@tap-payments/auth-jsconnect 2.4.13-test → 2.4.14-test

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/build/components/DatePicker/DatePicker.d.ts +2 -1
  2. package/build/components/DatePicker/DatePicker.js +12 -11
  3. package/build/features/entity/screens/EntityCapital/ActivityList.d.ts +0 -14
  4. package/build/features/entity/screens/EntityCapital/ActivityList.js +9 -14
  5. package/build/features/entity/screens/EntityCapital/CapitalPaid.d.ts +2 -1
  6. package/build/features/entity/screens/EntityCapital/CapitalPaid.js +4 -5
  7. package/build/features/entity/screens/EntityCapital/CapitalShareCount.d.ts +2 -1
  8. package/build/features/entity/screens/EntityCapital/CapitalShareCount.js +3 -4
  9. package/build/features/entity/screens/EntityCapital/CapitalShareValue.d.ts +2 -1
  10. package/build/features/entity/screens/EntityCapital/CapitalShareValue.js +7 -8
  11. package/build/features/entity/screens/EntityCapital/EntityCapital.js +13 -5
  12. package/build/features/entity/screens/EntityName/Article.d.ts +2 -1
  13. package/build/features/entity/screens/EntityName/Article.js +3 -2
  14. package/build/features/entity/screens/EntityName/EntityName.js +34 -12
  15. package/build/features/entity/screens/EntityName/EntityTypeList.d.ts +1 -14
  16. package/build/features/entity/screens/EntityName/EntityTypeList.js +7 -16
  17. package/build/features/entity/screens/EntityName/ExpiryDate.d.ts +2 -1
  18. package/build/features/entity/screens/EntityName/ExpiryDate.js +2 -4
  19. package/build/features/entity/screens/EntityName/IssuingDate.d.ts +2 -1
  20. package/build/features/entity/screens/EntityName/IssuingDate.js +2 -4
  21. package/build/features/entity/screens/EntityName/LegalName.d.ts +2 -1
  22. package/build/features/entity/screens/EntityName/LegalName.js +3 -4
  23. package/build/features/entity/screens/EntityName/LicenseCertificate.js +8 -2
  24. package/build/features/entity/screens/EntityName/LicenseNumber.d.ts +2 -1
  25. package/build/features/entity/screens/EntityName/LicenseNumber.js +4 -5
  26. package/build/features/entity/screens/EntityName/UnifiedNumber.d.ts +2 -1
  27. package/build/features/entity/screens/EntityName/UnifiedNumber.js +3 -4
  28. package/build/features/shared/EndAdornment/EndAdornment.d.ts +1 -1
  29. package/build/features/shared/EndAdornment/EndAdornment.js +1 -1
  30. package/build/utils/date.d.ts +1 -0
  31. package/build/utils/date.js +6 -0
  32. package/package.json +1 -1
@@ -10,6 +10,7 @@ export interface DatePickerProps extends CalendarProps {
10
10
  readOnly?: boolean;
11
11
  dir?: string;
12
12
  isDob?: boolean;
13
+ isVerified?: boolean;
13
14
  }
14
- declare const _default: React.MemoExoticComponent<({ onDateChange, disabled, readOnly, onClick, onDatePicked, dir, defaultValue, isDob, ...rest }: DatePickerProps) => JSX.Element>;
15
+ declare const _default: React.MemoExoticComponent<({ onDateChange, disabled, readOnly, onClick, onDatePicked, dir, defaultValue, isDob, isVerified, ...rest }: DatePickerProps) => JSX.Element>;
15
16
  export default _default;
@@ -28,9 +28,9 @@ import Box from '@mui/material/Box';
28
28
  import { styled } from '@mui/material/styles';
29
29
  import Divider from '@mui/material/Divider';
30
30
  import Collapse from '../Collapse';
31
- import ExpandIcon from '../ExpandIcon';
32
31
  import CalendarTodayOutlined from '@mui/icons-material/CalendarTodayOutlined';
33
- import { convertNumbers2English, dateFormat, getEighteenYearsAgo, scrollDown, scrollUp } from '../../utils';
32
+ import { convertToEnglishDateFormat, getEighteenYearsAgo, scrollDown, scrollUp } from '../../utils';
33
+ import { EndAdornmentExpanded } from '../../features/shared/EndAdornment';
34
34
  import Input from '../Input';
35
35
  import Text from '../Text';
36
36
  import './customStyle.css';
