@tap-payments/auth-jsconnect 2.3.43-test → 2.3.47-test

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. package/build/@types/form.d.ts +0 -1
  2. package/build/api/brand.d.ts +7 -0
  3. package/build/api/brand.js +10 -1
  4. package/build/api/index.d.ts +3 -1
  5. package/build/components/DatePicker/DatePicker.js +1 -0
  6. package/build/components/RadioGroup/RadioGroup.d.ts +5 -2
  7. package/build/components/RadioGroup/RadioGroup.js +5 -9
  8. package/build/components/RadioGroup/index.d.ts +1 -1
  9. package/build/features/app/brand/brandStore.js +14 -3
  10. package/build/features/app/business/businessStore.d.ts +3 -12
  11. package/build/features/app/business/businessStore.js +30 -70
  12. package/build/features/app/connectExpress/connectExpressStore.js +12 -8
  13. package/build/features/bank/screens/BankDetails/ConfirmPolicy.js +6 -10
  14. package/build/features/brand/screens/BrandActivities/ActivitiesList.d.ts +0 -5
  15. package/build/features/brand/screens/BrandActivities/ActivitiesList.js +5 -5
  16. package/build/features/brand/screens/BrandActivities/CustomerBase.d.ts +0 -5
  17. package/build/features/brand/screens/BrandActivities/CustomerBase.js +5 -5
  18. package/build/features/brand/screens/BrandActivities/ExpectedCustomers.js +13 -3
  19. package/build/features/brand/screens/BrandActivities/ExpectedSalesRange.js +12 -2
  20. package/build/features/brand/screens/BrandActivities/RefundPolicy.d.ts +5 -1
  21. package/build/features/brand/screens/BrandActivities/RefundPolicy.js +6 -9
  22. package/build/features/brand/screens/BrandActivities/TAC.d.ts +12 -0
  23. package/build/features/brand/screens/BrandActivities/TAC.js +6 -9
  24. package/build/features/brand/screens/BrandActivities/TransactionPolicy.js +1 -1
  25. package/build/features/brand/screens/BrandInfo/Segments.js +9 -1
  26. package/build/features/brand/screens/BrandInfo/TeamSize.js +9 -1
  27. package/build/features/business/screens/Activities/ActivitiesList.d.ts +0 -5
  28. package/build/features/business/screens/Activities/ActivitiesList.js +5 -5
  29. package/build/features/business/screens/Activities/OperationStartDate.js +1 -1
  30. package/build/features/business/screens/BusinessType/Article.d.ts +3 -1
  31. package/build/features/business/screens/BusinessType/Article.js +19 -54
  32. package/build/features/business/screens/BusinessType/BusinessType.js +4 -4
  33. package/build/features/business/screens/BusinessType/LicenseList.js +1 -1
  34. package/build/features/business/screens/Customers/CustomerLocations.d.ts +0 -5
  35. package/build/features/business/screens/Customers/CustomerLocations.js +5 -5
  36. package/build/features/business/screens/Customers/ExpectedCustomers.js +12 -2
  37. package/build/features/business/screens/Customers/ExpectedSalesRange.js +12 -2
  38. package/build/features/business/screens/IDBOD/DOB.js +1 -1
  39. package/build/features/connect/screens/Merchant/BrandList.js +1 -1
  40. package/build/features/connect/screens/Merchant/Segments.js +6 -1
  41. package/build/features/connect/screens/Merchant/TeamSize.js +6 -1
  42. package/build/features/connectExpress/screens/Brand/Brand.js +1 -1
  43. package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseList.js +3 -3
  44. package/build/features/connectExpress/screens/CollectBusinessInfo/LicenseType.js +1 -1
  45. package/build/features/connectExpress/screens/CollectBusinessInfo/TAC.d.ts +12 -0
  46. package/build/features/connectExpress/screens/CollectBusinessInfo/TAC.js +6 -9
  47. package/build/features/connectExpress/screens/NID/TAC.d.ts +12 -0
  48. package/build/features/connectExpress/screens/NID/TAC.js +6 -9
  49. package/build/features/entity/screens/EntityCapital/ActivityList.d.ts +0 -5
  50. package/build/features/entity/screens/EntityCapital/ActivityList.js +5 -5
  51. package/build/features/entity/screens/EntityName/Article.js +1 -2
  52. package/build/features/entity/screens/EntityName/EntityTypeList.d.ts +0 -5
  53. package/build/features/entity/screens/EntityName/EntityTypeList.js +5 -5
  54. package/build/features/individual/screens/AdditionalIndividualInfo/InfluencerSwitch.js +1 -1
  55. package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.js +10 -2
  56. package/build/features/individual/screens/AdditionalIndividualInfo/Occupation.js +9 -1
  57. package/build/features/individual/screens/AdditionalIndividualInfo/PEPSwitch.js +1 -1
  58. package/build/features/individual/screens/AdditionalIndividualInfo/SourceOfIncome.js +9 -1
  59. package/build/features/individual/screens/IndividualPersonalInfo/BirthCity.js +9 -1
  60. package/build/features/individual/screens/IndividualPersonalInfo/BirthCountry.js +9 -1
  61. package/build/features/individual/screens/IndividualPersonalInfo/DOB.js +1 -1
  62. package/build/features/individual/screens/IndividualPersonalInfo/ExpiryDate.js +1 -1
  63. package/build/features/individual/screens/IndividualPersonalInfo/Gender.js +1 -1
  64. package/build/features/individual/screens/IndividualPersonalInfo/IssuedCountry.js +9 -1
  65. package/build/features/individual/screens/IndividualPersonalInfo/MobileNumber.js +9 -6
  66. package/build/features/individual/screens/IndividualPersonalInfo/Nationality.js +9 -1
  67. package/build/features/shared/Address/CountryList.js +1 -1
  68. package/build/features/shared/Address/InputSelect.js +1 -1
  69. package/build/features/shared/Input/Input.js +2 -3
  70. package/build/features/shared/SalesChannels/SaleChannelIconsInput.js +2 -1
  71. package/build/features/shared/SalesChannels/SalesChannel.js +2 -1
  72. package/build/features/shared/UploadFile/FileUpload.js +5 -5
  73. package/build/features/shared/UploadFile/UploadFile.js +7 -7
  74. package/build/features/shared/UploadMultipleFile/UploadFile.js +5 -5
  75. package/build/features/tax/screens/TaxDetails/ConfirmPolicy.js +6 -9
  76. package/build/utils/string.d.ts +1 -1
  77. package/build/utils/string.js +6 -0
  78. package/package.json +1 -1
