feat: 氧化铝数字孪生系统监控大屏完成

This commit is contained in:
2026-04-08 21:44:08 +08:00
commit a48babc68d
67606 changed files with 3337335 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
export {};
type ThemedProps<Theme, Name extends keyof any> = Theme extends {
components: Record<Name, {
defaultProps: infer Props;
}>;
} ? Props : {};
export default function getThemeProps<Theme, Props, Name extends keyof any>(params: {
props: Props;
name: Name;
theme?: Theme | undefined;
}): Props & ThemedProps<Theme, Name>;

View File

@@ -0,0 +1,12 @@
import resolveProps from '@mui/utils/resolveProps';
export default function getThemeProps(params) {
const {
theme,
name,
props
} = params;
if (!theme || !theme.components || !theme.components[name] || !theme.components[name].defaultProps) {
return props;
}
return resolveProps(theme.components[name].defaultProps, props);
}

View File

@@ -0,0 +1,3 @@
export { default } from "./useThemeProps.js";
export * from "./useThemeProps.js";
export { default as getThemeProps } from "./getThemeProps.js";

2
node_modules/@mui/system/esm/useThemeProps/index.js generated vendored Normal file
View File

@@ -0,0 +1,2 @@
export { default } from "./useThemeProps.js";
export { default as getThemeProps } from "./getThemeProps.js";

View File

@@ -0,0 +1,14 @@
export interface ThemeWithProps {
components?: any;
}
export type ThemedProps<Theme, Name extends keyof any> = Theme extends {
components: Record<Name, {
defaultProps: infer Props;
}>;
} ? Props : {};
export default function useThemeProps<Theme extends ThemeWithProps, Props, Name extends keyof any>(params: {
props: Props;
name: Name;
defaultTheme?: Theme | undefined;
themeId?: string | undefined;
}): Props & ThemedProps<Theme, Name>;

View File

@@ -0,0 +1,20 @@
'use client';
import getThemeProps from "./getThemeProps.js";
import useTheme from "../useTheme/index.js";
export default function useThemeProps({
props,
name,
defaultTheme,
themeId
}) {
let theme = useTheme(defaultTheme);
if (themeId) {
theme = theme[themeId] || theme;
}
return getThemeProps({
theme,
name,
props
});
}