@tap-payments/auth-jsconnect 1.0.10 → 1.0.14

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 (148) hide show
  1. package/build/@types/app.d.ts +5 -0
  2. package/build/assets/locales/ar.json +190 -72
  3. package/build/assets/locales/en.json +207 -75
  4. package/build/components/AnimationFlow/Dialog.js +12 -1
  5. package/build/components/DatePicker/DatePicker.d.ts +3 -1
  6. package/build/components/DatePicker/DatePicker.js +8 -5
  7. package/build/components/Loader/Loader.js +2 -2
  8. package/build/components/Radio/Radio.d.ts +5 -0
  9. package/build/components/Radio/Radio.js +31 -0
  10. package/build/components/Radio/index.d.ts +3 -0
  11. package/build/components/Radio/index.js +2 -0
  12. package/build/components/RadioGroup/RadioGroup.d.ts +5 -0
  13. package/build/components/RadioGroup/RadioGroup.js +41 -0
  14. package/build/components/RadioGroup/index.d.ts +3 -0
  15. package/build/components/RadioGroup/index.js +2 -0
  16. package/build/components/RadioLabel/RadioLabel.d.ts +7 -0
  17. package/build/components/RadioLabel/RadioLabel.js +34 -0
  18. package/build/components/RadioLabel/index.d.ts +3 -0
  19. package/build/components/RadioLabel/index.js +2 -0
  20. package/build/constants/app.js +19 -7
  21. package/build/constants/dummy.d.ts +5 -0
  22. package/build/constants/dummy.js +8 -0
  23. package/build/features/bank/Bank.js +1 -1
  24. package/build/features/bank/screens/BankDetails/BankName.js +1 -1
  25. package/build/features/bank/screens/BankDetails/Beneficiary.js +3 -3
  26. package/build/features/bank/screens/BankDetails/IBAN.js +3 -3
  27. package/build/features/bank/screens/BankDetails/validation.js +8 -3
  28. package/build/features/bank/screens/Success/Success.d.ts +5 -0
  29. package/build/features/bank/screens/Success/Success.js +14 -0
  30. package/build/features/bank/screens/Success/index.d.ts +3 -0
  31. package/build/features/bank/screens/Success/index.js +2 -0
  32. package/build/features/business/Business.js +1 -1
  33. package/build/features/business/screens/Activities/Activities.js +14 -40
  34. package/build/features/business/screens/Activities/ActivitiesList.js +1 -1
  35. package/build/features/business/screens/Activities/OperationStartDate.d.ts +6 -0
  36. package/build/features/business/screens/Activities/OperationStartDate.js +31 -0
  37. package/build/features/business/screens/Activities/SalesChannels.js +3 -10
  38. package/build/features/business/screens/Activities/validation.d.ts +3 -0
  39. package/build/features/business/screens/Activities/validation.js +3 -2
  40. package/build/features/business/screens/BusinessType/BusinessType.js +2 -2
  41. package/build/features/business/screens/BusinessType/CRNumber.js +1 -1
  42. package/build/features/business/screens/BusinessType/CompanyLicense.js +1 -1
  43. package/build/features/business/screens/BusinessType/FLNumber.js +1 -1
  44. package/build/features/business/screens/BusinessType/FreelanceLicense.js +1 -1
  45. package/build/features/business/screens/BusinessType/SelectType.js +1 -1
  46. package/build/features/business/screens/Confirm/Confirm.js +1 -1
  47. package/build/features/business/screens/Customers/CustomerLocations.js +1 -1
  48. package/build/features/business/screens/Customers/Customers.js +5 -41
  49. package/build/features/business/screens/Customers/ExpectedCustomers.js +4 -10
  50. package/build/features/business/screens/Customers/ExpectedSalesRange.js +5 -6
  51. package/build/features/business/screens/Customers/RefundPolicy.d.ts +0 -8
  52. package/build/features/business/screens/Customers/RefundPolicy.js +2 -10
  53. package/build/features/business/screens/Customers/TransactionPolicy.js +3 -2
  54. package/build/features/business/screens/Customers/validation.d.ts +6 -6
  55. package/build/features/business/screens/Customers/validation.js +10 -5
  56. package/build/features/business/screens/IDBOD/DOB.d.ts +2 -1
  57. package/build/features/business/screens/IDBOD/DOB.js +4 -1
  58. package/build/features/business/screens/IDBOD/ID.js +7 -48
  59. package/build/features/business/screens/IDBOD/IDBOD.js +9 -41
  60. package/build/features/business/screens/IDBOD/validation.js +6 -2
  61. package/build/features/business/screens/OTP/OTP.js +18 -58
  62. package/build/features/business/screens/OTP/OTPInput.js +8 -21
  63. package/build/features/business/screens/Success/Success.js +1 -2
  64. package/build/features/business/screens/VerifyNumber/OTPInput.d.ts +1 -2
  65. package/build/features/business/screens/VerifyNumber/OTPInput.js +12 -42
  66. package/build/features/business/screens/VerifyNumber/VerifyNumber.js +20 -66
  67. package/build/features/connect/Connect.js +1 -1
  68. package/build/features/connect/screens/Individual/Email.js +7 -1
  69. package/build/features/connect/screens/Individual/Individual.js +0 -28
  70. package/build/features/connect/screens/Individual/Name.js +9 -3
  71. package/build/features/connect/screens/Individual/validation.js +5 -2
  72. package/build/features/connect/screens/MID/BusinessCountry.js +4 -4
  73. package/build/features/connect/screens/MID/IDNumber.js +9 -6
  74. package/build/features/connect/screens/MID/MID.js +2 -2
  75. package/build/features/connect/screens/MID/MobileNumber.js +13 -15
  76. package/build/features/connect/screens/MID/validation.d.ts +1 -1
  77. package/build/features/connect/screens/MID/validation.js +11 -5
  78. package/build/features/connect/screens/Merchant/BrandName.js +5 -3
  79. package/build/features/connect/screens/Merchant/SocialMedia.js +6 -1
  80. package/build/features/connect/screens/Merchant/TAC.js +2 -2
  81. package/build/features/connect/screens/Merchant/validation.d.ts +9 -9
  82. package/build/features/connect/screens/Merchant/validation.js +42 -11
  83. package/build/features/connect/screens/OTP/OTP.js +4 -3
  84. package/build/features/connect/screens/OTP/OTPInput.js +1 -1
  85. package/build/features/connect/screens/OTP/validation.js +1 -1
  86. package/build/features/connect/screens/Password/PasswordInput.js +2 -1
  87. package/build/features/connect/screens/Password/validation.js +1 -1
  88. package/build/features/connect/screens/ThankYou/ThankYou.js +1 -2
  89. package/build/features/featuresScreens.d.ts +1 -1
  90. package/build/features/featuresScreens.js +32 -7
  91. package/build/features/owner/Owner.js +1 -1
  92. package/build/features/owner/screens/AdditionalOwnerInfo/AdditionalOwnerInfo.d.ts +8 -0
  93. package/build/features/owner/screens/AdditionalOwnerInfo/AdditionalOwnerInfo.js +77 -0
  94. package/build/features/owner/screens/AdditionalOwnerInfo/EmployerLocation.d.ts +10 -0
  95. package/build/features/owner/screens/AdditionalOwnerInfo/EmployerLocation.js +80 -0
  96. package/build/features/owner/screens/AdditionalOwnerInfo/EmployerName.d.ts +6 -0
  97. package/build/features/owner/screens/AdditionalOwnerInfo/EmployerName.js +40 -0
  98. package/build/features/owner/screens/AdditionalOwnerInfo/InfluencerSwitch.d.ts +6 -0
  99. package/build/features/owner/screens/AdditionalOwnerInfo/InfluencerSwitch.js +45 -0
  100. package/build/features/owner/screens/AdditionalOwnerInfo/MonthlyIncome.d.ts +6 -0
  101. package/build/features/owner/screens/AdditionalOwnerInfo/MonthlyIncome.js +35 -0
  102. package/build/features/owner/screens/AdditionalOwnerInfo/PEPSwitch.d.ts +6 -0
  103. package/build/features/owner/screens/AdditionalOwnerInfo/PEPSwitch.js +45 -0
  104. package/build/features/owner/screens/AdditionalOwnerInfo/SourceOfIncome.d.ts +9 -0
  105. package/build/features/owner/screens/AdditionalOwnerInfo/SourceOfIncome.js +85 -0
  106. package/build/features/owner/screens/AdditionalOwnerInfo/index.d.ts +3 -0
  107. package/build/features/owner/screens/AdditionalOwnerInfo/index.js +2 -0
  108. package/build/features/owner/screens/AdditionalOwnerInfo/validation.d.ts +25 -0
  109. package/build/features/owner/screens/AdditionalOwnerInfo/validation.js +35 -0
  110. package/build/features/owner/screens/ShowOwnerInfo/ShowOwnerInfo.js +2 -2
  111. package/build/features/owner/screens/Success/Success.d.ts +5 -0
  112. package/build/features/owner/screens/Success/Success.js +14 -0
  113. package/build/features/owner/screens/Success/index.d.ts +3 -0
  114. package/build/features/owner/screens/Success/index.js +2 -0
  115. package/build/features/password/Password.js +3 -3
  116. package/build/features/password/screens/CreatePassword/ConfirmPassword.js +2 -1
  117. package/build/features/password/screens/CreatePassword/Password.js +2 -1
  118. package/build/features/password/screens/CreatePassword/validation.js +3 -3
  119. package/build/features/password/screens/Success/Success.d.ts +5 -0
  120. package/build/features/password/screens/Success/Success.js +14 -0
  121. package/build/features/password/screens/Success/index.d.ts +3 -0
  122. package/build/features/password/screens/Success/index.js +2 -0
  123. package/build/features/shared/Button/Button.js +7 -1
  124. package/build/features/shared/ExpandIcon/ExpandIcon.js +1 -1
  125. package/build/features/shared/Input/Input.d.ts +0 -1
  126. package/build/features/shared/Input/Input.js +2 -5
  127. package/build/features/shared/Mandatory/Mandatory.d.ts +2 -0
  128. package/build/features/shared/Mandatory/Mandatory.js +20 -0
  129. package/build/features/shared/Mandatory/index.d.ts +2 -0
  130. package/build/features/shared/Mandatory/index.js +2 -0
  131. package/build/features/shared/OTP/OTP.js +2 -2
  132. package/build/features/shared/SuccessScreen/SuccessScreen.js +1 -1
  133. package/build/features/tax/screens/Success/Success.d.ts +5 -0
  134. package/build/features/tax/screens/Success/Success.js +14 -0
  135. package/build/features/tax/screens/Success/index.d.ts +3 -0
  136. package/build/features/tax/screens/Success/index.js +2 -0
  137. package/build/features/tax/screens/TaxDetails/VATId.js +3 -4
  138. package/build/features/tax/screens/TaxDetails/validation.js +1 -1
  139. package/build/index.css +105 -3
  140. package/build/theme/typography.js +2 -2
  141. package/build/utils/string.js +2 -2
  142. package/build/utils/validation.d.ts +2 -0
  143. package/build/utils/validation.js +6 -0
  144. package/package.json +1 -1
  145. package/build/features/business/screens/OTP/OTPTimer.d.ts +0 -5
  146. package/build/features/business/screens/OTP/OTPTimer.js +0 -20
  147. package/build/features/business/screens/VerifyNumber/OTPTimer.d.ts +0 -5
  148. package/build/features/business/screens/VerifyNumber/OTPTimer.js +0 -20
