@tap-payments/auth-jsconnect 2.4.0-test → 2.4.5-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.
Files changed (62) hide show
  1. package/build/@types/app.d.ts +27 -1
  2. package/build/api/individual.d.ts +2 -2
  3. package/build/features/app/brand/brandStore.js +10 -9
  4. package/build/features/app/business/businessStore.js +11 -3
  5. package/build/features/app/connect/connectStore.js +1 -0
  6. package/build/features/app/entity/entityStore.js +3 -3
  7. package/build/features/app/individual/individualStore.js +2 -2
  8. package/build/features/bank/screens/BankDetails/BankDetails.js +3 -2
  9. package/build/features/bank/screens/BankDetails/BankName.d.ts +2 -1
  10. package/build/features/bank/screens/BankDetails/BankName.js +4 -5
  11. package/build/features/bank/screens/BankDetails/BankStatement.d.ts +2 -1
  12. package/build/features/bank/screens/BankDetails/BankStatement.js +4 -4
  13. package/build/features/bank/screens/BankDetails/Beneficiary.d.ts +2 -1
  14. package/build/features/bank/screens/BankDetails/Beneficiary.js +8 -10
  15. package/build/features/bank/screens/BankDetails/IBAN.d.ts +2 -1
  16. package/build/features/bank/screens/BankDetails/IBAN.js +3 -5
  17. package/build/features/brand/screens/BrandActivities/ActivitiesList.d.ts +0 -14
  18. package/build/features/brand/screens/BrandActivities/ActivitiesList.js +6 -11
  19. package/build/features/brand/screens/BrandActivities/BrandActivities.js +13 -7
  20. package/build/features/brand/screens/BrandActivities/CustomerBase.d.ts +4 -27
  21. package/build/features/brand/screens/BrandActivities/CustomerBase.js +9 -18
  22. package/build/features/brand/screens/BrandActivities/ExpectedCustomers.d.ts +2 -1
  23. package/build/features/brand/screens/BrandActivities/ExpectedCustomers.js +6 -5
  24. package/build/features/brand/screens/BrandActivities/ExpectedSalesRange.d.ts +2 -1
  25. package/build/features/brand/screens/BrandActivities/ExpectedSalesRange.js +15 -14
  26. package/build/features/brand/screens/BrandInfo/BrandInfo.js +5 -4
  27. package/build/features/brand/screens/BrandInfo/BrandLogo.d.ts +2 -1
  28. package/build/features/brand/screens/BrandInfo/BrandLogo.js +2 -2
  29. package/build/features/brand/screens/BrandInfo/BrandName.d.ts +2 -1
  30. package/build/features/brand/screens/BrandInfo/BrandName.js +3 -5
  31. package/build/features/brand/screens/BrandInfo/SalesChannels.js +6 -3
  32. package/build/features/brand/screens/BrandInfo/Segments.d.ts +2 -1
  33. package/build/features/brand/screens/BrandInfo/Segments.js +17 -24
  34. package/build/features/brand/screens/BrandInfo/TeamSize.d.ts +2 -1
  35. package/build/features/brand/screens/BrandInfo/TeamSize.js +18 -25
  36. package/build/features/business/screens/Customers/Customers.js +27 -16
  37. package/build/features/entity/screens/EntityName/EntityTypeList.js +1 -1
  38. package/build/features/shared/CheckIcon/CheckIcon.d.ts +7 -1
  39. package/build/features/shared/CheckIcon/CheckIcon.js +7 -6
  40. package/build/features/shared/EndAdornment/EndAdornment.d.ts +10 -0
  41. package/build/features/shared/EndAdornment/EndAdornment.js +17 -0
  42. package/build/features/shared/EndAdornment/EndAdornmentExpanded.d.ts +7 -0
  43. package/build/features/shared/EndAdornment/EndAdornmentExpanded.js +13 -0
  44. package/build/features/shared/EndAdornment/index.d.ts +3 -0
  45. package/build/features/shared/EndAdornment/index.js +3 -0
  46. package/build/features/shared/SalesChannels/SaleChannelIconsInput.d.ts +2 -1
  47. package/build/features/shared/SalesChannels/SaleChannelIconsInput.js +4 -3
  48. package/build/features/shared/SalesChannels/SalesChannel.d.ts +2 -1
  49. package/build/features/shared/SalesChannels/SalesChannel.js +2 -2
  50. package/build/features/shared/UploadFile/FileUpload.d.ts +2 -1
  51. package/build/features/shared/UploadFile/FileUpload.js +2 -2
  52. package/build/features/shared/UploadFile/UploadWrapper.d.ts +2 -1
  53. package/build/features/shared/UploadFile/UploadWrapper.js +2 -2
  54. package/build/features/shared/UploadMultipleFile/UploadFile.d.ts +2 -1
  55. package/build/features/shared/UploadMultipleFile/UploadFile.js +2 -2
  56. package/build/features/shared/UploadMultipleFile/UploadMultipleFile.d.ts +2 -1
  57. package/build/features/shared/UploadMultipleFile/UploadMultipleFile.js +2 -2
  58. package/build/hooks/index.d.ts +1 -0
  59. package/build/hooks/index.js +1 -0
  60. package/build/hooks/useDataVerified.d.ts +6 -0
  61. package/build/hooks/useDataVerified.js +19 -0
  62. package/package.json +1 -1
