|
|
@ -1,4 +1,4 @@ |
|
|
|
import { Dialog as MUIDialog } from '@mui/material'; |
|
|
|
import { Box, Dialog as MUIDialog, SxProps, Theme } from '@mui/material'; |
|
|
|
import { |
|
|
|
import { |
|
|
|
ButtonHTMLAttributes, |
|
|
|
ButtonHTMLAttributes, |
|
|
|
ElementType, |
|
|
|
ElementType, |
|
|
@ -51,6 +51,8 @@ const ConfirmDialog = forwardRef< |
|
|
|
openInitially = false, |
|
|
|
openInitially = false, |
|
|
|
proceedButtonProps = {}, |
|
|
|
proceedButtonProps = {}, |
|
|
|
proceedColour: proceedColourKey = 'blue', |
|
|
|
proceedColour: proceedColourKey = 'blue', |
|
|
|
|
|
|
|
scrollContent: isScrollContent = false, |
|
|
|
|
|
|
|
scrollBoxProps: { sx: scrollBoxSx, ...restScrollBoxProps } = {}, |
|
|
|
titleText, |
|
|
|
titleText, |
|
|
|
}, |
|
|
|
}, |
|
|
|
ref, |
|
|
|
ref, |
|
|
@ -183,6 +185,18 @@ const ConfirmDialog = forwardRef< |
|
|
|
typeof content === 'string' ? <BodyText text={content} /> : content, |
|
|
|
typeof content === 'string' ? <BodyText text={content} /> : content, |
|
|
|
[content], |
|
|
|
[content], |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
const combinedScrollBoxSx = useMemo<SxProps<Theme> | undefined>( |
|
|
|
|
|
|
|
() => |
|
|
|
|
|
|
|
isScrollContent |
|
|
|
|
|
|
|
? { |
|
|
|
|
|
|
|
maxHeight: '60vh', |
|
|
|
|
|
|
|
overflowY: 'scroll', |
|
|
|
|
|
|
|
padding: '.2em .4em', |
|
|
|
|
|
|
|
...scrollBoxSx, |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
: undefined, |
|
|
|
|
|
|
|
[isScrollContent, scrollBoxSx], |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
useImperativeHandle( |
|
|
|
useImperativeHandle( |
|
|
|
ref, |
|
|
|
ref, |
|
|
@ -210,7 +224,9 @@ const ConfirmDialog = forwardRef< |
|
|
|
onSubmit={contentContainerSubmitEventHandler} |
|
|
|
onSubmit={contentContainerSubmitEventHandler} |
|
|
|
{...contentContainerProps} |
|
|
|
{...contentContainerProps} |
|
|
|
> |
|
|
|
> |
|
|
|
{contentElement} |
|
|
|
<Box {...restScrollBoxProps} sx={combinedScrollBoxSx}> |
|
|
|
|
|
|
|
{contentElement} |
|
|
|
|
|
|
|
</Box> |
|
|
|
{actionAreaElement} |
|
|
|
{actionAreaElement} |
|
|
|
</FlexBox> |
|
|
|
</FlexBox> |
|
|
|
</MUIDialog> |
|
|
|
</MUIDialog> |
|
|
|