@tap-payments/auth-jsconnect 2.4.60-test → 2.4.61-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.
@@ -113,15 +113,15 @@ var Occupation = function (props) {
113
113
  setSubIndex(item.code);
114
114
  }, [anchorEl, occupationValue]);
115
115
  return (_jsx(Collapse, __assign({ in: props.show }, { children: _jsxs(ScreenContainer, __assign({ sx: { pb: 2.5 } }, { children: [_jsx(InputSelect, { required: true, label: t('occupation_title'), value: (isAr ? (_a = occupationValue === null || occupationValue === void 0 ? void 0 : occupationValue.name) === null || _a === void 0 ? void 0 : _a.ar : (_b = occupationValue === null || occupationValue === void 0 ? void 0 : occupationValue.name) === null || _b === void 0 ? void 0 : _b.en) || '', readOnly: props.readOnly, onClick: !!anchorEl ? handleCloseMainMenu : handleOpenMainMenu, placeholder: t('choose_any_occupation'), endAdornment: _jsx(ExpandIcon, { anchorEl: !!anchorEl }) }), _jsxs(Collapse, __assign({ in: !!anchorEl }, { children: [_jsx(Search, { onSearchValue: handleSearch }), _jsx(SimpleListStyled, { sx: { maxHeight: '350px', paddingTop: 0 }, list: occupation, listItemProps: { sx: { padding: 0 } }, onSelectItem: function (item) {
116
- var isOnlyOneItem = !item.sub || item.sub.length === 1;
117
- if (isOnlyOneItem)
118
- onSelectItem(item);
116
+ var _a;
117
+ if (((_a = item.sub) === null || _a === void 0 ? void 0 : _a.length) === 1)
118
+ onSelectItem(item.sub[0]);
119
119
  else
120
120
  handleOpenSubMenu(item.code);
121
121
  }, renderItem: function (item) {
122
122
  var _a;
123
123
  var isOnlyOneItem = !item.sub || ((_a = item.sub) === null || _a === void 0 ? void 0 : _a.length) === 1;
124
- var showCheck = item.code === (occupationValue === null || occupationValue === void 0 ? void 0 : occupationValue.code) && isOnlyOneItem;
124
+ var showCheck = item.code === (occupationValue === null || occupationValue === void 0 ? void 0 : occupationValue.section_code) && isOnlyOneItem;
125
125
  return (_jsxs(ListItemContainer, { children: [_jsxs(ListItem, __assign({ sx: __assign({ bgcolor: 'rgb(196 184 184 / 8%)', borderBottom: '1px solid rgba(227, 232, 238, 0.8)' }, (isOnlyOneItem && { bgcolor: 'inherit', borderBottom: 'none' })) }, { children: [_jsx(NameContainer, __assign({ isSelected: item.code === (occupationValue === null || occupationValue === void 0 ? void 0 : occupationValue.section_code), sx: __assign({}, (isOnlyOneItem && { paddingInlineStart: '5px' })) }, { children: isAr ? item.name.ar : item.name.en })), showCheck ? _jsx(CheckIcon, {}) : !isOnlyOneItem && _jsx(ExpandIcon, { anchorEl: subIndex === item.code })] })), _jsx(Collapse, __assign({ in: item.code === subIndex && !isOnlyOneItem }, { children: _jsx(SimpleListStyled, { sx: { pt: 0, pb: 0 }, list: (!isOnlyOneItem && item.sub) || [], onSelectItem: onSelectItem, listItemProps: { sx: { padding: 0, '&:last-child': { paddingBottom: 0 } } }, renderItem: function (item, idx) {
126
126
  return (_jsxs(ListItem, __assign({ sx: { mt: idx === 0 ? 1 : 0 } }, { children: [_jsx(NameContainer, __assign({ isSelected: item.code === (occupationValue === null || occupationValue === void 0 ? void 0 : occupationValue.code) }, { children: isAr ? item.name.ar : item.name.en })), item.code === (occupationValue === null || occupationValue === void 0 ? void 0 : occupationValue.code) && _jsx(CheckIcon, {})] })));
127
127
  } }) }))] }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tap-payments/auth-jsconnect",
3
- "version": "2.4.60-test",
3
+ "version": "2.4.61-test",
4
4
  "description": "connect library, auth",
5
5
  "private": false,
6
6
  "main": "build/index.js",