@tap-payments/auth-jsconnect 2.4.64-test → 2.4.66-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.
|
@@ -114,15 +114,16 @@ var Occupation = function (props) {
|
|
|
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
116
|
var _a;
|
|
117
|
-
|
|
118
|
-
|
|
117
|
+
var isSubEmpty = !item.sub || !((_a = item.sub) === null || _a === void 0 ? void 0 : _a.length);
|
|
118
|
+
if (isSubEmpty)
|
|
119
|
+
onSelectItem(item);
|
|
119
120
|
else
|
|
120
121
|
handleOpenSubMenu(item.code);
|
|
121
122
|
}, renderItem: function (item) {
|
|
122
123
|
var _a;
|
|
123
|
-
var
|
|
124
|
-
var showCheck = item.code === (occupationValue === null || occupationValue === void 0 ? void 0 : occupationValue.section_code) &&
|
|
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)' }, (
|
|
124
|
+
var isSubEmpty = !item.sub || !((_a = item.sub) === null || _a === void 0 ? void 0 : _a.length);
|
|
125
|
+
var showCheck = item.code === (occupationValue === null || occupationValue === void 0 ? void 0 : occupationValue.section_code) && isSubEmpty;
|
|
126
|
+
return (_jsxs(ListItemContainer, { children: [_jsxs(ListItem, __assign({ sx: __assign({ bgcolor: 'rgb(196 184 184 / 8%)', borderBottom: '1px solid rgba(227, 232, 238, 0.8)' }, (isSubEmpty && { bgcolor: 'inherit', borderBottom: 'none' })) }, { children: [_jsx(NameContainer, __assign({ isSelected: item.code === (occupationValue === null || occupationValue === void 0 ? void 0 : occupationValue.section_code), sx: __assign({}, (isSubEmpty && { paddingInlineStart: '5px' })) }, { children: isAr ? item.name.ar : item.name.en })), showCheck ? _jsx(CheckIcon, {}) : !isSubEmpty && _jsx(ExpandIcon, { anchorEl: subIndex === item.code })] })), _jsx(Collapse, __assign({ in: item.code === subIndex && !isSubEmpty }, { children: _jsx(SimpleListStyled, { sx: { pt: 0, pb: 0 }, list: (!isSubEmpty && item.sub) || [], onSelectItem: onSelectItem, listItemProps: { sx: { padding: 0, '&:last-child': { paddingBottom: 0 } } }, renderItem: function (item, idx) {
|
|
126
127
|
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
128
|
} }) }))] }));
|
|
128
129
|
} })] }))] })) })));
|
|
@@ -24,5 +24,10 @@ export var InputStyled = styled(Input)(function (_a) {
|
|
|
24
24
|
});
|
|
25
25
|
});
|
|
26
26
|
export default function InputSelect(props) {
|
|
27
|
-
|
|
27
|
+
var handleFocus = function (event) {
|
|
28
|
+
event.target.blur();
|
|
29
|
+
if (props.onFocus)
|
|
30
|
+
props.onFocus(event);
|
|
31
|
+
};
|
|
32
|
+
return _jsx(InputStyled, __assign({}, props, { inputMode: 'none', onFocus: handleFocus }));
|
|
28
33
|
}
|