@tap-payments/auth-jsconnect 2.4.3-test → 2.4.5-test
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/@types/app.d.ts +27 -1
- package/build/api/individual.d.ts +2 -2
- package/build/features/app/brand/brandStore.js +10 -9
- package/build/features/bank/screens/BankDetails/BankDetails.js +3 -2
- package/build/features/bank/screens/BankDetails/BankName.d.ts +2 -1
- package/build/features/bank/screens/BankDetails/BankName.js +4 -5
- package/build/features/bank/screens/BankDetails/BankStatement.d.ts +2 -1
- package/build/features/bank/screens/BankDetails/BankStatement.js +4 -4
- package/build/features/bank/screens/BankDetails/Beneficiary.d.ts +2 -1
- package/build/features/bank/screens/BankDetails/Beneficiary.js +8 -10
- package/build/features/bank/screens/BankDetails/IBAN.d.ts +2 -1
- package/build/features/bank/screens/BankDetails/IBAN.js +3 -5
- package/build/features/brand/screens/BrandActivities/ActivitiesList.d.ts +0 -14
- package/build/features/brand/screens/BrandActivities/ActivitiesList.js +6 -11
- package/build/features/brand/screens/BrandActivities/BrandActivities.js +13 -7
- package/build/features/brand/screens/BrandActivities/CustomerBase.d.ts +4 -27
- package/build/features/brand/screens/BrandActivities/CustomerBase.js +9 -18
- package/build/features/brand/screens/BrandActivities/ExpectedCustomers.d.ts +2 -1
- package/build/features/brand/screens/BrandActivities/ExpectedCustomers.js +6 -5
- package/build/features/brand/screens/BrandActivities/ExpectedSalesRange.d.ts +2 -1
- package/build/features/brand/screens/BrandActivities/ExpectedSalesRange.js +15 -14
- package/build/features/brand/screens/BrandInfo/BrandInfo.js +5 -4
- package/build/features/brand/screens/BrandInfo/BrandLogo.d.ts +2 -1
- package/build/features/brand/screens/BrandInfo/BrandLogo.js +2 -2
- package/build/features/brand/screens/BrandInfo/BrandName.d.ts +2 -1
- package/build/features/brand/screens/BrandInfo/BrandName.js +3 -5
- package/build/features/brand/screens/BrandInfo/SalesChannels.js +6 -3
- package/build/features/brand/screens/BrandInfo/Segments.d.ts +2 -1
- package/build/features/brand/screens/BrandInfo/Segments.js +17 -24
- package/build/features/brand/screens/BrandInfo/TeamSize.d.ts +2 -1
- package/build/features/brand/screens/BrandInfo/TeamSize.js +18 -25
- package/build/features/entity/screens/EntityName/EntityTypeList.js +1 -1
- package/build/features/shared/CheckIcon/CheckIcon.d.ts +7 -1
- package/build/features/shared/CheckIcon/CheckIcon.js +7 -6
- package/build/features/shared/EndAdornment/EndAdornment.d.ts +10 -0
- package/build/features/shared/EndAdornment/EndAdornment.js +17 -0
- package/build/features/shared/EndAdornment/EndAdornmentExpanded.d.ts +7 -0
- package/build/features/shared/EndAdornment/EndAdornmentExpanded.js +13 -0
- package/build/features/shared/EndAdornment/index.d.ts +3 -0
- package/build/features/shared/EndAdornment/index.js +3 -0
- package/build/features/shared/SalesChannels/SaleChannelIconsInput.d.ts +2 -1
- package/build/features/shared/SalesChannels/SaleChannelIconsInput.js +4 -3
- package/build/features/shared/SalesChannels/SalesChannel.d.ts +2 -1
- package/build/features/shared/SalesChannels/SalesChannel.js +2 -2
- package/build/features/shared/UploadFile/FileUpload.d.ts +2 -1
- package/build/features/shared/UploadFile/FileUpload.js +2 -2
- package/build/features/shared/UploadFile/UploadWrapper.d.ts +2 -1
- package/build/features/shared/UploadFile/UploadWrapper.js +2 -2
- package/build/features/shared/UploadMultipleFile/UploadFile.d.ts +2 -1
- package/build/features/shared/UploadMultipleFile/UploadFile.js +2 -2
- package/build/features/shared/UploadMultipleFile/UploadMultipleFile.d.ts +2 -1
- package/build/features/shared/UploadMultipleFile/UploadMultipleFile.js +2 -2
- package/build/hooks/index.d.ts +1 -0
- package/build/hooks/index.js +1 -0
- package/build/hooks/useDataVerified.d.ts +6 -0
- package/build/hooks/useDataVerified.js +19 -0
- package/package.json +1 -1
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
interface EndAdornmentProps {
|
|
3
|
+
loading?: boolean;
|
|
4
|
+
isVerified?: boolean;
|
|
5
|
+
error?: string;
|
|
6
|
+
value?: string;
|
|
7
|
+
onClear: () => void;
|
|
8
|
+
}
|
|
9
|
+
declare const EndAdornment: ({ isVerified, loading, error, value, onClear }: EndAdornmentProps) => JSX.Element;
|
|
10
|
+
export default EndAdornment;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import CircularProgress from '@mui/material/CircularProgress';
|
|
3
|
+
import ClearIcon from '../../shared/ClearIcon';
|
|
4
|
+
import CheckIcon from '../../shared/CheckIcon';
|
|
5
|
+
var EndAdornment = function (_a) {
|
|
6
|
+
var isVerified = _a.isVerified, loading = _a.loading, error = _a.error, value = _a.value, onClear = _a.onClear;
|
|
7
|
+
var getEndAdornment = function () {
|
|
8
|
+
if (loading)
|
|
9
|
+
return _jsx(CircularProgress, { size: 25, thickness: 5, sx: { height: 'auto !important' } });
|
|
10
|
+
if (!error && value)
|
|
11
|
+
return _jsx(CheckIcon, { isVerified: isVerified });
|
|
12
|
+
if (value)
|
|
13
|
+
return _jsx(ClearIcon, { onClick: onClear });
|
|
14
|
+
};
|
|
15
|
+
return _jsx(_Fragment, { children: getEndAdornment() });
|
|
16
|
+
};
|
|
17
|
+
export default EndAdornment;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
interface EndAdornmentExpandedProps {
|
|
3
|
+
anchorEl: HTMLElement | null;
|
|
4
|
+
isVerified?: boolean;
|
|
5
|
+
}
|
|
6
|
+
declare const EndAdornmentExpanded: ({ isVerified, anchorEl }: EndAdornmentExpandedProps) => JSX.Element;
|
|
7
|
+
export default EndAdornmentExpanded;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import CheckIcon from '../../shared/CheckIcon';
|
|
3
|
+
import ExpandIcon from '../../../components/ExpandIcon';
|
|
4
|
+
var EndAdornmentExpanded = function (_a) {
|
|
5
|
+
var isVerified = _a.isVerified, anchorEl = _a.anchorEl;
|
|
6
|
+
var getEndAdornmentExpanded = function () {
|
|
7
|
+
if (isVerified && !anchorEl)
|
|
8
|
+
return (_jsxs(_Fragment, { children: [_jsx(CheckIcon, { isVerified: isVerified, sx: { marginInlineEnd: '10px' } }), _jsx(ExpandIcon, { anchorEl: !!anchorEl })] }));
|
|
9
|
+
return _jsx(ExpandIcon, { anchorEl: !!anchorEl });
|
|
10
|
+
};
|
|
11
|
+
return _jsx(_Fragment, { children: getEndAdornmentExpanded() });
|
|
12
|
+
};
|
|
13
|
+
export default EndAdornmentExpanded;
|
|
@@ -7,6 +7,7 @@ interface SaleChannelIconsInputProps {
|
|
|
7
7
|
onChangeValue: (val: string, id: string) => void;
|
|
8
8
|
error: string | undefined;
|
|
9
9
|
readOnly?: boolean;
|
|
10
|
+
isVerified?: boolean;
|
|
10
11
|
}
|
|
11
|
-
export default function SaleChannelIconsInput({ selectedChannels, onSelectIcon, selectedIconId, onChangeValue, error, readOnly }: SaleChannelIconsInputProps): JSX.Element;
|
|
12
|
+
export default function SaleChannelIconsInput({ selectedChannels, onSelectIcon, selectedIconId, onChangeValue, error, readOnly, isVerified }: SaleChannelIconsInputProps): JSX.Element;
|
|
12
13
|
export {};
|
|
@@ -22,6 +22,7 @@ import ToggleButton from '../../../components/ToggleButton';
|
|
|
22
22
|
import Icon from '../../../components/Icon';
|
|
23
23
|
import { useLanguage } from '../../../hooks';
|
|
24
24
|
import { isWebsite, isTwitter } from '../../../utils';
|
|
25
|
+
import CheckIcon from '../CheckIcon';
|
|
25
26
|
var SocialMediaGroupStyled = styled(SocialMediaGroup)(function (_a) {
|
|
26
27
|
var theme = _a.theme, defaultValue = _a.defaultValue;
|
|
27
28
|
return ({
|
|
@@ -68,7 +69,7 @@ var SocialMediaButtonStyled = styled(ToggleButton, {
|
|
|
68
69
|
});
|
|
69
70
|
});
|
|
70
71
|
export default function SaleChannelIconsInput(_a) {
|
|
71
|
-
var selectedChannels = _a.selectedChannels, onSelectIcon = _a.onSelectIcon, selectedIconId = _a.selectedIconId, onChangeValue = _a.onChangeValue, error = _a.error, readOnly = _a.readOnly;
|
|
72
|
+
var selectedChannels = _a.selectedChannels, onSelectIcon = _a.onSelectIcon, selectedIconId = _a.selectedIconId, onChangeValue = _a.onChangeValue, error = _a.error, readOnly = _a.readOnly, isVerified = _a.isVerified;
|
|
72
73
|
var isAr = useLanguage().isAr;
|
|
73
74
|
var t = useTranslation().t;
|
|
74
75
|
var getPlaceHolder = function (item) {
|
|
@@ -93,9 +94,9 @@ export default function SaleChannelIconsInput(_a) {
|
|
|
93
94
|
var isSubActive = selectedIconId === sub.id;
|
|
94
95
|
return (_jsx(Collapse, __assign({ in: isSubActive, timeout: 300 }, { children: _jsx(InputStyled, { readOnly: readOnly, onChange: function (e) {
|
|
95
96
|
onChangeValue(e.target.value, sub.id);
|
|
96
|
-
}, value: sub.address || '', startAdornment: _jsx(TextStyled, __assign({ sx: __assign({}, (isTwitter(sub.code) && { fontSize: '20px' })) }, { children: isWebsite(sub.code) ? "https://www." : isTwitter(sub.code) ? "@" : '' })), placeholder: t(getPlaceHolder(sub)) }) }), "sub_".concat(subIndex)));
|
|
97
|
+
}, value: sub.address || '', startAdornment: _jsx(TextStyled, __assign({ sx: __assign({}, (isTwitter(sub.code) && { fontSize: '20px' })) }, { children: isWebsite(sub.code) ? "https://www." : isTwitter(sub.code) ? "@" : '' })), endAdornment: isVerified && !error && _jsx(CheckIcon, { isVerified: true }), placeholder: t(getPlaceHolder(sub)) }) }), "sub_".concat(subIndex)));
|
|
97
98
|
})) : (_jsx(Collapse, __assign({ in: isActive, timeout: 300 }, { children: _jsx(InputStyled, { readOnly: readOnly, onChange: function (e) {
|
|
98
99
|
onChangeValue(e.target.value, channel.id);
|
|
99
|
-
}, value: channel.address || '', startAdornment: _jsx(TextStyled, __assign({ sx: __assign({}, (isTwitter(channel.code) && { fontSize: '20px' })) }, { children: isWebsite(channel.code) ? "https://www." : isTwitter(channel.code) ? "@" : '' })), placeholder: t(getPlaceHolder(channel)) }) }), index));
|
|
100
|
+
}, value: channel.address || '', startAdornment: _jsx(TextStyled, __assign({ sx: __assign({}, (isTwitter(channel.code) && { fontSize: '20px' })) }, { children: isWebsite(channel.code) ? "https://www." : isTwitter(channel.code) ? "@" : '' })), placeholder: t(getPlaceHolder(channel)), endAdornment: isVerified && !error && _jsx(CheckIcon, { isVerified: true }) }) }), index));
|
|
100
101
|
}), _jsx(Collapse, __assign({ in: !!(error && error !== 'choose_atleast_one_channel') }, { children: _jsx(Warning, __assign({ warningType: 'alert' }, { children: t(error) })) }))] })) })));
|
|
101
102
|
}
|
|
@@ -8,6 +8,7 @@ interface SalesChannelProps {
|
|
|
8
8
|
selectFirstIconListener?: string | number | boolean;
|
|
9
9
|
disabled?: boolean;
|
|
10
10
|
readOnly?: boolean;
|
|
11
|
+
isChannelVerified?: (id: string) => boolean;
|
|
11
12
|
}
|
|
12
|
-
declare const _default: React.MemoExoticComponent<({ list, onChange, error, disabled, readOnly, defaultValue, selectFirstIconListener }: SalesChannelProps) => JSX.Element>;
|
|
13
|
+
declare const _default: React.MemoExoticComponent<({ list, onChange, error, disabled, readOnly, defaultValue, selectFirstIconListener, isChannelVerified }: SalesChannelProps) => JSX.Element>;
|
|
13
14
|
export default _default;
|
|
@@ -75,7 +75,7 @@ var CollapseStyled = styled(Collapse)(function (_a) {
|
|
|
75
75
|
});
|
|
76
76
|
});
|
|
77
77
|
var SalesChannel = function (_a) {
|
|
78
|
-
var _b = _a.list, list = _b === void 0 ? [] : _b, onChange = _a.onChange, error = _a.error, disabled = _a.disabled, readOnly = _a.readOnly, _c = _a.defaultValue, defaultValue = _c === void 0 ? [] : _c, _d = _a.selectFirstIconListener, selectFirstIconListener = _d === void 0 ? '' : _d;
|
|
78
|
+
var _b = _a.list, list = _b === void 0 ? [] : _b, onChange = _a.onChange, error = _a.error, disabled = _a.disabled, readOnly = _a.readOnly, _c = _a.defaultValue, defaultValue = _c === void 0 ? [] : _c, _d = _a.selectFirstIconListener, selectFirstIconListener = _d === void 0 ? '' : _d, isChannelVerified = _a.isChannelVerified;
|
|
79
79
|
var _e = React.useState(''), activeSaleIconId = _e[0], setActiveSaleIconId = _e[1];
|
|
80
80
|
var _f = React.useState([]), selectedSalas = _f[0], setSelectedSales = _f[1];
|
|
81
81
|
var t = useTranslation().t;
|
|
@@ -145,6 +145,6 @@ var SalesChannel = function (_a) {
|
|
|
145
145
|
return (_jsxs(_Fragment, { children: [_jsxs(Box, __assign({ sx: { mb: 3 } }, { children: [_jsxs(InputLabelStyled, { children: [t('channel_of_service'), " ", _jsx(MandatoryStyled, { children: "*" })] }), list.map(function (channel, index) {
|
|
146
146
|
var _a, _b;
|
|
147
147
|
return (_jsxs(ContainerStyled, { children: [_jsx(CheckBoxStyled, { id: channel.id, disableRipple: true, disabled: disabled || readOnly, disableFocusRipple: true, focusRipple: false, checked: isChecked(channel.id), onChange: function () { return onSelectSalesChannel(channel); } }), _jsxs(TextStyled, { children: [isAr ? (_a = channel === null || channel === void 0 ? void 0 : channel.name) === null || _a === void 0 ? void 0 : _a.ar : (_b = channel === null || channel === void 0 ? void 0 : channel.name) === null || _b === void 0 ? void 0 : _b.en, " "] })] }, "".concat(channel.id, "-indx").concat(index)));
|
|
148
|
-
}), _jsx(CollapseStyled, __assign({ in: error === 'choose_atleast_one_channel' }, { children: _jsx(Warning, __assign({ warningType: 'alert' }, { children: t(error) })) }))] }), 'salesChannels'), _jsx(SaleChannelIconsInput, { readOnly: readOnly, error: error, selectedIconId: activeSaleIconId, onSelectIcon: onChangeActiveSaleIcon, onChangeValue: onValueChange, selectedChannels: selectedSalas }, 'saleChannelIconsInput')] }));
|
|
148
|
+
}), _jsx(CollapseStyled, __assign({ in: error === 'choose_atleast_one_channel' }, { children: _jsx(Warning, __assign({ warningType: 'alert' }, { children: t(error) })) }))] }), 'salesChannels'), _jsx(SaleChannelIconsInput, { readOnly: readOnly, error: error, selectedIconId: activeSaleIconId, onSelectIcon: onChangeActiveSaleIcon, onChangeValue: onValueChange, selectedChannels: selectedSalas, isVerified: isChannelVerified === null || isChannelVerified === void 0 ? void 0 : isChannelVerified(activeSaleIconId) }, 'saleChannelIconsInput')] }));
|
|
149
149
|
};
|
|
150
150
|
export default React.memo(SalesChannel);
|
|
@@ -26,6 +26,7 @@ export declare type FileUploadProps = {
|
|
|
26
26
|
initialFileId?: string;
|
|
27
27
|
validFileFormats?: Array<string>;
|
|
28
28
|
readOnly?: boolean;
|
|
29
|
+
isVerified?: boolean;
|
|
29
30
|
};
|
|
30
|
-
declare const FileUpload: ({ key, show, title, file, uploadedFile, onSuccess, onDelete, onUpdate, sx, purpose, isSubmitting, fileRemoveType, initialFileId, validFileFormats, readOnly }: FileUploadProps) => JSX.Element;
|
|
31
|
+
declare const FileUpload: ({ key, show, title, file, uploadedFile, onSuccess, onDelete, onUpdate, sx, purpose, isSubmitting, fileRemoveType, initialFileId, validFileFormats, readOnly, isVerified }: FileUploadProps) => JSX.Element;
|
|
31
32
|
export default FileUpload;
|
|
@@ -108,7 +108,7 @@ var WarningContainer = styled(Box)(function (_a) {
|
|
|
108
108
|
return (__assign({ background: alpha(theme.palette.warning.main, 0.1), paddingBlock: theme.spacing(1.5), paddingInlineStart: theme.spacing(2.5), flexDirection: 'row', display: 'flex', justifyContent: 'center', color: theme.palette.warning.light, padding: theme.spacing(0.5, 1), borderRadius: '101px', alignItems: 'center', marginTop: theme.spacing(1.25) }, theme.typography.caption));
|
|
109
109
|
});
|
|
110
110
|
var FileUpload = function (_a) {
|
|
111
|
-
var key = _a.key, show = _a.show, title = _a.title, file = _a.file, uploadedFile = _a.uploadedFile, onSuccess = _a.onSuccess, onDelete = _a.onDelete, onUpdate = _a.onUpdate, sx = _a.sx, purpose = _a.purpose, isSubmitting = _a.isSubmitting, fileRemoveType = _a.fileRemoveType, initialFileId = _a.initialFileId, _b = _a.validFileFormats, validFileFormats = _b === void 0 ? VALID_FILE_FORMATS : _b, readOnly = _a.readOnly;
|
|
111
|
+
var key = _a.key, show = _a.show, title = _a.title, file = _a.file, uploadedFile = _a.uploadedFile, onSuccess = _a.onSuccess, onDelete = _a.onDelete, onUpdate = _a.onUpdate, sx = _a.sx, purpose = _a.purpose, isSubmitting = _a.isSubmitting, fileRemoveType = _a.fileRemoveType, initialFileId = _a.initialFileId, _b = _a.validFileFormats, validFileFormats = _b === void 0 ? VALID_FILE_FORMATS : _b, readOnly = _a.readOnly, isVerified = _a.isVerified;
|
|
112
112
|
var theme = useTheme();
|
|
113
113
|
var t = useTranslation().t;
|
|
114
114
|
var _c = file || {}, name = _c.name, size = _c.size, type = _c.type;
|
|
@@ -227,7 +227,7 @@ var FileUpload = function (_a) {
|
|
|
227
227
|
if (status === FileStatus.ERROR)
|
|
228
228
|
return _jsx(ErrorIconStyled, { src: ICONS_NAMES.ERROR_ICON });
|
|
229
229
|
if (status === FileStatus.SUCCESS)
|
|
230
|
-
return _jsx(CheckIcon, {});
|
|
230
|
+
return _jsx(CheckIcon, { isVerified: isVerified });
|
|
231
231
|
if (status === FileStatus.DOWNLOADING && !progress)
|
|
232
232
|
return _jsx(MUICircularProgress, { size: 25, thickness: 5 });
|
|
233
233
|
if (progress)
|
|
@@ -30,6 +30,7 @@ interface UploadWrapperProps {
|
|
|
30
30
|
defaultFile?: FileDetails;
|
|
31
31
|
validFileFormats?: Array<string>;
|
|
32
32
|
readOnly?: boolean;
|
|
33
|
+
isVerified?: boolean;
|
|
33
34
|
}
|
|
34
|
-
declare const _default: React.MemoExoticComponent<({ id, label, control, required, fileRemoveType, title, subTitle, dragDescription, uploadingTitle, successTitle, isSubmitting, onFileUploaded, fileUploadingStatus, onDeleteFile, purpose, fileTitle, defaultFile, validFileFormats, readOnly }: UploadWrapperProps) => JSX.Element>;
|
|
35
|
+
declare const _default: React.MemoExoticComponent<({ id, label, control, required, fileRemoveType, title, subTitle, dragDescription, uploadingTitle, successTitle, isSubmitting, onFileUploaded, fileUploadingStatus, onDeleteFile, purpose, fileTitle, defaultFile, validFileFormats, readOnly, isVerified }: UploadWrapperProps) => JSX.Element>;
|
|
35
36
|
export default _default;
|
|
@@ -44,7 +44,7 @@ export var InputContainerStyled = styled(Box)(function () { return ({
|
|
|
44
44
|
justifyContent: 'center'
|
|
45
45
|
}); });
|
|
46
46
|
var UploadWrapper = function (_a) {
|
|
47
|
-
var id = _a.id, label = _a.label, control = _a.control, required = _a.required, fileRemoveType = _a.fileRemoveType, title = _a.title, subTitle = _a.subTitle, dragDescription = _a.dragDescription, uploadingTitle = _a.uploadingTitle, successTitle = _a.successTitle, isSubmitting = _a.isSubmitting, onFileUploaded = _a.onFileUploaded, fileUploadingStatus = _a.fileUploadingStatus, onDeleteFile = _a.onDeleteFile, purpose = _a.purpose, fileTitle = _a.fileTitle, defaultFile = _a.defaultFile, validFileFormats = _a.validFileFormats, readOnly = _a.readOnly;
|
|
47
|
+
var id = _a.id, label = _a.label, control = _a.control, required = _a.required, fileRemoveType = _a.fileRemoveType, title = _a.title, subTitle = _a.subTitle, dragDescription = _a.dragDescription, uploadingTitle = _a.uploadingTitle, successTitle = _a.successTitle, isSubmitting = _a.isSubmitting, onFileUploaded = _a.onFileUploaded, fileUploadingStatus = _a.fileUploadingStatus, onDeleteFile = _a.onDeleteFile, purpose = _a.purpose, fileTitle = _a.fileTitle, defaultFile = _a.defaultFile, validFileFormats = _a.validFileFormats, readOnly = _a.readOnly, isVerified = _a.isVerified;
|
|
48
48
|
var t = useTranslation().t;
|
|
49
49
|
var _b = React.useState(''), error = _b[0], setError = _b[1];
|
|
50
50
|
var fileControl = useController({ name: "".concat(id, "File"), control: control });
|
|
@@ -110,6 +110,6 @@ var UploadWrapper = function (_a) {
|
|
|
110
110
|
var fileExists = !!fileInfo;
|
|
111
111
|
var showUploadedInputField = (fileInfo === null || fileInfo === void 0 ? void 0 : fileInfo.status) === FileStatus.SUCCESS || (fileInfo === null || fileInfo === void 0 ? void 0 : fileInfo.status) === FileStatus.DOWNLOADING || (fileInfo === null || fileInfo === void 0 ? void 0 : fileInfo.deleteStatus) === DeleteFileStatus.DELETING;
|
|
112
112
|
var showDragAndDrop = !showUploadedInputField && !readOnly;
|
|
113
|
-
return (_jsxs(FeatureStyled, { children: [_jsx(LabelContainerStyled, { children: _jsx(InputLabelStyled, { children: _jsxs(_Fragment, { children: [label, required && _jsx(Mandatory, {})] }) }) }), _jsx(Collapse, __assign({ in: showDragAndDrop }, { children: _jsx(InputContainerStyled, __assign({ sx: { mb: 2.5 } }, { children: _jsx(DragAndDrop, { title: title, subTitle: subTitle, description: dragDescription, fileExists: fileExists, uploadingTitle: uploadingTitle, successTitle: successTitle, progress: fileInfo === null || fileInfo === void 0 ? void 0 : fileInfo.progress, uploading: (fileInfo === null || fileInfo === void 0 ? void 0 : fileInfo.status) === FileStatus.UPLOADING, uploadSuccess: (fileInfo === null || fileInfo === void 0 ? void 0 : fileInfo.status) === FileStatus.SUCCESS, onSuccess: handleFileChange, error: (fileInfo === null || fileInfo === void 0 ? void 0 : fileInfo.error) || error, multiple: false }) })) })), _jsx(Collapse, __assign({ in: fileExists, timeout: 300 }, { children: _jsx(FileUpload, { validFileFormats: validFileFormats, readOnly: readOnly, show: showUploadedInputField, fileRemoveType: fileRemoveType, purpose: purpose, title: fileTitle || '', isSubmitting: isSubmitting, uploadedFile: fileInfo, file: fileData, onSuccess: handleSuccess, onDelete: handleDelete, onUpdate: handleUpdate, initialFileId: defaultFile === null || defaultFile === void 0 ? void 0 : defaultFile.id }) }))] }));
|
|
113
|
+
return (_jsxs(FeatureStyled, { children: [_jsx(LabelContainerStyled, { children: _jsx(InputLabelStyled, { children: _jsxs(_Fragment, { children: [label, required && _jsx(Mandatory, {})] }) }) }), _jsx(Collapse, __assign({ in: showDragAndDrop }, { children: _jsx(InputContainerStyled, __assign({ sx: { mb: 2.5 } }, { children: _jsx(DragAndDrop, { title: title, subTitle: subTitle, description: dragDescription, fileExists: fileExists, uploadingTitle: uploadingTitle, successTitle: successTitle, progress: fileInfo === null || fileInfo === void 0 ? void 0 : fileInfo.progress, uploading: (fileInfo === null || fileInfo === void 0 ? void 0 : fileInfo.status) === FileStatus.UPLOADING, uploadSuccess: (fileInfo === null || fileInfo === void 0 ? void 0 : fileInfo.status) === FileStatus.SUCCESS, onSuccess: handleFileChange, error: (fileInfo === null || fileInfo === void 0 ? void 0 : fileInfo.error) || error, multiple: false }) })) })), _jsx(Collapse, __assign({ in: fileExists, timeout: 300 }, { children: _jsx(FileUpload, { validFileFormats: validFileFormats, readOnly: readOnly, show: showUploadedInputField, fileRemoveType: fileRemoveType, purpose: purpose, title: fileTitle || '', isSubmitting: isSubmitting, uploadedFile: fileInfo, file: fileData, onSuccess: handleSuccess, onDelete: handleDelete, onUpdate: handleUpdate, initialFileId: defaultFile === null || defaultFile === void 0 ? void 0 : defaultFile.id, isVerified: isVerified }) }))] }));
|
|
114
114
|
};
|
|
115
115
|
export default React.memo(UploadWrapper);
|
|
@@ -23,6 +23,7 @@ export declare type UploadFileProps = {
|
|
|
23
23
|
sx?: SxProps<Theme> | undefined;
|
|
24
24
|
isSubmitting?: boolean;
|
|
25
25
|
readOnly?: boolean;
|
|
26
|
+
isVerified?: boolean;
|
|
26
27
|
};
|
|
27
|
-
declare const UploadFile: ({ index, title, file, fileType, uploadedFiles, onSuccess, onDelete, onUpdate, sx, purpose, isSubmitting, readOnly }: UploadFileProps) => JSX.Element;
|
|
28
|
+
declare const UploadFile: ({ index, title, file, fileType, uploadedFiles, onSuccess, onDelete, onUpdate, sx, purpose, isSubmitting, readOnly, isVerified }: UploadFileProps) => JSX.Element;
|
|
28
29
|
export default UploadFile;
|
|
@@ -108,7 +108,7 @@ var WarningContainer = styled(Box)(function (_a) {
|
|
|
108
108
|
return (__assign({ background: alpha(theme.palette.warning.main, 0.1), paddingBlock: theme.spacing(1.5), paddingInlineStart: theme.spacing(2.5), flexDirection: 'row', display: 'flex', justifyContent: 'center', color: theme.palette.warning.light, padding: theme.spacing(0.5, 1), borderRadius: '101px', alignItems: 'center', marginTop: theme.spacing(1.25) }, theme.typography.caption));
|
|
109
109
|
});
|
|
110
110
|
var UploadFile = function (_a) {
|
|
111
|
-
var index = _a.index, title = _a.title, file = _a.file, fileType = _a.fileType, uploadedFiles = _a.uploadedFiles, onSuccess = _a.onSuccess, onDelete = _a.onDelete, onUpdate = _a.onUpdate, sx = _a.sx, purpose = _a.purpose, isSubmitting = _a.isSubmitting, readOnly = _a.readOnly;
|
|
111
|
+
var index = _a.index, title = _a.title, file = _a.file, fileType = _a.fileType, uploadedFiles = _a.uploadedFiles, onSuccess = _a.onSuccess, onDelete = _a.onDelete, onUpdate = _a.onUpdate, sx = _a.sx, purpose = _a.purpose, isSubmitting = _a.isSubmitting, readOnly = _a.readOnly, isVerified = _a.isVerified;
|
|
112
112
|
var theme = useTheme();
|
|
113
113
|
var t = useTranslation().t;
|
|
114
114
|
var _b = file || {}, name = _b.name, size = _b.size, type = _b.type;
|
|
@@ -229,7 +229,7 @@ var UploadFile = function (_a) {
|
|
|
229
229
|
if (status === FileStatus.ERROR)
|
|
230
230
|
return _jsx(ErrorIconStyled, { src: ICONS_NAMES.ERROR_ICON });
|
|
231
231
|
if (status === FileStatus.SUCCESS)
|
|
232
|
-
return _jsx(CheckIcon, {});
|
|
232
|
+
return _jsx(CheckIcon, { isVerified: isVerified });
|
|
233
233
|
if (status === FileStatus.DOWNLOADING && !progress)
|
|
234
234
|
return _jsx(MUICircularProgress, { size: 25, thickness: 5 });
|
|
235
235
|
if (progress)
|
|
@@ -30,6 +30,7 @@ interface UploadMultipleFileProps {
|
|
|
30
30
|
maxLimit?: number;
|
|
31
31
|
defaultFiles?: Array<FileDetails>;
|
|
32
32
|
readOnly?: boolean;
|
|
33
|
+
isVerified?: boolean;
|
|
33
34
|
}
|
|
34
|
-
declare const UploadMultipleFile: ({ id, label, control, required, fileType, title, subTitle, dragDescription, uploadingTitle, successTitle, isSubmitting, onFileUploaded, fileUploadingStatus, onDeleteFile, maxLimit, purpose, fileTitle, defaultFiles, readOnly }: UploadMultipleFileProps) => JSX.Element;
|
|
35
|
+
declare const UploadMultipleFile: ({ id, label, control, required, fileType, title, subTitle, dragDescription, uploadingTitle, successTitle, isSubmitting, onFileUploaded, fileUploadingStatus, onDeleteFile, maxLimit, purpose, fileTitle, defaultFiles, readOnly, isVerified }: UploadMultipleFileProps) => JSX.Element;
|
|
35
36
|
export default UploadMultipleFile;
|
|
@@ -62,7 +62,7 @@ var UploadCountBox = styled(Box)(function (_a) {
|
|
|
62
62
|
});
|
|
63
63
|
});
|
|
64
64
|
var UploadMultipleFile = function (_a) {
|
|
65
|
-
var id = _a.id, label = _a.label, control = _a.control, required = _a.required, fileType = _a.fileType, title = _a.title, subTitle = _a.subTitle, dragDescription = _a.dragDescription, uploadingTitle = _a.uploadingTitle, successTitle = _a.successTitle, isSubmitting = _a.isSubmitting, onFileUploaded = _a.onFileUploaded, fileUploadingStatus = _a.fileUploadingStatus, onDeleteFile = _a.onDeleteFile, maxLimit = _a.maxLimit, purpose = _a.purpose, fileTitle = _a.fileTitle, defaultFiles = _a.defaultFiles, readOnly = _a.readOnly;
|
|
65
|
+
var id = _a.id, label = _a.label, control = _a.control, required = _a.required, fileType = _a.fileType, title = _a.title, subTitle = _a.subTitle, dragDescription = _a.dragDescription, uploadingTitle = _a.uploadingTitle, successTitle = _a.successTitle, isSubmitting = _a.isSubmitting, onFileUploaded = _a.onFileUploaded, fileUploadingStatus = _a.fileUploadingStatus, onDeleteFile = _a.onDeleteFile, maxLimit = _a.maxLimit, purpose = _a.purpose, fileTitle = _a.fileTitle, defaultFiles = _a.defaultFiles, readOnly = _a.readOnly, isVerified = _a.isVerified;
|
|
66
66
|
var t = useTranslation().t;
|
|
67
67
|
var theme = useTheme();
|
|
68
68
|
var _b = React.useState(''), error = _b[0], setError = _b[1];
|
|
@@ -170,7 +170,7 @@ var UploadMultipleFile = function (_a) {
|
|
|
170
170
|
};
|
|
171
171
|
var fileExists = fileInfoArray.length > 0;
|
|
172
172
|
return (_jsxs(FeatureStyled, { children: [_jsxs(LabelContainerStyled, { children: [_jsx(InputLabelStyled, { children: _jsxs(_Fragment, { children: [label, required && _jsx(Mandatory, {})] }) }), _jsx(Collapse, __assign({ in: !!uploadedFileCount, timeout: 100, unmountOnExit: true }, { children: _jsx(UploadCountBox, { children: "".concat(uploadedFileCount, " ").concat(t('uploaded_file')) }) }))] }), _jsx(Collapse, __assign({ in: fileExists, timeout: 300 }, { children: (fileArray || []).map(function (file, index) {
|
|
173
|
-
return (_jsx(UploadFile, { readOnly: readOnly, required: required, purpose: purpose, fileType: fileType, title: fileTitle, isSubmitting: isSubmitting, uploadedFiles: fileInfoArray, index: index, file: file, sx: {
|
|
173
|
+
return (_jsx(UploadFile, { readOnly: readOnly, required: required, purpose: purpose, fileType: fileType, title: fileTitle, isVerified: isVerified, isSubmitting: isSubmitting, uploadedFiles: fileInfoArray, index: index, file: file, sx: {
|
|
174
174
|
borderBottom: index === fileArray.length - 1 ? "1px solid ".concat(alpha(theme.palette.divider, 0.8)) : ''
|
|
175
175
|
}, onSuccess: handleSuccess, onDelete: handleDelete, onUpdate: handleUpdate }, index));
|
|
176
176
|
}) })), _jsx(Collapse, __assign({ in: !readOnly }, { children: _jsx(InputContainerStyled, __assign({ sx: { mt: 2.5 } }, { children: _jsx(DragAndDrop, { title: title, subTitle: subTitle, description: dragDescription, fileExists: fileExists, uploadingTitle: uploadingTitle, successTitle: successTitle, onSuccess: handleFileChange, multiple: true, error: error }) })) }))] }));
|
package/build/hooks/index.d.ts
CHANGED
package/build/hooks/index.js
CHANGED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { useCallback, useEffect, useState } from 'react';
|
|
2
|
+
import { hasVerifiedValue } from '../utils';
|
|
3
|
+
export var useDataVerified = function (dataVerification, verifiedKeys) {
|
|
4
|
+
var _a = useState({}), dataVerified = _a[0], setVerified = _a[1];
|
|
5
|
+
var setVerifiedValue = useCallback(function () {
|
|
6
|
+
if (!dataVerification)
|
|
7
|
+
return;
|
|
8
|
+
var obj = {};
|
|
9
|
+
verifiedKeys.forEach(function (path) {
|
|
10
|
+
var isVerified = hasVerifiedValue(dataVerification, path);
|
|
11
|
+
obj[path] = isVerified;
|
|
12
|
+
});
|
|
13
|
+
setVerified(obj);
|
|
14
|
+
}, [dataVerification, verifiedKeys]);
|
|
15
|
+
useEffect(function () {
|
|
16
|
+
setVerifiedValue();
|
|
17
|
+
}, [setVerified]);
|
|
18
|
+
return dataVerified;
|
|
19
|
+
};
|