@tap-payments/auth-jsconnect 2.3.90-test → 2.3.92-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.
|
@@ -161,11 +161,15 @@ var ActivityList = function (_a) {
|
|
|
161
161
|
return (controlValue === null || controlValue === void 0 ? void 0 : controlValue.length) + ' ' + t('activities_selected');
|
|
162
162
|
}
|
|
163
163
|
var item = (controlValue || [])[0];
|
|
164
|
-
|
|
164
|
+
var code = item === null || item === void 0 ? void 0 : item.isic_code;
|
|
165
|
+
var name = isAr ? ((_a = item === null || item === void 0 ? void 0 : item.name) === null || _a === void 0 ? void 0 : _a.ar) || ((_b = item === null || item === void 0 ? void 0 : item.name) === null || _b === void 0 ? void 0 : _b.en) : (_c = item === null || item === void 0 ? void 0 : item.name) === null || _c === void 0 ? void 0 : _c.en;
|
|
166
|
+
return code ? "".concat(code, " - ").concat(name) : name;
|
|
165
167
|
};
|
|
166
168
|
var getSelectedActivityName = function (item) {
|
|
167
169
|
var _a, _b, _c;
|
|
168
|
-
|
|
170
|
+
var code = item === null || item === void 0 ? void 0 : item.isic_code;
|
|
171
|
+
var name = isAr ? ((_a = item === null || item === void 0 ? void 0 : item.name) === null || _a === void 0 ? void 0 : _a.ar) || ((_b = item === null || item === void 0 ? void 0 : item.name) === null || _b === void 0 ? void 0 : _b.en) : (_c = item === null || item === void 0 ? void 0 : item.name) === null || _c === void 0 ? void 0 : _c.en;
|
|
172
|
+
return code ? "".concat(code, " - ").concat(name) : name;
|
|
169
173
|
};
|
|
170
174
|
var getSelectedActivitySectionFlag = function (section) {
|
|
171
175
|
var findSection = controlValue === null || controlValue === void 0 ? void 0 : controlValue.find(function (_a) {
|
|
@@ -235,7 +239,7 @@ var ActivityList = function (_a) {
|
|
|
235
239
|
}, [anchorEl, controlValue]);
|
|
236
240
|
return (_jsxs(ScreenContainer, { children: [_jsx(InputLabelStyled, { children: t('expected_sales_monthly', {
|
|
237
241
|
currency: t(findCurrencyByIso2(countryCode.iso2))
|
|
238
|
-
}) }), _jsx(InputStyled, { readOnly: readOnly, value: getSelectedActivities() || '', onClick: !!anchorEl ? handleCloseMainMenu : handleOpenMainMenu, placeholder: t('choose_expected_sales'), endAdornment: _jsx(ExpandIcon, { anchorEl: !!anchorEl }) }), _jsxs(Collapse, __assign({ in: !!anchorEl }, { children: [_jsx(Search, { onSearchValue: handleSearch }), _jsx(SimpleListStyled, { sx: { maxHeight: '350px', paddingTop: 0 }, list: activities, listItemProps: { sx: { padding: 0 } }, onSelectItem: function (section) {
|
|
242
|
+
}) }), _jsx(InputStyled, { readOnly: readOnly, value: getSelectedActivities() || '', onClick: !!anchorEl ? handleCloseMainMenu : handleOpenMainMenu, placeholder: t('choose_expected_sales'), endAdornment: _jsx(ExpandIcon, { anchorEl: !!anchorEl }) }), _jsxs(Collapse, __assign({ in: !!anchorEl }, { children: [_jsx(Search, { onSearchValue: handleSearch, placeholder: 'search_activities_placeholder' }), _jsx(SimpleListStyled, { sx: { maxHeight: '350px', paddingTop: 0 }, list: activities, listItemProps: { sx: { padding: 0 } }, onSelectItem: function (section) {
|
|
239
243
|
var isDivisionNotAvailable = !section.divisions || section.divisions.length === 0;
|
|
240
244
|
if (isDivisionNotAvailable)
|
|
241
245
|
onSelectItem(section);
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
interface SearchProps {
|
|
3
3
|
showSearch?: boolean;
|
|
4
|
+
placeholder?: string;
|
|
4
5
|
onSearchValue?: (value: string) => void;
|
|
5
6
|
}
|
|
6
|
-
declare const Search: ({ onSearchValue }: SearchProps) => JSX.Element;
|
|
7
|
+
declare const Search: ({ onSearchValue, placeholder }: SearchProps) => JSX.Element;
|
|
7
8
|
export default Search;
|
|
@@ -3,11 +3,11 @@ import * as React from 'react';
|
|
|
3
3
|
import { useTranslation } from 'react-i18next';
|
|
4
4
|
import Input from '../../shared/Input';
|
|
5
5
|
var Search = function (_a) {
|
|
6
|
-
var onSearchValue = _a.onSearchValue;
|
|
6
|
+
var onSearchValue = _a.onSearchValue, placeholder = _a.placeholder;
|
|
7
7
|
var t = useTranslation().t;
|
|
8
8
|
var handleOnChange = function (event) {
|
|
9
9
|
onSearchValue === null || onSearchValue === void 0 ? void 0 : onSearchValue(event.target.value);
|
|
10
10
|
};
|
|
11
|
-
return (_jsx(React.Fragment, { children: _jsx(Input, { placeholder: t('search_placeholder'), onChange: handleOnChange }) }));
|
|
11
|
+
return (_jsx(React.Fragment, { children: _jsx(Input, { placeholder: t(placeholder || 'search_placeholder'), onChange: handleOnChange }) }));
|
|
12
12
|
};
|
|
13
13
|
export default Search;
|