@@ -10,20 +10,20 @@ var __assign = (this && this.__assign) || function () {
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
12
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
13
- import Collapse from '../../../../components/Collapse';
14
- import { ScreenContainer } from '../../../../features/shared/Containers';
15
- import Input from '../../../../features/shared/Input';
16
- import { useAppSelector, useLanguage } from '../../../../hooks';
17
13
  import React from 'react';
18
- import { useTranslation } from 'react-i18next';
19
14
  import { useController, useFormContext } from 'react-hook-form';
20
- import { brandSelector } from '../../../../features/app/brand/brandStore';
21
- import SimpleList from '../../../../components/SimpleList';
22
- import ExpandIcon from '../../../../components/ExpandIcon';
15
+ import { useTranslation } from 'react-i18next';
23
16
  import Box from '@mui/material/Box';
24
17
  import { styled } from '@mui/material/styles';
18
+ import SimpleList from '../../../../components/SimpleList';
25
19
  import Text from '../../../../components/Text';
26
- import CheckIcon from '@mui/icons-material/Check';
20
+ import Collapse from '../../../../components/Collapse';
21
+ import { useAppSelector, useLanguage } from '../../../../hooks';
22
+ import { EndAdornmentExpanded } from '../../../shared/EndAdornment';
23
+ import { ScreenContainer } from '../../../shared/Containers';
24
+ import Input from '../../../shared/Input';
25
+ import CheckIcon from '../../../shared/CheckIcon';
26
+ import { brandSelector } from '../../../app/brand/brandStore';
27
27
  var InputStyled = styled(Input)(function (_a) {
28
28
  var readOnly = _a.readOnly;
29
29
  return ({
@@ -36,27 +36,20 @@ var IncomeText = styled(Text, { shouldForwardProp: function (prop) { return prop
36
36
  var theme = _a.theme, isSelected = _a.isSelected;
37
37
  return (__assign(__assign({ color: theme.palette.text.primary }, theme.typography.body2), { fontWeight: isSelected ? theme.typography.fontWeightMedium : theme.typography.fontWeightLight, paddingInlineStart: theme.spacing(1.25), textAlign: 'start' }));
38
38
  });
39
- var CheckIconStyled = styled(CheckIcon)(function (_a) {
40
- var theme = _a.theme;
41
- return ({
42
- color: theme.palette.success.main,
43
- display: 'flex',
44
- alignItems: 'flex-end'
45
- });
46
- });
47
39
  var TeamSize = function (_a) {
48
- var _b, _c, _d, _e;
49
- var show = _a.show, onListOpen = _a.onListOpen, onListClose = _a.onListClose, readOnly = _a.readOnly;
50
- var _f = React.useState([]), teamSizeList = _f[0], setTeamSizeList = _f[1];
51
- var _g = React.useState(null), anchorEl = _g[0], setAnchorEl = _g[1];
40
+ var _b, _c, _d;
41
+ var show = _a.show, onListOpen = _a.onListOpen, onListClose = _a.onListClose, readOnly = _a.readOnly, isVerified = _a.isVerified;
42
+ var _e = React.useState([]), teamSizeList = _e[0], setTeamSizeList = _e[1];
43
+ var _f = React.useState(null), anchorEl = _f[0], setAnchorEl = _f[1];
52
44
  var t = useTranslation().t;
53
45
  var isAr = useLanguage().isAr;
54
46
  var data = useAppSelector(brandSelector).data;
55
47
  var control = useFormContext().control;
56
- var teamSizesList = ((_b = data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.teamSizeList) || [];
48
+ var list = (data.verify.responseBody || {}).teamSizeList;
49
+ var teamSizesList = list || [];
57
50
  var teamSizeControl = useController({ control: control, name: 'teamSize' });
58
51
  var teamSize = teamSizeControl.field.value;
59
- var error = (_c = teamSizeControl.fieldState.error) === null || _c === void 0 ? void 0 : _c.message;
52
+ var error = (_b = teamSizeControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
60
53
  React.useEffect(function () {
61
54
  if ((teamSizesList === null || teamSizesList === void 0 ? void 0 : teamSizesList.length) > 0) {
62
55
  setTeamSizeList(teamSizesList);
@@ -76,9 +69,9 @@ var TeamSize = function (_a) {
76
69
  onCloseList();
77
70
  teamSizeControl.field.onChange(teamSize);
78
71
  };
79
- return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, __assign({ sx: { mt: 2.5, mb: 0 } }, { children: [_jsx(InputStyled, { required: true, label: t('team_size_title'), readOnly: readOnly, onClick: !!anchorEl ? function () { return onCloseList(); } : onOpenList, endAdornment: _jsx(ExpandIcon, { anchorEl: !!anchorEl }), placeholder: t('choose_team_size'), value: (isAr ? (_d = teamSize === null || teamSize === void 0 ? void 0 : teamSize.name) === null || _d === void 0 ? void 0 : _d.ar : (_e = teamSize === null || teamSize === void 0 ? void 0 : teamSize.name) === null || _e === void 0 ? void 0 : _e.en) || '', warningMessage: error && t(error) }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleList, { searchKeyPath: 'name.en', searchValuePath: ['name.ar', 'name.en'], list: teamSizeList, onSelectItem: onSelectItem, renderItem: function (item) {
72
+ return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, __assign({ sx: { mt: 2.5, mb: 0 } }, { children: [_jsx(InputStyled, { required: true, label: t('team_size_title'), readOnly: readOnly, onClick: !!anchorEl ? function () { return onCloseList(); } : onOpenList, endAdornment: _jsx(EndAdornmentExpanded, { anchorEl: anchorEl, isVerified: isVerified }), placeholder: t('choose_team_size'), value: (isAr ? (_c = teamSize === null || teamSize === void 0 ? void 0 : teamSize.name) === null || _c === void 0 ? void 0 : _c.ar : (_d = teamSize === null || teamSize === void 0 ? void 0 : teamSize.name) === null || _d === void 0 ? void 0 : _d.en) || '', warningMessage: error && t(error) }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleList, { searchKeyPath: 'name.en', searchValuePath: ['name.ar', 'name.en'], list: teamSizeList, onSelectItem: onSelectItem, renderItem: function (item) {
80
73
  var _a, _b;
81
- return (_jsxs(_Fragment, { children: [_jsx(Box, __assign({ display: 'flex' }, { children: _jsx(IncomeText, __assign({ isSelected: item.id === (teamSize === null || teamSize === void 0 ? void 0 : teamSize.id) }, { children: isAr ? (_a = item === null || item === void 0 ? void 0 : item.name) === null || _a === void 0 ? void 0 : _a.ar : (_b = item === null || item === void 0 ? void 0 : item.name) === null || _b === void 0 ? void 0 : _b.en })) })), item.id === (teamSize === null || teamSize === void 0 ? void 0 : teamSize.id) && _jsx(CheckIconStyled, {})] }));
74
+ return (_jsxs(_Fragment, { children: [_jsx(Box, __assign({ display: 'flex' }, { children: _jsx(IncomeText, __assign({ isSelected: item.id === (teamSize === null || teamSize === void 0 ? void 0 : teamSize.id) }, { children: isAr ? (_a = item === null || item === void 0 ? void 0 : item.name) === null || _a === void 0 ? void 0 : _a.ar : (_b = item === null || item === void 0 ? void 0 : item.name) === null || _b === void 0 ? void 0 : _b.en })) })), item.id === (teamSize === null || teamSize === void 0 ? void 0 : teamSize.id) && _jsx(CheckIcon, { isVerified: isVerified })] }));
82
75
  } }) }))] })) })));
83
76
  };
84
77
  export default TeamSize;
@@ -9,17 +9,6 @@ var __assign = (this && this.__assign) || function () {
9
9
  };
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
- var __rest = (this && this.__rest) || function (s, e) {
13
- var t = {};
14
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
- t[p] = s[p];
16
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
- t[p[i]] = s[p[i]];
20
- }
21
- return t;
22
- };
23
12
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
24
13
  import Box from '@mui/material/Box/Box';
25
14
  import { styled } from '@mui/material/styles';
@@ -52,16 +41,38 @@ var ListType;
52
41
  ListType["ExpectedSalesList"] = "ExpectedSalesList";
53
42
  })(ListType || (ListType = {}));
54
43
  var Customers = function (_a) {
55
- var _b = React.useState(), listActive = _b[0], setListActive = _b[1];
44
+ var _b, _c;
45
+ var _d = React.useState(), listActive = _d[0], setListActive = _d[1];
56
46
  var dispatch = useAppDispatch();
57
- var _c = useAppSelector(businessSelector), data = _c.data, loading = _c.loading, error = _c.error;
58
- var _d = data.customersData, responseBody = _d.responseBody, defaultValues = __rest(_d, ["responseBody"]);
47
+ var _e = useAppSelector(businessSelector), data = _e.data, loading = _e.loading, error = _e.error;
48
+ var _f = data.customersData, customerLocations = _f.customerLocations, expectedCustomer = _f.expectedCustomer, expectedSale = _f.expectedSale, refundPolicy = _f.refundPolicy, transactionPolicy = _f.transactionPolicy;
49
+ var terms = (_c = (_b = data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.brand) === null || _c === void 0 ? void 0 : _c.terms;
59
50
  var methods = useForm({
60
51
  resolver: yupResolver(CustomerInfoValidation),
61
- defaultValues: defaultValues,
52
+ defaultValues: {
53
+ customerLocations: customerLocations,
54
+ expectedCustomer: expectedCustomer,
55
+ expectedSale: expectedSale,
56
+ refundPolicy: refundPolicy,
57
+ transactionPolicy: transactionPolicy
58
+ },
62
59
  mode: 'onChange'
63
60
  });
64
- useSetFromDefaultValues(methods, defaultValues);
61
+ useSetFromDefaultValues(methods, data.customersData);
62
+ React.useEffect(function () {
63
+ var _a, _b;
64
+ var isTermsAgreed = !!((_b = (_a = terms === null || terms === void 0 ? void 0 : terms.find) === null || _a === void 0 ? void 0 : _a.call(terms, function (_a) {
65
+ var term = _a.term;
66
+ return term === 'general';
67
+ })) === null || _b === void 0 ? void 0 : _b.agree);
68
+ if (isTermsAgreed) {
69
+ var getValues = methods.getValues, setValue = methods.setValue;
70
+ if (!getValues('refundPolicy'))
71
+ setValue('refundPolicy', true, { shouldValidate: true });
72
+ if (!getValues('transactionPolicy'))
73
+ setValue('transactionPolicy', true, { shouldValidate: true });
74
+ }
75
+ }, [terms]);
65
76
  var onSubmit = function (data) {
66
77
  dispatch(updateCustomersInfo(data));
67
78
  };
@@ -72,7 +72,7 @@ var SimpleListStyled = styled((SimpleList))(function () { return ({}); });
72
72
  export var CheckIconStyled = styled(CheckIcon)(function (_a) {
73
73
  var theme = _a.theme;
74
74
  return ({
75
- color: theme.palette.primary.main,
75
+ color: theme.palette.success.main,
76
76
  display: 'flex',
77
77
  alignItems: 'flex-end'
78
78
  });
@@ -1,2 +1,8 @@
1
1
  /// <reference types="react" />
2
- export default function CustomClearIcon(): JSX.Element;
2
+ import { SxProps, Theme } from '@mui/material/styles';
3
+ declare type CustomCheckIconProps = {
4
+ isVerified?: boolean;
5
+ sx?: SxProps<Theme>;
6
+ };
7
+ export default function CustomCheckIcon({ isVerified, sx }: CustomCheckIconProps): JSX.Element;
8
+ export {};
@@ -1,14 +1,15 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { styled } from '@mui/material/styles';
2
+ import { alpha, styled } from '@mui/material/styles';
3
3
  import CheckIcon from '@mui/icons-material/Check';
4
- var ClearIconStyled = styled(CheckIcon)(function (_a) {
5
- var theme = _a.theme;
4
+ var CheckIconStyled = styled(CheckIcon, { shouldForwardProp: function (prop) { return prop !== 'isVerified'; } })(function (_a) {
5
+ var theme = _a.theme, isVerified = _a.isVerified;
6
6
  return ({
7
7
  display: 'flex',
8
8
  alignItems: 'flex-end',
9
- color: theme.palette.success.main
9
+ color: isVerified ? theme.palette.success.main : alpha(theme.palette.success.dark, 0.5)
10
10
  });
11
11
  });
12
- export default function CustomClearIcon() {
13
- return _jsx(ClearIconStyled, {});
12
+ export default function CustomCheckIcon(_a) {
13
+ var _b = _a.isVerified, isVerified = _b === void 0 ? false : _b, sx = _a.sx;
14
+ return _jsx(CheckIconStyled, { isVerified: isVerified, sx: sx });
14
15
  }
@@ -0,0 +1,10 @@
1
+ /// <reference types="react" />
2
+ interface EndAdornmentProps {
3
+ loading?: boolean;
4
+ isVerified?: boolean;
5
+ error?: string;
6
+ value?: string;
7
+ onClear: () => void;
8
+ }
9
+ declare const EndAdornment: ({ isVerified, loading, error, value, onClear }: EndAdornmentProps) => JSX.Element;
10
+ export default EndAdornment;
@@ -0,0 +1,17 @@
1
+ import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import CircularProgress from '@mui/material/CircularProgress';
3
+ import ClearIcon from '../../shared/ClearIcon';
4
+ import CheckIcon from '../../shared/CheckIcon';
5
+ var EndAdornment = function (_a) {
6
+ var isVerified = _a.isVerified, loading = _a.loading, error = _a.error, value = _a.value, onClear = _a.onClear;
7
+ var getEndAdornment = function () {
8
+ if (loading)
9
+ return _jsx(CircularProgress, { size: 25, thickness: 5, sx: { height: 'auto !important' } });
10
+ if (!error && value)
11
+ return _jsx(CheckIcon, { isVerified: isVerified });
12
+ if (value)
13
+ return _jsx(ClearIcon, { onClick: onClear });
14
+ };
15
+ return _jsx(_Fragment, { children: getEndAdornment() });
16
+ };
17
+ export default EndAdornment;
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ interface EndAdornmentExpandedProps {
3
+ anchorEl: HTMLElement | null;
4
+ isVerified?: boolean;
5
+ }
6
+ declare const EndAdornmentExpanded: ({ isVerified, anchorEl }: EndAdornmentExpandedProps) => JSX.Element;
7
+ export default EndAdornmentExpanded;
@@ -0,0 +1,13 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import CheckIcon from '../../shared/CheckIcon';
3
+ import ExpandIcon from '../../../components/ExpandIcon';
4
+ var EndAdornmentExpanded = function (_a) {
5
+ var isVerified = _a.isVerified, anchorEl = _a.anchorEl;
6
+ var getEndAdornmentExpanded = function () {
7
+ if (isVerified && !anchorEl)
8
+ return (_jsxs(_Fragment, { children: [_jsx(CheckIcon, { isVerified: isVerified, sx: { marginInlineEnd: '10px' } }), _jsx(ExpandIcon, { anchorEl: !!anchorEl })] }));
9
+ return _jsx(ExpandIcon, { anchorEl: !!anchorEl });
10
+ };
11
+ return _jsx(_Fragment, { children: getEndAdornmentExpanded() });
12
+ };
13
+ export default EndAdornmentExpanded;
@@ -0,0 +1,3 @@
1
+ import EndAdornment from './EndAdornment';
2
+ import EndAdornmentExpanded from './EndAdornmentExpanded';
3
+ export { EndAdornment, EndAdornmentExpanded };
@@ -0,0 +1,3 @@
1
+ import EndAdornment from './EndAdornment';
2
+ import EndAdornmentExpanded from './EndAdornmentExpanded';
3
+ export { EndAdornment, EndAdornmentExpanded };
@@ -7,6 +7,7 @@ interface SaleChannelIconsInputProps {
7
7
  onChangeValue: (val: string, id: string) => void;
8
8
  error: string | undefined;
9
9
  readOnly?: boolean;
10
+ isVerified?: boolean;
10
11
  }
11
- export default function SaleChannelIconsInput({ selectedChannels, onSelectIcon, selectedIconId, onChangeValue, error, readOnly }: SaleChannelIconsInputProps): JSX.Element;
12
+ export default function SaleChannelIconsInput({ selectedChannels, onSelectIcon, selectedIconId, onChangeValue, error, readOnly, isVerified }: SaleChannelIconsInputProps): JSX.Element;
12
13
  export {};
@@ -22,6 +22,7 @@ import ToggleButton from '../../../components/ToggleButton';
22
22
  import Icon from '../../../components/Icon';
23
23
  import { useLanguage } from '../../../hooks';
24
24
  import { isWebsite, isTwitter } from '../../../utils';
25
+ import CheckIcon from '../CheckIcon';
25
26
  var SocialMediaGroupStyled = styled(SocialMediaGroup)(function (_a) {
26
27
  var theme = _a.theme, defaultValue = _a.defaultValue;
27
28
  return ({
@@ -68,7 +69,7 @@ var SocialMediaButtonStyled = styled(ToggleButton, {
68
69
  });
69
70
  });
70
71
  export default function SaleChannelIconsInput(_a) {
71
- var selectedChannels = _a.selectedChannels, onSelectIcon = _a.onSelectIcon, selectedIconId = _a.selectedIconId, onChangeValue = _a.onChangeValue, error = _a.error, readOnly = _a.readOnly;
72
+ var selectedChannels = _a.selectedChannels, onSelectIcon = _a.onSelectIcon, selectedIconId = _a.selectedIconId, onChangeValue = _a.onChangeValue, error = _a.error, readOnly = _a.readOnly, isVerified = _a.isVerified;
72
73
  var isAr = useLanguage().isAr;
73
74
  var t = useTranslation().t;
74
75
  var getPlaceHolder = function (item) {
@@ -93,9 +94,9 @@ export default function SaleChannelIconsInput(_a) {
93
94
  var isSubActive = selectedIconId === sub.id;
94
95
  return (_jsx(Collapse, __assign({ in: isSubActive, timeout: 300 }, { children: _jsx(InputStyled, { readOnly: readOnly, onChange: function (e) {
95
96
  onChangeValue(e.target.value, sub.id);
96
- }, value: sub.address || '', startAdornment: _jsx(TextStyled, __assign({ sx: __assign({}, (isTwitter(sub.code) && { fontSize: '20px' })) }, { children: isWebsite(sub.code) ? "https://www." : isTwitter(sub.code) ? "@" : '' })), placeholder: t(getPlaceHolder(sub)) }) }), "sub_".concat(subIndex)));
97
+ }, value: sub.address || '', startAdornment: _jsx(TextStyled, __assign({ sx: __assign({}, (isTwitter(sub.code) && { fontSize: '20px' })) }, { children: isWebsite(sub.code) ? "https://www." : isTwitter(sub.code) ? "@" : '' })), endAdornment: isVerified && !error && _jsx(CheckIcon, { isVerified: true }), placeholder: t(getPlaceHolder(sub)) }) }), "sub_".concat(subIndex)));
97
98
  })) : (_jsx(Collapse, __assign({ in: isActive, timeout: 300 }, { children: _jsx(InputStyled, { readOnly: readOnly, onChange: function (e) {
98
99
  onChangeValue(e.target.value, channel.id);
99
- }, value: channel.address || '', startAdornment: _jsx(TextStyled, __assign({ sx: __assign({}, (isTwitter(channel.code) && { fontSize: '20px' })) }, { children: isWebsite(channel.code) ? "https://www." : isTwitter(channel.code) ? "@" : '' })), placeholder: t(getPlaceHolder(channel)) }) }), index));
100
+ }, value: channel.address || '', startAdornment: _jsx(TextStyled, __assign({ sx: __assign({}, (isTwitter(channel.code) && { fontSize: '20px' })) }, { children: isWebsite(channel.code) ? "https://www." : isTwitter(channel.code) ? "@" : '' })), placeholder: t(getPlaceHolder(channel)), endAdornment: isVerified && !error && _jsx(CheckIcon, { isVerified: true }) }) }), index));
100
101
  }), _jsx(Collapse, __assign({ in: !!(error && error !== 'choose_atleast_one_channel') }, { children: _jsx(Warning, __assign({ warningType: 'alert' }, { children: t(error) })) }))] })) })));
