@hmcts/opal-frontend-common 0.0.21 → 0.0.23
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 +20 -0
- package/components/abstract/abstract-form-array-base/index.d.ts +7 -7
- package/components/abstract/abstract-form-base/index.d.ts +5 -5
- package/components/abstract/abstract-form-parent-base/index.d.ts +8 -8
- package/components/abstract/abstract-sortable-table/index.d.ts +10 -10
- package/components/abstract/abstract-table-filter/index.d.ts +8 -8
- package/components/alphagov/alphagov-accessible-autocomplete/index.d.ts +3 -3
- package/components/custom/custom-account-information/custom-account-information-item/custom-account-information-item-label/index.d.ts +9 -0
- package/components/custom/custom-account-information/custom-account-information-item/custom-account-information-item-value/index.d.ts +9 -0
- package/components/custom/custom-account-information/custom-account-information-item/index.d.ts +10 -0
- package/components/custom/custom-account-information/index.d.ts +8 -0
- package/components/custom/custom-action-links/index.d.ts +12 -0
- package/components/custom/custom-page-header/index.d.ts +8 -0
- package/components/custom/custom-summary-metric-bar/custom-summary-metric-bar-item/custom-summary-metric-bar-item-label/index.d.ts +10 -0
- package/components/custom/custom-summary-metric-bar/custom-summary-metric-bar-item/custom-summary-metric-bar-item-value/index.d.ts +10 -0
- package/components/custom/custom-summary-metric-bar/custom-summary-metric-bar-item/index.d.ts +20 -0
- package/components/custom/custom-summary-metric-bar/index.d.ts +8 -0
- package/components/govuk/govuk-list/govuk-list-link/index.d.ts +12 -0
- package/components/govuk/govuk-list/index.d.ts +8 -0
- package/components/govuk/govuk-pagination/index.d.ts +12 -12
- package/components/hod/hod-loading-spinner/index.d.ts +11 -0
- package/components/moj/moj-button-menu/index.d.ts +16 -10
- package/components/moj/moj-button-menu/moj-button-menu-item/index.d.ts +12 -0
- package/components/moj/moj-date-picker/index.d.ts +1 -1
- package/directives/capitalisation/index.d.ts +1 -1
- package/directives/govuk-button/index.d.ts +21 -0
- package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-form-alias-base.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-form-array-base.mjs +9 -9
- 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.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-form-array-removal-base.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-form-base.mjs +7 -7
- package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-form-base.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-form-parent-base.mjs +15 -15
- package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-form-parent-base.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-sortable-table-pagination.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-sortable-table.mjs +19 -19
- package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-sortable-table.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-tab-data.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-table-filter.mjs +8 -8
- package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-table-filter.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-alphagov-alphagov-accessible-autocomplete.mjs +3 -3
- package/fesm2022/hmcts-opal-frontend-common-components-alphagov-alphagov-accessible-autocomplete.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-account-information-custom-account-information-item-custom-account-information-item-label.mjs +22 -0
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-account-information-custom-account-information-item-custom-account-information-item-label.mjs.map +1 -0
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-account-information-custom-account-information-item-custom-account-information-item-value.mjs +22 -0
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-account-information-custom-account-information-item-custom-account-information-item-value.mjs.map +1 -0
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-account-information-custom-account-information-item.mjs +28 -0
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-account-information-custom-account-information-item.mjs.map +1 -0
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-account-information.mjs +18 -0
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-account-information.mjs.map +1 -0
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-action-links.mjs +38 -0
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-action-links.mjs.map +1 -0
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-page-header.mjs +18 -0
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-page-header.mjs.map +1 -0
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-summary-metric-bar-custom-summary-metric-bar-item-custom-summary-metric-bar-item-label.mjs +28 -0
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-summary-metric-bar-custom-summary-metric-bar-item-custom-summary-metric-bar-item-label.mjs.map +1 -0
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-summary-metric-bar-custom-summary-metric-bar-item-custom-summary-metric-bar-item-value.mjs +28 -0
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-summary-metric-bar-custom-summary-metric-bar-item-custom-summary-metric-bar-item-value.mjs.map +1 -0
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-summary-metric-bar-custom-summary-metric-bar-item.mjs +43 -0
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-summary-metric-bar-custom-summary-metric-bar-item.mjs.map +1 -0
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-summary-metric-bar.mjs +18 -0
- package/fesm2022/hmcts-opal-frontend-common-components-custom-custom-summary-metric-bar.mjs.map +1 -0
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-accordion.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-back-link.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-button.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-cancel-link.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-checkboxes.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-date-input.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-error-summary.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-header.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-list-govuk-list-link.mjs +31 -0
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-list-govuk-list-link.mjs.map +1 -0
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-list.mjs +18 -0
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-list.mjs.map +1 -0
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-pagination.mjs +17 -17
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-pagination.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-radio.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-select.mjs.map +1 -1
- 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.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-table.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-tabs-govuk-tabs-list-item.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-tabs.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-text-area.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-text-input-prefix-suffix.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-text-input.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-helpers.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-hod-hod-loading-spinner.mjs +30 -0
- package/fesm2022/hmcts-opal-frontend-common-components-hod-hod-loading-spinner.mjs.map +1 -0
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-alert.mjs +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-alert.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-button-menu-moj-button-menu-item.mjs +29 -0
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-button-menu-moj-button-menu-item.mjs.map +1 -0
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-button-menu.mjs +40 -22
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-button-menu.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-date-picker.mjs +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-date-picker.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-filter-moj-filter-panel-moj-filter-panel-option-moj-filter-panel-option-form-group-item.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-filter-moj-filter-panel-moj-filter-panel-option-moj-filter-panel-option-form-group-keyword.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-filter-moj-filter-panel-moj-filter-panel-option.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-filter-moj-filter-panel-moj-filter-panel-selected-moj-filter-panel-selected-tag.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-filter-moj-filter-panel-moj-filter-panel-selected.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-filter.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-header.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-pagination.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-primary-navigation.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-sortable-table.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-moj-moj-sub-navigation.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-directives-capitalisation.mjs +1 -1
- package/fesm2022/hmcts-opal-frontend-common-directives-capitalisation.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-directives-govuk-button.mjs +61 -0
- package/fesm2022/hmcts-opal-frontend-common-directives-govuk-button.mjs.map +1 -0
- package/fesm2022/hmcts-opal-frontend-common-guards-auth.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-guards-has-flow-state.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-guards-helpers.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-guards-route-permissions.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-guards-signed-in.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-interceptors-http-error.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-pages-access-denied.component-hjYG8Hhi.mjs.map +1 -1
- package/fesm2022/{hmcts-opal-frontend-common-pages-sign-in-stub.component-CMgQc0uF.mjs → hmcts-opal-frontend-common-pages-sign-in-stub.component-joWzJ-cV.mjs} +2 -2
- package/fesm2022/hmcts-opal-frontend-common-pages-sign-in-stub.component-joWzJ-cV.mjs.map +1 -0
- package/fesm2022/{hmcts-opal-frontend-common-pages-sign-in.component-UHSDf5ya.mjs → hmcts-opal-frontend-common-pages-sign-in.component-JCBGIMBe.mjs} +4 -4
- package/fesm2022/hmcts-opal-frontend-common-pages-sign-in.component-JCBGIMBe.mjs.map +1 -0
- package/fesm2022/hmcts-opal-frontend-common-pages.mjs +1 -1
- package/fesm2022/hmcts-opal-frontend-common-pipes-date-format.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-pipes-days-ago.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-resolvers-title.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-services-app-initializer-service.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-services-app-insights-service.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-services-auth-service.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-services-date-service.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-services-launch-darkly-service.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-services-permissions-service.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-services-session-service.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-services-sort-service.mjs +18 -18
- package/fesm2022/hmcts-opal-frontend-common-services-sort-service.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-services-transfer-state-service.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-services-transformation-service.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-services-utils-service.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-stores-global.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-validators-alphabetical-text.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-validators-amount.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-validators-date-after-year.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-validators-date-before.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-validators-date-of-birth.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-validators-driving-licence-number.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-validators-future-date.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-validators-invalid-value.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-validators-national-insurance-number.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-validators-numerical-only.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-validators-optional-max-length.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-validators-optional-valid-date.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-validators-optional-valid-email-address.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-validators-optional-valid-telephone.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-validators-over-eighteen.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-validators-past-date.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-validators-pattern-validator.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-validators-special-characters.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-validators-time-format.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-validators-two-decimal-places.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-validators-valid-value.mjs.map +1 -1
- package/package.json +79 -1
- package/services/sort-service/index.d.ts +15 -15
- package/styles/custom/_custom-section_break.scss +6 -0
- package/styles/styles.scss +102 -0
- package/fesm2022/hmcts-opal-frontend-common-pages-sign-in-stub.component-CMgQc0uF.mjs.map +0 -1
- package/fesm2022/hmcts-opal-frontend-common-pages-sign-in.component-UHSDf5ya.mjs.map +0 -1
package/README.md
CHANGED
|
@@ -158,6 +158,26 @@ The following commands are available in the `package.json`:
|
|
|
158
158
|
- `yarn lint`
|
|
159
159
|
Runs linting using ESLint.
|
|
160
160
|
|
|
161
|
+
There is a custom lint rule for member ordering to ensure members in the code are ordered in the following format:
|
|
162
|
+
|
|
163
|
+
```json
|
|
164
|
+
[
|
|
165
|
+
"private-static-field",
|
|
166
|
+
"protected-static-field",
|
|
167
|
+
"public-static-field",
|
|
168
|
+
"private-instance-field",
|
|
169
|
+
"protected-instance-field",
|
|
170
|
+
"public-instance-field",
|
|
171
|
+
"constructor",
|
|
172
|
+
"private-static-method",
|
|
173
|
+
"protected-static-method",
|
|
174
|
+
"public-static-method",
|
|
175
|
+
"private-instance-method",
|
|
176
|
+
"protected-instance-method",
|
|
177
|
+
"public-instance-method"
|
|
178
|
+
]
|
|
179
|
+
```
|
|
180
|
+
|
|
161
181
|
- `yarn prettier`
|
|
162
182
|
Checks that all files conform to the Prettier formatting rules.
|
|
163
183
|
|
|
@@ -61,13 +61,6 @@ declare abstract class AbstractFormArrayBaseComponent extends AbstractFormBaseCo
|
|
|
61
61
|
* @param fieldNames - An array of field names to remove errors from.
|
|
62
62
|
*/
|
|
63
63
|
protected removeFormArrayControlsErrors(index: number, formArrayControls: IAbstractFormArrayControls[], fieldNames: string[]): void;
|
|
64
|
-
/**
|
|
65
|
-
* Adds controls to the form array at the specified index.
|
|
66
|
-
*
|
|
67
|
-
* @param index - The index at which the controls should be added.
|
|
68
|
-
* @param formArrayName - The name of the form array.
|
|
69
|
-
*/
|
|
70
|
-
addControlsToFormArray(index: number, formArrayName: string): void;
|
|
71
64
|
/**
|
|
72
65
|
* Removes a form array control at the specified index from the given array of form array controls.
|
|
73
66
|
*
|
|
@@ -150,6 +143,13 @@ declare abstract class AbstractFormArrayBaseComponent extends AbstractFormBaseCo
|
|
|
150
143
|
addIndexToFormArrayData(data: any[]): {
|
|
151
144
|
[key: string]: any;
|
|
152
145
|
}[];
|
|
146
|
+
/**
|
|
147
|
+
* Adds controls to the form array at the specified index.
|
|
148
|
+
*
|
|
149
|
+
* @param index - The index at which the controls should be added.
|
|
150
|
+
* @param formArrayName - The name of the form array.
|
|
151
|
+
*/
|
|
152
|
+
addControlsToFormArray(index: number, formArrayName: string): void;
|
|
153
153
|
ngOnInit(): void;
|
|
154
154
|
ngOnDestroy(): void;
|
|
155
155
|
static ɵfac: i0.ɵɵFactoryDeclaration<AbstractFormArrayBaseComponent, never>;
|
|
@@ -29,18 +29,18 @@ interface IAbstractFormBaseForm<T> {
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
declare abstract class AbstractFormBaseComponent implements OnInit, OnDestroy {
|
|
32
|
-
protected unsavedChanges: EventEmitter<boolean>;
|
|
33
|
-
protected formSubmit: EventEmitter<IAbstractFormBaseForm<any>>;
|
|
34
32
|
private readonly changeDetectorRef;
|
|
35
33
|
private readonly router;
|
|
36
34
|
private readonly activatedRoute;
|
|
35
|
+
protected unsavedChanges: EventEmitter<boolean>;
|
|
36
|
+
protected formSubmit: EventEmitter<IAbstractFormBaseForm<any>>;
|
|
37
37
|
protected readonly utilsService: UtilsService;
|
|
38
|
-
form: FormGroup;
|
|
39
|
-
formControlErrorMessages: IAbstractFormControlErrorMessage;
|
|
40
|
-
formErrorSummaryMessage: IAbstractFormBaseFormErrorSummaryMessage[];
|
|
41
38
|
protected fieldErrors: IAbstractFormBaseFieldErrors;
|
|
42
39
|
protected formSubmitted: boolean;
|
|
43
40
|
protected readonly ngUnsubscribe: Subject<void>;
|
|
41
|
+
form: FormGroup;
|
|
42
|
+
formControlErrorMessages: IAbstractFormControlErrorMessage;
|
|
43
|
+
formErrorSummaryMessage: IAbstractFormBaseFormErrorSummaryMessage[];
|
|
44
44
|
formErrors: IAbstractFormBaseFormError[];
|
|
45
45
|
constructor();
|
|
46
46
|
/**
|
|
@@ -4,14 +4,6 @@ declare abstract class AbstractFormParentBaseComponent {
|
|
|
4
4
|
private readonly router;
|
|
5
5
|
private readonly activatedRoute;
|
|
6
6
|
stateUnsavedChanges: boolean;
|
|
7
|
-
/**
|
|
8
|
-
* If the user navigates externally from the site or closes the tab
|
|
9
|
-
* Check if there is unsaved changes form state -> warning message
|
|
10
|
-
* Otherwise -> no warning message
|
|
11
|
-
*
|
|
12
|
-
* @returns boolean
|
|
13
|
-
*/
|
|
14
|
-
canDeactivate(): CanDeactivateTypes;
|
|
15
7
|
/**
|
|
16
8
|
* Navigates to a specified route using the Angular Router.
|
|
17
9
|
*
|
|
@@ -31,6 +23,14 @@ declare abstract class AbstractFormParentBaseComponent {
|
|
|
31
23
|
protected hasFormValues(form: {
|
|
32
24
|
[key: string]: any;
|
|
33
25
|
}): boolean;
|
|
26
|
+
/**
|
|
27
|
+
* If the user navigates externally from the site or closes the tab
|
|
28
|
+
* Check if there is unsaved changes form state -> warning message
|
|
29
|
+
* Otherwise -> no warning message
|
|
30
|
+
*
|
|
31
|
+
* @returns boolean
|
|
32
|
+
*/
|
|
33
|
+
protected canDeactivate(): CanDeactivateTypes;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
export { AbstractFormParentBaseComponent };
|
|
@@ -6,6 +6,16 @@ import { AbstractTableFilterComponent } from '@hmcts/opal-frontend-common/compon
|
|
|
6
6
|
|
|
7
7
|
declare abstract class AbstractSortableTableComponent extends AbstractTableFilterComponent implements OnInit {
|
|
8
8
|
private readonly sortService;
|
|
9
|
+
/**
|
|
10
|
+
* Synchronizes the sorted table data with the current filter and sort state.
|
|
11
|
+
*
|
|
12
|
+
* This effect observes changes to the filtered table data and the sort state signals.
|
|
13
|
+
* If no active sort key is found (i.e., no sorting is applied), it sets the sorted table data
|
|
14
|
+
* to a shallow copy of the filtered data. Otherwise, sorting logic should be applied elsewhere.
|
|
15
|
+
*
|
|
16
|
+
* @protected
|
|
17
|
+
*/
|
|
18
|
+
protected syncSortedDataEffect: _angular_core.EffectRef;
|
|
9
19
|
displayTableDataSignal: _angular_core.WritableSignal<IAbstractTableData<SortableValuesType>[]>;
|
|
10
20
|
filteredTableDataSignal: _angular_core.WritableSignal<IAbstractTableData<SortableValuesType>[]>;
|
|
11
21
|
sortedTableDataSignal: _angular_core.WritableSignal<IAbstractTableData<SortableValuesType>[]>;
|
|
@@ -74,16 +84,6 @@ declare abstract class AbstractSortableTableComponent extends AbstractTableFilte
|
|
|
74
84
|
key: string;
|
|
75
85
|
sortType: 'ascending' | 'descending';
|
|
76
86
|
}): void;
|
|
77
|
-
/**
|
|
78
|
-
* Synchronizes the sorted table data with the current filter and sort state.
|
|
79
|
-
*
|
|
80
|
-
* This effect observes changes to the filtered table data and the sort state signals.
|
|
81
|
-
* If no active sort key is found (i.e., no sorting is applied), it sets the sorted table data
|
|
82
|
-
* to a shallow copy of the filtered data. Otherwise, sorting logic should be applied elsewhere.
|
|
83
|
-
*
|
|
84
|
-
* @protected
|
|
85
|
-
*/
|
|
86
|
-
protected syncSortedDataEffect: _angular_core.EffectRef;
|
|
87
87
|
/**
|
|
88
88
|
* Lifecycle hook to initialise the sort state.
|
|
89
89
|
*/
|
|
@@ -10,6 +10,14 @@ declare abstract class AbstractTableFilterComponent {
|
|
|
10
10
|
keyword: _angular_core.WritableSignal<string>;
|
|
11
11
|
appliedFilterTags: _angular_core.WritableSignal<IAbstractTableFilterCategory[]>;
|
|
12
12
|
appliedKeyword: _angular_core.WritableSignal<string>;
|
|
13
|
+
/**
|
|
14
|
+
* A computed signal that returns the currently selected filter tags.
|
|
15
|
+
* It filters the filterTags signal to include only those options that are selected,
|
|
16
|
+
* grouped by their category name.
|
|
17
|
+
*
|
|
18
|
+
* @returns An array of filter categories each containing only the selected options.
|
|
19
|
+
*/
|
|
20
|
+
abstractSelectedTags: Signal<IAbstractTableFilterCategory[]>;
|
|
13
21
|
/**
|
|
14
22
|
* Determines whether a given item matches a specific filter option within a category.
|
|
15
23
|
* @param item The data item to test.
|
|
@@ -36,14 +44,6 @@ declare abstract class AbstractTableFilterComponent {
|
|
|
36
44
|
* @returns An array of category objects, each with only the selected options, and only categories with at least one selected option.
|
|
37
45
|
*/
|
|
38
46
|
protected getSelectedOptionsFromTags(tags: IAbstractTableFilterCategory[]): IAbstractTableFilterCategory[];
|
|
39
|
-
/**
|
|
40
|
-
* A computed signal that returns the currently selected filter tags.
|
|
41
|
-
* It filters the filterTags signal to include only those options that are selected,
|
|
42
|
-
* grouped by their category name.
|
|
43
|
-
*
|
|
44
|
-
* @returns An array of filter categories each containing only the selected options.
|
|
45
|
-
*/
|
|
46
|
-
abstractSelectedTags: Signal<IAbstractTableFilterCategory[]>;
|
|
47
47
|
/**
|
|
48
48
|
* Updates the keyword used to filter the table data.
|
|
49
49
|
* @param newKeyword The new keyword string to filter by.
|
|
@@ -8,6 +8,9 @@ interface IAlphagovAccessibleAutocompleteItem {
|
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
declare class AlphagovAccessibleAutocompleteComponent implements OnInit, OnDestroy {
|
|
11
|
+
private readonly changeDetector;
|
|
12
|
+
private _control;
|
|
13
|
+
private readonly ngUnsubscribe;
|
|
11
14
|
labelText: string;
|
|
12
15
|
labelClasses: string;
|
|
13
16
|
inputId: string;
|
|
@@ -18,9 +21,6 @@ declare class AlphagovAccessibleAutocompleteComponent implements OnInit, OnDestr
|
|
|
18
21
|
showAllValues: boolean;
|
|
19
22
|
errors: string | null;
|
|
20
23
|
autocompleteContainer: ElementRef<HTMLElement>;
|
|
21
|
-
private readonly changeDetector;
|
|
22
|
-
private _control;
|
|
23
|
-
private readonly ngUnsubscribe;
|
|
24
24
|
autoCompleteId: string;
|
|
25
25
|
set control(abstractControl: AbstractControl | null);
|
|
26
26
|
constructor();
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
|
|
3
|
+
declare class CustomAccountInformationItemLabelComponent {
|
|
4
|
+
hostClass: string;
|
|
5
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CustomAccountInformationItemLabelComponent, never>;
|
|
6
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CustomAccountInformationItemLabelComponent, "opal-lib-custom-account-information-item-label, [opal-lib-custom-account-information-item-label]", never, {}, {}, never, ["*"], true, never>;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export { CustomAccountInformationItemLabelComponent };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
|
|
3
|
+
declare class CustomAccountInformationItemValueComponent {
|
|
4
|
+
hostClass: string;
|
|
5
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CustomAccountInformationItemValueComponent, never>;
|
|
6
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CustomAccountInformationItemValueComponent, "opal-lib-custom-account-information-item-value, [opal-lib-custom-account-information-item-value]", never, {}, {}, never, ["*"], true, never>;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export { CustomAccountInformationItemValueComponent };
|
package/components/custom/custom-account-information/custom-account-information-item/index.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
|
|
3
|
+
declare class CustomAccountInformationItemComponent {
|
|
4
|
+
itemClasses: string;
|
|
5
|
+
get hostClass(): string;
|
|
6
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CustomAccountInformationItemComponent, never>;
|
|
7
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CustomAccountInformationItemComponent, "opal-lib-custom-account-information-item", never, { "itemClasses": { "alias": "itemClasses"; "required": false; }; }, {}, never, ["*"], true, never>;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export { CustomAccountInformationItemComponent };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
|
|
3
|
+
declare class CustomAccountInformationComponent {
|
|
4
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CustomAccountInformationComponent, never>;
|
|
5
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CustomAccountInformationComponent, "opal-lib-custom-account-information, [opal-lib-custom-account-information]", never, {}, {}, never, ["*"], true, never>;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export { CustomAccountInformationComponent };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
|
|
3
|
+
declare class CustomActionLinksComponent {
|
|
4
|
+
id: string;
|
|
5
|
+
classSize: string;
|
|
6
|
+
get hostId(): string;
|
|
7
|
+
get hostClass(): string;
|
|
8
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CustomActionLinksComponent, never>;
|
|
9
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CustomActionLinksComponent, "opal-lib-custom-action-links", never, { "id": { "alias": "id"; "required": true; }; "classSize": { "alias": "classSize"; "required": false; }; }, {}, never, ["[heading]", "[links]"], true, never>;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export { CustomActionLinksComponent };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
|
|
3
|
+
declare class CustomPageHeaderComponent {
|
|
4
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CustomPageHeaderComponent, never>;
|
|
5
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CustomPageHeaderComponent, "opal-lib-custom-page-header", never, {}, {}, never, ["[pageHeaderHeading]", "[pageHeaderButtons]"], true, never>;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export { CustomPageHeaderComponent };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
|
|
3
|
+
declare class CustomSummaryMetricBarItemLabelComponent {
|
|
4
|
+
textColour: string;
|
|
5
|
+
get hostClasses(): string;
|
|
6
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CustomSummaryMetricBarItemLabelComponent, never>;
|
|
7
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CustomSummaryMetricBarItemLabelComponent, "opal-lib-custom-summary-metric-bar-item-label, [opal-lib-custom-summary-metric-bar-item-label]", never, { "textColour": { "alias": "textColour"; "required": false; }; }, {}, never, ["*"], true, never>;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export { CustomSummaryMetricBarItemLabelComponent };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
|
|
3
|
+
declare class CustomSummaryMetricBarItemValueComponent {
|
|
4
|
+
textColour: string;
|
|
5
|
+
get hostClasses(): string;
|
|
6
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CustomSummaryMetricBarItemValueComponent, never>;
|
|
7
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CustomSummaryMetricBarItemValueComponent, "opal-lib-custom-summary-metric-bar-item-value, [opal-lib-custom-summary-metric-bar-item-value]", never, { "textColour": { "alias": "textColour"; "required": false; }; }, {}, never, ["*"], true, never>;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export { CustomSummaryMetricBarItemValueComponent };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
|
|
3
|
+
declare class CustomSummaryMetricBarItemComponent {
|
|
4
|
+
backgroundColour: string;
|
|
5
|
+
itemClasses: string;
|
|
6
|
+
get hostClasses(): string;
|
|
7
|
+
/**
|
|
8
|
+
* Returns the CSS class names for the summary metric bar item.
|
|
9
|
+
*
|
|
10
|
+
* This method generates a string containing the default class "custom-summary-metric-bar-item-frame"
|
|
11
|
+
* combined with additional classes determined by the component's background and text color properties.
|
|
12
|
+
*
|
|
13
|
+
* @returns {string} A space-separated list of CSS classes to apply to the component.
|
|
14
|
+
*/
|
|
15
|
+
getSummaryMetricBarItemClasses(): string;
|
|
16
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CustomSummaryMetricBarItemComponent, never>;
|
|
17
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CustomSummaryMetricBarItemComponent, "opal-lib-custom-summary-metric-bar-item", never, { "backgroundColour": { "alias": "backgroundColour"; "required": false; }; "itemClasses": { "alias": "itemClasses"; "required": false; }; }, {}, never, ["*"], true, never>;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export { CustomSummaryMetricBarItemComponent };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
|
|
3
|
+
declare class CustomSummaryMetricBarComponent {
|
|
4
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CustomSummaryMetricBarComponent, never>;
|
|
5
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CustomSummaryMetricBarComponent, "opal-lib-custom-summary-metric-bar", never, {}, {}, never, ["*"], true, never>;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export { CustomSummaryMetricBarComponent };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { EventEmitter } from '@angular/core';
|
|
3
|
+
|
|
4
|
+
declare class GovukListLinkComponent {
|
|
5
|
+
linkText: string;
|
|
6
|
+
linkClickEvent: EventEmitter<void>;
|
|
7
|
+
handleClick(event: Event): void;
|
|
8
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<GovukListLinkComponent, never>;
|
|
9
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<GovukListLinkComponent, "opal-lib-govuk-list-link", never, { "linkText": { "alias": "linkText"; "required": true; }; }, { "linkClickEvent": "linkClickEvent"; }, never, never, true, never>;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export { GovukListLinkComponent };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
|
|
3
|
+
declare class GovukListComponent {
|
|
4
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<GovukListComponent, never>;
|
|
5
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<GovukListComponent, "opal-lib-govuk-list", never, {}, {}, never, ["*"], true, never>;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export { GovukListComponent };
|
|
@@ -9,18 +9,6 @@ declare class GovukPaginationComponent implements OnChanges {
|
|
|
9
9
|
pages: _angular_core.WritableSignal<number[]>;
|
|
10
10
|
elipsedPages: _angular_core.WritableSignal<(string | number)[]>;
|
|
11
11
|
ELIPSIS: string;
|
|
12
|
-
/**
|
|
13
|
-
* Lifecycle hook that is called when any data-bound property of the component changes.
|
|
14
|
-
* It recalculates the pages for pagination.
|
|
15
|
-
*/
|
|
16
|
-
ngOnChanges(): void;
|
|
17
|
-
/**
|
|
18
|
-
* Handles the page change event.
|
|
19
|
-
*
|
|
20
|
-
* @param $event - The click event that triggered the page change.
|
|
21
|
-
* @param page - The new page number.
|
|
22
|
-
*/
|
|
23
|
-
onPageChanged($event: MouseEvent, page: number): void;
|
|
24
12
|
/**
|
|
25
13
|
* Calculates the number of pages based on the total number of items and the limit per page.
|
|
26
14
|
* Updates the `pages` and `elipsedPages` properties accordingly.
|
|
@@ -40,6 +28,18 @@ declare class GovukPaginationComponent implements OnChanges {
|
|
|
40
28
|
* @returns The modified array of pages with ellipses inserted.
|
|
41
29
|
*/
|
|
42
30
|
private elipseSkippedPages;
|
|
31
|
+
/**
|
|
32
|
+
* Handles the page change event.
|
|
33
|
+
*
|
|
34
|
+
* @param $event - The click event that triggered the page change.
|
|
35
|
+
* @param page - The new page number.
|
|
36
|
+
*/
|
|
37
|
+
onPageChanged($event: MouseEvent, page: number): void;
|
|
38
|
+
/**
|
|
39
|
+
* Lifecycle hook that is called when any data-bound property of the component changes.
|
|
40
|
+
* It recalculates the pages for pagination.
|
|
41
|
+
*/
|
|
42
|
+
ngOnChanges(): void;
|
|
43
43
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<GovukPaginationComponent, never>;
|
|
44
44
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<GovukPaginationComponent, "opal-lib-govuk-pagination", never, { "currentPage": { "alias": "currentPage"; "required": false; }; "total": { "alias": "total"; "required": false; }; "limit": { "alias": "limit"; "required": false; }; }, { "changePage": "changePage"; }, never, never, true, never>;
|
|
45
45
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
|
|
3
|
+
declare class HodLoadingSpinnerComponent {
|
|
4
|
+
spinnerId: string;
|
|
5
|
+
hostClasses: string;
|
|
6
|
+
role: string;
|
|
7
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<HodLoadingSpinnerComponent, never>;
|
|
8
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<HodLoadingSpinnerComponent, "opal-lib-hod-loading-spinner, [opal-lib-hod-loading-spinner]", never, { "spinnerId": { "alias": "spinnerId"; "required": true; }; }, {}, never, ["*"], true, never>;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export { HodLoadingSpinnerComponent };
|
|
@@ -1,21 +1,27 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
declare class MojButtonMenuItemComponent {
|
|
5
|
-
actionClick: EventEmitter<boolean>;
|
|
6
|
-
handleClick(event: Event): void;
|
|
7
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<MojButtonMenuItemComponent, never>;
|
|
8
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<MojButtonMenuItemComponent, "opal-lib-moj-button-menu-item", never, {}, { "actionClick": "actionClick"; }, never, ["[linkText]"], true, never>;
|
|
9
|
-
}
|
|
2
|
+
import { ElementRef } from '@angular/core';
|
|
10
3
|
|
|
11
4
|
declare class MojButtonMenuComponent {
|
|
12
5
|
menuButtonTitle: string;
|
|
6
|
+
menuButton: ElementRef<HTMLElement>;
|
|
7
|
+
hostClasses: string;
|
|
8
|
+
dataModule: string;
|
|
9
|
+
get dataButtonText(): string;
|
|
10
|
+
dataButtonClasses: string;
|
|
11
|
+
dataMojButtonMenuInit: string;
|
|
12
|
+
isExpanded: boolean;
|
|
13
13
|
/**
|
|
14
|
-
* Toggles the
|
|
14
|
+
* Toggles the expanded state of the button menu.
|
|
15
|
+
*
|
|
16
|
+
* This method retrieves the current "aria-expanded" state from the menu button,
|
|
17
|
+
* inverts the state, and then updates both the "aria-expanded" attribute and the
|
|
18
|
+
* internal component property "isExpanded" accordingly.
|
|
19
|
+
*
|
|
20
|
+
* @returns void
|
|
15
21
|
*/
|
|
16
22
|
toggleButtonMenu(): void;
|
|
17
23
|
static ɵfac: i0.ɵɵFactoryDeclaration<MojButtonMenuComponent, never>;
|
|
18
24
|
static ɵcmp: i0.ɵɵComponentDeclaration<MojButtonMenuComponent, "opal-lib-moj-button-menu", never, { "menuButtonTitle": { "alias": "menuButtonTitle"; "required": true; }; }, {}, never, ["*"], true, never>;
|
|
19
25
|
}
|
|
20
26
|
|
|
21
|
-
export { MojButtonMenuComponent
|
|
27
|
+
export { MojButtonMenuComponent };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { EventEmitter } from '@angular/core';
|
|
3
|
+
|
|
4
|
+
declare class MojButtonMenuItemComponent {
|
|
5
|
+
itemText: string;
|
|
6
|
+
actionClick: EventEmitter<void>;
|
|
7
|
+
handleClick(event: Event): void;
|
|
8
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MojButtonMenuItemComponent, never>;
|
|
9
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MojButtonMenuItemComponent, "opal-lib-moj-button-menu-item", never, { "itemText": { "alias": "itemText"; "required": true; }; }, { "actionClick": "actionClick"; }, never, never, true, never>;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export { MojButtonMenuItemComponent };
|
|
@@ -3,9 +3,9 @@ import { OnInit, EventEmitter } from '@angular/core';
|
|
|
3
3
|
import { AbstractControl, FormControl } from '@angular/forms';
|
|
4
4
|
|
|
5
5
|
declare class MojDatePickerComponent implements OnInit {
|
|
6
|
+
private readonly dateService;
|
|
6
7
|
private _control;
|
|
7
8
|
disabledDatesConcatenated: string;
|
|
8
|
-
private readonly dateService;
|
|
9
9
|
labelText: string;
|
|
10
10
|
labelClasses: string;
|
|
11
11
|
hintText: string;
|
|
@@ -5,8 +5,8 @@ import { UtilsService } from '@hmcts/opal-frontend-common/services/utils-service
|
|
|
5
5
|
|
|
6
6
|
declare class CapitalisationDirective implements OnInit, OnDestroy {
|
|
7
7
|
private readonly utilsService;
|
|
8
|
-
control: AbstractControl;
|
|
9
8
|
private readonly destroy$;
|
|
9
|
+
control: AbstractControl;
|
|
10
10
|
constructor(utilsService: UtilsService);
|
|
11
11
|
ngOnInit(): void;
|
|
12
12
|
ngOnDestroy(): void;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { EventEmitter } from '@angular/core';
|
|
3
|
+
|
|
4
|
+
declare class GovukButtonDirective {
|
|
5
|
+
buttonId: string;
|
|
6
|
+
buttonClasses: string;
|
|
7
|
+
type: 'button' | 'submit' | 'reset';
|
|
8
|
+
buttonClickEvent: EventEmitter<boolean>;
|
|
9
|
+
get id(): string;
|
|
10
|
+
get buttonType(): "button" | "submit" | "reset";
|
|
11
|
+
get classes(): string;
|
|
12
|
+
dataModule: string;
|
|
13
|
+
/**
|
|
14
|
+
* Handles the button click event.
|
|
15
|
+
*/
|
|
16
|
+
handleButtonClick(): void;
|
|
17
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<GovukButtonDirective, never>;
|
|
18
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<GovukButtonDirective, "[opalLibGovukButton]", never, { "buttonId": { "alias": "buttonId"; "required": true; }; "buttonClasses": { "alias": "buttonClasses"; "required": false; }; "type": { "alias": "type"; "required": false; }; }, { "buttonClickEvent": "buttonClickEvent"; }, never, never, true, never>;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export { GovukButtonDirective };
|
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 [...formArrayControls].forEach((_element, index) => {\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 fieldNames.forEach((field) => {\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;IACzD,uBAAuB,GAA0C,EAAE;IACnE,WAAW,GAAa,EAAE;AAEjC;;;;;;;;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,gBAAgB,CAAC,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,iBAAiB,CAAC,CAC3E;;AAGH;;;;;;;;AAQG;AACK,IAAA,gBAAgB,CACtB,KAAa,EACb,aAAqB,EACrB,UAAoB,EACpB,iBAAwD,EAAA;QAExD,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,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E;AAC5B,QAAA,IAAI,CAAC,eAAe,CAAC,CAAC,QAAQ,EAAE;QAChC,KAAK,CAAC,WAAW,EAAE;;wGAzPD,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,SAAA,EAAA,IAAA,EAAA,8BAA8B,+FAFxC,EAAE,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA;;4FAEQ,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 } 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 [...formArrayControls].forEach((_element, index) => {\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 fieldNames.forEach((field) => {\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;IACzD,uBAAuB,GAA0C,EAAE;IACnE,WAAW,GAAa,EAAE;AAEjC;;;;;;;;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,gBAAgB,CAAC,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,iBAAiB,CAAC,CAC3E;IACH;AAEA;;;;;;;;AAQG;AACK,IAAA,gBAAgB,CACtB,KAAa,EACb,aAAqB,EACrB,UAAoB,EACpB,iBAAwD,EAAA;QAExD,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,aAAa,CAAc;AAC7D,QAAA,MAAM,oBAAoB,GAAG,IAAI,SAAS,CAAC,EAAE,CAAC;;QAG9C,MAAM,QAAQ,GAAG,IAAI,CAAC,mBAAmB,CAAC,UAAU,EAAE,KAAK,CAAC;;QAG5D,IAAI,CAAC,sBAAsB,CAAC,oBAAoB,EAAE,iBAAiB,EAAE,KAAK,CAAC;;AAG3E,QAAA,WAAW,CAAC,IAAI,CAAC,oBAAoB,CAAC;;AAGtC,QAAA,OAAO,QAAQ;IACjB;AAEA;;;;;;;AAOG;AACK,IAAA,0BAA0B,CAChC,iBAA+C,EAC/C,aAAqB,EACrB,UAA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8B,+FAFxC,EAAE,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA;;4FAEQ,8BAA8B,EAAA,UAAA,EAAA,CAAA;kBAHnD,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,EAAE;AACb,iBAAA;;;ACbD;;AAEG;;;;"}
|
package/fesm2022/hmcts-opal-frontend-common-components-abstract-abstract-form-array-base.mjs
CHANGED
|
@@ -94,15 +94,6 @@ class AbstractFormArrayBaseComponent extends AbstractFormBaseComponent {
|
|
|
94
94
|
});
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
|
-
/**
|
|
98
|
-
* Adds controls to the form array at the specified index.
|
|
99
|
-
*
|
|
100
|
-
* @param index - The index at which the controls should be added.
|
|
101
|
-
* @param formArrayName - The name of the form array.
|
|
102
|
-
*/
|
|
103
|
-
addControlsToFormArray(index, formArrayName) {
|
|
104
|
-
this.formArrayControls.push(this.addFormArrayControls(index, formArrayName, this.formArrayFields, this.formArrayControlsValidation));
|
|
105
|
-
}
|
|
106
97
|
/**
|
|
107
98
|
* Removes a form array control at the specified index from the given array of form array controls.
|
|
108
99
|
*
|
|
@@ -226,6 +217,15 @@ class AbstractFormArrayBaseComponent extends AbstractFormBaseComponent {
|
|
|
226
217
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
227
218
|
{}));
|
|
228
219
|
}
|
|
220
|
+
/**
|
|
221
|
+
* Adds controls to the form array at the specified index.
|
|
222
|
+
*
|
|
223
|
+
* @param index - The index at which the controls should be added.
|
|
224
|
+
* @param formArrayName - The name of the form array.
|
|
225
|
+
*/
|
|
226
|
+
addControlsToFormArray(index, formArrayName) {
|
|
227
|
+
this.formArrayControls.push(this.addFormArrayControls(index, formArrayName, this.formArrayFields, this.formArrayControlsValidation));
|
|
228
|
+
}
|
|
229
229
|
ngOnInit() {
|
|
230
230
|
super.ngOnInit();
|
|
231
231
|
}
|