@hmcts/ccd-case-ui-toolkit 7.3.68-exui-4675 → 7.3.68-exui-4216

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.
@@ -17,7 +17,7 @@ import moment from 'moment';
17
17
  import { __decorate, __metadata } from 'tslib';
18
18
  import * as _ from 'underscore';
19
19
  import 'reflect-metadata';
20
- import { generate } from 'pegjs';
20
+ import { generate } from 'peggy';
21
21
  import { StateMachine } from '@edium/fsm';
22
22
  import * as i1$3 from '@angular/material/legacy-dialog';
23
23
  import { MAT_LEGACY_DIALOG_DATA, MatLegacyDialogModule } from '@angular/material/legacy-dialog';
@@ -10921,7 +10921,6 @@ function CaseEditFormComponent_ng_container_0_Template(rf, ctx) { if (rf & 1) {
10921
10921
  } }
10922
10922
  class CaseEditFormComponent {
10923
10923
  formValueService;
10924
- conditionalShowFormDirectives;
10925
10924
  fields = [];
10926
10925
  formGroup;
10927
10926
  caseFields = [];
@@ -10969,17 +10968,8 @@ class CaseEditFormComponent {
10969
10968
  const current = JSON.stringify(this.formValueService.sanitise(changes));
10970
10969
  this.initial !== current ? this.valuesChanged.emit(true) : this.valuesChanged.emit(false);
10971
10970
  }
10972
- // EXUI-4675 - needed for the race condition caused by the debounce in ConditionalShowFormDirective
10973
- syncConditionalShowStates() {
10974
- this.conditionalShowFormDirectives?.forEach(directive => directive.evalAllShowHideConditions());
10975
- }
10976
10971
  static ɵfac = function CaseEditFormComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || CaseEditFormComponent)(i0.ɵɵdirectiveInject(FormValueService)); };
