@itilite/iui-user-management 0.2.4 → 0.2.6

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.
@@ -1,5 +1,5 @@
1
1
  import { IUIAsyncSelect, IUIBox, IUILabel, IUIFileUpload, IUICheckboxButton, IUIPhone, IUISelect, IUIDatePicker, IUIInput, IUIDivider, IUIGrid, IUITypography, IUIRadio, IUIButton, IUIModal, IUIAccordion, IUIAccordionSummary, IUIAccordionDetails, IUIIconButton, IUICard, IUIBackdrop, IUICircularProgress, IUIBreadCrumb, IUIDropzone, IUIStepper, IUIFormControlLabel, IUICheckBox, IUIPrimaryRadio, IUITable, IUISkeleton, IUIProfileBox, IUIFormGroup, IUIDropdownButton } from '@itilite/iuistyles';
2
- import React, { useState, useEffect, Fragment as Fragment$1 } from 'react';
2
+ import React, { useState, useEffect, useRef, Fragment as Fragment$1 } from 'react';
3
3
  import { configs, services, utilUrls } from '@itilite/utils';
4
4
  import axios from 'axios';
5
5
  import AddIcon$1 from '@material-ui/icons/Add';
@@ -178,22 +178,22 @@ function clsx() {
178
178
  return n;
179
179
  }
180
180
 
181
- function GetInputType(_ref) {
182
- var _p = _ref._p,
183
- _ref$inputState = _ref.inputState,
184
- inputState = _ref$inputState === void 0 ? {} : _ref$inputState,
185
- _ref$customHandler = _ref.customHandler,
186
- customHandler = _ref$customHandler === void 0 ? function () {} : _ref$customHandler,
187
- _ref$dropdownList = _ref.dropdownList,
188
- dropdownList = _ref$dropdownList === void 0 ? {} : _ref$dropdownList,
189
- _ref$dateFormat = _ref.dateFormat,
190
- dateFormat = _ref$dateFormat === void 0 ? 'dd MMM yyyy' : _ref$dateFormat,
191
- _ref$errorArray = _ref.errorArray,
192
- errorArray = _ref$errorArray === void 0 ? [] : _ref$errorArray,
193
- _ref$errorMsg = _ref.errorMsg,
194
- errorMsg = _ref$errorMsg === void 0 ? '' : _ref$errorMsg,
195
- _ref$showNaOption = _ref.showNaOption,
196
- showNaOption = _ref$showNaOption === void 0 ? false : _ref$showNaOption;
181
+ var GetInputType = React.forwardRef(function (props, ref) {
182
+ var _p = props._p,
183
+ _props$inputState = props.inputState,
184
+ inputState = _props$inputState === void 0 ? {} : _props$inputState,
185
+ _props$customHandler = props.customHandler,
186
+ customHandler = _props$customHandler === void 0 ? function () {} : _props$customHandler,
187
+ _props$dropdownList = props.dropdownList,
188
+ dropdownList = _props$dropdownList === void 0 ? {} : _props$dropdownList,
189
+ _props$dateFormat = props.dateFormat,
190
+ dateFormat = _props$dateFormat === void 0 ? 'dd MMM yyyy' : _props$dateFormat,
191
+ _props$errorArray = props.errorArray,
192
+ errorArray = _props$errorArray === void 0 ? [] : _props$errorArray,
193
+ _props$errorMsg = props.errorMsg,
194
+ errorMsg = _props$errorMsg === void 0 ? '' : _props$errorMsg,
195
+ _props$showNaOption = props.showNaOption,
196
+ showNaOption = _props$showNaOption === void 0 ? false : _props$showNaOption;
197
197
 
198
198
  switch (_p.type) {
199
199
  case 'input':
@@ -323,6 +323,7 @@ function GetInputType(_ref) {
323
323
 
324
324
  case 'async_select':
325
325
  return /*#__PURE__*/React.createElement(IUIAsyncSelect, {
326
+ ref: ref,
326
327
  id: _p.name,
327
328
  additional: {
328
329
  page: 1,
@@ -356,7 +357,7 @@ function GetInputType(_ref) {
356
357
  default:
357
358
  return null;
358
359
  }
359
- }
360
+ });
360
361
 
361
362
  var env = configs.env;
362
363
  var IUILocalStorageService = services.IUILocalStorageService;
@@ -5073,6 +5074,13 @@ var UserAddEdit = function UserAddEdit(props) {
5073
5074
  expenseFYI = _useState20[0],
5074
5075
  setExpenseFYI = _useState20[1];
5075
5076
 
5077
+ var asyncSelectRefs = useRef({
5078
+ emp_level: useRef(null),
5079
+ entity: useRef(null),
5080
+ business_unit: useRef(null),
5081
+ department: useRef(null)
5082
+ });
5083
+
5076
5084
  var _useState21 = useState([]),
5077
5085
  errorArray = _useState21[0],
5078
5086
  setErrorArray = _useState21[1];
@@ -5169,6 +5177,7 @@ var UserAddEdit = function UserAddEdit(props) {
5169
5177
  };
5170
5178
 
5171
5179
  var onModalOpen = function onModalOpen(e, id) {
5180
+ console.log('onModalOpen', e, id);
5172
5181
  var title = '';
5173
5182
 
5174
5183
  if (id === 'entity') {
@@ -5211,6 +5220,7 @@ var UserAddEdit = function UserAddEdit(props) {
5211
5220
  value: res.data.value,
5212
5221
  label: res.data.label
5213
5222
  }, _extends2)));
5223
+ asyncSelectRefs.current[tempKey].current.blur();
5214
5224
  clearCacheForAsyncDropdown(function (prevState) {
5215
5225
  var _extends3;
5216
5226
 
@@ -6595,7 +6605,8 @@ var UserAddEdit = function UserAddEdit(props) {
6595
6605
  countryCode: countryCode,
6596
6606
  errorArray: errorArray,
6597
6607
  errorMsg: errorMsgs[p.name],
6598
- showNaOption: !p.required
6608
+ showNaOption: !p.required,
6609
+ ref: asyncSelectRefs.current[p.name]
6599
6610
  }));
6600
6611
  }), renderFields.userTagType.length ? /*#__PURE__*/React.createElement(Fragment$1, null, /*#__PURE__*/React.createElement(IUIGrid, {
6601
6612
  container: true,