Jesus sucks
This commit is contained in:
488
backend/frontend/node_modules/@mui/material/legacy/ButtonBase/ButtonBase.js
generated
vendored
Normal file
488
backend/frontend/node_modules/@mui/material/legacy/ButtonBase/ButtonBase.js
generated
vendored
Normal file
@@ -0,0 +1,488 @@
|
||||
'use client';
|
||||
|
||||
import _extends from "@babel/runtime/helpers/esm/extends";
|
||||
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
||||
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
||||
import * as React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import clsx from 'clsx';
|
||||
import refType from '@mui/utils/refType';
|
||||
import elementTypeAcceptingRef from '@mui/utils/elementTypeAcceptingRef';
|
||||
import composeClasses from '@mui/utils/composeClasses';
|
||||
import styled from '../styles/styled';
|
||||
import { useDefaultProps } from '../DefaultPropsProvider';
|
||||
import useForkRef from '../utils/useForkRef';
|
||||
import useEventCallback from '../utils/useEventCallback';
|
||||
import useIsFocusVisible from '../utils/useIsFocusVisible';
|
||||
import TouchRipple from './TouchRipple';
|
||||
import buttonBaseClasses, { getButtonBaseUtilityClass } from './buttonBaseClasses';
|
||||
import { jsx as _jsx } from "react/jsx-runtime";
|
||||
import { jsxs as _jsxs } from "react/jsx-runtime";
|
||||
var useUtilityClasses = function useUtilityClasses(ownerState) {
|
||||
var disabled = ownerState.disabled,
|
||||
focusVisible = ownerState.focusVisible,
|
||||
focusVisibleClassName = ownerState.focusVisibleClassName,
|
||||
classes = ownerState.classes;
|
||||
var slots = {
|
||||
root: ['root', disabled && 'disabled', focusVisible && 'focusVisible']
|
||||
};
|
||||
var composedClasses = composeClasses(slots, getButtonBaseUtilityClass, classes);
|
||||
if (focusVisible && focusVisibleClassName) {
|
||||
composedClasses.root += " ".concat(focusVisibleClassName);
|
||||
}
|
||||
return composedClasses;
|
||||
};
|
||||
export var ButtonBaseRoot = styled('button', {
|
||||
name: 'MuiButtonBase',
|
||||
slot: 'Root',
|
||||
overridesResolver: function overridesResolver(props, styles) {
|
||||
return styles.root;
|
||||
}
|
||||
})(_defineProperty(_defineProperty({
|
||||
display: 'inline-flex',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
position: 'relative',
|
||||
boxSizing: 'border-box',
|
||||
WebkitTapHighlightColor: 'transparent',
|
||||
backgroundColor: 'transparent',
|
||||
// Reset default value
|
||||
// We disable the focus ring for mouse, touch and keyboard users.
|
||||
outline: 0,
|
||||
border: 0,
|
||||
margin: 0,
|
||||
// Remove the margin in Safari
|
||||
borderRadius: 0,
|
||||
padding: 0,
|
||||
// Remove the padding in Firefox
|
||||
cursor: 'pointer',
|
||||
userSelect: 'none',
|
||||
verticalAlign: 'middle',
|
||||
MozAppearance: 'none',
|
||||
// Reset
|
||||
WebkitAppearance: 'none',
|
||||
// Reset
|
||||
textDecoration: 'none',
|
||||
// So we take precedent over the style of a native <a /> element.
|
||||
color: 'inherit',
|
||||
'&::-moz-focus-inner': {
|
||||
borderStyle: 'none' // Remove Firefox dotted outline.
|
||||
}
|
||||
}, "&.".concat(buttonBaseClasses.disabled), {
|
||||
pointerEvents: 'none',
|
||||
// Disable link interactions
|
||||
cursor: 'default'
|
||||
}), '@media print', {
|
||||
colorAdjust: 'exact'
|
||||
}));
|
||||
|
||||
/**
|
||||
* `ButtonBase` contains as few styles as possible.
|
||||
* It aims to be a simple building block for creating a button.
|
||||
* It contains a load of style reset and some focus/ripple logic.
|
||||
*/
|
||||
var ButtonBase = /*#__PURE__*/React.forwardRef(function ButtonBase(inProps, ref) {
|
||||
var props = useDefaultProps({
|
||||
props: inProps,
|
||||
name: 'MuiButtonBase'
|
||||
});
|
||||
var action = props.action,
|
||||
_props$centerRipple = props.centerRipple,
|
||||
centerRipple = _props$centerRipple === void 0 ? false : _props$centerRipple,
|
||||
children = props.children,
|
||||
className = props.className,
|
||||
_props$component = props.component,
|
||||
component = _props$component === void 0 ? 'button' : _props$component,
|
||||
_props$disabled = props.disabled,
|
||||
disabled = _props$disabled === void 0 ? false : _props$disabled,
|
||||
_props$disableRipple = props.disableRipple,
|
||||
disableRipple = _props$disableRipple === void 0 ? false : _props$disableRipple,
|
||||
_props$disableTouchRi = props.disableTouchRipple,
|
||||
disableTouchRipple = _props$disableTouchRi === void 0 ? false : _props$disableTouchRi,
|
||||
_props$focusRipple = props.focusRipple,
|
||||
focusRipple = _props$focusRipple === void 0 ? false : _props$focusRipple,
|
||||
focusVisibleClassName = props.focusVisibleClassName,
|
||||
_props$LinkComponent = props.LinkComponent,
|
||||
LinkComponent = _props$LinkComponent === void 0 ? 'a' : _props$LinkComponent,
|
||||
onBlur = props.onBlur,
|
||||
onClick = props.onClick,
|
||||
onContextMenu = props.onContextMenu,
|
||||
onDragLeave = props.onDragLeave,
|
||||
onFocus = props.onFocus,
|
||||
onFocusVisible = props.onFocusVisible,
|
||||
onKeyDown = props.onKeyDown,
|
||||
onKeyUp = props.onKeyUp,
|
||||
onMouseDown = props.onMouseDown,
|
||||
onMouseLeave = props.onMouseLeave,
|
||||
onMouseUp = props.onMouseUp,
|
||||
onTouchEnd = props.onTouchEnd,
|
||||
onTouchMove = props.onTouchMove,
|
||||
onTouchStart = props.onTouchStart,
|
||||
_props$tabIndex = props.tabIndex,
|
||||
tabIndex = _props$tabIndex === void 0 ? 0 : _props$tabIndex,
|
||||
TouchRippleProps = props.TouchRippleProps,
|
||||
touchRippleRef = props.touchRippleRef,
|
||||
type = props.type,
|
||||
other = _objectWithoutProperties(props, ["action", "centerRipple", "children", "className", "component", "disabled", "disableRipple", "disableTouchRipple", "focusRipple", "focusVisibleClassName", "LinkComponent", "onBlur", "onClick", "onContextMenu", "onDragLeave", "onFocus", "onFocusVisible", "onKeyDown", "onKeyUp", "onMouseDown", "onMouseLeave", "onMouseUp", "onTouchEnd", "onTouchMove", "onTouchStart", "tabIndex", "TouchRippleProps", "touchRippleRef", "type"]);
|
||||
var buttonRef = React.useRef(null);
|
||||
var rippleRef = React.useRef(null);
|
||||
var handleRippleRef = useForkRef(rippleRef, touchRippleRef);
|
||||
var _useIsFocusVisible = useIsFocusVisible(),
|
||||
isFocusVisibleRef = _useIsFocusVisible.isFocusVisibleRef,
|
||||
handleFocusVisible = _useIsFocusVisible.onFocus,
|
||||
handleBlurVisible = _useIsFocusVisible.onBlur,
|
||||
focusVisibleRef = _useIsFocusVisible.ref;
|
||||
var _React$useState = React.useState(false),
|
||||
focusVisible = _React$useState[0],
|
||||
setFocusVisible = _React$useState[1];
|
||||
if (disabled && focusVisible) {
|
||||
setFocusVisible(false);
|
||||
}
|
||||
React.useImperativeHandle(action, function () {
|
||||
return {
|
||||
focusVisible: function focusVisible() {
|
||||
setFocusVisible(true);
|
||||
buttonRef.current.focus();
|
||||
}
|
||||
};
|
||||
}, []);
|
||||
var _React$useState2 = React.useState(false),
|
||||
mountedState = _React$useState2[0],
|
||||
setMountedState = _React$useState2[1];
|
||||
React.useEffect(function () {
|
||||
setMountedState(true);
|
||||
}, []);
|
||||
var enableTouchRipple = mountedState && !disableRipple && !disabled;
|
||||
React.useEffect(function () {
|
||||
if (focusVisible && focusRipple && !disableRipple && mountedState) {
|
||||
rippleRef.current.pulsate();
|
||||
}
|
||||
}, [disableRipple, focusRipple, focusVisible, mountedState]);
|
||||
function useRippleHandler(rippleAction, eventCallback) {
|
||||
var skipRippleAction = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : disableTouchRipple;
|
||||
return useEventCallback(function (event) {
|
||||
if (eventCallback) {
|
||||
eventCallback(event);
|
||||
}
|
||||
var ignore = skipRippleAction;
|
||||
if (!ignore && rippleRef.current) {
|
||||
rippleRef.current[rippleAction](event);
|
||||
}
|
||||
return true;
|
||||
});
|
||||
}
|
||||
var handleMouseDown = useRippleHandler('start', onMouseDown);
|
||||
var handleContextMenu = useRippleHandler('stop', onContextMenu);
|
||||
var handleDragLeave = useRippleHandler('stop', onDragLeave);
|
||||
var handleMouseUp = useRippleHandler('stop', onMouseUp);
|
||||
var handleMouseLeave = useRippleHandler('stop', function (event) {
|
||||
if (focusVisible) {
|
||||
event.preventDefault();
|
||||
}
|
||||
if (onMouseLeave) {
|
||||
onMouseLeave(event);
|
||||
}
|
||||
});
|
||||
var handleTouchStart = useRippleHandler('start', onTouchStart);
|
||||
var handleTouchEnd = useRippleHandler('stop', onTouchEnd);
|
||||
var handleTouchMove = useRippleHandler('stop', onTouchMove);
|
||||
var handleBlur = useRippleHandler('stop', function (event) {
|
||||
handleBlurVisible(event);
|
||||
if (isFocusVisibleRef.current === false) {
|
||||
setFocusVisible(false);
|
||||
}
|
||||
if (onBlur) {
|
||||
onBlur(event);
|
||||
}
|
||||
}, false);
|
||||
var handleFocus = useEventCallback(function (event) {
|
||||
// Fix for https://github.com/facebook/react/issues/7769
|
||||
if (!buttonRef.current) {
|
||||
buttonRef.current = event.currentTarget;
|
||||
}
|
||||
handleFocusVisible(event);
|
||||
if (isFocusVisibleRef.current === true) {
|
||||
setFocusVisible(true);
|
||||
if (onFocusVisible) {
|
||||
onFocusVisible(event);
|
||||
}
|
||||
}
|
||||
if (onFocus) {
|
||||
onFocus(event);
|
||||
}
|
||||
});
|
||||
var isNonNativeButton = function isNonNativeButton() {
|
||||
var button = buttonRef.current;
|
||||
return component && component !== 'button' && !(button.tagName === 'A' && button.href);
|
||||
};
|
||||
|
||||
/**
|
||||
* IE11 shim for https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/repeat
|
||||
*/
|
||||
var keydownRef = React.useRef(false);
|
||||
var handleKeyDown = useEventCallback(function (event) {
|
||||
// Check if key is already down to avoid repeats being counted as multiple activations
|
||||
if (focusRipple && !keydownRef.current && focusVisible && rippleRef.current && event.key === ' ') {
|
||||
keydownRef.current = true;
|
||||
rippleRef.current.stop(event, function () {
|
||||
rippleRef.current.start(event);
|
||||
});
|
||||
}
|
||||
if (event.target === event.currentTarget && isNonNativeButton() && event.key === ' ') {
|
||||
event.preventDefault();
|
||||
}
|
||||
if (onKeyDown) {
|
||||
onKeyDown(event);
|
||||
}
|
||||
|
||||
// Keyboard accessibility for non interactive elements
|
||||
if (event.target === event.currentTarget && isNonNativeButton() && event.key === 'Enter' && !disabled) {
|
||||
event.preventDefault();
|
||||
if (onClick) {
|
||||
onClick(event);
|
||||
}
|
||||
}
|
||||
});
|
||||
var handleKeyUp = useEventCallback(function (event) {
|
||||
// calling preventDefault in keyUp on a <button> will not dispatch a click event if Space is pressed
|
||||
// https://codesandbox.io/p/sandbox/button-keyup-preventdefault-dn7f0
|
||||
if (focusRipple && event.key === ' ' && rippleRef.current && focusVisible && !event.defaultPrevented) {
|
||||
keydownRef.current = false;
|
||||
rippleRef.current.stop(event, function () {
|
||||
rippleRef.current.pulsate(event);
|
||||
});
|
||||
}
|
||||
if (onKeyUp) {
|
||||
onKeyUp(event);
|
||||
}
|
||||
|
||||
// Keyboard accessibility for non interactive elements
|
||||
if (onClick && event.target === event.currentTarget && isNonNativeButton() && event.key === ' ' && !event.defaultPrevented) {
|
||||
onClick(event);
|
||||
}
|
||||
});
|
||||
var ComponentProp = component;
|
||||
if (ComponentProp === 'button' && (other.href || other.to)) {
|
||||
ComponentProp = LinkComponent;
|
||||
}
|
||||
var buttonProps = {};
|
||||
if (ComponentProp === 'button') {
|
||||
buttonProps.type = type === undefined ? 'button' : type;
|
||||
buttonProps.disabled = disabled;
|
||||
} else {
|
||||
if (!other.href && !other.to) {
|
||||
buttonProps.role = 'button';
|
||||
}
|
||||
if (disabled) {
|
||||
buttonProps['aria-disabled'] = disabled;
|
||||
}
|
||||
}
|
||||
var handleRef = useForkRef(ref, focusVisibleRef, buttonRef);
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
// eslint-disable-next-line react-hooks/rules-of-hooks
|
||||
React.useEffect(function () {
|
||||
if (enableTouchRipple && !rippleRef.current) {
|
||||
console.error(['MUI: The `component` prop provided to ButtonBase is invalid.', 'Please make sure the children prop is rendered in this custom component.'].join('\n'));
|
||||
}
|
||||
}, [enableTouchRipple]);
|
||||
}
|
||||
var ownerState = _extends({}, props, {
|
||||
centerRipple: centerRipple,
|
||||
component: component,
|
||||
disabled: disabled,
|
||||
disableRipple: disableRipple,
|
||||
disableTouchRipple: disableTouchRipple,
|
||||
focusRipple: focusRipple,
|
||||
tabIndex: tabIndex,
|
||||
focusVisible: focusVisible
|
||||
});
|
||||
var classes = useUtilityClasses(ownerState);
|
||||
return /*#__PURE__*/_jsxs(ButtonBaseRoot, _extends({
|
||||
as: ComponentProp,
|
||||
className: clsx(classes.root, className),
|
||||
ownerState: ownerState,
|
||||
onBlur: handleBlur,
|
||||
onClick: onClick,
|
||||
onContextMenu: handleContextMenu,
|
||||
onFocus: handleFocus,
|
||||
onKeyDown: handleKeyDown,
|
||||
onKeyUp: handleKeyUp,
|
||||
onMouseDown: handleMouseDown,
|
||||
onMouseLeave: handleMouseLeave,
|
||||
onMouseUp: handleMouseUp,
|
||||
onDragLeave: handleDragLeave,
|
||||
onTouchEnd: handleTouchEnd,
|
||||
onTouchMove: handleTouchMove,
|
||||
onTouchStart: handleTouchStart,
|
||||
ref: handleRef,
|
||||
tabIndex: disabled ? -1 : tabIndex,
|
||||
type: type
|
||||
}, buttonProps, other, {
|
||||
children: [children, enableTouchRipple ?
|
||||
/*#__PURE__*/
|
||||
/* TouchRipple is only needed client-side, x2 boost on the server. */
|
||||
_jsx(TouchRipple, _extends({
|
||||
ref: handleRippleRef,
|
||||
center: centerRipple
|
||||
}, TouchRippleProps)) : null]
|
||||
}));
|
||||
});
|
||||
process.env.NODE_ENV !== "production" ? ButtonBase.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`. │
|
||||
// └─────────────────────────────────────────────────────────────────────┘
|
||||
/**
|
||||
* A ref for imperative actions.
|
||||
* It currently only supports `focusVisible()` action.
|
||||
*/
|
||||
action: refType,
|
||||
/**
|
||||
* If `true`, the ripples are centered.
|
||||
* They won't start at the cursor interaction position.
|
||||
* @default false
|
||||
*/
|
||||
centerRipple: PropTypes.bool,
|
||||
/**
|
||||
* The content of the component.
|
||||
*/
|
||||
children: PropTypes.node,
|
||||
/**
|
||||
* Override or extend the styles applied to the component.
|
||||
*/
|
||||
classes: PropTypes.object,
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
className: PropTypes.string,
|
||||
/**
|
||||
* The component used for the root node.
|
||||
* Either a string to use a HTML element or a component.
|
||||
*/
|
||||
component: elementTypeAcceptingRef,
|
||||
/**
|
||||
* If `true`, the component is disabled.
|
||||
* @default false
|
||||
*/
|
||||
disabled: PropTypes.bool,
|
||||
/**
|
||||
* If `true`, the ripple effect is disabled.
|
||||
*
|
||||
* ⚠️ Without a ripple there is no styling for :focus-visible by default. Be sure
|
||||
* to highlight the element by applying separate styles with the `.Mui-focusVisible` class.
|
||||
* @default false
|
||||
*/
|
||||
disableRipple: PropTypes.bool,
|
||||
/**
|
||||
* If `true`, the touch ripple effect is disabled.
|
||||
* @default false
|
||||
*/
|
||||
disableTouchRipple: PropTypes.bool,
|
||||
/**
|
||||
* If `true`, the base button will have a keyboard focus ripple.
|
||||
* @default false
|
||||
*/
|
||||
focusRipple: PropTypes.bool,
|
||||
/**
|
||||
* This prop can help identify which element has keyboard focus.
|
||||
* The class name will be applied when the element gains the focus through keyboard interaction.
|
||||
* It's a polyfill for the [CSS :focus-visible selector](https://drafts.csswg.org/selectors-4/#the-focus-visible-pseudo).
|
||||
* The rationale for using this feature [is explained here](https://github.com/WICG/focus-visible/blob/HEAD/explainer.md).
|
||||
* A [polyfill can be used](https://github.com/WICG/focus-visible) to apply a `focus-visible` class to other components
|
||||
* if needed.
|
||||
*/
|
||||
focusVisibleClassName: PropTypes.string,
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
href: PropTypes /* @typescript-to-proptypes-ignore */.any,
|
||||
/**
|
||||
* The component used to render a link when the `href` prop is provided.
|
||||
* @default 'a'
|
||||
*/
|
||||
LinkComponent: PropTypes.elementType,
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
onBlur: PropTypes.func,
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
onClick: PropTypes.func,
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
onContextMenu: PropTypes.func,
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
onDragLeave: PropTypes.func,
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
onFocus: PropTypes.func,
|
||||
/**
|
||||
* Callback fired when the component is focused with a keyboard.
|
||||
* We trigger a `onFocus` callback too.
|
||||
*/
|
||||
onFocusVisible: PropTypes.func,
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
onKeyDown: PropTypes.func,
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
onKeyUp: PropTypes.func,
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
onMouseDown: PropTypes.func,
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
onMouseLeave: PropTypes.func,
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
onMouseUp: PropTypes.func,
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
onTouchEnd: PropTypes.func,
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
onTouchMove: PropTypes.func,
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
onTouchStart: PropTypes.func,
|
||||
/**
|
||||
* The system prop that allows defining system overrides as well as additional CSS styles.
|
||||
*/
|
||||
sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object]),
|
||||
/**
|
||||
* @default 0
|
||||
*/
|
||||
tabIndex: PropTypes.number,
|
||||
/**
|
||||
* Props applied to the `TouchRipple` element.
|
||||
*/
|
||||
TouchRippleProps: PropTypes.object,
|
||||
/**
|
||||
* A ref that points to the `TouchRipple` element.
|
||||
*/
|
||||
touchRippleRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
|
||||
current: PropTypes.shape({
|
||||
pulsate: PropTypes.func.isRequired,
|
||||
start: PropTypes.func.isRequired,
|
||||
stop: PropTypes.func.isRequired
|
||||
})
|
||||
})]),
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
type: PropTypes.oneOfType([PropTypes.oneOf(['button', 'reset', 'submit']), PropTypes.string])
|
||||
} : void 0;
|
||||
export default ButtonBase;
|
||||
89
backend/frontend/node_modules/@mui/material/legacy/ButtonBase/Ripple.js
generated
vendored
Normal file
89
backend/frontend/node_modules/@mui/material/legacy/ButtonBase/Ripple.js
generated
vendored
Normal file
@@ -0,0 +1,89 @@
|
||||
'use client';
|
||||
|
||||
import * as React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import clsx from 'clsx';
|
||||
|
||||
/**
|
||||
* @ignore - internal component.
|
||||
*/
|
||||
import { jsx as _jsx } from "react/jsx-runtime";
|
||||
function Ripple(props) {
|
||||
var className = props.className,
|
||||
classes = props.classes,
|
||||
_props$pulsate = props.pulsate,
|
||||
pulsate = _props$pulsate === void 0 ? false : _props$pulsate,
|
||||
rippleX = props.rippleX,
|
||||
rippleY = props.rippleY,
|
||||
rippleSize = props.rippleSize,
|
||||
inProp = props.in,
|
||||
onExited = props.onExited,
|
||||
timeout = props.timeout;
|
||||
var _React$useState = React.useState(false),
|
||||
leaving = _React$useState[0],
|
||||
setLeaving = _React$useState[1];
|
||||
var rippleClassName = clsx(className, classes.ripple, classes.rippleVisible, pulsate && classes.ripplePulsate);
|
||||
var rippleStyles = {
|
||||
width: rippleSize,
|
||||
height: rippleSize,
|
||||
top: -(rippleSize / 2) + rippleY,
|
||||
left: -(rippleSize / 2) + rippleX
|
||||
};
|
||||
var childClassName = clsx(classes.child, leaving && classes.childLeaving, pulsate && classes.childPulsate);
|
||||
if (!inProp && !leaving) {
|
||||
setLeaving(true);
|
||||
}
|
||||
React.useEffect(function () {
|
||||
if (!inProp && onExited != null) {
|
||||
// react-transition-group#onExited
|
||||
var timeoutId = setTimeout(onExited, timeout);
|
||||
return function () {
|
||||
clearTimeout(timeoutId);
|
||||
};
|
||||
}
|
||||
return undefined;
|
||||
}, [onExited, inProp, timeout]);
|
||||
return /*#__PURE__*/_jsx("span", {
|
||||
className: rippleClassName,
|
||||
style: rippleStyles,
|
||||
children: /*#__PURE__*/_jsx("span", {
|
||||
className: childClassName
|
||||
})
|
||||
});
|
||||
}
|
||||
process.env.NODE_ENV !== "production" ? Ripple.propTypes = {
|
||||
/**
|
||||
* Override or extend the styles applied to the component.
|
||||
*/
|
||||
classes: PropTypes.object.isRequired,
|
||||
className: PropTypes.string,
|
||||
/**
|
||||
* @ignore - injected from TransitionGroup
|
||||
*/
|
||||
in: PropTypes.bool,
|
||||
/**
|
||||
* @ignore - injected from TransitionGroup
|
||||
*/
|
||||
onExited: PropTypes.func,
|
||||
/**
|
||||
* If `true`, the ripple pulsates, typically indicating the keyboard focus state of an element.
|
||||
*/
|
||||
pulsate: PropTypes.bool,
|
||||
/**
|
||||
* Diameter of the ripple.
|
||||
*/
|
||||
rippleSize: PropTypes.number,
|
||||
/**
|
||||
* Horizontal position of the ripple center.
|
||||
*/
|
||||
rippleX: PropTypes.number,
|
||||
/**
|
||||
* Vertical position of the ripple center.
|
||||
*/
|
||||
rippleY: PropTypes.number,
|
||||
/**
|
||||
* exit delay
|
||||
*/
|
||||
timeout: PropTypes.number.isRequired
|
||||
} : void 0;
|
||||
export default Ripple;
|
||||
268
backend/frontend/node_modules/@mui/material/legacy/ButtonBase/TouchRipple.js
generated
vendored
Normal file
268
backend/frontend/node_modules/@mui/material/legacy/ButtonBase/TouchRipple.js
generated
vendored
Normal file
@@ -0,0 +1,268 @@
|
||||
'use client';
|
||||
|
||||
import _extends from "@babel/runtime/helpers/esm/extends";
|
||||
import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
|
||||
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
||||
import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";
|
||||
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
||||
import * as React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { TransitionGroup } from 'react-transition-group';
|
||||
import clsx from 'clsx';
|
||||
import { keyframes } from '@mui/system';
|
||||
import useTimeout from '@mui/utils/useTimeout';
|
||||
import styled from '../styles/styled';
|
||||
import { useDefaultProps } from '../DefaultPropsProvider';
|
||||
import Ripple from './Ripple';
|
||||
import touchRippleClasses from './touchRippleClasses';
|
||||
import { jsx as _jsx } from "react/jsx-runtime";
|
||||
var DURATION = 550;
|
||||
export var DELAY_RIPPLE = 80;
|
||||
var enterKeyframe = keyframes(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n 0% {\n transform: scale(0);\n opacity: 0.1;\n }\n\n 100% {\n transform: scale(1);\n opacity: 0.3;\n }\n"])));
|
||||
var exitKeyframe = keyframes(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n 0% {\n opacity: 1;\n }\n\n 100% {\n opacity: 0;\n }\n"])));
|
||||
var pulsateKeyframe = keyframes(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n 0% {\n transform: scale(1);\n }\n\n 50% {\n transform: scale(0.92);\n }\n\n 100% {\n transform: scale(1);\n }\n"])));
|
||||
export var TouchRippleRoot = styled('span', {
|
||||
name: 'MuiTouchRipple',
|
||||
slot: 'Root'
|
||||
})({
|
||||
overflow: 'hidden',
|
||||
pointerEvents: 'none',
|
||||
position: 'absolute',
|
||||
zIndex: 0,
|
||||
top: 0,
|
||||
right: 0,
|
||||
bottom: 0,
|
||||
left: 0,
|
||||
borderRadius: 'inherit'
|
||||
});
|
||||
|
||||
// This `styled()` function invokes keyframes. `styled-components` only supports keyframes
|
||||
// in string templates. Do not convert these styles in JS object as it will break.
|
||||
export var TouchRippleRipple = styled(Ripple, {
|
||||
name: 'MuiTouchRipple',
|
||||
slot: 'Ripple'
|
||||
})(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n opacity: 0;\n position: absolute;\n\n &.", " {\n opacity: 0.3;\n transform: scale(1);\n animation-name: ", ";\n animation-duration: ", "ms;\n animation-timing-function: ", ";\n }\n\n &.", " {\n animation-duration: ", "ms;\n }\n\n & .", " {\n opacity: 1;\n display: block;\n width: 100%;\n height: 100%;\n border-radius: 50%;\n background-color: currentColor;\n }\n\n & .", " {\n opacity: 0;\n animation-name: ", ";\n animation-duration: ", "ms;\n animation-timing-function: ", ";\n }\n\n & .", " {\n position: absolute;\n /* @noflip */\n left: 0px;\n top: 0;\n animation-name: ", ";\n animation-duration: 2500ms;\n animation-timing-function: ", ";\n animation-iteration-count: infinite;\n animation-delay: 200ms;\n }\n"])), touchRippleClasses.rippleVisible, enterKeyframe, DURATION, function (_ref) {
|
||||
var theme = _ref.theme;
|
||||
return theme.transitions.easing.easeInOut;
|
||||
}, touchRippleClasses.ripplePulsate, function (_ref2) {
|
||||
var theme = _ref2.theme;
|
||||
return theme.transitions.duration.shorter;
|
||||
}, touchRippleClasses.child, touchRippleClasses.childLeaving, exitKeyframe, DURATION, function (_ref3) {
|
||||
var theme = _ref3.theme;
|
||||
return theme.transitions.easing.easeInOut;
|
||||
}, touchRippleClasses.childPulsate, pulsateKeyframe, function (_ref4) {
|
||||
var theme = _ref4.theme;
|
||||
return theme.transitions.easing.easeInOut;
|
||||
});
|
||||
|
||||
/**
|
||||
* @ignore - internal component.
|
||||
*
|
||||
* TODO v5: Make private
|
||||
*/
|
||||
var TouchRipple = /*#__PURE__*/React.forwardRef(function TouchRipple(inProps, ref) {
|
||||
var props = useDefaultProps({
|
||||
props: inProps,
|
||||
name: 'MuiTouchRipple'
|
||||
});
|
||||
var _props$center = props.center,
|
||||
centerProp = _props$center === void 0 ? false : _props$center,
|
||||
_props$classes = props.classes,
|
||||
classes = _props$classes === void 0 ? {} : _props$classes,
|
||||
className = props.className,
|
||||
other = _objectWithoutProperties(props, ["center", "classes", "className"]);
|
||||
var _React$useState = React.useState([]),
|
||||
ripples = _React$useState[0],
|
||||
setRipples = _React$useState[1];
|
||||
var nextKey = React.useRef(0);
|
||||
var rippleCallback = React.useRef(null);
|
||||
React.useEffect(function () {
|
||||
if (rippleCallback.current) {
|
||||
rippleCallback.current();
|
||||
rippleCallback.current = null;
|
||||
}
|
||||
}, [ripples]);
|
||||
|
||||
// Used to filter out mouse emulated events on mobile.
|
||||
var ignoringMouseDown = React.useRef(false);
|
||||
// We use a timer in order to only show the ripples for touch "click" like events.
|
||||
// We don't want to display the ripple for touch scroll events.
|
||||
var startTimer = useTimeout();
|
||||
|
||||
// This is the hook called once the previous timeout is ready.
|
||||
var startTimerCommit = React.useRef(null);
|
||||
var container = React.useRef(null);
|
||||
var startCommit = React.useCallback(function (params) {
|
||||
var pulsate = params.pulsate,
|
||||
rippleX = params.rippleX,
|
||||
rippleY = params.rippleY,
|
||||
rippleSize = params.rippleSize,
|
||||
cb = params.cb;
|
||||
setRipples(function (oldRipples) {
|
||||
return [].concat(_toConsumableArray(oldRipples), [/*#__PURE__*/_jsx(TouchRippleRipple, {
|
||||
classes: {
|
||||
ripple: clsx(classes.ripple, touchRippleClasses.ripple),
|
||||
rippleVisible: clsx(classes.rippleVisible, touchRippleClasses.rippleVisible),
|
||||
ripplePulsate: clsx(classes.ripplePulsate, touchRippleClasses.ripplePulsate),
|
||||
child: clsx(classes.child, touchRippleClasses.child),
|
||||
childLeaving: clsx(classes.childLeaving, touchRippleClasses.childLeaving),
|
||||
childPulsate: clsx(classes.childPulsate, touchRippleClasses.childPulsate)
|
||||
},
|
||||
timeout: DURATION,
|
||||
pulsate: pulsate,
|
||||
rippleX: rippleX,
|
||||
rippleY: rippleY,
|
||||
rippleSize: rippleSize
|
||||
}, nextKey.current)]);
|
||||
});
|
||||
nextKey.current += 1;
|
||||
rippleCallback.current = cb;
|
||||
}, [classes]);
|
||||
var start = React.useCallback(function () {
|
||||
var event = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
||||
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
||||
var cb = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : function () {};
|
||||
var _options$pulsate = options.pulsate,
|
||||
pulsate = _options$pulsate === void 0 ? false : _options$pulsate,
|
||||
_options$center = options.center,
|
||||
center = _options$center === void 0 ? centerProp || options.pulsate : _options$center,
|
||||
_options$fakeElement = options.fakeElement,
|
||||
fakeElement = _options$fakeElement === void 0 ? false : _options$fakeElement;
|
||||
if ((event == null ? void 0 : event.type) === 'mousedown' && ignoringMouseDown.current) {
|
||||
ignoringMouseDown.current = false;
|
||||
return;
|
||||
}
|
||||
if ((event == null ? void 0 : event.type) === 'touchstart') {
|
||||
ignoringMouseDown.current = true;
|
||||
}
|
||||
var element = fakeElement ? null : container.current;
|
||||
var rect = element ? element.getBoundingClientRect() : {
|
||||
width: 0,
|
||||
height: 0,
|
||||
left: 0,
|
||||
top: 0
|
||||
};
|
||||
|
||||
// Get the size of the ripple
|
||||
var rippleX;
|
||||
var rippleY;
|
||||
var rippleSize;
|
||||
if (center || event === undefined || event.clientX === 0 && event.clientY === 0 || !event.clientX && !event.touches) {
|
||||
rippleX = Math.round(rect.width / 2);
|
||||
rippleY = Math.round(rect.height / 2);
|
||||
} else {
|
||||
var _ref5 = event.touches && event.touches.length > 0 ? event.touches[0] : event,
|
||||
clientX = _ref5.clientX,
|
||||
clientY = _ref5.clientY;
|
||||
rippleX = Math.round(clientX - rect.left);
|
||||
rippleY = Math.round(clientY - rect.top);
|
||||
}
|
||||
if (center) {
|
||||
rippleSize = Math.sqrt((2 * Math.pow(rect.width, 2) + Math.pow(rect.height, 2)) / 3);
|
||||
|
||||
// For some reason the animation is broken on Mobile Chrome if the size is even.
|
||||
if (rippleSize % 2 === 0) {
|
||||
rippleSize += 1;
|
||||
}
|
||||
} else {
|
||||
var sizeX = Math.max(Math.abs((element ? element.clientWidth : 0) - rippleX), rippleX) * 2 + 2;
|
||||
var sizeY = Math.max(Math.abs((element ? element.clientHeight : 0) - rippleY), rippleY) * 2 + 2;
|
||||
rippleSize = Math.sqrt(Math.pow(sizeX, 2) + Math.pow(sizeY, 2));
|
||||
}
|
||||
|
||||
// Touche devices
|
||||
if (event != null && event.touches) {
|
||||
// check that this isn't another touchstart due to multitouch
|
||||
// otherwise we will only clear a single timer when unmounting while two
|
||||
// are running
|
||||
if (startTimerCommit.current === null) {
|
||||
// Prepare the ripple effect.
|
||||
startTimerCommit.current = function () {
|
||||
startCommit({
|
||||
pulsate: pulsate,
|
||||
rippleX: rippleX,
|
||||
rippleY: rippleY,
|
||||
rippleSize: rippleSize,
|
||||
cb: cb
|
||||
});
|
||||
};
|
||||
// Delay the execution of the ripple effect.
|
||||
// We have to make a tradeoff with this delay value.
|
||||
startTimer.start(DELAY_RIPPLE, function () {
|
||||
if (startTimerCommit.current) {
|
||||
startTimerCommit.current();
|
||||
startTimerCommit.current = null;
|
||||
}
|
||||
});
|
||||
}
|
||||
} else {
|
||||
startCommit({
|
||||
pulsate: pulsate,
|
||||
rippleX: rippleX,
|
||||
rippleY: rippleY,
|
||||
rippleSize: rippleSize,
|
||||
cb: cb
|
||||
});
|
||||
}
|
||||
}, [centerProp, startCommit, startTimer]);
|
||||
var pulsate = React.useCallback(function () {
|
||||
start({}, {
|
||||
pulsate: true
|
||||
});
|
||||
}, [start]);
|
||||
var stop = React.useCallback(function (event, cb) {
|
||||
startTimer.clear();
|
||||
|
||||
// The touch interaction occurs too quickly.
|
||||
// We still want to show ripple effect.
|
||||
if ((event == null ? void 0 : event.type) === 'touchend' && startTimerCommit.current) {
|
||||
startTimerCommit.current();
|
||||
startTimerCommit.current = null;
|
||||
startTimer.start(0, function () {
|
||||
stop(event, cb);
|
||||
});
|
||||
return;
|
||||
}
|
||||
startTimerCommit.current = null;
|
||||
setRipples(function (oldRipples) {
|
||||
if (oldRipples.length > 0) {
|
||||
return oldRipples.slice(1);
|
||||
}
|
||||
return oldRipples;
|
||||
});
|
||||
rippleCallback.current = cb;
|
||||
}, [startTimer]);
|
||||
React.useImperativeHandle(ref, function () {
|
||||
return {
|
||||
pulsate: pulsate,
|
||||
start: start,
|
||||
stop: stop
|
||||
};
|
||||
}, [pulsate, start, stop]);
|
||||
return /*#__PURE__*/_jsx(TouchRippleRoot, _extends({
|
||||
className: clsx(touchRippleClasses.root, classes.root, className),
|
||||
ref: container
|
||||
}, other, {
|
||||
children: /*#__PURE__*/_jsx(TransitionGroup, {
|
||||
component: null,
|
||||
exit: true,
|
||||
children: ripples
|
||||
})
|
||||
}));
|
||||
});
|
||||
process.env.NODE_ENV !== "production" ? TouchRipple.propTypes = {
|
||||
/**
|
||||
* If `true`, the ripple starts at the center of the component
|
||||
* rather than at the point of interaction.
|
||||
*/
|
||||
center: PropTypes.bool,
|
||||
/**
|
||||
* Override or extend the styles applied to the component.
|
||||
*/
|
||||
classes: PropTypes.object,
|
||||
/**
|
||||
* @ignore
|
||||
*/
|
||||
className: PropTypes.string
|
||||
} : void 0;
|
||||
export default TouchRipple;
|
||||
7
backend/frontend/node_modules/@mui/material/legacy/ButtonBase/buttonBaseClasses.js
generated
vendored
Normal file
7
backend/frontend/node_modules/@mui/material/legacy/ButtonBase/buttonBaseClasses.js
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
|
||||
import generateUtilityClass from '@mui/utils/generateUtilityClass';
|
||||
export function getButtonBaseUtilityClass(slot) {
|
||||
return generateUtilityClass('MuiButtonBase', slot);
|
||||
}
|
||||
var buttonBaseClasses = generateUtilityClasses('MuiButtonBase', ['root', 'disabled', 'focusVisible']);
|
||||
export default buttonBaseClasses;
|
||||
7
backend/frontend/node_modules/@mui/material/legacy/ButtonBase/index.js
generated
vendored
Normal file
7
backend/frontend/node_modules/@mui/material/legacy/ButtonBase/index.js
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
'use client';
|
||||
|
||||
export { default } from './ButtonBase';
|
||||
export { default as buttonBaseClasses } from './buttonBaseClasses';
|
||||
export * from './buttonBaseClasses';
|
||||
export { default as touchRippleClasses } from './touchRippleClasses';
|
||||
export * from './touchRippleClasses';
|
||||
7
backend/frontend/node_modules/@mui/material/legacy/ButtonBase/touchRippleClasses.js
generated
vendored
Normal file
7
backend/frontend/node_modules/@mui/material/legacy/ButtonBase/touchRippleClasses.js
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
import generateUtilityClasses from '@mui/utils/generateUtilityClasses';
|
||||
import generateUtilityClass from '@mui/utils/generateUtilityClass';
|
||||
export function getTouchRippleUtilityClass(slot) {
|
||||
return generateUtilityClass('MuiTouchRipple', slot);
|
||||
}
|
||||
var touchRippleClasses = generateUtilityClasses('MuiTouchRipple', ['root', 'ripple', 'rippleVisible', 'ripplePulsate', 'child', 'childLeaving', 'childPulsate']);
|
||||
export default touchRippleClasses;
|
||||
Reference in New Issue
Block a user