@tap-payments/auth-jsconnect 2.4.41-test → 2.4.42-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/components/SimpleList/SimpleList.d.ts +2 -1
- package/build/components/SimpleList/SimpleList.js +4 -6
- package/build/features/business/screens/Activities/ActivitiesList.js +1 -1
- package/build/features/connect/screens/Merchant/BrandList.js +1 -1
- package/build/features/entity/screens/EntityCapital/ActivityList.js +1 -1
- package/package.json +1 -1
|
@@ -12,8 +12,9 @@ export interface SimpleListProps<T> extends ListProps {
|
|
|
12
12
|
searchValuePath?: string[];
|
|
13
13
|
getSelectedItemCondition?: (a: T, b: T) => boolean;
|
|
14
14
|
sx?: SxProps<Theme>;
|
|
15
|
+
space?: number;
|
|
15
16
|
}
|
|
16
|
-
declare function SimpleList<T>({ list, listItemProps, onSelectItem, renderItem, children, searchKeyPath, searchValuePath, selectedItems, getSelectedItemCondition, ...rest }: SimpleListProps<T>): JSX.Element;
|
|
17
|
+
declare function SimpleList<T>({ list, listItemProps, onSelectItem, renderItem, children, searchKeyPath, searchValuePath, selectedItems, getSelectedItemCondition, space, ...rest }: SimpleListProps<T>): JSX.Element;
|
|
17
18
|
declare namespace SimpleList {
|
|
18
19
|
var defaultProps: {
|
|
19
20
|
searchKeyPath: string;
|
|
@@ -78,16 +78,14 @@ var ListItemStyled = styled(ListItem)(function (_a) {
|
|
|
78
78
|
});
|
|
79
79
|
});
|
|
80
80
|
function SimpleList(_a) {
|
|
81
|
-
var list = _a.list, listItemProps = _a.listItemProps, onSelectItem = _a.onSelectItem, renderItem = _a.renderItem, children = _a.children, searchKeyPath = _a.searchKeyPath, searchValuePath = _a.searchValuePath, selectedItems = _a.selectedItems, getSelectedItemCondition = _a.getSelectedItemCondition, rest = __rest(_a, ["list", "listItemProps", "onSelectItem", "renderItem", "children", "searchKeyPath", "searchValuePath", "selectedItems", "getSelectedItemCondition"]);
|
|
82
|
-
var
|
|
83
|
-
var el = document.querySelector('[data-rsbs-overlay]');
|
|
84
|
-
var bottomSheetHeight = el ? el.clientHeight : 0;
|
|
81
|
+
var list = _a.list, listItemProps = _a.listItemProps, onSelectItem = _a.onSelectItem, renderItem = _a.renderItem, children = _a.children, searchKeyPath = _a.searchKeyPath, searchValuePath = _a.searchValuePath, selectedItems = _a.selectedItems, getSelectedItemCondition = _a.getSelectedItemCondition, _b = _a.space, space = _b === void 0 ? 187 : _b, rest = __rest(_a, ["list", "listItemProps", "onSelectItem", "renderItem", "children", "searchKeyPath", "searchValuePath", "selectedItems", "getSelectedItemCondition", "space"]);
|
|
82
|
+
var _c = React.useState(list), items = _c[0], setItems = _c[1];
|
|
85
83
|
React.useEffect(function () {
|
|
86
84
|
setItems(list);
|
|
87
85
|
}, [list]);
|
|
88
86
|
var maxHeight = React.useMemo(function () {
|
|
89
|
-
return
|
|
90
|
-
}, [
|
|
87
|
+
return "calc(100vh - ".concat(space, "px)");
|
|
88
|
+
}, [space]);
|
|
91
89
|
var mapSelectedItemBeginning = React.useMemo(function () {
|
|
92
90
|
if (getSelectedItemCondition && (selectedItems === null || selectedItems === void 0 ? void 0 : selectedItems.length)) {
|
|
93
91
|
var mapSelectedListFirst = __spreadArray(__spreadArray([], items.filter(function (a) { return selectedItems.some(function (c) { return getSelectedItemCondition(a, c); }); }), true), items.filter(function (a) { return !selectedItems.some(function (c) { return getSelectedItemCondition(a, c); }); }), true);
|
|
@@ -262,7 +262,7 @@ var ActivityList = function (_a) {
|
|
|
262
262
|
onSelectItem(activity);
|
|
263
263
|
}, listItemProps: { sx: { padding: 0, '&:last-child': { paddingBottom: 0 } } }, renderItem: function (activity, idx) {
|
|
264
264
|
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) })] })));
|
|
265
|
-
} }) }))] })), _jsx(Search, { onSearchValue: handleSearch, placeholder: 'search_activities_placeholder' }), _jsx(SimpleListStyled, { sx: { maxHeight: '350px', paddingTop: 0 }, list: activities, listItemProps: { sx: { padding: 0 } }, onSelectItem: function (section) {
|
|
265
|
+
} }) }))] })), _jsx(Search, { onSearchValue: handleSearch, placeholder: 'search_activities_placeholder' }), _jsx(SimpleListStyled, { space: 292, sx: { maxHeight: '350px', paddingTop: 0 }, list: activities, listItemProps: { sx: { padding: 0 } }, onSelectItem: function (section) {
|
|
266
266
|
var isDivisionNotAvailable = !section.divisions || section.divisions.length === 0;
|
|
267
267
|
if (isDivisionNotAvailable)
|
|
268
268
|
onSelectItem(section);
|
|
@@ -99,7 +99,7 @@ var BrandList = function (_a) {
|
|
|
99
99
|
}), { shouldValidate: true });
|
|
100
100
|
onCloseBrandList();
|
|
101
101
|
};
|
|
102
|
-
return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, { children: [_jsx(InputStyled, { label: t('select_brand_label'), onClick: !!anchorEl ? onCloseBrandList : onOpenBrandList, endAdornment: _jsx(ExpandIcon, { anchorEl: !!anchorEl }), placeholder: t('choose_brand'), value: t(getBrandName(selectedBrand)) }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleList, { searchKeyPath: 'id', list: list, onSelectItem: onSelectItem, renderItem: function (item) {
|
|
102
|
+
return (_jsx(Collapse, __assign({ in: show }, { children: _jsxs(ScreenContainer, { children: [_jsx(InputStyled, { label: t('select_brand_label'), onClick: !!anchorEl ? onCloseBrandList : onOpenBrandList, endAdornment: _jsx(ExpandIcon, { anchorEl: !!anchorEl }), placeholder: t('choose_brand'), value: t(getBrandName(selectedBrand)) }), _jsx(Collapse, __assign({ in: !!anchorEl }, { children: _jsx(SimpleList, { searchKeyPath: 'id', space: 140, list: list, onSelectItem: onSelectItem, renderItem: function (item) {
|
|
103
103
|
return (_jsxs(_Fragment, { children: [_jsx(BrandContainer, { children: _jsx(BrandNameText, __assign({ isSelected: getBrandId(item) === getBrandId(selectedBrand) }, { children: isOtherBrand(item) ? t(getBrandName(item)) : getBrandName(item) })) }), getBrandId(item) === getBrandId(selectedBrand) && _jsx(CheckIcon, {})] }));
|
|
104
104
|
} }) }))] }) })));
|
|
105
105
|
};
|
|
@@ -256,7 +256,7 @@ var ActivityList = function (_a) {
|
|
|
256
256
|
onSelectItem(activity);
|
|
257
257
|
}, listItemProps: { sx: { padding: 0, '&:last-child': { paddingBottom: 0 } } }, renderItem: function (activity, idx) {
|
|
258
258
|
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) })] })));
|
|
259
|
-
} }) }))] })), _jsx(Search, { onSearchValue: handleSearch, placeholder: 'search_activities_placeholder' }), _jsx(SimpleListStyled, { sx: { maxHeight: '350px', paddingTop: 0 }, list: activities, listItemProps: { sx: { padding: 0 } }, onSelectItem: function (section) {
|
|
259
|
+
} }) }))] })), _jsx(Search, { onSearchValue: handleSearch, placeholder: 'search_activities_placeholder' }), _jsx(SimpleListStyled, { space: 292, sx: { maxHeight: '350px', paddingTop: 0 }, list: activities, listItemProps: { sx: { padding: 0 } }, onSelectItem: function (section) {
|
|
260
260
|
var isDivisionNotAvailable = !section.divisions || section.divisions.length === 0;
|
|
261
261
|
if (isDivisionNotAvailable)
|
|
262
262
|
onSelectItem(section);
|