@tap-payments/auth-jsconnect 1.0.30 → 1.0.33

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 (71) hide show
  1. package/build/@types/app.d.ts +17 -1
  2. package/build/@types/form.d.ts +16 -1
  3. package/build/api/axios.d.ts +2 -0
  4. package/build/api/axios.js +10 -0
  5. package/build/api/entity.d.ts +20 -0
  6. package/build/api/entity.js +9 -0
  7. package/build/api/firebase.d.ts +4 -0
  8. package/build/api/firebase.js +9 -0
  9. package/build/api/index.d.ts +16 -2
  10. package/build/api/index.js +7 -1
  11. package/build/api/lead.d.ts +22 -0
  12. package/build/api/lead.js +21 -1
  13. package/build/app/settings.d.ts +1 -0
  14. package/build/app/settings.js +44 -18
  15. package/build/assets/locales/ar.json +1 -1
  16. package/build/components/Input/Input.d.ts +1 -1
  17. package/build/components/Input/Input.js +3 -2
  18. package/build/components/Slide/Slide.d.ts +1 -1
  19. package/build/components/Warning/Warning.d.ts +1 -1
  20. package/build/components/Warning/Warning.js +13 -2
  21. package/build/constants/api.d.ts +5 -0
  22. package/build/constants/api.js +11 -1
  23. package/build/constants/app.d.ts +7 -1
  24. package/build/constants/app.js +7 -1
  25. package/build/constants/assets.d.ts +1 -0
  26. package/build/constants/assets.js +2 -1
  27. package/build/constants/dummy.js +3 -3
  28. package/build/constants/validation.d.ts +2 -0
  29. package/build/constants/validation.js +2 -0
  30. package/build/features/app/business/businessStore.d.ts +54 -4
  31. package/build/features/app/business/businessStore.js +325 -5
  32. package/build/features/app/connect/connectStore.d.ts +3 -1
  33. package/build/features/app/connect/connectStore.js +72 -43
  34. package/build/features/bank/screens/BankDetails/validation.js +2 -1
  35. package/build/features/business/Business.js +7 -3
  36. package/build/features/business/screens/Activities/Activities.js +3 -3
  37. package/build/features/business/screens/Activities/ActivitiesList.d.ts +2 -2
  38. package/build/features/business/screens/Activities/OperationStartDate.js +1 -1
  39. package/build/features/business/screens/BusinessType/BusinessType.d.ts +1 -8
  40. package/build/features/business/screens/BusinessType/BusinessType.js +25 -27
  41. package/build/features/business/screens/Confirm/Confirm.js +8 -9
  42. package/build/features/business/screens/Customers/CustomerLocations.d.ts +3 -3
  43. package/build/features/business/screens/IDBOD/DOB.js +1 -1
  44. package/build/features/business/screens/IDBOD/IDBOD.js +19 -12
  45. package/build/features/business/screens/OTP/OTP.d.ts +2 -5
  46. package/build/features/business/screens/OTP/OTP.js +18 -15
  47. package/build/features/business/screens/OTP/OTPInput.js +20 -5
  48. package/build/features/business/screens/Verify/OTPInput.js +7 -3
  49. package/build/features/business/screens/Verify/Verify.d.ts +1 -9
  50. package/build/features/business/screens/Verify/Verify.js +15 -17
  51. package/build/features/business/screens/Verify/index.d.ts +1 -2
  52. package/build/features/connect/screens/Individual/MobileNumber.js +23 -11
  53. package/build/features/connect/screens/Individual/Name.js +10 -1
  54. package/build/features/connect/screens/Individual/validation.js +3 -2
  55. package/build/features/connect/screens/Mobile/Mobile.js +2 -3
  56. package/build/features/connect/screens/Mobile/MobileNumber.js +22 -28
  57. package/build/features/connect/screens/NID/NID.js +1 -2
  58. package/build/features/connect/screens/OTP/OTPInput.js +3 -0
  59. package/build/features/connect/screens/Password/Password.js +2 -2
  60. package/build/features/featuresScreens.js +3 -3
  61. package/build/features/individual/screens/AdditionalIndividualInfo/validation.js +2 -4
  62. package/build/features/shared/Button/AbsherButton.js +1 -1
  63. package/build/features/shared/Input/Input.d.ts +1 -1
  64. package/build/features/shared/SuccessScreen/SuccessScreen.js +12 -2
  65. package/build/hooks/useAppConfig.js +100 -24
  66. package/build/theme/palette.js +4 -0
  67. package/build/utils/locale.d.ts +2 -0
  68. package/build/utils/locale.js +21 -0
  69. package/build/utils/string.d.ts +26 -1
  70. package/build/utils/string.js +62 -1
  71. package/package.json +1 -1
@@ -51,7 +51,7 @@ import { handleNextScreenStep } from '../../../app/settings';
51
51
  import API from '../../../api';
52
52
  import { CONNECT_STEP_NAMES, IDENTIFICATION_TYPE } from '../../../constants';
53
53
  import { defaultCountry } from '../../../constants';
54
- import { getIndividualName, getClientEmailUrl } from '../../../utils';
54
+ import { getIndividualName, getClientEmailUrl, capitalizeTheFirstLetterOfEachWord, removeRequestHeaders } from '../../../utils';
55
55
  export var getCountries = createAsyncThunk('getCountries', function (_, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
56
56
  var settings, countriesBody, list, businessCountry;
57
57
  return __generator(this, function (_a) {
@@ -178,36 +178,57 @@ export var verifyAuth = createAsyncThunk('verifyAuth', function (params, thunkAp
178
178
  }
179
179
  });
180
180
  }); });