@@ -38,6 +38,7 @@ export declare const ActivitiesValidationSchema: yup.ObjectSchema<import("yup/li
38
38
  name: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
39
39
  nameEn: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
40
40
  }>>[] | undefined>;
41
+ operationStartDate: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
41
42
  }>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
42
43
  activities: yup.ArraySchema<yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
43
44
  id: yup.NumberSchema<number | undefined, import("yup/lib/types").AnyObject, number | undefined>;
@@ -77,6 +78,7 @@ export declare const ActivitiesValidationSchema: yup.ObjectSchema<import("yup/li
77
78
  name: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
78
79
  nameEn: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
79
80
  }>>[] | undefined>;
81
+ operationStartDate: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
80
82
  }>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
81
83
  activities: yup.ArraySchema<yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
82
84
  id: yup.NumberSchema<number | undefined, import("yup/lib/types").AnyObject, number | undefined>;
@@ -116,4 +118,5 @@ export declare const ActivitiesValidationSchema: yup.ObjectSchema<import("yup/li
116
118
  name: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
117
119
  nameEn: yup.StringSchema<string | undefined, import("yup/lib/types").AnyObject, string | undefined>;
118
120
  }>>[] | undefined>;
121
+ operationStartDate: import("yup/lib/string").RequiredStringSchema<string | undefined, import("yup/lib/types").AnyObject>;
119
122
  }>>>;
@@ -7,11 +7,12 @@ export var ActivitiesValidationSchema = yup.object().shape({
7
7
  })),
8
8
  salesChannels: yup
9
9
  .array()
10
- .min(1)
10
+ .min(1, 'choose_atleast_one_channel')
11
11
  .of(yup.object().shape({
12
12
  id: yup.number(),
13
13
  name: yup.string(),
14
14
  nameEn: yup.string()
15
15
  }))
16
- .required('Is required')
16
+ .required('choose_atleast_one_channel'),
17
+ operationStartDate: yup.string().required('choose_any_business_date')
17
18
  });
@@ -69,11 +69,11 @@ var BusinessType = function (_a) {
69
69
  };
70
70
  var flList = [];
71
71
  var crList = CR_LIST;
