worked on GarageApp stuff
This commit is contained in:
parent
60aaf17af3
commit
eb606572b0
51919 changed files with 2168177 additions and 18 deletions
2
node_modules/@mui/utils/mergeSlotProps/index.d.ts
generated
vendored
Normal file
2
node_modules/@mui/utils/mergeSlotProps/index.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
export { default } from "./mergeSlotProps.js";
|
||||
export type { WithCommonProps, MergeSlotPropsParameters, MergeSlotPropsResult } from "./mergeSlotProps.js";
|
||||
13
node_modules/@mui/utils/mergeSlotProps/index.js
generated
vendored
Normal file
13
node_modules/@mui/utils/mergeSlotProps/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 _mergeSlotProps.default;
|
||||
}
|
||||
});
|
||||
var _mergeSlotProps = _interopRequireDefault(require("./mergeSlotProps"));
|
||||
56
node_modules/@mui/utils/mergeSlotProps/mergeSlotProps.d.ts
generated
vendored
Normal file
56
node_modules/@mui/utils/mergeSlotProps/mergeSlotProps.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
import * as React from 'react';
|
||||
import { ClassValue } from 'clsx';
|
||||
import { Simplify } from '@mui/types';
|
||||
import { EventHandlers } from "../types/index.js";
|
||||
export type WithCommonProps<OtherProps> = OtherProps & {
|
||||
className?: string;
|
||||
style?: React.CSSProperties;
|
||||
ref?: React.Ref<any>;
|
||||
};
|
||||
export interface MergeSlotPropsParameters<SlotProps, ExternalForwardedProps, ExternalSlotProps, AdditionalProps> {
|
||||
/**
|
||||
* A function that returns the internal props of the component.
|
||||
* It accepts the event handlers passed into the component by the user
|
||||
* and is responsible for calling them where appropriate.
|
||||
*/
|
||||
getSlotProps?: (other: EventHandlers) => WithCommonProps<SlotProps>;
|
||||
/**
|
||||
* Props provided to the `slotProps.*` of the Base UI component.
|
||||
*/
|
||||
externalSlotProps?: WithCommonProps<ExternalSlotProps>;
|
||||
/**
|
||||
* Extra props placed on the Base UI component that should be forwarded to the slot.
|
||||
* This should usually be used only for the root slot.
|
||||
*/
|
||||
externalForwardedProps?: WithCommonProps<ExternalForwardedProps>;
|
||||
/**
|
||||
* Additional props to be placed on the slot.
|
||||
*/
|
||||
additionalProps?: WithCommonProps<AdditionalProps>;
|
||||
/**
|
||||
* Extra class name(s) to be placed on the slot.
|
||||
*/
|
||||
className?: ClassValue | ClassValue[];
|
||||
}
|
||||
export type MergeSlotPropsResult<SlotProps, ExternalForwardedProps, ExternalSlotProps, AdditionalProps> = {
|
||||
props: Simplify<SlotProps & ExternalForwardedProps & ExternalSlotProps & AdditionalProps & {
|
||||
className?: string;
|
||||
style?: React.CSSProperties;
|
||||
}>;
|
||||
internalRef: React.Ref<any> | undefined;
|
||||
};
|
||||
/**
|
||||
* Merges the slot component internal props (usually coming from a hook)
|
||||
* with the externally provided ones.
|
||||
*
|
||||
* The merge order is (the latter overrides the former):
|
||||
* 1. The internal props (specified as a getter function to work with get*Props hook result)
|
||||
* 2. Additional props (specified internally on a Base UI component)
|
||||
* 3. External props specified on the owner component. These should only be used on a root slot.
|
||||
* 4. External props specified in the `slotProps.*` prop.
|
||||
* 5. The `className` prop - combined from all the above.
|
||||
* @param parameters
|
||||
* @returns
|
||||
*/
|
||||
declare function mergeSlotProps<SlotProps, ExternalForwardedProps extends Record<string, unknown>, ExternalSlotProps extends Record<string, unknown>, AdditionalProps>(parameters: MergeSlotPropsParameters<SlotProps, ExternalForwardedProps, ExternalSlotProps, AdditionalProps>): MergeSlotPropsResult<SlotProps, ExternalForwardedProps, ExternalSlotProps, AdditionalProps>;
|
||||
export default mergeSlotProps;
|
||||
97
node_modules/@mui/utils/mergeSlotProps/mergeSlotProps.js
generated
vendored
Normal file
97
node_modules/@mui/utils/mergeSlotProps/mergeSlotProps.js
generated
vendored
Normal file
|
|
@ -0,0 +1,97 @@
|
|||
"use strict";
|
||||
|
||||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
var _clsx = _interopRequireDefault(require("clsx"));
|
||||
var _extractEventHandlers = _interopRequireDefault(require("../extractEventHandlers"));
|
||||
var _omitEventHandlers = _interopRequireDefault(require("../omitEventHandlers"));
|
||||
/**
|
||||
* Merges the slot component internal props (usually coming from a hook)
|
||||
* with the externally provided ones.
|
||||
*
|
||||
* The merge order is (the latter overrides the former):
|
||||
* 1. The internal props (specified as a getter function to work with get*Props hook result)
|
||||
* 2. Additional props (specified internally on a Base UI component)
|
||||
* 3. External props specified on the owner component. These should only be used on a root slot.
|
||||
* 4. External props specified in the `slotProps.*` prop.
|
||||
* 5. The `className` prop - combined from all the above.
|
||||
* @param parameters
|
||||
* @returns
|
||||
*/
|
||||
function mergeSlotProps(parameters) {
|
||||
const {
|
||||
getSlotProps,
|
||||
additionalProps,
|
||||
externalSlotProps,
|
||||
externalForwardedProps,
|
||||
className
|
||||
} = parameters;
|
||||
if (!getSlotProps) {
|
||||
// The simpler case - getSlotProps is not defined, so no internal event handlers are defined,
|
||||
// so we can simply merge all the props without having to worry about extracting event handlers.
|
||||
const joinedClasses = (0, _clsx.default)(additionalProps?.className, className, externalForwardedProps?.className, externalSlotProps?.className);
|
||||
const mergedStyle = {
|
||||
...additionalProps?.style,
|
||||
...externalForwardedProps?.style,
|
||||
...externalSlotProps?.style
|
||||
};
|
||||
const props = {
|
||||
...additionalProps,
|
||||
...externalForwardedProps,
|
||||
...externalSlotProps
|
||||
};
|
||||
if (joinedClasses.length > 0) {
|
||||
props.className = joinedClasses;
|
||||
}
|
||||
if (Object.keys(mergedStyle).length > 0) {
|
||||
props.style = mergedStyle;
|
||||
}
|
||||
return {
|
||||
props,
|
||||
internalRef: undefined
|
||||
};
|
||||
}
|
||||
|
||||
// In this case, getSlotProps is responsible for calling the external event handlers.
|
||||
// We don't need to include them in the merged props because of this.
|
||||
|
||||
const eventHandlers = (0, _extractEventHandlers.default)({
|
||||
...externalForwardedProps,
|
||||
...externalSlotProps
|
||||
});
|
||||
const componentsPropsWithoutEventHandlers = (0, _omitEventHandlers.default)(externalSlotProps);
|
||||
const otherPropsWithoutEventHandlers = (0, _omitEventHandlers.default)(externalForwardedProps);
|
||||
const internalSlotProps = getSlotProps(eventHandlers);
|
||||
|
||||
// The order of classes is important here.
|
||||
// Emotion (that we use in libraries consuming Base UI) depends on this order
|
||||
// to properly override style. It requires the most important classes to be last
|
||||
// (see https://github.com/mui/material-ui/pull/33205) for the related discussion.
|
||||
const joinedClasses = (0, _clsx.default)(internalSlotProps?.className, additionalProps?.className, className, externalForwardedProps?.className, externalSlotProps?.className);
|
||||
const mergedStyle = {
|
||||
...internalSlotProps?.style,
|
||||
...additionalProps?.style,
|
||||
...externalForwardedProps?.style,
|
||||
...externalSlotProps?.style
|
||||
};
|
||||
const props = {
|
||||
...internalSlotProps,
|
||||
...additionalProps,
|
||||
...otherPropsWithoutEventHandlers,
|
||||
...componentsPropsWithoutEventHandlers
|
||||
};
|
||||
if (joinedClasses.length > 0) {
|
||||
props.className = joinedClasses;
|
||||
}
|
||||
if (Object.keys(mergedStyle).length > 0) {
|
||||
props.style = mergedStyle;
|
||||
}
|
||||
return {
|
||||
props,
|
||||
internalRef: internalSlotProps.ref
|
||||
};
|
||||
}
|
||||
var _default = exports.default = mergeSlotProps;
|
||||
Loading…
Add table
Add a link
Reference in a new issue