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

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.5
3
+ * @version v4.12.6
4
4
  * @link undefined
5
5
  * @license MIT
6
6
  */
@@ -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.list_items;
42251
- var complexValue = dynamicListValue.value;
42250
+ var list_items = dynamicListValue[0].list_items;
42251
+ var complexValue = dynamicListValue.map(function (data) { return data.value; });
42252
42252
  var value = {
42253
42253
  list_items: list_items,
42254
- value: complexValue ? complexValue : undefined
42254
+ value: complexValue.length > 0 ? complexValue : undefined
42255
42255
  };
42256
42256
  field.value = __assign({}, value);
42257
42257
  field.formatted_value = __assign({}, field.formatted_value, value);
@@ -42273,17 +42273,22 @@ var FieldsUtils = /** @class */ (function () {
42273
42273
  }
42274
42274
  };
42275
42275
  FieldsUtils.getDynamicListValue = function (jsonBlock, key) {
42276
- if (jsonBlock[key]) {
42277
- return 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]);
42278
42283
  }
42279
42284
  else {
42280
- for (var elementKey in jsonBlock) {
42281
- if (typeof jsonBlock === 'object' && jsonBlock.hasOwnProperty(elementKey)) {
42282
- return this.getDynamicListValue(jsonBlock[elementKey], key);
42285
+ for (var elementKey in jsonData) {
42286
+ if (typeof jsonData === 'object' && jsonData.hasOwnProperty(elementKey)) {
42287
+ this.getNestedFieldValues(jsonData[elementKey], key, output);
42283
42288
  }
42284
42289
  }
42285
42290
  }
42286
- return null;
42291
+ return output;
42287
42292
  };
42288
42293
  FieldsUtils.prototype.buildCanShowPredicate = function (eventTrigger, form) {
42289
42294
  var currentState = this.getCurrentEventState(eventTrigger, form);