@tap-payments/auth-jsconnect 1.0.11 → 1.0.16
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/assets/locales/ar.json +200 -88
- package/build/assets/locales/en.json +216 -90
- package/build/components/DatePicker/DatePicker.js +6 -17
- package/build/components/ExpandIcon/ExpandIcon.d.ts +7 -0
- package/build/components/ExpandIcon/ExpandIcon.js +24 -0
- package/build/components/ExpandIcon/index.d.ts +2 -0
- package/build/components/ExpandIcon/index.js +2 -0
- package/build/components/Footer/Footer.js +1 -1
- package/build/components/Loader/Loader.js +2 -2
- package/build/components/Warning/Warning.d.ts +1 -2
- package/build/components/Warning/Warning.js +1 -2
- package/build/constants/app.d.ts +1 -1
- package/build/constants/app.js +32 -8
- package/build/constants/dummy.js +3 -3
- package/build/features/bank/screens/BankDetails/BankName.js +1 -1
- package/build/features/bank/screens/BankDetails/Beneficiary.js +5 -5
- package/build/features/bank/screens/BankDetails/IBAN.js +3 -3
- package/build/features/bank/screens/BankDetails/validation.js +9 -4
- package/build/features/bank/screens/Success/Success.d.ts +5 -0
- package/build/features/bank/screens/Success/Success.js +14 -0
- package/build/features/bank/screens/Success/index.d.ts +3 -0
- package/build/features/bank/screens/Success/index.js +2 -0
- package/build/features/business/screens/Activities/ActivitiesList.d.ts +0 -16
- package/build/features/business/screens/Activities/ActivitiesList.js +3 -17
- package/build/features/business/screens/Activities/OperationStartDate.js +1 -1
- package/build/features/business/screens/Activities/SalesChannels.js +1 -1
- package/build/features/business/screens/Activities/validation.js +3 -3
- package/build/features/business/screens/BusinessType/CRNumber.js +2 -1
- package/build/features/business/screens/BusinessType/CompanyLicense.js +2 -2
- package/build/features/business/screens/BusinessType/FLNumber.js +2 -1
- package/build/features/business/screens/BusinessType/FreelanceLicense.js +2 -2
- package/build/features/business/screens/BusinessType/SelectType.js +1 -1
- package/build/features/business/screens/BusinessType/validation.js +2 -8
- package/build/features/business/screens/Confirm/Confirm.js +1 -1
- package/build/features/business/screens/Customers/CustomerLocations.d.ts +0 -24
- package/build/features/business/screens/Customers/CustomerLocations.js +3 -17
- package/build/features/business/screens/Customers/Customers.js +5 -41
- package/build/features/business/screens/Customers/ExpectedCustomers.js +7 -11
- package/build/features/business/screens/Customers/ExpectedSalesRange.js +7 -6
- package/build/features/business/screens/Customers/RefundPolicy.d.ts +0 -8
- package/build/features/business/screens/Customers/RefundPolicy.js +2 -10
- package/build/features/business/screens/Customers/TransactionPolicy.js +3 -2
- package/build/features/business/screens/Customers/validation.d.ts +6 -6
- package/build/features/business/screens/Customers/validation.js +10 -5
- package/build/features/business/screens/IDBOD/DOB.js +3 -11
- package/build/features/business/screens/IDBOD/ID.js +1 -1
- package/build/features/business/screens/IDBOD/validation.js +7 -2
- package/build/features/business/screens/OTP/OTP.js +18 -58
- package/build/features/business/screens/OTP/OTPInput.js +9 -21
- package/build/features/business/screens/OTP/validation.js +1 -1
- package/build/features/business/screens/Success/Success.js +1 -2
- package/build/features/business/screens/VerifyNumber/OTPInput.d.ts +1 -2
- package/build/features/business/screens/VerifyNumber/OTPInput.js +13 -42
- package/build/features/business/screens/VerifyNumber/VerifyNumber.js +20 -66
- package/build/features/business/screens/VerifyNumber/validation.js +1 -1
- package/build/features/connect/screens/Individual/Email.js +7 -1
- package/build/features/connect/screens/Individual/Individual.js +0 -28
- package/build/features/connect/screens/Individual/Name.js +9 -3
- package/build/features/connect/screens/Individual/validation.js +5 -2
- package/build/features/connect/screens/MID/BusinessCountry.d.ts +1 -0
- package/build/features/connect/screens/MID/BusinessCountry.js +2 -2
- package/build/features/connect/screens/MID/DOB.d.ts +6 -0
- package/build/features/connect/screens/MID/DOB.js +38 -0
- package/build/features/connect/screens/MID/IDNumber.js +3 -14
- package/build/features/connect/screens/MID/MID.js +13 -7
- package/build/features/connect/screens/MID/MobileNumber.d.ts +1 -0
- package/build/features/connect/screens/MID/MobileNumber.js +34 -10
- package/build/features/connect/screens/MID/validation.d.ts +1 -1
- package/build/features/connect/screens/MID/validation.js +9 -4
- package/build/features/connect/screens/Merchant/BrandName.js +3 -1
- package/build/features/connect/screens/Merchant/SocialMedia.js +7 -2
- package/build/features/connect/screens/Merchant/TAC.js +1 -1
- package/build/features/connect/screens/Merchant/validation.d.ts +9 -9
- package/build/features/connect/screens/Merchant/validation.js +42 -11
- package/build/features/connect/screens/OTP/OTP.js +4 -3
- package/build/features/connect/screens/OTP/OTPInput.js +2 -1
- package/build/features/connect/screens/OTP/validation.js +1 -1
- package/build/features/connect/screens/Password/PasswordInput.js +2 -1
- package/build/features/connect/screens/Password/validation.js +1 -1
- package/build/features/connect/screens/ThankYou/ThankYou.js +1 -2
- package/build/features/featuresScreens.d.ts +1 -1
- package/build/features/featuresScreens.js +27 -7
- package/build/features/individual/Individual.d.ts +6 -0
- package/build/features/individual/Individual.js +50 -0
- package/build/features/individual/index.d.ts +1 -0
- package/build/features/individual/index.js +1 -0
- package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.d.ts +8 -0
- package/build/features/individual/screens/AdditionalIndividualInfo/AdditionalIndividualInfo.js +81 -0
- package/build/features/individual/screens/AdditionalIndividualInfo/EmployerLocation.d.ts +10 -0
- package/build/features/individual/screens/AdditionalIndividualInfo/EmployerLocation.js +81 -0
- package/build/features/individual/screens/AdditionalIndividualInfo/EmployerName.d.ts +6 -0
- package/build/features/individual/screens/AdditionalIndividualInfo/EmployerName.js +40 -0
- package/build/features/individual/screens/AdditionalIndividualInfo/InfluencerSwitch.d.ts +6 -0
- package/build/features/individual/screens/AdditionalIndividualInfo/InfluencerSwitch.js +45 -0
- package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.d.ts +6 -0
- package/build/features/individual/screens/AdditionalIndividualInfo/MonthlyIncome.js +36 -0
- package/build/features/individual/screens/AdditionalIndividualInfo/PEPSwitch.d.ts +6 -0
- package/build/features/individual/screens/AdditionalIndividualInfo/PEPSwitch.js +45 -0
- package/build/features/individual/screens/AdditionalIndividualInfo/SourceOfIncome.d.ts +9 -0
- package/build/features/individual/screens/AdditionalIndividualInfo/SourceOfIncome.js +87 -0
- package/build/features/individual/screens/AdditionalIndividualInfo/index.d.ts +3 -0
- package/build/features/individual/screens/AdditionalIndividualInfo/index.js +2 -0
- package/build/features/individual/screens/AdditionalIndividualInfo/validation.d.ts +25 -0
- package/build/features/individual/screens/AdditionalIndividualInfo/validation.js +35 -0
- package/build/features/individual/screens/ShowIndividualInfo/ShowOwnerInfo.d.ts +19 -0
- package/build/features/individual/screens/ShowIndividualInfo/ShowOwnerInfo.js +52 -0
- package/build/features/individual/screens/ShowIndividualInfo/index.d.ts +3 -0
- package/build/features/individual/screens/ShowIndividualInfo/index.js +2 -0
- package/build/features/individual/screens/ShowIndividualInfo/info.d.ts +7 -0
- package/build/features/individual/screens/ShowIndividualInfo/info.js +28 -0
- package/build/features/individual/screens/Success/Success.d.ts +5 -0
- package/build/features/individual/screens/Success/Success.js +14 -0
- package/build/features/individual/screens/Success/index.d.ts +3 -0
- package/build/features/individual/screens/Success/index.js +2 -0
- package/build/features/owner/screens/AdditionalOwnerInfo/AdditionalOwnerInfo.js +1 -1
- package/build/features/owner/screens/AdditionalOwnerInfo/EmployerLocation.js +1 -1
- package/build/features/owner/screens/AdditionalOwnerInfo/EmployerName.js +7 -2
- package/build/features/owner/screens/AdditionalOwnerInfo/InfluencerSwitch.js +1 -1
- package/build/features/owner/screens/AdditionalOwnerInfo/MonthlyIncome.js +1 -1
- package/build/features/owner/screens/AdditionalOwnerInfo/PEPSwitch.js +1 -1
- package/build/features/owner/screens/AdditionalOwnerInfo/SourceOfIncome.js +1 -1
- package/build/features/owner/screens/AdditionalOwnerInfo/validation.js +6 -3
- package/build/features/owner/screens/ShowOwnerInfo/ShowOwnerInfo.js +1 -1
- package/build/features/owner/screens/Success/Success.d.ts +5 -0
- package/build/features/owner/screens/Success/Success.js +14 -0
- package/build/features/owner/screens/Success/index.d.ts +3 -0
- package/build/features/owner/screens/Success/index.js +2 -0
- package/build/features/password/Password.js +2 -2
- package/build/features/password/screens/CreatePassword/ConfirmPassword.d.ts +4 -1
- package/build/features/password/screens/CreatePassword/ConfirmPassword.js +3 -8
- package/build/features/password/screens/CreatePassword/Password.js +2 -1
- package/build/features/password/screens/CreatePassword/validation.js +3 -3
- package/build/features/password/screens/Success/Success.d.ts +5 -0
- package/build/features/password/screens/Success/Success.js +14 -0
- package/build/features/password/screens/Success/index.d.ts +3 -0
- package/build/features/password/screens/Success/index.js +2 -0
- package/build/features/shared/Button/Button.js +7 -1
- package/build/features/shared/Footer/Footer.js +1 -1
- package/build/features/shared/SuccessScreen/SuccessScreen.js +10 -1
- package/build/features/tax/screens/Success/Success.d.ts +5 -0
- package/build/features/tax/screens/Success/Success.js +14 -0
- package/build/features/tax/screens/Success/index.d.ts +3 -0
- package/build/features/tax/screens/Success/index.js +2 -0
- package/build/features/tax/screens/TaxDetails/VATId.js +3 -4
- package/build/features/tax/screens/TaxDetails/validation.js +1 -1
- package/build/index.css +105 -3
- package/build/index.d.ts +3 -3
- package/build/index.js +4 -4
- package/build/theme/typography.js +2 -2
- package/build/utils/string.js +2 -2
- package/package.json +120 -120
- package/build/features/business/screens/OTP/OTPTimer.d.ts +0 -5
- package/build/features/business/screens/OTP/OTPTimer.js +0 -20
- package/build/features/business/screens/VerifyNumber/OTPTimer.d.ts +0 -5
- package/build/features/business/screens/VerifyNumber/OTPTimer.js +0 -20
|
@@ -15,13 +15,13 @@ var FeatureStyled = styled(ScreenContainer)(function (_a) {
|
|
|
15
15
|
});
|
|
16
16
|
});
|
|
17
17
|
var IBAN = function () {
|
|
18
|
-
var _a;
|
|
18
|
+
var _a, _b;
|
|
19
19
|
var t = useTranslation().t;
|
|
20
20
|
var control = useFormContext().control;
|
|
21
21
|
var ibanControl = useController({ name: 'iban', control: control });
|
|
22
22
|
var ibanValue = ibanControl.field.value;
|
|
23
23
|
var hasError = !!((_a = ibanControl.fieldState.error) === null || _a === void 0 ? void 0 : _a.message);
|
|
24
|
-
var
|
|
24
|
+
var error = (_b = ibanControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
|
|
25
25
|
var handleIbanChange = function (_a) {
|
|
26
26
|
var target = _a.target;
|
|
27
27
|
var value = removeAllOtherThanCharsAndNumber(target.value);
|
|
@@ -30,6 +30,6 @@ var IBAN = function () {
|
|
|
30
30
|
var clearValue = function () {
|
|
31
31
|
ibanControl.field.onChange('');
|
|
32
32
|
};
|
|
33
|
-
return (_jsx(FeatureStyled, { children: _jsx(Input, { label: t('
|
|
33
|
+
return (_jsx(FeatureStyled, { children: _jsx(Input, { label: t('enter_iban'), inputProps: { maxLength: MAX_IBAN_VALUE }, onChange: handleIbanChange, value: ibanValue, placeholder: t('enter_iban_placeholder'), warningType: 'alert', warningMessage: error && t(error), required: true, endAdornment: !hasError && ibanValue ? _jsx(CheckIcon, {}) : ibanValue && _jsx(ClearIcon, { onClick: clearValue }) }) }));
|
|
34
34
|
};
|
|
35
35
|
export default IBAN;
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import * as yup from 'yup';
|
|
2
2
|
export var BankValidation = yup.object().shape({
|
|
3
|
-
iban: yup
|
|
4
|
-
|
|
3
|
+
iban: yup
|
|
4
|
+
.string()
|
|
5
|
+
.matches(/^[a-zA-Z]{2}\d{14,}$/g, 'invalid_iban_format')
|
|
6
|
+
.min(16, 'invalid_iban_format')
|
|
7
|
+
.max(34, 'invalid_iban_format')
|
|
8
|
+
.required('alert_iban'),
|
|
9
|
+
bankName: yup.string().required('bank_name_required'),
|
|
5
10
|
beneficiaryName: yup
|
|
6
11
|
.string()
|
|
7
|
-
.matches(/^([a-zA-Z0-9]+\s{1}[a-zA-Z0-9]{2,}|[a-zA-Z0-9]+\s{1}[a-zA-Z0-9]{1,}\s{1}[a-zA-Z0-9]{2,})$/g)
|
|
8
|
-
.required('')
|
|
12
|
+
.matches(/^([a-zA-Z0-9]+\s{1}[a-zA-Z0-9]{2,}|[a-zA-Z0-9]+\s{1}[a-zA-Z0-9]{1,}\s{1}[a-zA-Z0-9]{2,})$/g, 'beneficiary_name_invalid')
|
|
13
|
+
.required('beneficiary_name_required')
|
|
9
14
|
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { useTranslation } from 'react-i18next';
|
|
4
|
+
import SuccessScreen from '../../../shared/SuccessScreen';
|
|
5
|
+
var Success = function (_a) {
|
|
6
|
+
var t = useTranslation().t;
|
|
7
|
+
var onSuccess = function () {
|
|
8
|
+
console.log('success');
|
|
9
|
+
alert('Account created successfully, please check your email');
|
|
10
|
+
alert("It's a fake message, plz wait us to integrate with the backend. <A.Sharkawy>");
|
|
11
|
+
};
|
|
12
|
+
return _jsx(SuccessScreen, { title: t('ide_successfully_updated_message'), onSuccess: onSuccess });
|
|
13
|
+
};
|
|
14
|
+
export default React.memo(Success);
|
|
@@ -17,22 +17,6 @@ export declare const InputStyled: import("@emotion/styled").StyledComponent<Pick
|
|
|
17
17
|
hide?: boolean | undefined;
|
|
18
18
|
warningType?: "alert" | "error" | undefined;
|
|
19
19
|
} & {} & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
20
|
-
export declare const ExpandIcon: import("@emotion/styled").StyledComponent<{
|
|
21
|
-
children?: React.ReactNode;
|
|
22
|
-
classes?: Partial<import("@mui/material").SvgIconClasses> | undefined;
|
|
23
|
-
color?: "inherit" | "disabled" | "error" | "primary" | "secondary" | "action" | "info" | "success" | "warning" | undefined;
|
|
24
|
-
fontSize?: "small" | "inherit" | "medium" | "large" | undefined;
|
|
25
|
-
htmlColor?: string | undefined;
|
|
26
|
-
inheritViewBox?: boolean | undefined;
|
|
27
|
-
shapeRendering?: string | undefined;
|
|
28
|
-
sx?: import("@mui/material/styles").SxProps<import("@mui/material/styles").Theme> | undefined;
|
|
29
|
-
titleAccess?: string | undefined;
|
|
30
|
-
viewBox?: string | undefined;
|
|
31
|
-
} & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<React.SVGProps<SVGSVGElement>, "string" | "type" | "className" | "style" | "display" | "overflow" | "visibility" | "order" | "color" | "width" | "height" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "clipPath" | "cursor" | "direction" | "filter" | "fontSizeAdjust" | "fontStretch" | "fontVariant" | "imageRendering" | "opacity" | "paintOrder" | "pointerEvents" | "rotate" | "scale" | "textRendering" | "transform" | "unicodeBidi" | "wordSpacing" | "writingMode" | "mask" | "offset" | "textDecoration" | "azimuth" | "clip" | "alignmentBaseline" | "baselineShift" | "clipRule" | "colorInterpolation" | "colorRendering" | "dominantBaseline" | "fill" | "fillOpacity" | "fillRule" | "floodColor" | "floodOpacity" | "glyphOrientationVertical" | "lightingColor" | "markerEnd" | "markerMid" | "markerStart" | "shapeRendering" | "stopColor" | "stopOpacity" | "stroke" | "strokeDasharray" | "strokeDashoffset" | "strokeLinecap" | "strokeLinejoin" | "strokeMiterlimit" | "strokeOpacity" | "strokeWidth" | "textAnchor" | "vectorEffect" | "path" | "key" | "id" | "lang" | "tabIndex" | "role" | "children" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "end" | "values" | "local" | "x" | "y" | "alphabetic" | "hanging" | "ideographic" | "mathematical" | "name" | "spacing" | "elevation" | "in" | "max" | "href" | "orientation" | "media" | "target" | "origin" | "min" | "viewBox" | "method" | "crossOrigin" | "accentHeight" | "accumulate" | "additive" | "allowReorder" | "amplitude" | "arabicForm" | "ascent" | "attributeName" | "attributeType" | "autoReverse" | "baseFrequency" | "baseProfile" | "bbox" | "begin" | "bias" | "by" | "calcMode" | "capHeight" | "clipPathUnits" | "colorInterpolationFilters" | "colorProfile" | "contentScriptType" | "contentStyleType" | "cx" | "cy" | "d" | "decelerate" | "descent" | "diffuseConstant" | "divisor" | "dur" | "dx" | "dy" | "edgeMode" | "enableBackground" | "exponent" | "externalResourcesRequired" | "filterRes" | "filterUnits" | "focusable" | "format" | "fr" | "from" | "fx" | "fy" | "g1" | "g2" | "glyphName" | "glyphOrientationHorizontal" | "glyphRef" | "gradientTransform" | "gradientUnits" | "horizAdvX" | "horizOriginX" | "in2" | "intercept" | "k1" | "k2" | "k3" | "k4" | "k" | "kernelMatrix" | "kernelUnitLength" | "kerning" | "keyPoints" | "keySplines" | "keyTimes" | "lengthAdjust" | "limitingConeAngle" | "markerHeight" | "markerUnits" | "markerWidth" | "maskContentUnits" | "maskUnits" | "mode" | "numOctaves" | "operator" | "orient" | "overlinePosition" | "overlineThickness" | "panose1" | "pathLength" | "patternContentUnits" | "patternTransform" | "patternUnits" | "points" | "pointsAtX" | "pointsAtY" | "pointsAtZ" | "preserveAlpha" | "preserveAspectRatio" | "primitiveUnits" | "r" | "radius" | "refX" | "refY" | "renderingIntent" | "repeatCount" | "repeatDur" | "requiredExtensions" | "requiredFeatures" | "restart" | "result" | "rx" | "ry" | "seed" | "slope" | "specularConstant" | "specularExponent" | "speed" | "spreadMethod" | "startOffset" | "stdDeviation" | "stemh" | "stemv" | "stitchTiles" | "strikethroughPosition" | "strikethroughThickness" | "surfaceScale" | "systemLanguage" | "tableValues" | "targetX" | "targetY" | "textLength" | "to" | "u1" | "u2" | "underlinePosition" | "underlineThickness" | "unicode" | "unicodeRange" | "unitsPerEm" | "vAlphabetic" | "version" | "vertAdvY" | "vertOriginX" | "vertOriginY" | "vHanging" | "vIdeographic" | "viewTarget" | "vMathematical" | "widths" | "x1" | "x2" | "xChannelSelector" | "xHeight" | "xlinkActuate" | "xlinkArcrole" | "xlinkHref" | "xlinkRole" | "xlinkShow" | "xlinkTitle" | "xlinkType" | "xmlBase" | "xmlLang" | "xmlns" | "xmlnsXlink" | "xmlSpace" | "y1" | "y2" | "yChannelSelector" | "z" | "zoomAndPan"> & {
|
|
32
|
-
ref?: ((instance: SVGSVGElement | null) => void) | React.RefObject<SVGSVGElement> | null | undefined;
|
|
33
|
-
}, keyof import("@mui/material/OverridableComponent").CommonProps | "color" | "fontSize" | "shapeRendering" | "children" | "sx" | "htmlColor" | "inheritViewBox" | "titleAccess" | "viewBox"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & {
|
|
34
|
-
anchorEl: HTMLElement | null;
|
|
35
|
-
}, {}, {}>;
|
|
36
20
|
export declare const CheckIconStyled: import("@emotion/styled").StyledComponent<{
|
|
37
21
|
children?: React.ReactNode;
|
|
38
22
|
classes?: Partial<import("@mui/material").SvgIconClasses> | undefined;
|
|
@@ -35,7 +35,6 @@ import Box from '@mui/material/Box';
|
|
|
35
35
|
import { alpha, styled } from '@mui/material/styles';
|
|
36
36
|
import Text from '../../../../components/Text';
|
|
37
37
|
import Input from '../../../../components/Input';
|
|
38
|
-
import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
|
|
39
38
|
import { useTranslation } from 'react-i18next';
|
|
40
39
|
import { useController, useFormContext } from 'react-hook-form';
|
|
41
40
|
import { useLanguage } from '../../../../hooks';
|
|
@@ -43,16 +42,10 @@ import { ACTIVITIES } from '../../../../constants';
|
|
|
43
42
|
import { BusinessType } from '../../../../@types';
|
|
44
43
|
import Collapse from '../../../../components/Collapse';
|
|
45
44
|
import SimpleList from '../../../../components/SimpleList';
|
|
45
|
+
import ExpandIcon from '../../../../components/ExpandIcon';
|
|
46
|
+
import { ScreenContainer } from '../../../shared/Containers';
|
|
46
47
|
import CheckIcon from '@mui/icons-material/Check';
|
|
47
48
|
import { MandatoryStyled } from './SalesChannels';
|
|
48
|
-
var BoxStyled = styled(Box)(function (_a) {
|
|
49
|
-
var theme = _a.theme;
|
|
50
|
-
return ({
|
|
51
|
-
display: 'flex',
|
|
52
|
-
flexDirection: 'column',
|
|
53
|
-
direction: theme.direction
|
|
54
|
-
});
|
|
55
|
-
});
|
|
56
49
|
export var InputLabelStyled = styled(Text)(function (_a) {
|
|
57
50
|
var theme = _a.theme;
|
|
58
51
|
return (__assign({ margin: theme.spacing(2.5, 2.5, 1.5, 2.5), color: alpha(theme.palette.text.primary, 0.4) }, theme.typography.caption));
|
|
@@ -66,13 +59,6 @@ export var InputStyled = styled(Input)(function (_a) {
|
|
|
66
59
|
}
|
|
67
60
|
});
|
|
68
61
|
});
|
|
69
|
-
export var ExpandIcon = styled(ExpandMoreIcon, { shouldForwardProp: function (prop) { return prop !== 'anchorEl'; } })(function (_a) {
|
|
70
|
-
var _b;
|
|
71
|
-
var theme = _a.theme, anchorEl = _a.anchorEl;
|
|
72
|
-
return (__assign(__assign({}, theme.typography.h6), (_b = { display: 'flex', cursor: 'pointer', transform: !!anchorEl ? 'rotate(180deg)' : '', paddingInlineStart: !!anchorEl ? theme.spacing(0) : theme.spacing(1), paddingInlineEnd: !!anchorEl ? theme.spacing(1) : theme.spacing(0) }, _b[theme.transitions.create(['transform'])] = {
|
|
73
|
-
duration: theme.transitions.duration.standard
|
|
74
|
-
}, _b)));
|
|
75
|
-
});
|
|
76
62
|
var SimpleListStyled = styled((SimpleList))(function () { return ({
|
|
77
63
|
height: 'fit-content'
|
|
78
64
|
}); });
|
|
@@ -129,7 +115,7 @@ var ActivitiesList = function (_a) {
|
|
|
129
115
|
var getSelectedActivityFlag = function (item) {
|
|
130
116
|
return controlValue === null || controlValue === void 0 ? void 0 : controlValue.find(function (activity) { return activity.id === (item === null || item === void 0 ? void 0 : item.id); });
|
|
131
117
|
};
|
|
132
|
-
return (_jsxs(
|
|
118
|
+
return (_jsxs(ScreenContainer, { children: [_jsxs(InputLabelStyled, { children: [t(isCR ? 'activities' : 'category'), " ", _jsx(MandatoryStyled, { children: "*" })] }), _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', list: activitiesMenuList, onSelectItem: onSelectItem, renderItem: function (item) {
|
|
133
119
|
return (_jsxs(_Fragment, { children: [_jsx(Box, __assign({ display: 'flex' }, { children: _jsx(NameContainer, __assign({ isSelected: (item === null || item === void 0 ? void 0 : item.id) === getSelectedActivityFlag(item) }, { children: isAr ? item === null || item === void 0 ? void 0 : item.name : item === null || item === void 0 ? void 0 : item.nameEn })) })), getSelectedActivityFlag(item) && _jsx(CheckIconStyled, {})] }));
|
|
134
120
|
} }) }))] })] }));
|
|
135
121
|
};
|
|
@@ -26,6 +26,6 @@ var OperationStartDate = function (_a) {
|
|
|
26
26
|
oDateControl.field.onChange(data);
|
|
27
27
|
};
|
|
28
28
|
var dateValue = (_b = oDateControl === null || oDateControl === void 0 ? void 0 : oDateControl.field) === null || _b === void 0 ? void 0 : _b.value;
|
|
29
|
-
return (_jsxs(ScreenContainer, __assign({ sx: { mb: 5 } }, { children: [_jsxs(InputLabelStyled, { children: [t('
|
|
29
|
+
return (_jsxs(ScreenContainer, __assign({ sx: { mb: 5 } }, { children: [_jsxs(InputLabelStyled, { children: [t('business_start_date'), _jsx(MandatoryStyled, { children: "*" })] }), _jsx(DatePicker, { readOnly: true, defaultValue: dateValue ? new Date(dateValue) : new Date(), dir: 'ltr', locale: 'en', onClick: function () { return onDateClicked === null || onDateClicked === void 0 ? void 0 : onDateClicked(true); }, onDatePicked: function () { return onDateClicked === null || onDateClicked === void 0 ? void 0 : onDateClicked(false); }, onDateChange: handleOperationStartDateChange })] })));
|
|
30
30
|
};
|
|
31
31
|
export default OperationStartDate;
|
|
@@ -95,6 +95,6 @@ var SalesChannels = function () {
|
|
|
95
95
|
if (channelsChecked)
|
|
96
96
|
return !!(channelsChecked === null || channelsChecked === void 0 ? void 0 : channelsChecked.find(function (channel) { return channel.id === (item === null || item === void 0 ? void 0 : item.id); }));
|
|
97
97
|
};
|
|
98
|
-
return (_jsxs(ScreenContainer, { children: [_jsxs(InputLabelStyled, { children: [t('
|
|
98
|
+
return (_jsxs(ScreenContainer, { children: [_jsxs(InputLabelStyled, { children: [t('channel_of_service'), " ", _jsx(MandatoryStyled, { children: "*" })] }), channelsMenuList.map(function (channel) { return (_jsxs(ContainerStyled, { children: [_jsx(CheckBoxStyled, { id: channel.id.toString(), disableRipple: true, disableFocusRipple: true, focusRipple: false, checked: getSelectedChannelsFlag(channel), onChange: handleSalesChannelChange }), _jsxs(TextStyled, { children: [isAr ? channel.name : channel.nameEn, " "] })] }, channel.id)); }), _jsx(CollapseStyled, __assign({ in: !!warningMessage }, { children: _jsx(Warning, __assign({ warningType: 'alert' }, { children: t(warningMessage) })) }))] }));
|
|
99
99
|
};
|
|
100
100
|
export default SalesChannels;
|
|
@@ -7,12 +7,12 @@ export var ActivitiesValidationSchema = yup.object().shape({
|
|
|
7
7
|
})),
|
|
8
8
|
salesChannels: yup
|
|
9
9
|
.array()
|
|
10
|
-
.min(1, '
|
|
10
|
+
.min(1, 'choose_atleast_one_channel')
|
|
11
11
|
.of(yup.object().shape({
|
|
12
12
|
id: yup.number(),
|
|
13
13
|
name: yup.string(),
|
|
14
14
|
nameEn: yup.string()
|
|
15
15
|
}))
|
|
16
|
-
.required('
|
|
17
|
-
operationStartDate: yup.string().required('
|
|
16
|
+
.required('choose_atleast_one_channel'),
|
|
17
|
+
operationStartDate: yup.string().required('choose_any_business_date')
|
|
18
18
|
});
|
|
@@ -35,6 +35,7 @@ var CRNumber = function (_a) {
|
|
|
35
35
|
crNumberControl.field.onChange('');
|
|
36
36
|
};
|
|
37
37
|
var crNumberValue = crNumberControl.field.value;
|
|
38
|
-
|
|
38
|
+
var error = (_b = crNumberControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
|
|
39
|
+
return (_jsx(Collapse, __assign({ in: show }, { children: _jsx(ScreenContainer, { children: _jsx(Input, { label: t('enter_commercial_register_no'), onChange: handleFLNumberChange, inputProps: { maxLength: CR_NUMBER_LENGTH }, value: crNumberValue, endAdornment: (crNumberValue === null || crNumberValue === void 0 ? void 0 : crNumberValue.length) === CR_NUMBER_LENGTH ? (_jsx(CheckIcon, {})) : (crNumberValue && _jsx(ClearIcon, { onClick: clearCRNumber })), placeholder: '0123456789', warningType: 'alert', warningMessage: error && t(error, { length: CR_NUMBER_LENGTH }) }) }) })));
|
|
39
40
|
};
|
|
40
41
|
export default React.memo(CRNumber);
|
|
@@ -28,11 +28,11 @@ import Box from '@mui/material/Box';
|
|
|
28
28
|
import { styled } from '@mui/material/styles';
|
|
29
29
|
import { useLanguage } from '../../../../hooks';
|
|
30
30
|
import ScreenContainer from '../../../shared/Containers/ScreenContainer';
|
|
31
|
-
import ExpandIcon from '../../../shared/ExpandIcon';
|
|
32
31
|
import Input from '../../../shared/Input';
|
|
33
32
|
import CheckIcon from '../../../shared/CheckIcon';
|
|
34
33
|
import SimpleList from '../../../../components/SimpleList';
|
|
35
34
|
import Text from '../../../../components/Text';
|
|
35
|
+
import ExpandIcon from '../../../../components/ExpandIcon';
|
|
36
36
|
import Collapse from '../../../../components/Collapse';
|
|
37
37
|
import { OTHER_CR_LICENSE } from '../../../../constants';
|
|
38
38
|
import CRNumber from './CRNumber';
|
|
@@ -98,7 +98,7 @@ var CompanyLicense = function (_a) {
|
|
|
98
98
|
};
|
|
99
99
|
var hasList = (licenseList === null || licenseList === void 0 ? void 0 : licenseList.length) > 0;
|
|
100
100
|
var showCRNumber = !anchorEl;
|
|
101
|
-
return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, { children: [_jsxs(Collapse, __assign({ in: hasList }, { children: [_jsx(InputStyled, { label: t('
|
|
101
|
+
return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, { children: [_jsxs(Collapse, __assign({ in: hasList }, { children: [_jsx(InputStyled, { label: t('enter_commercial_register_no'), readOnly: true, onClick: !!anchorEl ? function () { return onCloseLicenseList(); } : onOpenLicenseList, endAdornment: _jsx(ExpandIcon, { anchorEl: !!anchorEl }), placeholder: t('choose_license_cr'), value: t(getLicenseName(selectedLicense)) }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleList, { searchKeyPath: 'crNumber', list: licenseList, onSelectItem: onSelectItem, renderItem: function (item) {
|
|
102
102
|
return (_jsxs(_Fragment, { children: [_jsx(LicenseContainer, { children: _jsx(LicenseNameText, __assign({ isSelected: getLicenseNumber(item) === getLicenseNumber(selectedLicense) }, { children: isOtherLicense(item)
|
|
103
103
|
? t(getLicenseNumber(item))
|
|
104
104
|
: isAr
|
|
@@ -35,6 +35,7 @@ var FLNumber = function (_a) {
|
|
|
35
35
|
flNumberControl.field.onChange('');
|
|
36
36
|
};
|
|
37
37
|
var flNumberValue = flNumberControl.field.value;
|
|
38
|
-
|
|
38
|
+
var error = (_b = flNumberControl.fieldState.error) === null || _b === void 0 ? void 0 : _b.message;
|
|
39
|
+
return (_jsx(Collapse, __assign({ in: show }, { children: _jsx(ScreenContainer, { children: _jsx(Input, { label: t('enter_license_no'), onChange: handleFLNumberChange, inputProps: { maxLength: FL_NUMBER_LENGTH }, value: flNumberValue, endAdornment: (flNumberValue === null || flNumberValue === void 0 ? void 0 : flNumberValue.length) === FL_NUMBER_LENGTH ? (_jsx(CheckIcon, {})) : (flNumberValue && _jsx(ClearIcon, { onClick: clearFLNumber })), placeholder: '12345678', warningType: 'alert', warningMessage: error && t(error, { length: FL_NUMBER_LENGTH }) }) }) })));
|
|
39
40
|
};
|
|
40
41
|
export default React.memo(FLNumber);
|
|
@@ -31,7 +31,7 @@ import Collapse from '../../../../components/Collapse';
|
|
|
31
31
|
import { useLanguage } from '../../../../hooks';
|
|
32
32
|
import ScreenContainer from '../../../shared/Containers/ScreenContainer';
|
|
33
33
|
import CheckIcon from '../../../shared/CheckIcon';
|
|
34
|
-
import ExpandIcon from '
|
|
34
|
+
import ExpandIcon from '../../../../components/ExpandIcon';
|
|
35
35
|
import Input from '../../../shared/Input';
|
|
36
36
|
import { OTHER_FL_LICENSE } from '../../../../constants';
|
|
37
37
|
import SimpleList from '../../../../components/SimpleList';
|
|
@@ -101,7 +101,7 @@ var FreelanceLicense = function (_a) {
|
|
|
101
101
|
};
|
|
102
102
|
var hasList = (licenseList === null || licenseList === void 0 ? void 0 : licenseList.length) > 0;
|
|
103
103
|
var showFLNumber = !anchorEl;
|
|
104
|
-
return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, { children: [_jsxs(Collapse, __assign({ in: hasList }, { children: [_jsx(InputStyled, { label: t('
|
|
104
|
+
return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, { children: [_jsxs(Collapse, __assign({ in: hasList }, { children: [_jsx(InputStyled, { label: t('enter_freelance_license'), readOnly: true, onClick: !!anchorEl ? function () { return onCloseLicenseList(); } : onOpenLicenseList, endAdornment: _jsx(ExpandIcon, { anchorEl: !!anchorEl }), placeholder: t('choose_license_fl'), value: t(getLicenseName(selectedLicense)) }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleList, { searchKeyPath: 'license_specialities[0].speciality.name_en', list: licenseList, onSelectItem: onSelectItem, renderItem: function (item) {
|
|
105
105
|
return (_jsxs(_Fragment, { children: [_jsx(LicenseContainer, { children: _jsx(LicenseNameText, __assign({ isSelected: getLicenseNumber(item) === getLicenseNumber(selectedLicense) }, { children: isOtherLicense(item)
|
|
106
106
|
? t(getLicenseNumber(item))
|
|
107
107
|
: isAr
|
|
@@ -101,6 +101,6 @@ var SelectType = function (_a) {
|
|
|
101
101
|
var FLActive = type === BusinessType.FL;
|
|
102
102
|
var CRActive = type === BusinessType.CR;
|
|
103
103
|
var isAnyTypeActive = FLActive || CRActive;
|
|
104
|
-
return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, { children: [_jsx(Collapse, __assign({ in: !isAnyTypeActive }, { children: _jsx(TitleStyled, { children: t('
|
|
104
|
+
return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, { children: [_jsx(Collapse, __assign({ in: !isAnyTypeActive }, { children: _jsx(TitleStyled, { children: t('signup_business_type_label') }) })), _jsxs(RadioGroupStyled, __assign({ "aria-labelledby": 'business-type', name: 'business-type' }, { children: [_jsx(BTypeSwitch, { value: BusinessType.FL, control: _jsx(RadioStyled, { color: 'primary', onClick: handleSwitchToFL }), label: _jsx(FLIconStyled, { src: FLActive ? ICONS_NAMES.FL_ACTIVE_ICON : ICONS_NAMES.FL_ICON }), active: FLActive }), _jsx(BTypeSwitch, { value: BusinessType.CR, control: _jsx(RadioStyled, { color: 'primary', onClick: handleSwitchToCR }), label: _jsx(CRIconStyled, { src: CRActive ? ICONS_NAMES.CR_ACTIVE_ICON : ICONS_NAMES.CR_ICON }), active: CRActive })] })), _jsx(Collapse, __assign({ in: !isAnyTypeActive }, { children: _jsxs(TextBoxStyled, { children: [_jsx(TextStyled, __assign({ onClick: handleSwitchToFL, active: FLActive }, { children: t('freelancer_reg') })), _jsx(TextStyled, __assign({ onClick: handleSwitchToCR, active: CRActive }, { children: t('commercial_reg') }))] }) }))] }) })));
|
|
105
105
|
};
|
|
106
106
|
export default React.memo(SelectType);
|
|
@@ -1,14 +1,8 @@
|
|
|
1
1
|
import * as yup from 'yup';
|
|
2
2
|
import { FL_NUMBER_LENGTH, CR_NUMBER_LENGTH } from '../../../../constants';
|
|
3
3
|
export var FLValidationSchema = yup.object().shape({
|
|
4
|
-
flNumber: yup
|
|
5
|
-
.string()
|
|
6
|
-
.min(FL_NUMBER_LENGTH, "Freelance number length should be ".concat(FL_NUMBER_LENGTH))
|
|
7
|
-
.required('Freelance number is required')
|
|
4
|
+
flNumber: yup.string().min(FL_NUMBER_LENGTH, "fl_max_length").required('fl_required')
|
|
8
5
|
});
|
|
9
6
|
export var CRValidationSchema = yup.object().shape({
|
|
10
|
-
crNumber: yup
|
|
11
|
-
.string()
|
|
12
|
-
.min(CR_NUMBER_LENGTH, "CR number length should be ".concat(CR_NUMBER_LENGTH))
|
|
13
|
-
.required('CR number is required')
|
|
7
|
+
crNumber: yup.string().min(CR_NUMBER_LENGTH, "cr_max_length").required('cr_required')
|
|
14
8
|
});
|
|
@@ -48,6 +48,6 @@ var Confirm = function () {
|
|
|
48
48
|
defaultValues: defaultValues,
|
|
49
49
|
mode: 'onChange'
|
|
50
50
|
});
|
|
51
|
-
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(InputStyled, { label: t(isCR ? '
|
|
51
|
+
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(InputStyled, { label: t(isCR ? 'signup_business_cr_info_title' : 'signup_business_fl_info_title'), value: defaultValues.licenseNumber, disabled: true }), _jsx(InputStyled, { label: t('signup_brand_name_label'), value: defaultValues.brandName, disabled: true }), _jsx(InputStyled, { label: t('signup_legal_name_label'), value: defaultValues.legalName, disabled: true }), _jsx(Button, __assign({ isAr: isAr }, { children: t('confirm') }))] })) })) }));
|
|
52
52
|
};
|
|
53
53
|
export default React.memo(Confirm);
|
|
@@ -1,12 +1,4 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
export declare const BoxStyled: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material/styles").Theme> & {
|
|
3
|
-
children?: React.ReactNode;
|
|
4
|
-
component?: React.ElementType<any> | undefined;
|
|
5
|
-
ref?: React.Ref<unknown> | undefined;
|
|
6
|
-
sx?: import("@mui/material/styles").SxProps<import("@mui/material/styles").Theme> | undefined;
|
|
7
|
-
} & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
|
|
8
|
-
ref?: ((instance: HTMLDivElement | null) => void) | React.RefObject<HTMLDivElement> | null | undefined;
|
|
9
|
-
}, keyof import("@mui/material/OverridableComponent").CommonProps | ("border" | "borderTop" | "borderRight" | "borderBottom" | "borderLeft" | "borderColor" | "borderRadius" | "display" | "displayPrint" | "overflow" | "textOverflow" | "visibility" | "whiteSpace" | "flexBasis" | "flexDirection" | "flexWrap" | "justifyContent" | "alignItems" | "alignContent" | "order" | "flex" | "flexGrow" | "flexShrink" | "alignSelf" | "justifyItems" | "justifySelf" | "gap" | "columnGap" | "rowGap" | "gridColumn" | "gridRow" | "gridAutoFlow" | "gridAutoColumns" | "gridAutoRows" | "gridTemplateColumns" | "gridTemplateRows" | "gridTemplateAreas" | "gridArea" | "bgcolor" | "color" | "zIndex" | "position" | "top" | "right" | "bottom" | "left" | "boxShadow" | "width" | "maxWidth" | "minWidth" | "height" | "maxHeight" | "minHeight" | "boxSizing" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "my" | "p" | "pt" | "pr" | "pb" | "pl" | "px" | "py" | "margin" | "marginTop" | "marginRight" | "marginBottom" | "marginLeft" | "marginX" | "marginY" | "padding" | "paddingTop" | "paddingRight" | "paddingBottom" | "paddingLeft" | "paddingX" | "paddingY" | "typography" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "lineHeight" | "textAlign" | "textTransform") | "ref" | "children" | "component" | "sx"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
10
2
|
export declare const InputLabelStyled: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material/styles").Theme> & {
|
|
11
3
|
align?: "right" | "left" | "inherit" | "center" | "justify" | undefined;
|
|
12
4
|
children?: React.ReactNode;
|
|
@@ -25,22 +17,6 @@ export declare const InputStyled: import("@emotion/styled").StyledComponent<Pick
|
|
|
25
17
|
hide?: boolean | undefined;
|
|
26
18
|
warningType?: "alert" | "error" | undefined;
|
|
27
19
|
} & {} & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
28
|
-
export declare const ExpandIcon: import("@emotion/styled").StyledComponent<{
|
|
29
|
-
children?: React.ReactNode;
|
|
30
|
-
classes?: Partial<import("@mui/material").SvgIconClasses> | undefined;
|
|
31
|
-
color?: "inherit" | "disabled" | "error" | "primary" | "secondary" | "action" | "info" | "success" | "warning" | undefined;
|
|
32
|
-
fontSize?: "small" | "inherit" | "medium" | "large" | undefined;
|
|
33
|
-
htmlColor?: string | undefined;
|
|
34
|
-
inheritViewBox?: boolean | undefined;
|
|
35
|
-
shapeRendering?: string | undefined;
|
|
36
|
-
sx?: import("@mui/material/styles").SxProps<import("@mui/material/styles").Theme> | undefined;
|
|
37
|
-
titleAccess?: string | undefined;
|
|
38
|
-
viewBox?: string | undefined;
|
|
39
|
-
} & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<React.SVGProps<SVGSVGElement>, "string" | "type" | "className" | "style" | "display" | "overflow" | "visibility" | "order" | "color" | "width" | "height" | "fontFamily" | "fontSize" | "fontStyle" | "fontWeight" | "letterSpacing" | "clipPath" | "cursor" | "direction" | "filter" | "fontSizeAdjust" | "fontStretch" | "fontVariant" | "imageRendering" | "opacity" | "paintOrder" | "pointerEvents" | "rotate" | "scale" | "textRendering" | "transform" | "unicodeBidi" | "wordSpacing" | "writingMode" | "mask" | "offset" | "textDecoration" | "azimuth" | "clip" | "alignmentBaseline" | "baselineShift" | "clipRule" | "colorInterpolation" | "colorRendering" | "dominantBaseline" | "fill" | "fillOpacity" | "fillRule" | "floodColor" | "floodOpacity" | "glyphOrientationVertical" | "lightingColor" | "markerEnd" | "markerMid" | "markerStart" | "shapeRendering" | "stopColor" | "stopOpacity" | "stroke" | "strokeDasharray" | "strokeDashoffset" | "strokeLinecap" | "strokeLinejoin" | "strokeMiterlimit" | "strokeOpacity" | "strokeWidth" | "textAnchor" | "vectorEffect" | "path" | "key" | "id" | "lang" | "tabIndex" | "role" | "children" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "end" | "values" | "local" | "x" | "y" | "alphabetic" | "hanging" | "ideographic" | "mathematical" | "name" | "spacing" | "elevation" | "in" | "max" | "href" | "orientation" | "media" | "target" | "origin" | "min" | "viewBox" | "method" | "crossOrigin" | "accentHeight" | "accumulate" | "additive" | "allowReorder" | "amplitude" | "arabicForm" | "ascent" | "attributeName" | "attributeType" | "autoReverse" | "baseFrequency" | "baseProfile" | "bbox" | "begin" | "bias" | "by" | "calcMode" | "capHeight" | "clipPathUnits" | "colorInterpolationFilters" | "colorProfile" | "contentScriptType" | "contentStyleType" | "cx" | "cy" | "d" | "decelerate" | "descent" | "diffuseConstant" | "divisor" | "dur" | "dx" | "dy" | "edgeMode" | "enableBackground" | "exponent" | "externalResourcesRequired" | "filterRes" | "filterUnits" | "focusable" | "format" | "fr" | "from" | "fx" | "fy" | "g1" | "g2" | "glyphName" | "glyphOrientationHorizontal" | "glyphRef" | "gradientTransform" | "gradientUnits" | "horizAdvX" | "horizOriginX" | "in2" | "intercept" | "k1" | "k2" | "k3" | "k4" | "k" | "kernelMatrix" | "kernelUnitLength" | "kerning" | "keyPoints" | "keySplines" | "keyTimes" | "lengthAdjust" | "limitingConeAngle" | "markerHeight" | "markerUnits" | "markerWidth" | "maskContentUnits" | "maskUnits" | "mode" | "numOctaves" | "operator" | "orient" | "overlinePosition" | "overlineThickness" | "panose1" | "pathLength" | "patternContentUnits" | "patternTransform" | "patternUnits" | "points" | "pointsAtX" | "pointsAtY" | "pointsAtZ" | "preserveAlpha" | "preserveAspectRatio" | "primitiveUnits" | "r" | "radius" | "refX" | "refY" | "renderingIntent" | "repeatCount" | "repeatDur" | "requiredExtensions" | "requiredFeatures" | "restart" | "result" | "rx" | "ry" | "seed" | "slope" | "specularConstant" | "specularExponent" | "speed" | "spreadMethod" | "startOffset" | "stdDeviation" | "stemh" | "stemv" | "stitchTiles" | "strikethroughPosition" | "strikethroughThickness" | "surfaceScale" | "systemLanguage" | "tableValues" | "targetX" | "targetY" | "textLength" | "to" | "u1" | "u2" | "underlinePosition" | "underlineThickness" | "unicode" | "unicodeRange" | "unitsPerEm" | "vAlphabetic" | "version" | "vertAdvY" | "vertOriginX" | "vertOriginY" | "vHanging" | "vIdeographic" | "viewTarget" | "vMathematical" | "widths" | "x1" | "x2" | "xChannelSelector" | "xHeight" | "xlinkActuate" | "xlinkArcrole" | "xlinkHref" | "xlinkRole" | "xlinkShow" | "xlinkTitle" | "xlinkType" | "xmlBase" | "xmlLang" | "xmlns" | "xmlnsXlink" | "xmlSpace" | "y1" | "y2" | "yChannelSelector" | "z" | "zoomAndPan"> & {
|
|
40
|
-
ref?: ((instance: SVGSVGElement | null) => void) | React.RefObject<SVGSVGElement> | null | undefined;
|
|
41
|
-
}, keyof import("@mui/material/OverridableComponent").CommonProps | "color" | "fontSize" | "shapeRendering" | "children" | "sx" | "htmlColor" | "inheritViewBox" | "titleAccess" | "viewBox"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & {
|
|
42
|
-
anchorEl: HTMLElement | null;
|
|
43
|
-
}, {}, {}>;
|
|
44
20
|
export declare const NameContainer: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material/styles").Theme> & {
|
|
45
21
|
align?: "right" | "left" | "inherit" | "center" | "justify" | undefined;
|
|
46
22
|
children?: React.ReactNode;
|
|
@@ -29,19 +29,12 @@ import { styled, alpha } from '@mui/material/styles';
|
|
|
29
29
|
import Text from '../../../../components/Text';
|
|
30
30
|
import Collapse from '../../../../components/Collapse';
|
|
31
31
|
import CheckIcon from '@mui/icons-material/Check';
|
|
32
|
-
import
|
|
32
|
+
import ExpandIcon from '../../../../components/ExpandIcon';
|
|
33
33
|
import Input from '../../../../components/Input';
|
|
34
34
|
import SimpleList from '../../../../components/SimpleList';
|
|
35
|
+
import { ScreenContainer } from '../../../shared/Containers';
|
|
35
36
|
import { useLanguage } from '../../../../hooks';
|
|
36
37
|
import { CUSTOMER_LOCATIONS } from '../../../../constants';
|
|
37
|
-
export var BoxStyled = styled(Box)(function (_a) {
|
|
38
|
-
var theme = _a.theme;
|
|
39
|
-
return ({
|
|
40
|
-
direction: theme.direction,
|
|
41
|
-
display: 'flex',
|
|
42
|
-
flexDirection: 'column'
|
|
43
|
-
});
|
|
44
|
-
});
|
|
45
38
|
export var InputLabelStyled = styled(Text)(function (_a) {
|
|
46
39
|
var theme = _a.theme;
|
|
47
40
|
return (__assign({ margin: theme.spacing(2.5, 2.5, 1.5, 2.5), color: alpha(theme.palette.text.primary, 0.4) }, theme.typography.caption));
|
|
@@ -55,13 +48,6 @@ export var InputStyled = styled(Input)(function (_a) {
|
|
|
55
48
|
}
|
|
56
49
|
});
|
|
57
50
|
});
|
|
58
|
-
export var ExpandIcon = styled(ExpandMoreIcon, { shouldForwardProp: function (prop) { return prop !== 'anchorEl'; } })(function (_a) {
|
|
59
|
-
var _b;
|
|
60
|
-
var theme = _a.theme, anchorEl = _a.anchorEl;
|
|
61
|
-
return (__assign(__assign({}, theme.typography.h6), (_b = { display: 'flex', cursor: 'pointer', transform: !!anchorEl ? 'rotate(180deg)' : '', paddingInlineStart: !!anchorEl ? theme.spacing(0) : theme.spacing(1), paddingInlineEnd: !!anchorEl ? theme.spacing(1) : theme.spacing(0) }, _b[theme.transitions.create(['transform'])] = {
|
|
62
|
-
duration: theme.transitions.duration.standard
|
|
63
|
-
}, _b)));
|
|
64
|
-
});
|
|
65
51
|
export var NameContainer = styled(Text, { shouldForwardProp: function (prop) { return prop !== 'isSelected'; } })(function (_a) {
|
|
66
52
|
var theme = _a.theme, isSelected = _a.isSelected;
|
|
67
53
|
return (__assign(__assign({ color: theme.palette.text.primary }, theme.typography.body2), { fontWeight: isSelected ? theme.typography.fontWeightMedium : theme.typography.fontWeightLight, paddingInlineStart: theme.spacing(1.25) }));
|
|
@@ -115,7 +101,7 @@ var customerLocations = function (_a) {
|
|
|
115
101
|
};
|
|
116
102
|
var customerLocationsValue = customerLocationsControl.field.value;
|
|
117
103
|
var customerLocationSelected = customerLocationsValue[customerLocationsValue.length - 1];
|
|
118
|
-
return (_jsxs(
|
|
104
|
+
return (_jsxs(ScreenContainer, { children: [_jsx(InputLabelStyled, { children: t('select_customer_base') }), _jsx(InputStyled, { readOnly: true, value: isAr ? customerLocationSelected === null || customerLocationSelected === void 0 ? void 0 : customerLocationSelected.nameAR : customerLocationSelected === null || customerLocationSelected === void 0 ? void 0 : customerLocationSelected.name, onClick: !!anchorEl ? function () { return onCloseList(); } : onOpenList, endAdornment: _jsx(ExpandIcon, { anchorEl: !!anchorEl }) }), _jsx(Collapse, __assign({ in: !!anchorEl, timeout: 300 }, { children: _jsx(SimpleListStyled, { searchKeyPath: 'name', list: customerLocationsList, placeholder: 'choose_customer_base', onSelectItem: onSelectItem, renderItem: function (item) {
|
|
119
105
|
return (_jsxs(_Fragment, { children: [_jsx(Box, __assign({ display: 'flex' }, { children: _jsx(NameContainer, __assign({ isSelected: (item === null || item === void 0 ? void 0 : item.id) === (customerLocationsValue === null || customerLocationsValue === void 0 ? void 0 : customerLocationsValue.id) }, { children: isAr ? item.nameAR : item.name })) })), item.id === (customerLocationSelected === null || customerLocationSelected === void 0 ? void 0 : customerLocationSelected.id) && _jsx(CheckIconStyled, {}), checkRemainingCondition(item) && item.id != (customerLocationSelected === null || customerLocationSelected === void 0 ? void 0 : customerLocationSelected.id) && _jsx(RemainingCheck, {})] }));
|
|
120
106
|
} }) }))] }));
|
|
121
107
|
};
|
|
@@ -10,20 +10,16 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
-
import Box from '@mui/material/Box/Box';
|
|
14
13
|
import { styled } from '@mui/material/styles';
|
|
15
14
|
import * as React from 'react';
|
|
16
15
|
import { useTranslation } from 'react-i18next';
|
|
17
16
|
import { useForm, FormProvider } from 'react-hook-form';
|
|
18
17
|
import { yupResolver } from '@hookform/resolvers/yup';
|
|
19
|
-
import Icon from '../../../../components/Icon';
|
|
20
18
|
import { useAppDispatch } from '../../../../hooks';
|
|
21
19
|
import { handleNextScreenStep } from '../../../../app/settings';
|
|
22
20
|
import { CustomerInfoValidation } from './validation';
|
|
23
21
|
import Form from '../../../../components/Form';
|
|
24
|
-
import Button from '
|
|
25
|
-
import { ICONS_NAMES } from '../../../../constants/assets';
|
|
26
|
-
import Loader from '../../../../components/Loader';
|
|
22
|
+
import Button from '../../../shared/Button';
|
|
27
23
|
import { useLanguage } from '../../../../hooks';
|
|
28
24
|
import CustomerLocations from './CustomerLocations';
|
|
29
25
|
import ExpectedCustomers from './ExpectedCustomers';
|
|
@@ -31,51 +27,19 @@ import ExpectedSales from './ExpectedSalesRange';
|
|
|
31
27
|
import { CUSTOMER_LOCATIONS, EXPECTED_CUSTOMERS, EXPECTED_SALES_RANGE } from '../../../../constants';
|
|
32
28
|
import RefundPolicy from './RefundPolicy';
|
|
33
29
|
import TransactionPolicy from './TransactionPolicy';
|
|
34
|
-
|
|
35
|
-
var theme = _a.theme;
|
|
36
|
-
return ({
|
|
37
|
-
padding: theme.spacing(2.5, 0, 2.5, 0),
|
|
38
|
-
overflow: 'hidden',
|
|
39
|
-
direction: theme.direction
|
|
40
|
-
});
|
|
41
|
-
});
|
|
30
|
+
import { ScreenContainer } from '../../../shared/Containers';
|
|
42
31
|
var FormStyled = styled(Form)(function () { return ({
|
|
43
32
|
display: 'flex',
|
|
44
33
|
flexDirection: 'column'
|
|
45
34
|
}); });
|
|
46
|
-
var ButtonContainer = styled(Box)(function (_a) {
|
|
47
|
-
var theme = _a.theme;
|
|
48
|
-
return ({
|
|
49
|
-
margin: theme.spacing(2.5, 2.5, 0, 2.5)
|
|
50
|
-
});
|
|
51
|
-
});
|
|
52
|
-
var IconStyled = styled(Icon, { shouldForwardProp: function (prop) { return prop !== 'isAr'; } })(function (_a) {
|
|
53
|
-
var theme = _a.theme, isAr = _a.isAr;
|
|
54
|
-
return ({
|
|
55
|
-
width: theme.spacing(3),
|
|
56
|
-
height: theme.spacing(3),
|
|
57
|
-
paddingInlineStart: theme.spacing(1.5),
|
|
58
|
-
paddingInlineEnd: theme.spacing(0.5),
|
|
59
|
-
transform: isAr ? 'scaleX(-1)' : 'scaleX(1)'
|
|
60
|
-
});
|
|
61
|
-
});
|
|
62
|
-
var LoaderStyled = styled(Loader)(function (_a) {
|
|
63
|
-
var theme = _a.theme;
|
|
64
|
-
return ({
|
|
65
|
-
marginInlineStart: theme.spacing(-6.25),
|
|
66
|
-
'& .loader-box-container': {
|
|
67
|
-
marginInlineStart: theme.spacing(2.5)
|
|
68
|
-
}
|
|
69
|
-
});
|
|
70
|
-
});
|
|
71
35
|
var Customers = function (_a) {
|
|
72
36
|
var dispatch = useAppDispatch();
|
|
73
37
|
var methods = useForm({
|
|
74
38
|
resolver: yupResolver(CustomerInfoValidation),
|
|
75
39
|
defaultValues: {
|
|
76
40
|
customerLocations: CUSTOMER_LOCATIONS,
|
|
77
|
-
expectedCustomers: EXPECTED_CUSTOMERS,
|
|
78
|
-
expectedSalesRange: EXPECTED_SALES_RANGE,
|
|
41
|
+
expectedCustomers: EXPECTED_CUSTOMERS[EXPECTED_CUSTOMERS.length - 1],
|
|
42
|
+
expectedSalesRange: EXPECTED_SALES_RANGE[EXPECTED_SALES_RANGE.length - 1],
|
|
79
43
|
refundPolicy: false,
|
|
80
44
|
transactionPolicy: false
|
|
81
45
|
},
|
|
@@ -87,6 +51,6 @@ var Customers = function (_a) {
|
|
|
87
51
|
};
|
|
88
52
|
var t = useTranslation().t;
|
|
89
53
|
var isAr = useLanguage().isAr;
|
|
90
|
-
return (_jsx(
|
|
54
|
+
return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(CustomerLocations, {}), _jsx(ExpectedCustomers, {}), _jsx(ExpectedSales, {}), _jsx(RefundPolicy, {}), _jsx(TransactionPolicy, {}), _jsx(Button, __assign({ sx: { mt: 2 }, disabled: !methods.formState.isValid, isAr: isAr }, { children: t('next') }))] })) })) }));
|
|
91
55
|
};
|
|
92
56
|
export default React.memo(Customers);
|
|
@@ -30,7 +30,9 @@ import { useLanguage } from '../../../../hooks';
|
|
|
30
30
|
import SimpleList from '../../../../components/SimpleList';
|
|
31
31
|
import { EXPECTED_CUSTOMERS } from '../../../../constants';
|
|
32
32
|
import Collapse from '../../../../components/Collapse';
|
|
33
|
-
import
|
|
33
|
+
import ExpandIcon from '../../../../components/ExpandIcon';
|
|
34
|
+
import { ScreenContainer } from '../../../shared/Containers';
|
|
35
|
+
import { CheckIconStyled, InputLabelStyled, InputStyled, NameContainer } from './CustomerLocations';
|
|
34
36
|
var ListItemContainer = styled(Box)(function (_a) {
|
|
35
37
|
var theme = _a.theme;
|
|
36
38
|
return ({
|
|
@@ -59,20 +61,14 @@ var ExpectedCustomers = function (_a) {
|
|
|
59
61
|
setAnchorEl(null);
|
|
60
62
|
(_a = rest.onListClose) === null || _a === void 0 ? void 0 : _a.call(rest);
|
|
61
63
|
};
|
|
62
|
-
var checkRemainingCondition = function (item) {
|
|
63
|
-
return !!expectedCustomersValue.find(function (expectedCustomer) {
|
|
64
|
-
return expectedCustomer.id === item.id;
|
|
65
|
-
});
|
|
66
|
-
};
|
|
67
64
|
var onSelectItem = function (expectedCustomers) {
|
|
68
65
|
onCloseList();
|
|
69
|
-
|
|
70
|
-
expectedCustomersControl.field.onChange(remaining);
|
|
66
|
+
expectedCustomersControl.field.onChange(expectedCustomers);
|
|
71
67
|
};
|
|
72
68
|
var expectedCustomersValue = expectedCustomersControl.field.value;
|
|
73
|
-
var expectedCustomersSelected = expectedCustomersValue
|
|
74
|
-
return (_jsxs(
|
|
75
|
-
return (_jsxs(_Fragment, { children: [_jsx(ListItemContainer, { children: _jsx(NameContainer, __assign({ isSelected: (item === null || item === void 0 ? void 0 : item.id) === (expectedCustomersValue === null || expectedCustomersValue === void 0 ? void 0 : expectedCustomersValue.id) }, { children: isAr ? item.nameAR : item.name })) }), item.id === (expectedCustomersSelected === null || expectedCustomersSelected === void 0 ? void 0 : expectedCustomersSelected.id) && _jsx(CheckIconStyled, {})
|
|
69
|
+
var expectedCustomersSelected = expectedCustomersValue;
|
|
70
|
+
return (_jsxs(ScreenContainer, { children: [_jsx(InputLabelStyled, { children: t('expected_customers_to_serve') }), _jsx(InputStyled, { readOnly: true, value: isAr ? expectedCustomersSelected === null || expectedCustomersSelected === void 0 ? void 0 : expectedCustomersSelected.nameAR : expectedCustomersSelected === null || expectedCustomersSelected === void 0 ? void 0 : expectedCustomersSelected.name, onClick: !!anchorEl ? function () { return onCloseList(); } : onOpenList, endAdornment: _jsx(ExpandIcon, { anchorEl: !!anchorEl }) }), _jsx(Collapse, __assign({ in: !!anchorEl, timeout: 300 }, { children: _jsx(SimpleListStyled, { searchKeyPath: 'name', list: expectedCustomersList, onSelectItem: onSelectItem, renderItem: function (item) {
|
|
71
|
+
return (_jsxs(_Fragment, { children: [_jsx(ListItemContainer, { children: _jsx(NameContainer, __assign({ isSelected: (item === null || item === void 0 ? void 0 : item.id) === (expectedCustomersValue === null || expectedCustomersValue === void 0 ? void 0 : expectedCustomersValue.id) }, { children: isAr ? item.nameAR : item.name })) }), item.id === (expectedCustomersSelected === null || expectedCustomersSelected === void 0 ? void 0 : expectedCustomersSelected.id) && _jsx(CheckIconStyled, {})] }));
|
|
76
72
|
} }) }))] }));
|
|
77
73
|
};
|
|
78
74
|
export default ExpectedCustomers;
|