@tap-payments/auth-jsconnect 2.5.5 → 2.5.6
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/@types/app.d.ts +5 -1
- package/build/@types/redux.d.ts +1 -0
- package/build/api/data.d.ts +4 -17
- package/build/api/data.js +5 -45
- package/build/api/entity.d.ts +3 -2
- package/build/api/entity.js +12 -4
- package/build/api/index.d.ts +5 -21
- package/build/components/Providers/ThemeProvider.js +1 -1
- package/build/constants/api.d.ts +2 -7
- package/build/constants/api.js +5 -15
- package/build/constants/app.js +7 -1
- package/build/features/app/auth/authStore.js +24 -21
- package/build/features/app/bank/bankStore.d.ts +13 -19
- package/build/features/app/bank/bankStore.js +183 -165
- package/build/features/app/board/boardStore.js +16 -10
- package/build/features/app/brand/brandStore.d.ts +17 -31
- package/build/features/app/brand/brandStore.js +250 -261
- package/build/features/app/business/businessStore.js +16 -16
- package/build/features/app/connect/connectStore.js +7 -7
- package/build/features/app/connectExpress/connectExpressStore.d.ts +5 -1
- package/build/features/app/connectExpress/connectExpressStore.js +64 -27
- package/build/features/app/entity/entityStore.d.ts +20 -34
- package/build/features/app/entity/entityStore.js +204 -249
- package/build/features/app/individual/individualStore.d.ts +17 -36
- package/build/features/app/individual/individualStore.js +228 -270
- package/build/features/app/password/passwordStore.d.ts +21 -25
- package/build/features/app/password/passwordStore.js +203 -220
- package/build/features/app/tax/taxStore.d.ts +13 -7
- package/build/features/app/tax/taxStore.js +168 -147
- package/build/features/auth/Auth.d.ts +0 -2
- package/build/features/auth/Auth.js +7 -7
- package/build/features/auth/screens/AuthSwitch/AuthSwitch.js +1 -1
- package/build/features/bank/Bank.js +5 -3
- package/build/features/bank/screens/BankDetails/BankDetails.js +17 -4
- package/build/features/board/Board.d.ts +2 -0
- package/build/features/board/Board.js +13 -7
- package/build/features/board/screens/PrepareDataLoading/PrepareDataLoading.d.ts +4 -0
- package/build/features/board/screens/PrepareDataLoading/PrepareDataLoading.js +10 -0
- package/build/features/board/screens/PrepareDataLoading/index.d.ts +2 -0
- package/build/features/board/screens/PrepareDataLoading/index.js +2 -0
- package/build/features/board/screens/SuccessWithFlowButtons/SuccessWithFlowButtons.js +12 -2
- package/build/features/brand/Brand.js +5 -3
- package/build/features/brand/screens/BrandActivities/ActivitiesList.d.ts +2 -2
- package/build/features/brand/screens/BrandActivities/BrandActivities.js +48 -11
- package/build/features/brand/screens/BrandActivities/CustomerBase.d.ts +3 -3
- package/build/features/brand/screens/BrandActivities/RefundPolicy.d.ts +2 -2
- package/build/features/brand/screens/BrandInfo/BrandInfo.js +22 -4
- package/build/features/brand/screens/BrandSegmentInfo/BrandSegmentInfo.js +22 -6
- package/build/features/business/Business.js +5 -3
- package/build/features/business/screens/Activities/Activities.js +9 -1
- package/build/features/business/screens/Activities/ActivitiesList.d.ts +2 -2
- package/build/features/business/screens/Activities/OperationStartDate.d.ts +1 -1
- package/build/features/business/screens/BrandDetails/SalesChannel.d.ts +1 -1
- package/build/features/business/screens/Customers/CustomerLocations.d.ts +3 -3
- package/build/features/business/screens/Customers/Customers.js +9 -1
- package/build/features/business/screens/Customers/RefundPolicy.d.ts +2 -2
- package/build/features/connect/Connect.js +5 -4
- package/build/features/connect/screens/BusinessCountry/BusinessCountry.js +7 -1
- package/build/features/connectExpress/ConnectExpress.js +5 -4
- package/build/features/entity/Entity.js +5 -3
- package/build/features/entity/screens/EntityCapital/ActivityList.d.ts +2 -2
- package/build/features/entity/screens/EntityCapital/EntityCapital.js +33 -9
- package/build/features/entity/screens/EntityName/EntityName.js +31 -14
- package/build/features/entity/screens/EntityName/EntityTypeList.d.ts +2 -2
- package/build/features/entity/screens/EntityName/ExpiryDate.d.ts +1 -1
- package/build/features/entity/screens/EntityName/IssuingDate.d.ts +1 -1
- package/build/features/featuresScreens.js +5 -0
- package/build/features/individual/Individual.js +5 -3
- package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.d.ts +1 -1
- package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +43 -10
- package/build/features/individual/screens/IndividualList/IndividualList.d.ts +2 -2
- package/build/features/individual/screens/IndividualList/IndividualList.js +7 -0
- package/build/features/individual/screens/IndividualList/UserList.js +3 -3
- package/build/features/individual/screens/IndividualPersonalInfo/IndividualPersonalInfo.d.ts +1 -1
- package/build/features/individual/screens/IndividualPersonalInfo/IndividualPersonalInfo.js +73 -18
- package/build/features/password/Password.js +6 -4
- package/build/features/shared/Address/CountryList.d.ts +2 -2
- package/build/features/shared/Address/InputSelect.d.ts +2 -2
- package/build/features/shared/Button/FlowsButtons.js +10 -2
- package/build/features/shared/Input/Input.d.ts +1 -1
- package/build/features/signIn/SignIn.js +15 -5
- package/build/features/tax/Tax.js +5 -3
- package/build/features/tax/screens/TaxDetails/TaxDetails.js +7 -2
- package/build/hooks/index.d.ts +1 -0
- package/build/hooks/index.js +1 -0
- package/build/hooks/useAppConfig.js +1 -1
- package/build/hooks/useAppTheme.js +4 -3
- package/build/hooks/useFormDirtyCheck.d.ts +10 -0
- package/build/hooks/useFormDirtyCheck.js +66 -0
- package/build/theme/theme.d.ts +1 -1
- package/build/theme/theme.js +2 -2
- package/package.json +1 -1
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import _ from 'lodash';
|
|
3
|
+
export var useFormDirtyCheck = function (method, backendData, customAttrs) {
|
|
4
|
+
var _a = React.useState(false), isDirty = _a[0], setIsDirty = _a[1];
|
|
5
|
+
var data = method.watch();
|
|
6
|
+
var isValidData = function (formValue, backendValue) {
|
|
7
|
+
if (_.isUndefined(formValue))
|
|
8
|
+
return false;
|
|
9
|
+
if (_.isArray(formValue) && formValue.length === 0)
|
|
10
|
+
return false;
|
|
11
|
+
if (_.isObject(formValue) && _.isEmpty(formValue))
|
|
12
|
+
return false;
|
|
13
|
+
if (formValue === '' && !backendValue)
|
|
14
|
+
return false;
|
|
15
|
+
return true;
|
|
16
|
+
};
|
|
17
|
+
var isArray = function (data, backendData) {
|
|
18
|
+
return backendData && data && _.isArray(backendData) && _.isArray(data);
|
|
19
|
+
};
|
|
20
|
+
var isObject = function (data, backendData) {
|
|
21
|
+
return backendData && data && _.isObject(data) && _.isObject(backendData);
|
|
22
|
+
};
|
|
23
|
+
var mapArrayOfObjectWithKeys = function (items, keys) {
|
|
24
|
+
return _.map(items, function (item) { return _.pick(item, keys); });
|
|
25
|
+
};
|
|
26
|
+
var mapObjectWithKeys = function (item, keys) {
|
|
27
|
+
return _.pick(item, keys);
|
|
28
|
+
};
|
|
29
|
+
var deepComparison = function (data, backendData, customAttrs) {
|
|
30
|
+
var _loop_1 = function (key) {
|
|
31
|
+
var formValue = data === null || data === void 0 ? void 0 : data[key];
|
|
32
|
+
var backEndValue = backendData === null || backendData === void 0 ? void 0 : backendData[key];
|
|
33
|
+
if (!isValidData(formValue, backEndValue))
|
|
34
|
+
return "continue";
|
|
35
|
+
var customAttr = customAttrs === null || customAttrs === void 0 ? void 0 : customAttrs.find(function (el) { return el.name === key; });
|
|
36
|
+
if (customAttr) {
|
|
37
|
+
var keys = customAttr.keys;
|
|
38
|
+
if (isArray(formValue, backEndValue)) {
|
|
39
|
+
formValue = mapArrayOfObjectWithKeys(formValue, keys);
|
|
40
|
+
backEndValue = mapArrayOfObjectWithKeys(backEndValue, keys);
|
|
41
|
+
if (formValue.length !== backEndValue.length)
|
|
42
|
+
return { value: true };
|
|
43
|
+
if (_.differenceWith(formValue, backEndValue, _.isEqual).length > 0)
|
|
44
|
+
return { value: true };
|
|
45
|
+
}
|
|
46
|
+
if (isObject(formValue, backEndValue)) {
|
|
47
|
+
formValue = mapObjectWithKeys(formValue, keys);
|
|
48
|
+
backEndValue = mapObjectWithKeys(backEndValue, keys);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
if (!_.isEqual(formValue, backEndValue))
|
|
52
|
+
return { value: true };
|
|
53
|
+
};
|
|
54
|
+
for (var key in backendData) {
|
|
55
|
+
var state_1 = _loop_1(key);
|
|
56
|
+
if (typeof state_1 === "object")
|
|
57
|
+
return state_1.value;
|
|
58
|
+
}
|
|
59
|
+
return false;
|
|
60
|
+
};
|
|
61
|
+
React.useEffect(function () {
|
|
62
|
+
var isDirty = deepComparison(data, backendData, customAttrs);
|
|
63
|
+
setIsDirty(isDirty);
|
|
64
|
+
}, [data, backendData]);
|
|
65
|
+
return { isDirty: isDirty };
|
|
66
|
+
};
|
package/build/theme/theme.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { DirectionMode, ThemeMode } from '../@types';
|
|
2
|
-
export declare const appTheme: (mode: ThemeMode,
|
|
2
|
+
export declare const appTheme: (mode: ThemeMode, dir: DirectionMode, isSmallScreen: boolean) => import("@mui/material/styles").Theme;
|
package/build/theme/theme.js
CHANGED
|
@@ -3,7 +3,7 @@ import { typography } from './typography';
|
|
|
3
3
|
import { darkPalette, lightPalette } from './palette';
|
|
4
4
|
import { components } from './components';
|
|
5
5
|
import { shadows } from './shadows';
|
|
6
|
-
export var appTheme = function (mode,
|
|
6
|
+
export var appTheme = function (mode, dir, isSmallScreen) {
|
|
7
7
|
return createTheme({
|
|
8
8
|
palette: mode === 'dark' ? darkPalette : lightPalette,
|
|
9
9
|
direction: dir,
|
|
@@ -11,7 +11,7 @@ export var appTheme = function (mode, isMobile, dir) {
|
|
|
11
11
|
breakpoints: {
|
|
12
12
|
values: {
|
|
13
13
|
xs: 0,
|
|
14
|
-
sm:
|
|
14
|
+
sm: isSmallScreen ? 1536 : 600,
|
|
15
15
|
md: 900,
|
|
16
16
|
lg: 1200,
|
|
17
17
|
xl: 1536
|