1 | "use strict";
|
2 |
|
3 | var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4 | Object.defineProperty(exports, "__esModule", {
|
5 | value: true
|
6 | });
|
7 | exports.default = useSlotProps;
|
8 | var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
9 | var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
10 | var _utils = require("@mui/utils");
|
11 | var _appendOwnerState = _interopRequireDefault(require("./appendOwnerState"));
|
12 | var _mergeSlotProps = _interopRequireDefault(require("./mergeSlotProps"));
|
13 | var _resolveComponentProps = _interopRequireDefault(require("./resolveComponentProps"));
|
14 | const _excluded = ["elementType", "externalSlotProps", "ownerState"];
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 | function useSlotProps(parameters) {
|
24 | var _parameters$additiona;
|
25 | const {
|
26 | elementType,
|
27 | externalSlotProps,
|
28 | ownerState
|
29 | } = parameters,
|
30 | rest = (0, _objectWithoutPropertiesLoose2.default)(parameters, _excluded);
|
31 | const resolvedComponentsProps = (0, _resolveComponentProps.default)(externalSlotProps, ownerState);
|
32 | const {
|
33 | props: mergedProps,
|
34 | internalRef
|
35 | } = (0, _mergeSlotProps.default)((0, _extends2.default)({}, rest, {
|
36 | externalSlotProps: resolvedComponentsProps
|
37 | }));
|
38 | const ref = (0, _utils.unstable_useForkRef)(internalRef, resolvedComponentsProps == null ? void 0 : resolvedComponentsProps.ref, (_parameters$additiona = parameters.additionalProps) == null ? void 0 : _parameters$additiona.ref);
|
39 | const props = (0, _appendOwnerState.default)(elementType, (0, _extends2.default)({}, mergedProps, {
|
40 | ref
|
41 | }), ownerState);
|
42 | return props;
|
43 | } |
\ | No newline at end of file |