@@ -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, InputStyled, NameContainer } from './CustomerBase';
34
+ import { CheckIconStyled, InputLabelStyled, NameContainer } from './CustomerBase';
35
35
  import { brandSelector, clearError } from '../../../app/brand/brandStore';
36
- import Search from '../../../../features/shared/Search';
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: true, 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) {
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, InputStyled, NameContainer } from './CustomerBase';
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: true, 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) {
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
- display: 'flex',
33
- flexDirection: 'row',
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
- display: 'flex',
33
- flexDirection: 'row',
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;
@@ -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(Input, { required: true, label: t('segment_title'), readOnly: true, 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) {
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(Input, { required: true, label: t('team_size_title'), readOnly: true, 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) {
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
  } }) }))] })) })));
@@ -12,11 +12,6 @@ export declare const InputLabelStyled: import("@emotion/styled").StyledComponent
12
12
  } & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "key" | keyof React.HTMLAttributes<HTMLSpanElement>> & {
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
- 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"> & {
16
- placeholder?: string | undefined;
17
- hide?: boolean | undefined;
18
- warningType?: "alert" | "error" | "hint" | undefined;
19
- } & {} & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
20
15
  export declare const InfoOutlinedIconStyled: import("@emotion/styled").StyledComponent<{
21
16
  children?: React.ReactNode;
22
17
  classes?: Partial<import("@mui/material").SvgIconClasses> | undefined;
@@ -39,7 +39,7 @@ import InfoIcon from '@mui/icons-material/Info';
39
39
  import InfoOutlinedIcon from '@mui/icons-material/InfoOutlined';
40
40
  import { sortActivitiesByName } from '../../../../utils';
41
41
  import Text from '../../../../components/Text';
42
- import Input from '../../../../components/Input';
42
+ import Input from '../../../shared/Input';
43
43
  import Tooltip from '../../../../components/Tooltip';
44
44
  import { useLanguage, useAppSelector } from '../../../../hooks';
45
45
  import { BusinessType } from '../../../../@types';
@@ -54,12 +54,12 @@ export var InputLabelStyled = styled(Text)(function (_a) {
54
54
  var theme = _a.theme;
55
55
  return (__assign({ color: alpha(theme.palette.text.primary, 0.4) }, theme.typography.caption));
56
56
  });
57
- export var InputStyled = styled(Input)(function (_a) {
58
- var theme = _a.theme;
57
+ var InputStyled = styled(Input)(function (_a) {
58
+ var theme = _a.theme, readOnly = _a.readOnly;
59
59
  return ({
60
60
  paddingInlineEnd: theme.spacing(2.5),
61
61
  '& .MuiInputBase-input': {
62
- cursor: 'pointer'
62
+ cursor: readOnly ? 'default' : 'pointer'
63
63
  }
64
64
  });
65
65
  });
@@ -156,7 +156,7 @@ var ActivitiesList = function (_a) {
156
156
  var getSelectedActivityFlag = function (item) {
157
157
  return controlValue === null || controlValue === void 0 ? void 0 : controlValue.find(function (activity) { return activity.id === item.id; });
158
158
  };
159
- return (_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: true, value: getSelectedActivities() || '', placeholder: isCR ? t('choose_activities') : t('category_name'), onClick: !!anchorEl ? function () { return onCloseList(); } : onOpenList, endAdornment: _jsx(ExpandIcon, { anchorEl: !!anchorEl }) }), _jsx(Collapse, __assign({ in: !!anchorEl, timeout: 300 }, { children: _jsx(SimpleListStyled, { searchKeyPath: 'name.en', searchValuePath: ['name.ar', 'name.en'], list: activitiesMenuList, onSelectItem: onSelectItem, renderItem: function (item) {
159
+ return (_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, { value: getSelectedActivities() || '', placeholder: isCR ? t('choose_activities') : t('category_name'), onClick: !!anchorEl ? function () { return onCloseList(); } : onOpenList, endAdornment: _jsx(ExpandIcon, { anchorEl: !!anchorEl }) }), _jsx(Collapse, __assign({ in: !!anchorEl, timeout: 300 }, { children: _jsx(SimpleListStyled, { searchKeyPath: 'name.en', searchValuePath: ['name.ar', 'name.en'], list: activitiesMenuList, onSelectItem: onSelectItem, renderItem: function (item) {
160
160
  var _a, _b, _c;
161
161
  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, {})] }));
162
162
  } }) }))] })] }));