10977
- static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: CaseEditFormComponent, selectors: [["ccd-case-edit-form"]], viewQuery: function CaseEditFormComponent_Query(rf, ctx) { if (rf & 1) {
10978
- i0.ɵɵviewQuery(ConditionalShowFormDirective, 5);
10979
- } if (rf & 2) {
10980
- let _t;
10981
- i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.conditionalShowFormDirectives = _t);
10982
- } }, inputs: { fields: "fields", formGroup: "formGroup", caseFields: "caseFields", pageChangeSubject: "pageChangeSubject" }, outputs: { valuesChanged: "valuesChanged" }, standalone: false, decls: 1, vars: 1, consts: [["CompoundRow", ""], ["ccdConditionalShowForm", "", 3, "formGroup", "caseFields", "contextFields", 4, "ngFor", "ngForOf"], ["ccdConditionalShowForm", "", 3, "formGroup", "caseFields", "contextFields"], ["ccdLabelSubstitutor", "", 3, "caseField", "formGroup", "contextFields"], [3, "ngSwitch"], [3, "caseField", "caseFields", "withLabel", "formGroup", 4, "ngSwitchCase"], [4, "ngSwitchCase"], [3, "caseField", "caseFields", "withLabel", "formGroup"], [4, "ngIf", "ngIfElse"], [3, "caseField", "caseFields", "formGroup", "idPrefix", "hidden"]], template: function CaseEditFormComponent_Template(rf, ctx) { if (rf & 1) {
10972
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: CaseEditFormComponent, selectors: [["ccd-case-edit-form"]], inputs: { fields: "fields", formGroup: "formGroup", caseFields: "caseFields", pageChangeSubject: "pageChangeSubject" }, outputs: { valuesChanged: "valuesChanged" }, standalone: false, decls: 1, vars: 1, consts: [["CompoundRow", ""], ["ccdConditionalShowForm", "", 3, "formGroup", "caseFields", "contextFields", 4, "ngFor", "ngForOf"], ["ccdConditionalShowForm", "", 3, "formGroup", "caseFields", "contextFields"], ["ccdLabelSubstitutor", "", 3, "caseField", "formGroup", "contextFields"], [3, "ngSwitch"], [3, "caseField", "caseFields", "withLabel", "formGroup", 4, "ngSwitchCase"], [4, "ngSwitchCase"], [3, "caseField", "caseFields", "withLabel", "formGroup"], [4, "ngIf", "ngIfElse"], [3, "caseField", "caseFields", "formGroup", "idPrefix", "hidden"]], template: function CaseEditFormComponent_Template(rf, ctx) { if (rf & 1) {
10983
10973
  i0.ɵɵtemplate(0, CaseEditFormComponent_ng_container_0_Template, 6, 11, "ng-container", 1);
10984
10974
  } if (rf & 2) {
10985
10975
  i0.ɵɵproperty("ngForOf", ctx.fields);
@@ -10988,10 +10978,7 @@ class CaseEditFormComponent {
10988
10978
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CaseEditFormComponent, [{
10989
10979
  type: Component,
10990
10980
  args: [{ selector: 'ccd-case-edit-form', standalone: false, template: "<ng-container ccdConditionalShowForm [formGroup]=\"formGroup\" [caseFields]=\"fields\" [contextFields]=\"caseFields\"\n *ngFor=\"let field of fields\">\n\n <div ccdLabelSubstitutor [caseField]=\"field\" [formGroup]=\"formGroup\" [contextFields]=\"caseFields\">\n <ng-container [ngSwitch]=\"field | ccdIsReadOnlyAndNotCollection\">\n\n <ccd-field-read *ngSwitchCase=\"true\" [caseField]=\"field\" [caseFields]=\"caseFields\" [withLabel]=\"true\"\n [formGroup]=\"formGroup\" [attr.field_id]=\"field.id\"\n [attr.field_type]=\"field.field_type.type\"></ccd-field-read>\n <ng-container *ngSwitchCase=\"false\">\n\n <ng-container *ngIf=\"!(field | ccdIsCompound); else CompoundRow\">\n <ccd-field-write [caseField]=\"field\"\n [caseFields]=\"caseFields\"\n [formGroup]=\"formGroup\"\n [idPrefix]=\"\"\n [hidden]=\"field.hidden\"\n [attr.field_id]=\"field.id\"\n [attr.field_type]=\"field.field_type.type\">\n </ccd-field-write>\n </ng-container>\n\n <ng-template #CompoundRow>\n <ccd-field-write [caseField]=\"field\"\n [caseFields]=\"caseFields\"\n [formGroup]=\"formGroup\"\n [idPrefix]=\"field.id + '_'\"\n [hidden]=\"field.hidden\"\n [attr.field_id]=\"field.id\"\n [attr.field_type]=\"field.field_type.type\"></ccd-field-write>\n </ng-template>\n </ng-container>\n </ng-container>\n </div>\n</ng-container>\n" }]
10991
- }], () => [{ type: FormValueService }], { conditionalShowFormDirectives: [{
10992
- type: ViewChildren,
10993
- args: [ConditionalShowFormDirective]
10994
- }], fields: [{
10981
+ }], () => [{ type: FormValueService }], { fields: [{
10995
10982
  type: Input
10996
10983
  }], formGroup: [{
10997
10984
  type: Input
@@ -11002,7 +10989,7 @@ class CaseEditFormComponent {
11002
10989
  }], valuesChanged: [{
11003
10990
  type: Output
11004
10991
  }] }); })();
11005
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CaseEditFormComponent, { className: "CaseEditFormComponent", filePath: "lib/shared/components/case-editor/case-edit-form/case-edit-form.component.ts", lineNumber: 14 }); })();
10992
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CaseEditFormComponent, { className: "CaseEditFormComponent", filePath: "lib/shared/components/case-editor/case-edit-form/case-edit-form.component.ts", lineNumber: 13 }); })();
11006
10993
 
