New source found from dndbeyond.com
This commit is contained in:
-2
@@ -1,2 +0,0 @@
|
||||
import createChainedFunction from '@mui/utils/createChainedFunction';
|
||||
export default createChainedFunction;
|
||||
-27
@@ -1,27 +0,0 @@
|
||||
'use client';
|
||||
|
||||
import _extends from "@babel/runtime/helpers/esm/extends";
|
||||
import * as React from 'react';
|
||||
import SvgIcon from '../SvgIcon';
|
||||
|
||||
/**
|
||||
* Private module reserved for @mui packages.
|
||||
*/
|
||||
import { jsx as _jsx } from "react/jsx-runtime";
|
||||
export default function createSvgIcon(path, displayName) {
|
||||
function Component(props, ref) {
|
||||
return /*#__PURE__*/_jsx(SvgIcon, _extends({
|
||||
"data-testid": `${displayName}Icon`,
|
||||
ref: ref
|
||||
}, props, {
|
||||
children: path
|
||||
}));
|
||||
}
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
// Need to set `displayName` on the inner component for React.memo.
|
||||
// React prior to 16.14 ignores `displayName` on the wrapper.
|
||||
Component.displayName = `${displayName}Icon`;
|
||||
}
|
||||
Component.muiName = SvgIcon.muiName;
|
||||
return /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(Component));
|
||||
}
|
||||
-2
@@ -1,2 +0,0 @@
|
||||
import deprecatedPropType from '@mui/utils/deprecatedPropType';
|
||||
export default deprecatedPropType;
|
||||
-30
@@ -1,30 +0,0 @@
|
||||
'use client';
|
||||
|
||||
import { unstable_ClassNameGenerator as ClassNameGenerator } from '@mui/base/ClassNameGenerator';
|
||||
export { default as capitalize } from './capitalize';
|
||||
export { default as createChainedFunction } from './createChainedFunction';
|
||||
export { default as createSvgIcon } from './createSvgIcon';
|
||||
export { default as debounce } from './debounce';
|
||||
export { default as deprecatedPropType } from './deprecatedPropType';
|
||||
export { default as isMuiElement } from './isMuiElement';
|
||||
export { default as ownerDocument } from './ownerDocument';
|
||||
export { default as ownerWindow } from './ownerWindow';
|
||||
export { default as requirePropFactory } from './requirePropFactory';
|
||||
export { default as setRef } from './setRef';
|
||||
export { default as unstable_useEnhancedEffect } from './useEnhancedEffect';
|
||||
export { default as unstable_useId } from './useId';
|
||||
export { default as unsupportedProp } from './unsupportedProp';
|
||||
export { default as useControlled } from './useControlled';
|
||||
export { default as useEventCallback } from './useEventCallback';
|
||||
export { default as useForkRef } from './useForkRef';
|
||||
export { default as useIsFocusVisible } from './useIsFocusVisible';
|
||||
// TODO: remove this export once ClassNameGenerator is stable
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||
export const unstable_ClassNameGenerator = {
|
||||
configure: generator => {
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
console.warn(['MUI: `ClassNameGenerator` import from `@mui/material/utils` is outdated and might cause unexpected issues.', '', "You should use `import { unstable_ClassNameGenerator } from '@mui/material/className'` instead", '', 'The detail of the issue: https://github.com/mui/material-ui/issues/30011#issuecomment-1024993401', '', 'The updated documentation: https://mui.com/guides/classname-generator/'].join('\n'));
|
||||
}
|
||||
ClassNameGenerator.configure(generator);
|
||||
}
|
||||
};
|
||||
-2
@@ -1,2 +0,0 @@
|
||||
import isMuiElement from '@mui/utils/isMuiElement';
|
||||
export default isMuiElement;
|
||||
-2
@@ -1,2 +0,0 @@
|
||||
import requirePropFactory from '@mui/utils/requirePropFactory';
|
||||
export default requirePropFactory;
|
||||
-2
@@ -1,2 +0,0 @@
|
||||
import setRef from '@mui/utils/setRef';
|
||||
export default setRef;
|
||||
-2
@@ -1,2 +0,0 @@
|
||||
import unsupportedProp from '@mui/utils/unsupportedProp';
|
||||
export default unsupportedProp;
|
||||
-4
@@ -1,4 +0,0 @@
|
||||
'use client';
|
||||
|
||||
import useControlled from '@mui/utils/useControlled';
|
||||
export default useControlled;
|
||||
-4
@@ -1,4 +0,0 @@
|
||||
'use client';
|
||||
|
||||
import useId from '@mui/utils/useId';
|
||||
export default useId;
|
||||
-82
@@ -1,82 +0,0 @@
|
||||
'use client';
|
||||
|
||||
import _extends from "@babel/runtime/helpers/esm/extends";
|
||||
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
||||
const _excluded = ["className", "elementType", "ownerState", "externalForwardedProps", "getSlotOwnerState", "internalForwardedProps"],
|
||||
_excluded2 = ["component", "slots", "slotProps"],
|
||||
_excluded3 = ["component"];
|
||||
import useForkRef from '@mui/utils/useForkRef';
|
||||
import { appendOwnerState, resolveComponentProps, mergeSlotProps } from '@mui/base/utils';
|
||||
/**
|
||||
* An internal function to create a Material UI slot.
|
||||
*
|
||||
* This is an advanced version of Base UI `useSlotProps` because Material UI allows leaf component to be customized via `component` prop
|
||||
* while Base UI does not need to support leaf component customization.
|
||||
*
|
||||
* @param {string} name: name of the slot
|
||||
* @param {object} parameters
|
||||
* @returns {[Slot, slotProps]} The slot's React component and the slot's props
|
||||
*
|
||||
* Note: the returned slot's props
|
||||
* - will never contain `component` prop.
|
||||
* - might contain `as` prop.
|
||||
*/
|
||||
export default function useSlot(
|
||||
/**
|
||||
* The slot's name. All Material UI components should have `root` slot.
|
||||
*
|
||||
* If the name is `root`, the logic behaves differently from other slots,
|
||||
* e.g. the `externalForwardedProps` are spread to `root` slot but not other slots.
|
||||
*/
|
||||
name, parameters) {
|
||||
const {
|
||||
className,
|
||||
elementType: initialElementType,
|
||||
ownerState,
|
||||
externalForwardedProps,
|
||||
getSlotOwnerState,
|
||||
internalForwardedProps
|
||||
} = parameters,
|
||||
useSlotPropsParams = _objectWithoutPropertiesLoose(parameters, _excluded);
|
||||
const {
|
||||
component: rootComponent,
|
||||
slots = {
|
||||
[name]: undefined
|
||||
},
|
||||
slotProps = {
|
||||
[name]: undefined
|
||||
}
|
||||
} = externalForwardedProps,
|
||||
other = _objectWithoutPropertiesLoose(externalForwardedProps, _excluded2);
|
||||
const elementType = slots[name] || initialElementType;
|
||||
|
||||
// `slotProps[name]` can be a callback that receives the component's ownerState.
|
||||
// `resolvedComponentsProps` is always a plain object.
|
||||
const resolvedComponentsProps = resolveComponentProps(slotProps[name], ownerState);
|
||||
const _mergeSlotProps = mergeSlotProps(_extends({
|
||||
className
|
||||
}, useSlotPropsParams, {
|
||||
externalForwardedProps: name === 'root' ? other : undefined,
|
||||
externalSlotProps: resolvedComponentsProps
|
||||
})),
|
||||
{
|
||||
props: {
|
||||
component: slotComponent
|
||||
},
|
||||
internalRef
|
||||
} = _mergeSlotProps,
|
||||
mergedProps = _objectWithoutPropertiesLoose(_mergeSlotProps.props, _excluded3);
|
||||
const ref = useForkRef(internalRef, resolvedComponentsProps == null ? void 0 : resolvedComponentsProps.ref, parameters.ref);
|
||||
const slotOwnerState = getSlotOwnerState ? getSlotOwnerState(mergedProps) : {};
|
||||
const finalOwnerState = _extends({}, ownerState, slotOwnerState);
|
||||
const LeafComponent = name === 'root' ? slotComponent || rootComponent : slotComponent;
|
||||
const props = appendOwnerState(elementType, _extends({}, name === 'root' && !rootComponent && !slots[name] && internalForwardedProps, name !== 'root' && !slots[name] && internalForwardedProps, mergedProps, LeafComponent && {
|
||||
as: LeafComponent
|
||||
}, {
|
||||
ref
|
||||
}), finalOwnerState);
|
||||
Object.keys(slotOwnerState).forEach(propName => {
|
||||
delete props[propName];
|
||||
});
|
||||
return [elementType, props];
|
||||
}
|
||||
Reference in New Issue
Block a user