@tap-payments/auth-jsconnect 2.0.34-test → 2.0.36-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/@types/app.d.ts +9 -2
- package/build/@types/app.js +7 -0
- package/build/@types/form.d.ts +4 -3
- package/build/api/entity.d.ts +2 -0
- package/build/app/rootReducer.d.ts +1 -0
- package/build/app/rootReducer.js +3 -1
- package/build/app/store.d.ts +2 -0
- package/build/assets/locales/ar.json +8 -4
- package/build/assets/locales/en.json +8 -4
- package/build/components/SocialMediaGroup/SocialMediaGroup.d.ts +2 -1
- package/build/components/SocialMediaGroup/SocialMediaGroup.js +27 -34
- package/build/constants/app.d.ts +1 -0
- package/build/constants/app.js +8 -0
- package/build/constants/assets.d.ts +9 -1
- package/build/constants/assets.js +14 -6
- package/build/features/app/auth/authStore.d.ts +20 -0
- package/build/features/app/auth/authStore.js +101 -0
- package/build/features/app/connect/connectStore.d.ts +1 -0
- package/build/features/app/connect/connectStore.js +58 -4
- package/build/features/app/entity/entityStore.d.ts +5 -0
- package/build/features/app/entity/entityStore.js +149 -14
- package/build/features/auth/Auth.d.ts +8 -0
- package/build/features/auth/Auth.js +53 -0
- package/build/features/auth/index.d.ts +1 -0
- package/build/features/auth/index.js +1 -0
- package/build/features/auth/screens/OTP/OTP.d.ts +5 -0
- package/build/features/auth/screens/OTP/OTP.js +72 -0
- package/build/features/auth/screens/OTP/OTPInput.d.ts +5 -0
- package/build/features/auth/screens/OTP/OTPInput.js +44 -0
- package/build/features/auth/screens/OTP/index.d.ts +3 -0
- package/build/features/auth/screens/OTP/index.js +2 -0
- package/build/features/auth/screens/OTP/validation.d.ts +8 -0
- package/build/features/auth/screens/OTP/validation.js +4 -0
- package/build/features/connect/screens/Merchant/Merchant.js +29 -9
- package/build/features/connect/screens/Merchant/SalesChannels.d.ts +5 -0
- package/build/features/connect/screens/Merchant/SalesChannels.js +114 -0
- package/build/features/connect/screens/Merchant/SocialMedia.js +56 -11
- package/build/features/connect/screens/Merchant/validation.d.ts +87 -0
- package/build/features/connect/screens/Merchant/validation.js +68 -2
- package/build/features/entity/screens/EntityInfoConfirm/ActivitiesList.d.ts +54 -0
- package/build/features/entity/screens/EntityInfoConfirm/ActivitiesList.js +139 -0
- package/build/features/entity/screens/EntityInfoConfirm/EntityInfo.js +52 -2
- package/build/features/entity/screens/EntityInfoConfirm/LicenseName.d.ts +5 -0
- package/build/features/entity/screens/EntityInfoConfirm/LicenseName.js +17 -0
- package/build/features/entity/screens/EntityInfoConfirm/LicenseNumber.d.ts +5 -0
- package/build/features/entity/screens/EntityInfoConfirm/LicenseNumber.js +28 -0
- package/build/features/entity/screens/EntityInfoConfirm/OperationStartDate.d.ts +6 -0
- package/build/features/entity/screens/EntityInfoConfirm/OperationStartDate.js +38 -0
- package/build/features/entity/screens/EntityInfoConfirm/SalesChannels.d.ts +5 -0
- package/build/features/entity/screens/EntityInfoConfirm/SalesChannels.js +112 -0
- package/build/features/entity/screens/EntityInfoConfirm/validation.d.ts +107 -0
- package/build/features/entity/screens/EntityInfoConfirm/validation.js +17 -0
- package/build/features/featuresScreens.d.ts +1 -0
- package/build/features/featuresScreens.js +9 -2
- package/build/hooks/useAppDispatch.d.ts +1 -0
- package/build/index.d.ts +3 -2
- package/build/index.js +5 -2
- package/package.json +128 -128
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
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
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
24
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
25
|
+
if (ar || !(i in from)) {
|
|
26
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
27
|
+
ar[i] = from[i];
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
31
|
+
};
|
|
32
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
33
|
+
import * as React from 'react';
|
|
34
|
+
import Box from '@mui/material/Box';
|
|
35
|
+
import { alpha, styled } from '@mui/material/styles';
|
|
36
|
+
import Text from '../../../../components/Text';
|
|
37
|
+
import Input from '../../../../components/Input';
|
|
38
|
+
import { useTranslation } from 'react-i18next';
|
|
39
|
+
import { useController, useFormContext } from 'react-hook-form';
|
|
40
|
+
import { useLanguage, useAppSelector } from '../../../../hooks';
|
|
41
|
+
import { BusinessType } from '../../../../@types';
|
|
42
|
+
import Collapse from '../../../../components/Collapse';
|
|
43
|
+
import SimpleList from '../../../../components/SimpleList';
|
|
44
|
+
import ExpandIcon from '../../../../components/ExpandIcon';
|
|
45
|
+
import { ScreenContainer } from '../../../shared/Containers';
|
|
46
|
+
import { entitySelector } from '../../../app/entity/entityStore';
|
|
47
|
+
import CheckIcon from '@mui/icons-material/Check';
|
|
48
|
+
export var InputLabelStyled = styled(Text)(function (_a) {
|
|
49
|
+
var theme = _a.theme;
|
|
50
|
+
return (__assign({ margin: theme.spacing(2.5, 2.5, 1.5, 2.5), color: alpha(theme.palette.text.primary, 0.4) }, theme.typography.caption));
|
|
51
|
+
});
|
|
52
|
+
export var InputStyled = styled(Input)(function (_a) {
|
|
53
|
+
var theme = _a.theme;
|
|
54
|
+
return ({
|
|
55
|
+
paddingInlineEnd: theme.spacing(2.5),
|
|
56
|
+
'& .MuiInputBase-input': {
|
|
57
|
+
cursor: 'pointer'
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
var SimpleListStyled = styled((SimpleList))(function () { return ({
|
|
62
|
+
height: 'fit-content'
|
|
63
|
+
}); });
|
|
64
|
+
export var CheckIconStyled = styled(CheckIcon)(function (_a) {
|
|
65
|
+
var theme = _a.theme;
|
|
66
|
+
return ({
|
|
67
|
+
color: theme.palette.primary.main,
|
|
68
|
+
display: 'flex',
|
|
69
|
+
alignItems: 'flex-end'
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
export var NameContainer = styled(Text, { shouldForwardProp: function (prop) { return prop !== 'isSelected'; } })(function (_a) {
|
|
73
|
+
var theme = _a.theme, isSelected = _a.isSelected;
|
|
74
|
+
return (__assign(__assign({ color: theme.palette.text.primary }, theme.typography.body2), { fontWeight: isSelected ? theme.typography.fontWeightMedium : theme.typography.fontWeightLight, paddingInlineStart: theme.spacing(1.25) }));
|
|
75
|
+
});
|
|
76
|
+
var ActivitiesList = function (_a) {
|
|
77
|
+
var _b, _c, _d, _e;
|
|
78
|
+
var rest = __rest(_a, []);
|
|
79
|
+
var _f = React.useState([]), activitiesMenuList = _f[0], setActivitiesMenuList = _f[1];
|
|
80
|
+
var _g = React.useState([]), storedActivities = _g[0], setStoredActivities = _g[1];
|
|
81
|
+
var _h = React.useState(null), anchorEl = _h[0], setAnchorEl = _h[1];
|
|
82
|
+
var t = useTranslation().t;
|
|
83
|
+
var isAr = useLanguage().isAr;
|
|
84
|
+
var control = useFormContext().control;
|
|
85
|
+
var data = useAppSelector(entitySelector).data;
|
|
86
|
+
var activitiesControl = useController({ name: 'activities', control: control });
|
|
87
|
+
var controlValue = activitiesControl.field.value;
|
|
88
|
+
var verify = data.verify, entityData = data.entityData;
|
|
89
|
+
var activities = (((_b = verify.responseBody) === null || _b === void 0 ? void 0 : _b.entity) || {}).activities;
|
|
90
|
+
var selectedActivities = (entityData.responseBody || {}).selectedActivities;
|
|
91
|
+
var businessType = (_e = (_d = (_c = verify.responseBody) === null || _c === void 0 ? void 0 : _c.entity) === null || _d === void 0 ? void 0 : _d.license) === null || _e === void 0 ? void 0 : _e.type;
|
|
92
|
+
var isCR = businessType === BusinessType.CR;
|
|
93
|
+
React.useEffect(function () {
|
|
94
|
+
if ((activities === null || activities === void 0 ? void 0 : activities.length) > 0) {
|
|
95
|
+
setActivitiesMenuList(activities);
|
|
96
|
+
}
|
|
97
|
+
}, [activities]);
|
|
98
|
+
React.useEffect(function () {
|
|
99
|
+
if ((selectedActivities === null || selectedActivities === void 0 ? void 0 : selectedActivities.length) > 0) {
|
|
100
|
+
setStoredActivities(selectedActivities);
|
|
101
|
+
}
|
|
102
|
+
}, []);
|
|
103
|
+
var onOpenList = function (event) {
|
|
104
|
+
var _a;
|
|
105
|
+
setAnchorEl(event.currentTarget);
|
|
106
|
+
(_a = rest.onListOpen) === null || _a === void 0 ? void 0 : _a.call(rest);
|
|
107
|
+
};
|
|
108
|
+
var onCloseList = function () {
|
|
109
|
+
var _a;
|
|
110
|
+
setAnchorEl(null);
|
|
111
|
+
(_a = rest.onListClose) === null || _a === void 0 ? void 0 : _a.call(rest);
|
|
112
|
+
};
|
|
113
|
+
var onSelectItem = function (item) {
|
|
114
|
+
var isActivityExists = controlValue === null || controlValue === void 0 ? void 0 : controlValue.find(function (activity) { return activity.en === (item === null || item === void 0 ? void 0 : item.en); });
|
|
115
|
+
var storedActivity = storedActivities === null || storedActivities === void 0 ? void 0 : storedActivities.find(function (activity) { return activity.en === (item === null || item === void 0 ? void 0 : item.en); });
|
|
116
|
+
if (isActivityExists && !storedActivity) {
|
|
117
|
+
var updatedIdList = controlValue === null || controlValue === void 0 ? void 0 : controlValue.filter(function (activity) { return activity.en !== (item === null || item === void 0 ? void 0 : item.en); });
|
|
118
|
+
if (updatedIdList.length >= 1)
|
|
119
|
+
activitiesControl.field.onChange(updatedIdList);
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
if (!storedActivity)
|
|
123
|
+
activitiesControl.field.onChange(__spreadArray(__spreadArray([], controlValue, true), [item], false));
|
|
124
|
+
};
|
|
125
|
+
var getSelectedActivities = function () {
|
|
126
|
+
var _a, _b;
|
|
127
|
+
if ((controlValue === null || controlValue === void 0 ? void 0 : controlValue.length) > 1) {
|
|
128
|
+
return (controlValue === null || controlValue === void 0 ? void 0 : controlValue.length) + ' ' + t('activities_selected');
|
|
129
|
+
}
|
|
130
|
+
return isAr ? (_a = controlValue[0]) === null || _a === void 0 ? void 0 : _a.ar : (_b = controlValue[0]) === null || _b === void 0 ? void 0 : _b.en;
|
|
131
|
+
};
|
|
132
|
+
var getSelectedActivityFlag = function (item) {
|
|
133
|
+
return controlValue === null || controlValue === void 0 ? void 0 : controlValue.find(function (activity) { return activity.en === (item === null || item === void 0 ? void 0 : item.en); });
|
|
134
|
+
};
|
|
135
|
+
return (_jsx(Collapse, __assign({ in: (activitiesMenuList === null || activitiesMenuList === void 0 ? void 0 : activitiesMenuList.length) > 0 }, { children: _jsxs(ScreenContainer, { children: [_jsx(InputLabelStyled, { children: t(isCR ? 'activities' : 'category') }), _jsxs(Box, { children: [_jsx(InputStyled, { readOnly: true, value: getSelectedActivities(), placeholder: isCR ? t('choose_activities') : t('category_name'), onClick: !!anchorEl ? function () { return onCloseList(); } : onOpenList, endAdornment: _jsx(ExpandIcon, { anchorEl: !!anchorEl }) }), _jsx(Collapse, __assign({ in: !!anchorEl, timeout: 300 }, { children: _jsx(SimpleListStyled, { searchKeyPath: 'name', list: activitiesMenuList, onSelectItem: onSelectItem, renderItem: function (item) {
|
|
136
|
+
return (_jsxs(_Fragment, { children: [_jsx(Box, __assign({ display: 'flex' }, { children: _jsx(NameContainer, __assign({ isSelected: (item === null || item === void 0 ? void 0 : item.en) === getSelectedActivityFlag(item) }, { children: isAr ? item === null || item === void 0 ? void 0 : item.ar : item === null || item === void 0 ? void 0 : item.en })) })), getSelectedActivityFlag(item) && _jsx(CheckIconStyled, {})] }));
|
|
137
|
+
} }) }))] })] }) })));
|
|
138
|
+
};
|
|
139
|
+
export default ActivitiesList;
|
|
@@ -1,6 +1,56 @@
|
|
|
1
|
-
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
13
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
14
|
+
import LicenseName from './LicenseName';
|
|
15
|
+
import * as React from 'react';
|
|
16
|
+
import LicenseNumber from './LicenseNumber';
|
|
17
|
+
import ActivitiesList from './ActivitiesList';
|
|
18
|
+
import { useAppDispatch, useAppSelector, useLanguage } from '../../../../hooks';
|
|
19
|
+
import { entitySelector, updateEntityInfo } from '../../../app/entity/entityStore';
|
|
20
|
+
import { FormProvider, useForm } from 'react-hook-form';
|
|
21
|
+
import { yupResolver } from '@hookform/resolvers/yup';
|
|
22
|
+
import { handlePrevScreenStep } from '../../../../app/settings';
|
|
23
|
+
import { styled } from '@mui/system';
|
|
24
|
+
import { EntityInfoValidationSchema } from './validation';
|
|
25
|
+
import Form from '../../../../components/Form';
|
|
26
|
+
import Collapse from '../../../../components/Collapse';
|
|
27
|
+
import Button from '../../../shared/Button';
|
|
28
|
+
import { useTranslation } from 'react-i18next';
|
|
29
|
+
import OperationStartDate from './OperationStartDate';
|
|
30
|
+
var FormStyled = styled(Form)(function () { return ({
|
|
31
|
+
display: 'flex',
|
|
32
|
+
flexDirection: 'column'
|
|
33
|
+
}); });
|
|
3
34
|
var EntityInfo = function (_a) {
|
|
4
|
-
|
|
35
|
+
var _b = React.useState(false), anchorEl = _b[0], setAnchorEl = _b[1];
|
|
36
|
+
var _c = useAppSelector(entitySelector), data = _c.data, loading = _c.loading, error = _c.error;
|
|
37
|
+
var isAr = useLanguage().isAr;
|
|
38
|
+
var t = useTranslation().t;
|
|
39
|
+
var dispatch = useAppDispatch();
|
|
40
|
+
var methods = useForm({
|
|
41
|
+
resolver: yupResolver(EntityInfoValidationSchema),
|
|
42
|
+
defaultValues: data.entityData,
|
|
43
|
+
mode: 'onChange'
|
|
44
|
+
});
|
|
45
|
+
var onSubmit = function (data) {
|
|
46
|
+
dispatch(updateEntityInfo(__assign({}, data)));
|
|
47
|
+
};
|
|
48
|
+
var onBack = function () {
|
|
49
|
+
dispatch(handlePrevScreenStep());
|
|
50
|
+
};
|
|
51
|
+
var handleMenuClick = function () {
|
|
52
|
+
anchorEl ? setAnchorEl(false) : setAnchorEl(true);
|
|
53
|
+
};
|
|
54
|
+
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsxs(Collapse, __assign({ in: !anchorEl }, { children: [_jsx(LicenseName, {}), _jsx(LicenseNumber, {})] })), _jsx(ActivitiesList, { onListOpen: function () { return handleMenuClick(); }, onListClose: function () { return handleMenuClick(); } }), _jsxs(Collapse, __assign({ in: !anchorEl }, { children: [_jsx(OperationStartDate, {}), _jsx(Button, __assign({ disableBack: true, onBackClicked: function () { return onBack(); }, isAr: isAr, loading: loading, error: t(error || '') }, { children: t('next') }))] }))] })) })) }));
|
|
5
55
|
};
|
|
6
56
|
export default EntityInfo;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { useTranslation } from 'react-i18next';
|
|
4
|
+
import { ScreenContainer } from '../../../shared/Containers';
|
|
5
|
+
import Input from '../../../shared/Input';
|
|
6
|
+
import { useAppSelector, useLanguage } from '../../../../hooks';
|
|
7
|
+
import { entitySelector } from '../../../app/entity/entityStore';
|
|
8
|
+
var LicenseName = function (_a) {
|
|
9
|
+
var _b, _c, _d;
|
|
10
|
+
var t = useTranslation().t;
|
|
11
|
+
var isAr = useLanguage().isAr;
|
|
12
|
+
var data = useAppSelector(entitySelector).data;
|
|
13
|
+
var entity = (((_b = data.verify) === null || _b === void 0 ? void 0 : _b.responseBody) || {}).entity;
|
|
14
|
+
var name = isAr ? (_c = entity === null || entity === void 0 ? void 0 : entity.legal_name) === null || _c === void 0 ? void 0 : _c.ar : (_d = entity === null || entity === void 0 ? void 0 : entity.legal_name) === null || _d === void 0 ? void 0 : _d.en;
|
|
15
|
+
return (_jsx(ScreenContainer, { children: _jsx(Input, { label: t('license_name_label'), readOnly: !!name, placeholder: t('license_name_label'), value: name, sx: { '& .MuiInputBase-input': { cursor: 'auto' } } }) }));
|
|
16
|
+
};
|
|
17
|
+
export default React.memo(LicenseName);
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import * as React from 'react';
|
|
14
|
+
import { useTranslation } from 'react-i18next';
|
|
15
|
+
import { ScreenContainer } from '../../../shared/Containers';
|
|
16
|
+
import Input from '../../../shared/Input';
|
|
17
|
+
import Collapse from '../../../../components/Collapse';
|
|
18
|
+
import { useAppSelector } from '../../../../hooks';
|
|
19
|
+
import { entitySelector } from '../../../app/entity/entityStore';
|
|
20
|
+
var LicenseNumber = function (_a) {
|
|
21
|
+
var _b, _c;
|
|
22
|
+
var t = useTranslation().t;
|
|
23
|
+
var data = useAppSelector(entitySelector).data;
|
|
24
|
+
var entity = (((_b = data.verify) === null || _b === void 0 ? void 0 : _b.responseBody) || {}).entity;
|
|
25
|
+
var number = (_c = entity === null || entity === void 0 ? void 0 : entity.license) === null || _c === void 0 ? void 0 : _c.number;
|
|
26
|
+
return (_jsx(Collapse, __assign({ in: !!number }, { children: _jsx(ScreenContainer, __assign({ sx: { mt: 2.5 } }, { children: _jsx(Input, { label: t('license_number_label'), readOnly: true, value: number, sx: { '& .MuiInputBase-input': { cursor: 'auto' } } }) })) })));
|
|
27
|
+
};
|
|
28
|
+
export default React.memo(LicenseNumber);
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { useTranslation } from 'react-i18next';
|
|
14
|
+
import { useController, useFormContext } from 'react-hook-form';
|
|
15
|
+
import Input from '../../../shared/Input';
|
|
16
|
+
import { ScreenContainer } from '../../../shared/Containers';
|
|
17
|
+
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
18
|
+
import { entitySelector, clearError } from '../../../app/entity/entityStore';
|
|
19
|
+
import DatePicker from '../../../../components/DatePicker';
|
|
20
|
+
import { InputLabelStyled } from './ActivitiesList';
|
|
21
|
+
var OperationStartDate = function (_a) {
|
|
22
|
+
var _b, _c, _d;
|
|
23
|
+
var onDateClicked = _a.onDateClicked;
|
|
24
|
+
var t = useTranslation().t;
|
|
25
|
+
var dispatch = useAppDispatch();
|
|
26
|
+
var control = useFormContext().control;
|
|
27
|
+
var _e = useAppSelector(entitySelector), data = _e.data, error = _e.error;
|
|
28
|
+
var oDateControl = useController({ control: control, name: 'operationStartDate' });
|
|
29
|
+
var handleOperationStartDateChange = function (data) {
|
|
30
|
+
if (error)
|
|
31
|
+
dispatch(clearError());
|
|
32
|
+
oDateControl.field.onChange(data);
|
|
33
|
+
};
|
|
34
|
+
var dateValue = (_b = oDateControl === null || oDateControl === void 0 ? void 0 : oDateControl.field) === null || _b === void 0 ? void 0 : _b.value;
|
|
35
|
+
var storedDate = (_d = (_c = data.verify.responseBody) === null || _c === void 0 ? void 0 : _c.brand) === null || _d === void 0 ? void 0 : _d.business_operation_start_at;
|
|
36
|
+
return (_jsx(ScreenContainer, __assign({ sx: { mt: 2.5 } }, { children: !!storedDate ? (_jsx(Input, { label: t('business_start_date'), readOnly: true, value: dateValue, sx: { '& .MuiInputBase-input': { cursor: 'auto' } } })) : (_jsxs(_Fragment, { children: [_jsx(InputLabelStyled, { children: t('business_start_date') }), _jsx(DatePicker, { readOnly: true, defaultValue: dateValue ? new Date(dateValue) : new Date(), dir: 'ltr', locale: 'en', onClick: function () { return onDateClicked === null || onDateClicked === void 0 ? void 0 : onDateClicked(true); }, onDatePicked: function () { return onDateClicked === null || onDateClicked === void 0 ? void 0 : onDateClicked(false); }, onDateChange: handleOperationStartDateChange })] })) })));
|
|
37
|
+
};
|
|
38
|
+
export default OperationStartDate;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export declare const MandatoryStyled: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
3
|
+
export declare const CollapseStyled: import("@emotion/styled").StyledComponent<import("../../../../components/Collapse").CollapseProps & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
4
|
+
declare const SalesChannels: () => JSX.Element;
|
|
5
|
+
export default SalesChannels;
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
13
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
14
|
+
if (ar || !(i in from)) {
|
|
15
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
16
|
+
ar[i] = from[i];
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
20
|
+
};
|
|
21
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
22
|
+
import * as React from 'react';
|
|
23
|
+
import Box from '@mui/material/Box';
|
|
24
|
+
import { alpha, styled } from '@mui/material/styles';
|
|
25
|
+
import { useTranslation } from 'react-i18next';
|
|
26
|
+
import { useController, useFormContext } from 'react-hook-form';
|
|
27
|
+
import { useLanguage, useAppSelector, useAppDispatch } from '../../../../hooks';
|
|
28
|
+
import Text from '../../../../components/Text';
|
|
29
|
+
import { entitySelector, clearError } from '../../../app/entity/entityStore';
|
|
30
|
+
import CheckBox from '../../../../components/CheckBox';
|
|
31
|
+
import Warning from '../../../../components/Warning';
|
|
32
|
+
import Collapse from '../../../../components/Collapse';
|
|
33
|
+
import { ScreenContainer } from '../../../shared/Containers';
|
|
34
|
+
var InputLabelStyled = styled(Text)(function (_a) {
|
|
35
|
+
var theme = _a.theme;
|
|
36
|
+
return (__assign({ margin: theme.spacing(2.5, 2.5, 0.5, 2.5), color: alpha(theme.palette.text.primary, 0.4) }, theme.typography.caption));
|
|
37
|
+
});
|
|
38
|
+
var ContainerStyled = styled(Box)(function (_a) {
|
|
39
|
+
var theme = _a.theme;
|
|
40
|
+
return ({
|
|
41
|
+
display: 'flex',
|
|
42
|
+
flexDirection: 'row',
|
|
43
|
+
alignItems: 'center',
|
|
44
|
+
padding: theme.spacing(0, 0.5, 0, 0.5),
|
|
45
|
+
height: theme.spacing(3.625),
|
|
46
|
+
marginBlockEnd: theme.spacing(0.2)
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
var TextStyled = styled(Text)(function (_a) {
|
|
50
|
+
var theme = _a.theme;
|
|
51
|
+
return (__assign(__assign({ color: alpha(theme.palette.text.primary, 0.4), fontWeight: theme.typography.fontWeightLight, whiteSpace: 'pre' }, theme.typography.body2), { marginBlockStart: theme.spacing(1.75) }));
|
|
52
|
+
});
|
|
53
|
+
var CheckBoxStyled = styled(CheckBox)(function (_a) {
|
|
54
|
+
var theme = _a.theme;
|
|
55
|
+
return ({
|
|
56
|
+
marginInlineEnd: theme.spacing(-1),
|
|
57
|
+
'& .MuiSvgIcon-root': {
|
|
58
|
+
fontSize: 30
|
|
59
|
+
},
|
|
60
|
+
'&.Mui-checked': {
|
|
61
|
+
color: theme.palette.text.primary,
|
|
62
|
+
borderRadius: theme.spacing(2.5)
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
export var MandatoryStyled = styled('span')(function (_a) {
|
|
67
|
+
var theme = _a.theme;
|
|
68
|
+
return (__assign(__assign({ color: alpha(theme.palette.error.light, 0.4) }, theme.typography.h6), { fontWeight: theme.typography.fontWeightLight, verticalAlign: 'sub' }));
|
|
69
|
+
});
|
|
70
|
+
export var CollapseStyled = styled(Collapse)(function (_a) {
|
|
71
|
+
var theme = _a.theme;
|
|
72
|
+
return ({
|
|
73
|
+
marginBlockStart: theme.spacing(2)
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
var SalesChannels = function () {
|
|
77
|
+
var _a;
|
|
78
|
+
var _b = React.useState([]), channelsMenuList = _b[0], setChannelsMenuList = _b[1];
|
|
79
|
+
var t = useTranslation().t;
|
|
80
|
+
var isAr = useLanguage().isAr;
|
|
81
|
+
var control = useFormContext().control;
|
|
82
|
+
var dispatch = useAppDispatch();
|
|
83
|
+
var channelsControl = useController({ name: 'salesChannels', control: control });
|
|
84
|
+
var channelsChecked = channelsControl.field.value;
|
|
85
|
+
var warningMessage = (_a = channelsControl.fieldState.error) === null || _a === void 0 ? void 0 : _a.message;
|
|
86
|
+
var _c = useAppSelector(entitySelector), data = _c.data, error = _c.error;
|
|
87
|
+
var channelList = (data.verify.responseBody || {}).channelList;
|
|
88
|
+
var salesChannels = (data.entityData || {}).salesChannels;
|
|
89
|
+
React.useEffect(function () {
|
|
90
|
+
if ((channelList === null || channelList === void 0 ? void 0 : channelList.length) > 0) {
|
|
91
|
+
setChannelsMenuList(channelList);
|
|
92
|
+
}
|
|
93
|
+
}, [channelList]);
|
|
94
|
+
var handleSalesChannelChange = function (event, checked) {
|
|
95
|
+
var selected = channelsMenuList.find(function (channel) { return channel.id === event.target.id; });
|
|
96
|
+
var isExists = channelsChecked === null || channelsChecked === void 0 ? void 0 : channelsChecked.find(function (channel) { return channel.id === (selected === null || selected === void 0 ? void 0 : selected.id); });
|
|
97
|
+
if (isExists) {
|
|
98
|
+
var updatedIdList = channelsChecked === null || channelsChecked === void 0 ? void 0 : channelsChecked.filter(function (channel) { return channel.id !== (selected === null || selected === void 0 ? void 0 : selected.id); });
|
|
99
|
+
channelsControl.field.onChange(updatedIdList);
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
channelsControl.field.onChange(__spreadArray(__spreadArray([], channelsChecked, true), [selected], false));
|
|
103
|
+
if (error)
|
|
104
|
+
dispatch(clearError());
|
|
105
|
+
};
|
|
106
|
+
var getSelectedChannelsFlag = function (item) {
|
|
107
|
+
if (channelsChecked)
|
|
108
|
+
return !!(channelsChecked === null || channelsChecked === void 0 ? void 0 : channelsChecked.find(function (channel) { return channel.id === (item === null || item === void 0 ? void 0 : item.id); }));
|
|
109
|
+
};
|
|
110
|
+
return (_jsxs(ScreenContainer, { children: [_jsx(InputLabelStyled, { children: t('channel_of_service') }), channelsMenuList.map(function (channel) { return (_jsxs(ContainerStyled, { children: [_jsx(CheckBoxStyled, { id: channel.id, disableRipple: true, disableFocusRipple: true, focusRipple: false, disabled: (salesChannels === null || salesChannels === void 0 ? void 0 : salesChannels.find(function (c) { return c.id === (channel === null || channel === void 0 ? void 0 : channel.id); })) ? true : false, checked: getSelectedChannelsFlag(channel), onChange: handleSalesChannelChange }), _jsxs(TextStyled, { children: [isAr ? channel.name_ar : channel.name_en, " "] })] }, channel.id)); }), _jsx(CollapseStyled, __assign({ in: !!warningMessage }, { children: _jsx(Warning, __assign({ warningType: 'alert' }, { children: t(warningMessage) })) }))] }));
|
|
111
|
+
};
|
|
112
|
+
export default SalesChannels;
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import * as yup from 'yup';
|
|
2
|
+
export declare const EntityInfoValidationSchema: yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
3
|
+
activities: yup.ArraySchema<yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
4
|
+
ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
5
|
+
en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
6
|
+
}>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
7
|
+
ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
8
|
+
en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
9
|
+
}>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
10
|
+
ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
11
|
+
en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
12
|
+
}>>>, import("yup/lib/types").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
13
|
+
ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
14
|
+
en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
15
|
+
}>>[] | undefined, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
16
|
+
ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
17
|
+
en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
18
|
+
}>>[] | undefined>;
|
|
19
|
+
salesChannels: import("yup/lib/array").RequiredArraySchema<yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
20
|
+
id: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
21
|
+
name_en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
22
|
+
name_ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
23
|
+
}>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
24
|
+
id: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
25
|
+
name_en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
26
|
+
name_ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
27
|
+
}>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
28
|
+
id: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
29
|
+
name_en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
30
|
+
name_ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
31
|
+
}>>>, import("yup/lib/types").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
32
|
+
id: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
33
|
+
name_en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
34
|
+
name_ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
35
|
+
}>>[] | undefined>;
|
|
36
|
+
operationStartDate: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
37
|
+
}>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
38
|
+
activities: yup.ArraySchema<yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
39
|
+
ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
40
|
+
en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
41
|
+
}>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
42
|
+
ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
43
|
+
en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
44
|
+
}>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
45
|
+
ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
46
|
+
en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
47
|
+
}>>>, import("yup/lib/types").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
48
|
+
ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
49
|
+
en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
50
|
+
}>>[] | undefined, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
51
|
+
ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
52
|
+
en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
53
|
+
}>>[] | undefined>;
|
|
54
|
+
salesChannels: import("yup/lib/array").RequiredArraySchema<yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
55
|
+
id: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
56
|
+
name_en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
57
|
+
name_ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
58
|
+
}>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
59
|
+
id: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
60
|
+
name_en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
61
|
+
name_ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
62
|
+
}>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
63
|
+
id: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
64
|
+
name_en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
65
|
+
name_ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
66
|
+
}>>>, import("yup/lib/types").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
67
|
+
id: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
68
|
+
name_en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
69
|
+
name_ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
70
|
+
}>>[] | undefined>;
|
|
71
|
+
operationStartDate: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
72
|
+
}>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
73
|
+
activities: yup.ArraySchema<yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
74
|
+
ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
75
|
+
en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
76
|
+
}>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
77
|
+
ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
78
|
+
en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
79
|
+
}>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
80
|
+
ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
81
|
+
en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
82
|
+
}>>>, import("yup/lib/types").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
83
|
+
ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
84
|
+
en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
85
|
+
}>>[] | undefined, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
86
|
+
ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
87
|
+
en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
88
|
+
}>>[] | undefined>;
|
|
89
|
+
salesChannels: import("yup/lib/array").RequiredArraySchema<yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
90
|
+
id: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
91
|
+
name_en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
92
|
+
name_ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
93
|
+
}>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
94
|
+
id: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
95
|
+
name_en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
96
|
+
name_ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
97
|
+
}>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
98
|
+
id: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
99
|
+
name_en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
100
|
+
name_ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
101
|
+
}>>>, import("yup/lib/types").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
|
|
102
|
+
id: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
103
|
+
name_en: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
104
|
+
name_ar: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
|
|
105
|
+
}>>[] | undefined>;
|
|
106
|
+
operationStartDate: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
|
|
107
|
+
}>>>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as yup from 'yup';
|
|
2
|
+
export var EntityInfoValidationSchema = yup.object().shape({
|
|
3
|
+
activities: yup.array().of(yup.object().shape({
|
|
4
|
+
ar: yup.string(),
|
|
5
|
+
en: yup.string()
|
|
6
|
+
})),
|
|
7
|
+
salesChannels: yup
|
|
8
|
+
.array()
|
|
9
|
+
.min(1, 'choose_atleast_one_channel')
|
|
10
|
+
.of(yup.object().shape({
|
|
11
|
+
id: yup.string(),
|
|
12
|
+
name_en: yup.string(),
|
|
13
|
+
name_ar: yup.string()
|
|
14
|
+
}))
|
|
15
|
+
.required('choose_atleast_one_channel'),
|
|
16
|
+
operationStartDate: yup.string().required('choose_any_business_date')
|
|
17
|
+
});
|
|
@@ -8,3 +8,4 @@ export declare const taxFeatureScreens: Array<FeatureScreenStep>;
|
|
|
8
8
|
export declare const signInFeatureScreens: Array<FeatureScreenStep>;
|
|
9
9
|
export declare const entityFeatureScreens: Array<FeatureScreenStep>;
|
|
10
10
|
export declare const otpFeatureScreens: Array<FeatureScreenStep>;
|
|
11
|
+
export declare const authFeatureScreens: Array<FeatureScreenStep>;
|
|
@@ -41,9 +41,10 @@ import SignInPasswordPage from './signIn/screens/Password';
|
|
|
41
41
|
import EntityVerifyPage from './entity/screens/Verify';
|
|
42
42
|
import EntityInfoConfirmPage from './entity/screens/EntityInfoConfirm';
|
|
43
43
|
import EntitySuccessPage from './entity/screens/Success';
|
|
44
|
-
import EntitySuccessWithFlowPage from './entity/screens/
|
|
45
|
-
import EntityResetPasswordSuccessPage from './entity/screens/
|
|
44
|
+
import EntitySuccessWithFlowPage from './entity/screens/SuccessWithFlowButtons';
|
|
45
|
+
import EntityResetPasswordSuccessPage from './entity/screens/ResetPasswordSuccess';
|
|
46
46
|
import OtpVerifyPage from '../features/otp/screens/OTPVerify';
|
|
47
|
+
import AuthVerifyPage from './auth/screens/OTP';
|
|
47
48
|
export var connectFeatureScreens = [
|
|
48
49
|
{
|
|
49
50
|
name: 'CONNECT_NID_STEP',
|
|
@@ -222,3 +223,9 @@ export var otpFeatureScreens = [
|
|
|
222
223
|
element: OtpVerifyPage
|
|
223
224
|
}
|
|
224
225
|
];
|
|
226
|
+
export var authFeatureScreens = [
|
|
227
|
+
{
|
|
228
|
+
name: 'AUTH_VERIFY_STEP',
|
|
229
|
+
element: AuthVerifyPage
|
|
230
|
+
}
|
|
231
|
+
];
|
|
@@ -9,4 +9,5 @@ export declare const useAppDispatch: () => import("redux-thunk").ThunkDispatch<{
|
|
|
9
9
|
signIn: import("../features/app/signIn/signInStore").SignInState;
|
|
10
10
|
entity: import("../features/app/entity/entityStore").EntityState;
|
|
11
11
|
otp: import("../features/app/otp/otpStore").OtpState;
|
|
12
|
+
auth: import("../features/app/auth/authStore").AuthState;
|
|
12
13
|
}, undefined, import("redux").AnyAction> & import("redux").Dispatch<import("redux").AnyAction>;
|
package/build/index.d.ts
CHANGED
|
@@ -9,5 +9,6 @@ import { TaxLib, renderTaxLib, TaxLibProps, unmountTaxLib } from './features/tax
|
|
|
9
9
|
import { SignInLib, renderSignInLib, SignInLibProps, unmountSignInLib } from './features/signIn';
|
|
10
10
|
import { EntityLib, EntityLibProps, renderEntityLib, unmountEntityLib } from './features/entity';
|
|
11
11
|
import { OTPLib, OTPLibProps, renderOTPLib, unmountOTPLib } from './features/otp/OTP';
|
|
12
|
-
|
|
13
|
-
export {
|
|
12
|
+
import { AuthLib, AuthLibProps, renderAuthLib, unmountAuthLib } from './features/auth';
|
|
13
|
+
export type { ConnectLibProps, BusinessLibProps, PasswordLibProps, IndividualLibProps, BankLibProps, TaxLibProps, EntityLibProps, OTPLibProps, AuthLibProps, SignInLibProps };
|
|
14
|
+
export { ConnectLib, renderConnectLib, unmountConnectLib, BusinessLib, renderBusinessLib, unmountBusinessLib, PasswordLib, renderPasswordLib, unmountPasswordLib, IndividualLib, renderIndividualLib, unmountIndividualLib, BankLib, renderBankLib, unmountBankLib, TaxLib, renderTaxLib, unmountTaxLib, EntityLib, renderEntityLib, unmountEntityLib, OTPLib, renderOTPLib, unmountOTPLib, SignInLib, renderSignInLib, unmountSignInLib, AuthLib, renderAuthLib, unmountAuthLib };
|