11007
10994
  class CaseEditDataService {
11008
10995
  details$ = new BehaviorSubject(null);
@@ -11539,7 +11526,6 @@ class CaseEditPageComponent {
11539
11526
  saveDraftSub;
11540
11527
  caseFormValidationErrorsSub;
11541
11528
  logger = new StructuredLoggerService();
11542
- caseEditFormComponents;
11543
11529
  static scrollToTop() {
11544
11530
  window.scrollTo(0, 0);
11545
11531
  }
@@ -11857,7 +11843,6 @@ class CaseEditPageComponent {
11857
11843
  }
11858
11844
  this.clearValidationErrors();
11859
11845
  this.checkForStagesCompleted();
11860
- this.caseEditFormComponents?.forEach(component => component.syncConditionalShowStates());
11861
11846
  if (this.currentPageIsNotValid()) {
11862
11847
  // The generateErrorMessage method filters out the hidden fields.
11863
11848
  // The error message for LinkedCases journey will never get displayed because the
@@ -12193,12 +12178,7 @@ class CaseEditPageComponent {
12193
12178
  });
12194
12179
  }
12195
12180
  static ɵfac = function CaseEditPageComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || CaseEditPageComponent)(i0.ɵɵdirectiveInject(CaseEditComponent), i0.ɵɵdirectiveInject(i1$1.ActivatedRoute), i0.ɵɵdirectiveInject(FormValueService), i0.ɵɵdirectiveInject(FormErrorService), i0.ɵɵdirectiveInject(i0.ChangeDetectorRef), i0.ɵɵdirectiveInject(PageValidationService), i0.ɵɵdirectiveInject(i1$3.MatLegacyDialog), i0.ɵɵdirectiveInject(CaseFieldService), i0.ɵɵdirectiveInject(CaseEditDataService), i0.ɵɵdirectiveInject(LoadingService), i0.ɵɵdirectiveInject(ValidPageListCaseFieldsService), i0.ɵɵdirectiveInject(MultipageComponentStateService), i0.ɵɵdirectiveInject(AddressesService), i0.ɵɵdirectiveInject(LinkedCasesService), i0.ɵɵdirectiveInject(CaseFlagStateService)); };
