@mui/utils
Advanced tools
Comparing version 5.10.6 to 5.10.9
import PropTypes from 'prop-types'; | ||
export default function chainPropTypes<A, B>(propType1: PropTypes.Validator<A>, propType2: PropTypes.Validator<B>): PropTypes.Validator<A & B>; |
@@ -0,0 +0,0 @@ declare const ClassNameGenerator: { |
export { default } from './ClassNameGenerator'; |
export default function composeClasses<ClassKey extends string>(slots: Record<ClassKey, ReadonlyArray<string | false | undefined | null>>, getUtilityClass: (slot: string) => string, classes: Record<string, string> | undefined): Record<ClassKey, string>; |
export { default } from './composeClasses'; |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ export declare function isPlainObject(item: unknown): item is Record<keyof any, unknown>; |
import PropTypes from 'prop-types'; | ||
declare const elementAcceptingRef: PropTypes.Requireable<unknown>; | ||
export default elementAcceptingRef; |
import PropTypes from 'prop-types'; | ||
declare const _default: PropTypes.Validator<PropTypes.ReactComponentLike | null | undefined>; | ||
export default _default; |
import * as React from 'react'; | ||
import setRef from './setRef'; | ||
export default function useForkRef(refA, refB) { | ||
export default function useForkRef(...refs) { | ||
/** | ||
* This will create a new function if the ref props change and are defined. | ||
* This will create a new function if the refs passed to this hook change and are all defined. | ||
* This means react will call the old forkRef with `null` and the new forkRef | ||
@@ -10,11 +10,12 @@ * with the ref. Cleanup naturally emerges from this behavior. | ||
return React.useMemo(() => { | ||
if (refA == null && refB == null) { | ||
if (refs.every(ref => ref == null)) { | ||
return null; | ||
} | ||
return refValue => { | ||
setRef(refA, refValue); | ||
setRef(refB, refValue); | ||
}; | ||
}, [refA, refB]); | ||
return instance => { | ||
refs.forEach(ref => { | ||
setRef(ref, instance); | ||
}); | ||
}; // eslint-disable-next-line react-hooks/exhaustive-deps | ||
}, refs); | ||
} |
import { ValidationMap } from 'prop-types'; | ||
export default function exactProp<T>(propTypes: ValidationMap<T>): ValidationMap<T>; |
@@ -0,0 +0,0 @@ /** |
export declare type GlobalStateSlot = 'active' | 'checked' | 'completed' | 'disabled' | 'error' | 'expanded' | 'focused' | 'focusVisible' | 'required' | 'selected'; | ||
export default function generateUtilityClass(componentName: string, slot: string, globalStatePrefix?: string): string; |
export { default } from './generateUtilityClass'; | ||
export * from './generateUtilityClass'; |
export default function generateUtilityClasses<T extends string>(componentName: string, slots: T[], globalStatePrefix?: string): Record<T, string>; |
export { default } from './generateUtilityClasses'; |
@@ -0,0 +0,0 @@ import * as React from 'react'; |
export default function getScrollbarSize(doc: Document): number; |
export default function HTMLElementType(props: { | ||
[key: string]: unknown; | ||
}, propName: string, componentName: string, location: string, propFullName: string): Error | null; |
@@ -0,0 +0,0 @@ export { default as chainPropTypes } from './chainPropTypes'; |
@@ -1,2 +0,2 @@ | ||
/** @license MUI v5.10.6 | ||
/** @license MUI v5.10.9 | ||
* | ||
@@ -3,0 +3,0 @@ * This source code is licensed under the MIT license found in the |
@@ -0,0 +0,0 @@ export function getTypeByValue(value: any): any; |
export default function isMuiElement(element: any, muiNames: readonly string[]): boolean; |
@@ -1,2 +0,2 @@ | ||
/** @license MUI v5.10.6 | ||
/** @license MUI v5.10.9 | ||
* | ||
@@ -3,0 +3,0 @@ * This source code is licensed under the MIT license found in the |
import * as React from 'react'; | ||
import setRef from './setRef'; | ||
export default function useForkRef(refA, refB) { | ||
export default function useForkRef() { | ||
for (var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++) { | ||
refs[_key] = arguments[_key]; | ||
} | ||
/** | ||
* This will create a new function if the ref props change and are defined. | ||
* This will create a new function if the refs passed to this hook change and are all defined. | ||
* This means react will call the old forkRef with `null` and the new forkRef | ||
@@ -10,11 +14,14 @@ * with the ref. Cleanup naturally emerges from this behavior. | ||
return React.useMemo(function () { | ||
if (refA == null && refB == null) { | ||
if (refs.every(function (ref) { | ||
return ref == null; | ||
})) { | ||
return null; | ||
} | ||
return function (refValue) { | ||
setRef(refA, refValue); | ||
setRef(refB, refValue); | ||
}; | ||
}, [refA, refB]); | ||
return function (instance) { | ||
refs.forEach(function (ref) { | ||
setRef(ref, instance); | ||
}); | ||
}; // eslint-disable-next-line react-hooks/exhaustive-deps | ||
}, refs); | ||
} |
@@ -1,2 +0,2 @@ | ||
/** @license MUI v5.10.6 | ||
/** @license MUI v5.10.9 | ||
* | ||
@@ -3,0 +3,0 @@ * This source code is licensed under the MIT license found in the |
import * as React from 'react'; | ||
import setRef from './setRef'; | ||
export default function useForkRef(refA, refB) { | ||
export default function useForkRef(...refs) { | ||
/** | ||
* This will create a new function if the ref props change and are defined. | ||
* This will create a new function if the refs passed to this hook change and are all defined. | ||
* This means react will call the old forkRef with `null` and the new forkRef | ||
@@ -10,11 +10,12 @@ * with the ref. Cleanup naturally emerges from this behavior. | ||
return React.useMemo(() => { | ||
if (refA == null && refB == null) { | ||
if (refs.every(ref => ref == null)) { | ||
return null; | ||
} | ||
return refValue => { | ||
setRef(refA, refValue); | ||
setRef(refB, refValue); | ||
}; | ||
}, [refA, refB]); | ||
return instance => { | ||
refs.forEach(ref => { | ||
setRef(ref, instance); | ||
}); | ||
}; // eslint-disable-next-line react-hooks/exhaustive-deps | ||
}, refs); | ||
} |
export default function ownerDocument(node: Node | null | undefined): Document; |
export default function ownerWindow(node: Node | undefined): Window; |
{ | ||
"name": "@mui/utils", | ||
"version": "5.10.6", | ||
"version": "5.10.9", | ||
"private": false, | ||
@@ -5,0 +5,0 @@ "author": "MUI Team", |
declare const _default: any; | ||
export default _default; |
import PropTypes from 'prop-types'; | ||
declare const refType: PropTypes.Requireable<object>; | ||
export default refType; |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ import * as React from 'react'; |
@@ -0,0 +0,0 @@ /** |
export {}; |
import * as React from 'react'; | ||
export default function useForkRef<InstanceA, InstanceB>(refA: React.Ref<InstanceA> | null | undefined, refB: React.Ref<InstanceB> | null | undefined): React.Ref<InstanceA & InstanceB> | null; | ||
export default function useForkRef<Instance>(...refs: Array<React.Ref<Instance> | undefined>): React.RefCallback<Instance> | null; |
@@ -18,5 +18,5 @@ "use strict"; | ||
function useForkRef(refA, refB) { | ||
function useForkRef(...refs) { | ||
/** | ||
* This will create a new function if the ref props change and are defined. | ||
* This will create a new function if the refs passed to this hook change and are all defined. | ||
* This means react will call the old forkRef with `null` and the new forkRef | ||
@@ -26,11 +26,12 @@ * with the ref. Cleanup naturally emerges from this behavior. | ||
return React.useMemo(() => { | ||
if (refA == null && refB == null) { | ||
if (refs.every(ref => ref == null)) { | ||
return null; | ||
} | ||
return refValue => { | ||
(0, _setRef.default)(refA, refValue); | ||
(0, _setRef.default)(refB, refValue); | ||
}; | ||
}, [refA, refB]); | ||
return instance => { | ||
refs.forEach(ref => { | ||
(0, _setRef.default)(ref, instance); | ||
}); | ||
}; // eslint-disable-next-line react-hooks/exhaustive-deps | ||
}, refs); | ||
} |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ import * as React from 'react'; |
declare const usePreviousProps: (value: object) => object; | ||
export default usePreviousProps; |
declare const visuallyHidden: import('react').CSSProperties; | ||
export default visuallyHidden; |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
665819
4088