paradiego

This commit is contained in:
2024-09-18 13:34:19 -03:00
commit 3f0e204289
12510 changed files with 1486101 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
import * as React from 'react';
/**
* Returns the ref of a React node handling differences between React 19 and older versions.
* It will return null if the node is not a valid React element.
*
* @param element React.ReactNode
* @returns React.Ref<any> | null
*/
export default function getReactNodeRef(element: React.ReactNode): React.Ref<any> | null;

View File

@@ -0,0 +1,27 @@
"use strict";
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = getReactNodeRef;
var React = _interopRequireWildcard(require("react"));
/**
* Returns the ref of a React node handling differences between React 19 and older versions.
* It will return null if the node is not a valid React element.
*
* @param element React.ReactNode
* @returns React.Ref<any> | null
*/
function getReactNodeRef(element) {
if (!element || ! /*#__PURE__*/React.isValidElement(element)) {
return null;
}
// 'ref' is passed as prop in React 19, whereas 'ref' is directly attached to children in older versions
return element.props.propertyIsEnumerable('ref') ? element.props.ref :
// @ts-expect-error element.ref is not included in the ReactElement type
// We cannot check for it, but isValidElement is true at this point
// https://github.com/DefinitelyTyped/DefinitelyTyped/discussions/70189
element.ref;
}

1
node_modules/@mui/utils/getReactNodeRef/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1 @@
export { default } from './getReactNodeRef';

13
node_modules/@mui/utils/getReactNodeRef/index.js generated vendored Normal file
View File

@@ -0,0 +1,13 @@
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "default", {
enumerable: true,
get: function () {
return _getReactNodeRef.default;
}
});
var _getReactNodeRef = _interopRequireDefault(require("./getReactNodeRef"));

6
node_modules/@mui/utils/getReactNodeRef/package.json generated vendored Normal file
View File

@@ -0,0 +1,6 @@
{
"sideEffects": false,
"module": "../esm/getReactNodeRef/index.js",
"main": "./index.js",
"types": "./index.d.ts"
}