@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
|
@@ -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 { resendOTP } from '../../../app/brand/brandStore';
|
|
20
|
+
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
21
|
+
import { brandSelector, resendOTP } from '../../../app/brand/brandStore';
|
|
22
|
+
import { isTokenExpired } from '../../../../utils';
|
|
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(brandSelector).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);
|
|
@@ -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 '
|
|
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
|
-
|
|
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, {
|
|
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.
|
|
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;
|
|
@@ -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'),
|
|
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 '
|
|
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
|
});
|
|
@@ -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, {
|
|
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,
|
|
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, {
|
|
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
|
};
|
|
@@ -22,9 +22,19 @@ import ExpandIcon from '../../../../components/ExpandIcon';
|
|
|
22
22
|
import { businessSelector, clearError } from '../../../app/business/businessStore';
|
|
23
23
|
import { findCurrencyByIso2, isExist } from '../../../../utils';
|
|
24
24
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
25
|
-
import { InputLabelStyled, CheckIconStyled,
|
|
25
|
+
import { InputLabelStyled, CheckIconStyled, NameContainer } from './CustomerLocations';
|
|
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 ({
|
|
@@ -112,7 +122,7 @@ var ExpectedSalesRange = function (_a) {
|
|
|
112
122
|
}, [anchorEl, expectedSalesRangeValue]);
|
|
113
123
|
return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, { children: [_jsx(InputLabelStyled, { children: t('expected_sales_monthly', {
|
|
114
124
|
currency: t(findCurrencyByIso2(countryCode.iso2))
|
|
115
|
-
}) }), _jsx(InputStyled, {
|
|
125
|
+
}) }), _jsx(InputStyled, { value: (isAr ? expectedSalesRangeValue === null || expectedSalesRangeValue === void 0 ? void 0 : expectedSalesRangeValue.name.ar : expectedSalesRangeValue === null || expectedSalesRangeValue === void 0 ? void 0 : expectedSalesRangeValue.name.en) || '', onClick: !!anchorEl ? handleCloseMainMenu : handleOpenMainMenu, placeholder: t('choose_expected_sales'), endAdornment: _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) {
|
|
116
126
|
var isOnlyOneItem = !item.sub || item.sub.length === 1;
|
|
117
127
|
if (isOnlyOneItem)
|
|
118
128
|
onSelectItem(item);
|
|
@@ -21,7 +21,7 @@ import { ScreenContainer } from '../../../shared/Containers';
|
|
|
21
21
|
import { businessSelector, clearError } from '../../../app/business/businessStore';
|
|
22
22
|
var InputLabelStyled = styled(Text)(function (_a) {
|
|
23
23
|
var theme = _a.theme;
|
|
24
|
-
return (__assign(__assign({ color: alpha(theme.palette.text.primary, 0.
|
|
24
|
+
return (__assign(__assign({ color: alpha(theme.palette.text.primary, 0.6) }, theme.typography.caption), { cursor: 'pointer' }));
|
|
25
25
|
});
|
|
26
26
|
var BOD = function (_a) {
|
|
27
27
|
var _b;
|
|
@@ -11,14 +11,15 @@ var __assign = (this && this.__assign) || function () {
|
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
import * as React from 'react';
|
|
14
|
-
import { useAppDispatch } from '../../../../hooks';
|
|
14
|
+
import { useAppDispatch, useAppSelector } from '../../../../hooks';
|
|
15
15
|
import Box from '@mui/material/Box/Box';
|
|
16
16
|
import { styled } from '@mui/material/styles';
|
|
17
17
|
import OTPField from '../../../shared/OTP';
|
|
18
18
|
import { useController, useFormContext } from 'react-hook-form';
|
|
19
19
|
import { useTranslation } from 'react-i18next';
|
|
20
20
|
import { DEFAULT_TIMER_VALUE } from '../../../../constants';
|
|
21
|
-
import {
|
|
21
|
+
import { isTokenExpired } from '../../../../utils';
|
|
22
|
+
import { businessSelector, resendOTP } from '../../../app/business/businessStore';
|
|
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(businessSelector).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);
|
|
@@ -99,7 +99,7 @@ var BrandList = function (_a) {
|
|
|
99
99
|
}), { shouldValidate: true });
|
|
100
100
|
onCloseBrandList();
|
|
101
101
|
};
|
|
102
|
-
return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, { children: [_jsx(InputStyled, { label: t('select_brand_label'),
|
|
102
|
+
return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, { children: [_jsx(InputStyled, { label: t('select_brand_label'), onClick: !!anchorEl ? onCloseBrandList : onOpenBrandList, endAdornment: _jsx(ExpandIcon, { anchorEl: !!anchorEl }), placeholder: t('choose_brand'), value: t(getBrandName(selectedBrand)) }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleList, { searchKeyPath: 'id', list: list, onSelectItem: onSelectItem, renderItem: function (item) {
|
|
103
103
|
return (_jsxs(_Fragment, { children: [_jsx(BrandContainer, { children: _jsx(BrandNameText, __assign({ isSelected: getBrandId(item) === getBrandId(selectedBrand) }, { children: isOtherBrand(item) ? t(getBrandName(item)) : getBrandName(item) })) }), getBrandId(item) === getBrandId(selectedBrand) && _jsx(CheckIcon, {})] }));
|
|
104
104
|
} }) }))] }) })));
|
|
105
105
|
};
|
|
@@ -24,6 +24,11 @@ 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 () { return ({
|
|
28
|
+
'& .MuiInputBase-input': {
|
|
29
|
+
cursor: 'pointer'
|
|
30
|
+
}
|
|
31
|
+
}); });
|
|
27
32
|
var IncomeText = styled(Text, { shouldForwardProp: function (prop) { return prop !== 'isSelected'; } })(function (_a) {
|
|
28
33
|
var theme = _a.theme, isSelected = _a.isSelected;
|
|
29
34
|
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' }));
|
|
@@ -66,7 +71,7 @@ var Segments = function (_a) {
|
|
|
66
71
|
onCloseList();
|
|
67
72
|
segmentControl.field.onChange(segment);
|
|
68
73
|
};
|
|
69
|
-
return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, __assign({ sx: { mt: 2.5, mb: 0 } }, { children: [_jsx(
|
|
74
|
+
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'), 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) {
|
|
70
75
|
var _a, _b;
|
|
71
76
|
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, {})] }));
|
|
72
77
|
} }) }))] })) })));
|
|
@@ -24,6 +24,11 @@ import ExpandIcon from '../../../../components/ExpandIcon';
|
|
|
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 () { return ({
|
|
28
|
+
'& .MuiInputBase-input': {
|
|
29
|
+
cursor: 'pointer'
|
|
30
|
+
}
|
|
31
|
+
}); });
|
|
27
32
|
var IncomeText = styled(Text, { shouldForwardProp: function (prop) { return prop !== 'isSelected'; } })(function (_a) {
|
|
28
33
|
var theme = _a.theme, isSelected = _a.isSelected;
|
|
29
34
|
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' }));
|
|
@@ -66,7 +71,7 @@ var TeamSize = function (_a) {
|
|
|
66
71
|
onCloseList();
|
|
67
72
|
teamSizeControl.field.onChange(teamSize);
|
|
68
73
|
};
|
|
69
|
-
return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, __assign({ sx: { mt: 2.5, mb: 0 } }, { children: [_jsx(
|
|
74
|
+
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'), 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.en', 'name.ar'], list: teamSizeList, onSelectItem: onSelectItem, renderItem: function (item) {
|
|
70
75
|
var _a, _b;
|
|
71
76
|
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, {})] }));
|
|
72
77
|
} }) }))] })) })));
|
|
@@ -64,7 +64,7 @@ var Brand = function (_a) {
|
|
|
64
64
|
var onSelectItem = function (brand) {
|
|
65
65
|
selectedBrandControl.field.onChange(brand);
|
|
66
66
|
};
|
|
67
|
-
return (_jsxs(ScreenContainer, { children: [_jsx(InputStyled, { label: t('select_brand_label'),
|
|
67
|
+
return (_jsxs(ScreenContainer, { children: [_jsx(InputStyled, { label: t('select_brand_label'), onClick: !!anchorEl ? onCloseBrandList : onOpenBrandList, endAdornment: _jsx(ExpandIcon, { anchorEl: !!anchorEl }), placeholder: t('choose_brand'), value: t(getBrandName(selectedBrand)) }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleList, { searchKeyPath: 'id', list: [], onSelectItem: onSelectItem, renderItem: function (item) {
|
|
68
68
|
return (_jsxs(_Fragment, { children: [_jsx(BrandContainer, { children: _jsx(BrandNameText, __assign({ isSelected: getBrandId(item) === getBrandId(selectedBrand) }, { children: isOtherBrand(item) ? t(getBrandName(item)) : getBrandName(item) })) }), getBrandId(item) === getBrandId(selectedBrand) && _jsx(CheckIcon, {})] }));
|
|
69
69
|
} }) }))] }));
|
|
70
70
|
};
|
|
@@ -42,11 +42,11 @@ import { connectExpressSelector, clearError } from '../../../app/connectExpress/
|
|
|
42
42
|
import LicenseNumber from './LicenseNumber';
|
|
43
43
|
import LicenseType from './LicenseType';
|
|
44
44
|
var InputStyled = styled(Input)(function (_a) {
|
|
45
|
-
var theme = _a.theme;
|
|
45
|
+
var theme = _a.theme, readOnly = _a.readOnly;
|
|
46
46
|
return ({
|
|
47
47
|
marginBottom: theme.spacing(2.5),
|
|
48
48
|
'& .MuiInputBase-input': {
|
|
49
|
-
cursor: 'pointer'
|
|
49
|
+
cursor: readOnly ? 'default' : 'pointer'
|
|
50
50
|
}
|
|
51
51
|
});
|
|
52
52
|
});
|
|
@@ -139,7 +139,7 @@ var LicenseList = function (_a) {
|
|
|
139
139
|
var licenseReadonly = !isOtherLicense(selected);
|
|
140
140
|
var isCR = (selected === null || selected === void 0 ? void 0 : selected.type) === BusinessType.CR;
|
|
141
141
|
var flValue = isOtherLicense(selected) ? t(getLicenseName(selected)) : getLicenseNumber(selected);
|
|
142
|
-
return (_jsxs(ScreenContainer, { children: [_jsxs(Collapse, __assign({ in: isSACountry }, { children: [_jsx(InputStyled, { label: t('choose_any_license'), readOnly:
|
|
142
|
+
return (_jsxs(ScreenContainer, { children: [_jsxs(Collapse, __assign({ in: isSACountry }, { children: [_jsx(InputStyled, { label: t('choose_any_license'), readOnly: readOnly, 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) {
|
|
143
143
|
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, {})] }));
|
|
144
144
|
} }) }))] })), _jsx(LicenseType, { show: show && !isSACountry, readOnly: readOnly }), _jsx(LicenseNumber, { show: !isSACountry ? isCR : show, readOnly: licenseReadonly })] }));
|
|
145
145
|
};
|
|
@@ -91,6 +91,6 @@ var LicenseType = function (_a) {
|
|
|
91
91
|
};
|
|
92
92
|
var selectedLicenseValue = selectedLicenseControl.field.value;
|
|
93
93
|
var isFL = (selectedLicenseValue === null || selectedLicenseValue === void 0 ? void 0 : selectedLicenseValue.type) === BusinessType.FL;
|
|
94
|
-
return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, __assign({ sx: { pb: isFL ? 9.5 : 1.5, pl: 2.5, pr: 2.5 } }, { children: [_jsxs(LabelTextStyled, { children: [t('signup_business_type_label'), _jsx(Mandatory, {})] }), _jsxs(RadioGroupStyled, __assign({ value: selectedLicenseValue != null ? ((selectedLicenseValue === null || selectedLicenseValue === void 0 ? void 0 : selectedLicenseValue.type) === BusinessType.FL ? BusinessType.FL : BusinessType.CR) : false, onChange: handleOnChange }, { children: [_jsx(RadioLabel, { value: BusinessType.FL, label: _jsxs(LabelStyled, { children: [t('homemaker_reg'), _jsx(Tooltip, __assign({ title: t('homemaker_reg_hint'), onMouseOver: function () { return setIsFLHovered(true); }, onMouseLeave: function () { return setIsFLHovered(false); }, onTouchStartCapture: function () { return setIsFLHovered(true); } }, { children: isFLHovered ? _jsx(InfoIconStyled, {}) : _jsx(InfoOutlinedIconStyled, {}) }))] }), control: _jsx(RadioStyled, { color: 'primary', disableFocusRipple: true, disableRipple: true, disableTouchRipple: true, focusRipple: false }) }), _jsx(RadioLabel, { value: BusinessType.CR, sx: { marginInlineEnd: '0px' }, label: _jsxs(LabelStyled, { children: [t('commercial_reg'), _jsx(Tooltip, __assign({ title: t('commercial_reg_hint'), onMouseOver: function () { return setIsCRHovered(true); }, onMouseLeave: function () { return setIsCRHovered(false); }, onTouchStartCapture: function () { return setIsCRHovered(true); } }, { children: isCRHovered ? _jsx(InfoIconStyled, {}) : _jsx(InfoOutlinedIconStyled, {}) }))] }), control: _jsx(RadioStyled, { color: 'primary', disableFocusRipple: true, disableRipple: true, disableTouchRipple: true, focusRipple: false }) })] }))] })) })));
|
|
94
|
+
return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, __assign({ sx: { pb: isFL ? 9.5 : 1.5, pl: 2.5, pr: 2.5 } }, { children: [_jsxs(LabelTextStyled, { children: [t('signup_business_type_label'), _jsx(Mandatory, {})] }), _jsxs(RadioGroupStyled, __assign({ readOnly: readOnly, value: selectedLicenseValue != null ? ((selectedLicenseValue === null || selectedLicenseValue === void 0 ? void 0 : selectedLicenseValue.type) === BusinessType.FL ? BusinessType.FL : BusinessType.CR) : false, onChange: handleOnChange }, { children: [_jsx(RadioLabel, { value: BusinessType.FL, label: _jsxs(LabelStyled, { children: [t('homemaker_reg'), _jsx(Tooltip, __assign({ title: t('homemaker_reg_hint'), onMouseOver: function () { return setIsFLHovered(true); }, onMouseLeave: function () { return setIsFLHovered(false); }, onTouchStartCapture: function () { return setIsFLHovered(true); } }, { children: isFLHovered ? _jsx(InfoIconStyled, {}) : _jsx(InfoOutlinedIconStyled, {}) }))] }), control: _jsx(RadioStyled, { color: 'primary', disableFocusRipple: true, disableRipple: true, disableTouchRipple: true, focusRipple: false }) }), _jsx(RadioLabel, { value: BusinessType.CR, sx: { marginInlineEnd: '0px' }, label: _jsxs(LabelStyled, { children: [t('commercial_reg'), _jsx(Tooltip, __assign({ title: t('commercial_reg_hint'), onMouseOver: function () { return setIsCRHovered(true); }, onMouseLeave: function () { return setIsCRHovered(false); }, onTouchStartCapture: function () { return setIsCRHovered(true); } }, { children: isCRHovered ? _jsx(InfoIconStyled, {}) : _jsx(InfoOutlinedIconStyled, {}) }))] }), control: _jsx(RadioStyled, { color: 'primary', disableFocusRipple: true, disableRipple: true, disableTouchRipple: true, focusRipple: false }) })] }))] })) })));
|
|
95
95
|
};
|
|
96
96
|
export default LicenseType;
|
|
@@ -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;
|
|
@@ -24,14 +24,11 @@ import Text from '../../../../components/Text';
|
|
|
24
24
|
import Warning from '../../../../components/Warning';
|
|
25
25
|
import Collapse from '../../../../components/Collapse';
|
|
26
26
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
27
|
-
var TACContainerStyled = styled(Box)(function (_a) {
|
|
28
|
-
var theme = _a.theme;
|
|
29
|
-
return ({
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
alignItems: 'center',
|
|
33
|
-
paddingInlineStart: theme.spacing(2.5)
|
|
34
|
-
});
|
|
27
|
+
export var TACContainerStyled = styled(Box, { shouldForwardProp: function (prop) { return prop !== 'readOnly'; } })(function (_a) {
|
|
28
|
+
var theme = _a.theme, readOnly = _a.readOnly;
|
|
29
|
+
return (__assign({ display: 'flex', flexDirection: 'row', alignItems: 'center', paddingInlineStart: theme.spacing(2.5) }, (readOnly && {
|
|
30
|
+
opacity: '0.6'
|
|
31
|
+
})));
|
|
35
32
|
});
|
|
36
33
|
var TextStyled = styled(Text)(function (_a) {
|
|
37
34
|
var theme = _a.theme;
|
|
@@ -80,6 +77,6 @@ var TAC = function (_a) {
|
|
|
80
77
|
return;
|
|
81
78
|
tacControl.field.onChange(checked);
|
|
82
79
|
};
|
|
83
|
-
return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, __assign({ sx: { mt: 2.5 } }, { children: [_jsxs(TACContainerStyled, { children: [_jsx(CheckboxStyled, { 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) })) }))] })) })));
|
|
80
|
+
return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, __assign({ sx: { mt: 2.5 } }, { children: [_jsxs(TACContainerStyled, __assign({ readOnly: readOnly }, { children: [_jsx(CheckboxStyled, { 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) })) }))] })) })));
|
|
84
81
|
};
|
|
85
82
|
export default React.memo(TAC);
|
|
@@ -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;
|
|
@@ -24,14 +24,11 @@ import Text from '../../../../components/Text';
|
|
|
24
24
|
import Warning from '../../../../components/Warning';
|
|
25
25
|
import Collapse from '../../../../components/Collapse';
|
|
26
26
|
import { ScreenContainer } from '../../../shared/Containers';
|
|
27
|
-
var TACContainerStyled = styled(Box)(function (_a) {
|
|
28
|
-
var theme = _a.theme;
|
|
29
|
-
return ({
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
alignItems: 'center',
|
|
33
|
-
paddingInlineStart: theme.spacing(2.5)
|
|
34
|
-
});
|
|
27
|
+
export var TACContainerStyled = styled(Box, { shouldForwardProp: function (prop) { return prop !== 'readOnly'; } })(function (_a) {
|
|
28
|
+
var theme = _a.theme, readOnly = _a.readOnly;
|
|
29
|
+
return (__assign({ display: 'flex', flexDirection: 'row', alignItems: 'center', paddingInlineStart: theme.spacing(2.5) }, (readOnly && {
|
|
30
|
+
opacity: '0.6'
|
|
31
|
+
})));
|
|
35
32
|
});
|
|
36
33
|
var TextStyled = styled(Text)(function (_a) {
|
|
37
34
|
var theme = _a.theme;
|
|
@@ -80,6 +77,6 @@ var TAC = function (_a) {
|
|
|
80
77
|
return;
|
|
81
78
|
tacControl.field.onChange(checked);
|
|
82
79
|
};
|
|
83
|
-
return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, __assign({ sx: { mt: 2.5 } }, { children: [_jsxs(TACContainerStyled, { children: [_jsx(CheckboxStyled, { 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) })) }))] })) })));
|
|
80
|
+
return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, __assign({ sx: { mt: 2.5 } }, { children: [_jsxs(TACContainerStyled, __assign({ readOnly: readOnly }, { children: [_jsx(CheckboxStyled, { 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) })) }))] })) })));
|
|
84
81
|
};
|
|
85
82
|
export default React.memo(TAC);
|
|
@@ -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;
|