1 | import _extends from "@babel/runtime/helpers/esm/extends";
|
2 | import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
3 | const _excluded = ["elementType", "externalSlotProps", "ownerState"];
|
4 | import { unstable_useForkRef as useForkRef } from '@mui/utils';
|
5 | import appendOwnerState from './appendOwnerState';
|
6 | import mergeSlotProps from './mergeSlotProps';
|
7 | import resolveComponentProps from './resolveComponentProps';
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 | export default function useSlotProps(parameters) {
|
17 | var _parameters$additiona;
|
18 | const {
|
19 | elementType,
|
20 | externalSlotProps,
|
21 | ownerState
|
22 | } = parameters,
|
23 | rest = _objectWithoutPropertiesLoose(parameters, _excluded);
|
24 | const resolvedComponentsProps = resolveComponentProps(externalSlotProps, ownerState);
|
25 | const {
|
26 | props: mergedProps,
|
27 | internalRef
|
28 | } = mergeSlotProps(_extends({}, rest, {
|
29 | externalSlotProps: resolvedComponentsProps
|
30 | }));
|
31 | const ref = useForkRef(internalRef, resolvedComponentsProps == null ? void 0 : resolvedComponentsProps.ref, (_parameters$additiona = parameters.additionalProps) == null ? void 0 : _parameters$additiona.ref);
|
32 | const props = appendOwnerState(elementType, _extends({}, mergedProps, {
|
33 | ref
|
34 | }), ownerState);
|
35 | return props;
|
36 | } |
\ | No newline at end of file |