101
102
  }
@@ -8,6 +8,7 @@ interface SalesChannelProps {
8
8
  selectFirstIconListener?: string | number | boolean;
9
9
  disabled?: boolean;
10
10
  readOnly?: boolean;
11
+ isChannelVerified?: (id: string) => boolean;
11
12
  }
12
- declare const _default: React.MemoExoticComponent<({ list, onChange, error, disabled, readOnly, defaultValue, selectFirstIconListener }: SalesChannelProps) => JSX.Element>;
13
+ declare const _default: React.MemoExoticComponent<({ list, onChange, error, disabled, readOnly, defaultValue, selectFirstIconListener, isChannelVerified }: SalesChannelProps) => JSX.Element>;
13
14
  export default _default;
@@ -75,7 +75,7 @@ var CollapseStyled = styled(Collapse)(function (_a) {
75
75
  });
76
76
  });
77
77
  var SalesChannel = function (_a) {
78
- var _b = _a.list, list = _b === void 0 ? [] : _b, onChange = _a.onChange, error = _a.error, disabled = _a.disabled, readOnly = _a.readOnly, _c = _a.defaultValue, defaultValue = _c === void 0 ? [] : _c, _d = _a.selectFirstIconListener, selectFirstIconListener = _d === void 0 ? '' : _d;
78
+ var _b = _a.list, list = _b === void 0 ? [] : _b, onChange = _a.onChange, error = _a.error, disabled = _a.disabled, readOnly = _a.readOnly, _c = _a.defaultValue, defaultValue = _c === void 0 ? [] : _c, _d = _a.selectFirstIconListener, selectFirstIconListener = _d === void 0 ? '' : _d, isChannelVerified = _a.isChannelVerified;
79
79
  var _e = React.useState(''), activeSaleIconId = _e[0], setActiveSaleIconId = _e[1];
80
80
  var _f = React.useState([]), selectedSalas = _f[0], setSelectedSales = _f[1];
81
81
  var t = useTranslation().t;
@@ -145,6 +145,6 @@ var SalesChannel = function (_a) {
145
145
  return (_jsxs(_Fragment, { children: [_jsxs(Box, __assign({ sx: { mb: 3 } }, { children: [_jsxs(InputLabelStyled, { children: [t('channel_of_service'), " ", _jsx(MandatoryStyled, { children: "*" })] }), list.map(function (channel, index) {
146
146
  var _a, _b;
147
147
  return (_jsxs(ContainerStyled, { children: [_jsx(CheckBoxStyled, { id: channel.id, disableRipple: true, disabled: disabled || readOnly, disableFocusRipple: true, focusRipple: false, checked: isChecked(channel.id), onChange: function () { return onSelectSalesChannel(channel); } }), _jsxs(TextStyled, { children: [isAr ? (_a = channel === null || channel === void 0 ? void 0 : channel.name) === null || _a === void 0 ? void 0 : _a.ar : (_b = channel === null || channel === void 0 ? void 0 : channel.name) === null || _b === void 0 ? void 0 : _b.en, " "] })] }, "".concat(channel.id, "-indx").concat(index)));
148
- }), _jsx(CollapseStyled, __assign({ in: error === 'choose_atleast_one_channel' }, { children: _jsx(Warning, __assign({ warningType: 'alert' }, { children: t(error) })) }))] }), 'salesChannels'), _jsx(SaleChannelIconsInput, { readOnly: readOnly, error: error, selectedIconId: activeSaleIconId, onSelectIcon: onChangeActiveSaleIcon, onChangeValue: onValueChange, selectedChannels: selectedSalas }, 'saleChannelIconsInput')] }));
148
+ }), _jsx(CollapseStyled, __assign({ in: error === 'choose_atleast_one_channel' }, { children: _jsx(Warning, __assign({ warningType: 'alert' }, { children: t(error) })) }))] }), 'salesChannels'), _jsx(SaleChannelIconsInput, { readOnly: readOnly, error: error, selectedIconId: activeSaleIconId, onSelectIcon: onChangeActiveSaleIcon, onChangeValue: onValueChange, selectedChannels: selectedSalas, isVerified: isChannelVerified === null || isChannelVerified === void 0 ? void 0 : isChannelVerified(activeSaleIconId) }, 'saleChannelIconsInput')] }));
149
149
  };
