@hmcts/opal-frontend-common 0.0.7 → 0.0.8
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/README.md +152 -11
- package/directives/capitalisation/capitalisation.directive.d.ts +14 -0
- package/directives/capitalisation/index.d.ts +5 -0
- package/directives/capitalisation/public-api.d.ts +1 -0
- package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-form-alias-base.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-form-array-base.mjs +4 -4
- package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-form-array-base.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-form-array-parent-base.mjs +2 -2
- package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-form-array-parent-base.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-form-array-removal-base.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-form-base.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-sortable-table-pagination.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-sortable-table.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-alphagov-alphagov-accessible-autocomplete.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-accordion.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-back-link.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-button.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-cancel-link.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-checkboxes.mjs +12 -12
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-date-input.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-details.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-error-summary.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-footer.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-header.mjs +6 -6
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-heading-with-caption.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-inset-text.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-notification-banner.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-pagination.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-panel.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-radio.mjs +12 -12
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-select.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-summary-card-list.mjs +6 -6
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-summary-list.mjs +12 -12
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-table.mjs +12 -12
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-tabs.mjs +9 -9
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-tag.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-task-list.mjs +6 -6
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-text-area.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-text-input-prefix-suffix.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-text-input.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-badge.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-banner.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-button-menu.mjs +6 -6
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-date-picker.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-header.mjs +6 -6
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-notification-badge.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-page-header.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-pagination.mjs +12 -12
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-primary-navigation.mjs +6 -6
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-sortable-table.mjs +15 -15
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-sub-navigation.mjs +6 -6
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-ticket-panel.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-timeline.mjs +6 -6
- package/fesm2022/hmcts-opal-frontend-common-directives-capitalisation.mjs +40 -0
- package/fesm2022/hmcts-opal-frontend-common-directives-capitalisation.mjs.map +1 -0
- package/fesm2022/hmcts-opal-frontend-common-guards-route-permissions.mjs +2 -1
- package/fesm2022/hmcts-opal-frontend-common-guards-route-permissions.mjs.map +1 -1
- package/fesm2022/{hmcts-opal-frontend-common-pages-access-denied.component-npDHlv8C.mjs → hmcts-opal-frontend-common-pages-access-denied.component-lAGLpY0c.mjs} +4 -4
- package/fesm2022/{hmcts-opal-frontend-common-pages-access-denied.component-npDHlv8C.mjs.map → hmcts-opal-frontend-common-pages-access-denied.component-lAGLpY0c.mjs.map} +1 -1
- package/fesm2022/{hmcts-opal-frontend-common-pages-sign-in-stub.component-EPZmMG9z.mjs → hmcts-opal-frontend-common-pages-sign-in-stub.component-N-tkNkj6.mjs} +4 -4
- package/fesm2022/{hmcts-opal-frontend-common-pages-sign-in-stub.component-EPZmMG9z.mjs.map → hmcts-opal-frontend-common-pages-sign-in-stub.component-N-tkNkj6.mjs.map} +1 -1
- package/fesm2022/{hmcts-opal-frontend-common-pages-sign-in.component-C94FFph9.mjs → hmcts-opal-frontend-common-pages-sign-in.component-CtniiG6-.mjs} +4 -4
- package/fesm2022/{hmcts-opal-frontend-common-pages-sign-in.component-C94FFph9.mjs.map → hmcts-opal-frontend-common-pages-sign-in.component-CtniiG6-.mjs.map} +1 -1
- package/fesm2022/hmcts-opal-frontend-common-pages.mjs +2 -2
- package/fesm2022/hmcts-opal-frontend-common-pipes-date-format.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-pipes-days-ago.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-resolvers-title.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-services-app-initializer-service.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-services-app-insights-service.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-services-auth-service.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-services-date-service.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-services-launch-darkly-service.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-services-permissions-service.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-services-session-service.mjs +9 -11
- package/fesm2022/hmcts-opal-frontend-common-services-session-service.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-services-sort-service.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-services-transfer-state-service.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-services-transformation-service.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-services-utils-service.mjs +3 -3
- package/package.json +7 -1
package/README.md
CHANGED
|
@@ -1,24 +1,165 @@
|
|
|
1
|
-
#
|
|
1
|
+
# OPAL Frontend Common UI Library
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/@hmcts/opal-frontend-common)
|
|
4
|
+
[](https://github.com/hmcts/opal-frontend-common-ui-lib/blob/main/LICENSE)
|
|
5
|
+
[](https://sonarcloud.io/summary/new_code?id=hmcts_opal-frontend-common-ui-lib)
|
|
6
|
+
[](https://sonarcloud.io/summary/new_code?id=hmcts_opal-frontend-common-ui-lib)
|
|
4
7
|
|
|
5
|
-
|
|
8
|
+
This is an [Angular Library](https://angular.dev/tools/libraries).
|
|
6
9
|
|
|
7
|
-
|
|
8
|
-
|
|
10
|
+
## Table of Contents
|
|
11
|
+
|
|
12
|
+
- [Getting Started](#getting-started)
|
|
13
|
+
- [Development server](#development-server)
|
|
14
|
+
- [Build](#build)
|
|
15
|
+
- [Switching Between Local and Published Versions](#switching-between-local-and-published-versions)
|
|
16
|
+
- [Running unit tests](#running-unit-tests)
|
|
17
|
+
- [Angular code scaffolding](#angular-code-scaffolding)
|
|
18
|
+
- [Commonly Used Commands](#commonly-used-commands)
|
|
19
|
+
- [Using This Library](#using-this-library-in-an-angular-application-eg-opal-frontend)
|
|
20
|
+
- [Publishing the Library](#publishing-the-library)
|
|
21
|
+
|
|
22
|
+
## Getting Started
|
|
23
|
+
|
|
24
|
+
### Prerequisites
|
|
25
|
+
|
|
26
|
+
Running the application requires the following tools to be installed in your environment:
|
|
27
|
+
|
|
28
|
+
- [Node.js](https://nodejs.org/) v23.7.0 or later
|
|
29
|
+
|
|
30
|
+
- [yarn](https://yarnpkg.com/) v4
|
|
31
|
+
|
|
32
|
+
### Install Dependencies
|
|
33
|
+
|
|
34
|
+
Install dependencies by executing the following command:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
|
|
38
|
+
yarn
|
|
39
|
+
|
|
40
|
+
```
|
|
9
41
|
|
|
10
42
|
## Build
|
|
11
43
|
|
|
12
|
-
Run `ng build
|
|
44
|
+
Run `yarn ng build` to build the project. The build artifacts will be stored in the `dist/` directory.
|
|
45
|
+
|
|
46
|
+
## Switching Between Local and Published Versions
|
|
47
|
+
|
|
48
|
+
See [opal-frontend](https://github.com/hmcts/opal-frontend) for how this library is consumed in practice.
|
|
49
|
+
|
|
50
|
+
Use the `yarn import:local:common-ui-lib` and `yarn import:published:common-ui-lib` scripts in your consuming project (`opal-frontend`) to switch between local development and the published npm version of the library.
|
|
51
|
+
|
|
52
|
+
To use a published version of this library during development in another project:
|
|
53
|
+
|
|
54
|
+
1. In the consuming project, run:
|
|
55
|
+
```bash
|
|
56
|
+
yarn import:published:common-ui-lib
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
To use a local version of this library during development in another project:
|
|
60
|
+
|
|
61
|
+
1. Build this library:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
yarn build
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
2. In your consuming project (e.g. `opal-frontend`), ensure you have set an environment variable pointing to the local build:
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
# In your shell config file (.zshrc, .bash_profile, or .bashrc)
|
|
71
|
+
export COMMON_UI_LIB_PATH="[INSERT PATH TO COMMON UI LIB FOLDER]"
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
3. In the consuming project (e.g. `opal-frontend`), run:
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
yarn import:local:common-ui-lib
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
This will remove the published version and install the local build using the path provided.
|
|
13
81
|
|
|
14
|
-
|
|
82
|
+
4. To switch back to the published version:
|
|
83
|
+
```bash
|
|
84
|
+
yarn import:published:common-ui-lib
|
|
85
|
+
```
|
|
15
86
|
|
|
16
|
-
|
|
87
|
+
This setup makes it easy to switch between development and production versions of the shared library.
|
|
88
|
+
|
|
89
|
+
## Publishing the Library
|
|
90
|
+
|
|
91
|
+
Once any changes have been approved and merged into the main branch, you'll need to publish a new version of the library so that it can be consumed by other projects. To do this:
|
|
92
|
+
|
|
93
|
+
1. Increment the version number in both the library's root `package.json` and in `/projects/opal-frontend-common/package.json`.
|
|
94
|
+
2. Commit and push those changes to the main branch.
|
|
95
|
+
3. On GitHub, create a new [release](https://github.com/hmcts/opal-frontend-common-ui-lib/releases) and use the updated version number as a tag.
|
|
96
|
+
4. When the release workflow completes, the library will be published.
|
|
97
|
+
|
|
98
|
+
After this new version of the library is published, any consuming application should remove the local or outdated version of the library and then install the published version by running:
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
yarn import:published:common-ui-lib
|
|
102
|
+
```
|
|
17
103
|
|
|
18
104
|
## Running unit tests
|
|
19
105
|
|
|
20
|
-
Run `
|
|
106
|
+
Run `yarn test` to execute the unit tests via [karma](https://karma-runner.github.io/latest/index.html).
|
|
107
|
+
|
|
108
|
+
To check code coverage, run `yarn test:coverage` to execute the unit tests via [karma](https://karma-runner.github.io/latest/index.html) but with code coverage.
|
|
109
|
+
The coverage report will be available in the coverage/ directory (e.g. coverage/index.html).
|
|
110
|
+
|
|
111
|
+
## Angular code scaffolding
|
|
112
|
+
|
|
113
|
+
### Component Prefixing
|
|
114
|
+
|
|
115
|
+
This library uses the prefix `opal-lib` for all of its shared components, as specified in the `angular.json` file. When generating new components, make sure they are prefixed accordingly. This ensures consistent naming and avoids naming collisions across applications.
|
|
116
|
+
|
|
117
|
+
Run `yarn ng generate component component-name` to generate a new component. You can also use `yarn ng generate directive|pipe|service|class|guard|interface|enum|module`.
|
|
118
|
+
|
|
119
|
+
Note the requirement for prefixing the `ng` commands with `yarn`
|
|
120
|
+
|
|
121
|
+
### Multiple Entry Points
|
|
122
|
+
|
|
123
|
+
This library uses multiple entry points, which allows you to organize and expose different parts of the library in separate modules. Each entry point requires:
|
|
124
|
+
|
|
125
|
+
- An `ng-package.json` to define how the entry point should be packaged.
|
|
126
|
+
- A `package.json` to specify the entry point's metadata and dependencies.
|
|
127
|
+
- A `public-api.ts` to declare and export the resources for that entry point.
|
|
128
|
+
|
|
129
|
+
Alias paths need to be set in both the `/projects/opal-frontend-common/package.json` and the library's `tsconfig.json`. These aliases help the consuming application import from each entry point using the correct path. By properly defining these aliases, developers can import modules from your library entry points without resorting to complex relative paths.
|
|
130
|
+
|
|
131
|
+
#### Example Usage of Entry Points
|
|
132
|
+
|
|
133
|
+
To import a module from a specific entry point in your application:
|
|
134
|
+
|
|
135
|
+
```ts
|
|
136
|
+
// Example: Importing various items from the library
|
|
137
|
+
import { GovukTextInputComponent } from '@hmcts/opal-frontend-common/components/govuk/govuk-text-input';
|
|
138
|
+
import { DateService } from '@hmcts/opal-frontend-common/services/date-service';
|
|
139
|
+
import { dateOfBirthValidator } from '@hmcts/opal-frontend-common/validators/date-of-birth';
|
|
140
|
+
import { hasFlowStateGuard } from '@hmcts/opal-frontend-common/guards/has-flow-state';
|
|
141
|
+
import { userStateResolver } from '@hmcts/opal-frontend-common/resolvers/user-state';
|
|
142
|
+
import { GlobalStore } from '@hmcts/opal-frontend-common/stores/global';
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
## Commonly Used Commands
|
|
146
|
+
|
|
147
|
+
The following commands are available in the `package.json`:
|
|
148
|
+
|
|
149
|
+
- `yarn build`
|
|
150
|
+
Builds the Angular library and outputs to the `dist/` folder.
|
|
151
|
+
|
|
152
|
+
- `yarn test`
|
|
153
|
+
Executes unit tests via [karma](https://karma-runner.github.io/latest/index.html).
|
|
154
|
+
|
|
155
|
+
- `yarn test:coverage`
|
|
156
|
+
Runs unit tests with code coverage reporting enabled. The coverage report can be found in the `coverage/` directory.
|
|
157
|
+
|
|
158
|
+
- `yarn lint`
|
|
159
|
+
Runs linting using ESLint.
|
|
21
160
|
|
|
22
|
-
|
|
161
|
+
- `yarn prettier`
|
|
162
|
+
Checks that all files conform to the Prettier formatting rules.
|
|
23
163
|
|
|
24
|
-
|
|
164
|
+
- `yarn prettier:fix`
|
|
165
|
+
Automatically formats files using Prettier.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
export declare class CapitalisationDirective {
|
|
3
|
+
private readonly renderer;
|
|
4
|
+
private readonly utilsService;
|
|
5
|
+
/**
|
|
6
|
+
* Handles the input event on the associated HTML element.
|
|
7
|
+
* Captures the input value, applies capitalisation, and updates the element's value.
|
|
8
|
+
*
|
|
9
|
+
* @param event - The input event triggered by the user.
|
|
10
|
+
*/
|
|
11
|
+
onInput(event: Event): void;
|
|
12
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CapitalisationDirective, never>;
|
|
13
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<CapitalisationDirective, "[opalLibCapitaliseAllCharacters]", never, {}, {}, never, never, true, never>;
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './capitalisation.directive';
|
package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-form-alias-base.mjs
CHANGED
|
@@ -190,10 +190,10 @@ class AbstractFormAliasBaseComponent extends AbstractFormBaseComponent {
|
|
|
190
190
|
this['ngUnsubscribe'].complete();
|
|
191
191
|
super.ngOnDestroy();
|
|
192
192
|
}
|
|
193
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
194
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.
|
|
193
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: AbstractFormAliasBaseComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
194
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.7", type: AbstractFormAliasBaseComponent, isStandalone: true, selector: "ng-component", usesInheritance: true, ngImport: i0, template: '', isInline: true });
|
|
195
195
|
}
|
|
196
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
196
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: AbstractFormAliasBaseComponent, decorators: [{
|
|
197
197
|
type: Component,
|
|
198
198
|
args: [{
|
|
199
199
|
template: '',
|
package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-form-array-base.mjs
CHANGED
|
@@ -123,7 +123,7 @@ class AbstractFormArrayBaseComponent extends AbstractFormBaseComponent {
|
|
|
123
123
|
*/
|
|
124
124
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
125
125
|
getControlValueOrDefault(control, defaultValue) {
|
|
126
|
-
return control?.value
|
|
126
|
+
return control?.value ?? defaultValue;
|
|
127
127
|
}
|
|
128
128
|
/**
|
|
129
129
|
* Removes a form array control at the specified index and updates the form array controls and errors.
|
|
@@ -234,10 +234,10 @@ class AbstractFormArrayBaseComponent extends AbstractFormBaseComponent {
|
|
|
234
234
|
this.ngUnsubscribe.complete();
|
|
235
235
|
super.ngOnDestroy();
|
|
236
236
|
}
|
|
237
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
238
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.
|
|
237
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: AbstractFormArrayBaseComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
238
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.7", type: AbstractFormArrayBaseComponent, isStandalone: true, selector: "ng-component", usesInheritance: true, ngImport: i0, template: '', isInline: true });
|
|
239
239
|
}
|
|
240
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
240
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: AbstractFormArrayBaseComponent, decorators: [{
|
|
241
241
|
type: Component,
|
|
242
242
|
args: [{
|
|
243
243
|
template: '',
|
package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-form-array-base.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hmcts-opal-frontend-common-components-abstract-abstract-form-array-base.mjs","sources":["../../../projects/opal-frontend-common/components/abstract/abstract-form-array-base/abstract-form-array-base.component.ts","../../../projects/opal-frontend-common/components/abstract/abstract-form-array-base/hmcts-opal-frontend-common-components-abstract-abstract-form-array-base.ts"],"sourcesContent":["import { Component, OnDestroy, OnInit } from '@angular/core';\nimport { AbstractFormBaseComponent } from '@hmcts/opal-frontend-common/components/abstract/abstract-form-base';\nimport {\n IAbstractFormArrayControls,\n IAbstractFormArrayControlValidation,\n IAbstractFormArrayControl,\n} from '@hmcts/opal-frontend-common/components/abstract/interfaces';\nimport { AbstractControl, FormArray, FormControl, FormGroup, ValidatorFn } from '@angular/forms';\n\n@Component({\n template: '',\n})\nexport abstract class AbstractFormArrayBaseComponent extends AbstractFormBaseComponent implements OnInit, OnDestroy {\n public formArrayControls: IAbstractFormArrayControls[] = [];\n public formArrayControlsValidation: IAbstractFormArrayControlValidation[] = [];\n public formArrayFields: string[] = [];\n\n /**\n * Builds an array of form controls for a 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 for the form controls.\n * @param controlValidation - An array of control validation configurations.\n * @returns An array of form controls for the form array.\n */\n private buildFormArrayControls(\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.addFormArrayControls(index, formArrayName, fieldNames, controlValidation),\n );\n }\n\n /**\n * Adds form array controls to the specified form array.\n *\n * @param index - The index at which the form array controls should be added.\n * @param formArrayName - The name of the form array.\n * @param fieldNames - The names of the form controls to be created.\n * @param controlValidation - The validation rules for the form controls.\n * @returns An object containing the form controls that were added.\n */\n private addFormArrayControls(\n index: number,\n formArrayName: string,\n fieldNames: string[],\n controlValidation: IAbstractFormArrayControlValidation[],\n ): { [key: string]: IAbstractFormArrayControl } {\n const formArray = this.form.get(formArrayName) as FormArray;\n const formArrayFormGroup = new FormGroup({});\n\n // Create the form controls...\n const controls = this.createFormArrayControls(fieldNames, index);\n\n // Add the controls to the form group...\n this.addControlsToFormGroup(formArrayFormGroup, controlValidation, index);\n\n // Add the form group to the form array...\n formArray.push(formArrayFormGroup);\n\n // Return the form controls...\n return controls;\n }\n\n /**\n * Creates a new instance of FormArray with the specified validators and controls.\n *\n * @param validators - An array of validator functions to be applied to the form array.\n * @param controls - An optional array of form controls to initialize the form array with.\n * @returns A new instance of FormArray.\n */\n protected createFormArray(validators: ValidatorFn[], controls: FormControl[] = []): FormArray {\n return new FormArray(controls, { validators: [...validators] });\n }\n\n /**\n * Sets up the form array form controls based on the provided parameters.\n *\n * @param formArrayCountArray - An array of numbers representing the count of form array controls.\n * @param formArrayName - The name of the form array.\n */\n protected setupFormArrayFormControls(formArrayCountArray: number[], formArrayName: string): void {\n if (formArrayCountArray.length) {\n this.formArrayControls = this.buildFormArrayControls(\n formArrayCountArray,\n formArrayName,\n this.formArrayFields,\n this.formArrayControlsValidation,\n );\n }\n }\n\n /**\n * Creates an object with form array controls based on the given fields and index.\n *\n * @param fields - An array of field names.\n * @param index - The index of the form array.\n * @returns An object with form array controls.\n */\n protected createFormArrayControls(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 * Removes form array controls errors for a specific index.\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 removeFormArrayControlsErrors(\n index: number,\n formArrayControls: IAbstractFormArrayControls[],\n fieldNames: string[],\n ): void {\n const formArrayControl = formArrayControls[index];\n\n if (formArrayControl) {\n fieldNames.forEach((field) => {\n delete this.formControlErrorMessages?.[formArrayControl[field].controlName];\n });\n }\n }\n\n /**\n * Adds controls to the form array at the specified index.\n *\n * @param index - The index at which the controls should be added.\n * @param formArrayName - The name of the form array.\n */\n public addControlsToFormArray(index: number, formArrayName: string): void {\n this.formArrayControls.push(\n this.addFormArrayControls(index, formArrayName, this.formArrayFields, this.formArrayControlsValidation),\n );\n }\n\n /**\n * Removes a form array control at the specified index from the given array of form array controls.\n *\n * @param index - The index of the form array control to be removed.\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 removeFormArrayControl(\n index: number,\n formArrayControls: IAbstractFormArrayControls[],\n ): IAbstractFormArrayControls[] {\n formArrayControls.splice(index, 1);\n return formArrayControls;\n }\n\n /**\n * Retrieves the value of a form control or returns a default value if the control is null or undefined.\n *\n * @param control - The form control to retrieve the value from.\n * @param defaultValue - The default value to return if the control is null or undefined.\n * @returns The value of the control if it exists, otherwise the default value.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n protected getControlValueOrDefault(control: AbstractControl | null, defaultValue: any): any {\n return control?.value || defaultValue;\n }\n\n /**\n * Removes a form array control at the specified index and updates the form array controls and errors.\n *\n * @param index - The index of the form array control to remove.\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.\n */\n public removeFormArrayControls(\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.removeFormArrayControlsErrors(index, formArrayControls, fieldNames);\n\n // Return the new list of form array controls...\n return this.removeFormArrayControl(index, formArrayControls);\n }\n\n /**\n * Removes controls from a form array at the specified index.\n *\n * @param index - The index at which to remove the controls.\n * @param formArrayName - The name of the form array.\n */\n public removeControlsFromFormArray(index: number, formArrayName: string): void {\n this.formArrayControls = this.removeFormArrayControls(\n index,\n formArrayName,\n this.formArrayControls,\n this.formArrayFields,\n );\n }\n\n /**\n * Removes a form array control from the specified form array.\n *\n * @param formArrayControl - The form array control to remove.\n * @param formArrayName - The name of the form array.\n */\n public removeFormArrayControlFromArray(formArrayControl: IAbstractFormArrayControls, formArrayName: string): void {\n const formArrayControlIndex = this.formArrayControls.findIndex((control) => control === formArrayControl);\n this.removeFormArrayControls(formArrayControlIndex, formArrayName, this.formArrayControls, this.formArrayFields);\n }\n\n /**\n * Retrieves the FormGroup at the specified index from a FormArray.\n *\n * @param index - The index of the FormGroup to retrieve.\n * @param formArrayName - The name of the FormArray.\n * @returns The FormGroup at the specified index.\n */\n public getFormArrayFormGroup(index: number, formArrayName: string): FormGroup {\n const formArray = this.form.get(formArrayName) as FormArray;\n return formArray.controls[index] as FormGroup;\n }\n\n /**\n * Retrieves the FormControl from a FormGroup within a FormArray at the specified index.\n *\n * @param formGroup - The FormGroup containing the FormControl.\n * @param controlName - The name of the FormControl.\n * @param index - The index of the FormArray.\n * @returns The FormControl at the specified index.\n */\n public getFormArrayFormGroupControl(formGroup: FormGroup, controlName: string, index: number): FormControl {\n return formGroup.controls[`${controlName}_${index}`] as FormControl;\n }\n\n /**\n * Adds validators to a specific form control within a form array group.\n *\n * @param formGroup - The form group containing the form array.\n * @param controlName - The name of the form control within the form array group.\n * @param index - The index of the form array group within the form array.\n * @param validators - An array of validator functions to be added to the form control.\n */\n public addFormArrayFormGroupControlValidators(formControl: FormControl, validators: ValidatorFn[]): void {\n formControl.setValidators(validators);\n formControl.updateValueAndValidity({ emitEvent: false });\n }\n\n /**\n * Removes validators from a specific form control within a form array group.\n * @param formGroup - The form group containing the form array.\n * @param controlName - The name of the form control within the form array group.\n * @param index - The index of the form array group within the form array.\n */\n public removeFormArrayFormGroupControlValidators(formControl: FormControl): void {\n formControl.clearValidators();\n formControl.setErrors(null);\n formControl.setValue(null, { emitEvent: false });\n formControl.updateValueAndValidity({ emitEvent: false });\n }\n\n /**\n * Reverses the form array data by appending the index to each key in the objects.\n *\n * @param data - An array of objects containing form data.\n * @returns An array of objects with keys modified to include their index in the original array.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public addIndexToFormArrayData(data: any[]): { [key: string]: any }[] {\n return data.map((item, index) =>\n Object.entries(item).reduce(\n (indexedObject, [key, value]) => {\n if (value !== undefined) {\n indexedObject[`${key}_${index}`] = value;\n }\n return indexedObject;\n },\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n {} as { [key: string]: any },\n ),\n );\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":";;;;;AAYM,MAAgB,8BAA+B,SAAQ,yBAAyB,CAAA;IAC7E,iBAAiB,GAAiC,EAAE;IACpD,2BAA2B,GAA0C,EAAE;IACvE,eAAe,GAAa,EAAE;AAErC;;;;;;;;AAQG;AACK,IAAA,sBAAsB,CAC5B,gBAA0B,EAC1B,aAAqB,EACrB,UAAoB,EACpB,iBAAwD,EAAA;;QAGxD,OAAO,gBAAgB,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,KAAK,KAC1C,IAAI,CAAC,oBAAoB,CAAC,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,iBAAiB,CAAC,CAC/E;;AAGH;;;;;;;;AAQG;AACK,IAAA,oBAAoB,CAC1B,KAAa,EACb,aAAqB,EACrB,UAAoB,EACpB,iBAAwD,EAAA;QAExD,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,aAAa,CAAc;AAC3D,QAAA,MAAM,kBAAkB,GAAG,IAAI,SAAS,CAAC,EAAE,CAAC;;QAG5C,MAAM,QAAQ,GAAG,IAAI,CAAC,uBAAuB,CAAC,UAAU,EAAE,KAAK,CAAC;;QAGhE,IAAI,CAAC,sBAAsB,CAAC,kBAAkB,EAAE,iBAAiB,EAAE,KAAK,CAAC;;AAGzE,QAAA,SAAS,CAAC,IAAI,CAAC,kBAAkB,CAAC;;AAGlC,QAAA,OAAO,QAAQ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,IAAI,KAAK,KAAK,SAAS,EAAE;gBACvB,aAAa,CAAC,GAAG,GAAG,CAAA,CAAA,EAAI,KAAK,CAAE,CAAA,CAAC,GAAG,KAAK;;AAE1C,YAAA,OAAO,aAAa;SACrB;;QAED,EAA4B,CAC7B,CACF;;IAGa,QAAQ,GAAA;QACtB,KAAK,CAAC,QAAQ,EAAE;;IAGF,WAAW,GAAA;AACzB,QAAA,IAAI,CAAC,aAAa,CAAC,IAAI,EAAE;AACzB,QAAA,IAAI,CAAC,aAAa,CAAC,QAAQ,EAAE;QAC7B,KAAK,CAAC,WAAW,EAAE;;uGA3SD,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;;;ACXD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"hmcts-opal-frontend-common-components-abstract-abstract-form-array-base.mjs","sources":["../../../projects/opal-frontend-common/components/abstract/abstract-form-array-base/abstract-form-array-base.component.ts","../../../projects/opal-frontend-common/components/abstract/abstract-form-array-base/hmcts-opal-frontend-common-components-abstract-abstract-form-array-base.ts"],"sourcesContent":["import { Component, OnDestroy, OnInit } from '@angular/core';\nimport { AbstractFormBaseComponent } from '@hmcts/opal-frontend-common/components/abstract/abstract-form-base';\nimport {\n IAbstractFormArrayControls,\n IAbstractFormArrayControlValidation,\n IAbstractFormArrayControl,\n} from '@hmcts/opal-frontend-common/components/abstract/interfaces';\nimport { AbstractControl, FormArray, FormControl, FormGroup, ValidatorFn } from '@angular/forms';\n\n@Component({\n template: '',\n})\nexport abstract class AbstractFormArrayBaseComponent extends AbstractFormBaseComponent implements OnInit, OnDestroy {\n public formArrayControls: IAbstractFormArrayControls[] = [];\n public formArrayControlsValidation: IAbstractFormArrayControlValidation[] = [];\n public formArrayFields: string[] = [];\n\n /**\n * Builds an array of form controls for a 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 for the form controls.\n * @param controlValidation - An array of control validation configurations.\n * @returns An array of form controls for the form array.\n */\n private buildFormArrayControls(\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.addFormArrayControls(index, formArrayName, fieldNames, controlValidation),\n );\n }\n\n /**\n * Adds form array controls to the specified form array.\n *\n * @param index - The index at which the form array controls should be added.\n * @param formArrayName - The name of the form array.\n * @param fieldNames - The names of the form controls to be created.\n * @param controlValidation - The validation rules for the form controls.\n * @returns An object containing the form controls that were added.\n */\n private addFormArrayControls(\n index: number,\n formArrayName: string,\n fieldNames: string[],\n controlValidation: IAbstractFormArrayControlValidation[],\n ): { [key: string]: IAbstractFormArrayControl } {\n const formArray = this.form.get(formArrayName) as FormArray;\n const formArrayFormGroup = new FormGroup({});\n\n // Create the form controls...\n const controls = this.createFormArrayControls(fieldNames, index);\n\n // Add the controls to the form group...\n this.addControlsToFormGroup(formArrayFormGroup, controlValidation, index);\n\n // Add the form group to the form array...\n formArray.push(formArrayFormGroup);\n\n // Return the form controls...\n return controls;\n }\n\n /**\n * Creates a new instance of FormArray with the specified validators and controls.\n *\n * @param validators - An array of validator functions to be applied to the form array.\n * @param controls - An optional array of form controls to initialize the form array with.\n * @returns A new instance of FormArray.\n */\n protected createFormArray(validators: ValidatorFn[], controls: FormControl[] = []): FormArray {\n return new FormArray(controls, { validators: [...validators] });\n }\n\n /**\n * Sets up the form array form controls based on the provided parameters.\n *\n * @param formArrayCountArray - An array of numbers representing the count of form array controls.\n * @param formArrayName - The name of the form array.\n */\n protected setupFormArrayFormControls(formArrayCountArray: number[], formArrayName: string): void {\n if (formArrayCountArray.length) {\n this.formArrayControls = this.buildFormArrayControls(\n formArrayCountArray,\n formArrayName,\n this.formArrayFields,\n this.formArrayControlsValidation,\n );\n }\n }\n\n /**\n * Creates an object with form array controls based on the given fields and index.\n *\n * @param fields - An array of field names.\n * @param index - The index of the form array.\n * @returns An object with form array controls.\n */\n protected createFormArrayControls(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 * Removes form array controls errors for a specific index.\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 removeFormArrayControlsErrors(\n index: number,\n formArrayControls: IAbstractFormArrayControls[],\n fieldNames: string[],\n ): void {\n const formArrayControl = formArrayControls[index];\n\n if (formArrayControl) {\n fieldNames.forEach((field) => {\n delete this.formControlErrorMessages?.[formArrayControl[field].controlName];\n });\n }\n }\n\n /**\n * Adds controls to the form array at the specified index.\n *\n * @param index - The index at which the controls should be added.\n * @param formArrayName - The name of the form array.\n */\n public addControlsToFormArray(index: number, formArrayName: string): void {\n this.formArrayControls.push(\n this.addFormArrayControls(index, formArrayName, this.formArrayFields, this.formArrayControlsValidation),\n );\n }\n\n /**\n * Removes a form array control at the specified index from the given array of form array controls.\n *\n * @param index - The index of the form array control to be removed.\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 removeFormArrayControl(\n index: number,\n formArrayControls: IAbstractFormArrayControls[],\n ): IAbstractFormArrayControls[] {\n formArrayControls.splice(index, 1);\n return formArrayControls;\n }\n\n /**\n * Retrieves the value of a form control or returns a default value if the control is null or undefined.\n *\n * @param control - The form control to retrieve the value from.\n * @param defaultValue - The default value to return if the control is null or undefined.\n * @returns The value of the control if it exists, otherwise the default value.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n protected getControlValueOrDefault(control: AbstractControl | null, defaultValue: any): any {\n return control?.value ?? defaultValue;\n }\n\n /**\n * Removes a form array control at the specified index and updates the form array controls and errors.\n *\n * @param index - The index of the form array control to remove.\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.\n */\n public removeFormArrayControls(\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.removeFormArrayControlsErrors(index, formArrayControls, fieldNames);\n\n // Return the new list of form array controls...\n return this.removeFormArrayControl(index, formArrayControls);\n }\n\n /**\n * Removes controls from a form array at the specified index.\n *\n * @param index - The index at which to remove the controls.\n * @param formArrayName - The name of the form array.\n */\n public removeControlsFromFormArray(index: number, formArrayName: string): void {\n this.formArrayControls = this.removeFormArrayControls(\n index,\n formArrayName,\n this.formArrayControls,\n this.formArrayFields,\n );\n }\n\n /**\n * Removes a form array control from the specified form array.\n *\n * @param formArrayControl - The form array control to remove.\n * @param formArrayName - The name of the form array.\n */\n public removeFormArrayControlFromArray(formArrayControl: IAbstractFormArrayControls, formArrayName: string): void {\n const formArrayControlIndex = this.formArrayControls.findIndex((control) => control === formArrayControl);\n this.removeFormArrayControls(formArrayControlIndex, formArrayName, this.formArrayControls, this.formArrayFields);\n }\n\n /**\n * Retrieves the FormGroup at the specified index from a FormArray.\n *\n * @param index - The index of the FormGroup to retrieve.\n * @param formArrayName - The name of the FormArray.\n * @returns The FormGroup at the specified index.\n */\n public getFormArrayFormGroup(index: number, formArrayName: string): FormGroup {\n const formArray = this.form.get(formArrayName) as FormArray;\n return formArray.controls[index] as FormGroup;\n }\n\n /**\n * Retrieves the FormControl from a FormGroup within a FormArray at the specified index.\n *\n * @param formGroup - The FormGroup containing the FormControl.\n * @param controlName - The name of the FormControl.\n * @param index - The index of the FormArray.\n * @returns The FormControl at the specified index.\n */\n public getFormArrayFormGroupControl(formGroup: FormGroup, controlName: string, index: number): FormControl {\n return formGroup.controls[`${controlName}_${index}`] as FormControl;\n }\n\n /**\n * Adds validators to a specific form control within a form array group.\n *\n * @param formGroup - The form group containing the form array.\n * @param controlName - The name of the form control within the form array group.\n * @param index - The index of the form array group within the form array.\n * @param validators - An array of validator functions to be added to the form control.\n */\n public addFormArrayFormGroupControlValidators(formControl: FormControl, validators: ValidatorFn[]): void {\n formControl.setValidators(validators);\n formControl.updateValueAndValidity({ emitEvent: false });\n }\n\n /**\n * Removes validators from a specific form control within a form array group.\n * @param formGroup - The form group containing the form array.\n * @param controlName - The name of the form control within the form array group.\n * @param index - The index of the form array group within the form array.\n */\n public removeFormArrayFormGroupControlValidators(formControl: FormControl): void {\n formControl.clearValidators();\n formControl.setErrors(null);\n formControl.setValue(null, { emitEvent: false });\n formControl.updateValueAndValidity({ emitEvent: false });\n }\n\n /**\n * Reverses the form array data by appending the index to each key in the objects.\n *\n * @param data - An array of objects containing form data.\n * @returns An array of objects with keys modified to include their index in the original array.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public addIndexToFormArrayData(data: any[]): { [key: string]: any }[] {\n return data.map((item, index) =>\n Object.entries(item).reduce(\n (indexedObject, [key, value]) => {\n if (value !== undefined) {\n indexedObject[`${key}_${index}`] = value;\n }\n return indexedObject;\n },\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n {} as { [key: string]: any },\n ),\n );\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":";;;;;AAYM,MAAgB,8BAA+B,SAAQ,yBAAyB,CAAA;IAC7E,iBAAiB,GAAiC,EAAE;IACpD,2BAA2B,GAA0C,EAAE;IACvE,eAAe,GAAa,EAAE;AAErC;;;;;;;;AAQG;AACK,IAAA,sBAAsB,CAC5B,gBAA0B,EAC1B,aAAqB,EACrB,UAAoB,EACpB,iBAAwD,EAAA;;QAGxD,OAAO,gBAAgB,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,KAAK,KAC1C,IAAI,CAAC,oBAAoB,CAAC,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,iBAAiB,CAAC,CAC/E;;AAGH;;;;;;;;AAQG;AACK,IAAA,oBAAoB,CAC1B,KAAa,EACb,aAAqB,EACrB,UAAoB,EACpB,iBAAwD,EAAA;QAExD,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,aAAa,CAAc;AAC3D,QAAA,MAAM,kBAAkB,GAAG,IAAI,SAAS,CAAC,EAAE,CAAC;;QAG5C,MAAM,QAAQ,GAAG,IAAI,CAAC,uBAAuB,CAAC,UAAU,EAAE,KAAK,CAAC;;QAGhE,IAAI,CAAC,sBAAsB,CAAC,kBAAkB,EAAE,iBAAiB,EAAE,KAAK,CAAC;;AAGzE,QAAA,SAAS,CAAC,IAAI,CAAC,kBAAkB,CAAC;;AAGlC,QAAA,OAAO,QAAQ;;AAGjB;;;;;;AAMG;AACO,IAAA,eAAe,CAAC,UAAyB,EAAE,QAAA,GAA0B,EAAE,EAAA;AAC/E,QAAA,OAAO,IAAI,SAAS,CAAC,QAAQ,EAAE,EAAE,UAAU,EAAE,CAAC,GAAG,UAAU,CAAC,EAAE,CAAC;;AAGjE;;;;;AAKG;IACO,0BAA0B,CAAC,mBAA6B,EAAE,aAAqB,EAAA;AACvF,Q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,CAAC,aAAa,CAAC,IAAI,EAAE;AACzB,QAAA,IAAI,CAAC,aAAa,CAAC,QAAQ,EAAE;QAC7B,KAAK,CAAC,WAAW,EAAE;;uGA3SD,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;;;ACXD;;AAEG;;;;"}
|
package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-form-array-parent-base.mjs
CHANGED
|
@@ -22,12 +22,12 @@ class AbstractFormArrayParentBaseComponent extends AbstractFormParentBaseCompone
|
|
|
22
22
|
const [_, baseKey, index] = match;
|
|
23
23
|
const idx = parseInt(index, 10);
|
|
24
24
|
currentIndex = idx; // Set the current index based on the last indexed key
|
|
25
|
-
result[idx] = result[idx]
|
|
25
|
+
result[idx] = result[idx] ?? {};
|
|
26
26
|
result[idx][baseKey] = indexedObject[key];
|
|
27
27
|
}
|
|
28
28
|
else {
|
|
29
29
|
// For non-indexed keys, use the currentIndex if available
|
|
30
|
-
result[currentIndex] = result[currentIndex]
|
|
30
|
+
result[currentIndex] = result[currentIndex] ?? {};
|
|
31
31
|
result[currentIndex][key] = indexedObject[key];
|
|
32
32
|
}
|
|
33
33
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hmcts-opal-frontend-common-components-abstract-abstract-form-array-parent-base.mjs","sources":["../../../projects/opal-frontend-common/components/abstract/abstract-form-array-parent-base/abstract-form-array-parent-base.component.ts","../../../projects/opal-frontend-common/components/abstract/abstract-form-array-parent-base/hmcts-opal-frontend-common-components-abstract-abstract-form-array-parent-base.ts"],"sourcesContent":["import { AbstractFormParentBaseComponent } from '@hmcts/opal-frontend-common/components/abstract/abstract-form-parent-base';\n\nexport abstract class AbstractFormArrayParentBaseComponent extends AbstractFormParentBaseComponent {\n /**\n * Removes index suffixes from keys in an array of objects and restructures the data.\n *\n * This function takes an array of objects where keys have an index suffix (e.g., `key_0`, `key_1`),\n * and returns a new array of objects where the keys are grouped by their base name without the index.\n *\n * @param data - The array of objects with indexed keys.\n * @returns A new array of objects with keys grouped by their base name.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public removeIndexFromFormArrayData(data: any[]): any[] {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return data.reduce((result: any[], indexedObject) => {\n let currentIndex!: number;\n Object.keys(indexedObject).forEach((key) => {\n const match = RegExp(/^(.*)_(\\d+)$/).exec(key);\n if (match) {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const [_, baseKey, index] = match;\n const idx = parseInt(index, 10);\n\n currentIndex = idx; // Set the current index based on the last indexed key\n\n result[idx] = result[idx]
|
|
1
|
+
{"version":3,"file":"hmcts-opal-frontend-common-components-abstract-abstract-form-array-parent-base.mjs","sources":["../../../projects/opal-frontend-common/components/abstract/abstract-form-array-parent-base/abstract-form-array-parent-base.component.ts","../../../projects/opal-frontend-common/components/abstract/abstract-form-array-parent-base/hmcts-opal-frontend-common-components-abstract-abstract-form-array-parent-base.ts"],"sourcesContent":["import { AbstractFormParentBaseComponent } from '@hmcts/opal-frontend-common/components/abstract/abstract-form-parent-base';\n\nexport abstract class AbstractFormArrayParentBaseComponent extends AbstractFormParentBaseComponent {\n /**\n * Removes index suffixes from keys in an array of objects and restructures the data.\n *\n * This function takes an array of objects where keys have an index suffix (e.g., `key_0`, `key_1`),\n * and returns a new array of objects where the keys are grouped by their base name without the index.\n *\n * @param data - The array of objects with indexed keys.\n * @returns A new array of objects with keys grouped by their base name.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public removeIndexFromFormArrayData(data: any[]): any[] {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return data.reduce((result: any[], indexedObject) => {\n let currentIndex!: number;\n Object.keys(indexedObject).forEach((key) => {\n const match = RegExp(/^(.*)_(\\d+)$/).exec(key);\n if (match) {\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const [_, baseKey, index] = match;\n const idx = parseInt(index, 10);\n\n currentIndex = idx; // Set the current index based on the last indexed key\n\n result[idx] = result[idx] ?? {};\n result[idx][baseKey] = indexedObject[key];\n } else {\n // For non-indexed keys, use the currentIndex if available\n result[currentIndex] = result[currentIndex] ?? {};\n result[currentIndex][key] = indexedObject[key];\n }\n });\n return result;\n }, []);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;AAEM,MAAgB,oCAAqC,SAAQ,+BAA+B,CAAA;AAChG;;;;;;;;AAQG;;AAEI,IAAA,4BAA4B,CAAC,IAAW,EAAA;;QAE7C,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,MAAa,EAAE,aAAa,KAAI;AAClD,YAAA,IAAI,YAAqB;YACzB,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,KAAI;gBACzC,MAAM,KAAK,GAAG,MAAM,CAAC,cAAc,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;gBAC9C,IAAI,KAAK,EAAE;;oBAET,MAAM,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,GAAG,KAAK;oBACjC,MAAM,GAAG,GAAG,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAC;AAE/B,oBAAA,YAAY,GAAG,GAAG,CAAC;oBAEnB,MAAM,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,IAAI,EAAE;oBAC/B,MAAM,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,GAAG,aAAa,CAAC,GAAG,CAAC;;qBACpC;;oBAEL,MAAM,CAAC,YAAY,CAAC,GAAG,MAAM,CAAC,YAAY,CAAC,IAAI,EAAE;oBACjD,MAAM,CAAC,YAAY,CAAC,CAAC,GAAG,CAAC,GAAG,aAAa,CAAC,GAAG,CAAC;;AAElD,aAAC,CAAC;AACF,YAAA,OAAO,MAAM;SACd,EAAE,EAAE,CAAC;;AAET;;ACrCD;;AAEG;;;;"}
|
package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-form-array-removal-base.mjs
CHANGED
|
@@ -77,10 +77,10 @@ class AbstractFormArrayRemovalComponent {
|
|
|
77
77
|
this.router.navigate([route], { relativeTo: this.activatedRoute.parent });
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
81
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.
|
|
80
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: AbstractFormArrayRemovalComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
81
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.7", type: AbstractFormArrayRemovalComponent, isStandalone: true, selector: "ng-component", ngImport: i0, template: '', isInline: true });
|
|
82
82
|
}
|
|
83
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
83
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: AbstractFormArrayRemovalComponent, decorators: [{
|
|
84
84
|
type: Component,
|
|
85
85
|
args: [{
|
|
86
86
|
template: '',
|
|
@@ -471,10 +471,10 @@ class AbstractFormBaseComponent {
|
|
|
471
471
|
this.ngUnsubscribe.next();
|
|
472
472
|
this.ngUnsubscribe.complete();
|
|
473
473
|
}
|
|
474
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
475
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.
|
|
474
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: AbstractFormBaseComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
475
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.7", type: AbstractFormBaseComponent, isStandalone: true, selector: "ng-component", outputs: { unsavedChanges: "unsavedChanges", formSubmit: "formSubmit" }, ngImport: i0, template: '', isInline: true });
|
|
476
476
|
}
|
|
477
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
477
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: AbstractFormBaseComponent, decorators: [{
|
|
478
478
|
type: Component,
|
|
479
479
|
args: [{
|
|
480
480
|
template: '',
|
|
@@ -45,10 +45,10 @@ class AbstractSortableTablePaginationComponent extends AbstractSortableTableComp
|
|
|
45
45
|
const totalPages = Math.ceil(this.abstractTableDataSignal().length / this.itemsPerPageSignal());
|
|
46
46
|
this.currentPageSignal.set(Math.max(1, Math.min(newPage, totalPages)));
|
|
47
47
|
}
|
|
48
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
49
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.
|
|
48
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: AbstractSortableTablePaginationComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
49
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.7", type: AbstractSortableTablePaginationComponent, isStandalone: true, selector: "ng-component", usesInheritance: true, ngImport: i0, template: '', isInline: true });
|
|
50
50
|
}
|
|
51
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
51
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: AbstractSortableTablePaginationComponent, decorators: [{
|
|
52
52
|
type: Component,
|
|
53
53
|
args: [{
|
|
54
54
|
template: '',
|
|
@@ -125,10 +125,10 @@ class AbstractSortableTableComponent {
|
|
|
125
125
|
ngOnInit() {
|
|
126
126
|
this.initialiseSortState();
|
|
127
127
|
}
|
|
128
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
129
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.
|
|
128
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: AbstractSortableTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
129
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.7", type: AbstractSortableTableComponent, isStandalone: true, selector: "ng-component", outputs: { abstractSortState: "abstractSortState" }, ngImport: i0, template: '', isInline: true });
|
|
130
130
|
}
|
|
131
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
131
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: AbstractSortableTableComponent, decorators: [{
|
|
132
132
|
type: Component,
|
|
133
133
|
args: [{
|
|
134
134
|
template: '',
|
package/fesm2022/hmcts-opal-frontend-common-components-alphagov-alphagov-accessible-autocomplete.mjs
CHANGED
|
@@ -120,10 +120,10 @@ class AlphagovAccessibleAutocompleteComponent {
|
|
|
120
120
|
this.ngUnsubscribe.next();
|
|
121
121
|
this.ngUnsubscribe.complete();
|
|
122
122
|
}
|
|
123
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
124
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.
|
|
123
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: AlphagovAccessibleAutocompleteComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
124
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.7", type: AlphagovAccessibleAutocompleteComponent, isStandalone: true, selector: "opal-lib-alphagov-accessible-autocomplete", inputs: { labelText: "labelText", labelClasses: "labelClasses", inputId: "inputId", inputName: "inputName", inputClasses: "inputClasses", hintText: "hintText", autoCompleteItems: "autoCompleteItems", showAllValues: "showAllValues", errors: "errors", control: "control" }, viewQueries: [{ propertyName: "autocompleteContainer", first: true, predicate: ["autocomplete"], descendants: true }], ngImport: i0, template: "<div class=\"govuk-form-group\" [class.govuk-form-group--error]=\"!!errors\">\n <label class=\"govuk-label {{ labelClasses }}\" [for]=\"autoCompleteId\"> {{ labelText }} </label>\n @if (hintText) {\n <div id=\"{{ inputId }}-hint\" class=\"govuk-hint\">\n {{ hintText }}\n </div>\n }\n\n @if (errors) {\n <p id=\"{{ this.autoCompleteId }}-error-message\" class=\"govuk-error-message\">\n <span class=\"govuk-visually-hidden\">Error: </span> {{ errors }}\n </p>\n }\n\n <div #autocomplete id=\"{{ autoCompleteId }}-container\" class=\"{{ inputClasses }}\"></div>\n <input [id]=\"inputId\" [name]=\"inputName\" type=\"hidden\" [formControl]=\"getControl\" />\n</div>\n", styles: [":host ::ng-deep .autocomplete__option{font-family:GDS Transport,arial,sans-serif}:host ::ng-deep .govuk-input--error input{border-color:#d4351c}:host ::ng-deep .autocomplete__input{background-color:#fff}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
125
125
|
}
|
|
126
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
126
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: AlphagovAccessibleAutocompleteComponent, decorators: [{
|
|
127
127
|
type: Component,
|
|
128
128
|
args: [{ selector: 'opal-lib-alphagov-accessible-autocomplete', imports: [ReactiveFormsModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"govuk-form-group\" [class.govuk-form-group--error]=\"!!errors\">\n <label class=\"govuk-label {{ labelClasses }}\" [for]=\"autoCompleteId\"> {{ labelText }} </label>\n @if (hintText) {\n <div id=\"{{ inputId }}-hint\" class=\"govuk-hint\">\n {{ hintText }}\n </div>\n }\n\n @if (errors) {\n <p id=\"{{ this.autoCompleteId }}-error-message\" class=\"govuk-error-message\">\n <span class=\"govuk-visually-hidden\">Error: </span> {{ errors }}\n </p>\n }\n\n <div #autocomplete id=\"{{ autoCompleteId }}-container\" class=\"{{ inputClasses }}\"></div>\n <input [id]=\"inputId\" [name]=\"inputName\" type=\"hidden\" [formControl]=\"getControl\" />\n</div>\n", styles: [":host ::ng-deep .autocomplete__option{font-family:GDS Transport,arial,sans-serif}:host ::ng-deep .govuk-input--error input{border-color:#d4351c}:host ::ng-deep .autocomplete__input{background-color:#fff}\n"] }]
|
|
129
129
|
}], ctorParameters: () => [], propDecorators: { labelText: [{
|
|
@@ -16,10 +16,10 @@ class GovukAccordionComponent {
|
|
|
16
16
|
});
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
20
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.
|
|
19
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: GovukAccordionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
20
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.7", type: GovukAccordionComponent, isStandalone: true, selector: "opal-lib-govuk-accordion", ngImport: i0, template: "<div class=\"govuk-accordion\" data-module=\"govuk-accordion\" id=\"accordion-default\">\n <div class=\"govuk-accordion__section\">\n <div class=\"govuk-accordion__section-header\">\n <h2 class=\"govuk-accordion__section-heading\">\n <span class=\"govuk-accordion__section-button\" id=\"accordion-default-heading-1\"> Writing well for the web </span>\n </h2>\n </div>\n <div\n id=\"accordion-default-content-1\"\n class=\"govuk-accordion__section-content\"\n aria-labelledby=\"accordion-default-heading-1\"\n >\n <p class=\"govuk-body\">This is the content for Writing well for the web.</p>\n </div>\n </div>\n <div class=\"govuk-accordion__section\">\n <div class=\"govuk-accordion__section-header\">\n <h2 class=\"govuk-accordion__section-heading\">\n <span class=\"govuk-accordion__section-button\" id=\"accordion-default-heading-2\">\n Writing well for specialists\n </span>\n </h2>\n </div>\n <div\n id=\"accordion-default-content-2\"\n class=\"govuk-accordion__section-content\"\n aria-labelledby=\"accordion-default-heading-2\"\n >\n <p class=\"govuk-body\">This is the content for Writing well for specialists.</p>\n </div>\n </div>\n <div class=\"govuk-accordion__section\">\n <div class=\"govuk-accordion__section-header\">\n <h2 class=\"govuk-accordion__section-heading\">\n <span class=\"govuk-accordion__section-button\" id=\"accordion-default-heading-3\"> Know your audience </span>\n </h2>\n </div>\n <div\n id=\"accordion-default-content-3\"\n class=\"govuk-accordion__section-content\"\n aria-labelledby=\"accordion-default-heading-3\"\n >\n <p class=\"govuk-body\">This is the content for Know your audience.</p>\n </div>\n </div>\n <div class=\"govuk-accordion__section\">\n <div class=\"govuk-accordion__section-header\">\n <h2 class=\"govuk-accordion__section-heading\">\n <span class=\"govuk-accordion__section-button\" id=\"accordion-default-heading-4\"> How people read </span>\n </h2>\n </div>\n <div\n id=\"accordion-default-content-4\"\n class=\"govuk-accordion__section-content\"\n aria-labelledby=\"accordion-default-heading-4\"\n >\n <p class=\"govuk-body\">This is the content for How people read.</p>\n </div>\n </div>\n</div>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
21
21
|
}
|
|
22
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
22
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: GovukAccordionComponent, decorators: [{
|
|
23
23
|
type: Component,
|
|
24
24
|
args: [{ selector: 'opal-lib-govuk-accordion', imports: [CommonModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"govuk-accordion\" data-module=\"govuk-accordion\" id=\"accordion-default\">\n <div class=\"govuk-accordion__section\">\n <div class=\"govuk-accordion__section-header\">\n <h2 class=\"govuk-accordion__section-heading\">\n <span class=\"govuk-accordion__section-button\" id=\"accordion-default-heading-1\"> Writing well for the web </span>\n </h2>\n </div>\n <div\n id=\"accordion-default-content-1\"\n class=\"govuk-accordion__section-content\"\n aria-labelledby=\"accordion-default-heading-1\"\n >\n <p class=\"govuk-body\">This is the content for Writing well for the web.</p>\n </div>\n </div>\n <div class=\"govuk-accordion__section\">\n <div class=\"govuk-accordion__section-header\">\n <h2 class=\"govuk-accordion__section-heading\">\n <span class=\"govuk-accordion__section-button\" id=\"accordion-default-heading-2\">\n Writing well for specialists\n </span>\n </h2>\n </div>\n <div\n id=\"accordion-default-content-2\"\n class=\"govuk-accordion__section-content\"\n aria-labelledby=\"accordion-default-heading-2\"\n >\n <p class=\"govuk-body\">This is the content for Writing well for specialists.</p>\n </div>\n </div>\n <div class=\"govuk-accordion__section\">\n <div class=\"govuk-accordion__section-header\">\n <h2 class=\"govuk-accordion__section-heading\">\n <span class=\"govuk-accordion__section-button\" id=\"accordion-default-heading-3\"> Know your audience </span>\n </h2>\n </div>\n <div\n id=\"accordion-default-content-3\"\n class=\"govuk-accordion__section-content\"\n aria-labelledby=\"accordion-default-heading-3\"\n >\n <p class=\"govuk-body\">This is the content for Know your audience.</p>\n </div>\n </div>\n <div class=\"govuk-accordion__section\">\n <div class=\"govuk-accordion__section-header\">\n <h2 class=\"govuk-accordion__section-heading\">\n <span class=\"govuk-accordion__section-button\" id=\"accordion-default-heading-4\"> How people read </span>\n </h2>\n </div>\n <div\n id=\"accordion-default-content-4\"\n class=\"govuk-accordion__section-content\"\n aria-labelledby=\"accordion-default-heading-4\"\n >\n <p class=\"govuk-body\">This is the content for How people read.</p>\n </div>\n </div>\n</div>\n" }]
|
|
25
25
|
}] });
|
|
@@ -13,10 +13,10 @@ class GovukBackLinkComponent {
|
|
|
13
13
|
event.preventDefault();
|
|
14
14
|
this.clickEvent.emit(event);
|
|
15
15
|
}
|
|
16
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
17
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.
|
|
16
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: GovukBackLinkComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
17
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.7", type: GovukBackLinkComponent, isStandalone: true, selector: "opal-lib-govuk-back-link", outputs: { clickEvent: "clickEvent" }, ngImport: i0, template: "<a href=\"#\" class=\"govuk-back-link\" (click)=\"onBack($event)\">Back</a>\n", changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
18
18
|
}
|
|
19
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
19
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: GovukBackLinkComponent, decorators: [{
|
|
20
20
|
type: Component,
|
|
21
21
|
args: [{ selector: 'opal-lib-govuk-back-link', imports: [], changeDetection: ChangeDetectionStrategy.OnPush, template: "<a href=\"#\" class=\"govuk-back-link\" (click)=\"onBack($event)\">Back</a>\n" }]
|
|
22
22
|
}], propDecorators: { clickEvent: [{
|
|
@@ -14,10 +14,10 @@ class GovukButtonComponent {
|
|
|
14
14
|
handleButtonClick() {
|
|
15
15
|
this.buttonClickEvent.emit(true);
|
|
16
16
|
}
|
|
17
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
18
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.
|
|
17
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: GovukButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
18
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.7", type: GovukButtonComponent, isStandalone: true, selector: "opal-lib-govuk-button", inputs: { buttonId: "buttonId", type: "type", buttonClasses: "buttonClasses" }, outputs: { buttonClickEvent: "buttonClickEvent" }, ngImport: i0, template: "<button\n [id]=\"buttonId\"\n [type]=\"type\"\n class=\"govuk-button {{ buttonClasses }}\"\n data-module=\"govuk-button\"\n (click)=\"handleButtonClick()\"\n>\n <ng-content></ng-content>\n</button>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: ReactiveFormsModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
19
19
|
}
|
|
20
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
20
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: GovukButtonComponent, decorators: [{
|
|
21
21
|
type: Component,
|
|
22
22
|
args: [{ selector: 'opal-lib-govuk-button', imports: [CommonModule, ReactiveFormsModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<button\n [id]=\"buttonId\"\n [type]=\"type\"\n class=\"govuk-button {{ buttonClasses }}\"\n data-module=\"govuk-button\"\n (click)=\"handleButtonClick()\"\n>\n <ng-content></ng-content>\n</button>\n" }]
|
|
23
23
|
}], propDecorators: { buttonId: [{
|
|
@@ -10,10 +10,10 @@ class GovukCancelLinkComponent {
|
|
|
10
10
|
handleClick() {
|
|
11
11
|
this.linkClickEvent.emit(true);
|
|
12
12
|
}
|
|
13
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.
|
|
14
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.
|
|
13
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: GovukCancelLinkComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
14
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.7", type: GovukCancelLinkComponent, isStandalone: true, selector: "opal-lib-govuk-cancel-link", inputs: { cancelLinkText: "cancelLinkText" }, outputs: { linkClickEvent: "linkClickEvent" }, ngImport: i0, template: "<a (keyup.enter)=\"handleClick()\" (click)=\"handleClick()\" class=\"govuk-link button-link\" role=\"link\" tabindex=\"0\">{{\n cancelLinkText\n}}</a>\n", changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
15
15
|
}
|
|
16
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.
|
|
16
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.7", ngImport: i0, type: GovukCancelLinkComponent, decorators: [{
|
|
17
17
|
type: Component,
|
|
18
18
|
args: [{ selector: 'opal-lib-govuk-cancel-link', imports: [], changeDetection: ChangeDetectionStrategy.OnPush, template: "<a (keyup.enter)=\"handleClick()\" (click)=\"handleClick()\" class=\"govuk-link button-link\" role=\"link\" tabindex=\"0\">{{\n cancelLinkText\n}}</a>\n" }]
|
|
19
19
|
}], propDecorators: { cancelLinkText: [{
|