@hmcts/ccd-case-ui-toolkit 6.13.10-show-condition-code-fix → 6.13.10-show-condition-code-fix-2

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.
@@ -11231,23 +11231,26 @@
11231
11231
  || !ReadFieldsFilterPipe.isEmpty(value[field.id]);
11232
11232
  };
11233
11233
  ReadFieldsFilterPipe.getValue = function (field, values, index) {
11234
- var value;
11235
- if (index >= 0) {
11236
- value = values[index].value[field.id];
11237
- }
11238
- else {
11239
- value = values[field.id];
11234
+ if (ReadFieldsFilterPipe.isEmpty(field.value)) {
11235
+ var value = void 0;
11236
+ if (index >= 0) {
11237
+ value = values[index].value[field.id];
11238
+ }
11239
+ else {
11240
+ value = values[field.id];
11241
+ }
11242
+ return value;
11240
11243
  }
11241
- return ReadFieldsFilterPipe.isEmpty(field.value) ? value : field.value;
11244
+ return field.value;
11242
11245
  };
11243
- ReadFieldsFilterPipe.evaluateConditionalShow = function (field, formValue, path, formGroupAvaliable, fieldId) {
11246
+ ReadFieldsFilterPipe.evaluateConditionalShow = function (field, formValue, path, formGroupAvailable, fieldId) {
11244
11247
  if (field.display_context === 'HIDDEN') {
11245
11248
  field.hidden = true;
11246
11249
  }
11247
11250
  else if (field.show_condition) {
11248
11251
  var cond = void 0;
11249
- if (fieldId && field.show_condition.indexOf(fieldId + ".") > -1 && !formGroupAvaliable && !!Object.keys(formValue).length) {
11250
- var search = fieldId + '.';
11252
+ if (fieldId && field.show_condition.indexOf(fieldId + ".") > -1 && !formGroupAvailable && !!Object.keys(formValue).length) {
11253
+ var search = fieldId + ".";
11251
11254
  var searchRegExp = new RegExp(search, 'g');
11252
11255
  var replaceWith = '';
11253
11256
  cond = ShowCondition.getInstance(field.show_condition.replace(searchRegExp, replaceWith));