150
150
  export default React.memo(SalesChannel);
@@ -26,6 +26,7 @@ export declare type FileUploadProps = {
26
26
  initialFileId?: string;
27
27
  validFileFormats?: Array<string>;
28
28
  readOnly?: boolean;
29
+ isVerified?: boolean;
29
30
  };
30
- declare const FileUpload: ({ key, show, title, file, uploadedFile, onSuccess, onDelete, onUpdate, sx, purpose, isSubmitting, fileRemoveType, initialFileId, validFileFormats, readOnly }: FileUploadProps) => JSX.Element;
31
+ declare const FileUpload: ({ key, show, title, file, uploadedFile, onSuccess, onDelete, onUpdate, sx, purpose, isSubmitting, fileRemoveType, initialFileId, validFileFormats, readOnly, isVerified }: FileUploadProps) => JSX.Element;
31
32
  export default FileUpload;
@@ -108,7 +108,7 @@ var WarningContainer = styled(Box)(function (_a) {
108
108
  return (__assign({ background: alpha(theme.palette.warning.main, 0.1), paddingBlock: theme.spacing(1.5), paddingInlineStart: theme.spacing(2.5), flexDirection: 'row', display: 'flex', justifyContent: 'center', color: theme.palette.warning.light, padding: theme.spacing(0.5, 1), borderRadius: '101px', alignItems: 'center', marginTop: theme.spacing(1.25) }, theme.typography.caption));
109
109
  });
