worked on GarageApp stuff
This commit is contained in:
parent
60aaf17af3
commit
eb606572b0
51919 changed files with 2168177 additions and 18 deletions
38
node_modules/@mui/utils/esm/useSlotProps/useSlotProps.js
generated
vendored
Normal file
38
node_modules/@mui/utils/esm/useSlotProps/useSlotProps.js
generated
vendored
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
'use client';
|
||||
|
||||
import useForkRef from "../useForkRef/index.js";
|
||||
import appendOwnerState from "../appendOwnerState/index.js";
|
||||
import mergeSlotProps from "../mergeSlotProps/index.js";
|
||||
import resolveComponentProps from "../resolveComponentProps/index.js";
|
||||
/**
|
||||
* @ignore - do not document.
|
||||
* Builds the props to be passed into the slot of an unstyled component.
|
||||
* It merges the internal props of the component with the ones supplied by the user, allowing to customize the behavior.
|
||||
* If the slot component is not a host component, it also merges in the `ownerState`.
|
||||
*
|
||||
* @param parameters.getSlotProps - A function that returns the props to be passed to the slot component.
|
||||
*/
|
||||
function useSlotProps(parameters) {
|
||||
const {
|
||||
elementType,
|
||||
externalSlotProps,
|
||||
ownerState,
|
||||
skipResolvingSlotProps = false,
|
||||
...other
|
||||
} = parameters;
|
||||
const resolvedComponentsProps = skipResolvingSlotProps ? {} : resolveComponentProps(externalSlotProps, ownerState);
|
||||
const {
|
||||
props: mergedProps,
|
||||
internalRef
|
||||
} = mergeSlotProps({
|
||||
...other,
|
||||
externalSlotProps: resolvedComponentsProps
|
||||
});
|
||||
const ref = useForkRef(internalRef, resolvedComponentsProps?.ref, parameters.additionalProps?.ref);
|
||||
const props = appendOwnerState(elementType, {
|
||||
...mergedProps,
|
||||
ref
|
||||
}, ownerState);
|
||||
return props;
|
||||
}
|
||||
export default useSlotProps;
|
||||
Loading…
Add table
Add a link
Reference in a new issue