@hmcts/ccd-case-ui-toolkit 6.13.10-show-condition-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.
- package/bundles/hmcts-ccd-case-ui-toolkit.umd.js +14 -13
- package/bundles/hmcts-ccd-case-ui-toolkit.umd.js.map +1 -1
- package/bundles/hmcts-ccd-case-ui-toolkit.umd.min.js +1 -1
- package/bundles/hmcts-ccd-case-ui-toolkit.umd.min.js.map +1 -1
- package/esm2015/lib/shared/pipes/complex/ccd-read-fields-filter.pipe.js +15 -14
- package/fesm2015/hmcts-ccd-case-ui-toolkit.js +14 -13
- package/fesm2015/hmcts-ccd-case-ui-toolkit.js.map +1 -1
- package/lib/shared/pipes/complex/ccd-read-fields-filter.pipe.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -11231,28 +11231,29 @@
|
|
|
11231
11231
|
|| !ReadFieldsFilterPipe.isEmpty(value[field.id]);
|
|
11232
11232
|
};
|
|
11233
11233
|
ReadFieldsFilterPipe.getValue = function (field, values, index) {
|
|
11234
|
-
|
|
11235
|
-
|
|
11236
|
-
|
|
11237
|
-
|
|
11238
|
-
|
|
11239
|
-
|
|
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
|
|
11244
|
+
return field.value;
|
|
11242
11245
|
};
|
|
11243
|
-
ReadFieldsFilterPipe.evaluateConditionalShow = function (field, formValue, path,
|
|
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 && !
|
|
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
|
-
|
|
11254
|
-
var isValidCondition = condition.split('"').length % 2 === 0;
|
|
11255
|
-
cond = ShowCondition.getInstance(isValidCondition ? field.show_condition : condition);
|
|
11256
|
+
cond = ShowCondition.getInstance(field.show_condition.replace(searchRegExp, replaceWith));
|
|
11256
11257
|
}
|
|
11257
11258
|
else {
|
|
11258
11259
|
cond = ShowCondition.getInstance(field.show_condition);
|