12196
- static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: CaseEditPageComponent, selectors: [["ccd-case-edit-page"]], viewQuery: function CaseEditPageComponent_Query(rf, ctx) { if (rf & 1) {
12197
- i0.ɵɵviewQuery(CaseEditFormComponent, 5);
12198
- } if (rf & 2) {
12199
- let _t;
12200
- i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.caseEditFormComponents = _t);
12201
- } }, standalone: false, decls: 12, vars: 11, consts: [["titleBlock", ""], ["idBlock", ""], [4, "ngIf"], [4, "ngIf", "ngIfThen", "ngIfElse"], ["class", "govuk-error-summary", "aria-labelledby", "error-summary-title", "role", "alert", "tabindex", "-1", "data-module", "govuk-error-summary", 4, "ngIf"], [3, "error"], [3, "callbackErrorsContext", "triggerTextContinue", "triggerTextIgnore", "callbackErrorsSubject"], [1, "width-50"], ["class", "form", 3, "formGroup", "submit", 4, "ngIf"], [3, "eventCompletionParams", "eventCanBeCompleted", 4, "ngIf"], ["class", "govuk-heading-l", 4, "ngIf"], [1, "govuk-heading-l"], [1, "govuk-caption-l"], [3, "content"], ["class", "heading-h2", 4, "ngIf"], [1, "heading-h2"], ["aria-labelledby", "error-summary-title", "role", "alert", "tabindex", "-1", "data-module", "govuk-error-summary", 1, "govuk-error-summary"], ["id", "error-summary-title", 1, "govuk-error-summary__title"], ["class", "govuk-error-summary__body", 4, "ngFor", "ngForOf"], [1, "govuk-error-summary__body"], [1, "govuk-list", "govuk-error-summary__list"], ["tabindex", "0", 1, "validation-error", 3, "click", "keyup.enter"], [1, "form", 3, "submit", "formGroup"], ["id", "fieldset-case-data"], [2, "display", "none"], ["id", "caseEditForm", 3, "fields", "formGroup", "caseFields", "pageChangeSubject", "valuesChanged", 4, "ngIf"], ["class", "grid-row", 4, "ngIf"], [1, "form-group", "form-group-related"], ["class", "button button-secondary", "type", "button", 3, "disabled", "click", 4, "ngIf"], ["type", "submit", 1, "button", 3, "disabled"], [1, "cancel"], ["type", "button", 1, "govuk-js-link", 3, "click"], ["id", "caseEditForm", 3, "valuesChanged", "fields", "formGroup", "caseFields", "pageChangeSubject"], [1, "grid-row"], [1, "column-two-thirds", "rightBorderSeparator"], ["id", "caseEditForm1", 3, "fields", "formGroup", "caseFields"], [1, "column-one-third"], ["id", "caseEditForm2", 3, "fields", "formGroup", "caseFields"], ["type", "button", 1, "button", "button-secondary", 3, "click", "disabled"], [3, "eventCanBeCompleted", "eventCompletionParams"]], template: function CaseEditPageComponent_Template(rf, ctx) { if (rf & 1) {
12181
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: CaseEditPageComponent, selectors: [["ccd-case-edit-page"]], standalone: false, decls: 12, vars: 11, consts: [["titleBlock", ""], ["idBlock", ""], [4, "ngIf"], [4, "ngIf", "ngIfThen", "ngIfElse"], ["class", "govuk-error-summary", "aria-labelledby", "error-summary-title", "role", "alert", "tabindex", "-1", "data-module", "govuk-error-summary", 4, "ngIf"], [3, "error"], [3, "callbackErrorsContext", "triggerTextContinue", "triggerTextIgnore", "callbackErrorsSubject"], [1, "width-50"], ["class", "form", 3, "formGroup", "submit", 4, "ngIf"], [3, "eventCompletionParams", "eventCanBeCompleted", 4, "ngIf"], ["class", "govuk-heading-l", 4, "ngIf"], [1, "govuk-heading-l"], [1, "govuk-caption-l"], [3, "content"], ["class", "heading-h2", 4, "ngIf"], [1, "heading-h2"], ["aria-labelledby", "error-summary-title", "role", "alert", "tabindex", "-1", "data-module", "govuk-error-summary", 1, "govuk-error-summary"], ["id", "error-summary-title", 1, "govuk-error-summary__title"], ["class", "govuk-error-summary__body", 4, "ngFor", "ngForOf"], [1, "govuk-error-summary__body"], [1, "govuk-list", "govuk-error-summary__list"], ["tabindex", "0", 1, "validation-error", 3, "click", "keyup.enter"], [1, "form", 3, "submit", "formGroup"], ["id", "fieldset-case-data"], [2, "display", "none"], ["id", "caseEditForm", 3, "fields", "formGroup", "caseFields", "pageChangeSubject", "valuesChanged", 4, "ngIf"], ["class", "grid-row", 4, "ngIf"], [1, "form-group", "form-group-related"], ["class", "button button-secondary", "type", "button", 3, "disabled", "click", 4, "ngIf"], ["type", "submit", 1, "button", 3, "disabled"], [1, "cancel"], ["type", "button", 1, "govuk-js-link", 3, "click"], ["id", "caseEditForm", 3, "valuesChanged", "fields", "formGroup", "caseFields", "pageChangeSubject"], [1, "grid-row"], [1, "column-two-thirds", "rightBorderSeparator"], ["id", "caseEditForm1", 3, "fields", "formGroup", "caseFields"], [1, "column-one-third"], ["id", "caseEditForm2", 3, "fields", "formGroup", "caseFields"], ["type", "button", 1, "button", "button-secondary", 3, "click", "disabled"], [3, "eventCanBeCompleted", "eventCompletionParams"]], template: function CaseEditPageComponent_Template(rf, ctx) { if (rf & 1) {
12202
12182
  const _r1 = i0.ɵɵgetCurrentView();
12203
12183
  i0.ɵɵtemplate(0, CaseEditPageComponent_ng_container_0_Template, 3, 2, "ng-container", 2)(1, CaseEditPageComponent_div_1_Template, 1, 0, "div", 3)(2, CaseEditPageComponent_ng_template_2_Template, 3, 7, "ng-template", null, 0, i0.ɵɵtemplateRefExtractor)(4, CaseEditPageComponent_ng_template_4_Template, 1, 1, "ng-template", null, 1, i0.ɵɵtemplateRefExtractor)(6, CaseEditPageComponent_div_6_Template, 5, 4, "div", 4);
12204
12184
  i0.ɵɵelement(7, "ccd-case-edit-generic-errors", 5);
@@ -12230,11 +12210,8 @@ class CaseEditPageComponent {
12230
12210
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(CaseEditPageComponent, [{
12231
12211
  type: Component,
12232
12212
  args: [{ selector: 'ccd-case-edit-page', standalone: false, template: "<ng-container *ngIf=\"currentPage\">\n <h1 *ngIf=\"!currentPage.label\" class=\"govuk-heading-l\">{{eventTrigger.name | rpxTranslate}}</h1>\n <ng-container *ngIf=\"currentPage.label\">\n <span class=\"govuk-caption-l\">{{ eventTrigger.name | rpxTranslate}}</span>\n <h1 class=\"govuk-heading-l\">{{currentPage.label | rpxTranslate}}</h1>\n </ng-container>\n</ng-container>\n\n<!--Case ID or Title -->\n<div *ngIf=\"getCaseTitle(); then titleBlock; else idBlock\"></div>\n<ng-template #titleBlock>\n <ccd-markdown [content]=\"getCaseTitle() | ccdCaseTitle: caseFields : editForm.controls['data'] | rpxTranslate\"></ccd-markdown>\n</ng-template>\n<ng-template #idBlock>\n <h2 *ngIf=\"getCaseId()\" class=\"heading-h2\">#{{ getCaseId() | ccdCaseReference }}</h2>\n</ng-template>\n\n<!-- Error message summary -->\n<div *ngIf=\"validationErrors.length > 0\" class=\"govuk-error-summary\" aria-labelledby=\"error-summary-title\" role=\"alert\" tabindex=\"-1\" data-module=\"govuk-error-summary\">\n <h2 class=\"govuk-error-summary__title\" id=\"error-summary-title\">\n {{'There is a problem' | rpxTranslate}}\n </h2>\n <div *ngFor=\"let validationError of validationErrors\" class=\"govuk-error-summary__body\">\n <ul class=\"govuk-list govuk-error-summary__list\">\n <li>\n <a (click)=\"navigateToErrorElement(validationError.id)\" (keyup.enter)=\"navigateToErrorElement(validationError.id)\" tabindex=\"0\" class=\"validation-error\">\n {{ validationError.message | rpxTranslate: getRpxTranslatePipeArgs(validationError.label | rpxTranslate): null }}\n </a>\n </li>\n </ul>\n </div>\n</div>\n\n<ccd-case-edit-generic-errors [error]=\"caseEdit.error\"></ccd-case-edit-generic-errors>\n\n<ccd-callback-errors\n [triggerTextContinue]=\"triggerTextStart\"\n [triggerTextIgnore]=\"triggerTextIgnoreWarnings\"\n [callbackErrorsSubject]=\"caseEdit.callbackErrorsSubject\"\n (callbackErrorsContext)=\"callbackErrorsNotify($event)\">\n</ccd-callback-errors>\n<div class=\"width-50\">\n <form *ngIf=\"currentPage\" class=\"form\" [formGroup]=\"editForm\" (submit)=\"nextStep()\">\n <fieldset id=\"fieldset-case-data\">\n <legend style=\"display: none;\"></legend>\n <!-- single column -->\n <ccd-case-edit-form id='caseEditForm' *ngIf=\"!currentPage.isMultiColumn()\" [fields]=\"currentPage.getCol1Fields()\"\n [formGroup]=\"editForm.controls['data']\" [caseFields]=\"caseFields\"\n [pageChangeSubject]=\"pageChangeSubject\"\n (valuesChanged)=\"applyValuesChanged($event)\"></ccd-case-edit-form>\n <!-- two columns -->\n <div *ngIf=\"currentPage.isMultiColumn()\" class=\"grid-row\">\n <div class=\"column-two-thirds rightBorderSeparator\">\n <ccd-case-edit-form id='caseEditForm1' [fields]=\"currentPage.getCol1Fields()\"\n [formGroup]=\"editForm.controls['data']\" [caseFields]=\"caseFields\"></ccd-case-edit-form>\n </div>\n <div class=\"column-one-third\">\n <ccd-case-edit-form id='caseEditForm2' [fields]=\"currentPage.getCol2Fields()\"\n [formGroup]=\"editForm.controls['data']\" [caseFields]=\"caseFields\"></ccd-case-edit-form>\n </div>\n </div>\n </fieldset>\n\n <div class=\"form-group form-group-related\">\n <button class=\"button button-secondary\" type=\"button\" (click)=\"toPreviousPage()\" *ngIf=\"!isAtStart()\" [disabled]=\"isDisabled()\">\n {{'Previous' | rpxTranslate}}\n </button>\n <button class=\"button\" type=\"submit\" [disabled]=\"submitting()\">{{triggerText | rpxTranslate}}</button>\n </div>\n\n <p class=\"cancel\"><button type=\"button\" (click)=\"cancel()\" class=\"govuk-js-link\">{{getCancelText() | rpxTranslate}}</button></p>\n </form>\n</div>\n\n<ccd-case-event-completion *ngIf=\"caseEdit.isEventCompletionChecksRequired\"\n [eventCompletionParams]=\"caseEdit.eventCompletionParams\"\n (eventCanBeCompleted)=\"onEventCanBeCompleted($event)\">\n</ccd-case-event-completion>\n", styles: [".rightBorderSeparator{border-right-width:4px;border-right-color:#ffcc02;border-right-style:solid}.validation-error{cursor:pointer;text-decoration:underline;color:#d4351c}\n"] }]
12233
- }], () => [{ type: CaseEditComponent }, { type: i1$1.ActivatedRoute }, { type: FormValueService }, { type: FormErrorService }, { type: i0.ChangeDetectorRef }, { type: PageValidationService }, { type: i1$3.MatLegacyDialog }, { type: CaseFieldService }, { type: CaseEditDataService }, { type: LoadingService }, { type: ValidPageListCaseFieldsService }, { type: MultipageComponentStateService }, { type: AddressesService }, { type: LinkedCasesService }, { type: CaseFlagStateService }], { caseEditFormComponents: [{
12234
- type: ViewChildren,
12235
- args: [CaseEditFormComponent]
12236
- }] }); })();
12237
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CaseEditPageComponent, { className: "CaseEditPageComponent", filePath: "lib/shared/components/case-editor/case-edit-page/case-edit-page.component.ts", lineNumber: 36 }); })();
12213
+ }], () => [{ type: CaseEditComponent }, { type: i1$1.ActivatedRoute }, { type: FormValueService }, { type: FormErrorService }, { type: i0.ChangeDetectorRef }, { type: PageValidationService }, { type: i1$3.MatLegacyDialog }, { type: CaseFieldService }, { type: CaseEditDataService }, { type: LoadingService }, { type: ValidPageListCaseFieldsService }, { type: MultipageComponentStateService }, { type: AddressesService }, { type: LinkedCasesService }, { type: CaseFlagStateService }], null); })();
12214
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(CaseEditPageComponent, { className: "CaseEditPageComponent", filePath: "lib/shared/components/case-editor/case-edit-page/case-edit-page.component.ts", lineNumber: 35 }); })();
12238
12215
 
12239
12216
  class CallbackErrorsContext {
12240
12217
  triggerText;