1 line
15 KiB
JSON
1 line
15 KiB
JSON
{"ast":null,"code":"import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"children\", \"defaultHeight\", \"defaultWidth\", \"disableHeight\", \"disableWidth\", \"nonce\", \"onResize\", \"style\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { useForkRef, ownerWindow, useEventCallback, unstable_useEnhancedEffect as useEnhancedEffect } from '@mui/material/utils';\nimport createDetectElementResize from '../lib/createDetectElementResize'; // TODO replace with https://caniuse.com/resizeobserver.\n\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst GridAutoSizer = /*#__PURE__*/React.forwardRef(function AutoSizer(props, ref) {\n const {\n children,\n defaultHeight = null,\n defaultWidth = null,\n disableHeight = false,\n disableWidth = false,\n nonce,\n onResize,\n style\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n const [state, setState] = React.useState({\n height: defaultHeight,\n width: defaultWidth\n });\n const rootRef = React.useRef(null);\n const parentElement = React.useRef(null);\n const handleResize = useEventCallback(() => {\n // Guard against AutoSizer component being removed from the DOM immediately after being added.\n // This can result in invalid style values which can result in NaN values if we don't handle them.\n // See issue #150 for more context.\n if (parentElement.current) {\n const height = parentElement.current.offsetHeight || 0;\n const width = parentElement.current.offsetWidth || 0;\n const win = ownerWindow(parentElement.current);\n const computedStyle = win.getComputedStyle(parentElement.current);\n const paddingLeft = parseInt(computedStyle.paddingLeft, 10) || 0;\n const paddingRight = parseInt(computedStyle.paddingRight, 10) || 0;\n const paddingTop = parseInt(computedStyle.paddingTop, 10) || 0;\n const paddingBottom = parseInt(computedStyle.paddingBottom, 10) || 0;\n const newHeight = height - paddingTop - paddingBottom;\n const newWidth = width - paddingLeft - paddingRight;\n if (!disableHeight && state.height !== newHeight || !disableWidth && state.width !== newWidth) {\n setState({\n height: newHeight,\n width: newWidth\n });\n if (onResize) {\n onResize({\n height: newHeight,\n width: newWidth\n });\n }\n }\n }\n });\n useEnhancedEffect(() => {\n var _parentElement$curren;\n parentElement.current = rootRef.current.parentElement;\n if (!parentElement) {\n return undefined;\n }\n const win = ownerWindow((_parentElement$curren = parentElement.current) != null ? _parentElement$curren : undefined);\n const detectElementResize = createDetectElementResize(nonce, win);\n detectElementResize.addResizeListener(parentElement.current, handleResize);\n handleResize();\n return () => {\n detectElementResize.removeResizeListener(parentElement.current, handleResize);\n };\n }, [nonce, handleResize]); // Outer div should not force width/height since that may prevent containers from shrinking.\n // Inner component should overflow and use calculated width/height.\n // See issue #68 for more information.\n\n const outerStyle = {\n overflow: 'visible'\n };\n const childParams = {};\n if (!disableHeight) {\n outerStyle.height = 0;\n childParams.height = state.height;\n }\n if (!disableWidth) {\n outerStyle.width = 0;\n childParams.width = state.width;\n }\n const handleRef = useForkRef(rootRef, ref);\n return /*#__PURE__*/_jsx(\"div\", _extends({\n ref: handleRef,\n style: _extends({}, outerStyle, style)\n }, other, {\n children: state.height === null && state.width === null ? null : children(childParams)\n }));\n});\nprocess.env.NODE_ENV !== \"production\" ? GridAutoSizer.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the TypeScript types and run \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n\n /**\n * Function responsible for rendering children.\n * @param {AutoSizerSize} size The grid's size.\n * @returns {React.ReactNode} The children to render.\n */\n children: PropTypes.func.isRequired,\n /**\n * Default height to use for initial render; useful for SSR.\n * @default null\n */\n defaultHeight: PropTypes.number,\n /**\n * Default width to use for initial render; useful for SSR.\n * @default null\n */\n defaultWidth: PropTypes.number,\n /**\n * If `true`, disable dynamic :height property.\n * @default false\n */\n disableHeight: PropTypes.bool,\n /**\n * If `true`, disable dynamic :width property.\n * @default false\n */\n disableWidth: PropTypes.bool,\n /**\n * Nonce of the inlined stylesheet for Content Security Policy.\n */\n nonce: PropTypes.string,\n /**\n * Callback to be invoked on-resize.\n * @param {AutoSizerSize} size The grid's size.\n */\n onResize: PropTypes.func\n} : void 0;\nexport { GridAutoSizer };","map":{"version":3,"names":["_extends","_objectWithoutPropertiesLoose","_excluded","React","PropTypes","useForkRef","ownerWindow","useEventCallback","unstable_useEnhancedEffect","useEnhancedEffect","createDetectElementResize","jsx","_jsx","GridAutoSizer","forwardRef","AutoSizer","props","ref","children","defaultHeight","defaultWidth","disableHeight","disableWidth","nonce","onResize","style","other","state","setState","useState","height","width","rootRef","useRef","parentElement","handleResize","current","offsetHeight","offsetWidth","win","computedStyle","getComputedStyle","paddingLeft","parseInt","paddingRight","paddingTop","paddingBottom","newHeight","newWidth","_parentElement$curren","undefined","detectElementResize","addResizeListener","removeResizeListener","outerStyle","overflow","childParams","handleRef","process","env","NODE_ENV","propTypes","func","isRequired","number","bool","string"],"sources":["/home/gnx/Desktop/ETB/ETB-FrontEnd/node_modules/@mui/x-data-grid/components/GridAutoSizer.js"],"sourcesContent":["import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"children\", \"defaultHeight\", \"defaultWidth\", \"disableHeight\", \"disableWidth\", \"nonce\", \"onResize\", \"style\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { useForkRef, ownerWindow, useEventCallback, unstable_useEnhancedEffect as useEnhancedEffect } from '@mui/material/utils';\nimport createDetectElementResize from '../lib/createDetectElementResize'; // TODO replace with https://caniuse.com/resizeobserver.\n\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst GridAutoSizer = /*#__PURE__*/React.forwardRef(function AutoSizer(props, ref) {\n const {\n children,\n defaultHeight = null,\n defaultWidth = null,\n disableHeight = false,\n disableWidth = false,\n nonce,\n onResize,\n style\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n\n const [state, setState] = React.useState({\n height: defaultHeight,\n width: defaultWidth\n });\n const rootRef = React.useRef(null);\n const parentElement = React.useRef(null);\n const handleResize = useEventCallback(() => {\n // Guard against AutoSizer component being removed from the DOM immediately after being added.\n // This can result in invalid style values which can result in NaN values if we don't handle them.\n // See issue #150 for more context.\n if (parentElement.current) {\n const height = parentElement.current.offsetHeight || 0;\n const width = parentElement.current.offsetWidth || 0;\n const win = ownerWindow(parentElement.current);\n const computedStyle = win.getComputedStyle(parentElement.current);\n const paddingLeft = parseInt(computedStyle.paddingLeft, 10) || 0;\n const paddingRight = parseInt(computedStyle.paddingRight, 10) || 0;\n const paddingTop = parseInt(computedStyle.paddingTop, 10) || 0;\n const paddingBottom = parseInt(computedStyle.paddingBottom, 10) || 0;\n const newHeight = height - paddingTop - paddingBottom;\n const newWidth = width - paddingLeft - paddingRight;\n\n if (!disableHeight && state.height !== newHeight || !disableWidth && state.width !== newWidth) {\n setState({\n height: newHeight,\n width: newWidth\n });\n\n if (onResize) {\n onResize({\n height: newHeight,\n width: newWidth\n });\n }\n }\n }\n });\n useEnhancedEffect(() => {\n var _parentElement$curren;\n\n parentElement.current = rootRef.current.parentElement;\n\n if (!parentElement) {\n return undefined;\n }\n\n const win = ownerWindow((_parentElement$curren = parentElement.current) != null ? _parentElement$curren : undefined);\n const detectElementResize = createDetectElementResize(nonce, win);\n detectElementResize.addResizeListener(parentElement.current, handleResize);\n handleResize();\n return () => {\n detectElementResize.removeResizeListener(parentElement.current, handleResize);\n };\n }, [nonce, handleResize]); // Outer div should not force width/height since that may prevent containers from shrinking.\n // Inner component should overflow and use calculated width/height.\n // See issue #68 for more information.\n\n const outerStyle = {\n overflow: 'visible'\n };\n const childParams = {};\n\n if (!disableHeight) {\n outerStyle.height = 0;\n childParams.height = state.height;\n }\n\n if (!disableWidth) {\n outerStyle.width = 0;\n childParams.width = state.width;\n }\n\n const handleRef = useForkRef(rootRef, ref);\n return /*#__PURE__*/_jsx(\"div\", _extends({\n ref: handleRef,\n style: _extends({}, outerStyle, style)\n }, other, {\n children: state.height === null && state.width === null ? null : children(childParams)\n }));\n});\nprocess.env.NODE_ENV !== \"production\" ? GridAutoSizer.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the TypeScript types and run \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n\n /**\n * Function responsible for rendering children.\n * @param {AutoSizerSize} size The grid's size.\n * @returns {React.ReactNode} The children to render.\n */\n children: PropTypes.func.isRequired,\n\n /**\n * Default height to use for initial render; useful for SSR.\n * @default null\n */\n defaultHeight: PropTypes.number,\n\n /**\n * Default width to use for initial render; useful for SSR.\n * @default null\n */\n defaultWidth: PropTypes.number,\n\n /**\n * If `true`, disable dynamic :height property.\n * @default false\n */\n disableHeight: PropTypes.bool,\n\n /**\n * If `true`, disable dynamic :width property.\n * @default false\n */\n disableWidth: PropTypes.bool,\n\n /**\n * Nonce of the inlined stylesheet for Content Security Policy.\n */\n nonce: PropTypes.string,\n\n /**\n * Callback to be invoked on-resize.\n * @param {AutoSizerSize} size The grid's size.\n */\n onResize: PropTypes.func\n} : void 0;\nexport { GridAutoSizer };"],"mappings":"AAAA,OAAOA,QAAQ,MAAM,oCAAoC;AACzD,OAAOC,6BAA6B,MAAM,yDAAyD;AACnG,MAAMC,SAAS,GAAG,CAAC,UAAU,EAAE,eAAe,EAAE,cAAc,EAAE,eAAe,EAAE,cAAc,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,CAAC;AAC9H,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,OAAOC,SAAS,MAAM,YAAY;AAClC,SAASC,UAAU,EAAEC,WAAW,EAAEC,gBAAgB,EAAEC,0BAA0B,IAAIC,iBAAiB,QAAQ,qBAAqB;AAChI,OAAOC,yBAAyB,MAAM,kCAAkC,CAAC,CAAC;;AAE1E,SAASC,GAAG,IAAIC,IAAI,QAAQ,mBAAmB;AAC/C,MAAMC,aAAa,GAAG,aAAaV,KAAK,CAACW,UAAU,CAAC,SAASC,SAASA,CAACC,KAAK,EAAEC,GAAG,EAAE;EACjF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