@hmcts/ccd-case-ui-toolkit 4.7.0-EUI-4412-order-fields-CYA-page → 4.7.0-EUI-4567-nested-fields-collection

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/RELEASE-NOTES.md CHANGED
@@ -1,8 +1,5 @@
1
1
  ## RELEASE NOTES
2
2
 
3
- ### Version 4.7.0-EUI-4412-order-fields-CYA-page
4
- **EUI-4414** Field order on the CYA page changes
5
-
6
3
  ### Version 3.1.5-complex-type-showing-in-tab
7
4
  **EUI-3798** 'Empty' complex type showing in tab (due to Label)
8
5
 
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.7.0-EUI-4412-order-fields-CYA-page
3
+ * @version v4.7.0-EUI-4567-nested-fields-collection
4
4
  * @link undefined
5
5
  * @license MIT
6
6
  */
@@ -20900,7 +20900,7 @@ var CcdPageFieldsPipe = /** @class */ (function () {
20900
20900
  return control['caseField'];
20901
20901
  }).filter(function (field) {
20902
20902
  return !!page.case_fields.find(function (pcf) { return pcf.id === field.id; });
20903
- }).sort(function (a, b) { return a.order - b.order; });
20903
+ });
20904
20904
  var rawValue = dataFormGroup.value;
20905
20905
  var value = page.case_fields.reduce(function (acc, field) {
20906
20906
  var _a;
@@ -29198,7 +29198,27 @@ var ShowCondition = /** @class */ (function () {
29198
29198
  if (!this.condition) {
29199
29199
  return true;
29200
29200
  }
29201
- return this.matchAndConditions(fields, path);
29201
+ return this.matchAndConditions(fields, this.updatePathName(path));
29202
+ };
29203
+ /**
29204
+ * Path Name gets updated for complex sub fields
29205
+ * @param path Path name.
29206
+ */
29207
+ ShowCondition.prototype.updatePathName = function (path) {
29208
+ if (path && path.split(/[_]+/g).length > 0) {
29209
+ var _a = path.split(/[_]+/g), pathName_1 = _a[0], pathTail = _a.slice(1);
29210
+ var pathFinalIndex_1 = pathTail.pop();
29211
+ var pathTailString = pathTail.toString();
29212
+ pathTail = pathTail.map(function (value) {
29213
+ return Number(pathFinalIndex_1) === Number(value) ? pathName_1 : value;
29214
+ });
29215
+ return pathTailString !== pathTail.toString()
29216
+ ? pathName_1 + "_" + pathTail.join('_') + "_" + pathFinalIndex_1
29217
+ : path;
29218
+ }
29219
+ else {
29220
+ return path;
29221
+ }
29202
29222
  };
29203
29223
  ShowCondition.prototype.matchByContextFields = function (contextFields) {
29204
29224
  return this.match(fields_utils_1.FieldsUtils.toValuesMap(contextFields));