tp-react-elements-dev 1.4.1 → 1.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -5,6 +5,7 @@ export interface ConfirmationDialogProps {
|
|
|
5
5
|
text: string;
|
|
6
6
|
Submit?: string;
|
|
7
7
|
Cancel?: string;
|
|
8
|
+
buttonStyleProps?: any;
|
|
8
9
|
}
|
|
9
|
-
declare const ConfirmationDialog: ({ openConfirmDialog, handleCancel, onClickSubmit, text, Submit, Cancel }: ConfirmationDialogProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
declare const ConfirmationDialog: ({ openConfirmDialog, handleCancel, onClickSubmit, text, Submit, Cancel, buttonStyleProps }: ConfirmationDialogProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
11
|
export default ConfirmationDialog;
|
|
@@ -3,6 +3,8 @@ export interface SessionTimeOutProps {
|
|
|
3
3
|
handleSubmitSession: () => void;
|
|
4
4
|
onSessionExpire: () => void;
|
|
5
5
|
handleSessionCancel: () => void;
|
|
6
|
+
SubmitButtonName?: string;
|
|
7
|
+
buttonStyleProps?: any;
|
|
6
8
|
}
|
|
7
|
-
declare const SessionTimeOut: ({ sessionTime, handleSubmitSession, onSessionExpire, handleSessionCancel }: SessionTimeOutProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
declare const SessionTimeOut: ({ sessionTime, handleSubmitSession, onSessionExpire, handleSessionCancel, SubmitButtonName, buttonStyleProps }: SessionTimeOutProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
10
|
export default SessionTimeOut;
|
package/dist/index.esm.js
CHANGED
|
@@ -53599,7 +53599,7 @@ newStyled(DialogTitle)(({ theme }) => ({
|
|
|
53599
53599
|
borderBottom: "1px solid rgb(229 231 235 / 1)",
|
|
53600
53600
|
}));
|
|
53601
53601
|
|
|
53602
|
-
const ConfirmationDialog = ({ openConfirmDialog, handleCancel, onClickSubmit, text, Submit = 'Submit', Cancel = 'Cancel' }) => {
|
|
53602
|
+
const ConfirmationDialog = ({ openConfirmDialog, handleCancel, onClickSubmit, text, Submit = 'Submit', Cancel = 'Cancel', buttonStyleProps }) => {
|
|
53603
53603
|
return (jsxRuntimeExports.jsxs(Dialog, Object.assign({ open: openConfirmDialog, TransitionComponent: Slide, fullWidth: true, sx: {
|
|
53604
53604
|
position: "fixed",
|
|
53605
53605
|
top: "10%",
|
|
@@ -53629,7 +53629,7 @@ const ConfirmationDialog = ({ openConfirmDialog, handleCancel, onClickSubmit, te
|
|
|
53629
53629
|
display: "flex",
|
|
53630
53630
|
justifyContent: "flex-end",
|
|
53631
53631
|
gap: "8px",
|
|
53632
|
-
} }, { children: [jsxRuntimeExports.jsx(SubmitButton, Object.assign({ variant: "contained", size: "small", type: "submit", onClick: () => onClickSubmit() }, { children: Submit })), jsxRuntimeExports.jsx(Button, Object.assign({ variant: "text",
|
|
53632
|
+
} }, { children: [jsxRuntimeExports.jsx(SubmitButton, Object.assign({ variant: "contained", size: "small", type: "submit", onClick: () => onClickSubmit(), sx: Object.assign({}, buttonStyleProps) }, { children: Submit })), jsxRuntimeExports.jsx(Button, Object.assign({ variant: "text",
|
|
53633
53633
|
// color="error"
|
|
53634
53634
|
size: "small", sx: {
|
|
53635
53635
|
textTransform: "none",
|
|
@@ -53667,7 +53667,7 @@ const secondsToMMSS = (totalSeconds) => {
|
|
|
53667
53667
|
return `${formattedMinutes}:${formattedSeconds}`;
|
|
53668
53668
|
};
|
|
53669
53669
|
const promptBeforeValue = 120000;
|
|
53670
|
-
const SessionTimeOut = ({ sessionTime, handleSubmitSession, onSessionExpire, handleSessionCancel }) => {
|
|
53670
|
+
const SessionTimeOut = ({ sessionTime, handleSubmitSession, onSessionExpire, handleSessionCancel, SubmitButtonName = 'Submit', buttonStyleProps }) => {
|
|
53671
53671
|
const [openConfirmModal, setOpenConfirmModal] = useState(false);
|
|
53672
53672
|
const expiryDetails = sessionTime;
|
|
53673
53673
|
const providedTimestamp = new Date(expiryDetails).getTime();
|
|
@@ -53713,7 +53713,7 @@ const SessionTimeOut = ({ sessionTime, handleSubmitSession, onSessionExpire, han
|
|
|
53713
53713
|
}, [promptBeforeIdle, getRemainingTime]);
|
|
53714
53714
|
const sessionMessage = `Your session will expire in ${formattedRemainingTime} seconds. Do you want to extend the session?`;
|
|
53715
53715
|
console.log(promptBeforeIdle, 'promptBeforeIdle');
|
|
53716
|
-
return (jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: jsxRuntimeExports.jsx(ConfirmationDialog, { openConfirmDialog: openConfirmModal, handleCancel: handleCancel, onClickSubmit: handleSubmit, text: sessionMessage }) }));
|
|
53716
|
+
return (jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: jsxRuntimeExports.jsx(ConfirmationDialog, { openConfirmDialog: openConfirmModal, handleCancel: handleCancel, onClickSubmit: handleSubmit, text: sessionMessage, Submit: SubmitButtonName, buttonStyleProps: buttonStyleProps }) }));
|
|
53717
53717
|
};
|
|
53718
53718
|
|
|
53719
53719
|
export { DeleteField, FormRenderWrapper as RenderForm, SessionTimeOut as SessionTimeoutField, useFormValidatingContext };
|