paradiego
This commit is contained in:
20
node_modules/@mui/utils/appendOwnerState/appendOwnerState.d.ts
generated
vendored
Normal file
20
node_modules/@mui/utils/appendOwnerState/appendOwnerState.d.ts
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
import * as React from 'react';
|
||||
import { Simplify } from '@mui/types';
|
||||
/**
|
||||
* Type of the ownerState based on the type of an element it applies to.
|
||||
* This resolves to the provided OwnerState for React components and `undefined` for host components.
|
||||
* Falls back to `OwnerState | undefined` when the exact type can't be determined in development time.
|
||||
*/
|
||||
type OwnerStateWhenApplicable<ElementType extends React.ElementType, OwnerState> = ElementType extends React.ComponentType<any> ? OwnerState : ElementType extends keyof React.JSX.IntrinsicElements ? undefined : OwnerState | undefined;
|
||||
export type AppendOwnerStateReturnType<ElementType extends React.ElementType, OtherProps, OwnerState> = Simplify<OtherProps & {
|
||||
ownerState: OwnerStateWhenApplicable<ElementType, OwnerState>;
|
||||
}>;
|
||||
/**
|
||||
* Appends the ownerState object to the props, merging with the existing one if necessary.
|
||||
*
|
||||
* @param elementType Type of the element that owns the `existingProps`. If the element is a DOM node or undefined, `ownerState` is not applied.
|
||||
* @param otherProps Props of the element.
|
||||
* @param ownerState
|
||||
*/
|
||||
declare function appendOwnerState<ElementType extends React.ElementType, OtherProps extends Record<string, any>, OwnerState>(elementType: ElementType | undefined, otherProps: OtherProps, ownerState: OwnerState): AppendOwnerStateReturnType<ElementType, OtherProps, OwnerState>;
|
||||
export default appendOwnerState;
|
||||
34
node_modules/@mui/utils/appendOwnerState/appendOwnerState.js
generated
vendored
Normal file
34
node_modules/@mui/utils/appendOwnerState/appendOwnerState.js
generated
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
"use strict";
|
||||
|
||||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
var _isHostComponent = _interopRequireDefault(require("../isHostComponent"));
|
||||
/**
|
||||
* Type of the ownerState based on the type of an element it applies to.
|
||||
* This resolves to the provided OwnerState for React components and `undefined` for host components.
|
||||
* Falls back to `OwnerState | undefined` when the exact type can't be determined in development time.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Appends the ownerState object to the props, merging with the existing one if necessary.
|
||||
*
|
||||
* @param elementType Type of the element that owns the `existingProps`. If the element is a DOM node or undefined, `ownerState` is not applied.
|
||||
* @param otherProps Props of the element.
|
||||
* @param ownerState
|
||||
*/
|
||||
function appendOwnerState(elementType, otherProps, ownerState) {
|
||||
if (elementType === undefined || (0, _isHostComponent.default)(elementType)) {
|
||||
return otherProps;
|
||||
}
|
||||
return {
|
||||
...otherProps,
|
||||
ownerState: {
|
||||
...otherProps.ownerState,
|
||||
...ownerState
|
||||
}
|
||||
};
|
||||
}
|
||||
var _default = exports.default = appendOwnerState;
|
||||
2
node_modules/@mui/utils/appendOwnerState/index.d.ts
generated
vendored
Normal file
2
node_modules/@mui/utils/appendOwnerState/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
export { default } from './appendOwnerState';
|
||||
export type { AppendOwnerStateReturnType } from './appendOwnerState';
|
||||
13
node_modules/@mui/utils/appendOwnerState/index.js
generated
vendored
Normal file
13
node_modules/@mui/utils/appendOwnerState/index.js
generated
vendored
Normal 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 _appendOwnerState.default;
|
||||
}
|
||||
});
|
||||
var _appendOwnerState = _interopRequireDefault(require("./appendOwnerState"));
|
||||
6
node_modules/@mui/utils/appendOwnerState/package.json
generated
vendored
Normal file
6
node_modules/@mui/utils/appendOwnerState/package.json
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"sideEffects": false,
|
||||
"module": "../esm/appendOwnerState/index.js",
|
||||
"main": "./index.js",
|
||||
"types": "./index.d.ts"
|
||||
}
|
||||
Reference in New Issue
Block a user