@tap-payments/auth-jsconnect 2.3.40-test → 2.3.46-test
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/@types/form.d.ts +0 -3
- package/build/api/entity.d.ts +0 -1
- package/build/api/index.d.ts +0 -3
- package/build/api/index.js +1 -3
- package/build/assets/locales/ar.json +0 -1
- package/build/assets/locales/en.json +0 -1
- package/build/components/DatePicker/DatePicker.js +1 -0
- package/build/components/RadioGroup/RadioGroup.d.ts +5 -2
- package/build/components/RadioGroup/RadioGroup.js +5 -9
- package/build/components/RadioGroup/index.d.ts +1 -1
- package/build/constants/app.js +4 -10
- package/build/features/app/bank/bankStore.d.ts +0 -1
- package/build/features/app/bank/bankStore.js +21 -37
- package/build/features/app/connectExpress/connectExpressStore.js +12 -8
- package/build/features/app/entity/entityStore.d.ts +1 -9
- package/build/features/app/entity/entityStore.js +48 -119
- package/build/features/app/individual/individualStore.d.ts +0 -2
- package/build/features/app/individual/individualStore.js +71 -91
- package/build/features/app/tax/taxStore.js +18 -36
- package/build/features/bank/screens/BankDetails/ConfirmPolicy.js +6 -10
- package/build/features/bank/screens/Verify/OTPInput.js +5 -3
- package/build/features/brand/screens/BrandActivities/ActivitiesList.d.ts +0 -5
- package/build/features/brand/screens/BrandActivities/ActivitiesList.js +5 -5
- package/build/features/brand/screens/BrandActivities/CustomerBase.d.ts +0 -5
- package/build/features/brand/screens/BrandActivities/CustomerBase.js +5 -5
- package/build/features/brand/screens/BrandActivities/ExpectedCustomers.js +13 -3
- package/build/features/brand/screens/BrandActivities/ExpectedSalesRange.js +12 -2
- package/build/features/brand/screens/BrandActivities/RefundPolicy.d.ts +5 -1
- package/build/features/brand/screens/BrandActivities/RefundPolicy.js +6 -9
- package/build/features/brand/screens/BrandActivities/TAC.d.ts +12 -0
- package/build/features/brand/screens/BrandActivities/TAC.js +6 -9
- package/build/features/brand/screens/BrandActivities/TransactionPolicy.js +1 -1
- package/build/features/brand/screens/BrandInfo/BrandInfo.js +2 -2
- package/build/features/brand/screens/BrandInfo/Segments.js +9 -1
- package/build/features/brand/screens/BrandInfo/TeamSize.js +9 -1
- package/build/features/brand/screens/Verify/OTPInput.js +5 -3
- package/build/features/business/screens/Activities/ActivitiesList.d.ts +0 -5
- package/build/features/business/screens/Activities/ActivitiesList.js +5 -5
- package/build/features/business/screens/Activities/OperationStartDate.js +1 -1
- package/build/features/business/screens/BusinessType/LicenseList.js +1 -1
- package/build/features/business/screens/Customers/CustomerLocations.d.ts +0 -5
- package/build/features/business/screens/Customers/CustomerLocations.js +5 -5
- package/build/features/business/screens/Customers/ExpectedCustomers.js +12 -2
- package/build/features/business/screens/Customers/ExpectedSalesRange.js +12 -2
- package/build/features/business/screens/IDBOD/DOB.js +1 -1
- package/build/features/business/screens/Verify/OTPInput.js +5 -3
- package/build/features/connect/screens/Merchant/BrandList.js +1 -1
- package/build/features/connect/screens/Merchant/Segments.js +6 -1
- package/build/features/connect/screens/Merchant/TeamSize.js +6 -1
- package/build/features/connectExpress/screens/Brand/Brand.js +1 -1
- package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseList.js +3 -3
- package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseType.js +1 -1
- package/build/features/connectExpress/screens/CollectBusinessInfo/TAC.d.ts +12 -0
- package/build/features/connectExpress/screens/CollectBusinessInfo/TAC.js +6 -9
- package/build/features/connectExpress/screens/NID/TAC.d.ts +12 -0
- package/build/features/connectExpress/screens/NID/TAC.js +6 -9
- package/build/features/entity/screens/EntityCapital/ActivityList.d.ts +0 -5
- package/build/features/entity/screens/EntityCapital/ActivityList.js +5 -5
- package/build/features/entity/screens/EntityCapital/EntityCapital.js +2 -2
- package/build/features/entity/screens/EntityName/EntityTypeList.d.ts +0 -5
- package/build/features/entity/screens/EntityName/EntityTypeList.js +5 -5
- package/build/features/entity/screens/Verify/OTPInput.js +5 -3
- package/build/features/featuresScreens.js +0 -5
- package/build/features/individual/screens/AdditionalIndividualInfo/InfluencerSwitch.js +1 -1
- package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.js +10 -2
- package/build/features/individual/screens/AdditionalIndividualInfo/Occupation.js +9 -1
- package/build/features/individual/screens/AdditionalIndividualInfo/PEPSwitch.js +1 -1
- package/build/features/individual/screens/AdditionalIndividualInfo/SourceOfIncome.js +9 -1
- package/build/features/individual/screens/IndividualPersonalInfo/BirthCity.js +9 -1
- package/build/features/individual/screens/IndividualPersonalInfo/BirthCountry.js +9 -1
- package/build/features/individual/screens/IndividualPersonalInfo/DOB.js +1 -1
- package/build/features/individual/screens/IndividualPersonalInfo/ExpiryDate.js +1 -1
- package/build/features/individual/screens/IndividualPersonalInfo/Gender.js +1 -1
- package/build/features/individual/screens/IndividualPersonalInfo/IssuedCountry.js +9 -1
- package/build/features/individual/screens/IndividualPersonalInfo/MobileNumber.js +9 -6
- package/build/features/individual/screens/IndividualPersonalInfo/Nationality.js +9 -1
- package/build/features/individual/screens/Verify/OTPInput.js +5 -3
- package/build/features/password/screens/Verify/OTPInput.js +5 -3
- package/build/features/shared/Address/Address.js +13 -20
- package/build/features/shared/Address/CountryList.js +4 -4
- package/build/features/shared/Address/InputSelect.js +1 -1
- package/build/features/shared/Button/FlowsButtons.js +14 -19
- package/build/features/shared/Input/Input.js +2 -3
- package/build/features/shared/OTP/OTP.d.ts +2 -1
- package/build/features/shared/OTP/OTP.js +2 -2
- package/build/features/shared/SalesChannels/SaleChannelIconsInput.js +2 -1
- package/build/features/shared/SalesChannels/SalesChannel.js +2 -1
- package/build/features/shared/UploadFile/FileUpload.js +5 -5
- package/build/features/shared/UploadFile/UploadFile.js +7 -7
- package/build/features/shared/UploadMultipleFile/UploadFile.js +5 -5
- package/build/features/tax/screens/TaxDetails/ConfirmPolicy.js +6 -9
- package/build/features/tax/screens/Verify/OTPInput.js +5 -3
- package/build/utils/error.d.ts +1 -0
- package/build/utils/error.js +3 -0
- package/build/utils/string.d.ts +1 -1
- package/build/utils/string.js +6 -0
- package/package.json +1 -1
- package/build/api/address.d.ts +0 -4
- package/build/api/address.js +0 -12
- package/build/features/entity/screens/EntityAddress/EntityAddress.d.ts +0 -5
- package/build/features/entity/screens/EntityAddress/EntityAddress.js +0 -42
- package/build/features/entity/screens/EntityAddress/index.d.ts +0 -2
- package/build/features/entity/screens/EntityAddress/index.js +0 -2
|
@@ -55,10 +55,10 @@ import { getRecentDocumentBasedOnPurpose, hasNoneEditableValue, sleep } from '..
|
|
|
55
55
|
export var verifyLeadToken = createAsyncThunk('taxVerifyLeadToken', function (_a, thunkApi) {
|
|
56
56
|
var token = _a.token, isInternally = _a.isInternally;
|
|
57
57
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
58
|
-
var payload, data, boardData,
|
|
59
|
-
var _b, _c, _d
|
|
60
|
-
return __generator(this, function (
|
|
61
|
-
switch (
|
|
58
|
+
var payload, data, boardData, countryIso2;
|
|
59
|
+
var _b, _c, _d;
|
|
60
|
+
return __generator(this, function (_e) {
|
|
61
|
+
switch (_e.label) {
|
|
62
62
|
case 0:
|
|
63
63
|
payload = {
|
|
64
64
|
service_name: 'tap_email',
|
|
@@ -66,30 +66,22 @@ export var verifyLeadToken = createAsyncThunk('taxVerifyLeadToken', function (_a
|
|
|
66
66
|
};
|
|
67
67
|
return [4, API.leadService.verifyLeadToken(payload)];
|
|
68
68
|
case 1:
|
|
69
|
-
data = (
|
|
70
|
-
|
|
69
|
+
data = (_e.sent()).data;
|
|
70
|
+
boardData = undefined;
|
|
71
71
|
if (((_b = data.errors) === null || _b === void 0 ? void 0 : _b.length) || (data === null || data === void 0 ? void 0 : data.mw_error))
|
|
72
72
|
throw new Error(data.errors[0].description || (data === null || data === void 0 ? void 0 : data.mw_error));
|
|
73
73
|
if (isInternally)
|
|
74
74
|
data.step_name = TAX_STEP_NAMES.TAX_INFO;
|
|
75
|
-
if (!data.id) return [3,
|
|
76
|
-
return [4, API.boardService.retrieveBoardInfoStatus(data.id)];
|
|
77
|
-
case 2:
|
|
78
|
-
boardInfoData = _f.sent();
|
|
75
|
+
if (!data.id) return [3, 3];
|
|
79
76
|
return [4, API.boardService.retrieveBoardDetails(data === null || data === void 0 ? void 0 : data.id)];
|
|
77
|
+
case 2:
|
|
78
|
+
boardData = _e.sent();
|
|
79
|
+
_e.label = 3;
|
|
80
80
|
case 3:
|
|
81
|
-
boardData = _f.sent();
|
|
82
|
-
_f.label = 4;
|
|
83
|
-
case 4:
|
|
84
|
-
info = (boardInfoData || {}).info;
|
|
85
81
|
countryIso2 = (_c = boardData === null || boardData === void 0 ? void 0 : boardData.entity) === null || _c === void 0 ? void 0 : _c.country;
|
|
86
82
|
if (countryIso2)
|
|
87
83
|
thunkApi.dispatch(handleSetCountryByIso2(countryIso2));
|
|
88
|
-
|
|
89
|
-
if (hasTaxCompleted) {
|
|
90
|
-
thunkApi.dispatch(handleNextScreenStep('TAX_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
|
|
91
|
-
}
|
|
92
|
-
else if (data.step_name === TAX_STEP_NAMES.PHONE_AUTH) {
|
|
84
|
+
if (data.step_name === TAX_STEP_NAMES.PHONE_AUTH) {
|
|
93
85
|
thunkApi.dispatch(handleCurrentActiveScreen('TAX_VERIFY_STEP'));
|
|
94
86
|
}
|
|
95
87
|
else if (data.step_name === TAX_STEP_NAMES.TAX_INFO) {
|
|
@@ -97,7 +89,7 @@ export var verifyLeadToken = createAsyncThunk('taxVerifyLeadToken', function (_a
|
|
|
97
89
|
}
|
|
98
90
|
return [2, {
|
|
99
91
|
data: data,
|
|
100
|
-
boardResponse: __assign(__assign({}, boardData === null || boardData === void 0 ? void 0 : boardData.business), {
|
|
92
|
+
boardResponse: __assign(__assign({}, boardData === null || boardData === void 0 ? void 0 : boardData.business), { entity: boardData === null || boardData === void 0 ? void 0 : boardData.entity, brand: boardData === null || boardData === void 0 ? void 0 : boardData.brand, user: boardData === null || boardData === void 0 ? void 0 : boardData.user, bank: boardData === null || boardData === void 0 ? void 0 : boardData.bank_account, vatID: (_d = boardData === null || boardData === void 0 ? void 0 : boardData.entity) === null || _d === void 0 ? void 0 : _d.vat_id, merchant: boardData === null || boardData === void 0 ? void 0 : boardData.merchant, individuals: boardData === null || boardData === void 0 ? void 0 : boardData.individuals, business: boardData === null || boardData === void 0 ? void 0 : boardData.business }),
|
|
101
93
|
token: token
|
|
102
94
|
}];
|
|
103
95
|
}
|
|
@@ -133,10 +125,10 @@ export var retrieveEntityInfo = createAsyncThunk('retrieveTaxEntityInfo', functi
|
|
|
133
125
|
});
|
|
134
126
|
}); });
|
|
135
127
|
export var verifyTaxLeadOTP = createAsyncThunk('verifyTaxLeadOTP', function (params, thunkApi) { return __awaiter(void 0, void 0, void 0, function () {
|
|
136
|
-
var _a, tax, settings, responseBody, payload, data
|
|
137
|
-
var _b, _c, _d, _e
|
|
138
|
-
return __generator(this, function (
|
|
139
|
-
switch (
|
|
128
|
+
var _a, tax, settings, responseBody, payload, data;
|
|
129
|
+
var _b, _c, _d, _e;
|
|
130
|
+
return __generator(this, function (_f) {
|
|
131
|
+
switch (_f.label) {
|
|
140
132
|
case 0:
|
|
141
133
|
_a = thunkApi.getState(), tax = _a.tax, settings = _a.settings;
|
|
142
134
|
responseBody = tax.data.verify.responseBody;
|
|
@@ -149,22 +141,12 @@ export var verifyTaxLeadOTP = createAsyncThunk('verifyTaxLeadOTP', function (par
|
|
|
149
141
|
};
|
|
150
142
|
return [4, API.leadService.verifyLeadOTP(payload)];
|
|
151
143
|
case 1:
|
|
152
|
-
data = (
|
|
144
|
+
data = (_f.sent()).data;
|
|
153
145
|
if ((_c = data.errors) === null || _c === void 0 ? void 0 : _c.length)
|
|
154
146
|
throw new Error(data.errors[0].description);
|
|
155
147
|
(_e = (_d = settings.data.appConfig).onStepCompleted) === null || _e === void 0 ? void 0 : _e.call(_d, settings.data.activeScreen.name, { otp: params.otp });
|
|
156
|
-
flows = (responseBody || {}).flows;
|
|
157
|
-
hasTaxCompleted = ((_f = flows === null || flows === void 0 ? void 0 : flows.find(function (flow) { return flow.name === 'tax'; })) === null || _f === void 0 ? void 0 : _f.status) === 'completed';
|
|
158
|
-
if (!hasTaxCompleted) return [3, 3];
|
|
159
|
-
return [4, thunkApi.dispatch(retrieveEntityInfo((_g = responseBody === null || responseBody === void 0 ? void 0 : responseBody.entity) === null || _g === void 0 ? void 0 : _g.id))];
|
|
160
|
-
case 2:
|
|
161
|
-
_h.sent();
|
|
162
|
-
thunkApi.dispatch(handleNextScreenStep('TAX_SUCCESS_FOUR_FLOWS_BUTTONS_STEP'));
|
|
163
|
-
return [3, 4];
|
|
164
|
-
case 3:
|
|
165
148
|
sleep(100).then(function () { return thunkApi.dispatch(handleNextScreenStep('TAX_TAX_DETAILS_STEP')); });
|
|
166
|
-
|
|
167
|
-
case 4: return [2, { data: data, formData: params }];
|
|
149
|
+
return [2, { data: data, formData: params }];
|
|
168
150
|
}
|
|
169
151
|
});
|
|
170
152
|
}); });
|
|
@@ -19,15 +19,11 @@ import CheckBox from '../../../../components/CheckBox';
|
|
|
19
19
|
import Text from '../../../../components/Text';
|
|
20
20
|
import Warning from '../../../../components/Warning';
|
|
21
21
|
import Collapse from '../../../../components/Collapse';
|
|
22
|
-
var ConfirmContainerStyled = styled(Box)(function (_a) {
|
|
23
|
-
var theme = _a.theme;
|
|
24
|
-
return ({
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
alignItems: 'center',
|
|
28
|
-
padding: theme.spacing(0, 2.5, 1.5, 2.5),
|
|
29
|
-
marginBlockStart: theme.spacing(3)
|
|
30
|
-
});
|
|
22
|
+
var ConfirmContainerStyled = styled(Box, { shouldForwardProp: function (prop) { return prop !== 'readOnly'; } })(function (_a) {
|
|
23
|
+
var theme = _a.theme, readOnly = _a.readOnly;
|
|
24
|
+
return (__assign({ display: 'flex', flexDirection: 'row', alignItems: 'center', padding: theme.spacing(0, 2.5, 1.5, 2.5), marginBlockStart: theme.spacing(3) }, (readOnly && {
|
|
25
|
+
opacity: '0.6'
|
|
26
|
+
})));
|
|
31
27
|
});
|
|
32
28
|
var TextStyled = styled(Text)(function (_a) {
|
|
33
29
|
var theme = _a.theme;
|
|
@@ -65,6 +61,6 @@ var ConfirmPolicy = function (_a) {
|
|
|
65
61
|
return;
|
|
66
62
|
confirmControl.field.onChange(checked);
|
|
67
63
|
};
|
|
68
|
-
return (_jsxs(ScreenContainer, { children: [_jsxs(ConfirmContainerStyled, { children: [_jsx(CheckboxStyled, { disableRipple: true, disableFocusRipple: true, focusRipple: false, checked: confirmChecked, onChange: handleConfirmCheckedChange }), _jsx(TextStyled, { children: t('bank_confirm_information') })] }), _jsx(CollapseStyled, __assign({ in: !!warningMessage }, { children: _jsx(Warning, __assign({ warningType: 'alert' }, { children: warningMessage && t(warningMessage) })) }))] }));
|
|
64
|
+
return (_jsxs(ScreenContainer, { children: [_jsxs(ConfirmContainerStyled, __assign({ readOnly: readOnly }, { children: [_jsx(CheckboxStyled, { disableRipple: true, disableFocusRipple: true, focusRipple: false, checked: confirmChecked, onChange: handleConfirmCheckedChange }), _jsx(TextStyled, { children: t('bank_confirm_information') })] })), _jsx(CollapseStyled, __assign({ in: !!warningMessage }, { children: _jsx(Warning, __assign({ warningType: 'alert' }, { children: warningMessage && t(warningMessage) })) }))] }));
|
|
69
65
|
};
|
|
70
66
|
export default ConfirmPolicy;
|
|
@@ -17,8 +17,9 @@ import OTPField from '../../../shared/OTP';
|
|
|
17
17
|
import { useController, useFormContext } from 'react-hook-form';
|
|
18
18
|
import { useTranslation } from 'react-i18next';
|
|
19
19
|
import { DEFAULT_TIMER_VALUE } from '../../../../constants';
|
|
20
|
-
import { useAppDispatch } from '../../../../hooks';
|
|
21
|
-
import {
|
|
20
|
+
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
21
|
+
import { isTokenExpired } from '../../../../utils';
|
|
22
|
+
import { resendOTP, bankSelector } from '../../../app/bank/bankStore';
|
|
22
23
|
var BoxStyled = styled(Box)(function (_a) {
|
|
23
24
|
var theme = _a.theme;
|
|
24
25
|
return ({
|
|
@@ -33,6 +34,7 @@ var OTPInput = function (_a) {
|
|
|
33
34
|
var t = useTranslation().t;
|
|
34
35
|
var otpControl = useController({ name: 'otp', control: control });
|
|
35
36
|
var dispatch = useAppDispatch();
|
|
37
|
+
var error = useAppSelector(bankSelector).error;
|
|
36
38
|
var handleOnOTPChange = function (otp) {
|
|
37
39
|
otpControl.field.onChange(otp);
|
|
38
40
|
};
|
|
@@ -42,6 +44,6 @@ var OTPInput = function (_a) {
|
|
|
42
44
|
dispatch(resendOTP());
|
|
43
45
|
};
|
|
44
46
|
var otpValue = otpControl.field.value;
|
|
45
|
-
return (_jsx(BoxStyled, __assign({ dir: 'ltr' }, { children: _jsx(OTPField, { loading: loading, timeEndLabel: t('ide_otp_resend_label'), timerInSeconds: DEFAULT_TIMER_VALUE, onResetClick: handleOnResendOTP, value: otpValue, onChange: function (number) { return handleOnOTPChange(number.toString()); } }) })));
|
|
47
|
+
return (_jsx(BoxStyled, __assign({ dir: 'ltr' }, { children: _jsx(OTPField, { loading: loading, timeEndLabel: t('ide_otp_resend_label'), timerInSeconds: DEFAULT_TIMER_VALUE, onResetClick: handleOnResendOTP, value: otpValue, hasError: isTokenExpired(error), onChange: function (number) { return handleOnOTPChange(number.toString()); } }) })));
|
|
46
48
|
};
|
|
47
49
|
export default React.memo(OTPInput);
|
|
@@ -13,11 +13,6 @@ export declare const InputLabelStyled: import("@emotion/styled").StyledComponent
|
|
|
13
13
|
ref?: ((instance: HTMLSpanElement | null) => void) | React.RefObject<HTMLSpanElement> | null | undefined;
|
|
14
14
|
}, 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") | "children" | "sx" | "variant" | "align" | "gutterBottom" | "noWrap" | "paragraph" | "variantMapping"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
15
15
|
export declare const MandatoryStyled: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, {}>;
|
|
16
|
-
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" | "value" | "components" | "componentsProps" | "autoFocus" | "fullWidth" | "required" | "rows" | "inputProps" | "inputRef" | "readOnly" | "autoComplete" | "disableInjectingGlobalStyles" | "endAdornment" | "inputComponent" | "multiline" | "renderSuffix" | "maxRows" | "minRows" | "startAdornment" | "disableUnderline" | "onEnterPressed" | "warningMessage"> & {
|
|
17
|
-
placeholder?: string | undefined;
|
|
18
|
-
hide?: boolean | undefined;
|
|
19
|
-
warningType?: "alert" | "error" | "hint" | undefined;
|
|
20
|
-
} & {} & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
21
16
|
export declare const InfoOutlinedIconStyled: import("@emotion/styled").StyledComponent<{
|
|
22
17
|
children?: React.ReactNode;
|
|
23
18
|
classes?: Partial<import("@mui/material").SvgIconClasses> | undefined;
|
|
@@ -36,7 +36,7 @@ import { alpha, styled } from '@mui/material/styles';
|
|
|
36
36
|
import InfoIcon from '@mui/icons-material/Info';
|
|
37
37
|
import InfoOutlinedIcon from '@mui/icons-material/InfoOutlined';
|
|
38
38
|
import Text from '../../../../components/Text';
|
|
39
|
-
import Input from '
|
|
39
|
+
import Input from '../../../shared/Input';
|
|
40
40
|
import Tooltip from '../../../../components/Tooltip';
|
|
41
41
|
import { useTranslation } from 'react-i18next';
|
|
42
42
|
import { useController, useFormContext } from 'react-hook-form';
|
|
@@ -56,12 +56,12 @@ export var MandatoryStyled = styled('span')(function (_a) {
|
|
|
56
56
|
var theme = _a.theme;
|
|
57
57
|
return (__assign(__assign({ color: alpha(theme.palette.error.light, 0.4) }, theme.typography.h6), { fontWeight: theme.typography.fontWeightLight, verticalAlign: 'sub' }));
|
|
58
58
|
});
|
|
59
|
-
|
|
60
|
-
var theme = _a.theme;
|
|
59
|
+
var InputStyled = styled(Input)(function (_a) {
|
|
60
|
+
var theme = _a.theme, readOnly = _a.readOnly;
|
|
61
61
|
return ({
|
|
62
62
|
paddingInlineEnd: theme.spacing(2.5),
|
|
63
63
|
'& .MuiInputBase-input': {
|
|
64
|
-
cursor: 'pointer'
|
|
64
|
+
cursor: readOnly ? 'default' : 'pointer'
|
|
65
65
|
}
|
|
66
66
|
});
|
|
67
67
|
});
|
|
@@ -160,7 +160,7 @@ var ActivitiesList = function (_a) {
|
|
|
160
160
|
var getSelectedActivityFlag = function (item) {
|
|
161
161
|
return controlValue === null || controlValue === void 0 ? void 0 : controlValue.find(function (activity) { return activity.id === item.id; });
|
|
162
162
|
};
|
|
163
|
-
return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, { children: [_jsxs(LabelContainerStyled, { children: [_jsxs(InputLabelStyled, { children: [t(isCR ? 'activities' : 'category'), " ", _jsx(MandatoryStyled, { children: "*" })] }), _jsx(Tooltip, __assign({ title: t('activities_name_hint'), onMouseOver: function () { return setIsHovered(true); }, onMouseLeave: function () { return setIsHovered(false); }, onTouchStartCapture: function () { return setIsHovered(true); } }, { children: isHovered ? _jsx(InfoIconStyled, {}) : _jsx(InfoOutlinedIconStyled, {}) }))] }), _jsxs(Box, { children: [_jsx(InputStyled, { readOnly:
|
|
163
|
+
return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, { children: [_jsxs(LabelContainerStyled, { children: [_jsxs(InputLabelStyled, { children: [t(isCR ? 'activities' : 'category'), " ", _jsx(MandatoryStyled, { children: "*" })] }), _jsx(Tooltip, __assign({ title: t('activities_name_hint'), onMouseOver: function () { return setIsHovered(true); }, onMouseLeave: function () { return setIsHovered(false); }, onTouchStartCapture: function () { return setIsHovered(true); } }, { children: isHovered ? _jsx(InfoIconStyled, {}) : _jsx(InfoOutlinedIconStyled, {}) }))] }), _jsxs(Box, { children: [_jsx(InputStyled, { readOnly: readOnly, disabled: disabled, value: getSelectedActivities(), placeholder: isCR ? t('choose_activities') : t('category_name'), onClick: disabled ? undefined : !!anchorEl ? onCloseList : onOpenList, endAdornment: disabled ? _jsx(_Fragment, {}) : _jsx(ExpandIcon, { anchorEl: !!anchorEl }) }), _jsx(Collapse, __assign({ in: !!anchorEl, timeout: 300 }, { children: _jsx(SimpleListStyled, { searchKeyPath: 'name.en', searchValuePath: ['name.ar', 'name.en'], list: activitiesMenuList, onSelectItem: onSelectItem, renderItem: function (item) {
|
|
164
164
|
var _a, _b, _c;
|
|
165
165
|
return (_jsxs(_Fragment, { children: [_jsx(Box, __assign({ display: 'flex' }, { children: _jsx(NameContainer, __assign({ isSelected: item.id === ((_a = getSelectedActivityFlag(item)) === null || _a === void 0 ? void 0 : _a.id) }, { children: isAr ? (_b = item === null || item === void 0 ? void 0 : item.name) === null || _b === void 0 ? void 0 : _b.ar : (_c = item === null || item === void 0 ? void 0 : item.name) === null || _c === void 0 ? void 0 : _c.en })) })), getSelectedActivityFlag(item) && _jsx(CheckIconStyled, {})] }));
|
|
166
166
|
} }) }))] })] }) })));
|
|
@@ -25,11 +25,6 @@ export declare const BaseLabelStyled: import("@emotion/styled").StyledComponent<
|
|
|
25
25
|
} & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "key" | keyof React.HTMLAttributes<HTMLSpanElement>> & {
|
|
26
26
|
ref?: ((instance: HTMLSpanElement | null) => void) | React.RefObject<HTMLSpanElement> | null | undefined;
|
|
27
27
|
}, 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") | "children" | "sx" | "variant" | "align" | "gutterBottom" | "noWrap" | "paragraph" | "variantMapping"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
28
|
-
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" | "value" | "components" | "componentsProps" | "autoFocus" | "fullWidth" | "required" | "rows" | "inputProps" | "inputRef" | "readOnly" | "autoComplete" | "disableInjectingGlobalStyles" | "endAdornment" | "inputComponent" | "multiline" | "renderSuffix" | "maxRows" | "minRows" | "startAdornment" | "disableUnderline" | "onEnterPressed" | "warningMessage"> & {
|
|
29
|
-
placeholder?: string | undefined;
|
|
30
|
-
hide?: boolean | undefined;
|
|
31
|
-
warningType?: "alert" | "error" | "hint" | undefined;
|
|
32
|
-
} & {} & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
33
28
|
export declare const NameContainer: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material/styles").Theme> & {
|
|
34
29
|
align?: "right" | "left" | "inherit" | "center" | "justify" | undefined;
|
|
35
30
|
children?: React.ReactNode;
|
|
@@ -30,7 +30,7 @@ import Text from '../../../../components/Text';
|
|
|
30
30
|
import Collapse from '../../../../components/Collapse';
|
|
31
31
|
import CheckIcon from '@mui/icons-material/Check';
|
|
32
32
|
import ExpandIcon from '../../../../components/ExpandIcon';
|
|
33
|
-
import Input from '
|
|
33
|
+
import Input from '../../../shared/Input';
|
|
34
34
|
import Tooltip from '../../../../components/Tooltip';
|
|
35
35
|
import SimpleList from '../../../../components/SimpleList';
|
|
36
36
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
@@ -46,12 +46,12 @@ export var BaseLabelStyled = styled(Text)(function (_a) {
|
|
|
46
46
|
var theme = _a.theme;
|
|
47
47
|
return (__assign({ color: alpha(theme.palette.text.primary, 0.4) }, theme.typography.caption));
|
|
48
48
|
});
|
|
49
|
-
|
|
50
|
-
var theme = _a.theme;
|
|
49
|
+
var InputStyled = styled(Input)(function (_a) {
|
|
50
|
+
var theme = _a.theme, readOnly = _a.readOnly;
|
|
51
51
|
return ({
|
|
52
52
|
paddingInlineEnd: theme.spacing(2.5),
|
|
53
53
|
'& .MuiInputBase-input': {
|
|
54
|
-
cursor: 'pointer'
|
|
54
|
+
cursor: readOnly ? 'default' : 'pointer'
|
|
55
55
|
}
|
|
56
56
|
});
|
|
57
57
|
});
|
|
@@ -140,7 +140,7 @@ var CustomerBase = function (_a) {
|
|
|
140
140
|
};
|
|
141
141
|
var customerLocationsValue = customerLocationsControl.field.value;
|
|
142
142
|
var customerLocationSelected = customerLocationsValue === null || customerLocationsValue === void 0 ? void 0 : customerLocationsValue[0];
|
|
143
|
-
return (_jsx(Collapse, __assign({ in: props.show }, { children: _jsxs(ScreenContainer, { children: [_jsxs(LabelContainerStyled, { children: [_jsx(BaseLabelStyled, { children: t('select_customer_base') }), _jsx(Tooltip, __assign({ title: t('customer_base_name_hint'), onMouseOver: function () { return setIsHovered(true); }, onMouseLeave: function () { return setIsHovered(false); }, onTouchStartCapture: function () { return setIsHovered(true); } }, { children: isHovered ? _jsx(InfoIconStyled, {}) : _jsx(InfoOutlinedIconStyled, {}) }))] }), _jsx(InputStyled, { readOnly:
|
|
143
|
+
return (_jsx(Collapse, __assign({ in: props.show }, { children: _jsxs(ScreenContainer, { children: [_jsxs(LabelContainerStyled, { children: [_jsx(BaseLabelStyled, { children: t('select_customer_base') }), _jsx(Tooltip, __assign({ title: t('customer_base_name_hint'), onMouseOver: function () { return setIsHovered(true); }, onMouseLeave: function () { return setIsHovered(false); }, onTouchStartCapture: function () { return setIsHovered(true); } }, { children: isHovered ? _jsx(InfoIconStyled, {}) : _jsx(InfoOutlinedIconStyled, {}) }))] }), _jsx(InputStyled, { readOnly: readOnly, disabled: disabled, placeholder: t('choose_expected_sales'), value: isAr ? (_b = customerLocationSelected === null || customerLocationSelected === void 0 ? void 0 : customerLocationSelected.name.ar) !== null && _b !== void 0 ? _b : '' : (_c = customerLocationSelected === null || customerLocationSelected === void 0 ? void 0 : customerLocationSelected.name.en) !== null && _c !== void 0 ? _c : '', onClick: disabled ? undefined : !!anchorEl ? function () { return onCloseList(); } : onOpenList, endAdornment: disabled ? _jsx(_Fragment, {}) : _jsx(ExpandIcon, { anchorEl: !!anchorEl }) }), _jsxs(Collapse, __assign({ in: !!anchorEl, timeout: 300 }, { children: [_jsx(Search, { onSearchValue: handleSearch }), _jsx(SimpleListStyled, { searchKeyPath: 'name.en', list: customerLocationsList, placeholder: 'choose_customer_base', onSelectItem: onSelectItem, renderItem: function (item) {
|
|
144
144
|
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.name.ar : item.name.en })) })), 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, {})] }));
|
|
145
145
|
} })] }))] }) })));
|
|
146
146
|
};
|
|
@@ -31,9 +31,19 @@ import SimpleList from '../../../../components/SimpleList';
|
|
|
31
31
|
import Collapse from '../../../../components/Collapse';
|
|
32
32
|
import ExpandIcon from '../../../../components/ExpandIcon';
|
|
33
33
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
34
|
-
import { CheckIconStyled, InputLabelStyled,
|
|
34
|
+
import { CheckIconStyled, InputLabelStyled, NameContainer } from './CustomerBase';
|
|
35
35
|
import { brandSelector, clearError } from '../../../app/brand/brandStore';
|
|
36
|
-
import Search from '
|
|
36
|
+
import Search from '../../../shared/Search';
|
|
37
|
+
import Input from '../../../shared/Input';
|
|
38
|
+
var InputStyled = styled(Input)(function (_a) {
|
|
39
|
+
var theme = _a.theme, readOnly = _a.readOnly;
|
|
40
|
+
return ({
|
|
41
|
+
paddingInlineEnd: theme.spacing(2.5),
|
|
42
|
+
'& .MuiInputBase-input': {
|
|
43
|
+
cursor: readOnly ? 'default' : 'pointer'
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
});
|
|
37
47
|
var ListItemContainer = styled(Box)(function (_a) {
|
|
38
48
|
var theme = _a.theme;
|
|
39
49
|
return ({
|
|
@@ -93,7 +103,7 @@ var ExpectedCustomers = function (_a) {
|
|
|
93
103
|
};
|
|
94
104
|
var expectedCustomersValue = expectedCustomerControl.field.value;
|
|
95
105
|
var expectedCustomersSelected = expectedCustomersValue;
|
|
96
|
-
return (_jsx(Collapse, __assign({ in: props.show }, { children: _jsxs(ScreenContainer, { children: [_jsx(InputLabelStyled, { children: t('expected_customers_to_serve') }), _jsx(InputStyled, { readOnly:
|
|
106
|
+
return (_jsx(Collapse, __assign({ in: props.show }, { children: _jsxs(ScreenContainer, { children: [_jsx(InputLabelStyled, { children: t('expected_customers_to_serve') }), _jsx(InputStyled, { readOnly: readOnly, placeholder: t('choose_expected_sales'), value: isAr ? (_c = (_b = expectedCustomersSelected === null || expectedCustomersSelected === void 0 ? void 0 : expectedCustomersSelected.name) === null || _b === void 0 ? void 0 : _b.ar) !== null && _c !== void 0 ? _c : '' : (_e = (_d = expectedCustomersSelected === null || expectedCustomersSelected === void 0 ? void 0 : expectedCustomersSelected.name) === null || _d === void 0 ? void 0 : _d.en) !== null && _e !== void 0 ? _e : '', onClick: !!anchorEl ? function () { return onCloseList(); } : onOpenList, endAdornment: _jsx(ExpandIcon, { anchorEl: !!anchorEl }) }), _jsxs(Collapse, __assign({ in: !!anchorEl, timeout: 300 }, { children: [_jsx(Search, { onSearchValue: handleSearch }), _jsx(SimpleListStyled, { searchKeyPath: 'name', list: expectedCustomersList, onSelectItem: onSelectItem, renderItem: function (item) {
|
|
97
107
|
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.name.ar : item.name.en })) }), item.id === (expectedCustomersSelected === null || expectedCustomersSelected === void 0 ? void 0 : expectedCustomersSelected.id) && _jsx(CheckIconStyled, {})] }));
|
|
98
108
|
} })] }))] }) })));
|
|
99
109
|
};
|
|
@@ -22,9 +22,19 @@ import ExpandIcon from '../../../../components/ExpandIcon';
|
|
|
22
22
|
import { brandSelector, clearError } from '../../../app/brand/brandStore';
|
|
23
23
|
import { findCurrencyByIso2, isExist } from '../../../../utils';
|
|
24
24
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
25
|
-
import { InputLabelStyled, CheckIconStyled,
|
|
25
|
+
import { InputLabelStyled, CheckIconStyled, NameContainer } from './CustomerBase';
|
|
26
26
|
import Search from '../../../../features/shared/Search';
|
|
27
27
|
import { settingsSelector } from '../../../../app/settings';
|
|
28
|
+
import Input from '../../../shared/Input';
|
|
29
|
+
var InputStyled = styled(Input)(function (_a) {
|
|
30
|
+
var theme = _a.theme, readOnly = _a.readOnly;
|
|
31
|
+
return ({
|
|
32
|
+
paddingInlineEnd: theme.spacing(2.5),
|
|
33
|
+
'& .MuiInputBase-input': {
|
|
34
|
+
cursor: readOnly ? 'default' : 'pointer'
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
});
|
|
28
38
|
var ListItem = styled(Box)(function (_a) {
|
|
29
39
|
var theme = _a.theme;
|
|
30
40
|
return ({
|
|
@@ -116,7 +126,7 @@ var ExpectedSalesRange = function (_a) {
|
|
|
116
126
|
}, [anchorEl, expectedSalesRangeValue]);
|
|
117
127
|
return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, { children: [_jsx(InputLabelStyled, { children: t('expected_sales_monthly', {
|
|
118
128
|
currency: t(findCurrencyByIso2(countryCode.iso2))
|
|
119
|
-
}) }), _jsx(InputStyled, { readOnly:
|
|
129
|
+
}) }), _jsx(InputStyled, { readOnly: readOnly, disabled: disabled, value: isAr ? (_b = expectedSalesRangeValue === null || expectedSalesRangeValue === void 0 ? void 0 : expectedSalesRangeValue.name.ar) !== null && _b !== void 0 ? _b : '' : (_c = expectedSalesRangeValue === null || expectedSalesRangeValue === void 0 ? void 0 : expectedSalesRangeValue.name.en) !== null && _c !== void 0 ? _c : '', onClick: disabled ? undefined : !!anchorEl ? handleCloseMainMenu : handleOpenMainMenu, placeholder: t('choose_expected_sales'), endAdornment: disabled ? _jsx(_Fragment, {}) : _jsx(ExpandIcon, { anchorEl: !!anchorEl }) }), _jsxs(Collapse, __assign({ in: !!anchorEl }, { children: [_jsx(Search, { onSearchValue: handleSearch }), _jsx(SimpleListStyled, { sx: { maxHeight: '350px', paddingTop: 0 }, list: expectedSalesRangeList, listItemProps: { sx: { padding: 0 } }, onSelectItem: function (item) {
|
|
120
130
|
var isOnlyOneItem = !item.sub || item.sub.length === 1;
|
|
121
131
|
if (isOnlyOneItem)
|
|
122
132
|
onSelectItem(item);
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { BoxProps } from '@mui/material/Box';
|
|
3
|
+
interface ContainerStyledProps extends BoxProps {
|
|
4
|
+
readOnly?: boolean;
|
|
5
|
+
}
|
|
2
6
|
export declare const ContainerStyled: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material/styles").Theme> & {
|
|
3
7
|
children?: React.ReactNode;
|
|
4
8
|
component?: React.ElementType<any> | undefined;
|
|
@@ -6,7 +10,7 @@ export declare const ContainerStyled: import("@emotion/styled").StyledComponent<
|
|
|
6
10
|
sx?: import("@mui/material/styles").SxProps<import("@mui/material/styles").Theme> | undefined;
|
|
7
11
|
} & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
|
|
8
12
|
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
|
|
13
|
+
}, 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> & ContainerStyledProps, {}, {}>;
|
|
10
14
|
export declare const CheckboxStyled: import("@emotion/styled").StyledComponent<import("../../../../components/CheckBox").CheckboxProps & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
11
15
|
export declare const TextStyled: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material/styles").Theme> & {
|
|
12
16
|
align?: "right" | "left" | "inherit" | "center" | "justify" | undefined;
|
|
@@ -26,14 +26,11 @@ import { ScreenContainer } from '../../../shared/Containers';
|
|
|
26
26
|
import { settingsSelector } from '../../../../app/settings';
|
|
27
27
|
import { useAppSelector } from '../../../../hooks';
|
|
28
28
|
import { brandSelector } from '../../../app/brand/brandStore';
|
|
29
|
-
export var ContainerStyled = styled(Box)(function (_a) {
|
|
30
|
-
var theme = _a.theme;
|
|
31
|
-
return ({
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
alignItems: 'center',
|
|
35
|
-
padding: theme.spacing(0, 2.5, 1.5, 2.5)
|
|
36
|
-
});
|
|
29
|
+
export var ContainerStyled = styled(Box, { shouldForwardProp: function (prop) { return prop !== 'readOnly'; } })(function (_a) {
|
|
30
|
+
var theme = _a.theme, readOnly = _a.readOnly;
|
|
31
|
+
return (__assign({ display: 'flex', flexDirection: 'row', alignItems: 'center', padding: theme.spacing(0, 2.5, 1.5, 2.5) }, (readOnly && {
|
|
32
|
+
opacity: '0.6'
|
|
33
|
+
})));
|
|
37
34
|
});
|
|
38
35
|
export var CheckboxStyled = styled(CheckBox)(function (_a) {
|
|
39
36
|
var theme = _a.theme;
|
|
@@ -91,6 +88,6 @@ var RefundPolicy = function (_a) {
|
|
|
91
88
|
return;
|
|
92
89
|
refundControl.field.onChange(checked);
|
|
93
90
|
};
|
|
94
|
-
return (_jsxs(ScreenContainer, { children: [_jsxs(ContainerStyled, { children: [_jsx(CheckboxStyled, { disabled: disabled, disableRipple: true, disableFocusRipple: true, focusRipple: false, checked: refundChecked, onChange: handleRefundCheckedChange }), _jsxs(TextStyled, { children: [t('agree_on_refund_policy'), _jsx(LinkStyled, __assign({ href: isAr ? TAP_WEBSITE + countryCode + EXTERNAL_LINKS.REFUND_AR : TAP_WEBSITE + countryCode + 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) })) }))] }));
|
|
91
|
+
return (_jsxs(ScreenContainer, { children: [_jsxs(ContainerStyled, __assign({ readOnly: readOnly }, { children: [_jsx(CheckboxStyled, { disabled: disabled, disableRipple: true, disableFocusRipple: true, focusRipple: false, checked: refundChecked, onChange: handleRefundCheckedChange }), _jsxs(TextStyled, { children: [t('agree_on_refund_policy'), _jsx(LinkStyled, __assign({ href: isAr ? TAP_WEBSITE + countryCode + EXTERNAL_LINKS.REFUND_AR : TAP_WEBSITE + countryCode + 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) })) }))] }));
|
|
95
92
|
};
|
|
96
93
|
export default RefundPolicy;
|
|
@@ -1,4 +1,16 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { BoxProps } from '@mui/material/Box';
|
|
3
|
+
interface TACContainerStyledProps extends BoxProps {
|
|
4
|
+
readOnly?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare const TACContainerStyled: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material/styles").Theme> & {
|
|
7
|
+
children?: React.ReactNode;
|
|
8
|
+
component?: React.ElementType<any> | undefined;
|
|
9
|
+
ref?: React.Ref<unknown> | undefined;
|
|
10
|
+
sx?: import("@mui/material/styles").SxProps<import("@mui/material/styles").Theme> | undefined;
|
|
11
|
+
} & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
|
|
12
|
+
ref?: ((instance: HTMLDivElement | null) => void) | React.RefObject<HTMLDivElement> | null | undefined;
|
|
13
|
+
}, 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> & TACContainerStyledProps, {}, {}>;
|
|
2
14
|
interface TACProps {
|
|
3
15
|
show: boolean;
|
|
4
16
|
readOnly?: boolean;
|
|
@@ -26,14 +26,11 @@ import { EXTERNAL_LINKS, TAP_WEBSITE } from '../../../../constants';
|
|
|
26
26
|
import { settingsSelector } from '../../../../app/settings';
|
|
27
27
|
import { useAppSelector } from '../../../../hooks';
|
|
28
28
|
import { brandSelector } from '../../../app/brand/brandStore';
|
|
29
|
-
var TACContainerStyled = styled(Box)(function (_a) {
|
|
30
|
-
var theme = _a.theme;
|
|
31
|
-
return ({
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
alignItems: 'center',
|
|
35
|
-
padding: theme.spacing(0, 2.5, 1.5, 2.5)
|
|
36
|
-
});
|
|
29
|
+
export var TACContainerStyled = styled(Box, { shouldForwardProp: function (prop) { return prop !== 'readOnly'; } })(function (_a) {
|
|
30
|
+
var theme = _a.theme, readOnly = _a.readOnly;
|
|
31
|
+
return (__assign({ display: 'flex', flexDirection: 'row', alignItems: 'center', padding: theme.spacing(0, 2.5, 1.5, 2.5) }, (readOnly && {
|
|
32
|
+
opacity: '0.6'
|
|
33
|
+
})));
|
|
37
34
|
});
|
|
38
35
|
var TextStyled = styled(Text)(function (_a) {
|
|
39
36
|
var theme = _a.theme;
|
|
@@ -91,6 +88,6 @@ var TAC = function (_a) {
|
|
|
91
88
|
return;
|
|
92
89
|
tacControl.field.onChange(checked);
|
|
93
90
|
};
|
|
94
|
-
return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, __assign({ sx: { mt: 2.75 } }, { children: [_jsxs(TACContainerStyled, { children: [_jsx(CheckboxStyled, { disabled: disabled, disableRipple: true, disableFocusRipple: true, focusRipple: false, checked: tacChecked, onChange: handleTACCheckedChange }), _jsxs(TextStyled, { children: [t('read_agree_terms_and_conditions_message'), _jsx(LinkStyled, __assign({ href: isAr ? TAP_WEBSITE + countryCode + EXTERNAL_LINKS.TOS_AR : TAP_WEBSITE + countryCode + EXTERNAL_LINKS.TOS_EN, target: '_blank', underline: 'always' }, { children: t('terms_and_conditions_link_title') }))] })] }), _jsx(CollapseStyled, __assign({ in: !!warningMessage }, { children: _jsx(Warning, __assign({ warningType: 'alert' }, { children: warningMessage && t(warningMessage) })) }))] })) })));
|
|
91
|
+
return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, __assign({ sx: { mt: 2.75 } }, { children: [_jsxs(TACContainerStyled, __assign({ readOnly: readOnly }, { children: [_jsx(CheckboxStyled, { disabled: disabled, disableRipple: true, disableFocusRipple: true, focusRipple: false, checked: tacChecked, onChange: handleTACCheckedChange }), _jsxs(TextStyled, { children: [t('read_agree_terms_and_conditions_message'), _jsx(LinkStyled, __assign({ href: isAr ? TAP_WEBSITE + countryCode + EXTERNAL_LINKS.TOS_AR : TAP_WEBSITE + countryCode + EXTERNAL_LINKS.TOS_EN, target: '_blank', underline: 'always' }, { children: t('terms_and_conditions_link_title') }))] })] })), _jsx(CollapseStyled, __assign({ in: !!warningMessage }, { children: _jsx(Warning, __assign({ warningType: 'alert' }, { children: warningMessage && t(warningMessage) })) }))] })) })));
|
|
95
92
|
};
|
|
96
93
|
export default React.memo(TAC);
|
|
@@ -51,6 +51,6 @@ var TransactionPolicy = function (_a) {
|
|
|
51
51
|
return;
|
|
52
52
|
transactionControl.field.onChange(checked);
|
|
53
53
|
};
|
|
54
|
-
return (_jsxs(ScreenContainer, { children: [_jsxs(ContainerStyled, { children: [_jsx(CheckboxStyled, { disabled: disabled, disableRipple: true, disableFocusRipple: true, focusRipple: false, checked: transactionChecked, onChange: handleTransactionCheckedChange }), _jsxs(TextStyled, { children: [t('agree_on_chargeback_policy'), _jsx(LinkStyled, __assign({ href: isAr ? TAP_WEBSITE + countryCode + EXTERNAL_LINKS.TRANSACTION_AR : TAP_WEBSITE + countryCode + 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) })) }))] }));
|
|
54
|
+
return (_jsxs(ScreenContainer, { children: [_jsxs(ContainerStyled, __assign({ readOnly: readOnly }, { children: [_jsx(CheckboxStyled, { disabled: disabled, disableRipple: true, disableFocusRipple: true, focusRipple: false, checked: transactionChecked, onChange: handleTransactionCheckedChange }), _jsxs(TextStyled, { children: [t('agree_on_chargeback_policy'), _jsx(LinkStyled, __assign({ href: isAr ? TAP_WEBSITE + countryCode + EXTERNAL_LINKS.TRANSACTION_AR : TAP_WEBSITE + countryCode + 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) })) }))] }));
|
|
55
55
|
};
|
|
56
56
|
export default TransactionPolicy;
|
|
@@ -46,7 +46,7 @@ var BrandInfo = function (_a) {
|
|
|
46
46
|
var t = useTranslation().t;
|
|
47
47
|
var isAr = useLanguage().isAr;
|
|
48
48
|
var settingData = useAppSelector(settingsSelector).data;
|
|
49
|
-
var _e = useAppSelector(brandSelector), data = _e.data, loading = _e.loading, error = _e.error;
|
|
49
|
+
var _e = useAppSelector(brandSelector), data = _e.data, loading = _e.loading, error = _e.error, uploadingBrandLogo = _e.uploadingBrandLogo;
|
|
50
50
|
var _f = data.brandData, brandName = _f.brandName, segment = _f.segment, teamSize = _f.teamSize, salesChannels = _f.salesChannels, brandLogoId = _f.brandLogoId, responseBody = _f.responseBody;
|
|
51
51
|
var _g = ((_b = data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.brand) || {}, logo_details = _g.logo_details, data_status = _g.data_status;
|
|
52
52
|
var methods = useForm({
|
|
@@ -77,7 +77,7 @@ var BrandInfo = function (_a) {
|
|
|
77
77
|
methods.setError('brandName', { message: 'brand_name_already_exist' });
|
|
78
78
|
}, [responseBody]);
|
|
79
79
|
var brandErrChecks = !methods.formState.isValid || !!methods.formState.errors.brandName || !!error;
|
|
80
|
-
var disabled = brandErrChecks || brandNameChecking;
|
|
80
|
+
var disabled = brandErrChecks || brandNameChecking || uploadingBrandLogo;
|
|
81
81
|
var handleMenuClick = function (flag) {
|
|
82
82
|
setListActive(flag);
|
|
83
83
|
};
|
|
@@ -24,6 +24,14 @@ import Box from '@mui/material/Box';
|
|
|
24
24
|
import { styled } from '@mui/material/styles';
|
|
25
25
|
import Text from '../../../../components/Text';
|
|
26
26
|
import CheckIcon from '@mui/icons-material/Check';
|
|
27
|
+
var InputStyled = styled(Input)(function (_a) {
|
|
28
|
+
var readOnly = _a.readOnly;
|
|
29
|
+
return ({
|
|
30
|
+
'& .MuiInputBase-input': {
|
|
31
|
+
cursor: readOnly ? 'default' : 'pointer'
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
});
|
|
27
35
|
var IncomeText = styled(Text, { shouldForwardProp: function (prop) { return prop !== 'isSelected'; } })(function (_a) {
|
|
28
36
|
var theme = _a.theme, isSelected = _a.isSelected;
|
|
29
37
|
return (__assign(__assign({ color: theme.palette.text.primary }, theme.typography.body2), { fontWeight: isSelected ? theme.typography.fontWeightMedium : theme.typography.fontWeightLight, paddingInlineStart: theme.spacing(1.25), textAlign: 'start' }));
|
|
@@ -68,7 +76,7 @@ var Segments = function (_a) {
|
|
|
68
76
|
onCloseList();
|
|
69
77
|
segmentControl.field.onChange(segment);
|
|
70
78
|
};
|
|
71
|
-
return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, __assign({ sx: { mt: 2.5, mb: 0 } }, { children: [_jsx(
|
|
79
|
+
return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, __assign({ sx: { mt: 2.5, mb: 0 } }, { children: [_jsx(InputStyled, { required: true, label: t('segment_title'), readOnly: readOnly, onClick: !!anchorEl ? function () { return onCloseList(); } : onOpenList, endAdornment: _jsx(ExpandIcon, { anchorEl: !!anchorEl }), placeholder: t('choose_any_segment'), value: (isAr ? (_d = segment === null || segment === void 0 ? void 0 : segment.name) === null || _d === void 0 ? void 0 : _d.ar : (_e = segment === null || segment === void 0 ? void 0 : segment.name) === null || _e === void 0 ? void 0 : _e.en) || '', warningMessage: error && t(error) }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleList, { searchKeyPath: 'name.en', searchValuePath: ['name.ar', 'name.en'], list: segmentList, onSelectItem: onSelectItem, renderItem: function (item) {
|
|
72
80
|
var _a, _b;
|
|
73
81
|
return (_jsxs(_Fragment, { children: [_jsx(Box, __assign({ display: 'flex' }, { children: _jsx(IncomeText, __assign({ isSelected: item.id === (segment === null || segment === void 0 ? void 0 : segment.id) }, { children: isAr ? (_a = item === null || item === void 0 ? void 0 : item.name) === null || _a === void 0 ? void 0 : _a.ar : (_b = item === null || item === void 0 ? void 0 : item.name) === null || _b === void 0 ? void 0 : _b.en })) })), item.id === (segment === null || segment === void 0 ? void 0 : segment.id) && _jsx(CheckIconStyled, {})] }));
|
|
74
82
|
} }) }))] })) })));
|
|
@@ -24,6 +24,14 @@ import Box from '@mui/material/Box';
|
|
|
24
24
|
import { styled } from '@mui/material/styles';
|
|
25
25
|
import Text from '../../../../components/Text';
|
|
26
26
|
import CheckIcon from '@mui/icons-material/Check';
|
|
27
|
+
var InputStyled = styled(Input)(function (_a) {
|
|
28
|
+
var readOnly = _a.readOnly;
|
|
29
|
+
return ({
|
|
30
|
+
'& .MuiInputBase-input': {
|
|
31
|
+
cursor: readOnly ? 'default' : 'pointer'
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
});
|
|
27
35
|
var IncomeText = styled(Text, { shouldForwardProp: function (prop) { return prop !== 'isSelected'; } })(function (_a) {
|
|
28
36
|
var theme = _a.theme, isSelected = _a.isSelected;
|
|
29
37
|
return (__assign(__assign({ color: theme.palette.text.primary }, theme.typography.body2), { fontWeight: isSelected ? theme.typography.fontWeightMedium : theme.typography.fontWeightLight, paddingInlineStart: theme.spacing(1.25), textAlign: 'start' }));
|
|
@@ -68,7 +76,7 @@ var TeamSize = function (_a) {
|
|
|
68
76
|
onCloseList();
|
|
69
77
|
teamSizeControl.field.onChange(teamSize);
|
|
70
78
|
};
|
|
71
|
-
return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, __assign({ sx: { mt: 2.5, mb: 0 } }, { children: [_jsx(
|
|
79
|
+
return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, __assign({ sx: { mt: 2.5, mb: 0 } }, { children: [_jsx(InputStyled, { required: true, label: t('team_size_title'), readOnly: readOnly, onClick: !!anchorEl ? function () { return onCloseList(); } : onOpenList, endAdornment: _jsx(ExpandIcon, { anchorEl: !!anchorEl }), placeholder: t('choose_team_size'), value: (isAr ? (_d = teamSize === null || teamSize === void 0 ? void 0 : teamSize.name) === null || _d === void 0 ? void 0 : _d.ar : (_e = teamSize === null || teamSize === void 0 ? void 0 : teamSize.name) === null || _e === void 0 ? void 0 : _e.en) || '', warningMessage: error && t(error) }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleList, { searchKeyPath: 'name.en', searchValuePath: ['name.ar', 'name.en'], list: teamSizeList, onSelectItem: onSelectItem, renderItem: function (item) {
|
|
72
80
|
var _a, _b;
|
|
73
81
|
return (_jsxs(_Fragment, { children: [_jsx(Box, __assign({ display: 'flex' }, { children: _jsx(IncomeText, __assign({ isSelected: item.id === (teamSize === null || teamSize === void 0 ? void 0 : teamSize.id) }, { children: isAr ? (_a = item === null || item === void 0 ? void 0 : item.name) === null || _a === void 0 ? void 0 : _a.ar : (_b = item === null || item === void 0 ? void 0 : item.name) === null || _b === void 0 ? void 0 : _b.en })) })), item.id === (teamSize === null || teamSize === void 0 ? void 0 : teamSize.id) && _jsx(CheckIconStyled, {})] }));
|
|
74
82
|
} }) }))] })) })));
|