|
|
@ -24,7 +24,11 @@ const ConfirmDialog = forwardRef< |
|
|
|
actionCancelText = 'Cancel', |
|
|
|
actionCancelText = 'Cancel', |
|
|
|
actionProceedText, |
|
|
|
actionProceedText, |
|
|
|
content, |
|
|
|
content, |
|
|
|
dialogProps: { open: baseOpen = false, ...restDialogProps } = {}, |
|
|
|
dialogProps: { |
|
|
|
|
|
|
|
open: baseOpen = false, |
|
|
|
|
|
|
|
PaperProps: paperProps = {}, |
|
|
|
|
|
|
|
...restDialogProps |
|
|
|
|
|
|
|
} = {}, |
|
|
|
onCancelAppend, |
|
|
|
onCancelAppend, |
|
|
|
onProceedAppend, |
|
|
|
onProceedAppend, |
|
|
|
openInitially = false, |
|
|
|
openInitially = false, |
|
|
@ -34,7 +38,9 @@ const ConfirmDialog = forwardRef< |
|
|
|
}, |
|
|
|
}, |
|
|
|
ref, |
|
|
|
ref, |
|
|
|
) => { |
|
|
|
) => { |
|
|
|
const { sx: proceedButtonSx } = proceedButtonProps; |
|
|
|
const { sx: paperSx, ...restPaperProps } = paperProps; |
|
|
|
|
|
|
|
const { sx: proceedButtonSx, ...restProceedButtonProps } = |
|
|
|
|
|
|
|
proceedButtonProps; |
|
|
|
|
|
|
|
|
|
|
|
const [isOpen, setIsOpen] = useState<boolean>(openInitially); |
|
|
|
const [isOpen, setIsOpen] = useState<boolean>(openInitially); |
|
|
|
|
|
|
|
|
|
|
@ -61,7 +67,10 @@ const ConfirmDialog = forwardRef< |
|
|
|
<Dialog |
|
|
|
<Dialog |
|
|
|
open={open} |
|
|
|
open={open} |
|
|
|
PaperComponent={Panel} |
|
|
|
PaperComponent={Panel} |
|
|
|
PaperProps={{ sx: { overflow: 'visible' } }} |
|
|
|
PaperProps={{ |
|
|
|
|
|
|
|
...restPaperProps, |
|
|
|
|
|
|
|
sx: { overflow: 'visible', ...paperSx }, |
|
|
|
|
|
|
|
}} |
|
|
|
{...restDialogProps} |
|
|
|
{...restDialogProps} |
|
|
|
> |
|
|
|
> |
|
|
|
<PanelHeader> |
|
|
|
<PanelHeader> |
|
|
@ -92,6 +101,12 @@ const ConfirmDialog = forwardRef< |
|
|
|
{actionCancelText} |
|
|
|
{actionCancelText} |
|
|
|
</ContainedButton> |
|
|
|
</ContainedButton> |
|
|
|
<ContainedButton |
|
|
|
<ContainedButton |
|
|
|
|
|
|
|
onClick={(...args) => { |
|
|
|
|
|
|
|
setIsOpen(false); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
onProceedAppend?.call(null, ...args); |
|
|
|
|
|
|
|
}} |
|
|
|
|
|
|
|
{...restProceedButtonProps} |
|
|
|
sx={{ |
|
|
|
sx={{ |
|
|
|
backgroundColor: proceedColour, |
|
|
|
backgroundColor: proceedColour, |
|
|
|
color: TEXT, |
|
|
|
color: TEXT, |
|
|
@ -100,11 +115,6 @@ const ConfirmDialog = forwardRef< |
|
|
|
|
|
|
|
|
|
|
|
...proceedButtonSx, |
|
|
|
...proceedButtonSx, |
|
|
|
}} |
|
|
|
}} |
|
|
|
onClick={(...args) => { |
|
|
|
|
|
|
|
setIsOpen(false); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
onProceedAppend?.call(null, ...args); |
|
|
|
|
|
|
|
}} |
|
|
|
|
|
|
|
> |
|
|
|
> |
|
|
|
{actionProceedText} |
|
|
|
{actionProceedText} |
|
|
|
</ContainedButton> |
|
|
|
</ContainedButton> |
|
|
|