pre-installations and preparations
This commit is contained in:
1 parent
3e5a0329cb
commit
201d621ac3
6977 files changed
+742826
No files matched your search
+14756
File diff suppressed because it is too large.
Load diff
+6
@@ -0,0 +1,6 @@
|
||||
declare const ClassNameGenerator: {
|
||||
configure(generator: (componentName: string) => string): void;
|
||||
generate(componentName: string): string;
|
||||
reset(): void;
|
||||
};
|
||||
export default ClassNameGenerator;
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
const defaultGenerator = componentName => componentName;
|
||||
const createClassNameGenerator = () => {
|
||||
let generate = defaultGenerator;
|
||||
return {
|
||||
configure(generator) {
|
||||
generate = generator;
|
||||
},
|
||||
generate(componentName) {
|
||||
return generate(componentName);
|
||||
},
|
||||
reset() {
|
||||
generate = defaultGenerator;
|
||||
}
|
||||
};
|
||||
};
|
||||
const ClassNameGenerator = createClassNameGenerator();
|
||||
export default ClassNameGenerator;
|
||||
+1
@@ -0,0 +1 @@
|
||||
export { default } from './ClassNameGenerator';
|
||||
+1
@@ -0,0 +1 @@
|
||||
export { default } from './ClassNameGenerator';
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"sideEffects": false,
|
||||
"module": "./index.js",
|
||||
"main": "../node/ClassNameGenerator/index.js",
|
||||
"types": "./index.d.ts"
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
export default function HTMLElementType(props: {
|
||||
[key: string]: unknown;
|
||||
}, propName: string, componentName: string, location: string, propFullName: string): Error | null;
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
export default function HTMLElementType(props, propName, componentName, location, propFullName) {
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
return null;
|
||||
}
|
||||
const propValue = props[propName];
|
||||
const safePropName = propFullName || propName;
|
||||
if (propValue == null) {
|
||||
return null;
|
||||
}
|
||||
if (propValue && propValue.nodeType !== 1) {
|
||||
return new Error(`Invalid ${location} \`${safePropName}\` supplied to \`${componentName}\`. ` + `Expected an HTMLElement.`);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
export { default } from './HTMLElementType';
|
||||
+1
@@ -0,0 +1 @@
|
||||
export { default } from './HTMLElementType';
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"sideEffects": false,
|
||||
"module": "./index.js",
|
||||
"main": "../node/HTMLElementType/index.js",
|
||||
"types": "./index.d.ts"
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014 Call-Em-All
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
# @mui/utils
|
||||
|
||||
Shared utilities used by MUI packages.
|
||||
+1
@@ -0,0 +1 @@
|
||||
export default function capitalize(string: string): string;
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
import _formatMuiErrorMessage from "@mui/utils/formatMuiErrorMessage";
|
||||
// It should to be noted that this function isn't equivalent to `text-transform: capitalize`.
|
||||
//
|
||||
// A strict capitalization should uppercase the first letter of each word in the sentence.
|
||||
// We only handle the first word.
|
||||
export default function capitalize(string) {
|
||||
if (typeof string !== 'string') {
|
||||
throw new Error(process.env.NODE_ENV !== "production" ? `MUI: \`capitalize(string)\` expects a string argument.` : _formatMuiErrorMessage(7));
|
||||
}
|
||||
return string.charAt(0).toUpperCase() + string.slice(1);
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
export { default } from './capitalize';
|
||||
+1
@@ -0,0 +1 @@
|
||||
export { default } from './capitalize';
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"sideEffects": false,
|
||||
"module": "./index.js",
|
||||
"main": "../node/capitalize/index.js",
|
||||
"types": "./index.d.ts"
|
||||
}
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
import PropTypes from 'prop-types';
|
||||
export default function chainPropTypes<A, B>(propType1: PropTypes.Validator<A>, propType2: PropTypes.Validator<B>): PropTypes.Validator<A & B>;
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
export default function chainPropTypes(propType1, propType2) {
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
return () => null;
|
||||
}
|
||||
return function validate(...args) {
|
||||
return propType1(...args) || propType2(...args);
|
||||
};
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
export { default } from './chainPropTypes';
|
||||
+1
@@ -0,0 +1 @@
|
||||
export { default } from './chainPropTypes';
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"sideEffects": false,
|
||||
"module": "./index.js",
|
||||
"main": "../node/chainPropTypes/index.js",
|
||||
"types": "./index.d.ts"
|
||||
}
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
declare function clamp(val: number, min?: number, max?: number): number;
|
||||
export default clamp;
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
function clamp(val, min = Number.MIN_SAFE_INTEGER, max = Number.MAX_SAFE_INTEGER) {
|
||||
return Math.max(min, Math.min(val, max));
|
||||
}
|
||||
export default clamp;
|
||||
+1
@@ -0,0 +1 @@
|
||||
export { default } from './clamp';
|
||||
+1
@@ -0,0 +1 @@
|
||||
export { default } from './clamp';
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"sideEffects": false,
|
||||
"module": "./index.js",
|
||||
"main": "../node/clamp/index.js",
|
||||
"types": "./index.d.ts"
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
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>;
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
export default function composeClasses(slots, getUtilityClass, classes = undefined) {
|
||||
const output = {};
|
||||
Object.keys(slots).forEach(
|
||||
// `Object.keys(slots)` can't be wider than `T` because we infer `T` from `slots`.
|
||||
// @ts-expect-error https://github.com/microsoft/TypeScript/pull/12253#issuecomment-263132208
|
||||
slot => {
|
||||
output[slot] = slots[slot].reduce((acc, key) => {
|
||||
if (key) {
|
||||
const utilityClass = getUtilityClass(key);
|
||||
if (utilityClass !== '') {
|
||||
acc.push(utilityClass);
|
||||
}
|
||||
if (classes && classes[key]) {
|
||||
acc.push(classes[key]);
|
||||
}
|
||||
}
|
||||
return acc;
|
||||
}, []).join(' ');
|
||||
});
|
||||
return output;
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
export { default } from './composeClasses';
|
||||
+1
@@ -0,0 +1 @@
|
||||
export { default } from './composeClasses';
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"sideEffects": false,
|
||||
"module": "./index.js",
|
||||
"main": "../node/composeClasses/index.js",
|
||||
"types": "./index.d.ts"
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
/**
|
||||
* Safe chained function.
|
||||
*
|
||||
* Will only create a new function if needed,
|
||||
* otherwise will pass back existing functions or null.
|
||||
*/
|
||||
export default function createChainedFunction<Args extends any[], This>(...funcs: Array<(this: This, ...args: Args) => any>): (this: This, ...args: Args) => void;
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
/**
|
||||
* Safe chained function.
|
||||
*
|
||||
* Will only create a new function if needed,
|
||||
* otherwise will pass back existing functions or null.
|
||||
*/
|
||||
export default function createChainedFunction(...funcs) {
|
||||
return funcs.reduce((acc, func) => {
|
||||
if (func == null) {
|
||||
return acc;
|
||||
}
|
||||
return function chainedFunction(...args) {
|
||||
acc.apply(this, args);
|
||||
func.apply(this, args);
|
||||
};
|
||||
}, () => {});
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
export { default } from './createChainedFunction';
|
||||
+1
@@ -0,0 +1 @@
|
||||
export { default } from './createChainedFunction';
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"sideEffects": false,
|
||||
"module": "./index.js",
|
||||
"main": "../node/createChainedFunction/index.js",
|
||||
"types": "./index.d.ts"
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
export interface Cancelable {
|
||||
clear(): void;
|
||||
}
|
||||
export default function debounce<T extends (...args: any[]) => any>(func: T, wait?: number): T & Cancelable;
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
// Corresponds to 10 frames at 60 Hz.
|
||||
// A few bytes payload overhead when lodash/debounce is ~3 kB and debounce ~300 B.
|
||||
export default function debounce(func, wait = 166) {
|
||||
let timeout;
|
||||
function debounced(...args) {
|
||||
const later = () => {
|
||||
// @ts-ignore
|
||||
func.apply(this, args);
|
||||
};
|
||||
clearTimeout(timeout);
|
||||
timeout = setTimeout(later, wait);
|
||||
}
|
||||
debounced.clear = () => {
|
||||
clearTimeout(timeout);
|
||||
};
|
||||
return debounced;
|
||||
}
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
export { default } from './debounce';
|
||||
export * from './debounce';
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
export { default } from './debounce';
|
||||
export * from './debounce';
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"sideEffects": false,
|
||||
"module": "./index.js",
|
||||
"main": "../node/debounce/index.js",
|
||||
"types": "./index.d.ts"
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
export declare function isPlainObject(item: unknown): item is Record<keyof any, unknown>;
|
||||
export interface DeepmergeOptions {
|
||||
clone?: boolean;
|
||||
}
|
||||
export default function deepmerge<T>(target: T, source: unknown, options?: DeepmergeOptions): T;
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
import _extends from "@babel/runtime/helpers/esm/extends";
|
||||
// https://github.com/sindresorhus/is-plain-obj/blob/main/index.js
|
||||
export function isPlainObject(item) {
|
||||
if (typeof item !== 'object' || item === null) {
|
||||
return false;
|
||||
}
|
||||
const prototype = Object.getPrototypeOf(item);
|
||||
return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in item) && !(Symbol.iterator in item);
|
||||
}
|
||||
function deepClone(source) {
|
||||
if (!isPlainObject(source)) {
|
||||
return source;
|
||||
}
|
||||
const output = {};
|
||||
Object.keys(source).forEach(key => {
|
||||
output[key] = deepClone(source[key]);
|
||||
});
|
||||
return output;
|
||||
}
|
||||
export default function deepmerge(target, source, options = {
|
||||
clone: true
|
||||
}) {
|
||||
const output = options.clone ? _extends({}, target) : target;
|
||||
if (isPlainObject(target) && isPlainObject(source)) {
|
||||
Object.keys(source).forEach(key => {
|
||||
// Avoid prototype pollution
|
||||
if (key === '__proto__') {
|
||||
return;
|
||||
}
|
||||
if (isPlainObject(source[key]) && key in target && isPlainObject(target[key])) {
|
||||
// Since `output` is a clone of `target` and we have narrowed `target` in this block we can cast to the same type.
|
||||
output[key] = deepmerge(target[key], source[key], options);
|
||||
} else if (options.clone) {
|
||||
output[key] = isPlainObject(source[key]) ? deepClone(source[key]) : source[key];
|
||||
} else {
|
||||
output[key] = source[key];
|
||||
}
|
||||
});
|
||||
}
|
||||
return output;
|
||||
}
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
export { default } from './deepmerge';
|
||||
export * from './deepmerge';
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
export { default } from './deepmerge';
|
||||
export * from './deepmerge';
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"sideEffects": false,
|
||||
"module": "./index.js",
|
||||
"main": "../node/deepmerge/index.js",
|
||||
"types": "./index.d.ts"
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
export default function deprecatedPropType<T>(validator: T, reason: string): T;
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
export default function deprecatedPropType(validator, reason) {
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
return () => null;
|
||||
}
|
||||
return (props, propName, componentName, location, propFullName) => {
|
||||
const componentNameSafe = componentName || '<<anonymous>>';
|
||||
const propFullNameSafe = propFullName || propName;
|
||||
if (typeof props[propName] !== 'undefined') {
|
||||
return new Error(`The ${location} \`${propFullNameSafe}\` of ` + `\`${componentNameSafe}\` is deprecated. ${reason}`);
|
||||
}
|
||||
return null;
|
||||
};
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
export { default } from './deprecatedPropType';
|
||||
+1
@@ -0,0 +1 @@
|
||||
export { default } from './deprecatedPropType';
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"sideEffects": false,
|
||||
"module": "./index.js",
|
||||
"main": "../node/deprecatedPropType/index.js",
|
||||
"types": "./index.d.ts"
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
import PropTypes from 'prop-types';
|
||||
declare const elementAcceptingRef: PropTypes.Requireable<unknown>;
|
||||
export default elementAcceptingRef;
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
import PropTypes from 'prop-types';
|
||||
import chainPropTypes from '../chainPropTypes';
|
||||
function isClassComponent(elementType) {
|
||||
// elementType.prototype?.isReactComponent
|
||||
const {
|
||||
prototype = {}
|
||||
} = elementType;
|
||||
return Boolean(prototype.isReactComponent);
|
||||
}
|
||||
function acceptingRef(props, propName, componentName, location, propFullName) {
|
||||
const element = props[propName];
|
||||
const safePropName = propFullName || propName;
|
||||
if (element == null ||
|
||||
// When server-side rendering React doesn't warn either.
|
||||
// This is not an accurate check for SSR.
|
||||
// This is only in place for Emotion compat.
|
||||
// TODO: Revisit once https://github.com/facebook/react/issues/20047 is resolved.
|
||||
typeof window === 'undefined') {
|
||||
return null;
|
||||
}
|
||||
let warningHint;
|
||||
const elementType = element.type;
|
||||
/**
|
||||
* Blacklisting instead of whitelisting
|
||||
*
|
||||
* Blacklisting will miss some components, such as React.Fragment. Those will at least
|
||||
* trigger a warning in React.
|
||||
* We can't whitelist because there is no safe way to detect React.forwardRef
|
||||
* or class components. "Safe" means there's no public API.
|
||||
*
|
||||
*/
|
||||
if (typeof elementType === 'function' && !isClassComponent(elementType)) {
|
||||
warningHint = 'Did you accidentally use a plain function component for an element instead?';
|
||||
}
|
||||
if (warningHint !== undefined) {
|
||||
return new Error(`Invalid ${location} \`${safePropName}\` supplied to \`${componentName}\`. ` + `Expected an element that can hold a ref. ${warningHint} ` + 'For more information see https://mui.com/r/caveat-with-refs-guide');
|
||||
}
|
||||
return null;
|
||||
}
|
||||
const elementAcceptingRef = chainPropTypes(PropTypes.element, acceptingRef);
|
||||
elementAcceptingRef.isRequired = chainPropTypes(PropTypes.element.isRequired, acceptingRef);
|
||||
export default elementAcceptingRef;
|
||||
+1
@@ -0,0 +1 @@
|
||||
export { default } from './elementAcceptingRef';
|
||||
+1
@@ -0,0 +1 @@
|
||||
export { default } from './elementAcceptingRef';
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"sideEffects": false,
|
||||
"module": "./index.js",
|
||||
"main": "../node/elementAcceptingRef/index.js",
|
||||
"types": "./index.d.ts"
|
||||
}
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
import PropTypes from 'prop-types';
|
||||
declare const _default: PropTypes.Validator<PropTypes.ReactComponentLike | null | undefined>;
|
||||
export default _default;
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
import PropTypes from 'prop-types';
|
||||
import chainPropTypes from '../chainPropTypes';
|
||||
function isClassComponent(elementType) {
|
||||
// elementType.prototype?.isReactComponent
|
||||
const {
|
||||
prototype = {}
|
||||
} = elementType;
|
||||
return Boolean(prototype.isReactComponent);
|
||||
}
|
||||
function elementTypeAcceptingRef(props, propName, componentName, location, propFullName) {
|
||||
const propValue = props[propName];
|
||||
const safePropName = propFullName || propName;
|
||||
if (propValue == null ||
|
||||
// When server-side rendering React doesn't warn either.
|
||||
// This is not an accurate check for SSR.
|
||||
// This is only in place for emotion compat.
|
||||
// TODO: Revisit once https://github.com/facebook/react/issues/20047 is resolved.
|
||||
typeof window === 'undefined') {
|
||||
return null;
|
||||
}
|
||||
let warningHint;
|
||||
|
||||
/**
|
||||
* Blacklisting instead of whitelisting
|
||||
*
|
||||
* Blacklisting will miss some components, such as React.Fragment. Those will at least
|
||||
* trigger a warning in React.
|
||||
* We can't whitelist because there is no safe way to detect React.forwardRef
|
||||
* or class components. "Safe" means there's no public API.
|
||||
*
|
||||
*/
|
||||
if (typeof propValue === 'function' && !isClassComponent(propValue)) {
|
||||
warningHint = 'Did you accidentally provide a plain function component instead?';
|
||||
}
|
||||
if (warningHint !== undefined) {
|
||||
return new Error(`Invalid ${location} \`${safePropName}\` supplied to \`${componentName}\`. ` + `Expected an element type that can hold a ref. ${warningHint} ` + 'For more information see https://mui.com/r/caveat-with-refs-guide');
|
||||
}
|
||||
return null;
|
||||
}
|
||||
export default chainPropTypes(PropTypes.elementType, elementTypeAcceptingRef);
|
||||
+1
@@ -0,0 +1 @@
|
||||
export { default } from './elementTypeAcceptingRef';
|
||||
+1
@@ -0,0 +1 @@
|
||||
export { default } from './elementTypeAcceptingRef';
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"sideEffects": false,
|
||||
"module": "./index.js",
|
||||
"main": "../node/elementTypeAcceptingRef/index.js",
|
||||
"types": "./index.d.ts"
|
||||
}
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
import { ValidationMap } from 'prop-types';
|
||||
export default function exactProp<T>(propTypes: ValidationMap<T>): ValidationMap<T>;
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
import _extends from "@babel/runtime/helpers/esm/extends";
|
||||
// This module is based on https://github.com/airbnb/prop-types-exact repository.
|
||||
// However, in order to reduce the number of dependencies and to remove some extra safe checks
|
||||
// the module was forked.
|
||||
|
||||
const specialProperty = 'exact-prop: \u200b';
|
||||
export default function exactProp(propTypes) {
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
return propTypes;
|
||||
}
|
||||
return _extends({}, propTypes, {
|
||||
[specialProperty]: props => {
|
||||
const unsupportedProps = Object.keys(props).filter(prop => !propTypes.hasOwnProperty(prop));
|
||||
if (unsupportedProps.length > 0) {
|
||||
return new Error(`The following props are not supported: ${unsupportedProps.map(prop => `\`${prop}\``).join(', ')}. Please remove them.`);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
});
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
export { default } from './exactProp';
|
||||
+1
@@ -0,0 +1 @@
|
||||
export { default } from './exactProp';
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"sideEffects": false,
|
||||
"module": "./index.js",
|
||||
"main": "../node/exactProp/index.js",
|
||||
"types": "./index.d.ts"
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
/**
|
||||
* WARNING: Don't import this directly.
|
||||
* Use `MuiError` from `@mui/internal-babel-macros/MuiError.macro` instead.
|
||||
* @param {number} code
|
||||
*/
|
||||
export default function formatMuiErrorMessage(code: number): string;
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
/**
|
||||
* WARNING: Don't import this directly.
|
||||
* Use `MuiError` from `@mui/internal-babel-macros/MuiError.macro` instead.
|
||||
* @param {number} code
|
||||
*/
|
||||
export default function formatMuiErrorMessage(code) {
|
||||
// Apply babel-plugin-transform-template-literals in loose mode
|
||||
// loose mode is safe if we're concatenating primitives
|
||||
// see https://babeljs.io/docs/en/babel-plugin-transform-template-literals#loose
|
||||
/* eslint-disable prefer-template */
|
||||
let url = 'https://mui.com/production-error/?code=' + code;
|
||||
for (let i = 1; i < arguments.length; i += 1) {
|
||||
// rest params over-transpile for this case
|
||||
// eslint-disable-next-line prefer-rest-params
|
||||
url += '&args[]=' + encodeURIComponent(arguments[i]);
|
||||
}
|
||||
return 'Minified MUI error #' + code + '; visit ' + url + ' for the full message.';
|
||||
/* eslint-enable prefer-template */
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
export { default } from './formatMuiErrorMessage';
|
||||
+1
@@ -0,0 +1 @@
|
||||
export { default } from './formatMuiErrorMessage';
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"sideEffects": false,
|
||||
"module": "./index.js",
|
||||
"main": "../node/formatMuiErrorMessage/index.js",
|
||||
"types": "./index.d.ts"
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
export type GlobalStateSlot = keyof typeof globalStateClasses;
|
||||
export declare const globalStateClasses: {
|
||||
active: string;
|
||||
checked: string;
|
||||
completed: string;
|
||||
disabled: string;
|
||||
error: string;
|
||||
expanded: string;
|
||||
focused: string;
|
||||
focusVisible: string;
|
||||
open: string;
|
||||
readOnly: string;
|
||||
required: string;
|
||||
selected: string;
|
||||
};
|
||||
export default function generateUtilityClass(componentName: string, slot: string, globalStatePrefix?: string): string;
|
||||
export declare function isGlobalState(slot: string): boolean;
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
import ClassNameGenerator from '../ClassNameGenerator';
|
||||
export const globalStateClasses = {
|
||||
active: 'active',
|
||||
checked: 'checked',
|
||||
completed: 'completed',
|
||||
disabled: 'disabled',
|
||||
error: 'error',
|
||||
expanded: 'expanded',
|
||||
focused: 'focused',
|
||||
focusVisible: 'focusVisible',
|
||||
open: 'open',
|
||||
readOnly: 'readOnly',
|
||||
required: 'required',
|
||||
selected: 'selected'
|
||||
};
|
||||
export default function generateUtilityClass(componentName, slot, globalStatePrefix = 'Mui') {
|
||||
const globalStateClass = globalStateClasses[slot];
|
||||
return globalStateClass ? `${globalStatePrefix}-${globalStateClass}` : `${ClassNameGenerator.generate(componentName)}-${slot}`;
|
||||
}
|
||||
export function isGlobalState(slot) {
|
||||
return globalStateClasses[slot] !== undefined;
|
||||
}
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
export { default } from './generateUtilityClass';
|
||||
export * from './generateUtilityClass';
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
export { default } from './generateUtilityClass';
|
||||
export * from './generateUtilityClass';
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"sideEffects": false,
|
||||
"module": "./index.js",
|
||||
"main": "../node/generateUtilityClass/index.js",
|
||||
"types": "./index.d.ts"
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
export default function generateUtilityClasses<T extends string>(componentName: string, slots: T[], globalStatePrefix?: string): Record<T, string>;
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
import generateUtilityClass from '../generateUtilityClass';
|
||||
export default function generateUtilityClasses(componentName, slots, globalStatePrefix = 'Mui') {
|
||||
const result = {};
|
||||
slots.forEach(slot => {
|
||||
result[slot] = generateUtilityClass(componentName, slot, globalStatePrefix);
|
||||
});
|
||||
return result;
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
export { default } from './generateUtilityClasses';
|
||||
+1
@@ -0,0 +1 @@
|
||||
export { default } from './generateUtilityClasses';
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"sideEffects": false,
|
||||
"module": "./index.js",
|
||||
"main": "../node/generateUtilityClasses/index.js",
|
||||
"types": "./index.d.ts"
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
import * as React from 'react';
|
||||
export declare function getFunctionName(fn: Function): string;
|
||||
/**
|
||||
* cherry-pick from
|
||||
* https://github.com/facebook/react/blob/769b1f270e1251d9dbdce0fcbd9e92e502d059b8/packages/shared/getComponentName.js
|
||||
* originally forked from recompose/getDisplayName with added IE11 support
|
||||
*/
|
||||
export default function getDisplayName(Component: React.ElementType): string | undefined;
|
||||
+47
@@ -0,0 +1,47 @@
|
||||
import { ForwardRef, Memo } from 'react-is';
|
||||
|
||||
// Simplified polyfill for IE11 support
|
||||
// https://github.com/JamesMGreene/Function.name/blob/58b314d4a983110c3682f1228f845d39ccca1817/Function.name.js#L3
|
||||
const fnNameMatchRegex = /^\s*function(?:\s|\s*\/\*.*\*\/\s*)+([^(\s/]*)\s*/;
|
||||
export function getFunctionName(fn) {
|
||||
const match = `${fn}`.match(fnNameMatchRegex);
|
||||
const name = match && match[1];
|
||||
return name || '';
|
||||
}
|
||||
function getFunctionComponentName(Component, fallback = '') {
|
||||
return Component.displayName || Component.name || getFunctionName(Component) || fallback;
|
||||
}
|
||||
function getWrappedName(outerType, innerType, wrapperName) {
|
||||
const functionName = getFunctionComponentName(innerType);
|
||||
return outerType.displayName || (functionName !== '' ? `${wrapperName}(${functionName})` : wrapperName);
|
||||
}
|
||||
|
||||
/**
|
||||
* cherry-pick from
|
||||
* https://github.com/facebook/react/blob/769b1f270e1251d9dbdce0fcbd9e92e502d059b8/packages/shared/getComponentName.js
|
||||
* originally forked from recompose/getDisplayName with added IE11 support
|
||||
*/
|
||||
export default function getDisplayName(Component) {
|
||||
if (Component == null) {
|
||||
return undefined;
|
||||
}
|
||||
if (typeof Component === 'string') {
|
||||
return Component;
|
||||
}
|
||||
if (typeof Component === 'function') {
|
||||
return getFunctionComponentName(Component, 'Component');
|
||||
}
|
||||
|
||||
// TypeScript can't have components as objects but they exist in the form of `memo` or `Suspense`
|
||||
if (typeof Component === 'object') {
|
||||
switch (Component.$$typeof) {
|
||||
case ForwardRef:
|
||||
return getWrappedName(Component, Component.render, 'ForwardRef');
|
||||
case Memo:
|
||||
return getWrappedName(Component, Component.type, 'memo');
|
||||
default:
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
export { default } from './getDisplayName';
|
||||
export * from './getDisplayName';
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
export { default } from './getDisplayName';
|
||||
export * from './getDisplayName';
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"sideEffects": false,
|
||||
"module": "./index.js",
|
||||
"main": "../node/getDisplayName/index.js",
|
||||
"types": "./index.d.ts"
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
export default function getScrollbarSize(doc: Document): number;
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
// A change of the browser zoom change the scrollbar size.
|
||||
// Credit https://github.com/twbs/bootstrap/blob/488fd8afc535ca3a6ad4dc581f5e89217b6a36ac/js/src/util/scrollbar.js#L14-L18
|
||||
export default function getScrollbarSize(doc) {
|
||||
// https://developer.mozilla.org/en-US/docs/Web/API/Window/innerWidth#usage_notes
|
||||
const documentWidth = doc.documentElement.clientWidth;
|
||||
return Math.abs(window.innerWidth - documentWidth);
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
export { default } from './getScrollbarSize';
|
||||
+1
@@ -0,0 +1 @@
|
||||
export { default } from './getScrollbarSize';
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"sideEffects": false,
|
||||
"module": "./index.js",
|
||||
"main": "../node/getScrollbarSize/index.js",
|
||||
"types": "./index.d.ts"
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
import * as React from 'react';
|
||||
/**
|
||||
* Gets only the valid children of a component,
|
||||
* and ignores any nullish or falsy child.
|
||||
*
|
||||
* @param children the children
|
||||
*/
|
||||
export default function getValidReactChildren(children: React.ReactNode): React.ReactElement<any, string | React.JSXElementConstructor<any>>[];
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
import * as React from 'react';
|
||||
|
||||
/**
|
||||
* Gets only the valid children of a component,
|
||||
* and ignores any nullish or falsy child.
|
||||
*
|
||||
* @param children the children
|
||||
*/
|
||||
export default function getValidReactChildren(children) {
|
||||
return React.Children.toArray(children).filter(child => /*#__PURE__*/React.isValidElement(child));
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
export { default } from './getValidReactChildren';
|
||||
+1
@@ -0,0 +1 @@
|
||||
export { default } from './getValidReactChildren';
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"sideEffects": false,
|
||||
"module": "./index.js",
|
||||
"main": "../node/getValidReactChildren/index.js",
|
||||
"types": "./index.d.ts"
|
||||
}
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
export { default as chainPropTypes } from './chainPropTypes';
|
||||
export { default as deepmerge } from './deepmerge';
|
||||
export { isPlainObject } from './deepmerge';
|
||||
export { default as elementAcceptingRef } from './elementAcceptingRef';
|
||||
export { default as elementTypeAcceptingRef } from './elementTypeAcceptingRef';
|
||||
export { default as exactProp } from './exactProp';
|
||||
export { default as formatMuiErrorMessage } from './formatMuiErrorMessage';
|
||||
export { default as getDisplayName } from './getDisplayName';
|
||||
export { default as HTMLElementType } from './HTMLElementType';
|
||||
export { default as ponyfillGlobal } from './ponyfillGlobal';
|
||||
export { default as refType } from './refType';
|
||||
export { default as unstable_capitalize } from './capitalize';
|
||||
export { default as unstable_createChainedFunction } from './createChainedFunction';
|
||||
export { default as unstable_debounce } from './debounce';
|
||||
export { default as unstable_deprecatedPropType } from './deprecatedPropType';
|
||||
export { default as unstable_isMuiElement } from './isMuiElement';
|
||||
export { default as unstable_ownerDocument } from './ownerDocument';
|
||||
export { default as unstable_ownerWindow } from './ownerWindow';
|
||||
export { default as unstable_requirePropFactory } from './requirePropFactory';
|
||||
export { default as unstable_setRef } from './setRef';
|
||||
export { default as unstable_useEnhancedEffect } from './useEnhancedEffect';
|
||||
export { default as unstable_useId } from './useId';
|
||||
export { default as unstable_unsupportedProp } from './unsupportedProp';
|
||||
export { default as unstable_useControlled } from './useControlled';
|
||||
export { default as unstable_useEventCallback } from './useEventCallback';
|
||||
export { default as unstable_useForkRef } from './useForkRef';
|
||||
export { default as unstable_useLazyRef } from './useLazyRef';
|
||||
export { default as unstable_useTimeout, Timeout as unstable_Timeout } from './useTimeout';
|
||||
export { default as unstable_useOnMount } from './useOnMount';
|
||||
export { default as unstable_useIsFocusVisible } from './useIsFocusVisible';
|
||||
export { default as unstable_getScrollbarSize } from './getScrollbarSize';
|
||||
export { detectScrollType as unstable_detectScrollType, getNormalizedScrollLeft as unstable_getNormalizedScrollLeft, } from './scrollLeft';
|
||||
export { default as usePreviousProps } from './usePreviousProps';
|
||||
export { default as getValidReactChildren } from './getValidReactChildren';
|
||||
export { default as visuallyHidden } from './visuallyHidden';
|
||||
export { default as integerPropType } from './integerPropType';
|
||||
export { default as internal_resolveProps } from './resolveProps';
|
||||
export { default as unstable_composeClasses } from './composeClasses';
|
||||
export { default as unstable_generateUtilityClass } from './generateUtilityClass';
|
||||
export { isGlobalState as unstable_isGlobalState } from './generateUtilityClass';
|
||||
export * from './generateUtilityClass';
|
||||
export { default as unstable_generateUtilityClasses } from './generateUtilityClasses';
|
||||
export { default as unstable_ClassNameGenerator } from './ClassNameGenerator';
|
||||
export { default as clamp } from './clamp';
|
||||
+51
@@ -0,0 +1,51 @@
|
||||
/**
|
||||
* @mui/utils v5.15.14
|
||||
*
|
||||
* @license MIT
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*/
|
||||
export { default as chainPropTypes } from './chainPropTypes';
|
||||
export { default as deepmerge } from './deepmerge';
|
||||
export { isPlainObject } from './deepmerge';
|
||||
export { default as elementAcceptingRef } from './elementAcceptingRef';
|
||||
export { default as elementTypeAcceptingRef } from './elementTypeAcceptingRef';
|
||||
export { default as exactProp } from './exactProp';
|
||||
export { default as formatMuiErrorMessage } from './formatMuiErrorMessage';
|
||||
export { default as getDisplayName } from './getDisplayName';
|
||||
export { default as HTMLElementType } from './HTMLElementType';
|
||||
export { default as ponyfillGlobal } from './ponyfillGlobal';
|
||||
export { default as refType } from './refType';
|
||||
export { default as unstable_capitalize } from './capitalize';
|
||||
export { default as unstable_createChainedFunction } from './createChainedFunction';
|
||||
export { default as unstable_debounce } from './debounce';
|
||||
export { default as unstable_deprecatedPropType } from './deprecatedPropType';
|
||||
export { default as unstable_isMuiElement } from './isMuiElement';
|
||||
export { default as unstable_ownerDocument } from './ownerDocument';
|
||||
export { default as unstable_ownerWindow } from './ownerWindow';
|
||||
export { default as unstable_requirePropFactory } from './requirePropFactory';
|
||||
export { default as unstable_setRef } from './setRef';
|
||||
export { default as unstable_useEnhancedEffect } from './useEnhancedEffect';
|
||||
export { default as unstable_useId } from './useId';
|
||||
export { default as unstable_unsupportedProp } from './unsupportedProp';
|
||||
export { default as unstable_useControlled } from './useControlled';
|
||||
export { default as unstable_useEventCallback } from './useEventCallback';
|
||||
export { default as unstable_useForkRef } from './useForkRef';
|
||||
export { default as unstable_useLazyRef } from './useLazyRef';
|
||||
export { default as unstable_useTimeout, Timeout as unstable_Timeout } from './useTimeout';
|
||||
export { default as unstable_useOnMount } from './useOnMount';
|
||||
export { default as unstable_useIsFocusVisible } from './useIsFocusVisible';
|
||||
export { default as unstable_getScrollbarSize } from './getScrollbarSize';
|
||||
export { detectScrollType as unstable_detectScrollType, getNormalizedScrollLeft as unstable_getNormalizedScrollLeft } from './scrollLeft';
|
||||
export { default as usePreviousProps } from './usePreviousProps';
|
||||
export { default as getValidReactChildren } from './getValidReactChildren';
|
||||
export { default as visuallyHidden } from './visuallyHidden';
|
||||
export { default as integerPropType } from './integerPropType';
|
||||
export { default as internal_resolveProps } from './resolveProps';
|
||||
export { default as unstable_composeClasses } from './composeClasses';
|
||||
export { default as unstable_generateUtilityClass } from './generateUtilityClass';
|
||||
export { isGlobalState as unstable_isGlobalState } from './generateUtilityClass';
|
||||
export * from './generateUtilityClass';
|
||||
export { default as unstable_generateUtilityClasses } from './generateUtilityClasses';
|
||||
export { default as unstable_ClassNameGenerator } from './ClassNameGenerator';
|
||||
export { default as clamp } from './clamp';
|
||||
Loaded 100 of 6977 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user