diff --git a/dist/mui/components/dialog/Dialog.d.ts b/dist/mui/components/dialog/Dialog.d.ts index fff31df..2dc72b7 100644 --- a/dist/mui/components/dialog/Dialog.d.ts +++ b/dist/mui/components/dialog/Dialog.d.ts @@ -3,7 +3,6 @@ import { DialogProps } from "@mui/material/Dialog"; import React from "react"; export interface DialogModalProps extends DialogProps { id?: string; - className?: string; titleComponent?: string | React.ReactNode; open: boolean; onSubmit?: (() => void) | undefined; @@ -25,5 +24,5 @@ export interface DialogModalProps extends DialogProps { cancelButtonProps?: ButtonProps; draggableId?: string; } -declare function DialogModal({ id, className, title, titleComponent, open, scroll, onSubmit, onCancel, onClose, children, maxWidth, dividers, fullWidth, isSubmitButtonDisabled, isSubmitButtonProcessing, isSubmitOnEnter, renderHeaderCustom, renderBodyCustom, renderFooterCustom, submitButtonText, cancelButtonText, submitButtonProps, cancelButtonProps, PaperComponent, draggableId, }: DialogModalProps): React.JSX.Element; +declare function DialogModal({ id, title, titleComponent, open, scroll, onSubmit, onCancel, onClose, children, maxWidth, dividers, fullWidth, isSubmitButtonDisabled, isSubmitButtonProcessing, isSubmitOnEnter, renderHeaderCustom, renderBodyCustom, renderFooterCustom, submitButtonText, cancelButtonText, submitButtonProps, cancelButtonProps, PaperComponent, draggableId, ...originalProps }: DialogModalProps): React.JSX.Element; export default DialogModal; diff --git a/dist/mui/components/dialog/Dialog.js b/dist/mui/components/dialog/Dialog.js index a138bdb..40e8056 100644 --- a/dist/mui/components/dialog/Dialog.js +++ b/dist/mui/components/dialog/Dialog.js @@ -10,7 +10,7 @@ import IconButton from "@mui/material/IconButton"; import Typography from "@mui/material/Typography"; import React, { useCallback } from "react"; import IconByName from "../icon/IconByName"; -function DialogModal({ id = "modal-dialog", className, title, titleComponent, open, scroll = "paper", onSubmit = undefined, onCancel, onClose, children, maxWidth = "sm", dividers = true, fullWidth = true, isSubmitButtonDisabled = false, isSubmitButtonProcessing = false, isSubmitOnEnter = false, renderHeaderCustom, renderBodyCustom, renderFooterCustom, submitButtonText = "Submit", cancelButtonText = "Cancel", submitButtonProps, cancelButtonProps, PaperComponent, draggableId, }) { +function DialogModal({ id = "modal-dialog", title, titleComponent, open, scroll = "paper", onSubmit = undefined, onCancel, onClose, children, maxWidth = "sm", dividers = true, fullWidth = true, isSubmitButtonDisabled = false, isSubmitButtonProcessing = false, isSubmitOnEnter = false, renderHeaderCustom, renderBodyCustom, renderFooterCustom, submitButtonText = "Submit", cancelButtonText = "Cancel", submitButtonProps, cancelButtonProps, PaperComponent, draggableId, ...originalProps }) { const handleSubmit = () => { if (onSubmit) onSubmit(); @@ -46,7 +46,7 @@ function DialogModal({ id = "modal-dialog", className, title, titleComponent, op React.createElement(Button, { id: `${id}-cancel-button`, variant: "text", "data-dismiss": "modal", "aria-label": cancelButtonText, onClick: handleCancel, ...cancelButtonProps }, cancelButtonText), React.createElement(LoadingButton, { id: `${id}-submit-button`, loading: isSubmitButtonProcessing, variant: "text", "aria-label": submitButtonText, disabled: isSubmitButtonDisabled || isSubmitButtonProcessing, onClick: handleSubmit, ...submitButtonProps }, submitButtonText))); }; - return (React.createElement(Dialog, { id: id, className: className, open: open, onClose: onClose, onSubmit: onSubmit, maxWidth: maxWidth, scroll: scroll, fullWidth: fullWidth, onKeyUp: handleSubmitOnEnter, PaperComponent: PaperComponent }, + return (React.createElement(Dialog, { id: id, open: open, onClose: onClose, onSubmit: onSubmit, maxWidth: maxWidth, scroll: scroll, fullWidth: fullWidth, onKeyUp: handleSubmitOnEnter, PaperComponent: PaperComponent, ...originalProps }, renderHeaderCustom ? renderHeaderCustom() : renderHeaderDefault(), renderBodyCustom ? renderBodyCustom() : renderBodyDefault(), renderFooterCustom ? renderFooterCustom() : renderFooterDefault())); diff --git a/src/mui/components/dialog/Dialog.tsx b/src/mui/components/dialog/Dialog.tsx index 91c32a8..7bc40bb 100644 --- a/src/mui/components/dialog/Dialog.tsx +++ b/src/mui/components/dialog/Dialog.tsx @@ -14,7 +14,6 @@ import IconByName from "../icon/IconByName"; export interface DialogModalProps extends DialogProps { id?: string; - className?: string; titleComponent?: string | React.ReactNode; open: boolean; onSubmit?: (() => void) | undefined; @@ -39,7 +38,6 @@ export interface DialogModalProps extends DialogProps { function DialogModal({ id = "modal-dialog", - className, title, titleComponent, open, @@ -63,6 +61,7 @@ function DialogModal({ cancelButtonProps, PaperComponent, draggableId, + ...originalProps }: DialogModalProps) { const handleSubmit = () => { if (onSubmit) onSubmit(); @@ -144,7 +143,6 @@ function DialogModal({ return ( + PaperComponent={PaperComponent} + {...originalProps}> {renderHeaderCustom ? renderHeaderCustom() : renderHeaderDefault()} {renderBodyCustom ? renderBodyCustom() : renderBodyDefault()} {renderFooterCustom ? renderFooterCustom() : renderFooterDefault()}