110
110
  var FileUpload = function (_a) {
111
- var key = _a.key, show = _a.show, title = _a.title, file = _a.file, uploadedFile = _a.uploadedFile, onSuccess = _a.onSuccess, onDelete = _a.onDelete, onUpdate = _a.onUpdate, sx = _a.sx, purpose = _a.purpose, isSubmitting = _a.isSubmitting, fileRemoveType = _a.fileRemoveType, initialFileId = _a.initialFileId, _b = _a.validFileFormats, validFileFormats = _b === void 0 ? VALID_FILE_FORMATS : _b, readOnly = _a.readOnly;
111
+ var key = _a.key, show = _a.show, title = _a.title, file = _a.file, uploadedFile = _a.uploadedFile, onSuccess = _a.onSuccess, onDelete = _a.onDelete, onUpdate = _a.onUpdate, sx = _a.sx, purpose = _a.purpose, isSubmitting = _a.isSubmitting, fileRemoveType = _a.fileRemoveType, initialFileId = _a.initialFileId, _b = _a.validFileFormats, validFileFormats = _b === void 0 ? VALID_FILE_FORMATS : _b, readOnly = _a.readOnly, isVerified = _a.isVerified;
112
112
  var theme = useTheme();
113
113
  var t = useTranslation().t;
114
114
  var _c = file || {}, name = _c.name, size = _c.size, type = _c.type;
@@ -227,7 +227,7 @@ var FileUpload = function (_a) {
227
227
  if (status === FileStatus.ERROR)
228
228
  return _jsx(ErrorIconStyled, { src: ICONS_NAMES.ERROR_ICON });
229
229
  if (status === FileStatus.SUCCESS)
230
- return _jsx(CheckIcon, {});
230
+ return _jsx(CheckIcon, { isVerified: isVerified });
231
231
  if (status === FileStatus.DOWNLOADING && !progress)
232
232
  return _jsx(MUICircularProgress, { size: 25, thickness: 5 });
233
233
  if (progress)
@@ -30,6 +30,7 @@ interface UploadWrapperProps {
30
30
  defaultFile?: FileDetails;
31
31
  validFileFormats?: Array<string>;
32
32
  readOnly?: boolean;
33
+ isVerified?: boolean;
33
34
  }
34
- declare const _default: React.MemoExoticComponent<({ id, label, control, required, fileRemoveType, title, subTitle, dragDescription, uploadingTitle, successTitle, isSubmitting, onFileUploaded, fileUploadingStatus, onDeleteFile, purpose, fileTitle, defaultFile, validFileFormats, readOnly }: UploadWrapperProps) => JSX.Element>;
35
+ declare const _default: React.MemoExoticComponent<({ id, label, control, required, fileRemoveType, title, subTitle, dragDescription, uploadingTitle, successTitle, isSubmitting, onFileUploaded, fileUploadingStatus, onDeleteFile, purpose, fileTitle, defaultFile, validFileFormats, readOnly, isVerified }: UploadWrapperProps) => JSX.Element>;
35
36
  export default _default;
@@ -44,7 +44,7 @@ export var InputContainerStyled = styled(Box)(function () { return ({
44
44
  justifyContent: 'center'
45
45
  }); });
46
46
  var UploadWrapper = function (_a) {
47
- var id = _a.id, label = _a.label, control = _a.control, required = _a.required, fileRemoveType = _a.fileRemoveType, title = _a.title, subTitle = _a.subTitle, dragDescription = _a.dragDescription, uploadingTitle = _a.uploadingTitle, successTitle = _a.successTitle, isSubmitting = _a.isSubmitting, onFileUploaded = _a.onFileUploaded, fileUploadingStatus = _a.fileUploadingStatus, onDeleteFile = _a.onDeleteFile, purpose = _a.purpose, fileTitle = _a.fileTitle, defaultFile = _a.defaultFile, validFileFormats = _a.validFileFormats, readOnly = _a.readOnly;
47
+ var id = _a.id, label = _a.label, control = _a.control, required = _a.required, fileRemoveType = _a.fileRemoveType, title = _a.title, subTitle = _a.subTitle, dragDescription = _a.dragDescription, uploadingTitle = _a.uploadingTitle, successTitle = _a.successTitle, isSubmitting = _a.isSubmitting, onFileUploaded = _a.onFileUploaded, fileUploadingStatus = _a.fileUploadingStatus, onDeleteFile = _a.onDeleteFile, purpose = _a.purpose, fileTitle = _a.fileTitle, defaultFile = _a.defaultFile, validFileFormats = _a.validFileFormats, readOnly = _a.readOnly, isVerified = _a.isVerified;
48
48
  var t = useTranslation().t;
49
49
  var _b = React.useState(''), error = _b[0], setError = _b[1];
50
50
  var fileControl = useController({ name: "".concat(id, "File"), control: control });
@@ -110,6 +110,6 @@ var UploadWrapper = function (_a) {
110
110
  var fileExists = !!fileInfo;
111
111
  var showUploadedInputField = (fileInfo === null || fileInfo === void 0 ? void 0 : fileInfo.status) === FileStatus.SUCCESS || (fileInfo === null || fileInfo === void 0 ? void 0 : fileInfo.status) === FileStatus.DOWNLOADING || (fileInfo === null || fileInfo === void 0 ? void 0 : fileInfo.deleteStatus) === DeleteFileStatus.DELETING;
112
112
  var showDragAndDrop = !showUploadedInputField && !readOnly;
113
- return (_jsxs(FeatureStyled, { children: [_jsx(LabelContainerStyled, { children: _jsx(InputLabelStyled, { children: _jsxs(_Fragment, { children: [label, required && _jsx(Mandatory, {})] }) }) }), _jsx(Collapse, __assign({ in: showDragAndDrop }, { children: _jsx(InputContainerStyled, __assign({ sx: { mb: 2.5 } }, { children: _jsx(DragAndDrop, { title: title, subTitle: subTitle, description: dragDescription, fileExists: fileExists, uploadingTitle: uploadingTitle, successTitle: successTitle, progress: fileInfo === null || fileInfo === void 0 ? void 0 : fileInfo.progress, uploading: (fileInfo === null || fileInfo === void 0 ? void 0 : fileInfo.status) === FileStatus.UPLOADING, uploadSuccess: (fileInfo === null || fileInfo === void 0 ? void 0 : fileInfo.status) === FileStatus.SUCCESS, onSuccess: handleFileChange, error: (fileInfo === null || fileInfo === void 0 ? void 0 : fileInfo.error) || error, multiple: false }) })) })), _jsx(Collapse, __assign({ in: fileExists, timeout: 300 }, { children: _jsx(FileUpload, { validFileFormats: validFileFormats, readOnly: readOnly, show: showUploadedInputField, fileRemoveType: fileRemoveType, purpose: purpose, title: fileTitle || '', isSubmitting: isSubmitting, uploadedFile: fileInfo, file: fileData, onSuccess: handleSuccess, onDelete: handleDelete, onUpdate: handleUpdate, initialFileId: defaultFile === null || defaultFile === void 0 ? void 0 : defaultFile.id }) }))] }));
113
+ return (_jsxs(FeatureStyled, { children: [_jsx(LabelContainerStyled, { children: _jsx(InputLabelStyled, { children: _jsxs(_Fragment, { children: [label, required && _jsx(Mandatory, {})] }) }) }), _jsx(Collapse, __assign({ in: showDragAndDrop }, { children: _jsx(InputContainerStyled, __assign({ sx: { mb: 2.5 } }, { children: _jsx(DragAndDrop, { title: title, subTitle: subTitle, description: dragDescription, fileExists: fileExists, uploadingTitle: uploadingTitle, successTitle: successTitle, progress: fileInfo === null || fileInfo === void 0 ? void 0 : fileInfo.progress, uploading: (fileInfo === null || fileInfo === void 0 ? void 0 : fileInfo.status) === FileStatus.UPLOADING, uploadSuccess: (fileInfo === null || fileInfo === void 0 ? void 0 : fileInfo.status) === FileStatus.SUCCESS, onSuccess: handleFileChange, error: (fileInfo === null || fileInfo === void 0 ? void 0 : fileInfo.error) || error, multiple: false }) })) })), _jsx(Collapse, __assign({ in: fileExists, timeout: 300 }, { children: _jsx(FileUpload, { validFileFormats: validFileFormats, readOnly: readOnly, show: showUploadedInputField, fileRemoveType: fileRemoveType, purpose: purpose, title: fileTitle || '', isSubmitting: isSubmitting, uploadedFile: fileInfo, file: fileData, onSuccess: handleSuccess, onDelete: handleDelete, onUpdate: handleUpdate, initialFileId: defaultFile === null || defaultFile === void 0 ? void 0 : defaultFile.id, isVerified: isVerified }) }))] }));
114
114
  };
115
115
  export default React.memo(UploadWrapper);
@@ -23,6 +23,7 @@ export declare type UploadFileProps = {
23
23
  sx?: SxProps<Theme> | undefined;
24
24
  isSubmitting?: boolean;
25
25
  readOnly?: boolean;
26
+ isVerified?: boolean;
26
27
  };
27
- declare const UploadFile: ({ index, title, file, fileType, uploadedFiles, onSuccess, onDelete, onUpdate, sx, purpose, isSubmitting, readOnly }: UploadFileProps) => JSX.Element;
28
+ declare const UploadFile: ({ index, title, file, fileType, uploadedFiles, onSuccess, onDelete, onUpdate, sx, purpose, isSubmitting, readOnly, isVerified }: UploadFileProps) => JSX.Element;
28
29
  export default UploadFile;
@@ -108,7 +108,7 @@ var WarningContainer = styled(Box)(function (_a) {
108
108
  return (__assign({ background: alpha(theme.palette.warning.main, 0.1), paddingBlock: theme.spacing(1.5), paddingInlineStart: theme.spacing(2.5), flexDirection: 'row', display: 'flex', justifyContent: 'center', color: theme.palette.warning.light, padding: theme.spacing(0.5, 1), borderRadius: '101px', alignItems: 'center', marginTop: theme.spacing(1.25) }, theme.typography.caption));
109
109
  });
110
110
  var UploadFile = function (_a) {
111
- var index = _a.index, title = _a.title, file = _a.file, fileType = _a.fileType, uploadedFiles = _a.uploadedFiles, onSuccess = _a.onSuccess, onDelete = _a.onDelete, onUpdate = _a.onUpdate, sx = _a.sx, purpose = _a.purpose, isSubmitting = _a.isSubmitting, readOnly = _a.readOnly;
111
+ var index = _a.index, title = _a.title, file = _a.file, fileType = _a.fileType, uploadedFiles = _a.uploadedFiles, onSuccess = _a.onSuccess, onDelete = _a.onDelete, onUpdate = _a.onUpdate, sx = _a.sx, purpose = _a.purpose, isSubmitting = _a.isSubmitting, readOnly = _a.readOnly, isVerified = _a.isVerified;
112
112
  var theme = useTheme();
113
113
  var t = useTranslation().t;
114
114
  var _b = file || {}, name = _b.name, size = _b.size, type = _b.type;
@@ -229,7 +229,7 @@ var UploadFile = function (_a) {
229
229
  if (status === FileStatus.ERROR)
230
230
  return _jsx(ErrorIconStyled, { src: ICONS_NAMES.ERROR_ICON });
231
231
  if (status === FileStatus.SUCCESS)
232
- return _jsx(CheckIcon, {});
232
+ return _jsx(CheckIcon, { isVerified: isVerified });
233
233
  if (status === FileStatus.DOWNLOADING && !progress)
234
234
  return _jsx(MUICircularProgress, { size: 25, thickness: 5 });
235
235
  if (progress)
@@ -30,6 +30,7 @@ interface UploadMultipleFileProps {
30
30
  maxLimit?: number;
31
31
  defaultFiles?: Array<FileDetails>;
32
32
  readOnly?: boolean;
33
+ isVerified?: boolean;
33
34
  }
34
- declare const UploadMultipleFile: ({ id, label, control, required, fileType, title, subTitle, dragDescription, uploadingTitle, successTitle, isSubmitting, onFileUploaded, fileUploadingStatus, onDeleteFile, maxLimit, purpose, fileTitle, defaultFiles, readOnly }: UploadMultipleFileProps) => JSX.Element;
35
+ declare const UploadMultipleFile: ({ id, label, control, required, fileType, title, subTitle, dragDescription, uploadingTitle, successTitle, isSubmitting, onFileUploaded, fileUploadingStatus, onDeleteFile, maxLimit, purpose, fileTitle, defaultFiles, readOnly, isVerified }: UploadMultipleFileProps) => JSX.Element;
35
36
  export default UploadMultipleFile;
@@ -62,7 +62,7 @@ var UploadCountBox = styled(Box)(function (_a) {
62
62
  });
63
63
  });
64
64
  var UploadMultipleFile = function (_a) {
65
- var id = _a.id, label = _a.label, control = _a.control, required = _a.required, fileType = _a.fileType, title = _a.title, subTitle = _a.subTitle, dragDescription = _a.dragDescription, uploadingTitle = _a.uploadingTitle, successTitle = _a.successTitle, isSubmitting = _a.isSubmitting, onFileUploaded = _a.onFileUploaded, fileUploadingStatus = _a.fileUploadingStatus, onDeleteFile = _a.onDeleteFile, maxLimit = _a.maxLimit, purpose = _a.purpose, fileTitle = _a.fileTitle, defaultFiles = _a.defaultFiles, readOnly = _a.readOnly;
65
+ var id = _a.id, label = _a.label, control = _a.control, required = _a.required, fileType = _a.fileType, title = _a.title, subTitle = _a.subTitle, dragDescription = _a.dragDescription, uploadingTitle = _a.uploadingTitle, successTitle = _a.successTitle, isSubmitting = _a.isSubmitting, onFileUploaded = _a.onFileUploaded, fileUploadingStatus = _a.fileUploadingStatus, onDeleteFile = _a.onDeleteFile, maxLimit = _a.maxLimit, purpose = _a.purpose, fileTitle = _a.fileTitle, defaultFiles = _a.defaultFiles, readOnly = _a.readOnly, isVerified = _a.isVerified;
66
66
  var t = useTranslation().t;
67
67
  var theme = useTheme();
68
68
  var _b = React.useState(''), error = _b[0], setError = _b[1];
@@ -170,7 +170,7 @@ var UploadMultipleFile = function (_a) {
170
170
  };
171
171
  var fileExists = fileInfoArray.length > 0;
172
172
  return (_jsxs(FeatureStyled, { children: [_jsxs(LabelContainerStyled, { children: [_jsx(InputLabelStyled, { children: _jsxs(_Fragment, { children: [label, required && _jsx(Mandatory, {})] }) }), _jsx(Collapse, __assign({ in: !!uploadedFileCount, timeout: 100, unmountOnExit: true }, { children: _jsx(UploadCountBox, { children: "".concat(uploadedFileCount, " ").concat(t('uploaded_file')) }) }))] }), _jsx(Collapse, __assign({ in: fileExists, timeout: 300 }, { children: (fileArray || []).map(function (file, index) {
173
- return (_jsx(UploadFile, { readOnly: readOnly, required: required, purpose: purpose, fileType: fileType, title: fileTitle, isSubmitting: isSubmitting, uploadedFiles: fileInfoArray, index: index, file: file, sx: {
173
+ return (_jsx(UploadFile, { readOnly: readOnly, required: required, purpose: purpose, fileType: fileType, title: fileTitle, isVerified: isVerified, isSubmitting: isSubmitting, uploadedFiles: fileInfoArray, index: index, file: file, sx: {
174
174
  borderBottom: index === fileArray.length - 1 ? "1px solid ".concat(alpha(theme.palette.divider, 0.8)) : ''
175
175
  }, onSuccess: handleSuccess, onDelete: handleDelete, onUpdate: handleUpdate }, index));
176
176
  }) })), _jsx(Collapse, __assign({ in: !readOnly }, { children: _jsx(InputContainerStyled, __assign({ sx: { mt: 2.5 } }, { children: _jsx(DragAndDrop, { title: title, subTitle: subTitle, description: dragDescription, fileExists: fileExists, uploadingTitle: uploadingTitle, successTitle: successTitle, onSuccess: handleFileChange, multiple: true, error: error }) })) }))] }));
@@ -19,3 +19,4 @@ export * from './useFormReadOnly';
19
19
  export * from './useDataNoneEditable';
20
20
  export * from './useFormErrorAndUpdateReadOnly';
21
21
  export * from './useExcludeReadOnlyFelids';
22
+ export * from './useDataVerified';
@@ -19,3 +19,4 @@ export * from './useFormReadOnly';
19
19
  export * from './useDataNoneEditable';
20
20
  export * from './useFormErrorAndUpdateReadOnly';
21
21
  export * from './useExcludeReadOnlyFelids';
22
+ export * from './useDataVerified';
@@ -0,0 +1,6 @@
1
+ import { FieldType } from '../@types';
2
+ declare type DataVerified<T> = {
3
+ [K in keyof T]?: boolean;
4
+ };
5
+ export declare const useDataVerified: <T = undefined>(dataVerification: Record<keyof T, FieldType>, verifiedKeys: (keyof T)[]) => DataVerified<T>;
6
+ export {};
@@ -0,0 +1,19 @@
1
+ import { useCallback, useEffect, useState } from 'react';
2
+ import { hasVerifiedValue } from '../utils';
3
+ export var useDataVerified = function (dataVerification, verifiedKeys) {
4
+ var _a = useState({}), dataVerified = _a[0], setVerified = _a[1];
5
+ var setVerifiedValue = useCallback(function () {
6
+ if (!dataVerification)
7
+ return;
8
+ var obj = {};
9
+ verifiedKeys.forEach(function (path) {
10
+ var isVerified = hasVerifiedValue(dataVerification, path);
11
+ obj[path] = isVerified;
12
+ });
13
+ setVerified(obj);
14
+ }, [dataVerification, verifiedKeys]);
15
+ useEffect(function () {
16
+ setVerifiedValue();
17
+ }, [setVerified]);
18
+ return dataVerified;
19
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tap-payments/auth-jsconnect",
3
- "version": "2.4.0-test",
3
+ "version": "2.4.5-test",
4
4
  "description": "connect library, auth",
5
5
  "private": false,
6
6
  "main": "build/index.js",