@@ -20,7 +20,7 @@ import { businessSelector, clearError } from '../../../app/business/businessStor
20
20
  import { alpha, styled } from '@mui/material/styles';
21
21
  export var InputLabelStyled = styled(Text)(function (_a) {
22
22
  var theme = _a.theme;
23
- return (__assign({ margin: theme.spacing(2.5, 2.5, 1.5, 2.5), color: alpha(theme.palette.text.primary, 0.4) }, theme.typography.caption));
23
+ return (__assign({ margin: theme.spacing(2.5, 2.5, 1.5, 2.5), color: alpha(theme.palette.text.primary, 0.6) }, theme.typography.caption));
24
24
  });
25
25
  export var MandatoryStyled = styled('span')(function (_a) {
26
26
  var theme = _a.theme;
@@ -1,6 +1,8 @@
1
1
  /// <reference types="react" />
2
+ import { FileDetails } from '../../../../@types';
2
3
  declare type ArticleProps = {
3
4
  show: boolean;
5
+ defaultFile?: FileDetails;
4
6
  };
5
- declare const Article: ({ show }: ArticleProps) => JSX.Element;
7
+ declare const Article: ({ show, defaultFile }: ArticleProps) => JSX.Element;
6
8
  export default Article;
@@ -10,17 +10,16 @@ var __assign = (this && this.__assign) || function () {
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
12
  import { jsx as _jsx } from "react/jsx-runtime";
13
- import React from 'react';
14
13
  import { styled } from '@mui/material/styles';
15
14
  import { ScreenContainer } from '../../../shared/Containers';
16
15
  import { useTranslation } from 'react-i18next';
17
16
  import { useController, useFormContext } from 'react-hook-form';
18
17
  import { useAppDispatch, useAppSelector } from '../../../../hooks';
19
- import { businessSelector, clearArticleId, uploadArticle } from '../../../app/business/businessStore';
20
- import { UploadFile } from '../../../shared/UploadFile';
21
- import { MAX_FILE_SIZE, VALID_FILE_FORMATS } from '../../../../constants';
22
- import { maskFileName } from '../../../../utils';
18
+ import { businessSelector, clearAOAFile, clearError, uploadingArticleStatus } from '../../../app/business/businessStore';
19
+ import { UploadWrapper } from '../../../shared/UploadFile';
20
+ import { FileRemoveType } from '../../../../constants';
23
21
  import Collapse from '../../../../components/Collapse';
22
+ import { DocumentPurpose } from '../../../../@types';
24
23
  var FeatureStyled = styled(ScreenContainer)(function (_a) {
25
24
  var theme = _a.theme;
26
25
  return ({
@@ -28,60 +27,26 @@ var FeatureStyled = styled(ScreenContainer)(function (_a) {
28
27
  });
29
28
  });
30
29
  var Article = function (_a) {
31
- var show = _a.show;
32
- var _b = React.useState(), error = _b[0], setError = _b[1];
33
- var _c = React.useState(0), progress = _c[0], setProgress = _c[1];
30
+ var _b;
31
+ var show = _a.show, defaultFile = _a.defaultFile;
34
32
  var t = useTranslation().t;
35
- var _d = useFormContext(), control = _d.control, setValue = _d.setValue;
36
- var articleFileControl = useController({ name: 'articleFile', control: control });
33
+ var control = useFormContext().control;
37
34
  var articleIdControl = useController({ name: 'articleId', control: control });
38
- var _e = useAppSelector(businessSelector), loading = _e.loading, uploadingArticle = _e.uploadingArticle, sysError = _e.uploadingArticleError, data = _e.data;
35
+ var _c = useAppSelector(businessSelector), loading = _c.loading, error = _c.error, data = _c.data;
39
36
  var dispatch = useAppDispatch();
40
- var articleValue = articleFileControl.field.value;
41
- var businessTypeData = data.businessTypeData;
42
- var articleFile = businessTypeData.articleFile, articleId = businessTypeData.articleId;
43
- React.useEffect(function () {
44
- if (!articleValue) {
45
- setValue('articleFile', articleFile);
46
- setValue('articleId', articleId);
47
- }
48
- }, [articleFile, articleId]);
49
- var handleArticleChange = function (files) {
50
- setError('');
51
- var file = files === null || files === void 0 ? void 0 : files[0];
52
- if (!file)
53
- return;
54
- if (!VALID_FILE_FORMATS.includes(file === null || file === void 0 ? void 0 : file.type)) {
55
- setError('file_not_supported_alert');
56
- return;
57
- }
58
- if ((file === null || file === void 0 ? void 0 : file.size) > MAX_FILE_SIZE) {
59
- setError('file_size_alert');
60
- return;
61
- }
62
- articleFileControl.field.onChange(file);
63
- dispatch(uploadArticle({
64
- file: file,
65
- onProgress: function (value) {
66
- setProgress(value);
67
- }
68
- }));
37
+ var AOA_file = (((_b = data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.entity) || {}).AOA_file;
38
+ var handleArticleChange = function (id) {
39
+ if (error)
40
+ dispatch(clearError());
41
+ articleIdControl.field.onChange(id);
69
42
  };
70
43
  var handleReset = function () {
71
- articleFileControl.field.onChange(undefined);
72
- articleIdControl.field.onChange('');
73
- dispatch(clearArticleId());
74
- setProgress(0);
44
+ if (error)
45
+ dispatch(clearError());
46
+ if (AOA_file)
47
+ dispatch(clearAOAFile());
48
+ articleIdControl.field.onChange(undefined);
75
49
  };
76
- React.useEffect(function () {
77
- if (sysError === 'file_upload_error') {
78
- setError(sysError);
79
- articleFileControl.field.onChange(undefined);
80
- setProgress(0);
81
- }
82
- }, [sysError]);
83
- var fileName = articleValue ? maskFileName(articleValue === null || articleValue === void 0 ? void 0 : articleValue.name) : '';
84
- var errorValue = error || sysError || '';
85
- return (_jsx(Collapse, __assign({ in: show }, { children: _jsx(FeatureStyled, { children: _jsx(UploadFile, { label: t('title_article'), title: t('drag_and_drop'), subTitle: t('subtitle_drop'), dragDescription: t('article_of_association'), uploadingTitle: t('file_uploading_title'), successTitle: t('success_upload_bank_statement'), onFileUploaded: handleArticleChange, isFileUploaded: !uploadingArticle && !!articleValue, isSubmitting: loading, isUploading: uploadingArticle, progress: progress, onReset: handleReset, error: errorValue && t(errorValue), initialFileName: fileName }) }) })));
50
+ return (_jsx(Collapse, __assign({ in: show }, { children: _jsx(FeatureStyled, { children: _jsx(UploadWrapper, { id: 'articleId', fileRemoveType: FileRemoveType.AOA_FILE_ID, control: control, label: t('title_article'), title: t('drag_and_drop'), subTitle: t('subtitle_drop'), dragDescription: t('article_of_association'), uploadingTitle: t('file_uploading_title'), successTitle: t('success_upload_bank_statement'), onFileUploaded: handleArticleChange, isSubmitting: loading, onDeleteFile: handleReset, defaultFile: defaultFile, purpose: DocumentPurpose.ARTICLE_ASSOCIATION, fileUploadingStatus: function (uploading) { return dispatch(uploadingArticleStatus(uploading)); } }) }) })));
86
51
  };
87
52
  export default Article;
@@ -28,7 +28,7 @@ import LicenseList from './LicenseList';
28
28
  var BusinessType = function (_a) {
29
29
  var _b = useAppSelector(businessSelector), data = _b.data, loading = _b.loading, error = _b.error, uploading = _b.uploading, uploadingArticle = _b.uploadingArticle;
30
30
  var settingsData = useAppSelector(settingsSelector).data;
31
- var _c = data.businessTypeData, selectedLicense = _c.selectedLicense, licenseNumber = _c.licenseNumber, entityLegalName = _c.entityLegalName, certificateId = _c.certificateId, articleId = _c.articleId, articleFile = _c.articleFile;
31
+ var _c = data.businessTypeData, selectedLicense = _c.selectedLicense, licenseNumber = _c.licenseNumber, entityLegalName = _c.entityLegalName, certificateId = _c.certificateId, articleId = _c.articleId;
32
32
  var t = useTranslation().t;
33
33
  var isAr = useLanguage().isAr;
34
34
  var dispatch = useAppDispatch();
@@ -41,8 +41,7 @@ var BusinessType = function (_a) {
41
41
  licenseNumber: licenseNumber,
42
42
  entityLegalName: entityLegalName,
43
43
  certificateId: certificateId,
44
- articleId: articleId,
45
- articleFile: articleFile
44
+ articleId: articleId
46
45
  },
47
46
  mode: 'onChange'
48
47
  });
@@ -56,7 +55,8 @@ var BusinessType = function (_a) {
56
55
  selectedLicense: data.selectedLicense,
57
56
  licenseNumber: data.licenseNumber,
58
57
  entityLegalName: data.entityLegalName,
59
- certificateId: data.certificateId
58
+ certificateId: data.certificateId,
59
+ articleId: data.articleId
60
60
  };
61
61
  dispatch(updateLeadBusinessType(dataValues));
62
62
  };
@@ -141,7 +141,7 @@ var LicenseList = function (_a) {
141
141
  var licenseReadonly = !isOtherLicense(selected);
142
142
  var isCR = (selected === null || selected === void 0 ? void 0 : selected.type) === BusinessType.CR;
143
143
  var flValue = isOtherLicense(selected) ? t(getLicenseName(selected)) : getLicenseNumber(selected);
144
- return (_jsxs(ScreenContainer, { children: [_jsxs(Collapse, __assign({ in: isSACountry }, { children: [_jsx(InputStyled, { label: t('choose_any_license'), readOnly: true, onClick: !!anchorEl ? function () { return onCloseLicenseList(); } : onOpenLicenseList, endAdornment: _jsx(ExpandIcon, { anchorEl: !!anchorEl }), placeholder: t('choose_license_cr'), value: isCR ? t(getLicenseName(selected)) : flValue }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleList, { searchKeyPath: 'legal_name?.en', list: licenseList || [], onSelectItem: onSelectItem, renderItem: function (item) {
144
+ return (_jsxs(ScreenContainer, { children: [_jsxs(Collapse, __assign({ in: isSACountry }, { children: [_jsx(InputStyled, { label: t('choose_any_license'), onClick: !!anchorEl ? function () { return onCloseLicenseList(); } : onOpenLicenseList, endAdornment: _jsx(ExpandIcon, { anchorEl: !!anchorEl }), placeholder: t('choose_license_cr'), value: isCR ? t(getLicenseName(selected)) : flValue }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleList, { searchKeyPath: 'legal_name?.en', list: licenseList || [], onSelectItem: onSelectItem, renderItem: function (item) {
145
145
  return (_jsxs(_Fragment, { children: [_jsx(LicenseContainer, { children: _jsx(LicenseNameText, __assign({ isSelected: getLicenseNumber(item) === getLicenseNumber(selected) }, { children: isOtherLicense(item) ? t(getLicenseName(item)) : getLicenseFullName(item) })) }), getLicenseNumber(item) === getLicenseNumber(selected) && _jsx(CheckIcon, {})] }));
146
146
  } }) }))] })), _jsx(LicenseType, { show: show && !isSACountry }), _jsx(EntityName, { show: show && !isSACountry && isCR }), _jsx(LicenseNumber, { show: !isSACountry ? isCR : show, readOnly: licenseReadonly }), _jsx(LicenseCertificate, { show: show && !isSACountry && isCR }), _jsx(Article, { show: show && !isSACountry && isCR })] }));
147
147
  };
@@ -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 '../../../../components/Input';
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
- export var InputStyled = styled(Input)(function (_a) {
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
  });
@@ -136,7 +136,7 @@ var customerLocations = function (_a) {
136
136
  };
137
137
  var customerLocationsValue = customerLocationsControl.field.value;
138
138
  var customerLocationSelected = customerLocationsValue === null || customerLocationsValue === void 0 ? void 0 : customerLocationsValue[0];
139
- return (_jsx(Collapse, __assign({ in: rest.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: true, placeholder: t('choose_expected_sales'), value: (isAr ? customerLocationSelected === null || customerLocationSelected === void 0 ? void 0 : customerLocationSelected.name.ar : customerLocationSelected === null || customerLocationSelected === void 0 ? void 0 : customerLocationSelected.name.en) || '', 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.en', list: customerLocationsList, placeholder: 'choose_customer_base', onSelectItem: onSelectItem, renderItem: function (item) {
139
+ return (_jsx(Collapse, __assign({ in: rest.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, { placeholder: t('choose_expected_sales'), value: (isAr ? customerLocationSelected === null || customerLocationSelected === void 0 ? void 0 : customerLocationSelected.name.ar : customerLocationSelected === null || customerLocationSelected === void 0 ? void 0 : customerLocationSelected.name.en) || '', 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.en', list: customerLocationsList, placeholder: 'choose_customer_base', onSelectItem: onSelectItem, renderItem: function (item) {
140
140
  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, {})] }));
141
141
  } })] }))] }) })));
142
142
  };
@@ -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, InputStyled, NameContainer } from './CustomerLocations';
34
+ import { CheckIconStyled, InputLabelStyled, NameContainer } from './CustomerLocations';
35
35
  import { businessSelector, clearError } from '../../../app/business/businessStore';
36
36
  import Search from '../../../../features/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 ({
@@ -90,7 +100,7 @@ var ExpectedCustomers = function (_a) {
90
100
  };
91
101
  var expectedCustomersValue = expectedCustomerControl.field.value;
92
102
  var expectedCustomersSelected = expectedCustomersValue;
93
- return (_jsx(Collapse, __assign({ in: rest.show }, { children: _jsxs(ScreenContainer, { children: [_jsx(InputLabelStyled, { children: t('expected_customers_to_serve') }), _jsx(InputStyled, { readOnly: true, placeholder: t('choose_expected_sales'), value: (isAr ? expectedCustomersSelected === null || expectedCustomersSelected === void 0 ? void 0 : expectedCustomersSelected.name.ar : expectedCustomersSelected === null || expectedCustomersSelected === void 0 ? void 0 : expectedCustomersSelected.name.en) || '', 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) {
103
+ return (_jsx(Collapse, __assign({ in: rest.show }, { children: _jsxs(ScreenContainer, { children: [_jsx(InputLabelStyled, { children: t('expected_customers_to_serve') }), _jsx(InputStyled, { placeholder: t('choose_expected_sales'), value: (isAr ? expectedCustomersSelected === null || expectedCustomersSelected === void 0 ? void 0 : expectedCustomersSelected.name.ar : expectedCustomersSelected === null || expectedCustomersSelected === void 0 ? void 0 : expectedCustomersSelected.name.en) || '', 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) {
94
104
  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, {})] }));
95
105
  } })] }))] }) })));
96
106
  };