|
|
|
@ -39,6 +39,8 @@ const ConfirmDialog: ForwardRefExoticComponent< |
|
|
|
|
proceedColour = 'blue', |
|
|
|
|
scrollContent = false, |
|
|
|
|
scrollBoxProps, |
|
|
|
|
showActionArea = true, |
|
|
|
|
showCancel, |
|
|
|
|
showClose, |
|
|
|
|
titleText, |
|
|
|
|
wide, |
|
|
|
@ -64,27 +66,9 @@ const ConfirmDialog: ForwardRefExoticComponent< |
|
|
|
|
[contentElement, scrollBoxProps, scrollContent], |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
useImperativeHandle( |
|
|
|
|
ref, |
|
|
|
|
() => ({ |
|
|
|
|
setOpen: (open) => dialogRef.current?.setOpen(open), |
|
|
|
|
}), |
|
|
|
|
[], |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
|
<DialogWithHeader |
|
|
|
|
dialogProps={dialogProps} |
|
|
|
|
header={titleText} |
|
|
|
|
loading={loading} |
|
|
|
|
openInitially={openInitially} |
|
|
|
|
ref={dialogRef} |
|
|
|
|
showClose={showClose} |
|
|
|
|
wide={wide} |
|
|
|
|
> |
|
|
|
|
<FlexBox {...contentContainerProps}> |
|
|
|
|
{bodyElement} |
|
|
|
|
{preActionArea} |
|
|
|
|
const actionArea = useMemo( |
|
|
|
|
() => |
|
|
|
|
showActionArea && ( |
|
|
|
|
<DialogActionArea |
|
|
|
|
cancelProps={{ |
|
|
|
|
children: actionCancelText, |
|
|
|
@ -105,7 +89,47 @@ const ConfirmDialog: ForwardRefExoticComponent< |
|
|
|
|
}, |
|
|
|
|
...proceedButtonProps, |
|
|
|
|
}} |
|
|
|
|
showCancel={showCancel} |
|
|
|
|
/> |
|
|
|
|
), |
|
|
|
|
[ |
|
|
|
|
actionCancelText, |
|
|
|
|
actionProceedText, |
|
|
|
|
closeOnProceed, |
|
|
|
|
disableProceed, |
|
|
|
|
loadingAction, |
|
|
|
|
onActionAppend, |
|
|
|
|
onCancelAppend, |
|
|
|
|
onProceedAppend, |
|
|
|
|
proceedButtonProps, |
|
|
|
|
proceedColour, |
|
|
|
|
showActionArea, |
|
|
|
|
showCancel, |
|
|
|
|
], |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
useImperativeHandle( |
|
|
|
|
ref, |
|
|
|
|
() => ({ |
|
|
|
|
setOpen: (open) => dialogRef.current?.setOpen(open), |
|
|
|
|
}), |
|
|
|
|
[], |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
|
<DialogWithHeader |
|
|
|
|
dialogProps={dialogProps} |
|
|
|
|
header={titleText} |
|
|
|
|
loading={loading} |
|
|
|
|
openInitially={openInitially} |
|
|
|
|
ref={dialogRef} |
|
|
|
|
showClose={showClose} |
|
|
|
|
wide={wide} |
|
|
|
|
> |
|
|
|
|
<FlexBox {...contentContainerProps}> |
|
|
|
|
{bodyElement} |
|
|
|
|
{preActionArea} |
|
|
|
|
{actionArea} |
|
|
|
|
</FlexBox> |
|
|
|
|
</DialogWithHeader> |
|
|
|
|
); |
|
|
|
|