181
- export var verifyAuthPassword = createAsyncThunk('verifyAuthPassword', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
182
- var _a, connect, settings, isAbsher, responseBody, payload, data;
183
- var _b, _c;
184
- return __generator(this, function (_d) {
185
- switch (_d.label) {
181
+ export var createVerifyAuthPassword = createAsyncThunk('verifyAuthPassword', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
182
+ var _a, connect, settings, _b, businessCountry, mobileData, mobile, countryCode, requestBody, data, payload, response, leadResponse, leadPayload;
183
+ var _c, _d, _e;
184
+ return __generator(this, function (_f) {
185
+ switch (_f.label) {
186
186
  case 0:
187
187
  _a = thunkApi.getState(), connect = _a.connect, settings = _a.settings;
188
- isAbsher = connect.data.otpData.isAbsher;
189
- responseBody = (isAbsher ? connect.data.nidData : connect.data.mobileData).responseBody;
188
+ _b = connect.data, businessCountry = _b.businessCountry, mobileData = _b.mobileData;
189
+ mobile = mobileData.mobile, countryCode = mobileData.countryCode;
190
+ requestBody = {
191
+ user_credentail: {
192
+ phone: mobile || '',
193
+ code: countryCode.idd_prefix.toString()
194
+ },
195
+ device_info: settings.data.deviceInfo,
196
+ sign_in: true,
197
+ step_name: CONNECT_STEP_NAMES.CREATE_AUTH_PASSWORD,
198
+ encryption_contract: ['user_credentail.phone', 'user_credentail.code']
199
+ };
200
+ return [4, API.authService.createAuth(requestBody)];
201
+ case 1:
202
+ data = (_f.sent()).data;
190
203
  payload = {
191
204
  data: params.password,
192
- auth_token: responseBody === null || responseBody === void 0 ? void 0 : responseBody.auth_token,
193
- auth_type: responseBody === null || responseBody === void 0 ? void 0 : responseBody.auth_type,
194
- device_token: responseBody === null || responseBody === void 0 ? void 0 : responseBody.device_token,
195
- service_name: responseBody === null || responseBody === void 0 ? void 0 : responseBody.service_name,
196
- new_user: responseBody === null || responseBody === void 0 ? void 0 : responseBody.new_user,
205
+ auth_token: data === null || data === void 0 ? void 0 : data.auth_token,
206
+ auth_type: data === null || data === void 0 ? void 0 : data.auth_type,
207
+ device_token: data === null || data === void 0 ? void 0 : data.device_token,
208
+ service_name: data === null || data === void 0 ? void 0 : data.service_name,
209
+ new_user: data === null || data === void 0 ? void 0 : data.new_user,
197
210
  sign_in: true,
198
- remember_me: responseBody === null || responseBody === void 0 ? void 0 : responseBody.remember_me,
199
- scopes: responseBody === null || responseBody === void 0 ? void 0 : responseBody.scopes,
211
+ remember_me: data === null || data === void 0 ? void 0 : data.remember_me,
212
+ scopes: data === null || data === void 0 ? void 0 : data.scopes,
200
213
  step_name: CONNECT_STEP_NAMES.VERIFY_AUTH_PASSWORD,
201
214
  encryption_contract: ['data']
202
215
  };
203
216
  return [4, API.authService.verifyAuth(payload)];
204
- case 1:
205
- data = (_d.sent()).data;
206
- if (!data.errors) {
207
- thunkApi.dispatch(handleNextScreenStep());
208
- (_c = (_b = settings.data.appConfig).onStepCompleted) === null || _c === void 0 ? void 0 : _c.call(_b, settings.data.activeScreen.name, { password: params.password });
209
- }
210
- return [2, { response: data, formData: params }];
217
+ case 2:
218
+ response = _f.sent();
219
+ leadResponse = undefined;
220
+ leadPayload = {
221
+ individual_id: (_c = response.data) === null || _c === void 0 ? void 0 : _c.individual_id,
222
+ country_code: businessCountry.iso2
223
+ };
224
+ if (!(!data.errors && !response.data.errors)) return [3, 4];
225
+ return [4, API.leadService.createLead(leadPayload)];
226
+ case 3:
227
+ leadResponse = _f.sent();
228
+ thunkApi.dispatch(handleNextScreenStep());
229
+ (_e = (_d = settings.data.appConfig).onStepCompleted) === null || _e === void 0 ? void 0 : _e.call(_d, settings.data.activeScreen.name, { password: params.password });
230
+ _f.label = 4;
231
+ case 4: return [2, { response: response.data, createAuthResponse: data, leadResponse: leadResponse === null || leadResponse === void 0 ? void 0 : leadResponse.data, formData: params }];
211
232
  }
212
233
  });
213
234
  }); });
@@ -256,15 +277,18 @@ export var updateLeadIndividual = createAsyncThunk('updateLeadIndividual', funct
256
277
  });
257
278
  }); });
