@itilite/iui-user-management 0.2.2 → 0.2.4

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/dist/index.js CHANGED
@@ -2853,8 +2853,11 @@ var personalInfo = [{
2853
2853
  readOnly: false,
2854
2854
  placeholder: 'Enter first and middle name',
2855
2855
  validation: {
2856
- regexOnChange: /^[a-zA-Z ]*$/,
2857
- regexOnBlur: null,
2856
+ regexOnChange: null,
2857
+ regexOnBlur: [{
2858
+ regex: /^[a-zA-Z ]*$/,
2859
+ message: 'Only alphabets are allowed.'
2860
+ }],
2858
2861
  maxLimit: '',
2859
2862
  minLimit: '',
2860
2863
  maxLength: 100,
@@ -2872,8 +2875,11 @@ var personalInfo = [{
2872
2875
  readOnly: false,
2873
2876
  placeholder: 'Enter last name',
2874
2877
  validation: {
2875
- regexOnChange: /^[a-zA-Z ]*$/,
2876
- regexOnBlur: null,
2878
+ regexOnChange: null,
2879
+ regexOnBlur: [{
2880
+ regex: /^[a-zA-Z ]*$/,
2881
+ message: 'Only alphabets are allowed.'
2882
+ }],
2877
2883
  maxLimit: '',
2878
2884
  minLimit: '',
2879
2885
  maxLength: 100,
@@ -2892,7 +2898,10 @@ var personalInfo = [{
2892
2898
  placeholder: 'Enter email address',
2893
2899
  validation: {
2894
2900
  regexOnChange: null,
2895
- regexOnBlur: /^(([^<>()\\.,;:\s@"]+(\.[^<>()\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,
2901
+ regexOnBlur: [{
2902
+ regex: /^(([^<>()\\.,;:\s@"]+(\.[^<>()\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,
2903
+ message: 'Invalid email address'
2904
+ }],
2896
2905
  maxLimit: '',
2897
2906
  minLimit: '',
2898
2907
  maxLength: 100,
@@ -2984,7 +2993,7 @@ var workInfo = [{
2984
2993
  value: 'employee_level',
2985
2994
  component: /*#__PURE__*/React__default.createElement(iuistyles.IUITypography, {
2986
2995
  className: "iui__font--color-link iui__font--weight-500"
2987
- }, "+ Add Employee Level"),
2996
+ }, "+ Add employee level"),
2988
2997
  callback: null
2989
2998
  }
2990
2999
  }, {
@@ -2998,8 +3007,11 @@ var workInfo = [{
2998
3007
  readOnly: false,
2999
3008
  placeholder: 'Enter employee ID',
3000
3009
  validation: {
3001
- regexOnChange: /^[A-Za-z0-9]*$/,
3002
- regexOnBlur: null,
3010
+ regexOnChange: null,
3011
+ regexOnBlur: [{
3012
+ regex: /^[A-Za-z0-9]*$/,
3013
+ message: 'Only alphabets & numbers are allowed'
3014
+ }],
3003
3015
  maxLimit: '',
3004
3016
  minLimit: '',
3005
3017
  maxLength: 100,
@@ -3026,7 +3038,7 @@ var workInfo = [{
3026
3038
  value: 'entity',
3027
3039
  component: /*#__PURE__*/React__default.createElement(iuistyles.IUITypography, {
3028
3040
  className: "iui__font--color-link iui__font--weight-500"
3029
- }, "+ Add Entity"),
3041
+ }, "+ Add entity"),
3030
3042
  callback: null
3031
3043
  }
3032
3044
  }, {
@@ -3048,7 +3060,7 @@ var workInfo = [{
3048
3060
  value: 'business_unit',
3049
3061
  component: /*#__PURE__*/React__default.createElement(iuistyles.IUITypography, {
3050
3062
  className: "iui__font--color-link iui__font--weight-500"
3051
- }, "+ Add Business Unit"),
3063
+ }, "+ Add business unit"),
3052
3064
  callback: null
3053
3065
  }
3054
3066
  }, {
@@ -3070,7 +3082,7 @@ var workInfo = [{
3070
3082
  value: 'department',
3071
3083
  component: /*#__PURE__*/React__default.createElement(iuistyles.IUITypography, {
3072
3084
  className: "iui__font--color-link iui__font--weight-500"
3073
- }, "+ Add Department"),
3085
+ }, "+ Add department"),
3074
3086
  callback: null
3075
3087
  }
3076
3088
  }, {
@@ -3084,8 +3096,14 @@ var workInfo = [{
3084
3096
  readOnly: false,
3085
3097
  placeholder: 'Enter designation',
3086
3098
  validation: {
3087
- regexOnChange: /^[A-Za-z0-9.&'()\- ]*$/,
3088
- regexOnBlur: /^[a-zA-Z][a-zA-Z0-9.&'()\- ]*$/,
3099
+ regexOnChange: null,
3100
+ regexOnBlur: [{
3101
+ regex: /^[A-Za-z0-9 -.&'()]*$/,
3102
+ message: "Only alphabets, numbers & special characters . & ' () - are allowed."
3103
+ }, {
3104
+ regex: /^[a-zA-Z]/,
3105
+ message: 'Designation should start with alphabets'
3106
+ }],
3089
3107
  maxLimit: '',
3090
3108
  minLimit: '',
3091
3109
  maxLength: 100,
@@ -3103,8 +3121,14 @@ var workInfo = [{
3103
3121
  visibility: true,
3104
3122
  readOnly: false,
3105
3123
  validation: {
3106
- regexOnChange: /^[A-Za-z0-9 -.&'()]*$/,
3107
- regexOnBlur: null,
3124
+ regexOnChange: null,
3125
+ regexOnBlur: [{
3126
+ regex: /^[A-Za-z0-9 -.&'()]*$/,
3127
+ message: "Only alphabets, numbers & special characters . & ' () - are allowed."
3128
+ }, {
3129
+ regex: /^[a-zA-Z]/,
3130
+ message: 'Base location should start with alphabets'
3131
+ }],
3108
3132
  maxLimit: '',
3109
3133
  minLimit: '',
3110
3134
  maxLength: 500,
@@ -3335,8 +3359,11 @@ var passportInfo = [{
3335
3359
  readOnly: false,
3336
3360
  placeholder: 'Enter passport number',
3337
3361
  validation: {
3338
- regexOnChange: /^[A-Za-z0-9]*$/,
3339
- regexOnBlur: null,
3362
+ regexOnChange: null,
3363
+ regexOnBlur: [{
3364
+ regex: /^[A-Za-z0-9]*$/,
3365
+ message: 'Only alphabets & numbers are allowed'
3366
+ }],
3340
3367
  maxLimit: '',
3341
3368
  minLimit: '',
3342
3369
  maxLength: 15,
@@ -5152,16 +5179,11 @@ var UserAddEdit = function UserAddEdit(props) {
5152
5179
  } else if (id === 'department') {
5153
5180
  title = 'Department';
5154
5181
  } else if (id === 'business_unit') {
5155
- title = 'Business Unit';
5182
+ title = 'Business unit';
5156
5183
  } else if (id === 'employee_level') {
5157
- title = 'Employee Level';
5184
+ title = 'Employee level';
5158
5185
  }
5159
5186
 
5160
- console.log(_extends({}, addModalData, {
5161
- isOpen: true,
5162
- title: title,
5163
- id: id
5164
- }));
5165
5187
  setAddModalData(_extends({}, addModalData, {
5166
5188
  isOpen: true,
5167
5189
  title: title,
@@ -5183,7 +5205,6 @@ var UserAddEdit = function UserAddEdit(props) {
5183
5205
  })).then(function (res) {
5184
5206
  var _extends2;
5185
5207
 
5186
- console.log(res, "success add " + addModalData.title + " response");
5187
5208
  setAddModalData(_extends({}, addModalData, {
5188
5209
  isOpen: false
5189
5210
  }));
@@ -5193,11 +5214,9 @@ var UserAddEdit = function UserAddEdit(props) {
5193
5214
  value: res.data.value,
5194
5215
  label: res.data.label
5195
5216
  }, _extends2)));
5196
- console.log('Set new value', res.data.label);
5197
5217
  clearCacheForAsyncDropdown(function (prevState) {
5198
5218
  var _extends3;
5199
5219
 
5200
- console.log('ClearCache function called');
5201
5220
  return _extends({}, prevState, (_extends3 = {}, _extends3[tempKey] = prevState[tempKey] + 1, _extends3));
5202
5221
  });
5203
5222
  dispatch(stopLoader());
@@ -5460,7 +5479,7 @@ var UserAddEdit = function UserAddEdit(props) {
5460
5479
  if ((_name === 'passport_photo' || _name === 'travel_docs') && _obj.openFile === true) {
5461
5480
  if (_obj.file.isExistingFile) {
5462
5481
  var link = document.createElement('a');
5463
- link.setAttribute('download', _obj.file.name);
5482
+ link.setAttribute('target', '_blank');
5464
5483
  link.href = _obj.file.presigned_url;
5465
5484
  document.body.appendChild(link);
5466
5485
  link.click();
@@ -5474,7 +5493,7 @@ var UserAddEdit = function UserAddEdit(props) {
5474
5493
  })).then(function (res) {
5475
5494
  dispatch(stopLoader());
5476
5495
  var link = document.createElement('a');
5477
- link.setAttribute('download', _obj.file.returned_file_name);
5496
+ link.setAttribute('target', '_blank');
5478
5497
  link.href = res.data.presigned_url;
5479
5498
  document.body.appendChild(link);
5480
5499
  link.click();