@tap-payments/auth-jsconnect 2.0.38-test → 2.0.40-test
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/build/app/settings.js +8 -2
- package/build/components/AnimationFlow/Dialog.js +2 -2
- package/build/constants/app.d.ts +2 -0
- package/build/constants/app.js +2 -0
- package/build/features/auth/Auth.d.ts +1 -0
- package/build/features/auth/Auth.js +10 -4
- package/build/features/bank/Bank.js +10 -4
- package/build/features/business/Business.js +10 -4
- package/build/features/connect/Connect.js +10 -4
- package/build/features/entity/Entity.js +10 -4
- package/build/features/individual/Individual.js +10 -4
- package/build/features/password/Password.js +10 -4
- package/build/features/shared/Background/Background.d.ts +3 -1
- package/build/features/shared/Background/Background.js +12 -5
- package/build/features/signIn/SignIn.js +10 -3
- package/build/features/tax/Tax.js +10 -3
- package/build/hooks/useAppConfig.js +2 -0
- package/build/utils/html.d.ts +1 -0
- package/build/utils/html.js +6 -0
- package/package.json +1 -1
package/build/app/settings.js
CHANGED
|
@@ -47,8 +47,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
47
47
|
};
|
|
48
48
|
var _a;
|
|
49
49
|
import { createAsyncThunk, createSlice } from '@reduxjs/toolkit';
|
|
50
|
-
import { getStoredData, storeData, isArray, findItem, getBrowserInfo, getFingerPrint, sortCountries, findCountryByIso2, getRequestHeaders, encryptString } from '../utils';
|
|
51
|
-
import { defaultCountry, DefaultDeviceInfo, LOCAL_STORAGE_KEYS } from '../constants';
|
|
50
|
+
import { getStoredData, storeData, isArray, findItem, getBrowserInfo, getFingerPrint, sortCountries, findCountryByIso2, getRequestHeaders, encryptString, removeElement } from '../utils';
|
|
51
|
+
import { defaultCountry, DefaultDeviceInfo, LOCAL_STORAGE_KEYS, DIALOG_ID, BACKGROUND_ID } from '../constants';
|
|
52
52
|
import i18n from '../i18n';
|
|
53
53
|
import { updateLocale } from '../utils/locale';
|
|
54
54
|
import API, { setAxiosGlobalHeaders } from '../api';
|
|
@@ -141,6 +141,12 @@ export var settingsSlice = createSlice({
|
|
|
141
141
|
},
|
|
142
142
|
handleOpen: function (state, action) {
|
|
143
143
|
state.data.open = action.payload;
|
|
144
|
+
if (action.payload === false) {
|
|
145
|
+
setTimeout(function () {
|
|
146
|
+
removeElement(DIALOG_ID);
|
|
147
|
+
removeElement(BACKGROUND_ID);
|
|
148
|
+
}, 1000);
|
|
149
|
+
}
|
|
144
150
|
},
|
|
145
151
|
handleSkin: function (state, action) {
|
|
146
152
|
state.data.skin = action.payload;
|
|
@@ -27,7 +27,7 @@ import DialogContent from '@mui/material/DialogContent';
|
|
|
27
27
|
import Paper from '@mui/material/Paper';
|
|
28
28
|
import Box from '@mui/material/Box';
|
|
29
29
|
import { styled } from '@mui/material/styles';
|
|
30
|
-
import { ICONS_NAMES } from '../../constants';
|
|
30
|
+
import { DIALOG_ID, ICONS_NAMES } from '../../constants';
|
|
31
31
|
import { useLanguage } from '../../hooks';
|
|
32
32
|
import Slide from '../Slide';
|
|
33
33
|
import LogoBadge from '../LogoBadge';
|
|
@@ -98,7 +98,7 @@ var Dialog = function (_a) {
|
|
|
98
98
|
if (animationType === 'slide') {
|
|
99
99
|
Object.assign(animation, { TransitionComponent: Transition });
|
|
100
100
|
}
|
|
101
|
-
return (_jsxs(MuiDialog, __assign({ PaperProps: {
|
|
101
|
+
return (_jsxs(MuiDialog, __assign({ id: DIALOG_ID, PaperProps: {
|
|
102
102
|
elevation: 0
|
|
103
103
|
}, sx: {
|
|
104
104
|
'& .MuiDialog-paper': {
|
package/build/constants/app.d.ts
CHANGED
|
@@ -12,6 +12,8 @@ export declare const EXTERNAL_LINKS: {
|
|
|
12
12
|
TRANSACTION_EN: string;
|
|
13
13
|
TRANSACTION_AR: string;
|
|
14
14
|
};
|
|
15
|
+
export declare const DIALOG_ID = "auth-js-connect-dialog";
|
|
16
|
+
export declare const BACKGROUND_ID = "auth-js-connect-background";
|
|
15
17
|
export declare const CONNECT_SCREENS_NAVIGATION: Array<ScreenStepNavigation>;
|
|
16
18
|
export declare const BUSINESS_SCREENS_NAVIGATION: Array<ScreenStepNavigation>;
|
|
17
19
|
export declare const INDIVIDUAL_SCREENS_NAVIGATION: Array<ScreenStepNavigation>;
|
package/build/constants/app.js
CHANGED
|
@@ -12,6 +12,8 @@ export var EXTERNAL_LINKS = {
|
|
|
12
12
|
TRANSACTION_EN: 'https://www.tap.company/sa/en/terms-conditions',
|
|
13
13
|
TRANSACTION_AR: 'https://www.tap.company/sa/ar/terms-conditions'
|
|
14
14
|
};
|
|
15
|
+
export var DIALOG_ID = 'auth-js-connect-dialog';
|
|
16
|
+
export var BACKGROUND_ID = 'auth-js-connect-background';
|
|
15
17
|
export var CONNECT_SCREENS_NAVIGATION = [
|
|
16
18
|
{
|
|
17
19
|
name: 'CONNECT_NID_STEP',
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { LibConfig } from '../../@types';
|
|
3
3
|
export interface AuthLibProps extends LibConfig {
|
|
4
4
|
leadId: string;
|
|
5
|
+
postURL: string;
|
|
5
6
|
}
|
|
6
7
|
export declare function AuthLib(props: AuthLibProps): JSX.Element;
|
|
7
8
|
export declare function renderAuthLib(config: AuthLibProps, elementId: string): void;
|
|
@@ -19,8 +19,8 @@ import { store } from '../../app/store';
|
|
|
19
19
|
import { authSelector } from '../app/auth/authStore';
|
|
20
20
|
import { ReduxProvider, ThemeProvider } from '../../components/Providers';
|
|
21
21
|
import Collapse from '../../components/Collapse';
|
|
22
|
-
import { reactElement } from '../../utils';
|
|
23
|
-
import { AUTH_SCREENS_NAVIGATION } from '../../constants';
|
|
22
|
+
import { reactElement, removeElement } from '../../utils';
|
|
23
|
+
import { AUTH_SCREENS_NAVIGATION, DIALOG_ID } from '../../constants';
|
|
24
24
|
import { authFeatureScreens } from '../featuresScreens';
|
|
25
25
|
import Background from '../shared/Background';
|
|
26
26
|
var Auth = memo(function (props) {
|
|
@@ -35,7 +35,7 @@ var Auth = memo(function (props) {
|
|
|
35
35
|
if (!props.leadId)
|
|
36
36
|
throw new Error('leadId is required');
|
|
37
37
|
}, []);
|
|
38
|
-
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading, sx: { position: 'absolute' } }, { children: _jsx(AnimationFlow, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading, error: error, open: open, footer: _jsx(_Fragment, {}), screenId: activeScreen.name, animationType: 'collapse' }, { children: _jsx(FeatureContainer, { children: authFeatureScreens.map(function (_a, index) {
|
|
38
|
+
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ open: open, isTapOrigin: isTapOrigin, loading: settingLoading, sx: { position: 'absolute' } }, { children: _jsx(AnimationFlow, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading, error: error, open: open, footer: _jsx(_Fragment, {}), screenId: activeScreen.name, animationType: 'collapse' }, { children: _jsx(FeatureContainer, { children: authFeatureScreens.map(function (_a, index) {
|
|
39
39
|
var Element = _a.element, name = _a.name;
|
|
40
40
|
var isActive = activeScreen.name === name;
|
|
41
41
|
return (_jsx(Collapse, __assign({ in: isActive, timeout: { enter: 1000, exit: 800 } }, { children: _jsx(Element, {}) }), index));
|
|
@@ -48,5 +48,11 @@ export function renderAuthLib(config, elementId) {
|
|
|
48
48
|
reactElement(elementId).render(_jsx(AuthLib, __assign({}, config)));
|
|
49
49
|
}
|
|
50
50
|
export function unmountAuthLib(elementId) {
|
|
51
|
-
|
|
51
|
+
var element = document.getElementById(elementId);
|
|
52
|
+
setTimeout(function () {
|
|
53
|
+
var _a;
|
|
54
|
+
((_a = element === null || element === void 0 ? void 0 : element.children) === null || _a === void 0 ? void 0 : _a.length) && element.removeChild(element.children[0]);
|
|
55
|
+
removeElement(DIALOG_ID);
|
|
56
|
+
reactElement(elementId).unmount();
|
|
57
|
+
}, 1000);
|
|
52
58
|
}
|
|
@@ -17,9 +17,9 @@ import AnimationFlow from '../../components/AnimationFlow';
|
|
|
17
17
|
import { store } from '../../app/store';
|
|
18
18
|
import { ReduxProvider, ThemeProvider } from '../../components/Providers';
|
|
19
19
|
import Collapse from '../../components/Collapse';
|
|
20
|
-
import { getParameterByName, reactElement } from '../../utils';
|
|
20
|
+
import { getParameterByName, reactElement, removeElement } from '../../utils';
|
|
21
21
|
import { FeatureContainer } from '../shared/Containers';
|
|
22
|
-
import { BANK_SCREENS_NAVIGATION } from '../../constants';
|
|
22
|
+
import { BANK_SCREENS_NAVIGATION, DIALOG_ID } from '../../constants';
|
|
23
23
|
import { bankFeatureScreens } from '../featuresScreens';
|
|
24
24
|
import CustomFooter from '../shared/Footer';
|
|
25
25
|
import { bankSelector, verifyLeadToken } from '../app/bank/bankStore';
|
|
@@ -46,7 +46,7 @@ var Bank = memo(function (props) {
|
|
|
46
46
|
if (!settingLoading)
|
|
47
47
|
verifyToken();
|
|
48
48
|
}, [settingLoading]);
|
|
49
|
-
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading || customLoading }, { children: _jsx(AnimationFlow, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading || customLoading, error: error, open: open, breakpoint: 'sm', footer: _jsx(CustomFooter, {}), screenId: activeScreen.name }, { children: _jsx(FeatureContainer, { children: bankFeatureScreens.map(function (_a, index) {
|
|
49
|
+
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ open: open, isTapOrigin: isTapOrigin, loading: settingLoading || customLoading }, { children: _jsx(AnimationFlow, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading || customLoading, error: error, open: open, breakpoint: 'sm', footer: _jsx(CustomFooter, {}), screenId: activeScreen.name }, { children: _jsx(FeatureContainer, { children: bankFeatureScreens.map(function (_a, index) {
|
|
50
50
|
var Element = _a.element, name = _a.name;
|
|
51
51
|
var isActive = activeScreen.name === name;
|
|
52
52
|
return (_jsx(Collapse, __assign({ in: isActive, timeout: { enter: 1000, exit: 800 } }, { children: _jsx(Element, {}) }), index));
|
|
@@ -59,5 +59,11 @@ export function renderBankLib(config, elementId) {
|
|
|
59
59
|
reactElement(elementId).render(_jsx(BankLib, __assign({}, config)));
|
|
60
60
|
}
|
|
61
61
|
export function unmountBankLib(elementId) {
|
|
62
|
-
|
|
62
|
+
var element = document.getElementById(elementId);
|
|
63
|
+
setTimeout(function () {
|
|
64
|
+
var _a;
|
|
65
|
+
((_a = element === null || element === void 0 ? void 0 : element.children) === null || _a === void 0 ? void 0 : _a.length) && element.removeChild(element.children[0]);
|
|
66
|
+
removeElement(DIALOG_ID);
|
|
67
|
+
reactElement(elementId).unmount();
|
|
68
|
+
}, 1000);
|
|
63
69
|
}
|
|
@@ -19,8 +19,8 @@ import AnimationFlow from '../../components/AnimationFlow';
|
|
|
19
19
|
import { store } from '../../app/store';
|
|
20
20
|
import { ReduxProvider, ThemeProvider } from '../../components/Providers';
|
|
21
21
|
import Collapse from '../../components/Collapse';
|
|
22
|
-
import { getParameterByName, reactElement } from '../../utils';
|
|
23
|
-
import { BUSINESS_SCREENS_NAVIGATION } from '../../constants';
|
|
22
|
+
import { getParameterByName, reactElement, removeElement } from '../../utils';
|
|
23
|
+
import { BUSINESS_SCREENS_NAVIGATION, DIALOG_ID } from '../../constants';
|
|
24
24
|
import { businessFeatureScreens } from '../featuresScreens';
|
|
25
25
|
import CustomFooter from '../shared/Footer';
|
|
26
26
|
import Background from '../shared/Background';
|
|
@@ -46,7 +46,7 @@ var Business = memo(function (props) {
|
|
|
46
46
|
if (!settingLoading)
|
|
47
47
|
verifyToken();
|
|
48
48
|
}, [settingLoading]);
|
|
49
|
-
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading || customLoading }, { children: _jsx(AnimationFlow, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading || customLoading, error: error, open: open, breakpoint: 'sm', footer: _jsx(CustomFooter, {}), screenId: activeScreen.name }, { children: _jsx(FeatureContainer, { children: businessFeatureScreens.map(function (_a, index) {
|
|
49
|
+
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ open: open, isTapOrigin: isTapOrigin, loading: settingLoading || customLoading }, { children: _jsx(AnimationFlow, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading || customLoading, error: error, open: open, breakpoint: 'sm', footer: _jsx(CustomFooter, {}), screenId: activeScreen.name }, { children: _jsx(FeatureContainer, { children: businessFeatureScreens.map(function (_a, index) {
|
|
50
50
|
var Element = _a.element, name = _a.name;
|
|
51
51
|
var isActive = activeScreen.name === name;
|
|
52
52
|
return (_jsx(Collapse, __assign({ in: isActive, timeout: { enter: 1000, exit: 800 } }, { children: _jsx(Element, {}) }), index));
|
|
@@ -59,5 +59,11 @@ export function renderBusinessLib(config, elementId) {
|
|
|
59
59
|
reactElement(elementId).render(_jsx(BusinessLib, __assign({}, config)));
|
|
60
60
|
}
|
|
61
61
|
export function unmountBusinessLib(elementId) {
|
|
62
|
-
|
|
62
|
+
var element = document.getElementById(elementId);
|
|
63
|
+
setTimeout(function () {
|
|
64
|
+
var _a;
|
|
65
|
+
((_a = element === null || element === void 0 ? void 0 : element.children) === null || _a === void 0 ? void 0 : _a.length) && element.removeChild(element.children[0]);
|
|
66
|
+
removeElement(DIALOG_ID);
|
|
67
|
+
reactElement(elementId).unmount();
|
|
68
|
+
}, 1000);
|
|
63
69
|
}
|
|
@@ -19,8 +19,8 @@ import { store } from '../../app/store';
|
|
|
19
19
|
import { connectSelector } from '../app/connect/connectStore';
|
|
20
20
|
import { ReduxProvider, ThemeProvider } from '../../components/Providers';
|
|
21
21
|
import Collapse from '../../components/Collapse';
|
|
22
|
-
import { reactElement } from '../../utils';
|
|
23
|
-
import { CONNECT_SCREENS_NAVIGATION } from '../../constants';
|
|
22
|
+
import { reactElement, removeElement } from '../../utils';
|
|
23
|
+
import { CONNECT_SCREENS_NAVIGATION, DIALOG_ID } from '../../constants';
|
|
24
24
|
import { connectFeatureScreens } from '../featuresScreens';
|
|
25
25
|
import CustomFooter from '../shared/Footer';
|
|
26
26
|
import Background from '../shared/Background';
|
|
@@ -32,7 +32,7 @@ var Connect = memo(function (props) {
|
|
|
32
32
|
useErrorListener(connectError || error);
|
|
33
33
|
useStepStartedListener();
|
|
34
34
|
var activeScreen = data.activeScreen, isTapOrigin = data.isTapOrigin, open = data.open;
|
|
35
|
-
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading }, { children: _jsx(AnimationFlow, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading, error: error, open: open, footer: _jsx(CustomFooter, {}), screenId: activeScreen.name }, { children: _jsx(FeatureContainer, { children: connectFeatureScreens.map(function (_a, index) {
|
|
35
|
+
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ open: open, isTapOrigin: isTapOrigin, loading: settingLoading }, { children: _jsx(AnimationFlow, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading, error: error, open: open, footer: _jsx(CustomFooter, {}), screenId: activeScreen.name }, { children: _jsx(FeatureContainer, { children: connectFeatureScreens.map(function (_a, index) {
|
|
36
36
|
var Element = _a.element, name = _a.name;
|
|
37
37
|
var isActive = activeScreen.name === name;
|
|
38
38
|
return (_jsx(Collapse, __assign({ in: isActive, timeout: { enter: 1000, exit: 800 } }, { children: _jsx(Element, {}) }), index));
|
|
@@ -45,5 +45,11 @@ export function renderConnectLib(config, elementId) {
|
|
|
45
45
|
reactElement(elementId).render(_jsx(ConnectLib, __assign({}, config)));
|
|
46
46
|
}
|
|
47
47
|
export function unmountConnectLib(elementId) {
|
|
48
|
-
|
|
48
|
+
var element = document.getElementById(elementId);
|
|
49
|
+
setTimeout(function () {
|
|
50
|
+
var _a;
|
|
51
|
+
((_a = element === null || element === void 0 ? void 0 : element.children) === null || _a === void 0 ? void 0 : _a.length) && element.removeChild(element.children[0]);
|
|
52
|
+
removeElement(DIALOG_ID);
|
|
53
|
+
reactElement(elementId).unmount();
|
|
54
|
+
}, 1000);
|
|
49
55
|
}
|
|
@@ -17,9 +17,9 @@ import AnimationFlow from '../../components/AnimationFlow';
|
|
|
17
17
|
import { store } from '../../app/store';
|
|
18
18
|
import { ReduxProvider, ThemeProvider } from '../../components/Providers';
|
|
19
19
|
import Collapse from '../../components/Collapse';
|
|
20
|
-
import { getParameterByName, reactElement } from '../../utils';
|
|
20
|
+
import { getParameterByName, reactElement, removeElement } from '../../utils';
|
|
21
21
|
import { FeatureContainer } from '../shared/Containers';
|
|
22
|
-
import { ENTITY_SCREENS_NAVIGATION } from '../../constants';
|
|
22
|
+
import { DIALOG_ID, ENTITY_SCREENS_NAVIGATION } from '../../constants';
|
|
23
23
|
import { entityFeatureScreens } from '../featuresScreens';
|
|
24
24
|
import CustomFooter from '../shared/Footer';
|
|
25
25
|
import { entitySelector, verifyLeadToken } from '../app/entity/entityStore';
|
|
@@ -46,7 +46,7 @@ var Entity = memo(function (props) {
|
|
|
46
46
|
if (!loading)
|
|
47
47
|
verifyToken();
|
|
48
48
|
}, [loading]);
|
|
49
|
-
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ isTapOrigin: isTapOrigin, loading: loading || customLoading }, { children: _jsx(AnimationFlow, __assign({ isTapOrigin: isTapOrigin, open: open, error: error, loading: loading || customLoading, breakpoint: 'sm', footer: _jsx(CustomFooter, {}), screenId: activeScreen.name }, { children: _jsx(FeatureContainer, { children: entityFeatureScreens.map(function (_a, index) {
|
|
49
|
+
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ open: open, isTapOrigin: isTapOrigin, loading: loading || customLoading }, { children: _jsx(AnimationFlow, __assign({ isTapOrigin: isTapOrigin, open: open, error: error, loading: loading || customLoading, breakpoint: 'sm', footer: _jsx(CustomFooter, {}), screenId: activeScreen.name }, { children: _jsx(FeatureContainer, { children: entityFeatureScreens.map(function (_a, index) {
|
|
50
50
|
var Element = _a.element, name = _a.name;
|
|
51
51
|
var isActive = activeScreen.name === name;
|
|
52
52
|
return (_jsx(Collapse, __assign({ in: isActive, timeout: { enter: 1000, exit: 800 } }, { children: _jsx(Element, {}) }), index));
|
|
@@ -59,5 +59,11 @@ export function renderEntityLib(config, elementId) {
|
|
|
59
59
|
reactElement(elementId).render(_jsx(EntityLib, __assign({}, config)));
|
|
60
60
|
}
|
|
61
61
|
export function unmountEntityLib(elementId) {
|
|
62
|
-
|
|
62
|
+
var element = document.getElementById(elementId);
|
|
63
|
+
setTimeout(function () {
|
|
64
|
+
var _a;
|
|
65
|
+
((_a = element === null || element === void 0 ? void 0 : element.children) === null || _a === void 0 ? void 0 : _a.length) && element.removeChild(element.children[0]);
|
|
66
|
+
removeElement(DIALOG_ID);
|
|
67
|
+
reactElement(elementId).unmount();
|
|
68
|
+
}, 1000);
|
|
63
69
|
}
|
|
@@ -17,9 +17,9 @@ import AnimationFlow from '../../components/AnimationFlow';
|
|
|
17
17
|
import { store } from '../../app/store';
|
|
18
18
|
import { ReduxProvider, ThemeProvider } from '../../components/Providers';
|
|
19
19
|
import Collapse from '../../components/Collapse';
|
|
20
|
-
import { getParameterByName, reactElement } from '../../utils';
|
|
20
|
+
import { getParameterByName, reactElement, removeElement } from '../../utils';
|
|
21
21
|
import { FeatureContainer } from '../shared/Containers';
|
|
22
|
-
import { INDIVIDUAL_SCREENS_NAVIGATION } from '../../constants';
|
|
22
|
+
import { DIALOG_ID, INDIVIDUAL_SCREENS_NAVIGATION } from '../../constants';
|
|
23
23
|
import { individualFeatureScreens } from '../featuresScreens';
|
|
24
24
|
import { individualSelector, verifyLeadToken } from '../app/individual/individualStore';
|
|
25
25
|
import CustomFooter from '../shared/Footer';
|
|
@@ -46,7 +46,7 @@ var Individual = memo(function (props) {
|
|
|
46
46
|
if (!settingLoading)
|
|
47
47
|
verifyToken();
|
|
48
48
|
}, [settingLoading]);
|
|
49
|
-
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading || customLoading }, { children: _jsx(AnimationFlow, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading || customLoading, error: error, open: open, breakpoint: 'sm', footer: _jsx(CustomFooter, {}), screenId: activeScreen.name }, { children: _jsx(FeatureContainer, { children: individualFeatureScreens.map(function (_a, index) {
|
|
49
|
+
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ open: open, isTapOrigin: isTapOrigin, loading: settingLoading || customLoading }, { children: _jsx(AnimationFlow, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading || customLoading, error: error, open: open, breakpoint: 'sm', footer: _jsx(CustomFooter, {}), screenId: activeScreen.name }, { children: _jsx(FeatureContainer, { children: individualFeatureScreens.map(function (_a, index) {
|
|
50
50
|
var Element = _a.element, name = _a.name;
|
|
51
51
|
var isActive = activeScreen.name === name;
|
|
52
52
|
return (_jsx(Collapse, __assign({ in: isActive, timeout: { enter: 1000, exit: 800 } }, { children: _jsx(Element, {}) }), index));
|
|
@@ -59,5 +59,11 @@ export function renderIndividualLib(config, elementId) {
|
|
|
59
59
|
reactElement(elementId).render(_jsx(IndividualLib, __assign({}, config)));
|
|
60
60
|
}
|
|
61
61
|
export function unmountIndividualLib(elementId) {
|
|
62
|
-
|
|
62
|
+
var element = document.getElementById(elementId);
|
|
63
|
+
setTimeout(function () {
|
|
64
|
+
var _a;
|
|
65
|
+
((_a = element === null || element === void 0 ? void 0 : element.children) === null || _a === void 0 ? void 0 : _a.length) && element.removeChild(element.children[0]);
|
|
66
|
+
removeElement(DIALOG_ID);
|
|
67
|
+
reactElement(elementId).unmount();
|
|
68
|
+
}, 1000);
|
|
63
69
|
}
|
|
@@ -18,8 +18,8 @@ import { store } from '../../app/store';
|
|
|
18
18
|
import { ReduxProvider, ThemeProvider } from '../../components/Providers';
|
|
19
19
|
import Collapse from '../../components/Collapse';
|
|
20
20
|
import { FeatureContainer } from '../shared/Containers';
|
|
21
|
-
import { getParameterByName, reactElement } from '../../utils';
|
|
22
|
-
import { PASSWORD_OPERATION_TYPE, PASSWORD_SCREENS_NAVIGATION } from '../../constants';
|
|
21
|
+
import { getParameterByName, reactElement, removeElement } from '../../utils';
|
|
22
|
+
import { DIALOG_ID, PASSWORD_OPERATION_TYPE, PASSWORD_SCREENS_NAVIGATION } from '../../constants';
|
|
23
23
|
import { passwordFeatureScreens } from '../featuresScreens';
|
|
24
24
|
import { passwordSelector, verifyLeadToken, verifyOperationToken } from '../app/password/passwordStore';
|
|
25
25
|
import CustomFooter from '../shared/Footer';
|
|
@@ -53,7 +53,7 @@ var Password = memo(function (props) {
|
|
|
53
53
|
if (!settingLoading)
|
|
54
54
|
verifyToken();
|
|
55
55
|
}, [settingLoading]);
|
|
56
|
-
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading || customLoading }, { children: _jsx(AnimationFlow, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading || customLoading, error: error, open: open, breakpoint: 'sm', footer: _jsx(CustomFooter, {}), screenId: activeScreen.name }, { children: _jsx(FeatureContainer, { children: passwordFeatureScreens.map(function (_a, index) {
|
|
56
|
+
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ open: open, isTapOrigin: isTapOrigin, loading: settingLoading || customLoading }, { children: _jsx(AnimationFlow, __assign({ isTapOrigin: isTapOrigin, loading: settingLoading || customLoading, error: error, open: open, breakpoint: 'sm', footer: _jsx(CustomFooter, {}), screenId: activeScreen.name }, { children: _jsx(FeatureContainer, { children: passwordFeatureScreens.map(function (_a, index) {
|
|
57
57
|
var Element = _a.element, name = _a.name;
|
|
58
58
|
var isActive = activeScreen.name === name;
|
|
59
59
|
return (_jsx(Collapse, __assign({ in: isActive, timeout: { enter: 1000, exit: 800 } }, { children: _jsx(Element, {}) }), index));
|
|
@@ -66,5 +66,11 @@ export function renderPasswordLib(config, elementId) {
|
|
|
66
66
|
reactElement(elementId).render(_jsx(PasswordLib, __assign({}, config)));
|
|
67
67
|
}
|
|
68
68
|
export function unmountPasswordLib(elementId) {
|
|
69
|
-
|
|
69
|
+
var element = document.getElementById(elementId);
|
|
70
|
+
setTimeout(function () {
|
|
71
|
+
var _a;
|
|
72
|
+
((_a = element === null || element === void 0 ? void 0 : element.children) === null || _a === void 0 ? void 0 : _a.length) && element.removeChild(element.children[0]);
|
|
73
|
+
removeElement(DIALOG_ID);
|
|
74
|
+
reactElement(elementId).unmount();
|
|
75
|
+
}, 1000);
|
|
70
76
|
}
|
|
@@ -2,12 +2,14 @@ import React from 'react';
|
|
|
2
2
|
import { SxProps, Theme } from '@mui/material/styles';
|
|
3
3
|
declare type TapOrigin = {
|
|
4
4
|
isTapOrigin: boolean;
|
|
5
|
+
open: boolean;
|
|
5
6
|
};
|
|
6
7
|
interface BackgroundProps extends TapOrigin {
|
|
7
8
|
children: React.ReactNode;
|
|
8
9
|
loading?: boolean;
|
|
9
10
|
hideLogo?: boolean;
|
|
10
11
|
sx?: SxProps<Theme>;
|
|
12
|
+
open: boolean;
|
|
11
13
|
}
|
|
12
|
-
declare const _default: React.MemoExoticComponent<({ children, isTapOrigin, loading, hideLogo, sx }: BackgroundProps) => JSX.Element>;
|
|
14
|
+
declare const _default: React.MemoExoticComponent<({ children, isTapOrigin, loading, hideLogo, sx, open }: BackgroundProps) => JSX.Element>;
|
|
13
15
|
export default _default;
|
|
@@ -14,17 +14,24 @@ import { memo } from 'react';
|
|
|
14
14
|
import { styled } from '@mui/material/styles';
|
|
15
15
|
import Box from '@mui/material/Box';
|
|
16
16
|
import LogoBackground from './LogoBackground';
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
import { BACKGROUND_ID } from '../../../constants';
|
|
18
|
+
var BackgroundStyled = styled(Box, {
|
|
19
|
+
shouldForwardProp: function (prop) { return !['isTapOrigin', 'open'].includes(prop); }
|
|
20
|
+
})(function (_a) {
|
|
21
|
+
var isTapOrigin = _a.isTapOrigin, open = _a.open;
|
|
19
22
|
return ({
|
|
20
23
|
width: '100vw',
|
|
21
24
|
height: '100vh',
|
|
22
|
-
background:
|
|
25
|
+
background: !open
|
|
26
|
+
? 'inherit'
|
|
27
|
+
: isTapOrigin
|
|
28
|
+
? 'linear-gradient(180deg, #98ABAF 0%, #D9D6CC 100%)'
|
|
29
|
+
: 'rgba(0, 0, 0, 0.5)'
|
|
23
30
|
});
|
|
24
31
|
});
|
|
25
32
|
var Background = function (_a) {
|
|
26
|
-
var children = _a.children, isTapOrigin = _a.isTapOrigin, loading = _a.loading, hideLogo = _a.hideLogo, sx = _a.sx;
|
|
33
|
+
var children = _a.children, isTapOrigin = _a.isTapOrigin, loading = _a.loading, hideLogo = _a.hideLogo, sx = _a.sx, open = _a.open;
|
|
27
34
|
var showLogo = !loading && isTapOrigin;
|
|
28
|
-
return (_jsxs(BackgroundStyled, __assign({ id:
|
|
35
|
+
return (_jsxs(BackgroundStyled, __assign({ id: BACKGROUND_ID, isTapOrigin: isTapOrigin, sx: sx, open: open }, { children: [showLogo && !hideLogo && _jsx(LogoBackground, {}), children] })));
|
|
29
36
|
};
|
|
30
37
|
export default memo(Background);
|
|
@@ -19,7 +19,7 @@ import { ReduxProvider, ThemeProvider } from '../../components/Providers';
|
|
|
19
19
|
import Collapse from '../../components/Collapse';
|
|
20
20
|
import { reactElement } from '../../utils';
|
|
21
21
|
import { FeatureContainer } from '../shared/Containers';
|
|
22
|
-
import { SigIn_SCREENS_NAVIGATION } from '../../constants';
|
|
22
|
+
import { DIALOG_ID, SigIn_SCREENS_NAVIGATION } from '../../constants';
|
|
23
23
|
import { signInFeatureScreens } from '../featuresScreens';
|
|
24
24
|
import CustomFooter from '../shared/Footer';
|
|
25
25
|
import { signInSelector } from '../app/signIn/signInStore';
|
|
@@ -32,7 +32,7 @@ var SignIn = memo(function (props) {
|
|
|
32
32
|
useErrorListener(signInError || error);
|
|
33
33
|
useStepStartedListener();
|
|
34
34
|
var activeScreen = data.activeScreen, isTapOrigin = data.isTapOrigin, open = data.open;
|
|
35
|
-
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ isTapOrigin: isTapOrigin, loading: loading }, { children: _jsx(AnimationFlow, __assign({ isTapOrigin: isTapOrigin, open: open, error: error, loading: loading, breakpoint: 'sm', footer: _jsx(CustomFooter, {}), screenId: activeScreen.name }, { children: _jsx(FeatureContainer, { children: signInFeatureScreens.map(function (_a, index) {
|
|
35
|
+
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ open: open, isTapOrigin: isTapOrigin, loading: loading }, { children: _jsx(AnimationFlow, __assign({ isTapOrigin: isTapOrigin, open: open, error: error, loading: loading, breakpoint: 'sm', footer: _jsx(CustomFooter, {}), screenId: activeScreen.name }, { children: _jsx(FeatureContainer, { children: signInFeatureScreens.map(function (_a, index) {
|
|
36
36
|
var Element = _a.element, name = _a.name;
|
|
37
37
|
var isActive = activeScreen.name === name;
|
|
38
38
|
return (_jsx(Collapse, __assign({ in: isActive, timeout: { enter: 1000, exit: 800 } }, { children: _jsx(Element, {}) }), index));
|
|
@@ -45,5 +45,12 @@ export function renderSignInLib(config, elementId) {
|
|
|
45
45
|
reactElement(elementId).render(_jsx(SignInLib, __assign({}, config)));
|
|
46
46
|
}
|
|
47
47
|
export function unmountSignInLib(elementId) {
|
|
48
|
-
|
|
48
|
+
var element = document.getElementById(elementId);
|
|
49
|
+
var dialogEl = document.getElementById(DIALOG_ID);
|
|
50
|
+
setTimeout(function () {
|
|
51
|
+
var _a;
|
|
52
|
+
((_a = element === null || element === void 0 ? void 0 : element.children) === null || _a === void 0 ? void 0 : _a.length) && element.removeChild(element.children[0]);
|
|
53
|
+
dialogEl && dialogEl.remove();
|
|
54
|
+
reactElement(elementId).unmount();
|
|
55
|
+
}, 1000);
|
|
49
56
|
}
|
|
@@ -19,7 +19,7 @@ import { ReduxProvider, ThemeProvider } from '../../components/Providers';
|
|
|
19
19
|
import Collapse from '../../components/Collapse';
|
|
20
20
|
import { getParameterByName, reactElement } from '../../utils';
|
|
21
21
|
import { FeatureContainer } from '../shared/Containers';
|
|
22
|
-
import { TAX_SCREENS_NAVIGATION } from '../../constants';
|
|
22
|
+
import { DIALOG_ID, TAX_SCREENS_NAVIGATION } from '../../constants';
|
|
23
23
|
import { taxFeatureScreens } from '../featuresScreens';
|
|
24
24
|
import CustomFooter from '../shared/Footer';
|
|
25
25
|
import { taxSelector, verifyLeadToken } from '../app/tax/taxStore';
|
|
@@ -46,7 +46,7 @@ var Tax = memo(function (props) {
|
|
|
46
46
|
if (!loading)
|
|
47
47
|
verifyToken();
|
|
48
48
|
}, [loading]);
|
|
49
|
-
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ isTapOrigin: isTapOrigin, loading: loading || customLoading }, { children: _jsx(AnimationFlow, __assign({ isTapOrigin: isTapOrigin, open: open, error: error, loading: loading || customLoading, breakpoint: 'sm', footer: _jsx(CustomFooter, {}), screenId: activeScreen.name }, { children: _jsx(FeatureContainer, { children: taxFeatureScreens.map(function (_a, index) {
|
|
49
|
+
return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(Background, __assign({ open: open, isTapOrigin: isTapOrigin, loading: loading || customLoading }, { children: _jsx(AnimationFlow, __assign({ isTapOrigin: isTapOrigin, open: open, error: error, loading: loading || customLoading, breakpoint: 'sm', footer: _jsx(CustomFooter, {}), screenId: activeScreen.name }, { children: _jsx(FeatureContainer, { children: taxFeatureScreens.map(function (_a, index) {
|
|
50
50
|
var Element = _a.element, name = _a.name;
|
|
51
51
|
var isActive = activeScreen.name === name;
|
|
52
52
|
return (_jsx(Collapse, __assign({ in: isActive, timeout: { enter: 1000, exit: 800 } }, { children: _jsx(Element, {}) }), index));
|
|
@@ -59,5 +59,12 @@ export function renderTaxLib(config, elementId) {
|
|
|
59
59
|
reactElement(elementId).render(_jsx(TaxLib, __assign({}, config)));
|
|
60
60
|
}
|
|
61
61
|
export function unmountTaxLib(elementId) {
|
|
62
|
-
|
|
62
|
+
var element = document.getElementById(elementId);
|
|
63
|
+
var dialogEl = document.getElementById(DIALOG_ID);
|
|
64
|
+
setTimeout(function () {
|
|
65
|
+
var _a;
|
|
66
|
+
((_a = element === null || element === void 0 ? void 0 : element.children) === null || _a === void 0 ? void 0 : _a.length) && element.removeChild(element.children[0]);
|
|
67
|
+
dialogEl && dialogEl.remove();
|
|
68
|
+
reactElement(elementId).unmount();
|
|
69
|
+
}, 1000);
|
|
63
70
|
}
|
package/build/utils/html.d.ts
CHANGED
|
@@ -2,3 +2,4 @@ export declare const createElementAndInject: (id: string) => HTMLDivElement;
|
|
|
2
2
|
export declare const reactElement: (elementId: string) => import("react-dom/client").Root;
|
|
3
3
|
export declare const scrollUp: (elementId: string, top?: number) => void;
|
|
4
4
|
export declare const scrollDown: (elementId: string) => void;
|
|
5
|
+
export declare const removeElement: (elementId: string) => void;
|
package/build/utils/html.js
CHANGED