@hmcts/ccd-case-ui-toolkit 4.12.4 → 4.12.5

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.umd.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @hmcts/ccd-case-ui-toolkit - Case UI Toolkit
3
- * @version v4.12.4
3
+ * @version v4.12.5
4
4
  * @link undefined
5
5
  * @license MIT
6
6
  */
@@ -19196,7 +19196,7 @@ var CaseEditPageComponent = /** @class */ (function () {
19196
19196
  };
19197
19197
  CaseEditPageComponent.prototype.updateFormControlsValue = function (formGroup, caseFieldId, value) {
19198
19198
  var theControl = formGroup.controls['data'].get(caseFieldId);
19199
- if (theControl) {
19199
+ if (theControl && theControl['status'] !== 'DISABLED') {
19200
19200
  if (Array.isArray(theControl.value) && Array.isArray(value)
19201
19201
  && theControl.value.length > value.length && theControl['caseField']
19202
19202
  && theControl['caseField']['display_context'] && theControl['caseField']['display_context'] === 'OPTIONAL'
@@ -42247,11 +42247,11 @@ var FieldsUtils = /** @class */ (function () {
42247
42247
  if (isDynamicField) {
42248
42248
  var dynamicListValue = _this.getDynamicListValue(rootCaseField.value, field.id);
42249
42249
  if (dynamicListValue) {
42250
- var list_items = dynamicListValue[0].list_items;
42251
- var complexValue = dynamicListValue.map(function (data) { return data.value; });
42250
+ var list_items = dynamicListValue.list_items;
42251
+ var complexValue = dynamicListValue.value;
42252
42252
  var value = {
42253
42253
  list_items: list_items,
42254
- value: complexValue.length > 0 ? complexValue : undefined
42254
+ value: complexValue ? complexValue : undefined
42255
42255
  };
42256
42256
  field.value = __assign({}, value);
42257
42257
  field.formatted_value = __assign({}, field.formatted_value, value);
@@ -42273,22 +42273,17 @@ var FieldsUtils = /** @class */ (function () {
42273
42273
  }
42274
42274
  };
42275
42275
  FieldsUtils.getDynamicListValue = function (jsonBlock, key) {
42276
- var data = jsonBlock ? this.getNestedFieldValues(jsonBlock, key, []) : [];
42277
- return data.length > 0 ? data : null;
42278
- };
42279
- FieldsUtils.getNestedFieldValues = function (jsonData, key, output) {
42280
- if (output === void 0) { output = []; }
42281
- if (jsonData && jsonData[key]) {
42282
- output.push(jsonData[key]);
42276
+ if (jsonBlock[key]) {
42277
+ return jsonBlock[key];
42283
42278
  }
42284
42279
  else {
42285
- for (var elementKey in jsonData) {
42286
- if (typeof jsonData === 'object' && jsonData.hasOwnProperty(elementKey)) {
42287
- this.getNestedFieldValues(jsonData[elementKey], key, output);
42280
+ for (var elementKey in jsonBlock) {
42281
+ if (typeof jsonBlock === 'object' && jsonBlock.hasOwnProperty(elementKey)) {
42282
+ return this.getDynamicListValue(jsonBlock[elementKey], key);
42288
42283
  }
42289
42284
  }
42290
42285
  }
42291
- return output;
42286
+ return null;
42292
42287
  };
42293
42288
  FieldsUtils.prototype.buildCanShowPredicate = function (eventTrigger, form) {
42294
42289
  var currentState = this.getCurrentEventState(eventTrigger, form);