@hmcts/opal-frontend-common 0.0.43 → 0.0.44
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/components/abstract/abstract-form-alias-base/index.d.ts +8 -1
- package/components/govuk/govuk-heading-with-caption/index.d.ts +1 -2
- package/components/govuk/govuk-summary-card-list/index.d.ts +4 -2
- package/components/govuk/govuk-summary-list/index.d.ts +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-form-alias-base.mjs +30 -6
- package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-form-alias-base.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-heading-with-caption.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-summary-card-list.mjs +9 -5
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-summary-card-list.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-summary-list.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-summary-list.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-types.mjs +4 -0
- package/fesm2022/hmcts-opal-frontend-common-types.mjs.map +1 -0
- package/fesm2022/hmcts-opal-frontend-common.mjs.map +1 -1
- package/index.d.ts +3 -0
- package/package.json +6 -1
- package/types/index.d.ts +3 -0
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { ValidatorFn, FormControl, FormArray } from '@angular/forms';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { OnInit, OnDestroy } from '@angular/core';
|
|
3
|
+
import { OnInit, OnDestroy, QueryList } from '@angular/core';
|
|
4
4
|
import { IAbstractFormAliasBaseAliasControls } from '@hmcts/opal-frontend-common/components/abstract/abstract-form-alias-base/interfaces';
|
|
5
5
|
import { AbstractFormBaseComponent } from '@hmcts/opal-frontend-common/components/abstract/abstract-form-base';
|
|
6
6
|
import { IAbstractFormArrayControlValidation, IAbstractFormArrayControls, IAbstractFormArrayControl } from '@hmcts/opal-frontend-common/components/abstract/interfaces';
|
|
7
|
+
import { GovukTextInputComponent } from '@hmcts/opal-frontend-common/components/govuk/govuk-text-input';
|
|
7
8
|
|
|
8
9
|
declare abstract class AbstractFormAliasBaseComponent extends AbstractFormBaseComponent implements OnInit, OnDestroy {
|
|
10
|
+
aliasFirstField: QueryList<GovukTextInputComponent>;
|
|
9
11
|
aliasControls: IAbstractFormAliasBaseAliasControls[];
|
|
10
12
|
aliasControlsValidation: IAbstractFormArrayControlValidation[];
|
|
11
13
|
aliasFields: string[];
|
|
@@ -86,6 +88,10 @@ declare abstract class AbstractFormAliasBaseComponent extends AbstractFormBaseCo
|
|
|
86
88
|
* @param formArrayName - The name of the form array control in the form.
|
|
87
89
|
*/
|
|
88
90
|
protected setUpAliasCheckboxListener(formCheckboxName: string, formArrayName: string): void;
|
|
91
|
+
/**
|
|
92
|
+
* Sets focus to the first input field of a newly added alias row.
|
|
93
|
+
*/
|
|
94
|
+
focusFirstAliasField(): void;
|
|
89
95
|
/**
|
|
90
96
|
* Removes a form alias control from a form array and updates the list of form array controls.
|
|
91
97
|
* @param index - The index of the form alias control to be removed.
|
|
@@ -97,6 +103,7 @@ declare abstract class AbstractFormAliasBaseComponent extends AbstractFormBaseCo
|
|
|
97
103
|
removeFormAliasControls(index: number, formArrayName: string, formArrayControls: IAbstractFormArrayControls[], fieldNames: string[]): IAbstractFormArrayControls[];
|
|
98
104
|
/**
|
|
99
105
|
* Adds an alias to the specified index of the form array.
|
|
106
|
+
* Sets user focus to the first field of the newly added alias.
|
|
100
107
|
*
|
|
101
108
|
* @param index - The index at which to add the alias.
|
|
102
109
|
* @param formArrayName - The name of the form array.
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { EventEmitter, OnInit } from '@angular/core';
|
|
3
|
+
import { HeadingLevel } from '@hmcts/opal-frontend-common/types';
|
|
3
4
|
|
|
4
5
|
declare class GovukSummaryCardActionComponent {
|
|
5
6
|
actionText: string;
|
|
@@ -15,18 +16,19 @@ declare class GovukSummaryCardActionComponent {
|
|
|
15
16
|
*/
|
|
16
17
|
onClick(event: Event, route: string): void;
|
|
17
18
|
static ɵfac: i0.ɵɵFactoryDeclaration<GovukSummaryCardActionComponent, never>;
|
|
18
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<GovukSummaryCardActionComponent, "opal-lib-govuk-summary-card-action, [opal-lib-govuk-summary-card-action]", never, { "actionText": { "alias": "actionText"; "required": true; }; "actionRoute": { "alias": "actionRoute"; "required": true; }; "visuallyHiddenText": { "alias": "visuallyHiddenText"; "required":
|
|
19
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<GovukSummaryCardActionComponent, "opal-lib-govuk-summary-card-action, [opal-lib-govuk-summary-card-action]", never, { "actionText": { "alias": "actionText"; "required": true; }; "actionRoute": { "alias": "actionRoute"; "required": true; }; "visuallyHiddenText": { "alias": "visuallyHiddenText"; "required": false; }; }, { "clickEvent": "clickEvent"; }, never, never, true, never>;
|
|
19
20
|
}
|
|
20
21
|
|
|
21
22
|
declare class GovukSummaryCardListComponent implements OnInit {
|
|
22
23
|
summaryCardListId: string;
|
|
23
24
|
cardTitle: string;
|
|
24
25
|
contentHidden: boolean;
|
|
26
|
+
headingLevel: HeadingLevel;
|
|
25
27
|
id: string;
|
|
26
28
|
private setId;
|
|
27
29
|
ngOnInit(): void;
|
|
28
30
|
static ɵfac: i0.ɵɵFactoryDeclaration<GovukSummaryCardListComponent, never>;
|
|
29
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<GovukSummaryCardListComponent, "opal-lib-govuk-summary-card-list", never, { "summaryCardListId": { "alias": "summaryCardListId"; "required": true; }; "cardTitle": { "alias": "cardTitle"; "required": false; }; "contentHidden": { "alias": "contentHidden"; "required": false; }; }, {}, never, ["[actions]", "[content]"], true, never>;
|
|
31
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<GovukSummaryCardListComponent, "opal-lib-govuk-summary-card-list", never, { "summaryCardListId": { "alias": "summaryCardListId"; "required": true; }; "cardTitle": { "alias": "cardTitle"; "required": false; }; "contentHidden": { "alias": "contentHidden"; "required": false; }; "headingLevel": { "alias": "headingLevel"; "required": false; }; }, {}, never, ["[actions]", "[content]"], true, never>;
|
|
30
32
|
}
|
|
31
33
|
|
|
32
34
|
export { GovukSummaryCardActionComponent, GovukSummaryCardListComponent };
|
|
@@ -13,7 +13,7 @@ declare class GovukSummaryListRowActionItemComponent {
|
|
|
13
13
|
*/
|
|
14
14
|
handleActionClick(event: Event, linkClicked: string): void;
|
|
15
15
|
static ɵfac: i0.ɵɵFactoryDeclaration<GovukSummaryListRowActionItemComponent, never>;
|
|
16
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<GovukSummaryListRowActionItemComponent, "opal-lib-govuk-summary-list-row-action-item, [opal-lib-govuk-summary-list-row-action-item]", never, { "actionName": { "alias": "actionName"; "required": true; }; "actionId": { "alias": "actionId"; "required": true; }; "visuallyHiddenText": { "alias": "visuallyHiddenText"; "required":
|
|
16
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<GovukSummaryListRowActionItemComponent, "opal-lib-govuk-summary-list-row-action-item, [opal-lib-govuk-summary-list-row-action-item]", never, { "actionName": { "alias": "actionName"; "required": true; }; "actionId": { "alias": "actionId"; "required": true; }; "visuallyHiddenText": { "alias": "visuallyHiddenText"; "required": false; }; }, { "linkClick": "linkClick"; }, never, never, true, never>;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
declare class GovukSummaryListRowActionsComponent {
|
package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-form-alias-base.mjs
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { FormGroup, FormArray } from '@angular/forms';
|
|
2
2
|
import { takeUntil } from 'rxjs';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
|
-
import { Component } from '@angular/core';
|
|
4
|
+
import { ViewChildren, Component } from '@angular/core';
|
|
5
5
|
import { AbstractFormBaseComponent } from '@hmcts/opal-frontend-common/components/abstract/abstract-form-base';
|
|
6
6
|
|
|
7
7
|
class AbstractFormAliasBaseComponent extends AbstractFormBaseComponent {
|
|
8
|
+
aliasFirstField;
|
|
8
9
|
aliasControls = [];
|
|
9
10
|
aliasControlsValidation = [];
|
|
10
11
|
aliasFields = [];
|
|
@@ -141,11 +142,29 @@ class AbstractFormAliasBaseComponent extends AbstractFormBaseComponent {
|
|
|
141
142
|
return;
|
|
142
143
|
}
|
|
143
144
|
addAliasControl.valueChanges.pipe(takeUntil(this['ngUnsubscribe'])).subscribe((shouldAddAlias) => {
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
145
|
+
if (shouldAddAlias) {
|
|
146
|
+
this.aliasControls = this.buildFormAliasControls([0], formArrayName, this.aliasFields, this.aliasControlsValidation);
|
|
147
|
+
this.focusFirstAliasField();
|
|
148
|
+
}
|
|
149
|
+
else {
|
|
150
|
+
this.aliasControls = this.removeAllFormAliasControls(this.aliasControls, formArrayName, this.aliasFields);
|
|
151
|
+
}
|
|
147
152
|
});
|
|
148
153
|
}
|
|
154
|
+
/**
|
|
155
|
+
* Sets focus to the first input field of a newly added alias row.
|
|
156
|
+
*/
|
|
157
|
+
focusFirstAliasField() {
|
|
158
|
+
this['changeDetectorRef'].detectChanges();
|
|
159
|
+
setTimeout(() => {
|
|
160
|
+
const index = this.aliasControls.length - 1;
|
|
161
|
+
const inputId = this.aliasFirstField.get(index)?.inputId;
|
|
162
|
+
if (inputId) {
|
|
163
|
+
const el = document.getElementById(inputId);
|
|
164
|
+
el?.focus();
|
|
165
|
+
}
|
|
166
|
+
}, 0);
|
|
167
|
+
}
|
|
149
168
|
/**
|
|
150
169
|
* Removes a form alias control from a form array and updates the list of form array controls.
|
|
151
170
|
* @param index - The index of the form alias control to be removed.
|
|
@@ -166,12 +185,14 @@ class AbstractFormAliasBaseComponent extends AbstractFormBaseComponent {
|
|
|
166
185
|
}
|
|
167
186
|
/**
|
|
168
187
|
* Adds an alias to the specified index of the form array.
|
|
188
|
+
* Sets user focus to the first field of the newly added alias.
|
|
169
189
|
*
|
|
170
190
|
* @param index - The index at which to add the alias.
|
|
171
191
|
* @param formArrayName - The name of the form array.
|
|
172
192
|
*/
|
|
173
193
|
addAlias(index, formArrayName) {
|
|
174
194
|
this.aliasControls.push(this.addAliasControls(index, formArrayName, this.aliasFields, this.aliasControlsValidation));
|
|
195
|
+
this.focusFirstAliasField();
|
|
175
196
|
}
|
|
176
197
|
/**
|
|
177
198
|
* Removes an alias from the form array.
|
|
@@ -191,14 +212,17 @@ class AbstractFormAliasBaseComponent extends AbstractFormBaseComponent {
|
|
|
191
212
|
super.ngOnDestroy();
|
|
192
213
|
}
|
|
193
214
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AbstractFormAliasBaseComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
194
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.4", type: AbstractFormAliasBaseComponent, isStandalone: true, selector: "ng-component", usesInheritance: true, ngImport: i0, template: '', isInline: true });
|
|
215
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.4", type: AbstractFormAliasBaseComponent, isStandalone: true, selector: "ng-component", viewQueries: [{ propertyName: "aliasFirstField", predicate: ["aliasFirstField"], descendants: true }], usesInheritance: true, ngImport: i0, template: '', isInline: true });
|
|
195
216
|
}
|
|
196
217
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AbstractFormAliasBaseComponent, decorators: [{
|
|
197
218
|
type: Component,
|
|
198
219
|
args: [{
|
|
199
220
|
template: '',
|
|
200
221
|
}]
|
|
201
|
-
}]
|
|
222
|
+
}], propDecorators: { aliasFirstField: [{
|
|
223
|
+
type: ViewChildren,
|
|
224
|
+
args: ['aliasFirstField']
|
|
225
|
+
}] } });
|
|
202
226
|
|
|
203
227
|
/**
|
|
204
228
|
* Generated bundle index. Do not edit.
|
package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-form-alias-base.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hmcts-opal-frontend-common-components-abstract-abstract-form-alias-base.mjs","sources":["../../../projects/opal-frontend-common/components/abstract/abstract-form-alias-base/abstract-form-alias-base.component.ts","../../../projects/opal-frontend-common/components/abstract/abstract-form-alias-base/hmcts-opal-frontend-common-components-abstract-abstract-form-alias-base.ts"],"sourcesContent":["import { FormArray, FormControl, FormGroup, ValidatorFn } from '@angular/forms';\nimport { takeUntil } from 'rxjs';\nimport { Component, OnDestroy, OnInit } from '@angular/core';\nimport { IAbstractFormAliasBaseAliasControls } from '@hmcts/opal-frontend-common/components/abstract/abstract-form-alias-base/interfaces';\nimport { AbstractFormBaseComponent } from '@hmcts/opal-frontend-common/components/abstract/abstract-form-base';\nimport {\n IAbstractFormArrayControlValidation,\n IAbstractFormArrayControls,\n IAbstractFormArrayControl,\n} from '@hmcts/opal-frontend-common/components/abstract/interfaces';\n\n@Component({\n template: '',\n})\nexport abstract class AbstractFormAliasBaseComponent extends AbstractFormBaseComponent implements OnInit, OnDestroy {\n public aliasControls: IAbstractFormAliasBaseAliasControls[] = [];\n public aliasControlsValidation: IAbstractFormArrayControlValidation[] = [];\n public aliasFields: string[] = [];\n\n /**\n * Builds an array of form controls for the given form array.\n *\n * @param formControlCount - An array of numbers representing the number of form controls to create.\n * @param formArrayName - The name of the form array.\n * @param fieldNames - An array of field names.\n * @param controlValidation - An array of control validation objects.\n * @returns An array of form controls for the given form array.\n */\n private buildFormAliasControls(\n formControlCount: number[],\n formArrayName: string,\n fieldNames: string[],\n controlValidation: IAbstractFormArrayControlValidation[],\n ): IAbstractFormArrayControls[] {\n // Directly map each index to a control\n return formControlCount.map((_element, index) =>\n this.addAliasControls(index, formArrayName, fieldNames, controlValidation),\n );\n }\n\n /**\n * Adds alias controls to the form array.\n *\n * @param index - The index of the form array.\n * @param formArrayName - The name of the form array.\n * @param fieldNames - The names of the fields for the alias controls.\n * @param controlValidation - The validation rules for the alias controls.\n * @returns An object containing the form controls.\n */\n private addAliasControls(\n index: number,\n formArrayName: string,\n fieldNames: string[],\n controlValidation: IAbstractFormArrayControlValidation[],\n ): { [key: string]: IAbstractFormArrayControl } {\n const formAliases = this.form.get(formArrayName) as FormArray;\n const formAliasesFormGroup = new FormGroup({});\n\n // Create the form controls...\n const controls = this.createAliasControls(fieldNames, index);\n\n // Add the controls to the form group...\n this.addControlsToFormGroup(formAliasesFormGroup, controlValidation, index);\n\n // Add the form group to the form array...\n formAliases.push(formAliasesFormGroup);\n\n // Return the form controls...\n return controls;\n }\n\n /**\n * Removes all form alias controls from a FormArray and clears any associated error messages.\n *\n * @param formArrayControls - An array of form array controls.\n * @param formArrayName - The name of the FormArray.\n * @param fieldNames - An array of field names associated with the form array controls.\n * @returns An empty array of form array controls.\n */\n private removeAllFormAliasControls(\n formArrayControls: IAbstractFormArrayControls[],\n formArrayName: string,\n fieldNames: string[],\n ): [] {\n const control = this.form.get(formArrayName) as FormArray;\n\n // Clear the error messages...\n for (const [index] of formArrayControls.entries()) {\n this.removeFormAliasControlsErrors(index, formArrayControls, fieldNames);\n }\n\n // Reset the form array controls...\n control.clear();\n\n // Return en empty array of form array controls...\n return [];\n }\n\n /**\n * Creates a FormArray with the specified validators and controls.\n *\n * @param validators - An array of validators to apply to the FormArray.\n * @param controls - An optional array of initial FormControl instances to add to the FormArray.\n * @returns A new FormArray instance.\n */\n protected createFormAlias(validators: ValidatorFn[], controls: FormControl[] = []): FormArray {\n return new FormArray(controls, { validators: [...validators] });\n }\n\n /**\n * Removes a form alias control at the specified index from the given form array controls.\n *\n * @param index - The index of the form alias control to remove.\n * @param formArrayControls - The array of form array controls.\n * @returns The updated array of form array controls after removing the specified control.\n */\n protected removeFormAliasControl(\n index: number,\n formArrayControls: IAbstractFormArrayControls[],\n ): IAbstractFormArrayControls[] {\n formArrayControls.splice(index, 1);\n return formArrayControls;\n }\n\n /**\n * Sets up the alias form controls based on the provided alias count array and form array name.\n * If there are any aliases, the alias controls will be re-populated.\n *\n * @param aliasCountArray - An array containing the count of aliases.\n * @param formArrayName - The name of the form array.\n */\n protected setupAliasFormControls(aliasCountArray: number[], formArrayName: string): void {\n // Re-populate the alias controls if there are any aliases\n if (aliasCountArray.length) {\n this.aliasControls = this.buildFormAliasControls(\n aliasCountArray,\n formArrayName,\n this.aliasFields,\n this.aliasControlsValidation,\n );\n }\n }\n\n /**\n * Removes the form alias controls errors for a specific index in a form array.\n *\n * @param index - The index of the form array control.\n * @param formArrayControls - An array of form array controls.\n * @param fieldNames - An array of field names to remove errors from.\n */\n protected removeFormAliasControlsErrors(\n index: number,\n formArrayControls: IAbstractFormArrayControls[],\n fieldNames: string[],\n ): void {\n const formArrayControl = formArrayControls[index];\n\n if (formArrayControl) {\n for (const field of fieldNames) {\n delete this.formControlErrorMessages?.[formArrayControl[field].controlName];\n }\n }\n }\n\n /**\n * Creates alias controls for the given fields and index.\n * @param fields - The list of fields for which alias controls need to be created.\n * @param index - The index value used to generate unique identifiers for the controls.\n * @returns An object containing the alias controls.\n */\n protected createAliasControls(fields: string[], index: number): { [key: string]: IAbstractFormArrayControl } {\n return fields.reduce(\n (controls, field) => ({\n ...controls,\n [field]: {\n inputId: `${field}_${index}`,\n inputName: `${field}_${index}`,\n controlName: `${field}_${index}`,\n },\n }),\n {},\n );\n }\n\n /**\n * Sets up the alias checkbox listener.\n *\n * @param formCheckboxName - The name of the checkbox control in the form.\n * @param formArrayName - The name of the form array control in the form.\n */\n protected setUpAliasCheckboxListener(formCheckboxName: string, formArrayName: string): void {\n // Ensure any existing subscription is cleared to avoid memory leaks\n this['ngUnsubscribe'].next();\n this['ngUnsubscribe'].complete();\n\n const addAliasControl = this.form.get(formCheckboxName);\n if (!addAliasControl) {\n return;\n }\n\n addAliasControl.valueChanges.pipe(takeUntil(this['ngUnsubscribe'])).subscribe((shouldAddAlias) => {\n this.aliasControls = shouldAddAlias\n ? this.buildFormAliasControls([0], formArrayName, this.aliasFields, this.aliasControlsValidation)\n : this.removeAllFormAliasControls(this.aliasControls, formArrayName, this.aliasFields);\n });\n }\n\n /**\n * Removes a form alias control from a form array and updates the list of form array controls.\n * @param index - The index of the form alias control to be removed.\n * @param formArrayName - The name of the form array.\n * @param formArrayControls - The list of form array controls.\n * @param fieldNames - The names of the fields associated with the form array controls.\n * @returns The updated list of form array controls after removing the specified control.\n */\n public removeFormAliasControls(\n index: number,\n formArrayName: string,\n formArrayControls: IAbstractFormArrayControls[],\n fieldNames: string[],\n ): IAbstractFormArrayControls[] {\n // Get the form array...\n const control = this.form.get(formArrayName) as FormArray;\n\n // Remove the form array control based on index\n control.removeAt(index);\n\n // Then remove the form array controls errors...\n this.removeFormAliasControlsErrors(index, formArrayControls, fieldNames);\n\n // Return the new list of form array controls...\n return this.removeFormAliasControl(index, formArrayControls);\n }\n\n /**\n * Adds an alias to the specified index of the form array.\n *\n * @param index - The index at which to add the alias.\n * @param formArrayName - The name of the form array.\n */\n public addAlias(index: number, formArrayName: string): void {\n this.aliasControls.push(\n this.addAliasControls(index, formArrayName, this.aliasFields, this.aliasControlsValidation),\n );\n }\n\n /**\n * Removes an alias from the form array.\n *\n * @param index - The index of the alias to remove.\n * @param formArrayName - The name of the form array.\n */\n public removeAlias(index: number, formArrayName: string): void {\n this.aliasControls = this.removeFormAliasControls(index, formArrayName, this.aliasControls, this.aliasFields);\n }\n\n public override ngOnInit(): void {\n super.ngOnInit();\n }\n\n public override ngOnDestroy(): void {\n this['ngUnsubscribe'].next();\n this['ngUnsubscribe'].complete();\n super.ngOnDestroy();\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;AAcM,MAAgB,8BAA+B,SAAQ,yBAAyB,CAAA;IAC7E,aAAa,GAA0C,EAAE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AqB,EAAA;QAClD,IAAI,CAAC,aAAa,CAAC,IAAI,CACrB,IAAI,CAAC,gBAAgB,CAAC,KAAK,EAAE,aAAa,EAAE,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,uBAAuB,CAAC,CAC5F;IACH;AAEA;;;;;AAKG;IACI,WAAW,CAAC,KAAa,EAAE,aAAqB,EAAA;AACrD,QAAA,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,uBAAuB,CAAC,KAAK,EAAE,aAAa,EAAE,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,WAAW,CAAC;IAC/G;IAEgB,QAAQ,GAAA;QACtB,KAAK,CAAC,QAAQ,EAAE;IAClB;IAEgB,WAAW,GAAA;AACzB,QAAA,IAAI,CAAC,eAAe,CAAC,CAAC,IAAI,EAAE;AAC5B,QAAA,IAAI,CAAC,eAAe,CAAC,CAAC,QAAQ,EAAE;QAChC,KAAK,CAAC,WAAW,EAAE;IACrB;uGA1PoB,8BAA8B,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAA9B,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,8BAA8B,+FAFxC,EAAE,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA;;2FAEQ,8BAA8B,EAAA,UAAA,EAAA,CAAA;kBAHnD,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,EAAE;AACb,iBAAA;;;ACbD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"hmcts-opal-frontend-common-components-abstract-abstract-form-alias-base.mjs","sources":["../../../projects/opal-frontend-common/components/abstract/abstract-form-alias-base/abstract-form-alias-base.component.ts","../../../projects/opal-frontend-common/components/abstract/abstract-form-alias-base/hmcts-opal-frontend-common-components-abstract-abstract-form-alias-base.ts"],"sourcesContent":["import { FormArray, FormControl, FormGroup, ValidatorFn } from '@angular/forms';\nimport { takeUntil } from 'rxjs';\nimport { Component, OnDestroy, OnInit, QueryList, ViewChildren } from '@angular/core';\nimport { IAbstractFormAliasBaseAliasControls } from '@hmcts/opal-frontend-common/components/abstract/abstract-form-alias-base/interfaces';\nimport { AbstractFormBaseComponent } from '@hmcts/opal-frontend-common/components/abstract/abstract-form-base';\nimport {\n IAbstractFormArrayControlValidation,\n IAbstractFormArrayControls,\n IAbstractFormArrayControl,\n} from '@hmcts/opal-frontend-common/components/abstract/interfaces';\nimport { GovukTextInputComponent } from '@hmcts/opal-frontend-common/components/govuk/govuk-text-input';\n\n@Component({\n template: '',\n})\nexport abstract class AbstractFormAliasBaseComponent extends AbstractFormBaseComponent implements OnInit, OnDestroy {\n @ViewChildren('aliasFirstField') aliasFirstField!: QueryList<GovukTextInputComponent>;\n public aliasControls: IAbstractFormAliasBaseAliasControls[] = [];\n public aliasControlsValidation: IAbstractFormArrayControlValidation[] = [];\n public aliasFields: string[] = [];\n\n /**\n * Builds an array of form controls for the given form array.\n *\n * @param formControlCount - An array of numbers representing the number of form controls to create.\n * @param formArrayName - The name of the form array.\n * @param fieldNames - An array of field names.\n * @param controlValidation - An array of control validation objects.\n * @returns An array of form controls for the given form array.\n */\n private buildFormAliasControls(\n formControlCount: number[],\n formArrayName: string,\n fieldNames: string[],\n controlValidation: IAbstractFormArrayControlValidation[],\n ): IAbstractFormArrayControls[] {\n // Directly map each index to a control\n return formControlCount.map((_element, index) =>\n this.addAliasControls(index, formArrayName, fieldNames, controlValidation),\n );\n }\n\n /**\n * Adds alias controls to the form array.\n *\n * @param index - The index of the form array.\n * @param formArrayName - The name of the form array.\n * @param fieldNames - The names of the fields for the alias controls.\n * @param controlValidation - The validation rules for the alias controls.\n * @returns An object containing the form controls.\n */\n private addAliasControls(\n index: number,\n formArrayName: string,\n fieldNames: string[],\n controlValidation: IAbstractFormArrayControlValidation[],\n ): { [key: string]: IAbstractFormArrayControl } {\n const formAliases = this.form.get(formArrayName) as FormArray;\n const formAliasesFormGroup = new FormGroup({});\n\n // Create the form controls...\n const controls = this.createAliasControls(fieldNames, index);\n\n // Add the controls to the form group...\n this.addControlsToFormGroup(formAliasesFormGroup, controlValidation, index);\n\n // Add the form group to the form array...\n formAliases.push(formAliasesFormGroup);\n\n // Return the form controls...\n return controls;\n }\n\n /**\n * Removes all form alias controls from a FormArray and clears any associated error messages.\n *\n * @param formArrayControls - An array of form array controls.\n * @param formArrayName - The name of the FormArray.\n * @param fieldNames - An array of field names associated with the form array controls.\n * @returns An empty array of form array controls.\n */\n private removeAllFormAliasControls(\n formArrayControls: IAbstractFormArrayControls[],\n formArrayName: string,\n fieldNames: string[],\n ): [] {\n const control = this.form.get(formArrayName) as FormArray;\n\n // Clear the error messages...\n for (const [index] of formArrayControls.entries()) {\n this.removeFormAliasControlsErrors(index, formArrayControls, fieldNames);\n }\n\n // Reset the form array controls...\n control.clear();\n\n // Return en empty array of form array controls...\n return [];\n }\n\n /**\n * Creates a FormArray with the specified validators and controls.\n *\n * @param validators - An array of validators to apply to the FormArray.\n * @param controls - An optional array of initial FormControl instances to add to the FormArray.\n * @returns A new FormArray instance.\n */\n protected createFormAlias(validators: ValidatorFn[], controls: FormControl[] = []): FormArray {\n return new FormArray(controls, { validators: [...validators] });\n }\n\n /**\n * Removes a form alias control at the specified index from the given form array controls.\n *\n * @param index - The index of the form alias control to remove.\n * @param formArrayControls - The array of form array controls.\n * @returns The updated array of form array controls after removing the specified control.\n */\n protected removeFormAliasControl(\n index: number,\n formArrayControls: IAbstractFormArrayControls[],\n ): IAbstractFormArrayControls[] {\n formArrayControls.splice(index, 1);\n return formArrayControls;\n }\n\n /**\n * Sets up the alias form controls based on the provided alias count array and form array name.\n * If there are any aliases, the alias controls will be re-populated.\n *\n * @param aliasCountArray - An array containing the count of aliases.\n * @param formArrayName - The name of the form array.\n */\n protected setupAliasFormControls(aliasCountArray: number[], formArrayName: string): void {\n // Re-populate the alias controls if there are any aliases\n if (aliasCountArray.length) {\n this.aliasControls = this.buildFormAliasControls(\n aliasCountArray,\n formArrayName,\n this.aliasFields,\n this.aliasControlsValidation,\n );\n }\n }\n\n /**\n * Removes the form alias controls errors for a specific index in a form array.\n *\n * @param index - The index of the form array control.\n * @param formArrayControls - An array of form array controls.\n * @param fieldNames - An array of field names to remove errors from.\n */\n protected removeFormAliasControlsErrors(\n index: number,\n formArrayControls: IAbstractFormArrayControls[],\n fieldNames: string[],\n ): void {\n const formArrayControl = formArrayControls[index];\n\n if (formArrayControl) {\n for (const field of fieldNames) {\n delete this.formControlErrorMessages?.[formArrayControl[field].controlName];\n }\n }\n }\n\n /**\n * Creates alias controls for the given fields and index.\n * @param fields - The list of fields for which alias controls need to be created.\n * @param index - The index value used to generate unique identifiers for the controls.\n * @returns An object containing the alias controls.\n */\n protected createAliasControls(fields: string[], index: number): { [key: string]: IAbstractFormArrayControl } {\n return fields.reduce(\n (controls, field) => ({\n ...controls,\n [field]: {\n inputId: `${field}_${index}`,\n inputName: `${field}_${index}`,\n controlName: `${field}_${index}`,\n },\n }),\n {},\n );\n }\n\n /**\n * Sets up the alias checkbox listener.\n *\n * @param formCheckboxName - The name of the checkbox control in the form.\n * @param formArrayName - The name of the form array control in the form.\n */\n protected setUpAliasCheckboxListener(formCheckboxName: string, formArrayName: string): void {\n // Ensure any existing subscription is cleared to avoid memory leaks\n this['ngUnsubscribe'].next();\n this['ngUnsubscribe'].complete();\n\n const addAliasControl = this.form.get(formCheckboxName);\n if (!addAliasControl) {\n return;\n }\n\n addAliasControl.valueChanges.pipe(takeUntil(this['ngUnsubscribe'])).subscribe((shouldAddAlias) => {\n if (shouldAddAlias) {\n this.aliasControls = this.buildFormAliasControls(\n [0],\n formArrayName,\n this.aliasFields,\n this.aliasControlsValidation,\n );\n this.focusFirstAliasField();\n } else {\n this.aliasControls = this.removeAllFormAliasControls(this.aliasControls, formArrayName, this.aliasFields);\n }\n });\n }\n\n /**\n * Sets focus to the first input field of a newly added alias row.\n */\n public focusFirstAliasField(): void {\n this['changeDetectorRef'].detectChanges();\n setTimeout(() => {\n const index = this.aliasControls.length - 1;\n const inputId = this.aliasFirstField.get(index)?.inputId;\n if (inputId) {\n const el = document.getElementById(inputId);\n el?.focus();\n }\n }, 0);\n }\n\n /**\n * Removes a form alias control from a form array and updates the list of form array controls.\n * @param index - The index of the form alias control to be removed.\n * @param formArrayName - The name of the form array.\n * @param formArrayControls - The list of form array controls.\n * @param fieldNames - The names of the fields associated with the form array controls.\n * @returns The updated list of form array controls after removing the specified control.\n */\n public removeFormAliasControls(\n index: number,\n formArrayName: string,\n formArrayControls: IAbstractFormArrayControls[],\n fieldNames: string[],\n ): IAbstractFormArrayControls[] {\n // Get the form array...\n const control = this.form.get(formArrayName) as FormArray;\n\n // Remove the form array control based on index\n control.removeAt(index);\n\n // Then remove the form array controls errors...\n this.removeFormAliasControlsErrors(index, formArrayControls, fieldNames);\n\n // Return the new list of form array controls...\n return this.removeFormAliasControl(index, formArrayControls);\n }\n\n /**\n * Adds an alias to the specified index of the form array.\n * Sets user focus to the first field of the newly added alias.\n *\n * @param index - The index at which to add the alias.\n * @param formArrayName - The name of the form array.\n */\n public addAlias(index: number, formArrayName: string): void {\n this.aliasControls.push(\n this.addAliasControls(index, formArrayName, this.aliasFields, this.aliasControlsValidation),\n );\n this.focusFirstAliasField();\n }\n\n /**\n * Removes an alias from the form array.\n *\n * @param index - The index of the alias to remove.\n * @param formArrayName - The name of the form array.\n */\n public removeAlias(index: number, formArrayName: string): void {\n this.aliasControls = this.removeFormAliasControls(index, formArrayName, this.aliasControls, this.aliasFields);\n }\n\n public override ngOnInit(): void {\n super.ngOnInit();\n }\n\n public override ngOnDestroy(): void {\n this['ngUnsubscribe'].next();\n this['ngUnsubscribe'].complete();\n super.ngOnDestroy();\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;AAeM,MAAgB,8BAA+B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IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAA9B,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,8BAA8B,sMAFxC,EAAE,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA;;2FAEQ,8BAA8B,EAAA,UAAA,EAAA,CAAA;kBAHnD,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,EAAE;AACb,iBAAA;8BAEkC,eAAe,EAAA,CAAA;sBAA/C,YAAY;uBAAC,iBAAiB;;;AChBjC;;AAEG;;;;"}
|
package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-heading-with-caption.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hmcts-opal-frontend-common-components-govuk-govuk-heading-with-caption.mjs","sources":["../../../projects/opal-frontend-common/components/govuk/govuk-heading-with-caption/govuk-heading-with-caption.component.ts","../../../projects/opal-frontend-common/components/govuk/govuk-heading-with-caption/govuk-heading-with-caption.component.html","../../../projects/opal-frontend-common/components/govuk/govuk-heading-with-caption/hmcts-opal-frontend-common-components-govuk-govuk-heading-with-caption.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, Input } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { HeadingLevel } from '
|
|
1
|
+
{"version":3,"file":"hmcts-opal-frontend-common-components-govuk-govuk-heading-with-caption.mjs","sources":["../../../projects/opal-frontend-common/components/govuk/govuk-heading-with-caption/govuk-heading-with-caption.component.ts","../../../projects/opal-frontend-common/components/govuk/govuk-heading-with-caption/govuk-heading-with-caption.component.html","../../../projects/opal-frontend-common/components/govuk/govuk-heading-with-caption/hmcts-opal-frontend-common-components-govuk-govuk-heading-with-caption.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, Input } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { HeadingLevel } from '@hmcts/opal-frontend-common/types';\n\n@Component({\n selector: 'opal-lib-govuk-heading-with-caption',\n imports: [CommonModule],\n templateUrl: './govuk-heading-with-caption.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class GovukHeadingWithCaptionComponent {\n @Input({ required: true }) captionText!: string;\n @Input({ required: true }) headingText!: string;\n @Input({ required: false }) headingClasses: string = 'govuk-heading-l';\n @Input({ required: false }) captionClasses: string = 'govuk-caption-l';\n @Input({ required: false }) headingLevel: HeadingLevel = 1;\n}\n","<ng-template #headingContent>\n <span class=\"{{ captionClasses }}\">{{ captionText }}</span> {{ headingText }}\n</ng-template>\n\n@switch (headingLevel) {\n @case (1) {\n <h1 class=\"{{ headingClasses }}\">\n <ng-container *ngTemplateOutlet=\"headingContent\"></ng-container>\n </h1>\n }\n @case (2) {\n <h2 class=\"{{ headingClasses }}\">\n <ng-container *ngTemplateOutlet=\"headingContent\"></ng-container>\n </h2>\n }\n @case (3) {\n <h3 class=\"{{ headingClasses }}\">\n <ng-container *ngTemplateOutlet=\"headingContent\"></ng-container>\n </h3>\n }\n @case (4) {\n <h4 class=\"{{ headingClasses }}\">\n <ng-container *ngTemplateOutlet=\"headingContent\"></ng-container>\n </h4>\n }\n @case (5) {\n <h5 class=\"{{ headingClasses }}\">\n <ng-container *ngTemplateOutlet=\"headingContent\"></ng-container>\n </h5>\n }\n @case (6) {\n <h6 class=\"{{ headingClasses }}\">\n <ng-container *ngTemplateOutlet=\"headingContent\"></ng-container>\n </h6>\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;MAUa,gCAAgC,CAAA;AAChB,IAAA,WAAW;AACX,IAAA,WAAW;IACV,cAAc,GAAW,iBAAiB;IAC1C,cAAc,GAAW,iBAAiB;IAC1C,YAAY,GAAiB,CAAC;uGAL/C,gCAAgC,EAAA,IAAA,EAAA,EAAA,EA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;;AAEG;;;;"}
|
|
@@ -18,11 +18,11 @@ class GovukSummaryCardActionComponent {
|
|
|
18
18
|
this.clickEvent.emit(route);
|
|
19
19
|
}
|
|
20
20
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: GovukSummaryCardActionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
21
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
21
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.4", type: GovukSummaryCardActionComponent, isStandalone: true, selector: "opal-lib-govuk-summary-card-action, [opal-lib-govuk-summary-card-action]", inputs: { actionText: "actionText", actionRoute: "actionRoute", visuallyHiddenText: "visuallyHiddenText" }, outputs: { clickEvent: "clickEvent" }, host: { properties: { "class": "this.hostClass" } }, ngImport: i0, template: "<a\n href=\"#\"\n class=\"govuk-link govuk-link--no-visited-state\"\n [id]=\"actionText\"\n (click)=\"onClick($event, actionRoute)\"\n (keyup.enter)=\"onClick($event, actionRoute)\"\n tabindex=\"0\"\n>\n <strong>{{ actionText }}</strong>\n @if (visuallyHiddenText) {\n <span class=\"govuk-visually-hidden\">{{ visuallyHiddenText }}</span>\n }\n</a>\n", changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
22
22
|
}
|
|
23
23
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: GovukSummaryCardActionComponent, decorators: [{
|
|
24
24
|
type: Component,
|
|
25
|
-
args: [{ selector: 'opal-lib-govuk-summary-card-action, [opal-lib-govuk-summary-card-action]', imports: [], changeDetection: ChangeDetectionStrategy.OnPush, template: "<a\n href=\"#\"\n class=\"govuk-link govuk-link--no-visited-state\"\n [id]=\"actionText\"\n (click)=\"onClick($event, actionRoute)\"\n (keyup.enter)=\"onClick($event, actionRoute)\"\n tabindex=\"0\"\n>\n <strong>{{ actionText }}</strong\n
|
|
25
|
+
args: [{ selector: 'opal-lib-govuk-summary-card-action, [opal-lib-govuk-summary-card-action]', imports: [], changeDetection: ChangeDetectionStrategy.OnPush, template: "<a\n href=\"#\"\n class=\"govuk-link govuk-link--no-visited-state\"\n [id]=\"actionText\"\n (click)=\"onClick($event, actionRoute)\"\n (keyup.enter)=\"onClick($event, actionRoute)\"\n tabindex=\"0\"\n>\n <strong>{{ actionText }}</strong>\n @if (visuallyHiddenText) {\n <span class=\"govuk-visually-hidden\">{{ visuallyHiddenText }}</span>\n }\n</a>\n" }]
|
|
26
26
|
}], propDecorators: { actionText: [{
|
|
27
27
|
type: Input,
|
|
28
28
|
args: [{ required: true }]
|
|
@@ -31,7 +31,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImpor
|
|
|
31
31
|
args: [{ required: true }]
|
|
32
32
|
}], visuallyHiddenText: [{
|
|
33
33
|
type: Input,
|
|
34
|
-
args: [{ required:
|
|
34
|
+
args: [{ required: false }]
|
|
35
35
|
}], clickEvent: [{
|
|
36
36
|
type: Output
|
|
37
37
|
}], hostClass: [{
|
|
@@ -43,6 +43,7 @@ class GovukSummaryCardListComponent {
|
|
|
43
43
|
summaryCardListId;
|
|
44
44
|
cardTitle;
|
|
45
45
|
contentHidden;
|
|
46
|
+
headingLevel = 2;
|
|
46
47
|
id;
|
|
47
48
|
setId() {
|
|
48
49
|
this.id = this.summaryCardListId + '-summary-card-list';
|
|
@@ -51,11 +52,11 @@ class GovukSummaryCardListComponent {
|
|
|
51
52
|
this.setId();
|
|
52
53
|
}
|
|
53
54
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: GovukSummaryCardListComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
54
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.4", type: GovukSummaryCardListComponent, isStandalone: true, selector: "opal-lib-govuk-summary-card-list", inputs: { summaryCardListId: "summaryCardListId", cardTitle: "cardTitle", contentHidden: "contentHidden" }, ngImport: i0, template: "<div class=\"govuk-summary-card\" [id]=\"id\">\n @if (cardTitle && cardTitle.length > 0) {\n <div class=\"govuk-summary-card__title-wrapper\">\n <h2 class=\"govuk-summary-card__title\">{{ cardTitle }}</h2>\n <ul class=\"govuk-summary-card__actions\" role=\"list\">\n <ng-content select=\"[actions]\"></ng-content>\n </ul>\n </div>\n }\n\n @if (!contentHidden) {\n <div class=\"govuk-summary-card__content govuk-white-background\">\n <ng-content select=\"[content]\"></ng-content>\n </div>\n }\n</div>\n", changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
55
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.4", type: GovukSummaryCardListComponent, isStandalone: true, selector: "opal-lib-govuk-summary-card-list", inputs: { summaryCardListId: "summaryCardListId", cardTitle: "cardTitle", contentHidden: "contentHidden", headingLevel: "headingLevel" }, ngImport: i0, template: "<div class=\"govuk-summary-card\" [id]=\"id\">\n @if (cardTitle && cardTitle.length > 0) {\n <div class=\"govuk-summary-card__title-wrapper\">\n @switch (headingLevel) {\n @case (1) {\n <h1 class=\"govuk-summary-card__title\">{{ cardTitle }}</h1>\n }\n @case (2) {\n <h2 class=\"govuk-summary-card__title\">{{ cardTitle }}</h2>\n }\n @case (3) {\n <h3 class=\"govuk-summary-card__title\">{{ cardTitle }}</h3>\n }\n @case (4) {\n <h4 class=\"govuk-summary-card__title\">{{ cardTitle }}</h4>\n }\n @case (5) {\n <h5 class=\"govuk-summary-card__title\">{{ cardTitle }}</h5>\n }\n @case (6) {\n <h6 class=\"govuk-summary-card__title\">{{ cardTitle }}</h6>\n }\n }\n <ul class=\"govuk-summary-card__actions\" role=\"list\">\n <ng-content select=\"[actions]\"></ng-content>\n </ul>\n </div>\n }\n\n @if (!contentHidden) {\n <div class=\"govuk-summary-card__content govuk-white-background\">\n <ng-content select=\"[content]\"></ng-content>\n </div>\n }\n</div>\n", changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
55
56
|
}
|
|
56
57
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: GovukSummaryCardListComponent, decorators: [{
|
|
57
58
|
type: Component,
|
|
58
|
-
args: [{ selector: 'opal-lib-govuk-summary-card-list', imports: [], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"govuk-summary-card\" [id]=\"id\">\n @if (cardTitle && cardTitle.length > 0) {\n <div class=\"govuk-summary-card__title-wrapper\">\n <h2 class=\"govuk-summary-card__title\">{{ cardTitle }}</h2>\n <ul class=\"govuk-summary-card__actions\" role=\"list\">\n <ng-content select=\"[actions]\"></ng-content>\n </ul>\n </div>\n }\n\n @if (!contentHidden) {\n <div class=\"govuk-summary-card__content govuk-white-background\">\n <ng-content select=\"[content]\"></ng-content>\n </div>\n }\n</div>\n" }]
|
|
59
|
+
args: [{ selector: 'opal-lib-govuk-summary-card-list', imports: [], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"govuk-summary-card\" [id]=\"id\">\n @if (cardTitle && cardTitle.length > 0) {\n <div class=\"govuk-summary-card__title-wrapper\">\n @switch (headingLevel) {\n @case (1) {\n <h1 class=\"govuk-summary-card__title\">{{ cardTitle }}</h1>\n }\n @case (2) {\n <h2 class=\"govuk-summary-card__title\">{{ cardTitle }}</h2>\n }\n @case (3) {\n <h3 class=\"govuk-summary-card__title\">{{ cardTitle }}</h3>\n }\n @case (4) {\n <h4 class=\"govuk-summary-card__title\">{{ cardTitle }}</h4>\n }\n @case (5) {\n <h5 class=\"govuk-summary-card__title\">{{ cardTitle }}</h5>\n }\n @case (6) {\n <h6 class=\"govuk-summary-card__title\">{{ cardTitle }}</h6>\n }\n }\n <ul class=\"govuk-summary-card__actions\" role=\"list\">\n <ng-content select=\"[actions]\"></ng-content>\n </ul>\n </div>\n }\n\n @if (!contentHidden) {\n <div class=\"govuk-summary-card__content govuk-white-background\">\n <ng-content select=\"[content]\"></ng-content>\n </div>\n }\n</div>\n" }]
|
|
59
60
|
}], propDecorators: { summaryCardListId: [{
|
|
60
61
|
type: Input,
|
|
61
62
|
args: [{ required: true }]
|
|
@@ -65,6 +66,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImpor
|
|
|
65
66
|
}], contentHidden: [{
|
|
66
67
|
type: Input,
|
|
67
68
|
args: [{ required: false }]
|
|
69
|
+
}], headingLevel: [{
|
|
70
|
+
type: Input,
|
|
71
|
+
args: [{ required: false }]
|
|
68
72
|
}] } });
|
|
69
73
|
|
|
70
74
|
/**
|
package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-summary-card-list.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hmcts-opal-frontend-common-components-govuk-govuk-summary-card-list.mjs","sources":["../../../projects/opal-frontend-common/components/govuk/govuk-summary-card-list/govuk-summary-card-action/govuk-summary-card-action.component.ts","../../../projects/opal-frontend-common/components/govuk/govuk-summary-card-list/govuk-summary-card-action/govuk-summary-card-action.component.html","../../../projects/opal-frontend-common/components/govuk/govuk-summary-card-list/govuk-summary-card-list.component.ts","../../../projects/opal-frontend-common/components/govuk/govuk-summary-card-list/govuk-summary-card-list.component.html","../../../projects/opal-frontend-common/components/govuk/govuk-summary-card-list/hmcts-opal-frontend-common-components-govuk-govuk-summary-card-list.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, EventEmitter, HostBinding, Input, Output } from '@angular/core';\n\n@Component({\n selector: 'opal-lib-govuk-summary-card-action, [opal-lib-govuk-summary-card-action]',\n imports: [],\n templateUrl: './govuk-summary-card-action.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class GovukSummaryCardActionComponent {\n @Input({ required: true }) actionText!: string;\n @Input({ required: true }) actionRoute!: string;\n @Input({ required:
|
|
1
|
+
{"version":3,"file":"hmcts-opal-frontend-common-components-govuk-govuk-summary-card-list.mjs","sources":["../../../projects/opal-frontend-common/components/govuk/govuk-summary-card-list/govuk-summary-card-action/govuk-summary-card-action.component.ts","../../../projects/opal-frontend-common/components/govuk/govuk-summary-card-list/govuk-summary-card-action/govuk-summary-card-action.component.html","../../../projects/opal-frontend-common/components/govuk/govuk-summary-card-list/govuk-summary-card-list.component.ts","../../../projects/opal-frontend-common/components/govuk/govuk-summary-card-list/govuk-summary-card-list.component.html","../../../projects/opal-frontend-common/components/govuk/govuk-summary-card-list/hmcts-opal-frontend-common-components-govuk-govuk-summary-card-list.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, EventEmitter, HostBinding, Input, Output } from '@angular/core';\n\n@Component({\n selector: 'opal-lib-govuk-summary-card-action, [opal-lib-govuk-summary-card-action]',\n imports: [],\n templateUrl: './govuk-summary-card-action.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class GovukSummaryCardActionComponent {\n @Input({ required: true }) actionText!: string;\n @Input({ required: true }) actionRoute!: string;\n @Input({ required: false }) visuallyHiddenText!: string;\n @Output() clickEvent = new EventEmitter<string>();\n\n @HostBinding('class') hostClass = 'govuk-summary-card__action';\n\n /**\n * Handles click events, prevents default behavior, and emits a route.\n *\n * @param {Event} event - The DOM event triggered by the user action.\n * @param {string} route - The route to be emitted when the event is triggered.\n */\n public onClick(event: Event, route: string): void {\n event.preventDefault();\n this.clickEvent.emit(route);\n }\n}\n","<a\n href=\"#\"\n class=\"govuk-link govuk-link--no-visited-state\"\n [id]=\"actionText\"\n (click)=\"onClick($event, actionRoute)\"\n (keyup.enter)=\"onClick($event, actionRoute)\"\n tabindex=\"0\"\n>\n <strong>{{ actionText }}</strong>\n @if (visuallyHiddenText) {\n <span class=\"govuk-visually-hidden\">{{ visuallyHiddenText }}</span>\n }\n</a>\n","import { ChangeDetectionStrategy, Component, Input, OnInit } from '@angular/core';\nimport { HeadingLevel } from '@hmcts/opal-frontend-common/types';\n\n@Component({\n selector: 'opal-lib-govuk-summary-card-list',\n imports: [],\n templateUrl: './govuk-summary-card-list.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class GovukSummaryCardListComponent implements OnInit {\n @Input({ required: true }) summaryCardListId!: string;\n @Input({ required: false }) cardTitle!: string;\n @Input({ required: false }) contentHidden!: boolean;\n @Input({ required: false }) headingLevel: HeadingLevel = 2;\n\n public id!: string;\n\n private setId(): void {\n this.id = this.summaryCardListId + '-summary-card-list';\n }\n\n public ngOnInit(): void {\n this.setId();\n }\n}\n","<div class=\"govuk-summary-card\" [id]=\"id\">\n @if (cardTitle && cardTitle.length > 0) {\n <div class=\"govuk-summary-card__title-wrapper\">\n @switch (headingLevel) {\n @case (1) {\n <h1 class=\"govuk-summary-card__title\">{{ cardTitle }}</h1>\n }\n @case (2) {\n <h2 class=\"govuk-summary-card__title\">{{ cardTitle }}</h2>\n }\n @case (3) {\n <h3 class=\"govuk-summary-card__title\">{{ cardTitle }}</h3>\n }\n @case (4) {\n <h4 class=\"govuk-summary-card__title\">{{ cardTitle }}</h4>\n }\n @case (5) {\n <h5 class=\"govuk-summary-card__title\">{{ cardTitle }}</h5>\n }\n @case (6) {\n <h6 class=\"govuk-summary-card__title\">{{ cardTitle }}</h6>\n }\n }\n <ul class=\"govuk-summary-card__actions\" role=\"list\">\n <ng-content select=\"[actions]\"></ng-content>\n </ul>\n </div>\n }\n\n @if (!contentHidden) {\n <div class=\"govuk-summary-card__content govuk-white-background\">\n <ng-content select=\"[content]\"></ng-content>\n </div>\n }\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;MAQa,+BAA+B,CAAA;AACf,IAAA,UAAU;AACV,IAAA,WAAW;AACV,IAAA,kBAAkB;AACpC,IAAA,UAAU,GAAG,IAAI,YAAY,EAAU;IAE3B,SAAS,GAAG,4BAA4B;AAE9D;;;;;AAKG;IACI,OAAO,CAAC,KAAY,EAAE,KAAa,EAAA;QACxC,KAAK,CAAC,cAAc,EAAE;AACtB,Q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AAA,SAAA,EAAA,CAAA;AAA7B,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,6BAA6B,sOCT1C,wnCAmCA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FD1Ba,6BAA6B,EAAA,UAAA,EAAA,CAAA;kBANzC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,kCAAkC,EAAA,OAAA,EACnC,EAAE,EAAA,eAAA,EAEM,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,wnCAAA,EAAA;8BAGpB,iBAAiB,EAAA,CAAA;sBAA3C,KAAK;uBAAC,EAAE,QAAQ,EAAE,IAAI,EAAE;gBACG,SAAS,EAAA,CAAA;sBAApC,KAAK;uBAAC,EAAE,QAAQ,EAAE,KAAK,EAAE;gBACE,aAAa,EAAA,CAAA;sBAAxC,KAAK;uBAAC,EAAE,QAAQ,EAAE,KAAK,EAAE;gBACE,YAAY,EAAA,CAAA;sBAAvC,KAAK;uBAAC,EAAE,QAAQ,EAAE,KAAK,EAAE;;;AEb5B;;AAEG;;;;"}
|
|
@@ -17,11 +17,11 @@ class GovukSummaryListRowActionItemComponent {
|
|
|
17
17
|
this.linkClick.emit(linkClicked);
|
|
18
18
|
}
|
|
19
19
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: GovukSummaryListRowActionItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
20
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
20
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.4", type: GovukSummaryListRowActionItemComponent, isStandalone: true, selector: "opal-lib-govuk-summary-list-row-action-item, [opal-lib-govuk-summary-list-row-action-item]", inputs: { actionName: "actionName", actionId: "actionId", visuallyHiddenText: "visuallyHiddenText" }, outputs: { linkClick: "linkClick" }, host: { properties: { "class": "this.hostClass" } }, ngImport: i0, template: "<a\n href=\"#\"\n class=\"govuk-link govuk-link--no-visited-state\"\n [id]=\"actionId\"\n (click)=\"handleActionClick($event, actionId)\"\n (keyup.enter)=\"handleActionClick($event, actionId)\"\n tabindex=\"0\"\n>\n <strong>{{ actionName }}</strong>\n @if (visuallyHiddenText) {\n <span class=\"govuk-visually-hidden\">{{ visuallyHiddenText }}</span>\n }\n</a>\n", changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
21
21
|
}
|
|
22
22
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: GovukSummaryListRowActionItemComponent, decorators: [{
|
|
23
23
|
type: Component,
|
|
24
|
-
args: [{ selector: 'opal-lib-govuk-summary-list-row-action-item, [opal-lib-govuk-summary-list-row-action-item]', imports: [], changeDetection: ChangeDetectionStrategy.OnPush, template: "<a\n href=\"#\"\n class=\"govuk-link govuk-link--no-visited-state\"\n [id]=\"actionId\"\n (click)=\"handleActionClick($event, actionId)\"\n (keyup.enter)=\"handleActionClick($event, actionId)\"\n tabindex=\"0\"\n>\n <strong>{{ actionName }}</strong\n
|
|
24
|
+
args: [{ selector: 'opal-lib-govuk-summary-list-row-action-item, [opal-lib-govuk-summary-list-row-action-item]', imports: [], changeDetection: ChangeDetectionStrategy.OnPush, template: "<a\n href=\"#\"\n class=\"govuk-link govuk-link--no-visited-state\"\n [id]=\"actionId\"\n (click)=\"handleActionClick($event, actionId)\"\n (keyup.enter)=\"handleActionClick($event, actionId)\"\n tabindex=\"0\"\n>\n <strong>{{ actionName }}</strong>\n @if (visuallyHiddenText) {\n <span class=\"govuk-visually-hidden\">{{ visuallyHiddenText }}</span>\n }\n</a>\n" }]
|
|
25
25
|
}], propDecorators: { actionName: [{
|
|
26
26
|
type: Input,
|
|
27
27
|
args: [{ required: true }]
|
|
@@ -30,7 +30,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImpor
|
|
|
30
30
|
args: [{ required: true }]
|
|
31
31
|
}], visuallyHiddenText: [{
|
|
32
32
|
type: Input,
|
|
33
|
-
args: [{ required:
|
|
33
|
+
args: [{ required: false }]
|
|
34
34
|
}], linkClick: [{
|
|
35
35
|
type: Output
|
|
36
36
|
}], hostClass: [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hmcts-opal-frontend-common-components-govuk-govuk-summary-list.mjs","sources":["../../../projects/opal-frontend-common/components/govuk/govuk-summary-list/govuk-summary-list-row/govuk-summary-list-row-actions/govuk-summary-list-row-action-item/govuk-summary-list-row-action-item.component.ts","../../../projects/opal-frontend-common/components/govuk/govuk-summary-list/govuk-summary-list-row/govuk-summary-list-row-actions/govuk-summary-list-row-action-item/govuk-summary-list-row-action-item.component.html","../../../projects/opal-frontend-common/components/govuk/govuk-summary-list/govuk-summary-list-row/govuk-summary-list-row-actions/govuk-summary-list-row-actions.component.ts","../../../projects/opal-frontend-common/components/govuk/govuk-summary-list/govuk-summary-list-row/govuk-summary-list-row-actions/govuk-summary-list-row-actions.component.html","../../../projects/opal-frontend-common/components/govuk/govuk-summary-list/govuk-summary-list-row/govuk-summary-list-row.component.ts","../../../projects/opal-frontend-common/components/govuk/govuk-summary-list/govuk-summary-list-row/govuk-summary-list-row.component.html","../../../projects/opal-frontend-common/components/govuk/govuk-summary-list/govuk-summary-list.component.ts","../../../projects/opal-frontend-common/components/govuk/govuk-summary-list/govuk-summary-list.component.html","../../../projects/opal-frontend-common/components/govuk/govuk-summary-list/hmcts-opal-frontend-common-components-govuk-govuk-summary-list.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, EventEmitter, HostBinding, Input, Output } from '@angular/core';\n\n@Component({\n selector: 'opal-lib-govuk-summary-list-row-action-item, [opal-lib-govuk-summary-list-row-action-item]',\n imports: [],\n templateUrl: './govuk-summary-list-row-action-item.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class GovukSummaryListRowActionItemComponent {\n @Input({ required: true }) actionName!: string;\n @Input({ required: true }) actionId!: string;\n @Input({ required:
|
|
1
|
+
{"version":3,"file":"hmcts-opal-frontend-common-components-govuk-govuk-summary-list.mjs","sources":["../../../projects/opal-frontend-common/components/govuk/govuk-summary-list/govuk-summary-list-row/govuk-summary-list-row-actions/govuk-summary-list-row-action-item/govuk-summary-list-row-action-item.component.ts","../../../projects/opal-frontend-common/components/govuk/govuk-summary-list/govuk-summary-list-row/govuk-summary-list-row-actions/govuk-summary-list-row-action-item/govuk-summary-list-row-action-item.component.html","../../../projects/opal-frontend-common/components/govuk/govuk-summary-list/govuk-summary-list-row/govuk-summary-list-row-actions/govuk-summary-list-row-actions.component.ts","../../../projects/opal-frontend-common/components/govuk/govuk-summary-list/govuk-summary-list-row/govuk-summary-list-row-actions/govuk-summary-list-row-actions.component.html","../../../projects/opal-frontend-common/components/govuk/govuk-summary-list/govuk-summary-list-row/govuk-summary-list-row.component.ts","../../../projects/opal-frontend-common/components/govuk/govuk-summary-list/govuk-summary-list-row/govuk-summary-list-row.component.html","../../../projects/opal-frontend-common/components/govuk/govuk-summary-list/govuk-summary-list.component.ts","../../../projects/opal-frontend-common/components/govuk/govuk-summary-list/govuk-summary-list.component.html","../../../projects/opal-frontend-common/components/govuk/govuk-summary-list/hmcts-opal-frontend-common-components-govuk-govuk-summary-list.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, EventEmitter, HostBinding, Input, Output } from '@angular/core';\n\n@Component({\n selector: 'opal-lib-govuk-summary-list-row-action-item, [opal-lib-govuk-summary-list-row-action-item]',\n imports: [],\n templateUrl: './govuk-summary-list-row-action-item.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class GovukSummaryListRowActionItemComponent {\n @Input({ required: true }) actionName!: string;\n @Input({ required: true }) actionId!: string;\n @Input({ required: false }) visuallyHiddenText!: string;\n @Output() public linkClick = new EventEmitter<string>();\n\n @HostBinding('class') hostClass = 'govuk-summary-list__actions-list-item govuk-link-colour';\n\n /**\n * Handles the click event for the action button.\n * @param event - The click event.\n */\n public handleActionClick(event: Event, linkClicked: string): void {\n event.preventDefault();\n this.linkClick.emit(linkClicked);\n }\n}\n","<a\n href=\"#\"\n class=\"govuk-link govuk-link--no-visited-state\"\n [id]=\"actionId\"\n (click)=\"handleActionClick($event, actionId)\"\n (keyup.enter)=\"handleActionClick($event, actionId)\"\n tabindex=\"0\"\n>\n <strong>{{ actionName }}</strong>\n @if (visuallyHiddenText) {\n <span class=\"govuk-visually-hidden\">{{ visuallyHiddenText }}</span>\n }\n</a>\n","import { ChangeDetectionStrategy, Component } from '@angular/core';\n\n@Component({\n selector: 'opal-lib-govuk-summary-list-row-actions',\n imports: [],\n templateUrl: './govuk-summary-list-row-actions.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class GovukSummaryListRowActionsComponent {}\n","<ul class=\"govuk-summary-list__actions-list govuk-body\">\n <ng-content></ng-content>\n</ul>\n","import {\n ChangeDetectionStrategy,\n Component,\n EventEmitter,\n HostBinding,\n Input,\n OnInit,\n Output,\n inject,\n} from '@angular/core';\nimport { UtilsService } from '@hmcts/opal-frontend-common/services/utils-service';\n\n@Component({\n selector: 'opal-lib-govuk-summary-list-row, [opal-lib-govuk-summary-list-row]',\n imports: [],\n templateUrl: './govuk-summary-list-row.component.html',\n styleUrl: './govuk-summary-list-row.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class GovukSummaryListRowComponent implements OnInit {\n private readonly utilService = inject(UtilsService);\n public _summaryListRowId!: string;\n\n @Output() public actionClick = new EventEmitter<boolean>();\n @Input() public actionEnabled = false;\n\n @Input({ required: true }) summaryListId!: string;\n @Input({ required: true }) set summaryListRowId(summaryListRowId: string) {\n this._summaryListRowId = this.utilService.upperCaseFirstLetter(summaryListRowId);\n }\n\n // We need to set the class and id on the host div element\n // A div needs to be passed, otherwise we will get https://dequeuniversity.com/rules/axe/4.8/definition-list?application=RuleDescription\n // As it doesn't like nested divs\n @HostBinding('class') class!: string;\n @HostBinding('id') id!: string;\n\n /**\n * Handles the click event for the action button.\n * @param event - The click event.\n */\n public handleActionClick(event: Event): void {\n event.preventDefault();\n this.actionClick.emit(true);\n }\n\n ngOnInit() {\n this.id = this.summaryListId + this._summaryListRowId;\n this.class = 'govuk-summary-list__row';\n }\n}\n","<dt class=\"govuk-summary-list__key\" [id]=\"summaryListId + _summaryListRowId + 'Key'\">\n <ng-content select=\"[name]\"></ng-content>\n</dt>\n\n<dd class=\"govuk-summary-list__value\" [id]=\"summaryListId + _summaryListRowId + 'Value'\">\n <ng-content select=\"[value]\"></ng-content>\n</dd>\n@if (actionEnabled) {\n <dd class=\"govuk-summary-list__actions\" [id]=\"summaryListId + _summaryListRowId + 'Actions'\">\n <a class=\"govuk-link\" href=\"#\" (click)=\"handleActionClick($event)\">\n <ng-content select=\"[action]\"></ng-content>\n </a>\n </dd>\n}\n","import { ChangeDetectionStrategy, Component, Input } from '@angular/core';\n\n@Component({\n selector: 'opal-lib-govuk-summary-list',\n imports: [],\n templateUrl: './govuk-summary-list.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class GovukSummaryListComponent {\n @Input({ required: true }) summaryListId!: string;\n @Input({ required: false }) classes!: string;\n}\n","<dl class=\"govuk-summary-list {{ classes }}\" [id]=\"summaryListId\">\n <ng-content></ng-content>\n</dl>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;MAQa,sCAAsC,CAAA;AACtB,IAAA,UAAU;AACV,IAAA,QAAQ;AACP,IAAA,kBAAkB;AAC7B,IAAA,SAAS,GAAG,IAAI,YAAY,EAAU;IAEjC,SAAS,GAAG,yDAAyD;AAE3F;;;AAGG;IACI,iBAAiB,CAAC,KAAY,EAAE,WAAmB,EAAA;QACxD,KAAK,CAAC,cAAc,EAAE;AACtB,QAAA,IAAI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,EAAE,KAAK,EAAE;;;AEV5B;;AAEG;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hmcts-opal-frontend-common-types.mjs","sources":["../../../projects/opal-frontend-common/types/hmcts-opal-frontend-common-types.ts"],"sourcesContent":["/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"AAAA;;AAEG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hmcts-opal-frontend-common.mjs","sources":["../../../projects/opal-frontend-common/constants/src/footer-links.constant.ts","../../../projects/opal-frontend-common/constants/src/header-links.constant.ts","../../../projects/opal-frontend-common/constants/src/regex-patterns.constant.ts","../../../projects/opal-frontend-common/pages/routing/pages.routes.ts","../../../projects/opal-frontend-common/public-api.ts","../../../projects/opal-frontend-common/hmcts-opal-frontend-common.ts"],"sourcesContent":["import { IGovukFooterLinks } from '@hmcts/opal-frontend-common/components/govuk/govuk-footer/interfaces';\n\nexport const FOOTER_LINKS: IGovukFooterLinks = {\n licenseLink: 'https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/',\n licenseVersion: '3.0',\n copyrightLink:\n 'https://www.nationalarchives.gov.uk/information-management/re-using-public-sector-information/uk-government-licensing-framework/crown-copyright/',\n};\n","import { IMojHeaderLinks } from '@hmcts/opal-frontend-common/components/moj/moj-header/interfaces';\n\nexport const HEADER_LINKS: IMojHeaderLinks = {\n govukLink: 'https://www.gov.uk/',\n serviceLink: '/',\n};\n","export const ALPHANUMERIC_WITH_SPACES_PATTERN = /^[a-zA-Z0-9 ]*$/;\nexport const ALPHANUMERIC_WITH_HYPHENS_SPACES_APOSTROPHES_DOT_PATTERN = /^[a-zA-Z0-9\\s'.-]*$/;\nexport const LETTERS_WITH_SPACES_PATTERN = /^[a-zA-Z ]*$/;\nexport const LETTERS_WITH_SPACES_DOT_PATTERN = /^[a-zA-Z\\s.]*$/;\nexport const LETTERS_SPACES_HYPHENS_APOSTROPHES_DOT_PATTERN = /^[a-zA-Z\\s'.-]*$/;\nexport const SPECIAL_CHARACTERS_PATTERN = /^[a-zA-Z0-9 ]*$/;\nexport const NUMERIC_PATTERN = /^\\d*$/;\nexport const DRIVING_LICENCE_NUMBER_PATTERN = /^[A-Za-z]{5}\\d{6}[A-Za-z]{2}[A-Za-z0-9]{3}$/;\nexport const EMAIL_ADDRESS_PATTERN = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$/;\nexport const TIME_FORMAT_PATTERN = /^([01]\\d|2[0-3]):[0-5]\\d$/;\nexport const TWO_DECIMAL_PLACES_PATTERN = /^\\d+(\\.\\d{0,2})?$/;\n","import { Routes } from '@angular/router';\nimport { PAGES_ROUTING_TITLES, PAGES_ROUTING_PATHS } from '@hmcts/opal-frontend-common/pages/routing/constants';\nimport { authGuard } from '@hmcts/opal-frontend-common/guards/auth';\nimport { signedInGuard } from '@hmcts/opal-frontend-common/guards/signed-in';\nimport { TitleResolver } from '@hmcts/opal-frontend-common/resolvers/title';\nimport { userStateResolver } from '@hmcts/opal-frontend-common/resolvers/user-state';\n\nexport const routing: Routes = [\n { path: '', redirectTo: 'dashboard', pathMatch: 'full' },\n {\n path: PAGES_ROUTING_PATHS.children.accessDenied,\n loadComponent: () => import('../access-denied/access-denied.component').then((c) => c.AccessDeniedComponent),\n canActivate: [authGuard],\n data: { title: PAGES_ROUTING_TITLES.children.accessDenied },\n resolve: { userState: userStateResolver, title: TitleResolver },\n },\n {\n path: PAGES_ROUTING_PATHS.children.signIn,\n loadComponent: () => import('../sign-in/sign-in.component').then((c) => c.SignInComponent),\n canActivate: [signedInGuard],\n data: { title: PAGES_ROUTING_TITLES.children.signIn },\n resolve: { title: TitleResolver },\n },\n];\n","/*\n * Public API Surface of @hmcts/opal-frontend-common\n *\n * This library uses individual entry points for components, services, and utilities\n * as defined in ng-package.json. This allows for tree-shaking and selective imports.\n *\n * Most exports are available through their specific entry points, such as:\n * - @hmcts/opal-frontend-common/components/govuk/govuk-button\n * - @hmcts/opal-frontend-common/services/auth-service\n * - @hmcts/opal-frontend-common/validators/amount\n *\n * The exports below are for common utilities that should be available\n * at the main entry point.\n */\n\n// Constants - commonly used across applications\nexport * from './constants/public-api';\n\n// Pages - routing configuration\nexport * from './pages/public-api';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;AAEO,MAAM,YAAY,GAAsB;AAC7C,IAAA,WAAW,EAAE,4EAA4E;AACzF,IAAA,cAAc,EAAE,KAAK;AACrB,IAAA,aAAa,EACX,kJAAkJ;;;ACJ/I,MAAM,YAAY,GAAoB;AAC3C,IAAA,SAAS,EAAE,qBAAqB;AAChC,IAAA,WAAW,EAAE,GAAG;;;ACJX,MAAM,gCAAgC,GAAG;AACzC,MAAM,wDAAwD,GAAG;AACjE,MAAM,2BAA2B,GAAG;AACpC,MAAM,+BAA+B,GAAG;AACxC,MAAM,8CAA8C,GAAG;AACvD,MAAM,0BAA0B,GAAG;AACnC,MAAM,eAAe,GAAG;AACxB,MAAM,8BAA8B,GAAG;AACvC,MAAM,qBAAqB,GAAG;AAC9B,MAAM,mBAAmB,GAAG;AAC5B,MAAM,0BAA0B,GAAG;;ACHnC,MAAM,OAAO,GAAW;IAC7B,EAAE,IAAI,EAAE,EAAE,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE;AACxD,IAAA;AACE,QAAA,IAAI,EAAE,mBAAmB,CAAC,QAAQ,CAAC,YAAY;AAC/C,QAAA,aAAa,EAAE,MAAM,OAAO,mEAA0C,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,qBAAqB,CAAC;QAC5G,WAAW,EAAE,CAAC,SAAS,CAAC;QACxB,IAAI,EAAE,EAAE,KAAK,EAAE,oBAAoB,CAAC,QAAQ,CAAC,YAAY,EAAE;QAC3D,OAAO,EAAE,EAAE,SAAS,EAAE,iBAAiB,EAAE,KAAK,EAAE,aAAa,EAAE;AAChE,KAAA;AACD,IAAA;AACE,QAAA,IAAI,EAAE,mBAAmB,CAAC,QAAQ,CAAC,MAAM;AACzC,QAAA,aAAa,EAAE,MAAM,OAAO,6DAA8B,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,eAAe,CAAC;QAC1F,WAAW,EAAE,CAAC,aAAa,CAAC;QAC5B,IAAI,EAAE,EAAE,KAAK,EAAE,oBAAoB,CAAC,QAAQ,CAAC,MAAM,EAAE;AACrD,QAAA,OAAO,EAAE,EAAE,KAAK,EAAE,aAAa,EAAE;AAClC,KAAA;;;ACtBH;;;;;;;;;;;;;AAaG;AAEH;;ACfA;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"hmcts-opal-frontend-common.mjs","sources":["../../../projects/opal-frontend-common/constants/src/footer-links.constant.ts","../../../projects/opal-frontend-common/constants/src/header-links.constant.ts","../../../projects/opal-frontend-common/constants/src/regex-patterns.constant.ts","../../../projects/opal-frontend-common/pages/routing/pages.routes.ts","../../../projects/opal-frontend-common/public-api.ts","../../../projects/opal-frontend-common/hmcts-opal-frontend-common.ts"],"sourcesContent":["import { IGovukFooterLinks } from '@hmcts/opal-frontend-common/components/govuk/govuk-footer/interfaces';\n\nexport const FOOTER_LINKS: IGovukFooterLinks = {\n licenseLink: 'https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/',\n licenseVersion: '3.0',\n copyrightLink:\n 'https://www.nationalarchives.gov.uk/information-management/re-using-public-sector-information/uk-government-licensing-framework/crown-copyright/',\n};\n","import { IMojHeaderLinks } from '@hmcts/opal-frontend-common/components/moj/moj-header/interfaces';\n\nexport const HEADER_LINKS: IMojHeaderLinks = {\n govukLink: 'https://www.gov.uk/',\n serviceLink: '/',\n};\n","export const ALPHANUMERIC_WITH_SPACES_PATTERN = /^[a-zA-Z0-9 ]*$/;\nexport const ALPHANUMERIC_WITH_HYPHENS_SPACES_APOSTROPHES_DOT_PATTERN = /^[a-zA-Z0-9\\s'.-]*$/;\nexport const LETTERS_WITH_SPACES_PATTERN = /^[a-zA-Z ]*$/;\nexport const LETTERS_WITH_SPACES_DOT_PATTERN = /^[a-zA-Z\\s.]*$/;\nexport const LETTERS_SPACES_HYPHENS_APOSTROPHES_DOT_PATTERN = /^[a-zA-Z\\s'.-]*$/;\nexport const SPECIAL_CHARACTERS_PATTERN = /^[a-zA-Z0-9 ]*$/;\nexport const NUMERIC_PATTERN = /^\\d*$/;\nexport const DRIVING_LICENCE_NUMBER_PATTERN = /^[A-Za-z]{5}\\d{6}[A-Za-z]{2}[A-Za-z0-9]{3}$/;\nexport const EMAIL_ADDRESS_PATTERN = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$/;\nexport const TIME_FORMAT_PATTERN = /^([01]\\d|2[0-3]):[0-5]\\d$/;\nexport const TWO_DECIMAL_PLACES_PATTERN = /^\\d+(\\.\\d{0,2})?$/;\n","import { Routes } from '@angular/router';\nimport { PAGES_ROUTING_TITLES, PAGES_ROUTING_PATHS } from '@hmcts/opal-frontend-common/pages/routing/constants';\nimport { authGuard } from '@hmcts/opal-frontend-common/guards/auth';\nimport { signedInGuard } from '@hmcts/opal-frontend-common/guards/signed-in';\nimport { TitleResolver } from '@hmcts/opal-frontend-common/resolvers/title';\nimport { userStateResolver } from '@hmcts/opal-frontend-common/resolvers/user-state';\n\nexport const routing: Routes = [\n { path: '', redirectTo: 'dashboard', pathMatch: 'full' },\n {\n path: PAGES_ROUTING_PATHS.children.accessDenied,\n loadComponent: () => import('../access-denied/access-denied.component').then((c) => c.AccessDeniedComponent),\n canActivate: [authGuard],\n data: { title: PAGES_ROUTING_TITLES.children.accessDenied },\n resolve: { userState: userStateResolver, title: TitleResolver },\n },\n {\n path: PAGES_ROUTING_PATHS.children.signIn,\n loadComponent: () => import('../sign-in/sign-in.component').then((c) => c.SignInComponent),\n canActivate: [signedInGuard],\n data: { title: PAGES_ROUTING_TITLES.children.signIn },\n resolve: { title: TitleResolver },\n },\n];\n","/*\n * Public API Surface of @hmcts/opal-frontend-common\n *\n * This library uses individual entry points for components, services, and utilities\n * as defined in ng-package.json. This allows for tree-shaking and selective imports.\n *\n * Most exports are available through their specific entry points, such as:\n * - @hmcts/opal-frontend-common/components/govuk/govuk-button\n * - @hmcts/opal-frontend-common/services/auth-service\n * - @hmcts/opal-frontend-common/validators/amount\n *\n * The exports below are for common utilities that should be available\n * at the main entry point.\n */\n\n// Constants - commonly used across applications\nexport * from './constants/public-api';\n\n// Pages - routing configuration\nexport * from './pages/public-api';\n\n// Types - commonly used types and interfaces\nexport * from './types/public-api';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;AAEO,MAAM,YAAY,GAAsB;AAC7C,IAAA,WAAW,EAAE,4EAA4E;AACzF,IAAA,cAAc,EAAE,KAAK;AACrB,IAAA,aAAa,EACX,kJAAkJ;;;ACJ/I,MAAM,YAAY,GAAoB;AAC3C,IAAA,SAAS,EAAE,qBAAqB;AAChC,IAAA,WAAW,EAAE,GAAG;;;ACJX,MAAM,gCAAgC,GAAG;AACzC,MAAM,wDAAwD,GAAG;AACjE,MAAM,2BAA2B,GAAG;AACpC,MAAM,+BAA+B,GAAG;AACxC,MAAM,8CAA8C,GAAG;AACvD,MAAM,0BAA0B,GAAG;AACnC,MAAM,eAAe,GAAG;AACxB,MAAM,8BAA8B,GAAG;AACvC,MAAM,qBAAqB,GAAG;AAC9B,MAAM,mBAAmB,GAAG;AAC5B,MAAM,0BAA0B,GAAG;;ACHnC,MAAM,OAAO,GAAW;IAC7B,EAAE,IAAI,EAAE,EAAE,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE;AACxD,IAAA;AACE,QAAA,IAAI,EAAE,mBAAmB,CAAC,QAAQ,CAAC,YAAY;AAC/C,QAAA,aAAa,EAAE,MAAM,OAAO,mEAA0C,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,qBAAqB,CAAC;QAC5G,WAAW,EAAE,CAAC,SAAS,CAAC;QACxB,IAAI,EAAE,EAAE,KAAK,EAAE,oBAAoB,CAAC,QAAQ,CAAC,YAAY,EAAE;QAC3D,OAAO,EAAE,EAAE,SAAS,EAAE,iBAAiB,EAAE,KAAK,EAAE,aAAa,EAAE;AAChE,KAAA;AACD,IAAA;AACE,QAAA,IAAI,EAAE,mBAAmB,CAAC,QAAQ,CAAC,MAAM;AACzC,QAAA,aAAa,EAAE,MAAM,OAAO,6DAA8B,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,eAAe,CAAC;QAC1F,WAAW,EAAE,CAAC,aAAa,CAAC;QAC5B,IAAI,EAAE,EAAE,KAAK,EAAE,oBAAoB,CAAC,QAAQ,CAAC,MAAM,EAAE;AACrD,QAAA,OAAO,EAAE,EAAE,KAAK,EAAE,aAAa,EAAE;AAClC,KAAA;;;ACtBH;;;;;;;;;;;;;AAaG;AAEH;;ACfA;;AAEG;;;;"}
|
package/index.d.ts
CHANGED
|
@@ -20,4 +20,7 @@ declare const TWO_DECIMAL_PLACES_PATTERN: RegExp;
|
|
|
20
20
|
|
|
21
21
|
declare const routing: Routes;
|
|
22
22
|
|
|
23
|
+
type HeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;
|
|
24
|
+
|
|
23
25
|
export { ALPHANUMERIC_WITH_HYPHENS_SPACES_APOSTROPHES_DOT_PATTERN, ALPHANUMERIC_WITH_SPACES_PATTERN, DRIVING_LICENCE_NUMBER_PATTERN, EMAIL_ADDRESS_PATTERN, FOOTER_LINKS, HEADER_LINKS, LETTERS_SPACES_HYPHENS_APOSTROPHES_DOT_PATTERN, LETTERS_WITH_SPACES_DOT_PATTERN, LETTERS_WITH_SPACES_PATTERN, NUMERIC_PATTERN, SPECIAL_CHARACTERS_PATTERN, TIME_FORMAT_PATTERN, TWO_DECIMAL_PLACES_PATTERN, routing };
|
|
26
|
+
export type { HeadingLevel };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hmcts/opal-frontend-common",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.44",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"peerDependencies": {
|
|
6
6
|
"@angular/common": "^18.2.0 || ^19.0.0 || ^20.0.0",
|
|
@@ -826,6 +826,11 @@
|
|
|
826
826
|
"types": "./validators/valid-value/index.d.ts",
|
|
827
827
|
"default": "./fesm2022/hmcts-opal-frontend-common-validators-valid-value.mjs"
|
|
828
828
|
},
|
|
829
|
+
"./types": {
|
|
830
|
+
"import": "./fesm2022/hmcts-opal-frontend-common-types.mjs",
|
|
831
|
+
"types": "./types/index.d.ts",
|
|
832
|
+
"default": "./fesm2022/hmcts-opal-frontend-common-types.mjs"
|
|
833
|
+
},
|
|
829
834
|
"./package.json": {
|
|
830
835
|
"default": "./package.json"
|
|
831
836
|
},
|
package/types/index.d.ts
ADDED