@churchillliving/se-ui-toolkit 6.53.271 → 6.53.272

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.
@@ -6082,113 +6082,114 @@
6082
6082
  var _this = this;
6083
6083
  var isValid = true;
6084
6084
  formFields.map(function (item) {
6085
- var _a, _b, _c, _d;
6085
+ var _a, _b;
6086
6086
  if (item.validations && !item.disabled) {
6087
- if (item.control === exports.EFormControl.LOOKUP_INPUT && item.value && typeof (item.value) === 'object') {
6088
- item.value = item.value.value;
6089
- }
6087
+ var itemValue = item.control === exports.EFormControl.LOOKUP_INPUT && item.value && typeof (item.value) === 'object' ? item.value.value : item.value;
6088
+ // if(item.control === EFormControl.LOOKUP_INPUT && item.value && typeof(item.value) === 'object'){
6089
+ // item.value = item.value.value;
6090
+ // }
6090
6091
  item.errorMessage = '';
6091
6092
  item.isvalid = true;
6092
6093
  for (var i = 0; i < item.validations.length; i++) {
6093
- var minMaxValidDate = calenderMinMaxValue(item, item.value, i);
6094
+ var minMaxValidDate = calenderMinMaxValue(item, itemValue, i);
6094
6095
  var valid = item.validations && typeof item.label === 'object'
6095
6096
  ? item.label.name
6096
6097
  : item.label;
6097
6098
  if (item.validations[i].type == exports.EValidator.REQUIRED &&
6098
- !item.value &&
6099
+ !itemValue &&
6099
6100
  !item.hidden &&
6100
6101
  valid) {
6101
- isValid = item.value
6102
+ isValid = itemValue
6102
6103
  ? true
6103
6104
  : _this.setErrorMessage(item, valid + " is required");
6104
6105
  break;
6105
6106
  }
6106
- else if (item.value &&
6107
+ else if (itemValue &&
6107
6108
  item.validations[i].type == exports.EValidator.MINLENGTH &&
6108
- item.value.length < item.validations[i].expression) {
6109
+ itemValue.length < item.validations[i].expression) {
6109
6110
  isValid =
6110
- item.value && item.value.length > item.validations[i].expression
6111
+ itemValue && itemValue.length > item.validations[i].expression
6111
6112
  ? true
6112
6113
  : _this.setErrorMessage(item, item.label + " Minimum " + item.validations[i].expression + " characters");
6113
6114
  break;
6114
6115
  }
6115
- else if (item.value &&
6116
+ else if (itemValue &&
6116
6117
  item.validations[i].type == exports.EValidator.MAXLENGTH &&
6117
- item.value.length > item.validations[i].expression) {
6118
+ itemValue.length > item.validations[i].expression) {
6118
6119
  isValid =
6119
- item.value && item.value.length < item.validations[i].expression
6120
+ itemValue && itemValue.length < item.validations[i].expression
6120
6121
  ? true
6121
6122
  : _this.setErrorMessage(item, item.label + " Maximum " + item.validations[i].expression + " characters");
6122
6123
  break;
6123
6124
  }
6124
- else if (item.value &&
6125
+ else if (itemValue &&
6125
6126
  item.validations[i].type == exports.EValidator.MINIMUM &&
6126
6127
  isValid) {
6127
6128
  if (item.control === exports.EFormControl.CALENDAR) {
6128
6129
  isValid = minMaxValidDate === 'minimum' ? _this.setErrorMessage(item, "Minimum " + valid + " " + item.validations[i].expression) : true;
6129
6130
  }
6130
- else if (item.value < item.validations[i].expression) {
6131
+ else if (itemValue < item.validations[i].expression) {
6131
6132
  isValid =
6132
- item.value && item.value.length > item.validations[i].expression
6133
+ itemValue && itemValue.length > item.validations[i].expression
6133
6134
  ? true
6134
6135
  : _this.setErrorMessage(item, item.label + " Minimum " + valid + " " + item.validations[i].expression);
6135
6136
  }
6136
6137
  }
6137
- else if (item.value &&
6138
+ else if (itemValue &&
6138
6139
  item.validations[i].type == exports.EValidator.MAXIMUM &&
6139
6140
  isValid) {
6140
6141
  if (item.control === exports.EFormControl.CALENDAR) {
6141
6142
  isValid = minMaxValidDate === 'greater' ? _this.setErrorMessage(item, "Maximum " + valid + " " + item.validations[i].expression) : true;
6142
6143
  }
6143
- else if (item.value > item.validations[i].expression) {
6144
+ else if (itemValue > item.validations[i].expression) {
6144
6145
  isValid =
6145
- item.value && item.value.length < item.validations[i].expression
6146
+ itemValue && itemValue.length < item.validations[i].expression
6146
6147
  ? true
6147
6148
  : _this.setErrorMessage(item, item.label + " Maximum " + valid + " " + item.validations[i].expression);
6148
6149
  }
6149
6150
  }
6150
- else if (item.value &&
6151
+ else if (itemValue &&
6151
6152
  item.validations[i].type == exports.EValidator.PATTERN &&
6152
- !item.value.match(item.validations[i].expression)) {
6153
+ !itemValue.match(item.validations[i].expression)) {
6153
6154
  isValid =
6154
- item.value && item.value.match(item.validations[i].expression)
6155
+ itemValue && itemValue.match(item.validations[i].expression)
6155
6156
  ? true
6156
6157
  : _this.setErrorMessage(item, "Enter valid " + valid);
6157
6158
  break;
6158
6159
  }
6159
- else if (item.value &&
6160
+ else if (itemValue &&
6160
6161
  item.validations[i].type == exports.EValidator.NUMERIC &&
6161
- !item.value.toString().match(/^(0|[-()1-9]\d*)$/)) {
6162
+ !itemValue.toString().match(/^(0|[-()1-9]\d*)$/)) {
6162
6163
  isValid =
6163
- item.value && ((_b = (_a = item.value) === null || _a === void 0 ? void 0 : _a.toString()) === null || _b === void 0 ? void 0 : _b.match(/^(0|[1-9]\d*)$/))
6164
+ itemValue && ((_a = itemValue === null || itemValue === void 0 ? void 0 : itemValue.toString()) === null || _a === void 0 ? void 0 : _a.match(/^(0|[1-9]\d*)$/))
6164
6165
  ? true
6165
6166
  : _this.setErrorMessage(item, "Enter " + item.validations[i].type + " for " + valid);
6166
6167
  break;
6167
6168
  }
6168
- else if (item.value &&
6169
+ else if (itemValue &&
6169
6170
  item.validations[i].type == exports.EValidator.PHONE &&
6170
- !item.value.toString().match(/^(?=.*[0-9])[-()0-9\s]+$/)) {
6171
+ !itemValue.toString().match(/^(?=.*[0-9])[-()0-9\s]+$/)) {
6171
6172
  isValid =
6172
- item.value && item.value.toString().match(/^(?=.*[0-9])[-()0-9\s]+$/)
6173
+ itemValue && itemValue.toString().match(/^(?=.*[0-9])[-()0-9\s]+$/)
6173
6174
  ? true
6174
6175
  : _this.setErrorMessage(item, "Enter valid " + valid);
6175
6176
  break;
6176
6177
  }
6177
- else if (item.value &&
6178
+ else if (itemValue &&
6178
6179
  item.validations[i].type == exports.EValidator.DECIMAL &&
6179
- !((_d = (_c = item.value) === null || _c === void 0 ? void 0 : _c.toString()) === null || _d === void 0 ? void 0 : _d.match(/^(0|[-()1-9]\d*)(\.\d+)?$/))) {
6180
+ !((_b = itemValue === null || itemValue === void 0 ? void 0 : itemValue.toString()) === null || _b === void 0 ? void 0 : _b.match(/^(0|[-()1-9]\d*)(\.\d+)?$/))) {
6180
6181
  isValid =
6181
- item.value && item.value.match(/^(0|[1-9]\d*)(\.\d+)?$/)
6182
+ itemValue && itemValue.match(/^(0|[1-9]\d*)(\.\d+)?$/)
6182
6183
  ? true
6183
6184
  : _this.setErrorMessage(item, "Enter " + item.validations[i].type + " for " + valid);
6184
6185
  break;
6185
6186
  }
6186
- else if (item.value &&
6187
+ else if (itemValue &&
6187
6188
  item.validations[i].type == exports.EValidator.EMAIL &&
6188
- !item.value.match(/^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,6}$/)) {
6189
+ !itemValue.match(/^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,6}$/)) {
6189
6190
  isValid =
6190
- item.value &&
6191
- item.value.match(/^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,6}$/)
6191
+ itemValue &&
6192
+ itemValue.match(/^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,6}$/)
6192
6193
  ? true
6193
6194
  : _this.setErrorMessage(item, "Enter valid " + valid);
6194
6195
  break;
@@ -6207,6 +6208,7 @@
6207
6208
  if (!fieldInfo.label) {
6208
6209
  fieldInfo.label = fieldInfo.field;
6209
6210
  }
6211
+ console.log('field ingo', fieldInfo);
6210
6212
  var formField = {
6211
6213
  label: fieldInfo.label,
6212
6214
  field: fieldInfo.field,
@@ -6338,11 +6340,11 @@
6338
6340
  FormService.prototype.getAutoCompleteData = function (formField, uniqueKey, filters, search) {
6339
6341
  if (search === void 0) { search = ''; }
6340
6342
  this.requestService.get('/Data/Fetch', { uniqueKey: uniqueKey, filters: filters }).subscribe(function (response) {
6341
- var _e;
6343
+ var _c;
6342
6344
  if (search) {
6343
6345
  var existInRecord = response.records.some(function (record) { var _a, _b; return record[formField.displayField] && ((_b = (_a = record[formField.displayField]) === null || _a === void 0 ? void 0 : _a.toString()) === null || _b === void 0 ? void 0 : _b.toLowerCase()) === (search === null || search === void 0 ? void 0 : search.toLowerCase()); });
6344
6346
  if (!existInRecord) {
6345
- response.records.unshift((_e = {}, _e[formField.displayField] = search, _e));
6347
+ response.records.unshift((_c = {}, _c[formField.displayField] = search, _c));
6346
6348
  }
6347
6349
  }
6348
6350
  formField.data = __spreadArray([], __read(response.records));
@@ -6445,17 +6447,17 @@
6445
6447
  });
6446
6448
  };
6447
6449
  // load component on form
6448
- FormService.prototype.setAddComponentData = function (_e, id, value) {
6449
- var formSections = _e.formSections;
6450
+ FormService.prototype.setAddComponentData = function (_c, id, value) {
6451
+ var formSections = _c.formSections;
6450
6452
  formSections === null || formSections === void 0 ? void 0 : formSections.forEach(function (section) {
6451
6453
  section.fields.forEach(function (field) {
6452
6454
  var _a;
6453
6455
  if (field.control === exports.EFormControl.COMPONENT && field.componentControl && ((_a = field.componentControl) === null || _a === void 0 ? void 0 : _a.id) === id) {
6454
6456
  var keys = Object.keys(value);
6455
6457
  keys.forEach(function (key) {
6456
- var _e;
6458
+ var _c;
6457
6459
  var _a;
6458
- field.componentControl.data = Object.assign(Object.assign({}, (_a = field.componentControl) === null || _a === void 0 ? void 0 : _a.data), (_e = {}, _e[key] = value[key], _e));
6460
+ field.componentControl.data = Object.assign(Object.assign({}, (_a = field.componentControl) === null || _a === void 0 ? void 0 : _a.data), (_c = {}, _c[key] = value[key], _c));
6459
6461
  });
6460
6462
  changeDynamicFormState(id, field.componentControl.data);
6461
6463
  }
@@ -6464,8 +6466,8 @@
6464
6466
  });
6465
6467
  };
6466
6468
  // set formfield value
6467
- FormService.prototype.setFormFieldValue = function (_e, field, value, displayText) {
6468
- var formSections = _e.formSections;
6469
+ FormService.prototype.setFormFieldValue = function (_c, field, value, displayText) {
6470
+ var formSections = _c.formSections;
6469
6471
  if (displayText === void 0) { displayText = ''; }
6470
6472
  formSections === null || formSections === void 0 ? void 0 : formSections.forEach(function (section) {
6471
6473
  section.fields.forEach(function (formField) {
@@ -6482,8 +6484,8 @@
6482
6484
  });
6483
6485
  };
6484
6486
  // set formfield property
6485
- FormService.prototype.setFormFieldProp = function (_e, field, props) {
6486
- var formSections = _e.formSections;
6487
+ FormService.prototype.setFormFieldProp = function (_c, field, props) {
6488
+ var formSections = _c.formSections;
6487
6489
  return formSections === null || formSections === void 0 ? void 0 : formSections.map(function (section) {
6488
6490
  return section.fields.map(function (formField) {
6489
6491
  var _a;
@@ -6517,8 +6519,8 @@
6517
6519
  else {
6518
6520
  return resolve([]);
6519
6521
  }
6520
- }, function (_e) {
6521
- var error = _e.error;
6522
+ }, function (_c) {
6523
+ var error = _c.error;
6522
6524
  reject(error);
6523
6525
  });
6524
6526
  });