@acuteinfo/common-screens 1.0.16 → 1.0.18

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.
package/dist/index.d.ts CHANGED
@@ -2,3 +2,4 @@ import "regenerator-runtime/runtime";
2
2
  import "buffer";
3
3
  export * from "./pages/auth/authController";
4
4
  export * from "./pages/auth/forgotPassword";
5
+ export * from "./pages/branchSelection/branchSelectionGrid";
package/dist/index.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import 'regenerator-runtime/runtime';
2
2
  import { jsx, jsxs, Fragment as Fragment$1 } from 'react/jsx-runtime';
3
- import { TextField, GradientButton, utilFunction } from '@acuteinfo/common-base';
4
- import { useState, useRef, useEffect, Fragment, useMemo, useReducer } from 'react';
3
+ import { TextField, GradientButton, utilFunction, ClearCacheProvider, queryClient, Alert, GridWrapper } from '@acuteinfo/common-base';
4
+ import { useState, useRef, useEffect, Fragment, useMemo, useReducer, useCallback } from 'react';
5
5
  import { makeStyles } from '@mui/styles';
6
6
  import Visibility from '@mui/icons-material/Visibility';
7
7
  import VisibilityOff from '@mui/icons-material/VisibilityOff';
8
- import { Container, Grid, InputAdornment, IconButton, CircularProgress, FormHelperText, Typography, Tooltip } from '@mui/material';
8
+ import { Container, Grid, InputAdornment, IconButton, CircularProgress, FormHelperText, Typography, Tooltip, tooltipClasses, Stack, Box, Avatar, Button } from '@mui/material';
9
9
  import { useTranslation } from 'react-i18next';
10
10
  import OTPInput, { ResendOTP } from 'otp-input-react';
11
11
  import IconButton$1 from '@mui/material/IconButton';
@@ -13,8 +13,12 @@ import clsx from 'clsx';
13
13
  import { useSnackbar } from 'notistack';
14
14
  import FingerprintSharpIcon from '@mui/icons-material/FingerprintSharp';
15
15
  import CryptoJS from 'crypto-js';
16
+ import { useQuery, useMutation } from 'react-query';
17
+ import bank_logo_default from 'assets/images/BecomePartnerImg.svg';
18
+ import { styled } from '@mui/material/styles';
19
+ import USER_PROFILE_DEFAULT from 'assets/images/USER_PROFILE_DEFAULT.png';
16
20
 
