worked on GarageApp stuff
This commit is contained in:
parent
60aaf17af3
commit
eb606572b0
51919 changed files with 2168177 additions and 18 deletions
58
node_modules/@mui/material/esm/Tabs/ScrollbarSize.js
generated
vendored
Normal file
58
node_modules/@mui/material/esm/Tabs/ScrollbarSize.js
generated
vendored
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
'use client';
|
||||
|
||||
import * as React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import debounce from "../utils/debounce.js";
|
||||
import { ownerWindow, unstable_useEnhancedEffect as useEnhancedEffect } from "../utils/index.js";
|
||||
import { jsx as _jsx } from "react/jsx-runtime";
|
||||
const styles = {
|
||||
width: 99,
|
||||
height: 99,
|
||||
position: 'absolute',
|
||||
top: -9999,
|
||||
overflow: 'scroll'
|
||||
};
|
||||
|
||||
/**
|
||||
* @ignore - internal component.
|
||||
* The component originates from https://github.com/STORIS/react-scrollbar-size.
|
||||
* It has been moved into the core in order to minimize the bundle size.
|
||||
*/
|
||||
export default function ScrollbarSize(props) {
|
||||
const {
|
||||
onChange,
|
||||
...other
|
||||
} = props;
|
||||
const scrollbarHeight = React.useRef();
|
||||
const nodeRef = React.useRef(null);
|
||||
const setMeasurements = () => {
|
||||
scrollbarHeight.current = nodeRef.current.offsetHeight - nodeRef.current.clientHeight;
|
||||
};
|
||||
useEnhancedEffect(() => {
|
||||
const handleResize = debounce(() => {
|
||||
const prevHeight = scrollbarHeight.current;
|
||||
setMeasurements();
|
||||
if (prevHeight !== scrollbarHeight.current) {
|
||||
onChange(scrollbarHeight.current);
|
||||
}
|
||||
});
|
||||
const containerWindow = ownerWindow(nodeRef.current);
|
||||
containerWindow.addEventListener('resize', handleResize);
|
||||
return () => {
|
||||
handleResize.clear();
|
||||
containerWindow.removeEventListener('resize', handleResize);
|
||||
};
|
||||
}, [onChange]);
|
||||
React.useEffect(() => {
|
||||
setMeasurements();
|
||||
onChange(scrollbarHeight.current);
|
||||
}, [onChange]);
|
||||
return /*#__PURE__*/_jsx("div", {
|
||||
style: styles,
|
||||
...other,
|
||||
ref: nodeRef
|
||||
});
|
||||
}
|
||||
process.env.NODE_ENV !== "production" ? ScrollbarSize.propTypes = {
|
||||
onChange: PropTypes.func.isRequired
|
||||
} : void 0;
|
||||
Loading…
Add table
Add a link
Reference in a new issue