@@ -61,11 +61,12 @@ var ArrowIcon = styled(Text, { shouldForwardProp: function (prop) { return prop
61
61
  var theme = _a.theme, disabled = _a.disabled;
62
62
  return ({
63
63
  cursor: disabled ? 'auto' : 'pointer',
64
- marginInlineEnd: theme.spacing(2.5)
64
+ marginInlineEnd: theme.spacing(2.5),
65
+ display: 'flex'
65
66
  });
66
67
  });
67
68
  var DatePicker = function (_a) {
68
- var onDateChange = _a.onDateChange, disabled = _a.disabled, readOnly = _a.readOnly, onClick = _a.onClick, onDatePicked = _a.onDatePicked, dir = _a.dir, defaultValue = _a.defaultValue, isDob = _a.isDob, rest = __rest(_a, ["onDateChange", "disabled", "readOnly", "onClick", "onDatePicked", "dir", "defaultValue", "isDob"]);
69
+ var onDateChange = _a.onDateChange, disabled = _a.disabled, readOnly = _a.readOnly, onClick = _a.onClick, onDatePicked = _a.onDatePicked, dir = _a.dir, defaultValue = _a.defaultValue, isDob = _a.isDob, isVerified = _a.isVerified, rest = __rest(_a, ["onDateChange", "disabled", "readOnly", "onClick", "onDatePicked", "dir", "defaultValue", "isDob", "isVerified"]);
69
70
  var _b = useState(), date = _b[0], setDate = _b[1];
70
71
  var _c = React.useState(null), anchor = _c[0], setAnchor = _c[1];
71
72
  useEffect(function () {
@@ -86,18 +87,18 @@ var DatePicker = function (_a) {
86
87
  setTimeout(function () { return scrollUp(elementId); }, 550);
87
88
  onClick === null || onClick === void 0 ? void 0 : onClick();
88
89
  };
89
- var formattedDate = function (d) {
90
- var date = new Date(d);
91
- var formattedDate = dateFormat(date, 'YYYY-MM-DD');
92
- return convertNumbers2English(formattedDate);
93
- };
94
90
  var handleOnDateChange = function (date) {
95
91
  setDate(date);
96
- onDateChange === null || onDateChange === void 0 ? void 0 : onDateChange(formattedDate(date));
92
+ onDateChange === null || onDateChange === void 0 ? void 0 : onDateChange(convertToEnglishDateFormat(date));
97
93
  setAnchor(null);
98
94
  onDatePicked === null || onDatePicked === void 0 ? void 0 : onDatePicked();
99
95
  };
100
- return (_jsxs(Container, __assign({ disabled: disabled, id: 'container-calendar' }, { children: [_jsx(InputFieldStyled, { endAdornment: _jsx(ArrowIcon, __assign({ disabled: disabled }, { children: disabled ? '' : _jsx(ExpandIcon, { anchorEl: !!anchor }) })), value: date ? formattedDate(date) : '', placeholder: 'YYYY-MM-DD', onClick: function (e) {
96
+ var getEndAdornment = function () {
97
+ if (disabled && !isVerified)
98
+ return '';
99
+ return _jsx(EndAdornmentExpanded, { isVerified: isVerified, anchorEl: anchor });
100
+ };
101
+ return (_jsxs(Container, __assign({ disabled: disabled, id: 'container-calendar' }, { children: [_jsx(InputFieldStyled, { endAdornment: _jsx(ArrowIcon, __assign({ disabled: disabled }, { children: getEndAdornment() })), value: date ? convertToEnglishDateFormat(date) : '', placeholder: 'YYYY-MM-DD', onClick: function (e) {
101
102
  if (!disabled)
102
103
  toggleCalender(e);
103
104
  }, startAdornment: calenderIcon, disabled: disabled, readOnly: readOnly, dir: dir }), _jsxs(Collapse, __assign({ in: !!anchor }, { children: [_jsx(Calendar, __assign({}, rest, { value: date || (isDob ? new Date(getEighteenYearsAgo()) : undefined), calendarType: 'Hebrew', onChange: handleOnDateChange, locale: rest.locale, maxDate: rest.maxDate || defaultMax, minDate: rest.minDate || defaultMin })), _jsx(Divider, {})] }))] })));
@@ -28,20 +28,6 @@ export declare const InputLabelStyled: import("@emotion/styled").StyledComponent
28
28
  } & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "key" | keyof React.HTMLAttributes<HTMLSpanElement>> & {
29
29
  ref?: ((instance: HTMLSpanElement | null) => void) | React.RefObject<HTMLSpanElement> | null | undefined;
30
30
  }, 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>, {}, {}>;
31
- export declare const CheckIconStyled: import("@emotion/styled").StyledComponent<{
32
- children?: React.ReactNode;
33
- classes?: Partial<import("@mui/material").SvgIconClasses> | undefined;
34
- color?: "inherit" | "disabled" | "error" | "info" | "success" | "primary" | "secondary" | "action" | "warning" | undefined;
35
- fontSize?: "small" | "inherit" | "medium" | "large" | undefined;
36
- htmlColor?: string | undefined;
37
- inheritViewBox?: boolean | undefined;
38
- shapeRendering?: string | undefined;
39
- sx?: import("@mui/material/styles").SxProps<import("@mui/material/styles").Theme> | undefined;
40
- titleAccess?: string | undefined;
41
- viewBox?: string | undefined;
42
- } & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<React.SVGProps<SVGSVGElement>, "string" | "name" | "type" | "version" | "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" | "children" | "key" | "id" | "lang" | "tabIndex" | "role" | "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" | "origin" | "method" | "operator" | "spacing" | "elevation" | "in" | "max" | "href" | "orientation" | "media" | "target" | "min" | "viewBox" | "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" | "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" | "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"> & {
43
- ref?: ((instance: SVGSVGElement | null) => void) | React.RefObject<SVGSVGElement> | null | undefined;
44
- }, keyof import("@mui/material/OverridableComponent").CommonProps | "color" | "fontSize" | "shapeRendering" | "children" | "sx" | "htmlColor" | "inheritViewBox" | "titleAccess" | "viewBox"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
45
31
  interface ActivityListProps {
46
32
  onListOpen?: () => void;
47
33
  onListClose?: () => void;
@@ -29,13 +29,13 @@ import { useLanguage, useAppSelector } from '../../../../hooks';
29
29
  import SimpleList from '../../../../components/SimpleList';
30
30
  import Collapse from '../../../../components/Collapse';
31
31
  import ExpandIcon from '../../../../components/ExpandIcon';
32
- import CheckIcon from '@mui/icons-material/Check';
33
32
  import Text from '../../../../components/Text';
34
- import { findCurrencyByIso2, isExist, groupSectionWithSelectedActivitiesAtBeginning } from '../../../../utils';
33
+ import { findCurrencyByIso2, isExist, groupSectionWithSelectedActivitiesAtBeginning, hasVerifiedValue } from '../../../../utils';
35
34
  import { ScreenContainer } from '../../../shared/Containers';
36
35
  import Search from '../../../shared/Search';
37
36
  import Input from '../../../shared/Input';
38
37
  import { entitySelector } from '../../../app/entity/entityStore';
38
+ import CheckIcon from '../../../../features/shared/CheckIcon';
39
39
  var InputStyled = styled(Input)(function (_a) {
40
40
  var theme = _a.theme, readOnly = _a.readOnly;
41
41
  return ({
@@ -53,14 +53,6 @@ export var InputLabelStyled = styled(Text)(function (_a) {
53
53
  var theme = _a.theme;
54
54
  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
55
  });
56
- export var CheckIconStyled = styled(CheckIcon)(function (_a) {
57
- var theme = _a.theme;
58
- return ({
59
- color: theme.palette.success.main,
60
- display: 'flex',
61
- alignItems: 'flex-end'
62
- });
63
- });
64
56
  var ListItem = styled(Box)(function (_a) {
65
57
  var theme = _a.theme;
66
58
  return ({
@@ -99,7 +91,7 @@ var ActivityList = function (_a) {
99
91
  var activitiesControl = useController({ name: 'activities', control: control });
100
92
  var data = useAppSelector(entitySelector).data;
101
93
  var settingsData = useAppSelector(settingsSelector).data;
102
- var activityList = (data.verify.responseBody || {}).activityList;
94
+ var _f = data.verify.responseBody || {}, activityList = _f.activityList, entity = _f.entity;
103
95
  var controlValue = activitiesControl.field.value;
104
96
  var countryCode = settingsData.businessCountry;
105
97
  var handleOpenMainMenu = function (event) {
@@ -121,6 +113,9 @@ var ActivityList = function (_a) {
121
113
  setActivities(activityList);
122
114
  }
123
115
  };
116
+ var isActivityVerified = function (item) {
117
+ return hasVerifiedValue(entity === null || entity === void 0 ? void 0 : entity.data_verification, "activities.".concat(item.id));
118
+ };
124
119
  var handleOpenSubMenu = function (index) {
125
120
  if (subIndex === index)
126
121
  setSubIndex('');
@@ -249,7 +244,7 @@ var ActivityList = function (_a) {
249
244
  var _a;
250
245
  var isDivisionNotAvailable = !section.divisions || ((_a = section.divisions) === null || _a === void 0 ? void 0 : _a.length) === 0;
251
246
  var showCheck = section.id === getSelectedActivitySectionFlag(section) && isDivisionNotAvailable;
252
- return (_jsxs(ListItemContainer, { children: [_jsxs(ListItem, __assign({ sx: __assign({ bgcolor: 'rgb(196 184 184 / 20%)', borderBottom: '1px solid rgba(227, 232, 238, 1)' }, (isDivisionNotAvailable && { bgcolor: 'inherit', borderBottom: 'none' })) }, { children: [_jsx(NameContainer, __assign({ isAr: isAr, isSelected: section.id === getSelectedActivitySectionFlag(section), sx: __assign({}, (isDivisionNotAvailable && { paddingInlineStart: '5px' })) }, { children: getSelectedActivityName(section) })), showCheck ? _jsx(CheckIconStyled, {}) : !isDivisionNotAvailable && _jsx(ExpandIcon, { anchorEl: subIndex === section.id })] })), _jsx(Collapse, __assign({ in: section.id === subIndex && !isDivisionNotAvailable }, { children: _jsx(DivisionListStyled, { sx: { pt: 0, pb: 0 }, list: (!isDivisionNotAvailable && section.divisions) || [], onSelectItem: function (division, e) {
247
+ return (_jsxs(ListItemContainer, { children: [_jsxs(ListItem, __assign({ sx: __assign({ bgcolor: 'rgb(196 184 184 / 20%)', borderBottom: '1px solid rgba(227, 232, 238, 1)' }, (isDivisionNotAvailable && { bgcolor: 'inherit', borderBottom: 'none' })) }, { children: [_jsx(NameContainer, __assign({ isAr: isAr, isSelected: section.id === getSelectedActivitySectionFlag(section), sx: __assign({}, (isDivisionNotAvailable && { paddingInlineStart: '5px' })) }, { children: getSelectedActivityName(section) })), showCheck ? (_jsx(CheckIcon, { isVerified: isActivityVerified(section) })) : (!isDivisionNotAvailable && _jsx(ExpandIcon, { anchorEl: subIndex === section.id }))] })), _jsx(Collapse, __assign({ in: section.id === subIndex && !isDivisionNotAvailable }, { children: _jsx(DivisionListStyled, { sx: { pt: 0, pb: 0 }, list: (!isDivisionNotAvailable && section.divisions) || [], onSelectItem: function (division, e) {
253
248
  e.stopPropagation();
254
249
  var isOnlyOneItem = !division.activities || division.activities.length <= 1;
255
250
  if (isOnlyOneItem)
@@ -260,11 +255,11 @@ var ActivityList = function (_a) {
260
255
  var _a;
261
256
  var isOnlyOneItem = !division.activities || ((_a = division.activities) === null || _a === void 0 ? void 0 : _a.length) <= 1;
262
257
  var showCheck = division.id === getSelectedActivityDivisionFlag(division) && isOnlyOneItem;
263
- return (_jsxs(ListItemContainer, { children: [_jsxs(ListItem, __assign({ sx: __assign({ bgcolor: 'rgb(196 184 184 / 6%)', borderBottom: '1px solid rgba(227, 232, 238, 0.6)' }, (isOnlyOneItem && { bgcolor: 'inherit', borderBottom: 'none' })) }, { children: [_jsx(NameContainer, __assign({ isAr: isAr, isSelected: division.id === getSelectedActivityDivisionFlag(division), sx: __assign({}, (isOnlyOneItem && { paddingInlineStart: '5px' })) }, { children: getSelectedActivityName(division) })), showCheck ? _jsx(CheckIconStyled, {}) : !isOnlyOneItem && _jsx(ExpandIcon, { anchorEl: subItemIndex === division.id })] })), _jsx(Collapse, __assign({ in: division.id === subItemIndex && !isOnlyOneItem }, { children: _jsx(ActivityListStyled, { sx: { pt: 0, pb: 0 }, list: (!isOnlyOneItem && division.activities) || [], onSelectItem: function (activity, e) {
258
+ return (_jsxs(ListItemContainer, { children: [_jsxs(ListItem, __assign({ sx: __assign({ bgcolor: 'rgb(196 184 184 / 6%)', borderBottom: '1px solid rgba(227, 232, 238, 0.6)' }, (isOnlyOneItem && { bgcolor: 'inherit', borderBottom: 'none' })) }, { children: [_jsx(NameContainer, __assign({ isAr: isAr, isSelected: division.id === getSelectedActivityDivisionFlag(division), sx: __assign({}, (isOnlyOneItem && { paddingInlineStart: '5px' })) }, { children: getSelectedActivityName(division) })), showCheck ? (_jsx(CheckIcon, { isVerified: isActivityVerified(division) })) : (!isOnlyOneItem && _jsx(ExpandIcon, { anchorEl: subItemIndex === division.id }))] })), _jsx(Collapse, __assign({ in: division.id === subItemIndex && !isOnlyOneItem }, { children: _jsx(ActivityListStyled, { sx: { pt: 0, pb: 0 }, list: (!isOnlyOneItem && division.activities) || [], onSelectItem: function (activity, e) {
264
259
  e.stopPropagation();
265
260
  onSelectItem(activity);
266
261
  }, listItemProps: { sx: { padding: 0, '&:last-child': { paddingBottom: 0 } } }, renderItem: function (activity, idx) {
267
- return (_jsxs(ListItem, __assign({ sx: { mt: idx === 0 ? 1 : 0 } }, { children: [_jsx(NameContainer, __assign({ isAr: isAr, isSelected: activity.id === getSelectedActivityFlag(activity) }, { children: getSelectedActivityName(activity) })), activity.id === getSelectedActivityFlag(activity) && _jsx(CheckIconStyled, {})] })));
262
+ return (_jsxs(ListItem, __assign({ sx: { mt: idx === 0 ? 1 : 0 } }, { children: [_jsx(NameContainer, __assign({ isAr: isAr, isSelected: activity.id === getSelectedActivityFlag(activity) }, { children: getSelectedActivityName(activity) })), activity.id === getSelectedActivityFlag(activity) && _jsx(CheckIcon, { isVerified: isActivityVerified(activity) })] })));
268
263
  } }) }))] }, idx));
269
264
  } }) }))] }));
270
265
  } })] }))] }));
@@ -1,6 +1,7 @@
1
1
  import * as React from 'react';
2
2
  interface CapitalPaidProps {
3
3
  readOnly?: boolean;
4
+ isVerified?: boolean;
4
5
  }
5
- declare const _default: React.MemoExoticComponent<({ readOnly }: CapitalPaidProps) => JSX.Element>;
6
+ declare const _default: React.MemoExoticComponent<({ readOnly, isVerified }: CapitalPaidProps) => JSX.Element>;
6
7
  export default _default;
@@ -20,9 +20,10 @@ import { findCurrencyByIso2, formatNumberAsCurrency, removeAllCharsFromNumber }
20
20
  import { ScreenContainer } from '../../../shared/Containers';
21
21
  import Input from '../../../shared/Input';
22
22
  import { clearError, entitySelector } from '../../../app/entity/entityStore';
23
+ import { EndAdornment } from '../../../shared/EndAdornment';
23
24
  var CapitalPaid = function (_a) {
24
25
  var _b, _c;
25
- var readOnly = _a.readOnly;
26
+ var readOnly = _a.readOnly, isVerified = _a.isVerified;
26
27
  var t = useTranslation().t;
27
28
  var data = useAppSelector(entitySelector).data;
28
29
  var settingsData = useAppSelector(settingsSelector).data;
@@ -31,7 +32,6 @@ var CapitalPaid = function (_a) {
31
32
  var entity = (data.verify.responseBody || {}).entity;
32
33
  var paid = (_b = entity === null || entity === void 0 ? void 0 : entity.capital) === null || _b === void 0 ? void 0 : _b.paid;
33
34
  var countryCode = settingsData.businessCountry.iso2;
34
- var disabled = false;
35
35
  var handleChange = function (_a) {
36
36
  var target = _a.target;
37
37
  if (error)
@@ -42,9 +42,8 @@ var CapitalPaid = function (_a) {
42
42
  var capitalPaidControl = useController({ control: control, name: 'capitalPaid' });
43
43
  var capitalPaidValue = capitalPaidControl.field.value;
44
44
  var error = (_c = capitalPaidControl.fieldState.error) === null || _c === void 0 ? void 0 : _c.message;
45
- var hide = !paid && disabled;
46
- return (_jsx(Collapse, __assign({ in: !hide }, { children: _jsx(ScreenContainer, __assign({ sx: { mt: 2.5 } }, { children: _jsx(Input, { readOnly: readOnly, label: t('capital_paid_label', {
45
+ return (_jsx(Collapse, __assign({ in: !!paid }, { children: _jsx(ScreenContainer, __assign({ sx: { mt: 2.5 } }, { children: _jsx(Input, { readOnly: readOnly, label: t('capital_paid_label', {
47
46
  currency: t(findCurrencyByIso2(countryCode))
48
- }), onChange: handleChange, disabled: disabled, value: capitalPaidValue, sx: { '& .MuiInputBase-input': { cursor: 'auto' } }, placeholder: t('capital_paid_hint'), warningType: 'alert', warningMessage: error && t(error) }) })) })));
47
+ }), onChange: handleChange, value: capitalPaidValue, sx: { '& .MuiInputBase-input': { cursor: 'auto' } }, placeholder: t('capital_paid_hint'), warningType: 'alert', warningMessage: error && t(error), endAdornment: _jsx(EndAdornment, { value: capitalPaidValue, isVerified: isVerified }) }) })) })));
49
48
  };
50
49
  export default React.memo(CapitalPaid);
@@ -1,6 +1,7 @@
1
1
  import * as React from 'react';
2
2
  interface CapitalShareCountProps {
3
3
  readOnly?: boolean;
4
+ isVerified?: boolean;
4
5
  }
5
- declare const _default: React.MemoExoticComponent<({ readOnly }: CapitalShareCountProps) => JSX.Element>;
6
+ declare const _default: React.MemoExoticComponent<({ readOnly, isVerified }: CapitalShareCountProps) => JSX.Element>;
6
7
  export default _default;
@@ -19,17 +19,16 @@ import { removeAllCharsFromNumber } from '../../../../utils';
19
19
  import { ScreenContainer } from '../../../shared/Containers';
20
20
  import Input from '../../../shared/Input';
21
21
  import { clearError, entitySelector } from '../../../app/entity/entityStore';
22
+ import { EndAdornment } from '../../../shared/EndAdornment';
22
23
  var CapitalShareCount = function (_a) {
23
24
  var _b, _c, _d;
24
- var readOnly = _a.readOnly;
25
+ var readOnly = _a.readOnly, isVerified = _a.isVerified;
25
26
  var t = useTranslation().t;
26
27
  var data = useAppSelector(entitySelector).data;
27
28
  var control = useFormContext().control;
28
29
  var dispatch = useAppDispatch();
29
30
  var entity = (data.verify.responseBody || {}).entity;
30
31
  var shareCount = (_c = (_b = entity === null || entity === void 0 ? void 0 : entity.capital) === null || _b === void 0 ? void 0 : _b.shares) === null || _c === void 0 ? void 0 : _c.count;
31
- var disabled = false;
32
- var hide = !shareCount && disabled;
33
32
  var handleChange = function (_a) {
34
33
  var target = _a.target;
35
34
  if (error)
@@ -40,6 +39,6 @@ var CapitalShareCount = function (_a) {
40
39
  var capitalShareCountControl = useController({ control: control, name: 'capitalShareCount' });
41
40
  var capitalShareCountValue = capitalShareCountControl.field.value;
42
41
  var error = (_d = capitalShareCountControl.fieldState.error) === null || _d === void 0 ? void 0 : _d.message;
43
- return (_jsx(Collapse, __assign({ in: !hide }, { children: _jsx(ScreenContainer, __assign({ sx: { mt: 2.5 } }, { children: _jsx(Input, { readOnly: readOnly, label: t('capital_share_count_label'), onChange: handleChange, disabled: disabled, value: capitalShareCountValue, sx: { '& .MuiInputBase-input': { cursor: 'auto' } }, placeholder: t('capital_share_count_hint'), warningType: 'alert', warningMessage: error && t(error) }) })) })));
42
+ return (_jsx(Collapse, __assign({ in: !!shareCount }, { children: _jsx(ScreenContainer, __assign({ sx: { mt: 2.5 } }, { children: _jsx(Input, { readOnly: readOnly, label: t('capital_share_count_label'), onChange: handleChange, value: capitalShareCountValue, sx: { '& .MuiInputBase-input': { cursor: 'auto' } }, placeholder: t('capital_share_count_hint'), warningType: 'alert', warningMessage: error && t(error), endAdornment: _jsx(EndAdornment, { value: capitalShareCountValue, isVerified: isVerified }) }) })) })));
44
43
  };
45
44
  export default React.memo(CapitalShareCount);
@@ -1,6 +1,7 @@
1
1
  import * as React from 'react';
2
2
  interface CapitalShareValueProps {
3
3
  readOnly?: boolean;
4
+ isVerified?: boolean;
4
5
  }
5
- declare const _default: React.MemoExoticComponent<({ readOnly }: CapitalShareValueProps) => JSX.Element>;
6
+ declare const _default: React.MemoExoticComponent<({ readOnly, isVerified }: CapitalShareValueProps) => JSX.Element>;
6
7
  export default _default;
@@ -13,16 +13,17 @@ import { jsx as _jsx } from "react/jsx-runtime";
13
13
  import * as React from 'react';
14
14
  import { useTranslation } from 'react-i18next';
15
15
  import { useController, useFormContext } from 'react-hook-form';
16
+ import { findCurrencyByIso2, formatNumberAsCurrency, removeAllCharsFromNumber } from '../../../../utils';
17
+ import { settingsSelector } from '../../../../app/settings';
18
+ import { useAppDispatch, useAppSelector } from '../../../../hooks';
16
19
  import Collapse from '@mui/material/Collapse';
17
20
  import { ScreenContainer } from '../../../shared/Containers';
18
21
  import Input from '../../../shared/Input';
19
- import { useAppDispatch, useAppSelector } from '../../../../hooks';
20
22
  import { clearError, entitySelector } from '../../../app/entity/entityStore';
21
- import { findCurrencyByIso2, formatNumberAsCurrency, removeAllCharsFromNumber } from '../../../../utils';
22
- import { settingsSelector } from '../../../../app/settings';
23
+ import { EndAdornment } from '../../../shared/EndAdornment';
23
24
  var CapitalShareValue = function (_a) {
24
25
  var _b, _c, _d;
25
- var readOnly = _a.readOnly;
26
+ var readOnly = _a.readOnly, isVerified = _a.isVerified;
26
27
  var t = useTranslation().t;
27
28
  var data = useAppSelector(entitySelector).data;
28
29
  var settingsData = useAppSelector(settingsSelector).data;
@@ -31,8 +32,6 @@ var CapitalShareValue = function (_a) {
31
32
  var entity = (data.verify.responseBody || {}).entity;
32
33
  var shareValue = (_c = (_b = entity === null || entity === void 0 ? void 0 : entity.capital) === null || _b === void 0 ? void 0 : _b.shares) === null || _c === void 0 ? void 0 : _c.value;
33
34
  var countryCode = settingsData.businessCountry.iso2;
34
- var disabled = false;
35
- var hide = !shareValue && disabled;
36
35
  var handleChange = function (_a) {
37
36
  var target = _a.target;
38
37
  if (error)
@@ -43,8 +42,8 @@ var CapitalShareValue = function (_a) {
43
42
  var capitalShareValueControl = useController({ control: control, name: 'capitalShareValue' });
44
43
  var capitalShareValueValue = capitalShareValueControl.field.value;
45
44
  var error = (_d = capitalShareValueControl.fieldState.error) === null || _d === void 0 ? void 0 : _d.message;
46
- return (_jsx(Collapse, __assign({ in: !hide }, { children: _jsx(ScreenContainer, __assign({ sx: { mt: 2.5 } }, { children: _jsx(Input, { readOnly: readOnly, label: t('capital_share_value_label', {
45
+ return (_jsx(Collapse, __assign({ in: !!shareValue }, { children: _jsx(ScreenContainer, __assign({ sx: { mt: 2.5 } }, { children: _jsx(Input, { readOnly: readOnly, label: t('capital_share_value_label', {
47
46
  currency: t(findCurrencyByIso2(countryCode))
48
- }), onChange: handleChange, disabled: disabled, value: capitalShareValueValue, sx: { '& .MuiInputBase-input': { cursor: 'auto' } }, placeholder: t('capital_share_value_hint'), warningType: 'alert', warningMessage: error && t(error) }) })) })));
47
+ }), onChange: handleChange, value: capitalShareValueValue, sx: { '& .MuiInputBase-input': { cursor: 'auto' } }, placeholder: t('capital_share_value_hint'), warningType: 'alert', warningMessage: error && t(error), endAdornment: _jsx(EndAdornment, { value: capitalShareValueValue, isVerified: isVerified }) }) })) })));
49
48
  };
50
49
  export default React.memo(CapitalShareValue);
@@ -15,7 +15,8 @@ import { FormProvider, useForm } from 'react-hook-form';
15
15
  import { useTranslation } from 'react-i18next';
16
16
  import { styled } from '@mui/material/styles';
17
17
  import Collapse from '@mui/material/Collapse';
18
- import { useAppDispatch, useAppSelector, useDataNoneEditable, useFormReadOnly, useLanguage, useSetFromDefaultValues, useFormErrorAndUpdateReadOnly, useExcludeReadOnlyFelids } from '../../../../hooks';
18
+ import { useAppDispatch, useAppSelector, useDataNoneEditable, useFormReadOnly, useLanguage, useSetFromDefaultValues, useFormErrorAndUpdateReadOnly, useExcludeReadOnlyFelids, useDataVerified } from '../../../../hooks';
19
+ import { removeAllCharsFromNumber } from '../../../../utils';
19
20
  import { clearError, entitySelector, updateEntityCapital } from '../../../app/entity/entityStore';
20
21
  import { yupResolver } from '@hookform/resolvers/yup';
21
22
  import { handlePrevScreenStep } from '../../../../app/settings';
@@ -32,13 +33,15 @@ var FormStyled = styled(Form)(function () { return ({
32
33
  flexDirection: 'column'
33
34
  }); });
34
35
  var EntityCapital = function (_a) {
35
- var _b = React.useState(false), anchorEl = _b[0], setAnchorEl = _b[1];
36
- var _c = useAppSelector(entitySelector), data = _c.data, loading = _c.loading, error = _c.error, uploading = _c.uploading;
36
+ var _b, _c, _d, _e, _f;
37
+ var _g = React.useState(false), anchorEl = _g[0], setAnchorEl = _g[1];
38
+ var _h = useAppSelector(entitySelector), data = _h.data, loading = _h.loading, error = _h.error, uploading = _h.uploading;
37
39
  var isAr = useLanguage().isAr;
38
40
  var t = useTranslation().t;
39
41
  var dispatch = useAppDispatch();
40
- var _d = data.entityCapitalData, responseBody = _d.responseBody, capitalPaid = _d.capitalPaid, capitalShareCount = _d.capitalShareCount, capitalShareValue = _d.capitalShareValue, activities = _d.activities;
42
+ var _j = data.entityCapitalData, responseBody = _j.responseBody, capitalPaid = _j.capitalPaid, capitalShareCount = _j.capitalShareCount, capitalShareValue = _j.capitalShareValue, activities = _j.activities;
41
43
  var entity = (data.verify.responseBody || {}).entity;
44
+ var _k = entity || {}, data_verification = _k.data_verification, capital = _k.capital;
42
45
  var methods = useForm({
43
46
  resolver: yupResolver(EntityCapitalValidationSchema()),
44
47
  defaultValues: {
@@ -50,6 +53,7 @@ var EntityCapital = function (_a) {
50
53
  mode: 'onChange'
51
54
  });
52
55
  useSetFromDefaultValues(methods, data.entityCapitalData, true);
56
+ var watch = methods.watch;
53
57
  var originalReadOnly = useFormReadOnly(methods);
54
58
  var noneEditable = useDataNoneEditable(entity === null || entity === void 0 ? void 0 : entity.data_status, [
55
59
  'activities',
@@ -59,6 +63,10 @@ var EntityCapital = function (_a) {
59
63
  ]);
60
64
  var readOnly = useFormErrorAndUpdateReadOnly(methods, originalReadOnly, noneEditable);
61
65
  var getFelids = useExcludeReadOnlyFelids(methods, readOnly).getFelids;
66
+ var dataVerified = useDataVerified(data_verification, ['capital.paid', 'capital.shares.count', 'capital.shares.value']);
67
+ var isCapitalPaidVerified = dataVerified['capital.paid'] && ((_b = capital === null || capital === void 0 ? void 0 : capital.paid) === null || _b === void 0 ? void 0 : _b.toString()) === removeAllCharsFromNumber(watch('capitalPaid'));
68
+ var isCapitalShareCountVerified = dataVerified['capital.shares.count'] && ((_d = (_c = capital === null || capital === void 0 ? void 0 : capital.shares) === null || _c === void 0 ? void 0 : _c.count) === null || _d === void 0 ? void 0 : _d.toString()) === watch('capitalShareCount');
69
+ var isCapitalShareValueVerified = dataVerified['capital.shares.value'] && ((_f = (_e = capital === null || capital === void 0 ? void 0 : capital.shares) === null || _e === void 0 ? void 0 : _e.value) === null || _f === void 0 ? void 0 : _f.toString()) === removeAllCharsFromNumber(watch('capitalShareValue'));
62
70
  var onSubmit = function (data) {
63
71
  dispatch(updateEntityCapital(getFelids(data)));
64
72
  };
@@ -73,6 +81,6 @@ var EntityCapital = function (_a) {
73
81
  setAnchorEl(flag);
74
82
  };
75
83
  var disabled = !methods.formState.isValid || !!error || uploading;
76
- return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(ActivityList, { readOnly: readOnly['activities'] || noneEditable['activities'], onListOpen: function () { return handleActivitiesOpenClose(true); }, onListClose: function () { return handleActivitiesOpenClose(false); } }), _jsxs(Collapse, __assign({ in: !anchorEl }, { children: [_jsx(CapitalPaid, { readOnly: readOnly['capitalPaid'] || noneEditable['capital.paid'] }), _jsx(CapitalShareCount, { readOnly: readOnly['capitalShareCount'] || noneEditable['capital.shares.count'] }), _jsx(CapitalShareValue, { readOnly: readOnly['capitalShareValue'] || noneEditable['capital.shares.value'] }), _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, loading: loading, error: t(error || '') }, { children: t('next') }))] }))] })) })) }));
84
+ return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(ActivityList, { readOnly: readOnly['activities'] || noneEditable['activities'], onListOpen: function () { return handleActivitiesOpenClose(true); }, onListClose: function () { return handleActivitiesOpenClose(false); } }), _jsxs(Collapse, __assign({ in: !anchorEl }, { children: [_jsx(CapitalPaid, { readOnly: readOnly['capitalPaid'] || noneEditable['capital.paid'], isVerified: isCapitalPaidVerified }), _jsx(CapitalShareCount, { readOnly: readOnly['capitalShareCount'] || noneEditable['capital.shares.count'], isVerified: isCapitalShareCountVerified }), _jsx(CapitalShareValue, { readOnly: readOnly['capitalShareValue'] || noneEditable['capital.shares.value'], isVerified: isCapitalShareValueVerified }), _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, loading: loading, error: t(error || '') }, { children: t('next') }))] }))] })) })) }));
77
85
  };
78
86
  export default EntityCapital;
@@ -4,6 +4,7 @@ declare type ArticleProps = {
4
4
  show: boolean;
5
5
  readOnly?: boolean;
6
6
  defaultFile?: FileDetails;
7
+ isVerified?: boolean;
7
8
  };
8
- declare const Article: ({ show, readOnly, defaultFile }: ArticleProps) => JSX.Element;
9
+ declare const Article: ({ show, readOnly, defaultFile, isVerified }: ArticleProps) => JSX.Element;
9
10
  export default Article;
@@ -28,13 +28,14 @@ var FeatureStyled = styled(ScreenContainer)(function (_a) {
28
28
  });
29
29
  var Article = function (_a) {
30
30
  var _b;
31
- var show = _a.show, readOnly = _a.readOnly, defaultFile = _a.defaultFile;
31
+ var show = _a.show, readOnly = _a.readOnly, defaultFile = _a.defaultFile, isVerified = _a.isVerified;
32
32
  var t = useTranslation().t;
33
33
  var control = useFormContext().control;
34
34
  var articleIdControl = useController({ name: 'articleId', control: control });
35
35
  var dispatch = useAppDispatch();
36
36
  var _c = useAppSelector(entitySelector), data = _c.data, error = _c.error, loading = _c.loading;
37
37
  var AOA_file = (((_b = data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.entity) || {}).AOA_file;
38
+ var id = articleIdControl.field.value;
38
39
  var handleArticleChange = function (id) {
39
40
  if (error)
40
41
  dispatch(clearError());
@@ -47,6 +48,6 @@ var Article = function (_a) {
47
48
  dispatch(clearAOAFile());
48
49
  articleIdControl.field.onChange(undefined);
49
50
  };
50
- return (_jsx(Collapse, __assign({ in: show }, { children: _jsx(FeatureStyled, { children: _jsx(UploadWrapper, { readOnly: readOnly, id: 'articleId', fileRemoveType: FileRemoveType.AOA_FILE_ID, control: control, label: t('title_article'), title: t('drag_and_drop'), subTitle: t('subtitle_drop'), dragDescription: t('article_of_association'), uploadingTitle: t('file_uploading_title'), successTitle: t('success_upload_bank_statement'), onFileUploaded: handleArticleChange, isSubmitting: loading, onDeleteFile: handleReset, defaultFile: defaultFile, purpose: DocumentPurpose.ARTICLE_ASSOCIATION, fileUploadingStatus: function (uploading) { return dispatch(uploadingArticleStatus(uploading)); } }) }) })));
51
+ return (_jsx(Collapse, __assign({ in: show }, { children: _jsx(FeatureStyled, { children: _jsx(UploadWrapper, { readOnly: readOnly, id: 'articleId', fileRemoveType: FileRemoveType.AOA_FILE_ID, control: control, label: t('title_article'), title: t('drag_and_drop'), subTitle: t('subtitle_drop'), dragDescription: t('article_of_association'), uploadingTitle: t('file_uploading_title'), successTitle: t('success_upload_bank_statement'), onFileUploaded: handleArticleChange, isSubmitting: loading, onDeleteFile: handleReset, defaultFile: defaultFile, purpose: DocumentPurpose.ARTICLE_ASSOCIATION, isVerified: isVerified && !id, fileUploadingStatus: function (uploading) { return dispatch(uploadingArticleStatus(uploading)); } }) }) })));
51
52
  };
52
53
  export default Article;
@@ -15,9 +15,9 @@ import { FormProvider, useForm } from 'react-hook-form';
15
15
  import { useTranslation } from 'react-i18next';
16
16
  import { yupResolver } from '@hookform/resolvers/yup';
17
17
  import { styled } from '@mui/material/styles';
18
- import { useAppDispatch, useAppSelector, useDataNoneEditable, useFormReadOnly, useLanguage, useSetFromDefaultValues, useFormErrorAndUpdateReadOnly, useExcludeReadOnlyFelids } from '../../../../hooks';
18
+ import { useAppDispatch, useAppSelector, useDataNoneEditable, useFormReadOnly, useLanguage, useSetFromDefaultValues, useFormErrorAndUpdateReadOnly, useExcludeReadOnlyFelids, useDataVerified } from '../../../../hooks';
19
19
  import { handlePrevScreenStep, settingsSelector } from '../../../../app/settings';
20
- import { getFileDetailsFromDocument, isKW, isSA } from '../../../../utils';
20
+ import { convertToEnglishDateFormat, getFileDetailsFromDocument, isKW, isSA } from '../../../../utils';
21
21
  import { BusinessType, DocumentPurpose } from '../../../../@types';
22
22
  import Form from '../../../../components/Form';
23
23
  import Collapse from '../../../../components/Collapse';
@@ -38,20 +38,22 @@ var FormStyled = styled(Form)(function () { return ({
38
38
  flexDirection: 'column'
39
39
  }); });
40
40
  var EntityName = function (_a) {
41
- var _b = React.useState(false), issueAnchorEl = _b[0], setIssueAnchorEl = _b[1];
42
- var _c = React.useState(false), expiryAnchorEl = _c[0], setExpiryAnchorEl = _c[1];
43
- var _d = React.useState(false), entityTypeAnchorEl = _d[0], setEntityTypeAnchorEl = _d[1];
44
- var _e = useAppSelector(entitySelector), data = _e.data, loading = _e.loading, error = _e.error, uploading = _e.uploading, uploadingArticle = _e.uploadingArticle;
41
+ var _b;
42
+ var _c = React.useState(false), issueAnchorEl = _c[0], setIssueAnchorEl = _c[1];
43
+ var _d = React.useState(false), expiryAnchorEl = _d[0], setExpiryAnchorEl = _d[1];
44
+ var _e = React.useState(false), entityTypeAnchorEl = _e[0], setEntityTypeAnchorEl = _e[1];
45
+ var _f = useAppSelector(entitySelector), data = _f.data, loading = _f.loading, error = _f.error, uploading = _f.uploading, uploadingArticle = _f.uploadingArticle;
45
46
  var settingsData = useAppSelector(settingsSelector).data;
46
47
  var isAr = useLanguage().isAr;
47
48
  var t = useTranslation().t;
48
49
  var dispatch = useAppDispatch();
49
- var _f = data.entityNameData, legalName = _f.legalName, licenseNumber = _f.licenseNumber, licenseType = _f.licenseType, entityType = _f.entityType, issuingDate = _f.issuingDate, expiryDate = _f.expiryDate, unifiedNumber = _f.unifiedNumber, certificateId = _f.certificateId, articleId = _f.articleId;
50
+ var _g = data.entityNameData, legalName = _g.legalName, licenseNumber = _g.licenseNumber, licenseType = _g.licenseType, entityType = _g.entityType, issuingDate = _g.issuingDate, expiryDate = _g.expiryDate, unifiedNumber = _g.unifiedNumber, certificateId = _g.certificateId, articleId = _g.articleId;
50
51
  var country_code = settingsData.businessCountry.iso2;
51
52
  var isSACountry = React.useMemo(function () { return isSA(country_code); }, [country_code]);
52
53
  var isKWCountry = React.useMemo(function () { return isKW(country_code); }, [country_code]);
53
54
  var isCR = licenseType === BusinessType.CR;
54
- var _g = data.verify.responseBody || {}, entity = _g.entity, flows = _g.flows;
55
+ var _h = data.verify.responseBody || {}, entity = _h.entity, flows = _h.flows;
56
+ var _j = entity || {}, AOA_file = _j.AOA_file, id = _j.id, documents = _j.documents, data_status = _j.data_status, data_verification = _j.data_verification, legal_name = _j.legal_name, type = _j.type, license = _j.license;
55
57
  var methods = useForm({
56
58
  resolver: yupResolver(isSACountry ? EntityNameValidationSchema() : EntityNameKWValidationSchema()),
57
59
  defaultValues: {
@@ -67,11 +69,12 @@ var EntityName = function (_a) {
67
69
  },
68
70
  mode: 'onChange'
69
71
  });
72
+ var watch = methods.watch;
70
73
  useSetFromDefaultValues(methods, data.entityNameData, true);
71
- var defaultCertificateFiles = React.useMemo(function () { return getFileDetailsFromDocument(entity === null || entity === void 0 ? void 0 : entity.documents, DocumentPurpose.CR); }, [entity === null || entity === void 0 ? void 0 : entity.documents]);
72
- var defaultArticleFile = React.useMemo(function () { return (entity === null || entity === void 0 ? void 0 : entity.AOA_file) && __assign(__assign({}, entity === null || entity === void 0 ? void 0 : entity.AOA_file), { docId: entity.id }); }, [entity === null || entity === void 0 ? void 0 : entity.AOA_file]);
74
+ var defaultCertificateFiles = React.useMemo(function () { return getFileDetailsFromDocument(documents, DocumentPurpose.CR); }, [documents]);
75
+ var defaultArticleFile = React.useMemo(function () { return AOA_file && __assign(__assign({}, AOA_file), { docId: id }); }, [AOA_file]);
73
76
  var originalReadOnly = useFormReadOnly(methods, { certificateId: defaultCertificateFiles, articleId: defaultArticleFile });
74
- var noneEditable = useDataNoneEditable(entity === null || entity === void 0 ? void 0 : entity.data_status, [
77
+ var noneEditable = useDataNoneEditable(data_status, [
75
78
  'legal_name.en',
76
79
  'legal_name.ar',
77
80
  'type',
@@ -84,6 +87,25 @@ var EntityName = function (_a) {
84
87
  ]);
85
88
  var readOnly = useFormErrorAndUpdateReadOnly(methods, originalReadOnly, noneEditable);
86
89
  var getFelids = useExcludeReadOnlyFelids(methods, readOnly).getFelids;
90
+ var dataVerified = useDataVerified(data_verification, [
91
+ 'legal_name.en',
92
+ 'legal_name.ar',
93
+ 'type',
94
+ 'license.number',
95
+ 'license.additional_info',
96
+ 'license.issuing_date',
97
+ 'license.expiry_date',
98
+ 'AOA_file_id'
99
+ ]);
100
+ var issueDateRes = (license === null || license === void 0 ? void 0 : license.issuing_date) && convertToEnglishDateFormat(new Date(license.issuing_date));
101
+ var expDateRes = (license === null || license === void 0 ? void 0 : license.expiry_date) && convertToEnglishDateFormat(new Date(license.expiry_date));
102
+ var isLegalNameVerified = dataVerified['legal_name.en'] && dataVerified['legal_name.ar'] && ((legal_name === null || legal_name === void 0 ? void 0 : legal_name.en) === watch('legalName') || (legal_name === null || legal_name === void 0 ? void 0 : legal_name.ar) === watch('legalName'));
103
+ var isEntityTypeVerified = dataVerified['type'] && type === watch('entityType');
104
+ var isLicenseNumberVerified = dataVerified['license.number'] && (license === null || license === void 0 ? void 0 : license.number) === watch('licenseNumber');
105
+ var isUnifiedNumberVerified = dataVerified['license.additional_info'] && ((_b = license === null || license === void 0 ? void 0 : license.additional_info) === null || _b === void 0 ? void 0 : _b.unified_number) === watch('unifiedNumber');
106
+ var isIssuingDateVerified = dataVerified['license.issuing_date'] && issueDateRes === watch('issuingDate');
107
+ var isExpiryDateVerified = dataVerified['license.expiry_date'] && expDateRes === watch('expiryDate');
108
+ var isArticleIdVerified = dataVerified['AOA_file_id'];
87
109
  var onSubmit = function (data) {
88
110
  dispatch(updateEntityName(getFelids(data)));
89
111
  };
@@ -110,6 +132,6 @@ var EntityName = function (_a) {
110
132
  var disabled = !methods.formState.isValid || !!error || uploading || uploadingArticle;
111
133
  var showLicenseNumber = !isSACountry ? isCR : true;
112
134
  var showUnifiedNumber = isSACountry ? isCR : false;
113
- return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(Collapse, __assign({ in: !expiryAnchorEl && !issueAnchorEl && !entityTypeAnchorEl }, { children: _jsx(LegalName, { readOnly: readOnly['legalName'] || (noneEditable['legal_name.en'] && noneEditable['legal_name.ar']) }) })), _jsx(Collapse, __assign({ in: !expiryAnchorEl && !issueAnchorEl }, { children: _jsx(EntityTypeList, { readOnly: readOnly['entityType'] || noneEditable['type'], onListOpen: function () { return handleEntityOpenClose(true); }, onListClose: function () { return handleEntityOpenClose(false); } }) })), _jsxs(Collapse, __assign({ in: !expiryAnchorEl && !issueAnchorEl && !entityTypeAnchorEl }, { children: [_jsx(LicenseNumber, { show: showLicenseNumber, readOnly: readOnly['licenseNumber'] || noneEditable['license.number'] }), _jsx(UnifiedNumber, { show: showUnifiedNumber, readOnly: readOnly['unifiedNumber'] || noneEditable['license.additional_info'] })] })), _jsx(Collapse, __assign({ in: !expiryAnchorEl && !entityTypeAnchorEl }, { children: _jsx(IssuingDate, { onDateClicked: handleIssueDateOpenClose, readOnly: readOnly['issuingDate'] || noneEditable['license.issuing_date'] }) })), _jsx(Collapse, __assign({ in: !issueAnchorEl && !entityTypeAnchorEl }, { children: _jsx(ExpiryDate, { onDateClicked: handleExpiryDateOpenClose, readOnly: readOnly['expiryDate'] || noneEditable['license.expiry_date'] }) })), _jsxs(Collapse, __assign({ in: !expiryAnchorEl && !issueAnchorEl && !entityTypeAnchorEl }, { children: [_jsx(LicenseCertificate, { defaultFiles: defaultCertificateFiles, show: !(isKWCountry && !isCR), readOnly: readOnly['certificateId'] || noneEditable['documents'] }), _jsx(Article, { defaultFile: defaultArticleFile, show: true, readOnly: readOnly['articleId'] || noneEditable['AOA_file_id'] })] })), _jsx(Collapse, __assign({ in: !expiryAnchorEl && !issueAnchorEl && !entityTypeAnchorEl }, { children: _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, loading: loading, error: t(error || '') }, { children: t('next') })) }))] })) })) }));
135
+ return (_jsx(ScreenContainer, { children: _jsx(FormProvider, __assign({}, methods, { children: _jsxs(FormStyled, __assign({ onSubmit: methods.handleSubmit(onSubmit) }, { children: [_jsx(Collapse, __assign({ in: !expiryAnchorEl && !issueAnchorEl && !entityTypeAnchorEl }, { children: _jsx(LegalName, { readOnly: readOnly['legalName'] || (noneEditable['legal_name.en'] && noneEditable['legal_name.ar']), isVerified: isLegalNameVerified }) })), _jsx(Collapse, __assign({ in: !expiryAnchorEl && !issueAnchorEl }, { children: _jsx(EntityTypeList, { readOnly: readOnly['entityType'] || noneEditable['type'], onListOpen: function () { return handleEntityOpenClose(true); }, onListClose: function () { return handleEntityOpenClose(false); }, isVerified: isEntityTypeVerified }) })), _jsxs(Collapse, __assign({ in: !expiryAnchorEl && !issueAnchorEl && !entityTypeAnchorEl }, { children: [_jsx(LicenseNumber, { show: showLicenseNumber, readOnly: readOnly['licenseNumber'] || noneEditable['license.number'], isVerified: isLicenseNumberVerified }), _jsx(UnifiedNumber, { show: showUnifiedNumber, readOnly: readOnly['unifiedNumber'] || noneEditable['license.additional_info'], isVerified: isUnifiedNumberVerified })] })), _jsx(Collapse, __assign({ in: !expiryAnchorEl && !entityTypeAnchorEl }, { children: _jsx(IssuingDate, { onDateClicked: handleIssueDateOpenClose, readOnly: readOnly['issuingDate'] || noneEditable['license.issuing_date'], isVerified: isIssuingDateVerified }) })), _jsx(Collapse, __assign({ in: !issueAnchorEl && !entityTypeAnchorEl }, { children: _jsx(ExpiryDate, { onDateClicked: handleExpiryDateOpenClose, readOnly: readOnly['expiryDate'] || noneEditable['license.expiry_date'], isVerified: isExpiryDateVerified }) })), _jsxs(Collapse, __assign({ in: !expiryAnchorEl && !issueAnchorEl && !entityTypeAnchorEl }, { children: [_jsx(LicenseCertificate, { defaultFiles: defaultCertificateFiles, show: !(isKWCountry && !isCR), readOnly: readOnly['certificateId'] || noneEditable['documents'] }), _jsx(Article, { defaultFile: defaultArticleFile, show: true, readOnly: readOnly['articleId'] || noneEditable['AOA_file_id'], isVerified: isArticleIdVerified })] })), _jsx(Collapse, __assign({ in: !expiryAnchorEl && !issueAnchorEl && !entityTypeAnchorEl }, { children: _jsx(Button, __assign({ onBackClicked: function () { return onBack(); }, disabled: disabled, isAr: isAr, loading: loading, error: t(error || '') }, { children: t('next') })) }))] })) })) }));
114
136
  };
115
137
  export default EntityName;
@@ -48,20 +48,6 @@ export declare const LabelContainerStyled: import("@emotion/styled").StyledCompo
48
48
  } & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
49
49
  ref?: ((instance: HTMLDivElement | null) => void) | React.RefObject<HTMLDivElement> | null | undefined;
50
50
  }, 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" | "component" | "ref" | "sx"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
51
- export declare const CheckIconStyled: import("@emotion/styled").StyledComponent<{
52
- children?: React.ReactNode;
53
- classes?: Partial<import("@mui/material").SvgIconClasses> | undefined;
54
- color?: "inherit" | "disabled" | "error" | "info" | "success" | "primary" | "secondary" | "action" | "warning" | undefined;
55
- fontSize?: "small" | "inherit" | "medium" | "large" | undefined;
56
- htmlColor?: string | undefined;
57
- inheritViewBox?: boolean | undefined;
58
- shapeRendering?: string | undefined;
59
- sx?: import("@mui/material/styles").SxProps<import("@mui/material/styles").Theme> | undefined;
60
- titleAccess?: string | undefined;
61
- viewBox?: string | undefined;
62
- } & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<React.SVGProps<SVGSVGElement>, "string" | "name" | "type" | "version" | "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" | "children" | "key" | "id" | "lang" | "tabIndex" | "role" | "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" | "origin" | "method" | "operator" | "spacing" | "elevation" | "in" | "max" | "href" | "orientation" | "media" | "target" | "min" | "viewBox" | "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" | "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" | "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"> & {
63
- ref?: ((instance: SVGSVGElement | null) => void) | React.RefObject<SVGSVGElement> | null | undefined;
64
- }, keyof import("@mui/material/OverridableComponent").CommonProps | "color" | "fontSize" | "shapeRendering" | "children" | "sx" | "htmlColor" | "inheritViewBox" | "titleAccess" | "viewBox"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
65
51
  export declare const NameContainer: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material/styles").Theme> & {
66
52
  align?: "right" | "left" | "inherit" | "center" | "justify" | undefined;
67
53
  children?: React.ReactNode;
@@ -81,6 +67,7 @@ export interface EntityTypeListProps {
81
67
  onListOpen?: () => void;
82
68
  onListClose?: () => void;
83
69
  readOnly?: boolean;
70
+ isVerified?: boolean;
84
71
  }
85
72
  declare const EntityTypeList: (props: EntityTypeListProps) => JSX.Element;
86
73
  export default EntityTypeList;
@@ -16,19 +16,19 @@ import { useController, useFormContext } from 'react-hook-form';
16
16
  import Box from '@mui/material/Box';
17
17
  import { alpha, styled, useTheme } from '@mui/material/styles';
18
18
  import InfoIcon from '@mui/icons-material/Info';
19
- import CheckIcon from '@mui/icons-material/Check';
20
19
  import InfoOutlinedIcon from '@mui/icons-material/InfoOutlined';
21
20
  import { useAppDispatch, useAppSelector } from '../../../../hooks';
22
21
  import Text from '../../../../components/Text';
23
22
  import Collapse from '../../../../components/Collapse';
24
23
  import SimpleList from '../../../../components/SimpleList';
25
- import ExpandIcon from '../../../../components/ExpandIcon';
24
+ import { hasVerifiedValue, removeAllOtherThanAlphabet } from '../../../../utils';
26
25
  import Input from '../../../shared/Input';
27
26
  import { ScreenContainer } from '../../../shared/Containers';
28
27
  import { clearError, entitySelector } from '../../../app/entity/entityStore';
29
28
  import Search from '../../../shared/Search';
30
29
  import SharedInput from '../../../shared/Input';
31
- import { hasVerifiedValue, removeAllOtherThanAlphabet } from '../../../../utils';
30
+ import CheckIcon from '../../../shared/CheckIcon';
31
+ import { EndAdornment, EndAdornmentExpanded } from '../../../shared/EndAdornment';
32
32
  export var InputLabelStyled = styled(Text)(function (_a) {
33
33
  var theme = _a.theme;
34
34
  return (__assign({ color: alpha(theme.palette.text.primary, 0.6) }, theme.typography.caption));
@@ -69,14 +69,6 @@ export var LabelContainerStyled = styled(Box)(function (_a) {
69
69
  });
70
70
  });
71
71
  var SimpleListStyled = styled((SimpleList))(function () { return ({}); });
72
- export var CheckIconStyled = styled(CheckIcon)(function (_a) {
73
- var theme = _a.theme;
74
- return ({
75
- color: theme.palette.success.main,
76
- display: 'flex',
77
- alignItems: 'flex-end'
78
- });
79
- });
80
72
  export var NameContainer = styled(Text, { shouldForwardProp: function (prop) { return prop !== 'isSelected'; } })(function (_a) {
81
73
  var theme = _a.theme, isSelected = _a.isSelected;
82
74
  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' }));
@@ -93,11 +85,10 @@ var EntityTypeList = function (props) {
93
85
  var dispatch = useAppDispatch();
94
86
  var _d = data.verify.responseBody || {}, entityTypes = _d.entityTypes, entity = _d.entity;
95
87
  var type = entity === null || entity === void 0 ? void 0 : entity.type;
96
- var disabled = false;
97
88
  var isListAvailable = (entityTypes === null || entityTypes === void 0 ? void 0 : entityTypes.length) > 0;
98
89
  var hide = React.useMemo(function () {
99
- return (!type && disabled) || hasVerifiedValue(entity === null || entity === void 0 ? void 0 : entity.data_verification, 'type');
100
- }, [type, disabled, entity === null || entity === void 0 ? void 0 : entity.data_verification]);
90
+ return !type || hasVerifiedValue(entity === null || entity === void 0 ? void 0 : entity.data_verification, 'type');
91
+ }, [type, entity === null || entity === void 0 ? void 0 : entity.data_verification]);
101
92
  React.useEffect(function () {
102
93
  if ((entityTypes === null || entityTypes === void 0 ? void 0 : entityTypes.length) > 0) {
103
94
  setEntityTypesMenuList(entityTypes);
@@ -139,8 +130,8 @@ var EntityTypeList = function (props) {
139
130
  var filteredList = entityTypes === null || entityTypes === void 0 ? void 0 : entityTypes.filter(function (i) { return i === null || i === void 0 ? void 0 : i.toLowerCase().includes(val); });
140
131
  setEntityTypesMenuList(filteredList);
141
132
  };
142
- return (_jsx(Collapse, __assign({ in: !hide }, { children: _jsxs(ScreenContainer, __assign({ sx: { paddingTop: theme.spacing(2.5) } }, { children: [_jsx(Collapse, __assign({ in: !isListAvailable }, { children: _jsx(SharedInput, { disabled: disabled, readOnly: props.readOnly, onChange: handleChange, value: t(getSelectedValue()), label: t('entity_type'), placeholder: t('entity_type_placeholder'), sx: { '& .MuiInputBase-input': { cursor: 'auto' } } }) })), _jsxs(Collapse, __assign({ in: isListAvailable }, { children: [_jsx(LabelContainerStyled, { children: _jsx(InputLabelStyled, { children: t('entity_type') }) }), _jsxs(Box, { children: [_jsx(InputStyled, { readOnly: props.readOnly, disabled: disabled, value: t(getSelectedValue()), placeholder: t('choose_entity_type'), onClick: disabled ? undefined : !!anchorEl ? function () { return onCloseList(); } : onOpenList, endAdornment: disabled ? _jsx(_Fragment, {}) : _jsx(ExpandIcon, { anchorEl: !!anchorEl }) }), _jsxs(Collapse, __assign({ in: !!anchorEl, timeout: 300 }, { children: [_jsx(Search, { onSearchValue: handleSearch }), _jsx(SimpleListStyled, { searchKeyPath: 'name', list: entityTypesMenuList, onSelectItem: onSelectItem, renderItem: function (i) {
143
- return (_jsxs(_Fragment, { children: [_jsx(Box, __assign({ display: 'flex' }, { children: _jsx(NameContainer, __assign({ isSelected: getSelectedTypeFlag(i) }, { children: i })) })), getSelectedTypeFlag(i) && _jsx(CheckIconStyled, {})] }));
133
+ return (_jsx(Collapse, __assign({ in: !hide }, { children: _jsxs(ScreenContainer, __assign({ sx: { paddingTop: theme.spacing(2.5) } }, { children: [_jsx(Collapse, __assign({ in: !isListAvailable }, { children: _jsx(SharedInput, { readOnly: props.readOnly, onChange: handleChange, value: t(getSelectedValue()), label: t('entity_type'), placeholder: t('entity_type_placeholder'), sx: { '& .MuiInputBase-input': { cursor: 'auto' } }, endAdornment: _jsx(EndAdornment, { value: getSelectedValue(), isVerified: props.isVerified }) }) })), _jsxs(Collapse, __assign({ in: isListAvailable }, { children: [_jsx(LabelContainerStyled, { children: _jsx(InputLabelStyled, { children: t('entity_type') }) }), _jsxs(Box, { children: [_jsx(InputStyled, { readOnly: props.readOnly, value: t(getSelectedValue()), placeholder: t('choose_entity_type'), onClick: !!anchorEl ? function () { return onCloseList(); } : onOpenList, endAdornment: _jsx(EndAdornmentExpanded, { isVerified: props.isVerified, anchorEl: anchorEl }) }), _jsxs(Collapse, __assign({ in: !!anchorEl, timeout: 300 }, { children: [_jsx(Search, { onSearchValue: handleSearch }), _jsx(SimpleListStyled, { list: entityTypesMenuList, onSelectItem: onSelectItem, renderItem: function (i) {
134
+ return (_jsxs(_Fragment, { children: [_jsx(Box, __assign({ display: 'flex' }, { children: _jsx(NameContainer, __assign({ isSelected: getSelectedTypeFlag(i) }, { children: i })) })), getSelectedTypeFlag(i) && _jsx(CheckIcon, { isVerified: props.isVerified })] }));
144
135
  } })] }))] })] }))] })) })));
145
136
  };
146
137
  export default EntityTypeList;
@@ -15,6 +15,7 @@ export declare const InputLabelStyled: import("@emotion/styled").StyledComponent
15
15
  export interface ExpiryDateProps {
16
16
  onDateClicked?: (flag: boolean) => void;
17
17
  readOnly?: boolean;
18
+ isVerified?: boolean;
18
19
  }
19
- declare const ExpiryDate: ({ onDateClicked, readOnly }: ExpiryDateProps) => JSX.Element;
20
+ declare const ExpiryDate: ({ onDateClicked, readOnly, isVerified }: ExpiryDateProps) => JSX.Element;
20
21
  export default ExpiryDate;
@@ -25,15 +25,13 @@ export var InputLabelStyled = styled(Text)(function (_a) {
25
25
  });
26
26
  var ExpiryDate = function (_a) {
27
27
  var _b, _c;
28
- var onDateClicked = _a.onDateClicked, readOnly = _a.readOnly;
28
+ var onDateClicked = _a.onDateClicked, readOnly = _a.readOnly, isVerified = _a.isVerified;
29
29
  var t = useTranslation().t;
30
30
  var dispatch = useAppDispatch();
31
31
  var control = useFormContext().control;
32
32
  var _d = useAppSelector(entitySelector), data = _d.data, error = _d.error;
33
33
  var entity = (data.verify.responseBody || {}).entity;
34
34
  var expiryDate = (_b = entity === null || entity === void 0 ? void 0 : entity.license) === null || _b === void 0 ? void 0 : _b.expiry_date;
35
- var disabled = false;
36
- var hide = !expiryDate && disabled;
37
35
  var oDateControl = useController({ control: control, name: 'expiryDate' });
38
36
  var dateValue = (_c = oDateControl === null || oDateControl === void 0 ? void 0 : oDateControl.field) === null || _c === void 0 ? void 0 : _c.value;
39
37
  var handleExpiryDateChange = function (data) {
@@ -41,6 +39,6 @@ var ExpiryDate = function (_a) {
41
39
  dispatch(clearError());
42
40
  oDateControl.field.onChange(data);
43
41
  };
44
- return (_jsx(Collapse, __assign({ in: !hide }, { children: _jsxs(ScreenContainer, __assign({ sx: { mt: 2.5 } }, { children: [_jsx(InputLabelStyled, { children: t('business_expiry_date') }), _jsx(DatePicker, { readOnly: true, disabled: disabled || readOnly, maxDate: getFutureDate(), 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: handleExpiryDateChange })] })) })));
42
+ return (_jsx(Collapse, __assign({ in: !!expiryDate }, { children: _jsxs(ScreenContainer, __assign({ sx: { mt: 2.5 } }, { children: [_jsx(InputLabelStyled, { children: t('business_expiry_date') }), _jsx(DatePicker, { readOnly: true, isVerified: isVerified, disabled: readOnly, maxDate: getFutureDate(), 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: handleExpiryDateChange })] })) })));
45
43
  };
46
44
  export default ExpiryDate;
@@ -15,6 +15,7 @@ export declare const InputLabelStyled: import("@emotion/styled").StyledComponent
15
15
  export interface IssuingDateProps {
16
16
  onDateClicked?: (flag: boolean) => void;
17
17
  readOnly?: boolean;
18
+ isVerified?: boolean;
18
19
  }
19
- declare const IssuingDate: ({ onDateClicked, readOnly }: IssuingDateProps) => JSX.Element;
20
+ declare const IssuingDate: ({ onDateClicked, readOnly, isVerified }: IssuingDateProps) => JSX.Element;
20
21
  export default IssuingDate;
@@ -24,15 +24,13 @@ export var InputLabelStyled = styled(Text)(function (_a) {
24
24
  });
25
25
  var IssuingDate = function (_a) {
26
26
  var _b, _c;
27
- var onDateClicked = _a.onDateClicked, readOnly = _a.readOnly;
27
+ var onDateClicked = _a.onDateClicked, readOnly = _a.readOnly, isVerified = _a.isVerified;
28
28
  var t = useTranslation().t;
29
29
  var dispatch = useAppDispatch();
30
30
  var control = useFormContext().control;
31
31
  var _d = useAppSelector(entitySelector), data = _d.data, error = _d.error;
32
32
  var entity = (data.verify.responseBody || {}).entity;
33
33
  var issueDate = (_b = entity === null || entity === void 0 ? void 0 : entity.license) === null || _b === void 0 ? void 0 : _b.issuing_date;
34
- var disabled = false;
35
- var hide = !issueDate && disabled;
36
34
  var oDateControl = useController({ control: control, name: 'issuingDate' });
37
35
  var dateValue = (_c = oDateControl === null || oDateControl === void 0 ? void 0 : oDateControl.field) === null || _c === void 0 ? void 0 : _c.value;
38
36
  var handleIssuingDateChange = function (data) {
@@ -40,6 +38,6 @@ var IssuingDate = function (_a) {
40
38
  dispatch(clearError());
41
39
  oDateControl.field.onChange(data);
42
40
  };
43
- return (_jsx(Collapse, __assign({ in: !hide }, { children: _jsxs(ScreenContainer, __assign({ sx: { mt: 2.5 } }, { children: [_jsx(InputLabelStyled, { children: t('issue_date') }), _jsx(DatePicker, { readOnly: true, disabled: disabled || readOnly, 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: handleIssuingDateChange })] })) })));
41
+ return (_jsx(Collapse, __assign({ in: !!issueDate }, { children: _jsxs(ScreenContainer, __assign({ sx: { mt: 2.5 } }, { children: [_jsx(InputLabelStyled, { children: t('issue_date') }), _jsx(DatePicker, { readOnly: true, disabled: readOnly, isVerified: isVerified, 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: handleIssuingDateChange })] })) })));
44
42
  };
45
43
  export default IssuingDate;
@@ -1,6 +1,7 @@
1
1
  import * as React from 'react';
2
2
  interface LegalNameProps {
3
3
  readOnly?: boolean;
4
+ isVerified?: boolean;
4
5
  }
5
- declare const _default: React.MemoExoticComponent<({ readOnly }: LegalNameProps) => JSX.Element>;
6
+ declare const _default: React.MemoExoticComponent<({ readOnly, isVerified }: LegalNameProps) => JSX.Element>;
6
7
  export default _default;
@@ -19,8 +19,9 @@ import { removeAllOtherThanCharsNumbersAndSpace } from '../../../../utils';
19
19
  import { ScreenContainer } from '../../../shared/Containers';
20
20
  import { clearError, entitySelector } from '../../../app/entity/entityStore';
21
21
  import Input from '../../../shared/Input';
22
+ import { EndAdornment } from '../../../shared/EndAdornment';
22
23
  var LegalName = function (_a) {
23
- var readOnly = _a.readOnly;
24
+ var readOnly = _a.readOnly, isVerified = _a.isVerified;
24
25
  var t = useTranslation().t;
25
26
  var isAr = useLanguage();
26
27
  var _b = useFormContext(), control = _b.control, setValue = _b.setValue;
@@ -32,8 +33,6 @@ var LegalName = function (_a) {
32
33
  var name = isAr ? legalName === null || legalName === void 0 ? void 0 : legalName.ar : legalName === null || legalName === void 0 ? void 0 : legalName.en;
33
34
  var legalNameControl = useController({ control: control, name: 'legalName' });
34
35
  var legalNameValue = legalNameControl.field.value;
35
- var disabled = false;
36
- var hide = !legalName && disabled;
37
36
  React.useEffect(function () {
38
37
  if (name && !legalNameValue)
39
38
  setValue('legalName', name, { shouldValidate: true });
@@ -45,6 +44,6 @@ var LegalName = function (_a) {
45
44
  var value = removeAllOtherThanCharsNumbersAndSpace(target.value);
46
45
  legalNameControl.field.onChange(value);
47
46
  };
48
- return (_jsx(Collapse, __assign({ in: !hide }, { children: _jsx(ScreenContainer, { children: _jsx(Input, { readOnly: readOnly, disabled: disabled, onChange: handleChange, value: legalNameValue, label: t('license_name_label'), placeholder: t('license_name_placeholder'), sx: { '& .MuiInputBase-input': { cursor: 'auto' } } }) }) })));
47
+ return (_jsx(Collapse, __assign({ in: !!legalName }, { children: _jsx(ScreenContainer, { children: _jsx(Input, { readOnly: readOnly, onChange: handleChange, value: legalNameValue, label: t('license_name_label'), placeholder: t('license_name_placeholder'), sx: { '& .MuiInputBase-input': { cursor: 'auto' } }, endAdornment: _jsx(EndAdornment, { value: legalNameValue, isVerified: isVerified }) }) }) })));
49
48
  };
50
49
  export default React.memo(LegalName);
@@ -10,6 +10,7 @@ var __assign = (this && this.__assign) || function () {
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
12
  import { jsx as _jsx } from "react/jsx-runtime";
13
+ import React from 'react';
13
14
  import { useTranslation } from 'react-i18next';
14
15
  import { useController, useFormContext } from 'react-hook-form';
15
16
  import { styled } from '@mui/material/styles';
@@ -17,6 +18,7 @@ import Collapse from '../../../../components/Collapse';
17
18
  import { DocumentPurpose } from '../../../../@types';
18
19
  import { FileType } from '../../../../constants';
19
20
  import { useAppDispatch, useAppSelector } from '../../../../hooks';
21
+ import { hasVerifiedValue } from '../../../../utils';
20
22
  import { ScreenContainer } from '../../../shared/Containers';
21
23
  import { clearError, entitySelector, uploadingStatus } from '../../../app/entity/entityStore';
22
24
  import UploadMultipleFile from '../../../shared/UploadMultipleFile';
@@ -27,12 +29,16 @@ var FeatureStyled = styled(ScreenContainer)(function (_a) {
27
29
  });
28
30
  });
29
31
  var LicenseCertificate = function (_a) {
32
+ var _b;
30
33
  var show = _a.show, readOnly = _a.readOnly, defaultFiles = _a.defaultFiles;
31
34
  var t = useTranslation().t;
32
35
  var control = useFormContext().control;
33
36
  var dispatch = useAppDispatch();
34
37
  var certificateIdControl = useController({ name: 'certificateId', control: control });
35
- var _b = useAppSelector(entitySelector), loading = _b.loading, error = _b.error;
38
+ var _c = useAppSelector(entitySelector), loading = _c.loading, error = _c.error, data = _c.data;
39
+ var data_verification = (((_b = data.verify.responseBody) === null || _b === void 0 ? void 0 : _b.entity) || {}).data_verification;
40
+ var uploadedIds = certificateIdControl.field.value;
41
+ var isDocumentVerified = React.useMemo(function () { var _a; return !!((_a = defaultFiles === null || defaultFiles === void 0 ? void 0 : defaultFiles[0]) === null || _a === void 0 ? void 0 : _a.docId) && hasVerifiedValue(data_verification, "documents.".concat(defaultFiles[0].docId)); }, [data_verification]);
36
42
  var handleLicenseCertificateChange = function (ids) {
37
43
  if (error)
38
44
  dispatch(clearError());
@@ -43,6 +49,6 @@ var LicenseCertificate = function (_a) {
43
49
  dispatch(clearError());
44
50
  certificateIdControl.field.onChange(ids);
45
51
  };
46
- return (_jsx(Collapse, __assign({ in: show }, { children: _jsx(FeatureStyled, { children: _jsx(UploadMultipleFile, { readOnly: readOnly, id: 'certificateId', control: control, label: t('title_license_certificate'), title: t('drag_and_drop'), subTitle: t('subtitle_drop'), dragDescription: t('desc_drag_and_drop_certificate'), uploadingTitle: t('file_uploading_title'), successTitle: t('success_upload_bank_statement'), onFileUploaded: handleLicenseCertificateChange, isSubmitting: loading, onDeleteFile: handleReset, maxLimit: 4, defaultFiles: defaultFiles, purpose: DocumentPurpose.CR, fileUploadingStatus: function (uploading) { return dispatch(uploadingStatus(uploading)); }, fileType: FileType.IMAGES }) }) })));
52
+ return (_jsx(Collapse, __assign({ in: show }, { children: _jsx(FeatureStyled, { children: _jsx(UploadMultipleFile, { readOnly: readOnly, id: 'certificateId', control: control, label: t('title_license_certificate'), title: t('drag_and_drop'), subTitle: t('subtitle_drop'), dragDescription: t('desc_drag_and_drop_certificate'), uploadingTitle: t('file_uploading_title'), successTitle: t('success_upload_bank_statement'), onFileUploaded: handleLicenseCertificateChange, isSubmitting: loading, onDeleteFile: handleReset, maxLimit: 4, defaultFiles: defaultFiles, purpose: DocumentPurpose.CR, fileUploadingStatus: function (uploading) { return dispatch(uploadingStatus(uploading)); }, fileType: FileType.IMAGES, isVerified: !(uploadedIds === null || uploadedIds === void 0 ? void 0 : uploadedIds.length) && isDocumentVerified }) }) })));
47
53
  };
48
54
  export default LicenseCertificate;
@@ -2,6 +2,7 @@ import * as React from 'react';
2
2
  interface LicenseNumberProps {
3
3
  show: boolean;
4
4
  readOnly?: boolean;
5
+ isVerified?: boolean;
5
6
  }
6
- declare const _default: React.MemoExoticComponent<({ show, readOnly }: LicenseNumberProps) => JSX.Element>;
7
+ declare const _default: React.MemoExoticComponent<({ show, readOnly, isVerified }: LicenseNumberProps) => JSX.Element>;
7
8
  export default _default;
@@ -18,13 +18,14 @@ import { BusinessType } from '../../../../@types';
18
18
  import { isSA, removeAllOtherThanCharsAndNumber } from '../../../../utils';
19
19
  import { settingsSelector } from '../../../../app/settings';
20
20
  import { CR_NUMBER_LENGTH, FL_NUMBER_ENTITY_LENGTH, KW_MAX_LICENSE_LENGTH, KW_MIN_LICENSE_LENGTH } from '../../../../constants';
21
+ import Collapse from '../../../../components/Collapse';
21
22
  import { ScreenContainer } from '../../../shared/Containers';
22
23
  import Input from '../../../shared/Input';
23
24
  import { clearError, entitySelector } from '../../../app/entity/entityStore';
24
- import Collapse from '../../../../components/Collapse';
25
+ import { EndAdornment } from '../../../shared/EndAdornment';
25
26
  var LicenseNumber = function (_a) {
26
27
  var _b, _c;
27
- var show = _a.show, readOnly = _a.readOnly;
28
+ var show = _a.show, readOnly = _a.readOnly, isVerified = _a.isVerified;
28
29
  var t = useTranslation().t;
29
30
  var _d = useAppSelector(entitySelector), data = _d.data, bckError = _d.error;
30
31
  var dispatch = useAppDispatch();
@@ -33,8 +34,6 @@ var LicenseNumber = function (_a) {
33
34
  var entity = (data.verify.responseBody || {}).entity;
34
35
  var type = data.entityNameData.licenseType;
35
36
  var number = (_b = entity === null || entity === void 0 ? void 0 : entity.license) === null || _b === void 0 ? void 0 : _b.number;
36
- var disabled = false;
37
- var hide = !number && disabled;
38
37
  var isSACountry = React.useMemo(function () { return isSA(settingsData.businessCountry.iso2); }, [settingsData.businessCountry.iso2]);
39
38
  var handleChange = function (_a) {
40
39
  var target = _a.target;
@@ -49,6 +48,6 @@ var LicenseNumber = function (_a) {
49
48
  var isCR = type === BusinessType.CR;
50
49
  var length = !isSACountry ? KW_MAX_LICENSE_LENGTH : isCR ? CR_NUMBER_LENGTH : FL_NUMBER_ENTITY_LENGTH;
51
50
  var minLength = !isSACountry ? KW_MIN_LICENSE_LENGTH : length;
52
- return (_jsx(Collapse, __assign({ in: show && !hide }, { children: _jsx(ScreenContainer, __assign({ sx: { mt: 2.5 } }, { children: _jsx(Input, { readOnly: readOnly, label: t('license_number_label'), onChange: handleChange, disabled: disabled, inputProps: { maxLength: length }, value: licenseNumberValue, sx: { '& .MuiInputBase-input': { cursor: 'auto' } }, placeholder: isCR ? t('cr_number_hint') : t('fl_number_hint'), warningType: 'alert', warningMessage: error && t(error, { length: minLength }) }) })) })));
51
+ return (_jsx(Collapse, __assign({ in: show && !!number }, { children: _jsx(ScreenContainer, __assign({ sx: { mt: 2.5 } }, { children: _jsx(Input, { readOnly: readOnly, label: t('license_number_label'), onChange: handleChange, inputProps: { maxLength: length }, value: licenseNumberValue, sx: { '& .MuiInputBase-input': { cursor: 'auto' } }, placeholder: isCR ? t('cr_number_hint') : t('fl_number_hint'), warningType: 'alert', warningMessage: error && t(error, { length: minLength }), endAdornment: _jsx(EndAdornment, { value: licenseNumberValue, isVerified: isVerified }) }) })) })));
53
52
  };
54
53
  export default React.memo(LicenseNumber);
@@ -2,6 +2,7 @@ import * as React from 'react';
2
2
  interface UnifiedNumberProps {
3
3
  show: boolean;
4
4
  readOnly?: boolean;
5
+ isVerified?: boolean;
5
6
  }
6
- declare const _default: React.MemoExoticComponent<({ show, readOnly }: UnifiedNumberProps) => JSX.Element>;
7
+ declare const _default: React.MemoExoticComponent<({ show, readOnly, isVerified }: UnifiedNumberProps) => JSX.Element>;
7
8
  export default _default;
@@ -19,17 +19,16 @@ import Collapse from '../../../../components/Collapse';
19
19
  import { ScreenContainer } from '../../../shared/Containers';
20
20
  import Input from '../../../shared/Input';
21
21
  import { clearError, entitySelector } from '../../../app/entity/entityStore';
22
+ import { EndAdornment } from '../../../shared/EndAdornment';
22
23
  var UnifiedNumber = function (_a) {
23
24
  var _b, _c, _d;
24
- var show = _a.show, readOnly = _a.readOnly;
25
+ var show = _a.show, readOnly = _a.readOnly, isVerified = _a.isVerified;
25
26
  var t = useTranslation().t;
26
27
  var _e = useAppSelector(entitySelector), data = _e.data, bckError = _e.error;
27
28
  var control = useFormContext().control;
28
29
  var dispatch = useAppDispatch();
29
30
  var entity = (data.verify.responseBody || {}).entity;
30
31
  var number = (_c = (_b = entity === null || entity === void 0 ? void 0 : entity.license) === null || _b === void 0 ? void 0 : _b.additional_info) === null || _c === void 0 ? void 0 : _c.unified_number;
31
- var disabled = false;
32
- var hide = !number && disabled;
33
32
  var handleChange = function (_a) {
34
33
  var target = _a.target;
35
34
  if (bckError)
@@ -40,6 +39,6 @@ var UnifiedNumber = function (_a) {
40
39
  var unifiedNumberControl = useController({ control: control, name: 'unifiedNumber' });
41
40
  var unifiedNumberValue = unifiedNumberControl.field.value;
42
41
  var error = (_d = unifiedNumberControl.fieldState.error) === null || _d === void 0 ? void 0 : _d.message;
43
- return (_jsx(Collapse, __assign({ in: show && !hide }, { children: _jsx(ScreenContainer, __assign({ sx: { mt: 2.5 } }, { children: _jsx(Input, { readOnly: readOnly, label: t('unified_number_label'), onChange: handleChange, disabled: disabled, value: unifiedNumberValue, sx: { '& .MuiInputBase-input': { cursor: 'auto' } }, placeholder: t('unified_number_hint'), warningType: 'alert', warningMessage: error && t(error) }) })) })));
42
+ return (_jsx(Collapse, __assign({ in: show && !!number }, { children: _jsx(ScreenContainer, __assign({ sx: { mt: 2.5 } }, { children: _jsx(Input, { readOnly: readOnly, label: t('unified_number_label'), onChange: handleChange, value: unifiedNumberValue, sx: { '& .MuiInputBase-input': { cursor: 'auto' } }, placeholder: t('unified_number_hint'), warningType: 'alert', warningMessage: error && t(error), endAdornment: _jsx(EndAdornment, { value: unifiedNumberValue, isVerified: isVerified }) }) })) })));
44
43
  };
45
44
  export default React.memo(UnifiedNumber);
@@ -4,7 +4,7 @@ interface EndAdornmentProps {
4
4
  isVerified?: boolean;
5
5
  error?: string;
6
6
  value?: string;
7
- onClear: () => void;
7
+ onClear?: () => void;
8
8
  }
9
9
  declare const EndAdornment: ({ isVerified, loading, error, value, onClear }: EndAdornmentProps) => JSX.Element;
10
10
  export default EndAdornment;
@@ -9,7 +9,7 @@ var EndAdornment = function (_a) {
9
9
  return _jsx(CircularProgress, { size: 25, thickness: 5, sx: { height: 'auto !important' } });
10
10
  if (!error && value)
11
11
  return _jsx(CheckIcon, { isVerified: isVerified });
12
- if (value)
12
+ if (value && onClear)
13
13
  return _jsx(ClearIcon, { onClick: onClear });
14
14
  };
15
15
  return _jsx(_Fragment, { children: getEndAdornment() });
@@ -1,2 +1,3 @@
1
1
  export declare const dateFormat: (date: Date, fmt?: string) => string;
2
2
  export declare const getFutureDate: (years?: number) => Date;
3
+ export declare const convertToEnglishDateFormat: (d: Date) => string;
@@ -1,4 +1,5 @@
1
1
  import moment from 'moment';
2
+ import { convertNumbers2English } from './string';
2
3
  export var dateFormat = function (date, fmt) {
3
4
  if (fmt === void 0) { fmt = 'YYYY-MM-DD'; }
4
5
  return moment(date).format(fmt);
@@ -9,3 +10,8 @@ export var getFutureDate = function (years) {
9
10
  maxDate.setFullYear(maxDate.getFullYear() + futureY);
10
11
  return maxDate;
11
12
  };
13
+ export var convertToEnglishDateFormat = function (d) {
14
+ var date = new Date(d);
15
+ var formattedDate = dateFormat(date, 'YYYY-MM-DD');
16
+ return convertNumbers2English(formattedDate);
17
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tap-payments/auth-jsconnect",
3
- "version": "2.4.13-test",
3
+ "version": "2.4.14-test",
4
4
  "description": "connect library, auth",
5
5
  "private": false,
6
6
  "main": "build/index.js",