17
- const useStyles = makeStyles((theme) => ({
21
+ const useStyles$1 = makeStyles((theme) => ({
18
22
  wrapper: {
19
23
  minHeight: "100vh",
20
24
  boxShadow: "0 3px 6px rgba(0,0,0,0.03)",
@@ -186,8 +190,7 @@ const useStyles = makeStyles((theme) => ({
186
190
  },
187
191
  }));
188
192
 
189
- // import { Language_App } from "pages_audit/appBar/language";
190
- const UsernamePasswordField = ({ classes, loginState, verifyUsernamePassword, forgotPasswordEndpoint }) => {
193
+ const UsernamePasswordField = ({ classes, loginState, verifyUsernamePassword, forgotPasswordEndpoint, }) => {
191
194
  const [input, setInput] = useState({ userName: "", password: "" });
192
195
  const [showPasswordTime, setShowPasswordTime] = useState(0);
193
196
  const showPassword = Date.now() < showPasswordTime;
@@ -601,8 +604,8 @@ function styleInject(css, ref) {
601
604
  }
602
605
  }
603
606
 
604
- var css_248z = ".spinner-wrap{position:relative}.spinner-item{animation:zoom 2s linear .75s infinite;border:1px solid #949597;border-radius:50%;height:250px;left:50%;opacity:0;position:absolute;top:50%;transform:translate(-50%,-50%);width:250px}.spinner-item--2{animation-delay:1.25s}.spinner-item--3{animation-delay:1.75s}@keyframes zoom{0%{opacity:0;transform:translate(-50%,-50%) scale(.1)}50%{opacity:1}to{opacity:0;transform:translate(-50%,-50%) scale(.6)}}.image{height:50px;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%)}.progress{backdrop-filter:blur(2px) brightness(101%);border:1px solid #b0b0b0;border-radius:4px;box-shadow:0 0 3px #b0b0;margin:0 auto;width:20em}.bar{background:#4263c7;height:4px;width:65%}";
605
- styleInject(css_248z);
607
+ var css_248z$1 = ".spinner-wrap{position:relative}.spinner-item{animation:zoom 2s linear .75s infinite;border:1px solid #949597;border-radius:50%;height:250px;left:50%;opacity:0;position:absolute;top:50%;transform:translate(-50%,-50%);width:250px}.spinner-item--2{animation-delay:1.25s}.spinner-item--3{animation-delay:1.75s}@keyframes zoom{0%{opacity:0;transform:translate(-50%,-50%) scale(.1)}50%{opacity:1}to{opacity:0;transform:translate(-50%,-50%) scale(.6)}}.image{height:50px;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%)}.progress{backdrop-filter:blur(2px) brightness(101%);border:1px solid #b0b0b0;border-radius:4px;box-shadow:0 0 3px #b0b0;margin:0 auto;width:20em}.bar{background:#4263c7;height:4px;width:65%}";
608
+ styleInject(css_248z$1);
606
609
 
607
610
  const VerifyFinger = ({ classes, loginState, verifyFinger, previousStep, }) => {
608
611
  const { t } = useTranslation();
@@ -802,7 +805,7 @@ const matchFinger = async (rows, captureFinger) => {
802
805
  return promise;
803
806
  };
804
807
 
805
- const isBase64 = (str) => {
808
+ const isBase64 = (str = "") => {
806
809
  if (typeof str !== "string") {
807
810
  return false;
808
811
  }
@@ -813,7 +816,7 @@ const isBase64 = (str) => {
813
816
  const BankDetails = ({ bannerDetails }) => {
814
817
  const [loginImageURL, setLoginImageURL] = useState(null);
815
818
  const urlObj = useRef(null);
816
- const classes = useStyles();
819
+ const classes = useStyles$1();
817
820
  const banner = useMemo(() => bannerDetails, []);
818
821
  useEffect(() => {
819
822
  if (Boolean(banner?.bannerImg)) {
@@ -1204,10 +1207,8 @@ const reducer$1 = (state, action) => {
1204
1207
  }
1205
1208
  }
1206
1209
  };
1207
- const AuthControllerWrapper = ({ bannerDetails, logoUrl, loginFn, veirfyUsernameandPassword, verifyOTP, OTPResendRequest, ResetPassword, LanguageComponent, forgotPasswordEndpoint }) => {
1208
- // const { isLoggedIn, login } = useContext(AuthContext);
1209
- const classes = useStyles();
1210
- // const navigate = useNavigate();
1210
+ const AuthControllerWrapper = ({ bannerDetails, logoUrl, logoTitle, loginFn, veirfyUsernameandPassword, verifyOTP, OTPResendRequest, ResetPassword, LanguageComponent, forgotPasswordEndpoint, }) => {
1211
+ const classes = useStyles$1();
1211
1212
  const [loginState, dispath] = useReducer(reducer$1, inititalState$1);
1212
1213
  const [openpwdreset, setOpenPwdReset] = useState(false);
1213
1214
  const failureCount = useRef(0);
@@ -1431,7 +1432,7 @@ const AuthControllerWrapper = ({ bannerDetails, logoUrl, loginFn, veirfyUsername
1431
1432
  });
1432
1433
  }
1433
1434
  };
1434
- return (jsx(Fragment$1, { children: jsxs(Grid, { container: true, style: { height: "100vh", overflow: "hidden" }, children: [jsx(BankDetails, { bannerDetails: bannerDetails }), jsxs(Grid, { item: true, xs: 11, md: 6, lg: 6, sm: 6, children: [jsx(Grid, { container: true, direction: "row", justifyContent: "flex-end", alignItems: "center", padding: "25px", maxWidth: "210px", ml: "auto", children: jsx(Tooltip, { describeChild: true, title: "Enfinity-CBS-UI-V1.0.17", children: jsx("img", { src: Boolean(dashboardLogoURL) ? dashboardLogoURL : "", alt: "Logo", width: "100%" }) }) }), jsx(Grid, { container: true, direction: "row", justifyContent: "flex-end", alignItems: "center", padding: "0 35px 0 0", maxWidth: "180px", ml: "auto", children: jsx(LanguageComponent, {}) }), openpwdreset ? (jsx(PasswordRotation, { classes: classes, ResetPassword: ResetPassword, open: openpwdreset, username: loginState.username, accessToken: loginState.access_token, tokenType: loginState.token_type, handleClose: handlePasswordRotationClose })) : (jsx(Fragment$1, { children: loginState.currentFlow === "username" ? (jsx(UsernamePasswordField, { classes: classes, loginState: loginState, verifyUsernamePassword: verifyUsernamePassword, forgotPasswordEndpoint: forgotPasswordEndpoint }, "username")) : (jsx(Fragment$1, { children: loginState.authType === "OTP" ? (jsx(OTPModel, { OTPResendRequest: OTPResendRequest, classes: classes, loginState: loginState, VerifyOTP: VerifyOTP, previousStep: changeUserName, OTPError: t(loginState?.OtpuserMessage ?? ""), setOTPError: (error) => {
1435
+ return (jsx(Fragment$1, { children: jsxs(Grid, { container: true, style: { height: "100vh", overflow: "hidden" }, children: [jsx(BankDetails, { bannerDetails: bannerDetails }), jsxs(Grid, { item: true, xs: 11, md: 6, lg: 6, sm: 6, children: [logoUrl ? (jsx(Grid, { container: true, direction: "row", justifyContent: "flex-end", alignItems: "center", padding: "25px", maxWidth: "210px", ml: "auto", children: jsx(Tooltip, { describeChild: true, title: logoTitle ?? "", children: jsx("img", { src: Boolean(dashboardLogoURL) ? dashboardLogoURL : "", alt: "Logo", width: "100%" }) }) })) : null, LanguageComponent ? (jsx(Grid, { container: true, direction: "row", justifyContent: "flex-end", alignItems: "center", padding: "0 35px 0 0", maxWidth: "180px", ml: "auto", children: jsx(LanguageComponent, {}) })) : null, openpwdreset ? (jsx(PasswordRotation, { classes: classes, ResetPassword: ResetPassword, open: openpwdreset, username: loginState.username, accessToken: loginState.access_token, tokenType: loginState.token_type, handleClose: handlePasswordRotationClose })) : (jsx(Fragment$1, { children: loginState.currentFlow === "username" ? (jsx(UsernamePasswordField, { classes: classes, loginState: loginState, verifyUsernamePassword: verifyUsernamePassword, forgotPasswordEndpoint: forgotPasswordEndpoint }, "username")) : (jsx(Fragment$1, { children: loginState.authType === "OTP" ? (jsx(OTPModel, { OTPResendRequest: OTPResendRequest, classes: classes, loginState: loginState, VerifyOTP: VerifyOTP, previousStep: changeUserName, OTPError: t(loginState?.OtpuserMessage ?? ""), setOTPError: (error) => {
1435
1436
  dispath({
1436
1437
  type: "OTPVerificationFailed",
1437
1438
  payload: { error: error },
@@ -1458,7 +1459,7 @@ const AuthControllerWrapper = ({ bannerDetails, logoUrl, loginFn, veirfyUsername
1458
1459
  }, otpresendCount: otpResendRef.current }, "OTPForm")] })) : (jsx(VerifyFinger, { classes: classes, loginState: loginState, verifyFinger: verifyFinger, previousStep: changeUserName }, "biometric")) })) }))] })] }) }));
1459
1460
  };
1460
1461
 
1461
- const ForgotPasswordFields = ({ classes, loginState, onSubmit, navigate, loginPageEndpoint }) => {
1462
+ const ForgotPasswordFields = ({ classes, loginState, onSubmit, navigate, loginPageEndpoint, }) => {
1462
1463
  const [input, setInput] = useState({
1463
1464
  userName: loginState.workingState === 1 ? loginState?.username : "",
1464
1465
  mobileno: "",
@@ -1722,8 +1723,8 @@ const reducer = (state, action) => {
1722
1723
  }
1723
1724
  }
1724
1725
  };
1725
- const ForgotPasswordControllerWrapper = ({ screenFlag, updatenewPassword, veirfyUsernameandMobileNo, verifyOTPForPWDReset, logoUrl, LanguageComponent, bannerDetails, navigate, loginPageEndpoint }) => {
1726
- const classes = useStyles();
1726
+ const ForgotPasswordControllerWrapper = ({ screenFlag, updatenewPassword, veirfyUsernameandMobileNo, verifyOTPForPWDReset, logoUrl, logoTitle, LanguageComponent, bannerDetails, navigate, loginPageEndpoint, }) => {
1727
+ const classes = useStyles$1();
1727
1728
  const [loginState, dispath] = useReducer(reducer, inititalState);
1728
1729
  const [open, setOpen] = useState(false);
1729
1730
  const { enqueueSnackbar } = useSnackbar();
@@ -1902,7 +1903,7 @@ const ForgotPasswordControllerWrapper = ({ screenFlag, updatenewPassword, veirfy
1902
1903
  });
1903
1904
  }
1904
1905
  };
1905
- return (jsx(Fragment$1, { children: jsxs(Grid, { container: true, style: { height: "100vh", overflow: "hidden" }, children: [jsx(BankDetails, { bannerDetails: bannerDetails }), jsxs(Grid, { item: true, xs: 6, md: 6, lg: 6, sm: 6, children: [jsx(Grid, { container: true, direction: "row", justifyContent: "flex-end", alignItems: "center", padding: "31px", maxWidth: "210px", ml: "auto", children: jsx("img", { src: Boolean(dashboardLogoURL) ? dashboardLogoURL : "", alt: "Logo", width: "100%" }) }), jsx(Grid, { container: true, direction: "row", justifyContent: "flex-end", alignItems: "center", padding: "0 35px 0 0", maxWidth: "180px", ml: "auto", children: jsx(LanguageComponent, {}) }), jsx(Container, { maxWidth: "xs", children: jsxs(Grid, { alignItems: "center", style: { paddingTop: "20px" }, children: [jsx("h2", { style: { margin: "10px 0" }, children: loginState.workingState === 1
1906
+ return (jsx(Fragment$1, { children: jsxs(Grid, { container: true, style: { height: "100vh", overflow: "hidden" }, children: [jsx(BankDetails, { bannerDetails: bannerDetails }), jsxs(Grid, { item: true, xs: 6, md: 6, lg: 6, sm: 6, children: [logoUrl ? (jsx(Grid, { container: true, direction: "row", justifyContent: "flex-end", alignItems: "center", padding: "31px", maxWidth: "210px", ml: "auto", children: jsx("img", { src: Boolean(dashboardLogoURL) ? dashboardLogoURL : "", alt: "Logo", width: "100%" }) })) : null, LanguageComponent ? (jsx(Grid, { container: true, direction: "row", justifyContent: "flex-end", alignItems: "center", padding: "0 35px 0 0", maxWidth: "180px", ml: "auto", children: jsx(LanguageComponent, {}) })) : null, jsx(Container, { maxWidth: "xs", children: jsxs(Grid, { alignItems: "center", style: { paddingTop: "20px" }, children: [jsx("h2", { style: { margin: "10px 0" }, children: loginState.workingState === 1
1906
1907
  ? t("Setnewpassword")
1907
1908
  : screenFlag === "totp"
1908
1909
  ? "Forgot TOTP"
@@ -1920,5 +1921,360 @@ const ForgotPasswordControllerWrapper = ({ screenFlag, updatenewPassword, veirfy
1920
1921
  }, otpresendCount: otpResendRef.current, OTPResendRequest: undefined })) : (jsx(ForgotPasswordFields, { classes: classes, loginState: loginState, onSubmit: onSubmitHandel, navigate: navigate, loginPageEndpoint: loginPageEndpoint }))] }) })] })] }) }));
1921
1922
  };
1922
1923
 
1923
- export { AuthControllerWrapper, ForgotPasswordControllerWrapper, ValidatePassword };
1924
+ const BranchSelectionGridMetaData = {
1925
+ gridConfig: {
1926
+ dense: true,
1927
+ gridLabel: "Access Branch List",
1928
+ rowIdColumn: "BRANCH_CD",
1929
+ // searchPlaceholder: "Branches",
1930
+ defaultColumnConfig: {
1931
+ width: 400,
1932
+ maxWidth: 450,
1933
+ minWidth: 300,
1934
+ },
1935
+ allowColumnReordering: false,
1936
+ disableSorting: false,
1937
+ hideHeader: false,
1938
+ disableGroupBy: true,
1939
+ enablePagination: false,
1940
+ containerHeight: {
1941
+ min: "68vh",
1942
+ max: "68vh ",
1943
+ },
1944
+ allowFilter: false,
1945
+ allowColumnHiding: false,
1946
+ allowRowSelection: false,
1947
+ isCusrsorFocused: true,
1948
+ hideFooter: true,
1949
+ },
1950
+ columns: [
1951
+ {
1952
+ accessor: "BRANCH_CD",
1953
+ columnName: "Branch Code",
1954
+ sequence: 1,
1955
+ alignment: "left",
1956
+ componentType: "default",
1957
+ width: 200,
1958
+ minWidth: 140,
1959
+ maxWidth: 220,
1960
+ },
1961
+ {
1962
+ accessor: "BRANCH_NM",
1963
+ columnName: "Branch Name",
1964
+ sequence: 2,
1965
+ alignment: "left",
1966
+ componentType: "default",
1967
+ width: 280,
1968
+ minWidth: 280,
1969
+ maxWidth: 420,
1970
+ },
1971
+ {
1972
+ accessor: "DISP_STATUS",
1973
+ columnName: "Status",
1974
+ sequence: 3,
1975
+ alignment: "left",
1976
+ componentType: "default",
1977
+ width: 200,
1978
+ minWidth: 140,
1979
+ maxWidth: 220,
1980
+ },
1981
+ {
1982
+ accessor: "BEGIN_DATETIME",
1983
+ columnName: "Begin Time",
1984
+ sequence: 4,
1985
+ alignment: "left",
1986
+ componentType: "dateTime",
1987
+ width: 222,
1988
+ minWidth: 140,
1989
+ maxWidth: 240,
1990
+ },
1991
+ {
1992
+ accessor: "END_DATETIME",
1993
+ columnName: "End Time",
1994
+ sequence: 5,
1995
+ alignment: "left",
1996
+ componentType: "dateTime",
1997
+ width: 222,
1998
+ minWidth: 140,
1999
+ maxWidth: 240,
2000
+ },
2001
+ {
2002
+ accessor: "DAYEND_STATUS",
2003
+ columnName: "Dayend Status",
2004
+ sequence: 6,
2005
+ componentType: "default",
2006
+ isVisible: false,
2007
+ },
2008
+ {
2009
+ accessor: "EOD_RUNNING_STATUS",
2010
+ columnName: "EOD Running Status",
2011
+ sequence: 6,
2012
+ componentType: "default",
2013
+ isVisible: false,
2014
+ },
2015
+ {
2016
+ accessor: "BASE_COMP_CD",
2017
+ columnName: "Base Comp Cd",
2018
+ sequence: 6,
2019
+ componentType: "default",
2020
+ isVisible: false,
2021
+ },
2022
+ {
2023
+ accessor: "BASE_BRANCH_CD",
2024
+ columnName: "Base Branch Cd",
2025
+ sequence: 6,
2026
+ componentType: "default",
2027
+ isVisible: false,
2028
+ },
2029
+ {
2030
+ accessor: "COMP_CD",
2031
+ columnName: "Comp Cd",
2032
+ sequence: 6,
2033
+ componentType: "default",
2034
+ isVisible: false,
2035
+ },
2036
+ {
2037
+ accessor: "COMP_NM",
2038
+ columnName: "Comp Name",
2039
+ sequence: 6,
2040
+ componentType: "default",
2041
+ isVisible: false,
2042
+ },
2043
+ ],
2044
+ };
2045
+
2046
+ var css_248z = "*{box-sizing:border-box}*,.sideImage{margin:0;padding:0}.sideImage{display:flex;height:100%;position:relative;z-index:1}.bank-name,.emp-id{font-size:18px;font-weight:600;line-height:1em;margin:8px 0}.bank-name{word-wrap:break-word}.name-heading{color:var(--theme-color1);font-weight:400;position:relative;z-index:1}.name-heading span{color:var(--theme-color1);font-weight:700}";
2047
+ styleInject(css_248z);
2048
+
2049
+ var Waving_hand = "waving-hand.png";
2050
+
2051
+ const useStyles = makeStyles((theme) => ({
2052
+ heading_user_img: {
2053
+ width: "40px",
2054
+ height: "40px",
2055
+ // cursor: "pointer",
2056
+ },
2057
+ heading_user_img_border: {
2058
+ border: "2px dashed var(--theme-color3)",
2059
+ borderRadius: "50%",
2060
+ padding: "4px",
2061
+ },
2062
+ logo: {
2063
+ height: "38px",
2064
+ },
2065
+ }));
2066
+
2067
+ // import Logo from "assets/images/easy_bankcore_Logo.png";
2068
+ // import useLogoPics from "components/common/logoPics/logoPics";
2069
+ // import Greetings from "components/common/logoPics/greet/greetings";
2070
+ const actions = [
2071
+ {
2072
+ actionName: "back",
2073
+ actionLabel: "Back",
2074
+ multiple: false,
2075
+ rowDoubleClick: false,
2076
+ // actionTextColor: "var(--theme-color3)",
2077
+ // actionBackground: "var(--theme-color2)",
2078
+ // startsIcon: "West",
2079
+ // rotateIcon: "scale(1.4) rotateX(-360deg)",
2080
+ },
2081
+ {
2082
+ actionName: "proceed",
2083
+ actionLabel: "Proceed",
2084
+ multiple: false,
2085
+ rowDoubleClick: true,
2086
+ // actionTextColor: "var(--theme-color2)",
2087
+ // actionBackground: "var(--theme-color3)",
2088
+ // onEnterSubmit: true,
2089
+ // endsIcon: "East",
2090
+ // rotateIcon: "scale(1.4) rotateX(-360deg)",
2091
+ },
2092
+ ];
2093
+ const BranchSelectionGrid = ({ selectionMode, authState, isBranchSelectedFn, isLoggedInFn, logoutFn, logos, logo, navigate, BranchSelectionGridDataApiFn, GetMenuDataApiFn, sideImage, branchSelectFn, dashboardUrl, loginUrl }) => {
2094
+ // const { authState, isBranchSelected, branchSelect, isLoggedIn, logout } =
2095
+ // useContext(AuthContext);
2096
+ // const navigate = useNavigate();
2097
+ // const logos = useLogoPics();
2098
+ const classes = useStyles();
2099
+ const { enqueueSnackbar } = useSnackbar();
2100
+ const { data, isLoading, isFetching, refetch, error, isError } = useQuery(["BranchSelectionGridData"], () => BranchSelectionGridDataApiFn());
2101
+ useEffect(() => {
2102
+ return () => {
2103
+ queryClient.removeQueries(["BranchSelectionGridData", {}]);
2104
+ };
2105
+ }, []);
2106
+ // const imagesData = useQuery<any, any>(["getBankimgAndProfileimg"], () =>
2107
+ // getBankimgAndProfileimg({
2108
+ // userID: authController?.authState?.user?.id,
2109
+ // companyID: authController?.authState?.access_token?.companyID,
2110
+ // })
2111
+ // );
2112
+ useEffect(() => {
2113
+ if (!isLoggedInFn()) {
2114
+ navigate(loginUrl);
2115
+ }
2116
+ else if (isBranchSelectedFn() && selectionMode !== "C") {
2117
+ navigate(dashboardUrl);
2118
+ }
2119
+ }, [isBranchSelectedFn, isLoggedInFn]);
2120
+ const mutation = useMutation(GetMenuDataApiFn, {
2121
+ onSuccess: (data, extreData) => {
2122
+ branchSelectFn({
2123
+ menulistdata: data,
2124
+ branchCode: extreData?.BRANCH_CD,
2125
+ branch: extreData?.BRANCH_NM,
2126
+ baseBranchCode: extreData?.BASE_BRANCH_CD,
2127
+ });
2128
+ },
2129
+ });
2130
+ const getError = mutation.error;
2131
+ const setCurrentAction = useCallback((data) => {
2132
+ if (data.name === "proceed") {
2133
+ if (data.rows?.length === 0) {
2134
+ enqueueSnackbar("Please Select Branch", {
2135
+ variant: "error",
2136
+ });
2137
+ }
2138
+ else if (data.rows?.[0]?.data?.STATUS === "C") {
2139
+ enqueueSnackbar("Branch is in Day End Status.~rPlease contact system Vendor.", {
2140
+ variant: "error",
2141
+ });
2142
+ }
2143
+ else {
2144
+ mutation.mutate({
2145
+ BASE_COMP_CD: data.rows?.[0]?.data?.BASE_COMP_CD ?? "",
2146
+ BASE_BRANCH_CD: data.rows?.[0]?.data?.BASE_BRANCH_CD ?? "",
2147
+ COMP_CD: data.rows?.[0]?.data?.COMP_CD ?? "",
2148
+ BRANCH_CD: data.rows?.[0]?.data?.BRANCH_CD ?? "",
2149
+ GROUP_NAME: authState?.groupName ?? "",
2150
+ APP_TRAN_CD: "51",
2151
+ COMP_NM: data.rows?.[0]?.data?.COMP_NM ?? "",
2152
+ BRANCH_NM: data.rows?.[0]?.data?.BRANCH_NM ?? "",
2153
+ DAYEND_STATUS: data.rows?.[0]?.data?.DAYEND_STATUS ?? "",
2154
+ EOD_RUNNING_STATUS: data.rows?.[0]?.data?.EOD_RUNNING_STATUS ?? "",
2155
+ IS_UPD_DEF_BRANCH: authState?.user?.isUpdDefBranch ?? "",
2156
+ COMP_BASE_BRANCH_CD: data.rows?.[0]?.data?.COMP_BASE_BRANCH_CD ?? "",
2157
+ selectionMode,
2158
+ });
2159
+ }
2160
+ }
2161
+ else if (data.name === "back") {
2162
+ if (selectionMode === "C") {
2163
+ navigate(dashboardUrl, {
2164
+ replace: true,
2165
+ });
2166
+ }
2167
+ else {
2168
+ logoutFn();
2169
+ }
2170
+ }
2171
+ }, [navigate, data, mutation]);
2172
+ useEffect(() => {
2173
+ var oneBranchOpen = data?.some((branch) => branch.STATUS === "O");
2174
+ if (oneBranchOpen === false) {
2175
+ enqueueSnackbar("Branch is in Day End Status.~rPlease contact system Vendor.", {
2176
+ variant: "error",
2177
+ });
2178
+ logoutFn();
2179
+ }
2180
+ if (data?.length === 1) {
2181
+ if (data?.[0]?.STATUS === "O") {
2182
+ setCurrentAction({ name: "proceed", rows: [{ data: { ...data[0] } }] });
2183
+ }
2184
+ }
2185
+ }, [JSON.stringify(data)]);
2186
+ const Greetings = () => {
2187
+ let hours = new Date().getHours();
2188
+ let greet;
2189
+ if (hours < 12)
2190
+ greet = "morning";
2191
+ else if (hours >= 12 && hours <= 16)
2192
+ greet = "afternoon";
2193
+ else if (hours >= 16 && hours <= 24)
2194
+ greet = "evening";
2195
+ return jsxs("span", { children: ["Good ", greet, ","] });
2196
+ };
2197
+ const LightTooltip = styled(({ className, ...props }) => (jsx(Tooltip, { ...props, classes: { popper: className } })))(({ theme }) => ({
2198
+ [`& .${tooltipClasses.tooltip}`]: {
2199
+ backgroundColor: theme.palette.common.white,
2200
+ color: "rgba(0, 0, 0, 0.87)",
2201
+ boxShadow: theme.shadows[1],
2202
+ fontSize: 13,
2203
+ },
2204
+ }));
2205
+ // const greet = Greetings();
2206
+ return (jsx(Fragment$1, { children: jsxs(Grid, { container: true, style: {
2207
+ margin: "0",
2208
+ padding: "0",
2209
+ height: "100vh",
2210
+ // overflowY: "hidden",
2211
+ }, children: [jsx(Grid, { item: true, lg: 1, md: 1, xl: 1, xs: 1, sm: 1, children: jsx("img", { className: "sideImage", src: sideImage, alt: "side-Image" }) }), jsx(Grid, { item: true, lg: 11, md: 11, xl: 11, xs: 11, style: {
2212
+ display: "flex",
2213
+ justifyContent: "center",
2214
+ }, children: jsxs(Grid, { container: true, style: {
2215
+ minHeight: "100vh",
2216
+ padding: "10px 0px 0px 0px",
2217
+ }, lg: 11, md: 11, xl: 11, xs: 11, children: [jsxs(Grid, { container: true, style: {
2218
+ margin: "0",
2219
+ padding: "0",
2220
+ // height: "12vh",
2221
+ }, lg: 12, md: 12, xl: 12, xs: 12, children: [jsx(Grid, { xs: 12, sm: 1, md: 1, lg: 1, xl: 1, sx: {
2222
+ display: "flex",
2223
+ alignItems: "center",
2224
+ // justifyContent: "center",
2225
+ }, children: jsx(Stack, { direction: "row", spacing: 4, ml: 1, children: jsx(Box, { className: classes.heading_user_img_border, sx: { cursor: "pointer" }, children: jsx(LightTooltip, { title: jsxs(Fragment$1, { children: [jsxs("div", { children: ["User ID : ", authState?.user?.id ?? ""] }), jsxs("div", { children: ["Role : ", authState?.roleName ?? ""] }), jsx("div", { children: "Last Unsuccessful Login : \"\"" })] }), placement: "bottom-start", children: jsx(Avatar, { className: classes.heading_user_img,
2226
+ // onClick={handleNavigate}
2227
+ alt: "Remy Sharp", src: Boolean(logos?.profile)
2228
+ ? logos?.profile
2229
+ : USER_PROFILE_DEFAULT }) }) }) }) }), jsxs(Grid, { xs: 12, sm: 5, md: 5, lg: 5, xl: 5, sx: {
2230
+ justifyContent: "center",
2231
+ display: "flex",
2232
+ flexDirection: "column",
2233
+ }, children: [jsxs("h1", { className: "name-heading", style: { fontSize: "24px", margin: "4px 0px" }, children: ["Welcome ", jsx("span", { children: `${authState?.user?.name ?? ""},` })] }), jsxs("div", { style: { display: "flex", alignItems: "center", gap: 10 }, children: [jsx("h3", { style: { margin: "4px 0px" }, children: Greetings() }), jsx("img", { src: Waving_hand, alt: "", style: { height: "18px" } })] })] }), jsx(Grid, { xs: 12, sm: 1, md: 1, lg: 1, xl: 1, sx: {
2234
+ display: "flex",
2235
+ // flexDirection: "column",
2236
+ justifyContent: "center",
2237
+ alignItems: "center",
2238
+ }, children: jsx(Stack, { direction: "row", justifyContent: "flex-start", spacing: 2, children: jsx(Box, { className: classes.heading_user_img_border, children: jsx(Avatar, { className: classes.heading_user_img, alt: "Remy Sharp", src: Boolean(logos?.bank) ? logos?.bank : bank_logo_default }) }) }) }), jsxs(Grid, { xs: 12, sm: 3, md: 3, lg: 3, xl: 3, sx: {
2239
+ display: "flex",
2240
+ flexDirection: "column",
2241
+ justifyContent: "center",
2242
+ }, children: [jsx("div", { className: "bank-name-container", style: { fontSize: "14px" }, children: jsx("p", { className: "bank-name", children: `Bank Name: ${authState?.companyName ?? ""}` }) }), jsx("p", { className: "emp-id", children: `Emp. Id: ${authState?.user?.employeeID ?? ""}` })] }), jsxs(Grid, { xs: 12, sm: 3, md: 3, lg: 2, xl: 2, sx: {
2243
+ display: "flex",
2244
+ alignItems: "center",
2245
+ justifyContent: "right",
2246
+ }, children: [" ", jsx("div", { children: jsx("img", { src: Boolean(logos?.logo) ? logos?.logo : logo, alt: "CbsEnfinity", className: classes.logo }) })] })] }), isError ? (jsx(Fragment, { children: jsx("div", { style: { width: "100%", paddingTop: "10px" }, children: jsx(Alert, { severity: error?.severity ?? "error", errorMsg: error?.error_msg ?? "Error", errorDetail: error?.error_detail ?? "" }) }) })) : mutation.isError && mutation.error ? (jsx(Fragment, { children: jsx("div", { style: { width: "100%", paddingTop: "10px" }, children: jsx(Alert, { severity: getError.severity ?? "error", errorMsg: getError.error_msg ?? "Error", errorDetail: getError.error_detail ?? "" }) }) })) : null, jsx(GridWrapper, { finalMetaData: BranchSelectionGridMetaData, data: data ?? [], setData: () => null, actions: actions, setAction: setCurrentAction,
2247
+ // controlsAtBottom={true}
2248
+ // headerToolbarStyle={{
2249
+ // background: "var(--theme-color2)",
2250
+ // color: "black",
2251
+ // padding: "0",
2252
+ // }}
2253
+ // onlySingleSelectionAllow={true}
2254
+ // isNewRowStyle={true}
2255
+ loading: isLoading || isFetching || mutation.isLoading }, `branchSelection`), isError || data?.length === 0 ? (jsx(Button, { sx: {
2256
+ backgroundColor: "var(--theme-color3)",
2257
+ position: "absolute",
2258
+ right: "113px",
2259
+ bottom: "20px",
2260
+ width: "7rem",
2261
+ "&:hover": {
2262
+ backgroundColor: "var(--theme-color3)",
2263
+ },
2264
+ }, onClick: () => {
2265
+ if (selectionMode === "C") {
2266
+ navigate(dashboardUrl, {
2267
+ replace: true,
2268
+ });
2269
+ }
2270
+ else {
2271
+ logoutFn();
2272
+ }
2273
+ }, children: "Back" })) : null] }) })] }) }));
2274
+ };
2275
+ const BranchSelectionGridWrapper = (props) => {
2276
+ return (jsx(ClearCacheProvider, { children: jsx(BranchSelectionGrid, { ...props }) }));
2277
+ };
2278
+
2279
+ export { AuthControllerWrapper, BranchSelectionGridWrapper, ForgotPasswordControllerWrapper, ValidatePassword };
1924
2280
  //# sourceMappingURL=index.js.map