258
279
  export var updateLeadBrand = createAsyncThunk('updateLeadBrand', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
259
- var _a, settings, connect, headers, payload, data;
260
- var _b, _c, _d, _e, _f, _g, _h, _j;
261
- return __generator(this, function (_k) {
262
- switch (_k.label) {
280
+ var _a, settings, connect, isNewUser, headers, payload, data;
281
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
282
+ return __generator(this, function (_m) {
283
+ switch (_m.label) {
263
284
  case 0:
264
285
  _a = thunkApi.getState(), settings = _a.settings, connect = _a.connect;
286
+ isNewUser = (_b = connect.data.otpData.responseBody) === null || _b === void 0 ? void 0 : _b.new_user;
265
287
  headers = {
266
- lead_id: ((_b = connect.data.otpData.responseBody) === null || _b === void 0 ? void 0 : _b.lead_id) || '',
267
- device_identifier: (_d = (_c = settings.data.deviceInfo) === null || _c === void 0 ? void 0 : _c.browser) === null || _d === void 0 ? void 0 : _d.browser_id
288
+ lead_id: !isNewUser
289
+ ? (_c = connect.data.passwordData.responseBody) === null || _c === void 0 ? void 0 : _c.lead_id
290
+ : ((_d = connect.data.otpData.responseBody) === null || _d === void 0 ? void 0 : _d.lead_id) || '',
291
+ device_identifier: (_f = (_e = settings.data.deviceInfo) === null || _e === void 0 ? void 0 : _e.browser) === null || _f === void 0 ? void 0 : _f.browser_id
268
292
  };
269
293
  payload = {
270
294
  brand: {
@@ -273,8 +297,8 @@ export var updateLeadBrand = createAsyncThunk('updateLeadBrand', function (param
273
297
  ar: params.brandName,
274
298
  zh: params.brandName
275
299
  },
276
- website: (_e = params.links) === null || _e === void 0 ? void 0 : _e.website,
277
- social: [(_f = params.links) === null || _f === void 0 ? void 0 : _f.twitter, (_g = params.links) === null || _g === void 0 ? void 0 : _g.instagram]
300
+ website: (_g = params.links) === null || _g === void 0 ? void 0 : _g.website,
301
+ social: [(_h = params.links) === null || _h === void 0 ? void 0 : _h.twitter, (_j = params.links) === null || _j === void 0 ? void 0 : _j.instagram]
278
302
  },
279
303
  terms_conditions_accepted: params.termAndConditionChecked,
280
304
  step_name: CONNECT_STEP_NAMES.UPDATE_LEAD_MERCHANT,
@@ -282,10 +306,10 @@ export var updateLeadBrand = createAsyncThunk('updateLeadBrand', function (param
282
306
  };
283
307
  return [4, API.leadService.updateLead(payload, { headers: headers })];
284
308
  case 1:
285
- data = (_k.sent()).data;
309
+ data = (_m.sent()).data;
286
310
  if (!data.errors) {
287
311
  thunkApi.dispatch(handleNextScreenStep());
288
- (_j = (_h = settings.data.appConfig).onStepCompleted) === null || _j === void 0 ? void 0 : _j.call(_h, settings.data.activeScreen.name, params);
312
+ (_l = (_k = settings.data.appConfig).onStepCompleted) === null || _l === void 0 ? void 0 : _l.call(_k, settings.data.activeScreen.name, params);
289
313
  }
290
314
  return [2, { response: data, formData: params }];
291
315
  }
@@ -486,8 +510,10 @@ export var connectSlice = createSlice({
486
510
  if (!!leadResponse && !leadError) {
487
511
  var name_1 = leadResponse.name, contact = leadResponse.contact;
488
512
  var email = (contact || {}).email;
489
- if (!!name_1)
490
- state.data.individualData.name = (name_1 === null || name_1 === void 0 ? void 0 : name_1.first) + ' ' + (name_1 === null || name_1 === void 0 ? void 0 : name_1.middle) + ' ' + (name_1 === null || name_1 === void 0 ? void 0 : name_1.last);
513
+ if (!!name_1) {
514
+ var capitalizedName = capitalizeTheFirstLetterOfEachWord((name_1 === null || name_1 === void 0 ? void 0 : name_1.first) + ' ' + (name_1 === null || name_1 === void 0 ? void 0 : name_1.middle) + ' ' + (name_1 === null || name_1 === void 0 ? void 0 : name_1.third) + ' ' + (name_1 === null || name_1 === void 0 ? void 0 : name_1.last));
515
+ state.data.individualData.name = capitalizedName;
516
+ }
491
517
  if (!!email)
492
518
  state.data.individualData.email = email;
493
519
  }
@@ -502,24 +528,26 @@ export var connectSlice = createSlice({
502
528
  state.loading = false;
503
529
  state.error = action.error.message;
504
530
  })
505
- .addCase(verifyAuthPassword.fulfilled, function (state, action) {
506
- var _a;
531
+ .addCase(createVerifyAuthPassword.fulfilled, function (state, action) {
532
+ var _a, _b, _c;
507
533
  state.loading = false;
508
534
  state.error = null;
509
- var _b = action.payload, formData = _b.formData, response = _b.response;
510
- var description = (((_a = response === null || response === void 0 ? void 0 : response.errors) === null || _a === void 0 ? void 0 : _a[0]) || {}).description;
511
- if (description) {
512
- state.error = description;
535
+ var _d = action.payload, formData = _d.formData, response = _d.response, createAuthResponse = _d.createAuthResponse, leadResponse = _d.leadResponse;
536
+ var error = ((_a = createAuthResponse === null || createAuthResponse === void 0 ? void 0 : createAuthResponse.errors) === null || _a === void 0 ? void 0 : _a[0]) || {};
537
+ var description = (((_b = response === null || response === void 0 ? void 0 : response.errors) === null || _b === void 0 ? void 0 : _b[0]) || {}).description;
538
+ var leadError = ((_c = leadResponse === null || leadResponse === void 0 ? void 0 : leadResponse.errors) === null || _c === void 0 ? void 0 : _c[0]) || {};
539
+ if ((error === null || error === void 0 ? void 0 : error.description) || description || (leadError === null || leadError === void 0 ? void 0 : leadError.description)) {
540
+ state.error = (error === null || error === void 0 ? void 0 : error.description) || description;
513
541
  return;
514
542
  }
515
543
  state.data.passwordData.password = formData.password;
516
- state.data.passwordData.responseBody = response;
544
+ state.data.passwordData.responseBody = leadResponse;
517
545
  })
518
- .addCase(verifyAuthPassword.pending, function (state) {
546
+ .addCase(createVerifyAuthPassword.pending, function (state) {
519
547
  state.loading = true;
520
548
  state.error = null;
521
549
  })
522
- .addCase(verifyAuthPassword.rejected, function (state, action) {
550
+ .addCase(createVerifyAuthPassword.rejected, function (state, action) {
523
551
  state.loading = false;
524
552
  state.error = action.error.message;
525
553
  })
@@ -603,6 +631,7 @@ export var connectSlice = createSlice({
603
631
  state.error = description;
604
632
  return;
605
633
  }
634
+ removeRequestHeaders();
606
635
  })
607
636
  .addCase(updateLeadSuccess.pending, function (state) {
608
637
  state.loading = true;
@@ -1,3 +1,4 @@
1
+ import { REGEX_FULL_NAME } from '../../../../constants';
1
2
  import * as yup from 'yup';
2
3
  export var BankValidation = yup.object().shape({
3
4
  iban: yup
@@ -9,6 +10,6 @@ export var BankValidation = yup.object().shape({
9
10
  bankName: yup.string().required('bank_name_required'),
10
11
  beneficiaryName: yup
11
12
  .string()
12
- .matches(/^([a-zA-Z0-9]+\s{1}[a-zA-Z0-9]{2,}|[a-zA-Z0-9]+\s{1}[a-zA-Z0-9]{1,}\s{1}[a-zA-Z0-9]{2,})$/g, 'beneficiary_name_invalid')
13
+ .matches(REGEX_FULL_NAME, 'beneficiary_name_invalid')
13
14
  .required('beneficiary_name_required')
14
15
  });
@@ -15,7 +15,7 @@ import { styled } from '@mui/material/styles';
15
15
  import Box from '@mui/material/Box';
16
16
  import { useAppTheme, useAppDispatch, useAppSelector, useAppConfig, useErrorListener } from '../../hooks';
17
17
  import { settingsSelector } from '../../app/settings';
18
- import { verifyLeadToken } from '../app/business/businessStore';
18
+ import { getCountries, verifyLeadToken } from '../app/business/businessStore';
19
19
  import AnimationFlow from '../../components/AnimationFlow';
20
20
  import { store } from '../../app/store';
21
21
  import { ReduxProvider, ThemeProvider } from '../../components/Providers';
@@ -41,7 +41,7 @@ var Business = memo(function (props) {
41
41
  var theme = useAppTheme().theme;
42
42
  var dispatch = useAppDispatch();
43
43
  var data = useAppSelector(settingsSelector).data;
44
- useAppConfig(__assign({ navigation: BUSINESS_SCREENS_NAVIGATION }, props));
44
+ var loading = useAppConfig(__assign({ navigation: BUSINESS_SCREENS_NAVIGATION }, props)).loading;
45
45
  useErrorListener();
46
46
  var activeScreen = data.activeScreen;
47
47
  var verifyToken = function () {
@@ -51,7 +51,11 @@ var Business = memo(function (props) {
51
51
  dispatch(verifyLeadToken(token));
52
52
  };
53
53
  useEffect(function () {
54
- verifyToken();
54
+ if (!loading)
55
+ verifyToken();
56
+ }, [loading]);
57
+ useEffect(function () {
58
+ dispatch(getCountries());
55
59
  }, []);
56
60
  return (_jsx(ThemeProvider, __assign({ theme: theme }, { children: _jsx(AnimationFlow, __assign({ open: open, breakpoint: 'sm', footer: _jsx(CustomFooter, {}) }, { children: _jsx(Container, { children: businessFeatureScreens.map(function (_a, index) {
57
61
  var Element = _a.element, name = _a.name;
@@ -19,13 +19,14 @@ import Form from '../../../../components/Form';
19
19
  import { yupResolver } from '@hookform/resolvers/yup';
20
20
  import { useTranslation } from 'react-i18next';
21
21
  import { ActivitiesValidationSchema } from './validation';
22
- import { handleNextScreenStep, handlePrevScreenStep } from '../../../../app/settings';
22
+ import { handlePrevScreenStep } from '../../../../app/settings';
23
23
  import { ACTIVITIES, SALES_CHANNELS } from '../../../../constants';
24
24
  import Button from '../../../shared/Button';
25
25
  import SalesChannels from './SalesChannels';
26
26
  import { ScreenContainer } from '../../../shared/Containers';
27
27
  import Collapse from '../../../../components/Collapse';
28
28
  import OperationStartDate from './OperationStartDate';
29
+ import { updateEntityInfo } from '../../../app/business/businessStore';
29
30
  var FormStyled = styled(Form)(function () { return ({
30
31
  display: 'flex',
31
32
  flexDirection: 'column'
@@ -46,8 +47,7 @@ var Activities = function () {
46
47
  mode: 'onChange'
47
48
  });
48
49
  var onSubmit = function (data) {
49
- console.log('data', data);
50
- dispatch(handleNextScreenStep());
50
+ dispatch(updateEntityInfo(__assign(__assign({}, data), { isResend: false })));
51
51
  };
52
52
  var handleCollapseOpenClose = function (flag) {
53
53
  console.log('flag', flag);
@@ -15,7 +15,7 @@ export declare const InputLabelStyled: import("@emotion/styled").StyledComponent
15
15
  export declare const InputStyled: import("@emotion/styled").StyledComponent<Pick<import("../../../../components/Input").InputProps, "name" | "type" | "className" | "style" | "classes" | "color" | "margin" | "translate" | "slot" | "title" | "ref" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "sx" | "size" | "disabled" | "error" | "components" | "componentsProps" | "value" | "autoFocus" | "fullWidth" | "required" | "rows" | "inputProps" | "inputRef" | "readOnly" | "autoComplete" | "disableInjectingGlobalStyles" | "endAdornment" | "inputComponent" | "multiline" | "renderSuffix" | "maxRows" | "minRows" | "startAdornment" | "disableUnderline" | "onEnterPressed" | "warningMessage"> & {
16
16
  placeholder?: string | undefined;
17
17
  hide?: boolean | undefined;
18
- warningType?: "alert" | "error" | undefined;
18
+ warningType?: "alert" | "error" | "hint" | undefined;
19
19
  } & {} & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
20
20
  export declare const CheckIconStyled: import("@emotion/styled").StyledComponent<{
21
21
  children?: React.ReactNode;
@@ -28,7 +28,7 @@ export declare const CheckIconStyled: import("@emotion/styled").StyledComponent<
28
28
  sx?: import("@mui/material/styles").SxProps<import("@mui/material/styles").Theme> | undefined;
29
29
  titleAccess?: string | undefined;
30
30
  viewBox?: string | undefined;
31
- } & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<React.SVGProps<SVGSVGElement>, "string" | "name" | "type" | "version" | "className" | "style" | "display" | "overflow" | "visibility" | "order" | "color" | "width" | "height" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "clipPath" | "cursor" | "direction" | "filter" | "fontSizeAdjust" | "fontStretch" | "fontVariant" | "imageRendering" | "opacity" | "paintOrder" | "pointerEvents" | "rotate" | "scale" | "textRendering" | "transform" | "unicodeBidi" | "wordSpacing" | "writingMode" | "mask" | "offset" | "textDecoration" | "azimuth" | "clip" | "alignmentBaseline" | "baselineShift" | "clipRule" | "colorInterpolation" | "colorRendering" | "dominantBaseline" | "fill" | "fillOpacity" | "fillRule" | "floodColor" | "floodOpacity" | "glyphOrientationVertical" | "lightingColor" | "markerEnd" | "markerMid" | "markerStart" | "shapeRendering" | "stopColor" | "stopOpacity" | "stroke" | "strokeDasharray" | "strokeDashoffset" | "strokeLinecap" | "strokeLinejoin" | "strokeMiterlimit" | "strokeOpacity" | "strokeWidth" | "textAnchor" | "vectorEffect" | "path" | "key" | "id" | "lang" | "tabIndex" | "role" | "children" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "end" | "values" | "local" | "x" | "y" | "alphabetic" | "hanging" | "ideographic" | "mathematical" | "spacing" | "elevation" | "in" | "max" | "href" | "orientation" | "media" | "target" | "origin" | "min" | "viewBox" | "method" | "crossOrigin" | "accentHeight" | "accumulate" | "additive" | "allowReorder" | "amplitude" | "arabicForm" | "ascent" | "attributeName" | "attributeType" | "autoReverse" | "baseFrequency" | "baseProfile" | "bbox" | "begin" | "bias" | "by" | "calcMode" | "capHeight" | "clipPathUnits" | "colorInterpolationFilters" | "colorProfile" | "contentScriptType" | "contentStyleType" | "cx" | "cy" | "d" | "decelerate" | "descent" | "diffuseConstant" | "divisor" | "dur" | "dx" | "dy" | "edgeMode" | "enableBackground" | "exponent" | "externalResourcesRequired" | "filterRes" | "filterUnits" | "focusable" | "format" | "fr" | "from" | "fx" | "fy" | "g1" | "g2" | "glyphName" | "glyphOrientationHorizontal" | "glyphRef" | "gradientTransform" | "gradientUnits" | "horizAdvX" | "horizOriginX" | "in2" | "intercept" | "k1" | "k2" | "k3" | "k4" | "k" | "kernelMatrix" | "kernelUnitLength" | "kerning" | "keyPoints" | "keySplines" | "keyTimes" | "lengthAdjust" | "limitingConeAngle" | "markerHeight" | "markerUnits" | "markerWidth" | "maskContentUnits" | "maskUnits" | "mode" | "numOctaves" | "operator" | "orient" | "overlinePosition" | "overlineThickness" | "panose1" | "pathLength" | "patternContentUnits" | "patternTransform" | "patternUnits" | "points" | "pointsAtX" | "pointsAtY" | "pointsAtZ" | "preserveAlpha" | "preserveAspectRatio" | "primitiveUnits" | "r" | "radius" | "refX" | "refY" | "renderingIntent" | "repeatCount" | "repeatDur" | "requiredExtensions" | "requiredFeatures" | "restart" | "result" | "rx" | "ry" | "seed" | "slope" | "specularConstant" | "specularExponent" | "speed" | "spreadMethod" | "startOffset" | "stdDeviation" | "stemh" | "stemv" | "stitchTiles" | "strikethroughPosition" | "strikethroughThickness" | "surfaceScale" | "systemLanguage" | "tableValues" | "targetX" | "targetY" | "textLength" | "to" | "u1" | "u2" | "underlinePosition" | "underlineThickness" | "unicode" | "unicodeRange" | "unitsPerEm" | "vAlphabetic" | "vertAdvY" | "vertOriginX" | "vertOriginY" | "vHanging" | "vIdeographic" | "viewTarget" | "vMathematical" | "widths" | "x1" | "x2" | "xChannelSelector" | "xHeight" | "xlinkActuate" | "xlinkArcrole" | "xlinkHref" | "xlinkRole" | "xlinkShow" | "xlinkTitle" | "xlinkType" | "xmlBase" | "xmlLang" | "xmlns" | "xmlnsXlink" | "xmlSpace" | "y1" | "y2" | "yChannelSelector" | "z" | "zoomAndPan"> & {
31
+ } & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<React.SVGProps<SVGSVGElement>, "string" | "name" | "type" | "version" | "className" | "style" | "display" | "overflow" | "visibility" | "order" | "color" | "width" | "height" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "clipPath" | "cursor" | "direction" | "filter" | "fontSizeAdjust" | "fontStretch" | "fontVariant" | "imageRendering" | "opacity" | "paintOrder" | "pointerEvents" | "rotate" | "scale" | "textRendering" | "transform" | "unicodeBidi" | "wordSpacing" | "writingMode" | "mask" | "offset" | "textDecoration" | "azimuth" | "clip" | "alignmentBaseline" | "baselineShift" | "clipRule" | "colorInterpolation" | "colorRendering" | "dominantBaseline" | "fill" | "fillOpacity" | "fillRule" | "floodColor" | "floodOpacity" | "glyphOrientationVertical" | "lightingColor" | "markerEnd" | "markerMid" | "markerStart" | "shapeRendering" | "stopColor" | "stopOpacity" | "stroke" | "strokeDasharray" | "strokeDashoffset" | "strokeLinecap" | "strokeLinejoin" | "strokeMiterlimit" | "strokeOpacity" | "strokeWidth" | "textAnchor" | "vectorEffect" | "path" | "key" | "id" | "lang" | "tabIndex" | "role" | "children" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "end" | "values" | "local" | "x" | "y" | "alphabetic" | "hanging" | "ideographic" | "mathematical" | "method" | "spacing" | "elevation" | "in" | "max" | "href" | "orientation" | "media" | "target" | "origin" | "min" | "viewBox" | "crossOrigin" | "accentHeight" | "accumulate" | "additive" | "allowReorder" | "amplitude" | "arabicForm" | "ascent" | "attributeName" | "attributeType" | "autoReverse" | "baseFrequency" | "baseProfile" | "bbox" | "begin" | "bias" | "by" | "calcMode" | "capHeight" | "clipPathUnits" | "colorInterpolationFilters" | "colorProfile" | "contentScriptType" | "contentStyleType" | "cx" | "cy" | "d" | "decelerate" | "descent" | "diffuseConstant" | "divisor" | "dur" | "dx" | "dy" | "edgeMode" | "enableBackground" | "exponent" | "externalResourcesRequired" | "filterRes" | "filterUnits" | "focusable" | "format" | "fr" | "from" | "fx" | "fy" | "g1" | "g2" | "glyphName" | "glyphOrientationHorizontal" | "glyphRef" | "gradientTransform" | "gradientUnits" | "horizAdvX" | "horizOriginX" | "in2" | "intercept" | "k1" | "k2" | "k3" | "k4" | "k" | "kernelMatrix" | "kernelUnitLength" | "kerning" | "keyPoints" | "keySplines" | "keyTimes" | "lengthAdjust" | "limitingConeAngle" | "markerHeight" | "markerUnits" | "markerWidth" | "maskContentUnits" | "maskUnits" | "mode" | "numOctaves" | "operator" | "orient" | "overlinePosition" | "overlineThickness" | "panose1" | "pathLength" | "patternContentUnits" | "patternTransform" | "patternUnits" | "points" | "pointsAtX" | "pointsAtY" | "pointsAtZ" | "preserveAlpha" | "preserveAspectRatio" | "primitiveUnits" | "r" | "radius" | "refX" | "refY" | "renderingIntent" | "repeatCount" | "repeatDur" | "requiredExtensions" | "requiredFeatures" | "restart" | "result" | "rx" | "ry" | "seed" | "slope" | "specularConstant" | "specularExponent" | "speed" | "spreadMethod" | "startOffset" | "stdDeviation" | "stemh" | "stemv" | "stitchTiles" | "strikethroughPosition" | "strikethroughThickness" | "surfaceScale" | "systemLanguage" | "tableValues" | "targetX" | "targetY" | "textLength" | "to" | "u1" | "u2" | "underlinePosition" | "underlineThickness" | "unicode" | "unicodeRange" | "unitsPerEm" | "vAlphabetic" | "vertAdvY" | "vertOriginX" | "vertOriginY" | "vHanging" | "vIdeographic" | "viewTarget" | "vMathematical" | "widths" | "x1" | "x2" | "xChannelSelector" | "xHeight" | "xlinkActuate" | "xlinkArcrole" | "xlinkHref" | "xlinkRole" | "xlinkShow" | "xlinkTitle" | "xlinkType" | "xmlBase" | "xmlLang" | "xmlns" | "xmlnsXlink" | "xmlSpace" | "y1" | "y2" | "yChannelSelector" | "z" | "zoomAndPan"> & {
32
32
  ref?: ((instance: SVGSVGElement | null) => void) | React.RefObject<SVGSVGElement> | null | undefined;
33
33
  }, keyof import("@mui/material/OverridableComponent").CommonProps | "color" | "fontSize" | "shapeRendering" | "children" | "sx" | "htmlColor" | "inheritViewBox" | "titleAccess" | "viewBox"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
34
34
  export declare const NameContainer: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material/styles").Theme> & {
@@ -14,7 +14,7 @@ import { InputLabelStyled } from './ActivitiesList';
14
14
  import { useTranslation } from 'react-i18next';
15
15
  import { useController, useFormContext } from 'react-hook-form';
16
16
  import DatePicker from '../../../../components/DatePicker';
17
- import { ScreenContainer } from '../../../../features/shared/Containers';
17
+ import { ScreenContainer } from '../../../shared/Containers';
18
18
  import { MandatoryStyled } from './SalesChannels';
19
19
  var OperationStartDate = function (_a) {
20
20
  var _b;
@@ -1,12 +1,5 @@
1
1
  import * as React from 'react';
2
- import { BusinessType as BusinessTypeEnum } from '../../../../@types';
3
2
  export interface BusinessTypeProps {
4
- businessType: BusinessTypeEnum;
5
3
  }
6
- declare const _default: React.MemoExoticComponent<{
7
- ({ businessType }: BusinessTypeProps): JSX.Element;
8
- defaultProps: {
9
- businessType: BusinessTypeEnum;
10
- };
11
- }>;
4
+ declare const _default: React.MemoExoticComponent<({}: BusinessTypeProps) => JSX.Element>;
12
5
  export default _default;
@@ -11,24 +11,25 @@ var __assign = (this && this.__assign) || function () {
11
11
  };
12
12
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
13
  import * as React from 'react';
14
+ import { useSelector } from 'react-redux';
14
15
  import { useForm, FormProvider } from 'react-hook-form';
15
16
  import { useTranslation } from 'react-i18next';
16
17
  import { yupResolver } from '@hookform/resolvers/yup';
17
18
  import Box from '@mui/material/Box';
18
19
  import { styled } from '@mui/material/styles';
19
20
  import { useAppDispatch } from '../../../../hooks';
20
- import { handleNextScreenStep, handlePrevScreenStep } from '../../../../app/settings';
21
+ import { handlePrevScreenStep } from '../../../../app/settings';
21
22
  import Form from '../../../../components/Form';
22
23
  import Collapse from '../../../../components/Collapse';
23
24
  import { useLanguage } from '../../../../hooks';
24
25
  import ScreenContainer from '../../../shared/Containers/ScreenContainer';
26
+ import { businessSelector, clearError, updateLeadBusinessType } from '../../../app/business/businessStore';
27
+ import { BusinessType as BusinessTypeEnum } from '../../../../@types';
25
28
  import Button from '../../../shared/Button';
26
29
  import { CRValidationSchema, FLValidationSchema } from './validation';
27
30
  import SelectType from './SelectType';
28
- import { BusinessType as BusinessTypeEnum } from '../../../../@types';
29
31
  import FreelanceLicense from './FreelanceLicense';
30
32
  import CompanyLicense from './CompanyLicense';
31
- import { CR_LIST } from '../../../../constants/dummy';
32
33
  var InputsContainerStyled = styled(Box)(function (_a) {
33
34
  var _b;
34
35
  var theme = _a.theme, listActive = _a.listActive;
@@ -41,48 +42,45 @@ var InputsContainerStyled = styled(Box)(function (_a) {
41
42
  _b);
42
43
  });
43
44
  var BusinessType = function (_a) {
44
- var businessType = _a.businessType;
45
45
  var _b = React.useState(false), isCR = _b[0], setIsCR = _b[1];
46
+ var _c = useSelector(businessSelector), data = _c.data, loading = _c.loading, error = _c.error;
47
+ var businessTypeData = data.businessTypeData;
48
+ var t = useTranslation().t;
49
+ var isAr = useLanguage().isAr;
50
+ var dispatch = useAppDispatch();
51
+ var _d = React.useState(false), listActive = _d[0], setListActive = _d[1];
46
52
  var methods = useForm({
47
53
  resolver: yupResolver(isCR ? CRValidationSchema : FLValidationSchema),
48
- defaultValues: {
49
- businessType: businessType,
50
- flNumber: '',
51
- crNumber: ''
52
- },
54
+ defaultValues: data.businessTypeData,
53
55
  mode: 'onChange'
54
56
  });
55
57
  React.useEffect(function () {
58
+ var businessType = businessTypeData.businessType;
56
59
  if (businessType === BusinessTypeEnum.CR)
57
60
  setIsCR(true);
58
- }, [businessType]);
59
- var t = useTranslation().t;
60
- var isAr = useLanguage().isAr;
61
- var dispatch = useAppDispatch();
62
- var _c = React.useState(false), listActive = _c[0], setListActive = _c[1];
61
+ }, [businessTypeData.businessType]);
62
+ React.useEffect(function () {
63
+ if (error)
64
+ dispatch(clearError());
65
+ }, [methods.formState.isValid]);
63
66
  var onSubmit = function (data) {
64
- var dataValues = isCR
65
- ? { businessType: data.businessType, crNumber: data.crNumber }
66
- : { businessType: data.businessType, flNumber: data.flNumber };
67
- console.log('data', dataValues);
68
- dispatch(handleNextScreenStep());
67
+ var dataValues = { businessType: data.businessType, flNumber: data.flNumber, crNumber: '' };
68
+ if (isCR)
69
+ dataValues = { businessType: data.businessType, crNumber: data.crNumber, flNumber: '' };
70
+ dispatch(updateLeadBusinessType(dataValues));
69
71
  };
70
72
  var onBack = function () {
71
73
  dispatch(handlePrevScreenStep());
72
74
  };
73
- var flList = [];
74
- var crList = CR_LIST;
75
- return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(Form, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsxs(InputsContainerStyled, __assign({ listActive: listActive }, { children: [_jsx(SelectType, { show: !listActive, onSwitchToCR: function () { return setIsCR(true); }, onSwitchToFL: function () { return setIsCR(false); } }), _jsx(CompanyLicense, { show: isCR, list: crList, onListOpen: function () {
75
+ var disabled = !methods.formState.isValid || !!error;
76
+ return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(Form, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsxs(InputsContainerStyled, __assign({ listActive: listActive }, { children: [_jsx(SelectType, { show: !listActive, onSwitchToCR: function () { return setIsCR(true); }, onSwitchToFL: function () { return setIsCR(false); } }), _jsx(CompanyLicense, { show: isCR, list: data.crInfos, onListOpen: function () {
76
77
  setListActive(true);
77
78
  }, onListClose: function () {
78
79
  setListActive(false);
79
- } }), _jsx(FreelanceLicense, { show: !isCR, list: flList, onListOpen: function () {
80
+ } }), _jsx(FreelanceLicense, { show: !isCR, list: data.flInfos, onListOpen: function () {
80
81
  setListActive(true);
81
82
  }, onListClose: function () {
82
83
  setListActive(false);
83
- } })] })), _jsx(Collapse, __assign({ in: !listActive, timeout: 500 }, { children: _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, isAr: isAr, disabled: !methods.formState.isValid, loading: false }, { children: t('next') })) }))] })) })) }));
84
+ } })] })), _jsx(Collapse, __assign({ in: !listActive, timeout: 500 }, { children: _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, isAr: isAr, disabled: disabled, loading: loading, error: t(error || '') }, { children: t('next') })) }))] })) })) }));
84
85
  };
85
86
  export default React.memo(BusinessType);
86
- BusinessType.defaultProps = {
87
- businessType: BusinessTypeEnum.FL
88
- };
@@ -11,6 +11,7 @@ var __assign = (this && this.__assign) || function () {
11
11
  };
12
12
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
13
  import * as React from 'react';
14
+ import { useSelector } from 'react-redux';
14
15
  import { styled } from '@mui/material/styles';
15
16
  import { useAppDispatch, useLanguage } from '../../../../hooks';
16
17
  import { useTranslation } from 'react-i18next';
@@ -20,6 +21,8 @@ import Form from '../../../../components/Form';
20
21
  import Input from '../../../shared/Input';
21
22
  import Button from '../../../shared/Button';
22
23
  import { ScreenContainer } from '../../../shared/Containers';
24
+ import { businessSelector } from '../../../app/business/businessStore';
25
+ import { BusinessType as BusinessTypeEnum } from '../../../../@types';
23
26
  var InputStyled = styled(Input)(function (_a) {
24
27
  var theme = _a.theme;
25
28
  return ({
@@ -30,27 +33,23 @@ var FormStyled = styled(Form)(function () { return ({
30
33
  display: 'flex',
31
34
  flexDirection: 'column'
32
35
  }); });
33
- var defaultValues = {
34
- licenseNumber: 1234567890,
35
- brandName: 'Tap Payments',
36
- legalName: 'Ali Abulhasan'
37
- };
38
36
  var Confirm = function () {
39
37
  var dispatch = useAppDispatch();
40
- var businessType = React.useState('CR')[0];
41
38
  var t = useTranslation().t;
42
39
  var isAr = useLanguage().isAr;
43
- var isCR = businessType === 'CR';
40
+ var data = useSelector(businessSelector).data;
41
+ var _a = data.businessInfo, licenseNumber = _a.licenseNumber, brandName = _a.brandName, legalName = _a.legalName;
42
+ var isCR = data.businessTypeData.businessType === BusinessTypeEnum.CR;
44
43
  var onSubmit = function () {
45
44
  dispatch(handleNextScreenStep());
46
45
  };
47
46
  var methods = useForm({
48
- defaultValues: defaultValues,
47
+ defaultValues: data.businessInfo,
49
48
  mode: 'onChange'
50
49
  });
51
50
  var onBack = function () {
52
51
  dispatch(handlePrevScreenStep());
53
52
  };
54
- return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(InputStyled, { label: t(isCR ? 'signup_business_cr_info_title' : 'signup_business_fl_info_title'), value: defaultValues.licenseNumber, disabled: true }), _jsx(InputStyled, { label: t('signup_brand_name_label'), value: defaultValues.brandName, disabled: true }), _jsx(InputStyled, { label: t('signup_legal_name_label'), value: defaultValues.legalName, disabled: true }), _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, isAr: isAr }, { children: t('confirm') }))] })) })) }));
53
+ return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(InputStyled, { label: t(isCR ? 'signup_business_cr_info_title' : 'signup_business_fl_info_title'), value: licenseNumber, disabled: true }), _jsx(InputStyled, { label: t('signup_brand_name_label'), value: brandName, disabled: true }), _jsx(InputStyled, { label: t('signup_legal_name_label'), value: legalName, disabled: true }), _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, isAr: isAr }, { children: t('confirm') }))] })) })) }));
55
54
  };
56
55
  export default React.memo(Confirm);