|
@@ -16,7 +16,7 @@ import Box from "@mui/material/Box";
|
|
|
|
|
|
import { useClassNames, useDynamicProperty } from "../../utils/hooks";
|
|
import { useClassNames, useDynamicProperty } from "../../utils/hooks";
|
|
import TaipyRendered from "../pages/TaipyRendered";
|
|
import TaipyRendered from "../pages/TaipyRendered";
|
|
-import { TaipyBaseProps } from "./utils";
|
|
|
|
|
|
+import { expandSx, getCssSize, TaipyBaseProps } from "./utils";
|
|
import { TaipyContext } from "../../context/taipyContext";
|
|
import { TaipyContext } from "../../context/taipyContext";
|
|
|
|
|
|
interface PartProps extends TaipyBaseProps {
|
|
interface PartProps extends TaipyBaseProps {
|
|
@@ -29,6 +29,7 @@ interface PartProps extends TaipyBaseProps {
|
|
partial?: boolean;
|
|
partial?: boolean;
|
|
height?: string;
|
|
height?: string;
|
|
defaultHeight?: string;
|
|
defaultHeight?: string;
|
|
|
|
+ width?: string | number;
|
|
}
|
|
}
|
|
|
|
|
|
const IframeStyle = {
|
|
const IframeStyle = {
|
|
@@ -55,7 +56,7 @@ const Part = (props: PartProps) => {
|
|
return false;
|
|
return false;
|
|
}, [state.locations, page, defaultPartial]);
|
|
}, [state.locations, page, defaultPartial]);
|
|
|
|
|
|
- const boxSx = useMemo(() => (height ? { height: height } : undefined), [height]);
|
|
|
|
|
|
+ const boxSx = useMemo(() => expandSx({}, height ? { height: height } : undefined, props.width ? {width: getCssSize(props.width)}: undefined), [height, props.width]);
|
|
return render ? (
|
|
return render ? (
|
|
<Box id={id} className={className} sx={boxSx}>
|
|
<Box id={id} className={className} sx={boxSx}>
|
|
{iFrame ? (
|
|
{iFrame ? (
|