72
- 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(FreelanceLicense, { show: !isCR, list: flList, onListOpen: function () {
72
+ 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 () {
73
73
  setListActive(true);
74
74
  }, onListClose: function () {
75
75
  setListActive(false);
76
- } }), _jsx(CompanyLicense, { show: isCR, list: crList, onListOpen: function () {
76
+ } }), _jsx(FreelanceLicense, { show: !isCR, list: flList, onListOpen: function () {
77
77
  setListActive(true);
78
78
  }, onListClose: function () {
79
79
  setListActive(false);
@@ -35,6 +35,6 @@ var CRNumber = function (_a) {
35
35
  crNumberControl.field.onChange('');
36
36
  };
37
37
  var crNumberValue = crNumberControl.field.value;
38
- return (_jsx(Collapse, __assign({ in: show }, { children: _jsx(ScreenContainer, { children: _jsx(Input, { label: t('cr_number_label'), onChange: handleFLNumberChange, inputProps: { maxLength: CR_NUMBER_LENGTH }, value: crNumberValue, endAdornment: (crNumberValue === null || crNumberValue === void 0 ? void 0 : crNumberValue.length) === CR_NUMBER_LENGTH ? (_jsx(CheckIcon, {})) : (crNumberValue && _jsx(ClearIcon, { onClick: clearCRNumber })), placeholder: '0123456789', warningType: 'alert', warningMessage: (_b = crNumberControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message }) }) })));
38
+ return (_jsx(Collapse, __assign({ in: show }, { children: _jsx(ScreenContainer, { children: _jsx(Input, { label: t('enter_commercial_register_no'), onChange: handleFLNumberChange, inputProps: { maxLength: CR_NUMBER_LENGTH }, value: crNumberValue, endAdornment: (crNumberValue === null || crNumberValue === void 0 ? void 0 : crNumberValue.length) === CR_NUMBER_LENGTH ? (_jsx(CheckIcon, {})) : (crNumberValue && _jsx(ClearIcon, { onClick: clearCRNumber })), placeholder: '0123456789', warningType: 'alert', warningMessage: (_b = crNumberControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message }) }) })));
39
39
  };
40
40
  export default React.memo(CRNumber);
@@ -98,7 +98,7 @@ var CompanyLicense = function (_a) {
98
98
  };
99
99
  var hasList = (licenseList === null || licenseList === void 0 ? void 0 : licenseList.length) > 0;
100
100
  var showCRNumber = !anchorEl;
101
- return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, { children: [_jsxs(Collapse, __assign({ in: hasList }, { children: [_jsx(InputStyled, { label: t('business_country_placeholder'), readOnly: true, onClick: !!anchorEl ? function () { return onCloseLicenseList(); } : onOpenLicenseList, endAdornment: _jsx(ExpandIcon, { anchorEl: !!anchorEl }), placeholder: t('company_license_placeholder'), value: t(getLicenseName(selectedLicense)) }), _jsx(Collapse, __assign({ in: !!anchorEl, timeout: 300 }, { children: _jsx(SimpleList, { searchKeyPath: 'crNumber', list: licenseList, onSelectItem: onSelectItem, renderItem: function (item) {
101
+ return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, { children: [_jsxs(Collapse, __assign({ in: hasList }, { children: [_jsx(InputStyled, { label: t('enter_commercial_register_no'), readOnly: true, onClick: !!anchorEl ? function () { return onCloseLicenseList(); } : onOpenLicenseList, endAdornment: _jsx(ExpandIcon, { anchorEl: !!anchorEl }), placeholder: t('choose_license_cr'), value: t(getLicenseName(selectedLicense)) }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleList, { searchKeyPath: 'crNumber', list: licenseList, onSelectItem: onSelectItem, renderItem: function (item) {
102
102
  return (_jsxs(_Fragment, { children: [_jsx(LicenseContainer, { children: _jsx(LicenseNameText, __assign({ isSelected: getLicenseNumber(item) === getLicenseNumber(selectedLicense) }, { children: isOtherLicense(item)
103
103
  ? t(getLicenseNumber(item))
104
104
  : isAr
@@ -35,6 +35,6 @@ var FLNumber = function (_a) {
35
35
  flNumberControl.field.onChange('');
36
36
  };
37
37
  var flNumberValue = flNumberControl.field.value;
38
- return (_jsx(Collapse, __assign({ in: show }, { children: _jsx(ScreenContainer, { children: _jsx(Input, { label: t('fl_number_label'), onChange: handleFLNumberChange, inputProps: { maxLength: FL_NUMBER_LENGTH }, value: flNumberValue, endAdornment: (flNumberValue === null || flNumberValue === void 0 ? void 0 : flNumberValue.length) === FL_NUMBER_LENGTH ? (_jsx(CheckIcon, {})) : (flNumberValue && _jsx(ClearIcon, { onClick: clearFLNumber })), placeholder: '12345678', warningType: 'alert', warningMessage: (_b = flNumberControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message }) }) })));
38
+ return (_jsx(Collapse, __assign({ in: show }, { children: _jsx(ScreenContainer, { children: _jsx(Input, { label: t('enter_license_no'), onChange: handleFLNumberChange, inputProps: { maxLength: FL_NUMBER_LENGTH }, value: flNumberValue, endAdornment: (flNumberValue === null || flNumberValue === void 0 ? void 0 : flNumberValue.length) === FL_NUMBER_LENGTH ? (_jsx(CheckIcon, {})) : (flNumberValue && _jsx(ClearIcon, { onClick: clearFLNumber })), placeholder: '12345678', warningType: 'alert', warningMessage: (_b = flNumberControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message }) }) })));
39
39
  };
40
40
  export default React.memo(FLNumber);
@@ -101,7 +101,7 @@ var FreelanceLicense = function (_a) {
101
101
  };
102
102
  var hasList = (licenseList === null || licenseList === void 0 ? void 0 : licenseList.length) > 0;
103
103
  var showFLNumber = !anchorEl;
104
- return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, { children: [_jsxs(Collapse, __assign({ in: hasList }, { children: [_jsx(InputStyled, { label: t('freelance_license_label'), readOnly: true, onClick: !!anchorEl ? function () { return onCloseLicenseList(); } : onOpenLicenseList, endAdornment: _jsx(ExpandIcon, { anchorEl: !!anchorEl }), placeholder: t('freelance_license_placeholder'), value: t(getLicenseName(selectedLicense)) }), _jsx(Collapse, __assign({ in: !!anchorEl, timeout: 300 }, { children: _jsx(SimpleList, { searchKeyPath: 'license_specialities[0].speciality.name_en', list: licenseList, onSelectItem: onSelectItem, renderItem: function (item) {
104
+ return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, { children: [_jsxs(Collapse, __assign({ in: hasList }, { children: [_jsx(InputStyled, { label: t('enter_freelance_license'), readOnly: true, onClick: !!anchorEl ? function () { return onCloseLicenseList(); } : onOpenLicenseList, endAdornment: _jsx(ExpandIcon, { anchorEl: !!anchorEl }), placeholder: t('choose_license_fl'), value: t(getLicenseName(selectedLicense)) }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleList, { searchKeyPath: 'license_specialities[0].speciality.name_en', list: licenseList, onSelectItem: onSelectItem, renderItem: function (item) {
105
105
  return (_jsxs(_Fragment, { children: [_jsx(LicenseContainer, { children: _jsx(LicenseNameText, __assign({ isSelected: getLicenseNumber(item) === getLicenseNumber(selectedLicense) }, { children: isOtherLicense(item)
106
106
  ? t(getLicenseNumber(item))
107
107
  : isAr
@@ -101,6 +101,6 @@ var SelectType = function (_a) {
101
101
  var FLActive = type === BusinessType.FL;
102
102
  var CRActive = type === BusinessType.CR;
103
103
  var isAnyTypeActive = FLActive || CRActive;
104
- return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, { children: [_jsx(Collapse, __assign({ in: !isAnyTypeActive }, { children: _jsx(TitleStyled, { children: t('select_your_business_type') }) })), _jsxs(RadioGroupStyled, __assign({ "aria-labelledby": 'business-type', name: 'business-type' }, { children: [_jsx(BTypeSwitch, { value: BusinessType.FL, control: _jsx(RadioStyled, { color: 'primary', onClick: handleSwitchToFL }), label: _jsx(FLIconStyled, { src: FLActive ? ICONS_NAMES.FL_ACTIVE_ICON : ICONS_NAMES.FL_ICON }), active: FLActive }), _jsx(BTypeSwitch, { value: BusinessType.CR, control: _jsx(RadioStyled, { color: 'primary', onClick: handleSwitchToCR }), label: _jsx(CRIconStyled, { src: CRActive ? ICONS_NAMES.CR_ACTIVE_ICON : ICONS_NAMES.CR_ICON }), active: CRActive })] })), _jsx(Collapse, __assign({ in: !isAnyTypeActive }, { children: _jsxs(TextBoxStyled, { children: [_jsx(TextStyled, __assign({ onClick: handleSwitchToFL, active: FLActive }, { children: t('freelancer_reg') })), _jsx(TextStyled, __assign({ onClick: handleSwitchToCR, active: CRActive }, { children: t('commercial_reg') }))] }) }))] }) })));
104
+ return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, { children: [_jsx(Collapse, __assign({ in: !isAnyTypeActive }, { children: _jsx(TitleStyled, { children: t('signup_business_type_label') }) })), _jsxs(RadioGroupStyled, __assign({ "aria-labelledby": 'business-type', name: 'business-type' }, { children: [_jsx(BTypeSwitch, { value: BusinessType.FL, control: _jsx(RadioStyled, { color: 'primary', onClick: handleSwitchToFL }), label: _jsx(FLIconStyled, { src: FLActive ? ICONS_NAMES.FL_ACTIVE_ICON : ICONS_NAMES.FL_ICON }), active: FLActive }), _jsx(BTypeSwitch, { value: BusinessType.CR, control: _jsx(RadioStyled, { color: 'primary', onClick: handleSwitchToCR }), label: _jsx(CRIconStyled, { src: CRActive ? ICONS_NAMES.CR_ACTIVE_ICON : ICONS_NAMES.CR_ICON }), active: CRActive })] })), _jsx(Collapse, __assign({ in: !isAnyTypeActive }, { children: _jsxs(TextBoxStyled, { children: [_jsx(TextStyled, __assign({ onClick: handleSwitchToFL, active: FLActive }, { children: t('freelancer_reg') })), _jsx(TextStyled, __assign({ onClick: handleSwitchToCR, active: CRActive }, { children: t('commercial_reg') }))] }) }))] }) })));
105
105
  };
106
106
  export default React.memo(SelectType);
@@ -48,6 +48,6 @@ var Confirm = function () {
48
48
  defaultValues: defaultValues,
49
49
  mode: 'onChange'
50
50
  });
51
- return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(InputStyled, { label: t(isCR ? 'confirm_business_cr_label' : 'confirm_business_fl_label'), value: defaultValues.licenseNumber, disabled: true }), _jsx(InputStyled, { label: t('confirm_brand_name_label'), value: defaultValues.brandName, disabled: true }), _jsx(InputStyled, { label: t('confirm_legal_name_label'), value: defaultValues.legalName, disabled: true }), _jsx(Button, __assign({ isAr: isAr }, { children: t('confirm') }))] })) })) }));
51
+ 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({ isAr: isAr }, { children: t('confirm') }))] })) })) }));
52
52
  };
53
53
  export default React.memo(Confirm);
@@ -115,7 +115,7 @@ var customerLocations = function (_a) {
115
115
  };
116
116
  var customerLocationsValue = customerLocationsControl.field.value;
117
117
  var customerLocationSelected = customerLocationsValue[customerLocationsValue.length - 1];
118
- return (_jsxs(BoxStyled, { children: [_jsx(InputLabelStyled, { children: t('select_customer_locations') }), _jsx(InputStyled, { readOnly: true, value: isAr ? customerLocationSelected === null || customerLocationSelected === void 0 ? void 0 : customerLocationSelected.nameAR : customerLocationSelected === null || customerLocationSelected === void 0 ? void 0 : customerLocationSelected.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: customerLocationsList, onSelectItem: onSelectItem, renderItem: function (item) {
118
+ return (_jsxs(BoxStyled, { children: [_jsx(InputLabelStyled, { children: t('select_customer_base') }), _jsx(InputStyled, { readOnly: true, value: isAr ? customerLocationSelected === null || customerLocationSelected === void 0 ? void 0 : customerLocationSelected.nameAR : customerLocationSelected === null || customerLocationSelected === void 0 ? void 0 : customerLocationSelected.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: customerLocationsList, placeholder: 'choose_customer_base', onSelectItem: onSelectItem, renderItem: function (item) {
119
119
  return (_jsxs(_Fragment, { children: [_jsx(Box, __assign({ display: 'flex' }, { children: _jsx(NameContainer, __assign({ isSelected: (item === null || item === void 0 ? void 0 : item.id) === (customerLocationsValue === null || customerLocationsValue === void 0 ? void 0 : customerLocationsValue.id) }, { children: isAr ? item.nameAR : item.name })) })), item.id === (customerLocationSelected === null || customerLocationSelected === void 0 ? void 0 : customerLocationSelected.id) && _jsx(CheckIconStyled, {}), checkRemainingCondition(item) && item.id != (customerLocationSelected === null || customerLocationSelected === void 0 ? void 0 : customerLocationSelected.id) && _jsx(RemainingCheck, {})] }));
120
120
  } }) }))] }));
121
121
  };
@@ -10,20 +10,16 @@ var __assign = (this && this.__assign) || function () {
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
12
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
- import Box from '@mui/material/Box/Box';
14
13
  import { styled } from '@mui/material/styles';
15
14
  import * as React from 'react';
16
15
  import { useTranslation } from 'react-i18next';
17
16
  import { useForm, FormProvider } from 'react-hook-form';
18
17
  import { yupResolver } from '@hookform/resolvers/yup';
19
- import Icon from '../../../../components/Icon';
20
18
  import { useAppDispatch } from '../../../../hooks';
21
19
  import { handleNextScreenStep } from '../../../../app/settings';
22
20
  import { CustomerInfoValidation } from './validation';
23
21
  import Form from '../../../../components/Form';
24
- import Button from '../../../../components/Button';
25
- import { ICONS_NAMES } from '../../../../constants/assets';
26
- import Loader from '../../../../components/Loader';
22
+ import Button from '../../../shared/Button';
27
23
  import { useLanguage } from '../../../../hooks';
28
24
  import CustomerLocations from './CustomerLocations';
29
25
  import ExpectedCustomers from './ExpectedCustomers';
@@ -31,51 +27,19 @@ import ExpectedSales from './ExpectedSalesRange';
31
27
  import { CUSTOMER_LOCATIONS, EXPECTED_CUSTOMERS, EXPECTED_SALES_RANGE } from '../../../../constants';
32
28
  import RefundPolicy from './RefundPolicy';
33
29
  import TransactionPolicy from './TransactionPolicy';
34
- var BoxStyled = styled(Box)(function (_a) {
35
- var theme = _a.theme;
36
- return ({
37
- padding: theme.spacing(2.5, 0, 2.5, 0),
38
- overflow: 'hidden',
39
- direction: theme.direction
40
- });
41
- });
30
+ import { ScreenContainer } from '../../../shared/Containers';
42
31
  var FormStyled = styled(Form)(function () { return ({
43
32
  display: 'flex',
44
33
  flexDirection: 'column'
45
34
  }); });
46
- var ButtonContainer = styled(Box)(function (_a) {
47
- var theme = _a.theme;
48
- return ({
49
- margin: theme.spacing(2.5, 2.5, 0, 2.5)
50
- });
51
- });
52
- var IconStyled = styled(Icon, { shouldForwardProp: function (prop) { return prop !== 'isAr'; } })(function (_a) {
53
- var theme = _a.theme, isAr = _a.isAr;
54
- return ({
55
- width: theme.spacing(3),
56
- height: theme.spacing(3),
57
- paddingInlineStart: theme.spacing(1.5),
58
- paddingInlineEnd: theme.spacing(0.5),
59
- transform: isAr ? 'scaleX(-1)' : 'scaleX(1)'
60
- });
61
- });
62
- var LoaderStyled = styled(Loader)(function (_a) {
63
- var theme = _a.theme;
64
- return ({
65
- marginInlineStart: theme.spacing(-6.25),
66
- '& .loader-box-container': {
67
- marginInlineStart: theme.spacing(2.5)
68
- }
69
- });
70
- });
71
35
  var Customers = function (_a) {
72
36
  var dispatch = useAppDispatch();
73
37
  var methods = useForm({
74
38
  resolver: yupResolver(CustomerInfoValidation),
75
39
  defaultValues: {
76
40
  customerLocations: CUSTOMER_LOCATIONS,
77
- expectedCustomers: EXPECTED_CUSTOMERS,
78
- expectedSalesRange: EXPECTED_SALES_RANGE,
41
+ expectedCustomers: EXPECTED_CUSTOMERS[EXPECTED_CUSTOMERS.length - 1],
42
+ expectedSalesRange: EXPECTED_SALES_RANGE[EXPECTED_SALES_RANGE.length - 1],
79
43
  refundPolicy: false,
80
44
  transactionPolicy: false
81
45
  },
@@ -87,6 +51,6 @@ var Customers = function (_a) {
87
51
  };
88
52
  var t = useTranslation().t;
89
53
  var isAr = useLanguage().isAr;
90
- return (_jsx(BoxStyled, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(CustomerLocations, {}), _jsx(ExpectedCustomers, {}), _jsx(ExpectedSales, {}), _jsx(RefundPolicy, {}), _jsx(TransactionPolicy, {}), _jsx(ButtonContainer, { children: _jsx(Button, __assign({ disabled: !methods.formState.isValid, type: 'submit', startIcon: _jsx(LoaderStyled, { innerColor: 'white', outerColor: 'white', size: 30, toggleAnimation: false }), endIcon: _jsx(IconStyled, { isAr: isAr, src: ICONS_NAMES.WHITE_ARROW }) }, { children: t('next') })) })] })) })) }));
54
+ return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(CustomerLocations, {}), _jsx(ExpectedCustomers, {}), _jsx(ExpectedSales, {}), _jsx(RefundPolicy, {}), _jsx(TransactionPolicy, {}), _jsx(Button, __assign({ sx: { mt: 2 }, disabled: !methods.formState.isValid, isAr: isAr }, { children: t('next') }))] })) })) }));
91
55
  };
92
56
  export default React.memo(Customers);
@@ -30,7 +30,7 @@ import { useLanguage } from '../../../../hooks';
30
30
  import SimpleList from '../../../../components/SimpleList';
31
31
  import { EXPECTED_CUSTOMERS } from '../../../../constants';
32
32
  import Collapse from '../../../../components/Collapse';
33
- import { BoxStyled, CheckIconStyled, ExpandIcon, InputLabelStyled, InputStyled, NameContainer, RemainingCheck } from './CustomerLocations';
33
+ import { BoxStyled, CheckIconStyled, ExpandIcon, InputLabelStyled, InputStyled, NameContainer } from './CustomerLocations';
34
34
  var ListItemContainer = styled(Box)(function (_a) {
35
35
  var theme = _a.theme;
36
36
  return ({
@@ -59,20 +59,14 @@ var ExpectedCustomers = function (_a) {
59
59
  setAnchorEl(null);
60
60
  (_a = rest.onListClose) === null || _a === void 0 ? void 0 : _a.call(rest);
61
61
  };
62
- var checkRemainingCondition = function (item) {
63
- return !!expectedCustomersValue.find(function (expectedCustomer) {
64
- return expectedCustomer.id === item.id;
65
- });
66
- };
67
62
  var onSelectItem = function (expectedCustomers) {
68
63
  onCloseList();
69
- var remaining = expectedCustomersList.filter(function (customers) { return customers.id <= expectedCustomers.id; });
70
- expectedCustomersControl.field.onChange(remaining);
64
+ expectedCustomersControl.field.onChange(expectedCustomers);
71
65
  };
72
66
  var expectedCustomersValue = expectedCustomersControl.field.value;
73
- var expectedCustomersSelected = expectedCustomersValue[expectedCustomersValue.length - 1];
67
+ var expectedCustomersSelected = expectedCustomersValue;
74
68
  return (_jsxs(BoxStyled, { children: [_jsx(InputLabelStyled, { children: t('expected_customers_to_serve') }), _jsx(InputStyled, { readOnly: true, value: isAr ? expectedCustomersSelected === null || expectedCustomersSelected === void 0 ? void 0 : expectedCustomersSelected.nameAR : expectedCustomersSelected === null || expectedCustomersSelected === void 0 ? void 0 : expectedCustomersSelected.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: expectedCustomersList, onSelectItem: onSelectItem, renderItem: function (item) {
75
- return (_jsxs(_Fragment, { children: [_jsx(ListItemContainer, { children: _jsx(NameContainer, __assign({ isSelected: (item === null || item === void 0 ? void 0 : item.id) === (expectedCustomersValue === null || expectedCustomersValue === void 0 ? void 0 : expectedCustomersValue.id) }, { children: isAr ? item.nameAR : item.name })) }), item.id === (expectedCustomersSelected === null || expectedCustomersSelected === void 0 ? void 0 : expectedCustomersSelected.id) && _jsx(CheckIconStyled, {}), checkRemainingCondition(item) && item.id != (expectedCustomersSelected === null || expectedCustomersSelected === void 0 ? void 0 : expectedCustomersSelected.id) && _jsx(RemainingCheck, {})] }));
69
+ return (_jsxs(_Fragment, { children: [_jsx(ListItemContainer, { children: _jsx(NameContainer, __assign({ isSelected: (item === null || item === void 0 ? void 0 : item.id) === (expectedCustomersValue === null || expectedCustomersValue === void 0 ? void 0 : expectedCustomersValue.id) }, { children: isAr ? item.nameAR : item.name })) }), item.id === (expectedCustomersSelected === null || expectedCustomersSelected === void 0 ? void 0 : expectedCustomersSelected.id) && _jsx(CheckIconStyled, {})] }));
76
70
  } }) }))] }));
77
71
  };
78
72
  export default ExpectedCustomers;
@@ -30,7 +30,7 @@ import { useLanguage } from '../../../../hooks';
30
30
  import { EXPECTED_SALES_RANGE } from '../../../../constants';
31
31
  import SimpleList from '../../../../components/SimpleList';
32
32
  import Collapse from '../../../../components/Collapse';
33
- import { InputLabelStyled, BoxStyled, CheckIconStyled, ExpandIcon, RemainingCheck, InputStyled, NameContainer } from './CustomerLocations';
33
+ import { InputLabelStyled, BoxStyled, CheckIconStyled, ExpandIcon, InputStyled, NameContainer } from './CustomerLocations';
34
34
  var ListItemContainer = styled(Box)(function () { return ({
35
35
  display: 'flex'
36
36
  }); });
@@ -62,13 +62,12 @@ var ExpectedSalesRange = function (_a) {
62
62
  };
63
63
  var onSelectItem = function (expectedSalesRange) {
64
64
  onCloseList();
65
- var remaining = expectedSalesRangeList.filter(function (saleRange) { return saleRange.id <= expectedSalesRange.id; });
66
- expectedSalesRangeControl.field.onChange(remaining);
65
+ expectedSalesRangeControl.field.onChange(expectedSalesRange);
67
66
  };
68
67
  var expectedSalesRangeValue = expectedSalesRangeControl.field.value || expectedSalesRangeList;
69
- var expectedSalesRangeSelected = expectedSalesRangeValue[expectedSalesRangeValue.length - 1];
70
- return (_jsxs(BoxStyled, { children: [_jsx(InputLabelStyled, { children: t('expected_sales_range') }), _jsx(InputStyled, { readOnly: true, value: isAr ? expectedSalesRangeSelected === null || expectedSalesRangeSelected === void 0 ? void 0 : expectedSalesRangeSelected.nameAR : expectedSalesRangeSelected === null || expectedSalesRangeSelected === void 0 ? void 0 : expectedSalesRangeSelected.name, onClick: !!anchorEl ? function () { return onCloseList(); } : onOpenList, endAdornment: _jsx(ExpandIcon, { anchorEl: anchorEl }) }), _jsx(Collapse, __assign({ in: !!anchorEl, timeout: 100 }, { children: _jsx(SimpleListStyled, { searchKeyPath: 'name', list: expectedSalesRangeList, onSelectItem: onSelectItem, renderItem: function (item) {
71
- return (_jsxs(_Fragment, { children: [_jsx(ListItemContainer, { children: _jsx(NameContainer, __assign({ isSelected: (item === null || item === void 0 ? void 0 : item.id) === (expectedSalesRangeValue === null || expectedSalesRangeValue === void 0 ? void 0 : expectedSalesRangeValue.id) }, { children: isAr ? item.nameAR : item.name })) }), item.id === (expectedSalesRangeSelected === null || expectedSalesRangeSelected === void 0 ? void 0 : expectedSalesRangeSelected.id) && _jsx(CheckIconStyled, {}), checkRemainingCondition(item) && item.id != (expectedSalesRangeSelected === null || expectedSalesRangeSelected === void 0 ? void 0 : expectedSalesRangeSelected.id) && _jsx(RemainingCheck, {})] }));
68
+ var expectedSalesRangeSelected = expectedSalesRangeValue;
69
+ return (_jsxs(BoxStyled, { children: [_jsx(InputLabelStyled, { children: t('expected_sales_yearly') }), _jsx(InputStyled, { readOnly: true, value: isAr ? expectedSalesRangeSelected === null || expectedSalesRangeSelected === void 0 ? void 0 : expectedSalesRangeSelected.nameAR : expectedSalesRangeSelected === null || expectedSalesRangeSelected === void 0 ? void 0 : expectedSalesRangeSelected.name, onClick: !!anchorEl ? function () { return onCloseList(); } : onOpenList, placeholder: t('choose_expected_sales'), endAdornment: _jsx(ExpandIcon, { anchorEl: anchorEl }) }), _jsx(Collapse, __assign({ in: !!anchorEl, timeout: 300 }, { children: _jsx(SimpleListStyled, { searchKeyPath: 'name', list: expectedSalesRangeList, onSelectItem: onSelectItem, renderItem: function (item) {
70
+ return (_jsxs(_Fragment, { children: [_jsx(ListItemContainer, { children: _jsx(NameContainer, __assign({ isSelected: (item === null || item === void 0 ? void 0 : item.id) === (expectedSalesRangeValue === null || expectedSalesRangeValue === void 0 ? void 0 : expectedSalesRangeValue.id) }, { children: isAr ? item.nameAR : item.name })) }), item.id === (expectedSalesRangeSelected === null || expectedSalesRangeSelected === void 0 ? void 0 : expectedSalesRangeSelected.id) && _jsx(CheckIconStyled, {})] }));
72
71
  } }) }))] }));
73
72
  };
74
73
  export default ExpectedSalesRange;
@@ -1,12 +1,4 @@
1
1
  import * as React from 'react';
2
- export declare const BoxStyled: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material/styles").Theme> & {
3
- children?: React.ReactNode;
4
- component?: React.ElementType<any> | undefined;
5
- ref?: React.Ref<unknown> | undefined;
6
- sx?: import("@mui/material/styles").SxProps<import("@mui/material/styles").Theme> | undefined;
7
- } & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
8
- ref?: ((instance: HTMLDivElement | null) => void) | React.RefObject<HTMLDivElement> | null | undefined;
9
- }, keyof import("@mui/material/OverridableComponent").CommonProps | ("border" | "borderTop" | "borderRight" | "borderBottom" | "borderLeft" | "borderColor" | "borderRadius" | "display" | "displayPrint" | "overflow" | "textOverflow" | "visibility" | "whiteSpace" | "flexBasis" | "flexDirection" | "flexWrap" | "justifyContent" | "alignItems" | "alignContent" | "order" | "flex" | "flexGrow" | "flexShrink" | "alignSelf" | "justifyItems" | "justifySelf" | "gap" | "columnGap" | "rowGap" | "gridColumn" | "gridRow" | "gridAutoFlow" | "gridAutoColumns" | "gridAutoRows" | "gridTemplateColumns" | "gridTemplateRows" | "gridTemplateAreas" | "gridArea" | "bgcolor" | "color" | "zIndex" | "position" | "top" | "right" | "bottom" | "left" | "boxShadow" | "width" | "maxWidth" | "minWidth" | "height" | "maxHeight" | "minHeight" | "boxSizing" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "my" | "p" | "pt" | "pr" | "pb" | "pl" | "px" | "py" | "margin" | "marginTop" | "marginRight" | "marginBottom" | "marginLeft" | "marginX" | "marginY" | "padding" | "paddingTop" | "paddingRight" | "paddingBottom" | "paddingLeft" | "paddingX" | "paddingY" | "typography" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "lineHeight" | "textAlign" | "textTransform") | "ref" | "children" | "component" | "sx"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
10
2
  export declare const ContainerStyled: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material/styles").Theme> & {
11
3
  children?: React.ReactNode;
12
4
  component?: React.ElementType<any> | undefined;
@@ -21,15 +21,7 @@ import Text from '../../../../components/Text';
21
21
  import Link from '@mui/material/Link';
22
22
  import Warning from '../../../../components/Warning';
23
23
  import { EXTERNAL_LINKS } from '../../../../constants';
24
- export var BoxStyled = styled(Box)(function (_a) {
25
- var theme = _a.theme;
26
- return ({
27
- direction: theme.direction,
28
- display: 'flex',
29
- flexDirection: 'column',
30
- marginBlockStart: theme.spacing(2.75)
31
- });
32
- });
24
+ import { ScreenContainer } from '../../../shared/Containers';
33
25
  export var ContainerStyled = styled(Box)(function (_a) {
34
26
  var theme = _a.theme;
35
27
  return ({
@@ -81,6 +73,6 @@ var RefundPolicy = function () {
81
73
  var handleRefundCheckedChange = function (event, checked) {
82
74
  refundControl.field.onChange(checked);
83
75
  };
84
- return (_jsxs(BoxStyled, { children: [_jsxs(ContainerStyled, { children: [_jsx(CheckboxStyled, { disableRipple: true, disableFocusRipple: true, focusRipple: false, checked: refundChecked, onChange: handleRefundCheckedChange }), _jsxs(TextStyled, { children: [t('agree_on_refund_policy'), _jsx(LinkStyled, __assign({ href: isAr ? EXTERNAL_LINKS.REFUND_AR : EXTERNAL_LINKS.REFUND_EN, target: '_blank', underline: 'always' }, { children: t('refund_policy_compliance') }))] })] }), _jsx(CollapseStyled, __assign({ in: !!warningMessage }, { children: _jsx(Warning, __assign({ warningType: 'alert' }, { children: warningMessage })) }))] }));
76
+ return (_jsxs(ScreenContainer, __assign({ sx: { mt: 2.75 } }, { children: [_jsxs(ContainerStyled, { children: [_jsx(CheckboxStyled, { disableRipple: true, disableFocusRipple: true, focusRipple: false, checked: refundChecked, onChange: handleRefundCheckedChange }), _jsxs(TextStyled, { children: [t('agree_on_refund_policy'), _jsx(LinkStyled, __assign({ href: isAr ? EXTERNAL_LINKS.REFUND_AR : EXTERNAL_LINKS.REFUND_EN, target: '_blank', underline: 'always' }, { children: t('refund_policy_compliance') }))] })] }), _jsx(CollapseStyled, __assign({ in: !!warningMessage }, { children: _jsx(Warning, __assign({ warningType: 'alert' }, { children: warningMessage && t(warningMessage) })) }))] })));
85
77
  };
86
78
  export default RefundPolicy;
@@ -17,7 +17,8 @@ import { useLanguage } from '../../../../hooks';
17
17
  import { useController, useFormContext } from 'react-hook-form';
18
18
  import Warning from '../../../../components/Warning';
19
19
  import { EXTERNAL_LINKS } from '../../../../constants';
20
- import { BoxStyled, ContainerStyled, CheckboxStyled, TextStyled, LinkStyled } from './RefundPolicy';
20
+ import { ContainerStyled, CheckboxStyled, TextStyled, LinkStyled } from './RefundPolicy';
21
+ import { ScreenContainer } from '../../../shared/Containers';
21
22
  var CollapseStyled = styled(Collapse)(function () { return ({
22
23
  width: '100%'
23
24
  }); });
@@ -32,6 +33,6 @@ var TransactionPolicy = function () {
32
33
  var handleTransactionCheckedChange = function (event, checked) {
33
34
  transactionControl.field.onChange(checked);
34
35
  };
35
- return (_jsxs(BoxStyled, { children: [_jsxs(ContainerStyled, { children: [_jsx(CheckboxStyled, { disableRipple: true, disableFocusRipple: true, focusRipple: false, checked: transactionChecked, onChange: handleTransactionCheckedChange }), _jsxs(TextStyled, { children: [t('agree_on_transaction_policy'), _jsx(LinkStyled, __assign({ href: isAr ? EXTERNAL_LINKS.TRANSACTION_AR : EXTERNAL_LINKS.TRANSACTION_EN, target: '_blank', underline: 'always' }, { children: t('transaction_policy') }))] })] }), _jsx(CollapseStyled, __assign({ in: !!warningMessage }, { children: _jsx(Warning, __assign({ warningType: 'alert' }, { children: warningMessage })) }))] }));
36
+ return (_jsxs(ScreenContainer, { children: [_jsxs(ContainerStyled, { children: [_jsx(CheckboxStyled, { disableRipple: true, disableFocusRipple: true, focusRipple: false, checked: transactionChecked, onChange: handleTransactionCheckedChange }), _jsxs(TextStyled, { children: [t('agree_on_chargeback_policy'), _jsx(LinkStyled, __assign({ href: isAr ? EXTERNAL_LINKS.TRANSACTION_AR : EXTERNAL_LINKS.TRANSACTION_EN, target: '_blank', underline: 'always' }, { children: t('chargeback_policy') }))] })] }), _jsx(CollapseStyled, __assign({ in: !!warningMessage }, { children: _jsx(Warning, __assign({ warningType: 'alert' }, { children: warningMessage && t(warningMessage) })) }))] }));
36
37
  };
37
38
  export default TransactionPolicy;
@@ -1,20 +1,20 @@
1
1
  import * as yup from 'yup';
2
2
  export declare const CustomerInfoValidation: yup.ObjectSchema<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
3
3
  customerLocations: import("yup/lib/array").RequiredArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined>;
4
- expectedCustomers: import("yup/lib/array").RequiredArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined>;
5
- expectedSalesRange: import("yup/lib/array").RequiredArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined>;
4
+ expectedCustomers: any;
5
+ expectedSalesRange: any;
6
6
  refundPolicy: yup.BooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject, true>;
7
7
  transactionPolicy: yup.BooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject, true>;
8
8
  }>, import("yup/lib/object").AnyObject, import("yup/lib/object").TypeOfShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
9
9
  customerLocations: import("yup/lib/array").RequiredArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined>;
10
- expectedCustomers: import("yup/lib/array").RequiredArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined>;
11
- expectedSalesRange: import("yup/lib/array").RequiredArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined>;
10
+ expectedCustomers: any;
11
+ expectedSalesRange: any;
12
12
  refundPolicy: yup.BooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject, true>;
13
13
  transactionPolicy: yup.BooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject, true>;
14
14
  }>>, import("yup/lib/object").AssertsShape<import("yup/lib/object").Assign<import("yup/lib/object").ObjectShape, {
15
15
  customerLocations: import("yup/lib/array").RequiredArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined>;
16
- expectedCustomers: import("yup/lib/array").RequiredArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined>;
17
- expectedSalesRange: import("yup/lib/array").RequiredArraySchema<yup.AnySchema<any, any, any>, import("yup/lib/types").AnyObject, any[] | undefined>;
16
+ expectedCustomers: any;
17
+ expectedSalesRange: any;
18
18
  refundPolicy: yup.BooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject, true>;
19
19
  transactionPolicy: yup.BooleanSchema<boolean | undefined, import("yup/lib/types").AnyObject, true>;
20
20
  }>>>;
@@ -1,8 +1,13 @@
1
1
  import * as yup from 'yup';
2
+ var objectElements = {
3
+ id: yup.number(),
4
+ name: yup.string(),
5
+ nameAR: yup.string()
6
+ };
2
7
  export var CustomerInfoValidation = yup.object().shape({
3
- customerLocations: yup.array().required(''),
4
- expectedCustomers: yup.array().required(''),
5
- expectedSalesRange: yup.array().required(''),
6
- refundPolicy: yup.boolean().required().isTrue('Please accept the refund policy'),
7
- transactionPolicy: yup.boolean().required().isTrue('Please accept the transaction policy')
8
+ customerLocations: yup.array().required('please_choose_base'),
9
+ expectedCustomers: yup.object().shape(objectElements).required(''),
10
+ expectedSalesRange: yup.object().shape(objectElements).required('select_expected_sales'),
11
+ refundPolicy: yup.boolean().required().isTrue('refund_policy_error'),
12
+ transactionPolicy: yup.boolean().required().isTrue('transaction_policy_error')
8
13
  });
@@ -1,5 +1,6 @@
1
1
  import * as React from 'react';
2
2
  interface BODProps {
3
+ onDateClicked?: (flag: boolean) => void;
3
4
  }
4
- declare const _default: React.MemoExoticComponent<({}: BODProps) => JSX.Element>;
5
+ declare const _default: React.MemoExoticComponent<({ onDateClicked }: BODProps) => JSX.Element>;
5
6
  export default _default;
@@ -30,15 +30,18 @@ var InputLabelStyled = styled(Text)(function (_a) {
30
30
  return (__assign(__assign({ color: alpha(theme.palette.text.primary, 0.4) }, theme.typography.caption), { cursor: 'pointer' }));
31
31
  });
32
32
  var BOD = function (_a) {
33
+ var _b;
34
+ var onDateClicked = _a.onDateClicked;
33
35
  var t = useTranslation().t;
34
36
  var control = useFormContext().control;
35
37
  var dobControl = useController({ control: control, name: 'dob' });
36
38
  var handleBirthDateChange = function (data) {
37
39
  dobControl.field.onChange(data);
38
40
  };
41
+ var dateValue = (_b = dobControl === null || dobControl === void 0 ? void 0 : dobControl.field) === null || _b === void 0 ? void 0 : _b.value;
39
42
  return (_jsxs(BoxStyled, { children: [_jsx(InputLabelStyled, __assign({ sx: { p: function (_a) {
40
43
  var spacing = _a.spacing;
41
44
  return spacing(2.5, 2.5, 1.5, 2.5);
42
- } } }, { children: t('date_of_birth') })), _jsx(DatePicker, { defaultValue: new Date('2000-01-01'), readOnly: true, locale: 'en', onDateChange: handleBirthDateChange })] }));
45
+ } } }, { children: t('date_of_birth') })), _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: handleBirthDateChange })] }));
43
46
  };
44
47
  export default React.memo(BOD);
@@ -1,52 +1,13 @@
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";
1
+ import { jsx as _jsx } from "react/jsx-runtime";
13
2
  import * as React from 'react';
14
- import Box from '@mui/material/Box';
15
3
  import { useTranslation } from 'react-i18next';
16
4
  import { useController, useFormContext } from 'react-hook-form';
17
- import { styled, alpha } from '@mui/material/styles';
18
- import Text from '../../../../components/Text';
19
- import Input from '../../../../components/Input';
20
- import ClearIcon from '@mui/icons-material/Clear';
5
+ import { ScreenContainer } from '../../../shared/Containers';
6
+ import Input from '../../../shared/Input';
7
+ import ClearIcon from '../../../shared/ClearIcon';
8
+ import CheckIcon from '../../../shared/CheckIcon';
21
9
  import { removeAllCharsFromNumber } from '../../../../utils';
22
10
  import { ID_NUMBER_LENGTH } from '../../../../constants';
23
- var BoxStyled = styled(Box)(function (_a) {
24
- var theme = _a.theme;
25
- return ({
26
- display: 'flex',
27
- flexDirection: 'column',
28
- direction: theme.direction
29
- });
30
- });
31
- var InputLabelStyled = styled(Text)(function (_a) {
32
- var theme = _a.theme;
33
- return (__assign({ color: alpha(theme.palette.text.primary, 0.4) }, theme.typography.caption));
34
- });
35
- var InputStyled = styled(Input)(function (_a) {
36
- var theme = _a.theme;
37
- return ({
38
- padding: theme.spacing(0, 2, 0, 0)
39
- });
40
- });
41
- var ClearIconStyled = styled(ClearIcon)(function (_a) {
42
- var theme = _a.theme;
43
- return ({
44
- width: theme.spacing(2),
45
- height: theme.spacing(2),
46
- cursor: 'pointer',
47
- color: alpha(theme.palette.text.primary, 0.4)
48
- });
49
- });
50
11
  var IDNumber = function (_a) {
51
12
  var _b;
52
13
  var t = useTranslation().t;
@@ -61,9 +22,7 @@ var IDNumber = function (_a) {
61
22
  nidControl.field.onChange('');
62
23
  };
63
24
  var nidValue = nidControl.field.value;
64
- return (_jsxs(BoxStyled, { children: [_jsx(InputLabelStyled, __assign({ sx: { p: function (_a) {
65
- var spacing = _a.spacing;
66
- return spacing(2.5, 2.5, 1.5, 2.5);
67
- } } }, { children: t('id_number_label') })), _jsx(InputStyled, { inputProps: { maxLength: ID_NUMBER_LENGTH }, onChange: handleIdChange, value: nidValue, endAdornment: nidValue && _jsx(ClearIconStyled, { onClick: clearIdNumber }), placeholder: '0000000000', warningType: 'alert', warningMessage: (_b = nidControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message })] }));
25
+ var error = (_b = nidControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
26
+ return (_jsx(ScreenContainer, { children: _jsx(Input, { label: t('enter_national_id'), inputProps: { maxLength: ID_NUMBER_LENGTH }, onChange: handleIdChange, value: nidValue, endAdornment: !error && nidValue ? _jsx(CheckIcon, {}) : nidValue && _jsx(ClearIcon, { onClick: clearIdNumber }), placeholder: '0000000000', warningType: 'alert', warningMessage: error && t(error, { number: '1' }) }) }));
68
27
  };
69
28
  export default React.memo(IDNumber);
@@ -11,7 +11,6 @@ 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 Box from '@mui/material/Box';
15
14
  import { useTranslation } from 'react-i18next';
16
15
  import { styled } from '@mui/material/styles';
17
16
  import ID from './ID';
@@ -19,52 +18,18 @@ import DOB from './DOB';
19
18
  import { useForm, FormProvider } from 'react-hook-form';
20
19
  import { yupResolver } from '@hookform/resolvers/yup';
21
20
  import { NIDValidationSchema } from './validation';
22
- import Loader from '../../../../components/Loader';
23
- import { ICONS_NAMES } from '../../../../constants';
24
- import Button from '../../../../components/Button';
25
21
  import { useAppDispatch, useLanguage } from '../../../../hooks';
26
22
  import { handleNextScreenStep } from '../../../../app/settings';
27
- import Icon from '../../../../components/Icon';
28
23
  import Form from '../../../../components/Form';
29
- var BoxStyled = styled(Box)(function (_a) {
30
- var theme = _a.theme;
31
- return ({
32
- direction: theme.direction,
33
- display: 'flex',
34
- flexDirection: 'column',
35
- overflow: 'hidden'
36
- });
37
- });
38
- var IconStyled = styled(Icon, { shouldForwardProp: function (prop) { return prop !== 'isAr'; } })(function (_a) {
39
- var theme = _a.theme, isAr = _a.isAr;
40
- return ({
41
- width: theme.spacing(3),
42
- height: theme.spacing(3),
43
- paddingInlineStart: theme.spacing(1.5),
44
- paddingInlineEnd: theme.spacing(0.5),
45
- transform: isAr ? 'scaleX(-1)' : 'scaleX(1)'
46
- });
47
- });
48
- var ButtonContainer = styled(Box)(function (_a) {
49
- var theme = _a.theme;
50
- return ({
51
- margin: theme.spacing(5, 2.5, 2.5, 2.5)
52
- });
53
- });
54
- var LoaderStyled = styled(Loader)(function (_a) {
55
- var theme = _a.theme;
56
- return ({
57
- marginInlineStart: theme.spacing(-6.25),
58
- '& .loader-box-container': {
59
- marginInlineStart: theme.spacing(2.5)
60
- }
61
- });
62
- });
24
+ import Button from '../../../shared/Button';
25
+ import { ScreenContainer } from '../../../shared/Containers';
26
+ import Collapse from '../../../../components/Collapse';
63
27
  var FormStyled = styled(Form)(function () { return ({
64
28
  display: 'flex',
65
29
  flexDirection: 'column'
66
30
  }); });
67
31
  var IDBOD = function (_a) {
32
+ var _b = React.useState(false), collapse = _b[0], setCollapse = _b[1];
68
33
  var isAr = useLanguage().isAr;
69
34
  var dispatch = useAppDispatch();
70
35
  var t = useTranslation().t;
@@ -72,7 +37,7 @@ var IDBOD = function (_a) {
72
37
  resolver: yupResolver(NIDValidationSchema),
73
38
  defaultValues: {
74
39
  nid: '',
75
- dob: ''
40
+ dob: '1998-08-22'
76
41
  },
77
42
  mode: 'onChange'
78
43
  });
@@ -80,6 +45,9 @@ var IDBOD = function (_a) {
80
45
  console.log('data', data);
81
46
  dispatch(handleNextScreenStep());
82
47
  };
83
- return (_jsx(BoxStyled, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(ID, {}), _jsx(DOB, {}), _jsx(ButtonContainer, { children: _jsx(Button, __assign({ disabled: !methods.formState.isValid, type: 'submit', startIcon: _jsx(LoaderStyled, { innerColor: 'white', outerColor: 'white', size: 30 }), endIcon: _jsx(IconStyled, { isAr: isAr, src: ICONS_NAMES.WHITE_ARROW }) }, { children: t('next') })) })] })) })) }));
48
+ var handleCollapseOpenClose = function (flag) {
49
+ setCollapse(flag);
50
+ };
51
+ return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(Collapse, __assign({ in: !collapse }, { children: _jsx(ID, {}) })), _jsx(DOB, { onDateClicked: handleCollapseOpenClose }), _jsx(Collapse, __assign({ in: !collapse }, { children: _jsx(Button, __assign({ sx: { mt: 6 }, isAr: isAr, disabled: !methods.formState.isValid }, { children: t('next') })) }))] })) })) }));
84
52
  };
85
53
  export default React.memo(IDBOD);
@@ -1,5 +1,9 @@
1
1
  import * as yup from 'yup';
2
2
  export var NIDValidationSchema = yup.object().shape({
3
- dob: yup.string().min(5).required('DOB is required'),
4
- nid: yup.string().min(8).max(10).required('NID is required')
3
+ dob: yup.string().min(5).required('enter_valid_birth_date'),
4
+ nid: yup
5
+ .string()
6
+ .min(8, 'signup_invalid_national_id_format')
7
+ .max(10, 'signup_invalid_national_id_format')
8
+ .required('signup_invalid_national_id')
5
9
  });