@hmcts/opal-frontend-common 0.0.56 → 0.0.58
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/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-radio.mjs +122 -19
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-radio.mjs.map +1 -1
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-tabs-govuk-tabs-list-item.mjs +7 -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 +8 -2
- package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-tabs.mjs.map +1 -1
- package/package.json +1 -1
- package/types/hmcts-opal-frontend-common-components-govuk-govuk-radio.d.ts +53 -5
- package/types/hmcts-opal-frontend-common-components-govuk-govuk-tabs-govuk-tabs-list-item.d.ts +1 -0
- package/types/hmcts-opal-frontend-common-components-govuk-govuk-tabs.d.ts +1 -0
|
@@ -1,31 +1,24 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { Input, ChangeDetectionStrategy, Component, HostBinding, inject, ElementRef, afterNextRender } from '@angular/core';
|
|
3
|
+
import * as i1$1 from '@angular/common';
|
|
3
4
|
import { CommonModule } from '@angular/common';
|
|
4
5
|
import * as i1 from '@angular/forms';
|
|
5
6
|
import { ReactiveFormsModule } from '@angular/forms';
|
|
6
7
|
|
|
7
8
|
class GovukRadiosConditionalComponent {
|
|
9
|
+
/**
|
|
10
|
+
* Id used by aria-controls to connect a radio input to this conditional panel.
|
|
11
|
+
*/
|
|
8
12
|
conditionalId;
|
|
9
|
-
class = 'govuk-radios__conditional';
|
|
10
|
-
id;
|
|
11
|
-
ngOnInit() {
|
|
12
|
-
this.id = `${this.conditionalId}-conditional`;
|
|
13
|
-
}
|
|
14
13
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: GovukRadiosConditionalComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
15
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.16", type: GovukRadiosConditionalComponent, isStandalone: true, selector: "opal-lib-govuk-radios-conditional, [opal-lib-govuk-radios-conditional]", inputs: { conditionalId: "conditionalId" },
|
|
14
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.16", type: GovukRadiosConditionalComponent, isStandalone: true, selector: "opal-lib-govuk-radios-conditional, [opal-lib-govuk-radios-conditional]", inputs: { conditionalId: "conditionalId" }, ngImport: i0, template: "<div class=\"govuk-radios__conditional govuk-radios__conditional--hidden\" [id]=\"conditionalId\">\n <ng-content></ng-content>\n</div>\n", styles: [":host{display:block}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
16
15
|
}
|
|
17
16
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: GovukRadiosConditionalComponent, decorators: [{
|
|
18
17
|
type: Component,
|
|
19
|
-
args: [{ selector: 'opal-lib-govuk-radios-conditional, [opal-lib-govuk-radios-conditional]', imports: [], changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-content></ng-content>\n" }]
|
|
18
|
+
args: [{ selector: 'opal-lib-govuk-radios-conditional, [opal-lib-govuk-radios-conditional]', imports: [], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"govuk-radios__conditional govuk-radios__conditional--hidden\" [id]=\"conditionalId\">\n <ng-content></ng-content>\n</div>\n", styles: [":host{display:block}\n"] }]
|
|
20
19
|
}], propDecorators: { conditionalId: [{
|
|
21
20
|
type: Input,
|
|
22
21
|
args: [{ required: true }]
|
|
23
|
-
}], class: [{
|
|
24
|
-
type: HostBinding,
|
|
25
|
-
args: ['class']
|
|
26
|
-
}], id: [{
|
|
27
|
-
type: HostBinding,
|
|
28
|
-
args: ['id']
|
|
29
22
|
}] } });
|
|
30
23
|
|
|
31
24
|
class GovukRadiosDividerComponent {
|
|
@@ -47,20 +40,71 @@ class GovukRadiosItemComponent {
|
|
|
47
40
|
inputValue;
|
|
48
41
|
inputValueHint;
|
|
49
42
|
ariaControls;
|
|
43
|
+
/**
|
|
44
|
+
* Assigns the FormControl used to bind the radio input.
|
|
45
|
+
* @param abstractControl - Control instance from the parent form group.
|
|
46
|
+
* @remarks Casts to FormControl for template binding.
|
|
47
|
+
*/
|
|
50
48
|
set control(abstractControl) {
|
|
51
49
|
// Form controls are passed in as abstract controls, we need to re-cast it.
|
|
52
50
|
this._control = abstractControl;
|
|
53
51
|
}
|
|
54
52
|
class = 'govuk-radios__item';
|
|
53
|
+
/**
|
|
54
|
+
* Exposes the bound FormControl to the template.
|
|
55
|
+
*/
|
|
55
56
|
get getControl() {
|
|
56
57
|
return this._control;
|
|
57
58
|
}
|
|
59
|
+
/**
|
|
60
|
+
* Normalizes the input name for safe binding.
|
|
61
|
+
* @returns Trimmed input name or empty string.
|
|
62
|
+
*/
|
|
63
|
+
get resolvedInputName() {
|
|
64
|
+
return this.inputName?.trim() ?? '';
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Ensures the radio input id is prefixed with the input name when needed.
|
|
68
|
+
* @returns Normalized id used by the input and label.
|
|
69
|
+
*/
|
|
70
|
+
get resolvedInputId() {
|
|
71
|
+
const baseId = this.inputId?.trim() ?? '';
|
|
72
|
+
const inputName = this.resolvedInputName;
|
|
73
|
+
const prefix = inputName ? `${inputName}-` : '';
|
|
74
|
+
if (!baseId || !prefix || baseId === inputName || baseId.startsWith(prefix)) {
|
|
75
|
+
return baseId;
|
|
76
|
+
}
|
|
77
|
+
return `${prefix}${baseId}`;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Normalizes aria-controls to avoid empty attributes.
|
|
81
|
+
* @returns Trimmed value or null when not provided.
|
|
82
|
+
*/
|
|
83
|
+
get dataAriaControls() {
|
|
84
|
+
const controls = this.ariaControls?.trim();
|
|
85
|
+
return controls || null;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Exposes the radio value for Angular's RadioControlValueAccessor.
|
|
89
|
+
* IMPORTANT: keep the original type (e.g. boolean) so Reactive Forms emits the correct value.
|
|
90
|
+
*/
|
|
91
|
+
get resolvedInputValue() {
|
|
92
|
+
return this.inputValue;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Normalizes the radio value to a string for the HTML attribute binding.
|
|
96
|
+
* @returns String value for the input's `value` attribute.
|
|
97
|
+
*/
|
|
98
|
+
get resolvedInputValueAttr() {
|
|
99
|
+
const v = this.inputValue;
|
|
100
|
+
return typeof v === 'string' ? v : String(v);
|
|
101
|
+
}
|
|
58
102
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: GovukRadiosItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
59
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.16", type: GovukRadiosItemComponent, isStandalone: true, selector: "opal-lib-govuk-radios-item, [opal-lib-govuk-radios-item]", inputs: { labelText: "labelText", labelClasses: "labelClasses", inputId: "inputId", inputName: "inputName", inputClasses: "inputClasses", inputValue: "inputValue", inputValueHint: "inputValueHint", ariaControls: "ariaControls", control: "control" }, host: { properties: { "class": "this.class" } }, ngImport: i0, template: "<input\n class=\"govuk-radios__input {{ inputClasses }}\"\n [id]=\"
|
|
103
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.16", type: GovukRadiosItemComponent, isStandalone: true, selector: "opal-lib-govuk-radios-item, [opal-lib-govuk-radios-item]", inputs: { labelText: "labelText", labelClasses: "labelClasses", inputId: "inputId", inputName: "inputName", inputClasses: "inputClasses", inputValue: "inputValue", inputValueHint: "inputValueHint", ariaControls: "ariaControls", control: "control" }, host: { properties: { "class": "this.class" } }, ngImport: i0, template: "<input\n class=\"govuk-radios__input {{ inputClasses }}\"\n [id]=\"resolvedInputId\"\n [name]=\"resolvedInputName\"\n [attr.name]=\"resolvedInputName\"\n [formControl]=\"getControl\"\n type=\"radio\"\n [value]=\"resolvedInputValue\"\n [attr.value]=\"resolvedInputValueAttr\"\n [attr.aria-controls]=\"dataAriaControls || null\"\n [attr.aria-describedby]=\"inputValueHint ? resolvedInputId + '-item-hint' : null\"\n/>\n<label class=\"govuk-label govuk-radios__label {{ labelClasses }}\" [for]=\"resolvedInputId\"> {{ labelText }} </label>\n@if (inputValueHint) {\n <div id=\"{{ resolvedInputId }}-item-hint\" class=\"govuk-hint govuk-radios__hint\">\n {{ inputValueHint }}\n </div>\n}\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { 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.RadioControlValueAccessor, selector: "input[type=radio][formControlName],input[type=radio][formControl],input[type=radio][ngModel]", inputs: ["name", "formControlName", "value"] }, { 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 });
|
|
60
104
|
}
|
|
61
105
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: GovukRadiosItemComponent, decorators: [{
|
|
62
106
|
type: Component,
|
|
63
|
-
args: [{ selector: 'opal-lib-govuk-radios-item, [opal-lib-govuk-radios-item]', imports: [CommonModule, ReactiveFormsModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<input\n class=\"govuk-radios__input {{ inputClasses }}\"\n [id]=\"
|
|
107
|
+
args: [{ selector: 'opal-lib-govuk-radios-item, [opal-lib-govuk-radios-item]', imports: [CommonModule, ReactiveFormsModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<input\n class=\"govuk-radios__input {{ inputClasses }}\"\n [id]=\"resolvedInputId\"\n [name]=\"resolvedInputName\"\n [attr.name]=\"resolvedInputName\"\n [formControl]=\"getControl\"\n type=\"radio\"\n [value]=\"resolvedInputValue\"\n [attr.value]=\"resolvedInputValueAttr\"\n [attr.aria-controls]=\"dataAriaControls || null\"\n [attr.aria-describedby]=\"inputValueHint ? resolvedInputId + '-item-hint' : null\"\n/>\n<label class=\"govuk-label govuk-radios__label {{ labelClasses }}\" [for]=\"resolvedInputId\"> {{ labelText }} </label>\n@if (inputValueHint) {\n <div id=\"{{ resolvedInputId }}-item-hint\" class=\"govuk-hint govuk-radios__hint\">\n {{ inputValueHint }}\n </div>\n}\n" }]
|
|
64
108
|
}], propDecorators: { labelText: [{
|
|
65
109
|
type: Input,
|
|
66
110
|
args: [{ required: true }]
|
|
@@ -94,12 +138,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
|
|
|
94
138
|
}] } });
|
|
95
139
|
|
|
96
140
|
class GovukRadioComponent {
|
|
141
|
+
elementRef = inject((ElementRef));
|
|
97
142
|
fieldSetId;
|
|
98
143
|
legendText;
|
|
99
144
|
legendHint;
|
|
100
145
|
legendClasses;
|
|
101
146
|
radioClasses;
|
|
102
147
|
errors;
|
|
148
|
+
/**
|
|
149
|
+
* Builds the aria-describedby value for the fieldset based on hint/error ids.
|
|
150
|
+
* @returns Space-separated id list or null when there is nothing to describe.
|
|
151
|
+
*/
|
|
103
152
|
get describedBy() {
|
|
104
153
|
const ids = [];
|
|
105
154
|
if (this.legendHint) {
|
|
@@ -110,13 +159,67 @@ class GovukRadioComponent {
|
|
|
110
159
|
}
|
|
111
160
|
return ids.length ? ids.join(' ') : null;
|
|
112
161
|
}
|
|
162
|
+
constructor() {
|
|
163
|
+
afterNextRender(() => {
|
|
164
|
+
// Only trigger the render of the component in the browser
|
|
165
|
+
this.initOuterRadios();
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Initializes govuk-frontend radios behavior for this component's radio group.
|
|
170
|
+
* Side effects: dynamically imports govuk-frontend, mutates dataset, logs warnings on fallback.
|
|
171
|
+
*/
|
|
172
|
+
initOuterRadios() {
|
|
173
|
+
const host = this.elementRef.nativeElement;
|
|
174
|
+
const rootRadios = host.querySelector('.govuk-radios');
|
|
175
|
+
if (!rootRadios)
|
|
176
|
+
return;
|
|
177
|
+
if (rootRadios.dataset['opalGovukRadiosInitialised'] === 'true')
|
|
178
|
+
return;
|
|
179
|
+
rootRadios.dataset['opalGovukRadiosInitialised'] = 'true';
|
|
180
|
+
this.loadGovukFrontend()
|
|
181
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
182
|
+
.then((module) => {
|
|
183
|
+
// Prefer Radios constructor for a scoped init
|
|
184
|
+
const Radios = module.Radios ?? module.radios ?? module.default?.Radios;
|
|
185
|
+
if (typeof Radios === 'function') {
|
|
186
|
+
try {
|
|
187
|
+
// scoped init for just this root
|
|
188
|
+
// eslint-disable-next-line no-new
|
|
189
|
+
new Radios(rootRadios);
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
192
|
+
catch (e) {
|
|
193
|
+
console.warn('Govuk Radios constructor failed for rootRadios, falling back to initAll', e);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
// Fallback: prefer module.initAll({ scope }) when available
|
|
197
|
+
const initAll = module.initAll ?? module.default?.initAll;
|
|
198
|
+
if (typeof initAll === 'function') {
|
|
199
|
+
initAll({ scope: rootRadios });
|
|
200
|
+
return;
|
|
201
|
+
}
|
|
202
|
+
console.warn('govuk-frontend radios init not found for rootRadios', module);
|
|
203
|
+
})
|
|
204
|
+
.catch((err) => {
|
|
205
|
+
console.error('Failed to import govuk-frontend for rootRadios init', err);
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Loads the govuk-frontend module.
|
|
210
|
+
* Wrapped for testability so unit tests can stub the dynamic import.
|
|
211
|
+
*/
|
|
212
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
213
|
+
loadGovukFrontend() {
|
|
214
|
+
return import('govuk-frontend');
|
|
215
|
+
}
|
|
113
216
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: GovukRadioComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
114
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.16", type: GovukRadioComponent, isStandalone: true, selector: "opal-lib-govuk-radio", inputs: { fieldSetId: "fieldSetId", legendText: "legendText", legendHint: "legendHint", legendClasses: "legendClasses", radioClasses: "radioClasses", errors: "errors" }, ngImport: i0, template: "<div class=\"govuk-form-group\" [class.govuk-form-group--error]=\"!!errors\">\n <fieldset class=\"govuk-fieldset\" [id]=\"fieldSetId\" [attr.aria-describedby]=\"describedBy\">\n @if (legendText) {\n <legend class=\"govuk-fieldset__legend {{ legendClasses }}\">\n {{ legendText }}\n </legend>\n }\n @if (legendHint) {\n <div [id]=\"fieldSetId ? fieldSetId + '-hint' : ''\" class=\"govuk-hint\">\n {{ legendHint }}\n </div>\n }\n\n @if (errors) {\n <p id=\"{{ this.fieldSetId }}-error-message\" class=\"govuk-error-message\">\n <span class=\"govuk-visually-hidden\">Error: </span> {{ errors }}\n </p>\n }\n <div class=\"govuk-radios {{ radioClasses }}\" data-module=\"govuk-radios\">\n
|
|
217
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.16", type: GovukRadioComponent, isStandalone: true, selector: "opal-lib-govuk-radio", inputs: { fieldSetId: "fieldSetId", legendText: "legendText", legendHint: "legendHint", legendClasses: "legendClasses", radioClasses: "radioClasses", errors: "errors" }, ngImport: i0, template: "<div class=\"govuk-form-group\" [class.govuk-form-group--error]=\"!!errors\">\n <fieldset class=\"govuk-fieldset\" [id]=\"fieldSetId\" [attr.aria-describedby]=\"describedBy\">\n @if (legendText) {\n <legend class=\"govuk-fieldset__legend {{ legendClasses }}\">\n {{ legendText }}\n </legend>\n }\n @if (legendHint) {\n <div [id]=\"fieldSetId ? fieldSetId + '-hint' : ''\" class=\"govuk-hint\">\n {{ legendHint }}\n </div>\n }\n\n @if (errors) {\n <p id=\"{{ this.fieldSetId }}-error-message\" class=\"govuk-error-message\">\n <span class=\"govuk-visually-hidden\">Error: </span> {{ errors }}\n </p>\n }\n\n <!-- single reusable radios template -->\n <ng-template #radiosGroup>\n <div class=\"govuk-radios {{ radioClasses }}\" data-module=\"govuk-radios\">\n <ng-content></ng-content>\n </div>\n </ng-template>\n\n <!-- render the radiosGroup inside the fieldset -->\n <ng-container *ngTemplateOutlet=\"radiosGroup\"></ng-container>\n </fieldset>\n</div>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: ReactiveFormsModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
115
218
|
}
|
|
116
219
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: GovukRadioComponent, decorators: [{
|
|
117
220
|
type: Component,
|
|
118
|
-
args: [{ selector: 'opal-lib-govuk-radio', imports: [], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"govuk-form-group\" [class.govuk-form-group--error]=\"!!errors\">\n <fieldset class=\"govuk-fieldset\" [id]=\"fieldSetId\" [attr.aria-describedby]=\"describedBy\">\n @if (legendText) {\n <legend class=\"govuk-fieldset__legend {{ legendClasses }}\">\n {{ legendText }}\n </legend>\n }\n @if (legendHint) {\n <div [id]=\"fieldSetId ? fieldSetId + '-hint' : ''\" class=\"govuk-hint\">\n {{ legendHint }}\n </div>\n }\n\n @if (errors) {\n <p id=\"{{ this.fieldSetId }}-error-message\" class=\"govuk-error-message\">\n <span class=\"govuk-visually-hidden\">Error: </span> {{ errors }}\n </p>\n }\n <div class=\"govuk-radios {{ radioClasses }}\" data-module=\"govuk-radios\">\n
|
|
119
|
-
}], propDecorators: { fieldSetId: [{
|
|
221
|
+
args: [{ selector: 'opal-lib-govuk-radio', imports: [CommonModule, ReactiveFormsModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"govuk-form-group\" [class.govuk-form-group--error]=\"!!errors\">\n <fieldset class=\"govuk-fieldset\" [id]=\"fieldSetId\" [attr.aria-describedby]=\"describedBy\">\n @if (legendText) {\n <legend class=\"govuk-fieldset__legend {{ legendClasses }}\">\n {{ legendText }}\n </legend>\n }\n @if (legendHint) {\n <div [id]=\"fieldSetId ? fieldSetId + '-hint' : ''\" class=\"govuk-hint\">\n {{ legendHint }}\n </div>\n }\n\n @if (errors) {\n <p id=\"{{ this.fieldSetId }}-error-message\" class=\"govuk-error-message\">\n <span class=\"govuk-visually-hidden\">Error: </span> {{ errors }}\n </p>\n }\n\n <!-- single reusable radios template -->\n <ng-template #radiosGroup>\n <div class=\"govuk-radios {{ radioClasses }}\" data-module=\"govuk-radios\">\n <ng-content></ng-content>\n </div>\n </ng-template>\n\n <!-- render the radiosGroup inside the fieldset -->\n <ng-container *ngTemplateOutlet=\"radiosGroup\"></ng-container>\n </fieldset>\n</div>\n" }]
|
|
222
|
+
}], ctorParameters: () => [], propDecorators: { fieldSetId: [{
|
|
120
223
|
type: Input,
|
|
121
224
|
args: [{ required: true }]
|
|
122
225
|
}], legendText: [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hmcts-opal-frontend-common-components-govuk-govuk-radio.mjs","sources":["../../../projects/opal-frontend-common/components/govuk/govuk-radio/govuk-radios-conditional/govuk-radios-conditional.component.ts","../../../projects/opal-frontend-common/components/govuk/govuk-radio/govuk-radios-conditional/govuk-radios-conditional.component.html","../../../projects/opal-frontend-common/components/govuk/govuk-radio/govuk-radios-divider/govuk-radios-divider.component.ts","../../../projects/opal-frontend-common/components/govuk/govuk-radio/govuk-radios-divider/govuk-radios-divider.component.html","../../../projects/opal-frontend-common/components/govuk/govuk-radio/govuk-radios-item/govuk-radios-item.component.ts","../../../projects/opal-frontend-common/components/govuk/govuk-radio/govuk-radios-item/govuk-radios-item.component.html","../../../projects/opal-frontend-common/components/govuk/govuk-radio/govuk-radio.component.ts","../../../projects/opal-frontend-common/components/govuk/govuk-radio/govuk-radio.component.html","../../../projects/opal-frontend-common/components/govuk/govuk-radio/hmcts-opal-frontend-common-components-govuk-govuk-radio.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, HostBinding, Input, OnInit } from '@angular/core';\n\n@Component({\n selector: 'opal-lib-govuk-radios-conditional, [opal-lib-govuk-radios-conditional]',\n imports: [],\n templateUrl: './govuk-radios-conditional.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class GovukRadiosConditionalComponent implements OnInit {\n @Input({ required: true }) conditionalId!: string;\n\n @HostBinding('class') class = 'govuk-radios__conditional';\n @HostBinding('id') id!: string;\n\n ngOnInit() {\n this.id = `${this.conditionalId}-conditional`;\n }\n}\n","<ng-content></ng-content>\n","import { ChangeDetectionStrategy, Component } from '@angular/core';\n\n@Component({\n selector: 'opal-lib-govuk-radios-divider',\n imports: [],\n templateUrl: './govuk-radios-divider.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class GovukRadiosDividerComponent {}\n","<div class=\"govuk-radios__divider\"><ng-content></ng-content></div>\n","import { CommonModule } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, HostBinding, Input } from '@angular/core';\nimport { FormControl, AbstractControl, ReactiveFormsModule } from '@angular/forms';\n\n@Component({\n selector: 'opal-lib-govuk-radios-item, [opal-lib-govuk-radios-item]',\n imports: [CommonModule, ReactiveFormsModule],\n templateUrl: './govuk-radios-item.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class GovukRadiosItemComponent {\n private _control!: FormControl;\n\n @Input({ required: true }) labelText!: string;\n @Input({ required: false }) labelClasses!: string;\n @Input({ required: true }) inputId!: string;\n @Input({ required: true }) inputName!: string;\n @Input({ required: false }) inputClasses!: string;\n @Input({ required: true }) inputValue!: string | boolean;\n @Input({ required: false }) inputValueHint!: string;\n @Input({ required: false }) ariaControls!: string;\n\n @Input({ required: true }) set control(abstractControl: AbstractControl | null) {\n // Form controls are passed in as abstract controls, we need to re-cast it.\n this._control = abstractControl as FormControl;\n }\n\n @HostBinding('class') class = 'govuk-radios__item';\n\n get getControl() {\n return this._control;\n }\n}\n","<input\n class=\"govuk-radios__input {{ inputClasses }}\"\n [id]=\"inputId\"\n [name]=\"inputName\"\n [formControl]=\"getControl\"\n type=\"radio\"\n [value]=\"inputValue\"\n [attr.data-aria-controls]=\"ariaControls\"\n [attr.aria-describedby]=\"inputValueHint ? inputId + '-item-hint' : null\"\n/>\n<label class=\"govuk-label govuk-radios__label {{ labelClasses }}\" [for]=\"inputId\"> {{ labelText }} </label>\n@if (inputValueHint) {\n <div id=\"{{ inputId }}-item-hint\" class=\"govuk-hint govuk-radios__hint\">\n {{ inputValueHint }}\n </div>\n}\n","import { ChangeDetectionStrategy, Component, Input } from '@angular/core';\n\n@Component({\n selector: 'opal-lib-govuk-radio',\n imports: [],\n templateUrl: './govuk-radio.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class GovukRadioComponent {\n @Input({ required: true }) fieldSetId!: string;\n\n @Input({ required: false }) legendText!: string;\n @Input({ required: false }) legendHint!: string;\n @Input({ required: false }) legendClasses!: string;\n @Input({ required: false }) radioClasses!: string;\n @Input({ required: false }) errors!: string | null;\n\n get describedBy(): string | null {\n const ids: string[] = [];\n\n if (this.legendHint) {\n ids.push(`${this.fieldSetId}-hint`);\n }\n\n if (this.errors) {\n ids.push(`${this.fieldSetId}-error-message`);\n }\n\n return ids.length ? ids.join(' ') : null;\n }\n}\n","<div class=\"govuk-form-group\" [class.govuk-form-group--error]=\"!!errors\">\n <fieldset class=\"govuk-fieldset\" [id]=\"fieldSetId\" [attr.aria-describedby]=\"describedBy\">\n @if (legendText) {\n <legend class=\"govuk-fieldset__legend {{ legendClasses }}\">\n {{ legendText }}\n </legend>\n }\n @if (legendHint) {\n <div [id]=\"fieldSetId ? fieldSetId + '-hint' : ''\" class=\"govuk-hint\">\n {{ legendHint }}\n </div>\n }\n\n @if (errors) {\n <p id=\"{{ this.fieldSetId }}-error-message\" class=\"govuk-error-message\">\n <span class=\"govuk-visually-hidden\">Error: </span> {{ errors }}\n </p>\n }\n <div class=\"govuk-radios {{ radioClasses }}\" data-module=\"govuk-radios\">\n <ng-content></ng-content>\n </div>\n </fieldset>\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;MAQa,+BAA+B,CAAA;AACf,IAAA,aAAa;IAElB,KAAK,GAAG,2BAA2B;AACtC,IAAA,EAAE;IAErB,QAAQ,GAAA;QACN,IAAI,CAAC,EAAE,GAAG,CAAA,EAAG,IAAI,CAAC,aAAa,cAAc;IAC/C;wGARW,+BAA+B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAA/B,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,+BAA+B,gPCR5C,6BACA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;4FDOa,+BAA+B,EAAA,UAAA,EAAA,CAAA;kBAN3C,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,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MAAM,GAAG,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,IAAI;IAC1C;wGArBW,mBAAmB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAnB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,mBAAmB,0PCRhC,0zBAuBA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;4FDfa,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAN/B,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,sBAAsB,EAAA,OAAA,EACvB,EAAE,EAAA,eAAA,EAEM,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,0zBAAA,EAAA;;sBAG9C,KAAK;uBAAC,EAAE,QAAQ,EAAE,IAAI,EAAE;;sBAExB,KAAK;uBAAC,EAAE,QAAQ,EAAE,KAAK,EAAE;;sBACzB,KAAK;uBAAC,EAAE,QAAQ,EAAE,KAAK,EAAE;;sBACzB,KAAK;uBAAC,EAAE,QAAQ,EAAE,KAAK,EAAE;;sBACzB,KAAK;uBAAC,EAAE,QAAQ,EAAE,KAAK,EAAE;;sBACzB,KAAK;uBAAC,EAAE,QAAQ,EAAE,KAAK,EAAE;;;AEf5B;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"hmcts-opal-frontend-common-components-govuk-govuk-radio.mjs","sources":["../../../projects/opal-frontend-common/components/govuk/govuk-radio/govuk-radios-conditional/govuk-radios-conditional.component.ts","../../../projects/opal-frontend-common/components/govuk/govuk-radio/govuk-radios-conditional/govuk-radios-conditional.component.html","../../../projects/opal-frontend-common/components/govuk/govuk-radio/govuk-radios-divider/govuk-radios-divider.component.ts","../../../projects/opal-frontend-common/components/govuk/govuk-radio/govuk-radios-divider/govuk-radios-divider.component.html","../../../projects/opal-frontend-common/components/govuk/govuk-radio/govuk-radios-item/govuk-radios-item.component.ts","../../../projects/opal-frontend-common/components/govuk/govuk-radio/govuk-radios-item/govuk-radios-item.component.html","../../../projects/opal-frontend-common/components/govuk/govuk-radio/govuk-radio.component.ts","../../../projects/opal-frontend-common/components/govuk/govuk-radio/govuk-radio.component.html","../../../projects/opal-frontend-common/components/govuk/govuk-radio/hmcts-opal-frontend-common-components-govuk-govuk-radio.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, Input } from '@angular/core';\n\n@Component({\n selector: 'opal-lib-govuk-radios-conditional, [opal-lib-govuk-radios-conditional]',\n imports: [],\n templateUrl: './govuk-radios-conditional.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n styleUrls: ['./govuk-radios-conditional.component.scss'],\n})\nexport class GovukRadiosConditionalComponent {\n /**\n * Id used by aria-controls to connect a radio input to this conditional panel.\n */\n @Input({ required: true }) conditionalId!: string;\n}\n","<div class=\"govuk-radios__conditional govuk-radios__conditional--hidden\" [id]=\"conditionalId\">\n <ng-content></ng-content>\n</div>\n","import { ChangeDetectionStrategy, Component } from '@angular/core';\n\n@Component({\n selector: 'opal-lib-govuk-radios-divider',\n imports: [],\n templateUrl: './govuk-radios-divider.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class GovukRadiosDividerComponent {}\n","<div class=\"govuk-radios__divider\"><ng-content></ng-content></div>\n","import { CommonModule } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, HostBinding, Input } from '@angular/core';\nimport { FormControl, AbstractControl, ReactiveFormsModule } from '@angular/forms';\n\n@Component({\n selector: 'opal-lib-govuk-radios-item, [opal-lib-govuk-radios-item]',\n imports: [CommonModule, ReactiveFormsModule],\n templateUrl: './govuk-radios-item.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class GovukRadiosItemComponent {\n private _control!: FormControl;\n\n @Input({ required: true }) labelText!: string;\n @Input({ required: false }) labelClasses!: string;\n @Input({ required: true }) inputId!: string;\n @Input({ required: true }) inputName!: string;\n @Input({ required: false }) inputClasses!: string;\n @Input({ required: true }) inputValue!: string | boolean;\n @Input({ required: false }) inputValueHint!: string;\n @Input({ required: false }) ariaControls!: string;\n\n /**\n * Assigns the FormControl used to bind the radio input.\n * @param abstractControl - Control instance from the parent form group.\n * @remarks Casts to FormControl for template binding.\n */\n @Input({ required: true }) set control(abstractControl: AbstractControl | null) {\n // Form controls are passed in as abstract controls, we need to re-cast it.\n this._control = abstractControl as FormControl;\n }\n\n @HostBinding('class') class = 'govuk-radios__item';\n\n /**\n * Exposes the bound FormControl to the template.\n */\n get getControl() {\n return this._control;\n }\n\n /**\n * Normalizes the input name for safe binding.\n * @returns Trimmed input name or empty string.\n */\n get resolvedInputName(): string {\n return this.inputName?.trim() ?? '';\n }\n\n /**\n * Ensures the radio input id is prefixed with the input name when needed.\n * @returns Normalized id used by the input and label.\n */\n get resolvedInputId(): string {\n const baseId = this.inputId?.trim() ?? '';\n const inputName = this.resolvedInputName;\n const prefix = inputName ? `${inputName}-` : '';\n\n if (!baseId || !prefix || baseId === inputName || baseId.startsWith(prefix)) {\n return baseId;\n }\n\n return `${prefix}${baseId}`;\n }\n\n /**\n * Normalizes aria-controls to avoid empty attributes.\n * @returns Trimmed value or null when not provided.\n */\n get dataAriaControls(): string | null {\n const controls = this.ariaControls?.trim();\n return controls || null;\n }\n\n /**\n * Exposes the radio value for Angular's RadioControlValueAccessor.\n * IMPORTANT: keep the original type (e.g. boolean) so Reactive Forms emits the correct value.\n */\n get resolvedInputValue(): string | boolean {\n return this.inputValue;\n }\n\n /**\n * Normalizes the radio value to a string for the HTML attribute binding.\n * @returns String value for the input's `value` attribute.\n */\n get resolvedInputValueAttr(): string {\n const v = this.inputValue;\n return typeof v === 'string' ? v : String(v);\n }\n}\n","<input\n class=\"govuk-radios__input {{ inputClasses }}\"\n [id]=\"resolvedInputId\"\n [name]=\"resolvedInputName\"\n [attr.name]=\"resolvedInputName\"\n [formControl]=\"getControl\"\n type=\"radio\"\n [value]=\"resolvedInputValue\"\n [attr.value]=\"resolvedInputValueAttr\"\n [attr.aria-controls]=\"dataAriaControls || null\"\n [attr.aria-describedby]=\"inputValueHint ? resolvedInputId + '-item-hint' : null\"\n/>\n<label class=\"govuk-label govuk-radios__label {{ labelClasses }}\" [for]=\"resolvedInputId\"> {{ labelText }} </label>\n@if (inputValueHint) {\n <div id=\"{{ resolvedInputId }}-item-hint\" class=\"govuk-hint govuk-radios__hint\">\n {{ inputValueHint }}\n </div>\n}\n","import { afterNextRender, ChangeDetectionStrategy, Component, ElementRef, inject, Input } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { ReactiveFormsModule } from '@angular/forms';\n\n@Component({\n selector: 'opal-lib-govuk-radio',\n imports: [CommonModule, ReactiveFormsModule],\n templateUrl: './govuk-radio.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class GovukRadioComponent {\n private readonly elementRef = inject(ElementRef<HTMLElement>);\n\n @Input({ required: true }) fieldSetId!: string;\n @Input({ required: false }) legendText!: string;\n @Input({ required: false }) legendHint!: string;\n @Input({ required: false }) legendClasses!: string;\n @Input({ required: false }) radioClasses!: string;\n @Input({ required: false }) errors!: string | null;\n\n /**\n * Builds the aria-describedby value for the fieldset based on hint/error ids.\n * @returns Space-separated id list or null when there is nothing to describe.\n */\n get describedBy(): string | null {\n const ids: string[] = [];\n\n if (this.legendHint) {\n ids.push(`${this.fieldSetId}-hint`);\n }\n\n if (this.errors) {\n ids.push(`${this.fieldSetId}-error-message`);\n }\n\n return ids.length ? ids.join(' ') : null;\n }\n\n constructor() {\n afterNextRender(() => {\n // Only trigger the render of the component in the browser\n this.initOuterRadios();\n });\n }\n\n /**\n * Initializes govuk-frontend radios behavior for this component's radio group.\n * Side effects: dynamically imports govuk-frontend, mutates dataset, logs warnings on fallback.\n */\n private initOuterRadios(): void {\n const host = this.elementRef.nativeElement;\n const rootRadios = host.querySelector('.govuk-radios') as HTMLElement | null;\n if (!rootRadios) return;\n\n if (rootRadios.dataset['opalGovukRadiosInitialised'] === 'true') return;\n rootRadios.dataset['opalGovukRadiosInitialised'] = 'true';\n\n this.loadGovukFrontend()\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n .then((module: any) => {\n // Prefer Radios constructor for a scoped init\n const Radios = module.Radios ?? module.radios ?? module.default?.Radios;\n if (typeof Radios === 'function') {\n try {\n // scoped init for just this root\n // eslint-disable-next-line no-new\n new Radios(rootRadios);\n return;\n } catch (e) {\n console.warn('Govuk Radios constructor failed for rootRadios, falling back to initAll', e);\n }\n }\n\n // Fallback: prefer module.initAll({ scope }) when available\n const initAll = module.initAll ?? module.default?.initAll;\n if (typeof initAll === 'function') {\n initAll({ scope: rootRadios });\n return;\n }\n\n console.warn('govuk-frontend radios init not found for rootRadios', module);\n })\n .catch((err) => {\n console.error('Failed to import govuk-frontend for rootRadios init', err);\n });\n }\n\n /**\n * Loads the govuk-frontend module.\n * Wrapped for testability so unit tests can stub the dynamic import.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n protected loadGovukFrontend(): Promise<any> {\n return import('govuk-frontend');\n }\n}\n","<div class=\"govuk-form-group\" [class.govuk-form-group--error]=\"!!errors\">\n <fieldset class=\"govuk-fieldset\" [id]=\"fieldSetId\" [attr.aria-describedby]=\"describedBy\">\n @if (legendText) {\n <legend class=\"govuk-fieldset__legend {{ legendClasses }}\">\n {{ legendText }}\n </legend>\n }\n @if (legendHint) {\n <div [id]=\"fieldSetId ? fieldSetId + '-hint' : ''\" class=\"govuk-hint\">\n {{ legendHint }}\n </div>\n }\n\n @if (errors) {\n <p id=\"{{ this.fieldSetId }}-error-message\" class=\"govuk-error-message\">\n <span class=\"govuk-visually-hidden\">Error: </span> {{ errors }}\n </p>\n }\n\n <!-- single reusable radios template -->\n <ng-template #radiosGroup>\n <div class=\"govuk-radios {{ radioClasses }}\" data-module=\"govuk-radios\">\n <ng-content></ng-content>\n </div>\n </ng-template>\n\n <!-- render the radiosGroup inside the fieldset -->\n <ng-container *ngTemplateOutlet=\"radiosGroup\"></ng-container>\n </fieldset>\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;MASa,+BAA+B,CAAA;AAC1C;;AAEG;AACwB,IAAA,aAAa;wGAJ7B,+BAA+B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAA/B,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,+BAA+B,8KCT5C,2IAGA,EAAA,MAAA,EAAA,CAAA,wBAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;4FDMa,+BAA+B,EAAA,UAAA,EAAA,CAAA;kBAP3C,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,wEAAwE,EAAA,OAAA,EACzE,EAAE,EAAA,eAAA,EAEM,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,2IAAA,EAAA,MAAA,EAAA,CAAA,wBAAA,CAAA,EAAA;;sBAO9C,KAAK;uBAAC,EAAE,QAAQ,EAAE,IAAI,EAAE;;;MELd,2BAA2B,CAAA;wGAA3B,2BAA2B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAA3B,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,2BAA2B,yFCRxC,wEACA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;4FDOa,2BAA2B,EAAA,UAAA,EAAA,CAAA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A,EAAA,IAAA,EDxBY,YAAY,uMAAE,mBAAmB,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;4FAIhC,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAN/B,SAAS;+BACE,sBAAsB,EAAA,OAAA,EACvB,CAAC,YAAY,EAAE,mBAAmB,CAAC,EAAA,eAAA,EAE3B,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,oiCAAA,EAAA;;sBAK9C,KAAK;uBAAC,EAAE,QAAQ,EAAE,IAAI,EAAE;;sBACxB,KAAK;uBAAC,EAAE,QAAQ,EAAE,KAAK,EAAE;;sBACzB,KAAK;uBAAC,EAAE,QAAQ,EAAE,KAAK,EAAE;;sBACzB,KAAK;uBAAC,EAAE,QAAQ,EAAE,KAAK,EAAE;;sBACzB,KAAK;uBAAC,EAAE,QAAQ,EAAE,KAAK,EAAE;;sBACzB,KAAK;uBAAC,EAAE,QAAQ,EAAE,KAAK,EAAE;;;AElB5B;;AAEG;;;;"}
|
package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-tabs-govuk-tabs-list-item.mjs
CHANGED
|
@@ -12,6 +12,9 @@ class GovukTabsListItemComponent {
|
|
|
12
12
|
get hostClass() {
|
|
13
13
|
return this.isActive ? 'govuk-tabs__list-item govuk-tabs__list-item--selected' : 'govuk-tabs__list-item';
|
|
14
14
|
}
|
|
15
|
+
get hostRole() {
|
|
16
|
+
return 'presentation';
|
|
17
|
+
}
|
|
15
18
|
/**
|
|
16
19
|
* Resolves the tab item ID, using the tabs prefix when none is provided.
|
|
17
20
|
*/
|
|
@@ -44,7 +47,7 @@ class GovukTabsListItemComponent {
|
|
|
44
47
|
this.router.navigate(['./'], { relativeTo: this.route, fragment });
|
|
45
48
|
}
|
|
46
49
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: GovukTabsListItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
47
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.16", type: GovukTabsListItemComponent, isStandalone: true, selector: "opal-lib-govuk-tabs-list-item, [opal-lib-govuk-tabs-list-item]", inputs: { tabItemId: "tabItemId", tabItemFragment: "tabItemFragment", activeTabItemFragment: "activeTabItemFragment" }, host: { properties: { "class": "this.hostClass" } }, ngImport: i0, template: "<a\n #tabLink\n class=\"govuk-tabs__tab\"\n (click)=\"handleItemClick($event, tabItemFragment)\"\n [attr.href]=\"'#' + tabItemFragment\"\n [id]=\"resolvedTabItemId\"\n role=\"tab\"\n [attr.aria-controls]=\"tabItemFragment\"\n [attr.aria-selected]=\"isActive ? 'true' : 'false'\"\n [attr.tabindex]=\"isActive ? 0 : -1\"\n>\n <ng-content></ng-content>\n</a>\n", changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
50
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.16", type: GovukTabsListItemComponent, isStandalone: true, selector: "opal-lib-govuk-tabs-list-item, [opal-lib-govuk-tabs-list-item]", inputs: { tabItemId: "tabItemId", tabItemFragment: "tabItemFragment", activeTabItemFragment: "activeTabItemFragment" }, host: { properties: { "class": "this.hostClass", "attr.role": "this.hostRole" } }, ngImport: i0, template: "<a\n #tabLink\n class=\"govuk-tabs__tab\"\n (click)=\"handleItemClick($event, tabItemFragment)\"\n [attr.href]=\"'#' + tabItemFragment\"\n [id]=\"resolvedTabItemId\"\n role=\"tab\"\n [attr.aria-controls]=\"tabItemFragment\"\n [attr.aria-selected]=\"isActive ? 'true' : 'false'\"\n [attr.tabindex]=\"isActive ? 0 : -1\"\n>\n <ng-content></ng-content>\n</a>\n", changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
48
51
|
}
|
|
49
52
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: GovukTabsListItemComponent, decorators: [{
|
|
50
53
|
type: Component,
|
|
@@ -61,6 +64,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
|
|
|
61
64
|
}], hostClass: [{
|
|
62
65
|
type: HostBinding,
|
|
63
66
|
args: ['class']
|
|
67
|
+
}], hostRole: [{
|
|
68
|
+
type: HostBinding,
|
|
69
|
+
args: ['attr.role']
|
|
64
70
|
}] } });
|
|
65
71
|
|
|
66
72
|
/**
|
package/fesm2022/hmcts-opal-frontend-common-components-govuk-govuk-tabs-govuk-tabs-list-item.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hmcts-opal-frontend-common-components-govuk-govuk-tabs-govuk-tabs-list-item.mjs","sources":["../../../projects/opal-frontend-common/components/govuk/govuk-tabs/govuk-tabs-list-item/govuk-tabs-list-item.component.ts","../../../projects/opal-frontend-common/components/govuk/govuk-tabs/govuk-tabs-list-item/govuk-tabs-list-item.component.html","../../../projects/opal-frontend-common/components/govuk/govuk-tabs/govuk-tabs-list-item/hmcts-opal-frontend-common-components-govuk-govuk-tabs-govuk-tabs-list-item.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, ElementRef, HostBinding, Input, inject } from '@angular/core';\nimport { Router, ActivatedRoute } from '@angular/router';\n\n@Component({\n selector: 'opal-lib-govuk-tabs-list-item, [opal-lib-govuk-tabs-list-item]',\n templateUrl: './govuk-tabs-list-item.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class GovukTabsListItemComponent {\n private readonly router = inject(Router);\n private readonly route = inject(ActivatedRoute);\n private readonly elementRef = inject(ElementRef<HTMLElement>);\n\n @Input({ required: false }) public tabItemId?: string;\n @Input({ required: true }) public tabItemFragment!: string;\n @Input({ required: true }) public activeTabItemFragment!: string;\n\n @HostBinding('class')\n /**\n * Returns the host class based on active state.\n */\n get hostClass(): string {\n return this.isActive ? 'govuk-tabs__list-item govuk-tabs__list-item--selected' : 'govuk-tabs__list-item';\n }\n\n /**\n * Resolves the tab item ID, using the tabs prefix when none is provided.\n */\n get resolvedTabItemId(): string {\n if (this.tabItemId) {\n return this.tabItemId;\n }\n\n const prefix = this.elementRef.nativeElement.closest('.govuk-tabs')?.id ?? 'tab';\n return `${prefix}-${this.tabItemFragment}`;\n }\n\n /**\n * Indicates whether this tab matches the active fragment.\n */\n get isActive(): boolean {\n return this.activeTabItemFragment === this.tabItemFragment;\n }\n\n /**\n * Handles the click event of a sub-navigation item.\n * @param event - The click event.\n * @param item - The item string.\n */\n public handleItemClick(event: Event, item: string): void {\n event.preventDefault();\n this.activate(item);\n }\n\n /**\n * Navigates to the provided fragment.\n */\n public activate(fragment: string): void {\n this.router.navigate(['./'], { relativeTo: this.route, fragment });\n }\n}\n","<a\n #tabLink\n class=\"govuk-tabs__tab\"\n (click)=\"handleItemClick($event, tabItemFragment)\"\n [attr.href]=\"'#' + tabItemFragment\"\n [id]=\"resolvedTabItemId\"\n role=\"tab\"\n [attr.aria-controls]=\"tabItemFragment\"\n [attr.aria-selected]=\"isActive ? 'true' : 'false'\"\n [attr.tabindex]=\"isActive ? 0 : -1\"\n>\n <ng-content></ng-content>\n</a>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;MAQa,0BAA0B,CAAA;AACpB,IAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;AACvB,IAAA,KAAK,GAAG,MAAM,CAAC,cAAc,CAAC;AAC9B,IAAA,UAAU,GAAG,MAAM,EAAC,UAAuB,EAAC;AAE1B,IAAA,SAAS;AACV,IAAA,eAAe;AACf,IAAA,qBAAqB;AAEvD,IAAA,IAII,SAAS,GAAA;QACX,OAAO,IAAI,CAAC,QAAQ,GAAG,uDAAuD,GAAG,uBAAuB;IAC1G;AAEA;;AAEG;AACH,IAAA,IAAI,iBAAiB,GAAA;AACnB,QAAA,IAAI,IAAI,CAAC,SAAS,EAAE;YAClB,OAAO,IAAI,CAAC,SAAS;QACvB;AAEA,QAAA,MAAM,MAAM,GAAG,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,OAAO,CAAC,aAAa,CAAC,EAAE,EAAE,IAAI,KAAK;AAChF,QAAA,OAAO,GAAG,MAAM,CAAA,CAAA,EAAI,IAAI,CAAC,eAAe,EAAE;IAC5C;AAEA;;AAEG;AACH,IAAA,IAAI,QAAQ,GAAA;AACV,QAAA,OAAO,IAAI,CAAC,qBAAqB,KAAK,IAAI,CAAC,eAAe;IAC5D;AAEA;;;;AAIG;IACI,eAAe,CAAC,KAAY,EAAE,IAAY,EAAA;QAC/C,KAAK,CAAC,cAAc,EAAE;AACtB,QAAA,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC;IACrB;AAEA;;AAEG;AACI,IAAA,QAAQ,CAAC,QAAgB,EAAA;AAC9B,QAAA,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,UAAU,EAAE,IAAI,CAAC,KAAK,EAAE,QAAQ,EAAE,CAAC;IACpE;
|
|
1
|
+
{"version":3,"file":"hmcts-opal-frontend-common-components-govuk-govuk-tabs-govuk-tabs-list-item.mjs","sources":["../../../projects/opal-frontend-common/components/govuk/govuk-tabs/govuk-tabs-list-item/govuk-tabs-list-item.component.ts","../../../projects/opal-frontend-common/components/govuk/govuk-tabs/govuk-tabs-list-item/govuk-tabs-list-item.component.html","../../../projects/opal-frontend-common/components/govuk/govuk-tabs/govuk-tabs-list-item/hmcts-opal-frontend-common-components-govuk-govuk-tabs-govuk-tabs-list-item.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, ElementRef, HostBinding, Input, inject } from '@angular/core';\nimport { Router, ActivatedRoute } from '@angular/router';\n\n@Component({\n selector: 'opal-lib-govuk-tabs-list-item, [opal-lib-govuk-tabs-list-item]',\n templateUrl: './govuk-tabs-list-item.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class GovukTabsListItemComponent {\n private readonly router = inject(Router);\n private readonly route = inject(ActivatedRoute);\n private readonly elementRef = inject(ElementRef<HTMLElement>);\n\n @Input({ required: false }) public tabItemId?: string;\n @Input({ required: true }) public tabItemFragment!: string;\n @Input({ required: true }) public activeTabItemFragment!: string;\n\n @HostBinding('class')\n /**\n * Returns the host class based on active state.\n */\n get hostClass(): string {\n return this.isActive ? 'govuk-tabs__list-item govuk-tabs__list-item--selected' : 'govuk-tabs__list-item';\n }\n\n @HostBinding('attr.role')\n /**\n * Sets the host role attribute.\n */\n get hostRole(): string {\n return 'presentation';\n }\n\n /**\n * Resolves the tab item ID, using the tabs prefix when none is provided.\n */\n get resolvedTabItemId(): string {\n if (this.tabItemId) {\n return this.tabItemId;\n }\n\n const prefix = this.elementRef.nativeElement.closest('.govuk-tabs')?.id ?? 'tab';\n return `${prefix}-${this.tabItemFragment}`;\n }\n\n /**\n * Indicates whether this tab matches the active fragment.\n */\n get isActive(): boolean {\n return this.activeTabItemFragment === this.tabItemFragment;\n }\n\n /**\n * Handles the click event of a sub-navigation item.\n * @param event - The click event.\n * @param item - The item string.\n */\n public handleItemClick(event: Event, item: string): void {\n event.preventDefault();\n this.activate(item);\n }\n\n /**\n * Navigates to the provided fragment.\n */\n public activate(fragment: string): void {\n this.router.navigate(['./'], { relativeTo: this.route, fragment });\n }\n}\n","<a\n #tabLink\n class=\"govuk-tabs__tab\"\n (click)=\"handleItemClick($event, tabItemFragment)\"\n [attr.href]=\"'#' + tabItemFragment\"\n [id]=\"resolvedTabItemId\"\n role=\"tab\"\n [attr.aria-controls]=\"tabItemFragment\"\n [attr.aria-selected]=\"isActive ? 'true' : 'false'\"\n [attr.tabindex]=\"isActive ? 0 : -1\"\n>\n <ng-content></ng-content>\n</a>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;MAQa,0BAA0B,CAAA;AACpB,IAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;AACvB,IAAA,KAAK,GAAG,MAAM,CAAC,cAAc,C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AA,EAAA,IAAA,EAAA,0BAA0B,qUCRvC,iXAaA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;4FDLa,0BAA0B,EAAA,UAAA,EAAA,CAAA;kBALtC,SAAS;+BACE,gEAAgE,EAAA,eAAA,EAEzD,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,iXAAA,EAAA;;sBAO9C,KAAK;uBAAC,EAAE,QAAQ,EAAE,KAAK,EAAE;;sBACzB,KAAK;uBAAC,EAAE,QAAQ,EAAE,IAAI,EAAE;;sBACxB,KAAK;uBAAC,EAAE,QAAQ,EAAE,IAAI,EAAE;;sBAExB,WAAW;uBAAC,OAAO;;sBAQnB,WAAW;uBAAC,WAAW;;;AEzB1B;;AAEG;;;;"}
|
|
@@ -16,6 +16,12 @@ class GovukTabsComponent {
|
|
|
16
16
|
get titleId() {
|
|
17
17
|
return `${this.tabId}-title`;
|
|
18
18
|
}
|
|
19
|
+
/*
|
|
20
|
+
* Returns the role attribute for the tabs list.
|
|
21
|
+
*/
|
|
22
|
+
get role() {
|
|
23
|
+
return 'tablist';
|
|
24
|
+
}
|
|
19
25
|
/**
|
|
20
26
|
* Subscribes to URL fragment changes and emits active tab updates.
|
|
21
27
|
*/
|
|
@@ -45,11 +51,11 @@ class GovukTabsComponent {
|
|
|
45
51
|
this.ngUnsubscribe.complete();
|
|
46
52
|
}
|
|
47
53
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: GovukTabsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
48
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.16", type: GovukTabsComponent, isStandalone: true, selector: "opal-lib-govuk-tabs", inputs: { tabId: "tabId", titleText: "titleText" }, outputs: { activeTabFragmentChange: "activeTabFragmentChange" }, ngImport: i0, template: "<div class=\"govuk-tabs govuk-frontend-supported\" data-module=\"govuk-tabs\" [id]=\"tabId\">\n <h2 class=\"govuk-tabs__title\" [id]=\"titleId\">{{ titleText }}</h2>\n <ul class=\"govuk-tabs__list\" [attr.aria-labelledby]=\"titleId\">\n <ng-content select=\"[tab-list-items]\"></ng-content>\n </ul>\n <ng-content select=\"[tab-panels]\"></ng-content>\n</div>\n", changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
54
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.16", type: GovukTabsComponent, isStandalone: true, selector: "opal-lib-govuk-tabs", inputs: { tabId: "tabId", titleText: "titleText" }, outputs: { activeTabFragmentChange: "activeTabFragmentChange" }, ngImport: i0, template: "<div class=\"govuk-tabs govuk-frontend-supported\" data-module=\"govuk-tabs\" [id]=\"tabId\">\n <h2 class=\"govuk-tabs__title\" [id]=\"titleId\">{{ titleText }}</h2>\n <ul class=\"govuk-tabs__list\" [attr.aria-labelledby]=\"titleId\" [attr.role]=\"role\">\n <ng-content select=\"[tab-list-items]\"></ng-content>\n </ul>\n <ng-content select=\"[tab-panels]\"></ng-content>\n</div>\n", changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
49
55
|
}
|
|
50
56
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: GovukTabsComponent, decorators: [{
|
|
51
57
|
type: Component,
|
|
52
|
-
args: [{ selector: 'opal-lib-govuk-tabs', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"govuk-tabs govuk-frontend-supported\" data-module=\"govuk-tabs\" [id]=\"tabId\">\n <h2 class=\"govuk-tabs__title\" [id]=\"titleId\">{{ titleText }}</h2>\n <ul class=\"govuk-tabs__list\" [attr.aria-labelledby]=\"titleId\">\n <ng-content select=\"[tab-list-items]\"></ng-content>\n </ul>\n <ng-content select=\"[tab-panels]\"></ng-content>\n</div>\n" }]
|
|
58
|
+
args: [{ selector: 'opal-lib-govuk-tabs', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"govuk-tabs govuk-frontend-supported\" data-module=\"govuk-tabs\" [id]=\"tabId\">\n <h2 class=\"govuk-tabs__title\" [id]=\"titleId\">{{ titleText }}</h2>\n <ul class=\"govuk-tabs__list\" [attr.aria-labelledby]=\"titleId\" [attr.role]=\"role\">\n <ng-content select=\"[tab-list-items]\"></ng-content>\n </ul>\n <ng-content select=\"[tab-panels]\"></ng-content>\n</div>\n" }]
|
|
53
59
|
}], propDecorators: { tabId: [{
|
|
54
60
|
type: Input,
|
|
55
61
|
args: [{ required: false }]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hmcts-opal-frontend-common-components-govuk-govuk-tabs.mjs","sources":["../../../projects/opal-frontend-common/components/govuk/govuk-tabs/govuk-tabs.component.ts","../../../projects/opal-frontend-common/components/govuk/govuk-tabs/govuk-tabs.component.html","../../../projects/opal-frontend-common/components/govuk/govuk-tabs/hmcts-opal-frontend-common-components-govuk-govuk-tabs.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n EventEmitter,\n Input,\n OnDestroy,\n OnInit,\n Output,\n inject,\n} from '@angular/core';\nimport { ActivatedRoute } from '@angular/router';\nimport { Subject, takeUntil } from 'rxjs';\n\nlet nextTabsId = 0;\n\n@Component({\n selector: 'opal-lib-govuk-tabs',\n templateUrl: './govuk-tabs.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class GovukTabsComponent implements OnInit, OnDestroy {\n private readonly route = inject(ActivatedRoute);\n private readonly ngUnsubscribe = new Subject<void>();\n\n @Input({ required: false }) public tabId = `govuk-tabs-${++nextTabsId}`;\n @Input({ required: false }) public titleText = 'Contents';\n @Output() public activeTabFragmentChange = new EventEmitter<string>();\n\n /**\n * Returns the ID for the tabs title element.\n */\n get titleId(): string {\n return `${this.tabId}-title`;\n }\n\n /**\n * Subscribes to URL fragment changes and emits active tab updates.\n */\n private setupListeners(): void {\n this.route.fragment.pipe(takeUntil(this.ngUnsubscribe)).subscribe((fragment) => {\n if (fragment) {\n this.activeTabFragmentChange.emit(fragment);\n }\n });\n }\n\n /**\n * Angular lifecycle hook that is called after the component's data-bound properties have been initialized.\n * Initializes the component by setting up necessary event listeners.\n *\n * @remarks\n * This method is part of the Angular OnInit lifecycle interface.\n */\n public ngOnInit(): void {\n this.setupListeners();\n }\n\n /**\n * Lifecycle hook that is called when the component is about to be destroyed.\n * Unsubscribes from the route fragment subscription.\n */\n public ngOnDestroy(): void {\n this.ngUnsubscribe.next();\n this.ngUnsubscribe.complete();\n }\n\n // GOV.UK tabs keyboard navigation is handled by govuk-frontend JavaScript when enabled.\n}\n","<div class=\"govuk-tabs govuk-frontend-supported\" data-module=\"govuk-tabs\" [id]=\"tabId\">\n <h2 class=\"govuk-tabs__title\" [id]=\"titleId\">{{ titleText }}</h2>\n <ul class=\"govuk-tabs__list\" [attr.aria-labelledby]=\"titleId\">\n <ng-content select=\"[tab-list-items]\"></ng-content>\n </ul>\n <ng-content select=\"[tab-panels]\"></ng-content>\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;AAaA,IAAI,UAAU,GAAG,CAAC;MAOL,kBAAkB,CAAA;AACZ,IAAA,KAAK,GAAG,MAAM,CAAC,cAAc,CAAC;AAC9B,IAAA,aAAa,GAAG,IAAI,OAAO,EAAQ;AAEjB,IAAA,KAAK,GAAG,CAAA,WAAA,EAAc,EAAE,UAAU,EAAE;IACpC,SAAS,GAAG,UAAU;AACxC,IAAA,uBAAuB,GAAG,IAAI,YAAY,EAAU;AAErE;;AAEG;AACH,IAAA,IAAI,OAAO,GAAA;AACT,QAAA,OAAO,CAAA,EAAG,IAAI,CAAC,KAAK,QAAQ;IAC9B;AAEA;;AAEG;IACK,cAAc,GAAA;QACpB,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,QAAQ,KAAI;YAC7E,IAAI,QAAQ,EAAE;AACZ,gBAAA,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC,QAAQ,CAAC;YAC7C;AACF,QAAA,CAAC,CAAC;IACJ;AAEA;;;;;;AAMG;IACI,QAAQ,GAAA;QACb,IAAI,CAAC,cAAc,EAAE;IACvB;AAEA;;;AAGG;IACI,WAAW,GAAA;AAChB,QAAA,IAAI,CAAC,aAAa,CAAC,IAAI,EAAE;AACzB,QAAA,IAAI,CAAC,aAAa,CAAC,QAAQ,EAAE;IAC/B;
|
|
1
|
+
{"version":3,"file":"hmcts-opal-frontend-common-components-govuk-govuk-tabs.mjs","sources":["../../../projects/opal-frontend-common/components/govuk/govuk-tabs/govuk-tabs.component.ts","../../../projects/opal-frontend-common/components/govuk/govuk-tabs/govuk-tabs.component.html","../../../projects/opal-frontend-common/components/govuk/govuk-tabs/hmcts-opal-frontend-common-components-govuk-govuk-tabs.ts"],"sourcesContent":["import {\n ChangeDetectionStrategy,\n Component,\n EventEmitter,\n Input,\n OnDestroy,\n OnInit,\n Output,\n inject,\n} from '@angular/core';\nimport { ActivatedRoute } from '@angular/router';\nimport { Subject, takeUntil } from 'rxjs';\n\nlet nextTabsId = 0;\n\n@Component({\n selector: 'opal-lib-govuk-tabs',\n templateUrl: './govuk-tabs.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class GovukTabsComponent implements OnInit, OnDestroy {\n private readonly route = inject(ActivatedRoute);\n private readonly ngUnsubscribe = new Subject<void>();\n\n @Input({ required: false }) public tabId = `govuk-tabs-${++nextTabsId}`;\n @Input({ required: false }) public titleText = 'Contents';\n @Output() public activeTabFragmentChange = new EventEmitter<string>();\n\n /**\n * Returns the ID for the tabs title element.\n */\n get titleId(): string {\n return `${this.tabId}-title`;\n }\n\n /*\n * Returns the role attribute for the tabs list.\n */\n get role(): string {\n return 'tablist';\n }\n\n /**\n * Subscribes to URL fragment changes and emits active tab updates.\n */\n private setupListeners(): void {\n this.route.fragment.pipe(takeUntil(this.ngUnsubscribe)).subscribe((fragment) => {\n if (fragment) {\n this.activeTabFragmentChange.emit(fragment);\n }\n });\n }\n\n /**\n * Angular lifecycle hook that is called after the component's data-bound properties have been initialized.\n * Initializes the component by setting up necessary event listeners.\n *\n * @remarks\n * This method is part of the Angular OnInit lifecycle interface.\n */\n public ngOnInit(): void {\n this.setupListeners();\n }\n\n /**\n * Lifecycle hook that is called when the component is about to be destroyed.\n * Unsubscribes from the route fragment subscription.\n */\n public ngOnDestroy(): void {\n this.ngUnsubscribe.next();\n this.ngUnsubscribe.complete();\n }\n\n // GOV.UK tabs keyboard navigation is handled by govuk-frontend JavaScript when enabled.\n}\n","<div class=\"govuk-tabs govuk-frontend-supported\" data-module=\"govuk-tabs\" [id]=\"tabId\">\n <h2 class=\"govuk-tabs__title\" [id]=\"titleId\">{{ titleText }}</h2>\n <ul class=\"govuk-tabs__list\" [attr.aria-labelledby]=\"titleId\" [attr.role]=\"role\">\n <ng-content select=\"[tab-list-items]\"></ng-content>\n </ul>\n <ng-content select=\"[tab-panels]\"></ng-content>\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;AAaA,IAAI,UAAU,GAAG,CAAC;MAOL,kBAAkB,CAAA;AACZ,IAAA,KAAK,GAAG,MAAM,CAAC,cAAc,CAAC;AAC9B,IAAA,aAAa,GAAG,IAAI,OAAO,EAAQ;AAEjB,IAAA,KAAK,GAAG,CAAA,WAAA,EAAc,EAAE,UAAU,EAAE;IACpC,SAAS,GAAG,UAAU;AACxC,IAAA,uBAAuB,GAAG,IAAI,YAAY,EAAU;AAErE;;AAEG;AACH,IAAA,IAAI,OAAO,GAAA;AACT,QAAA,OAAO,CAAA,EAAG,IAAI,CAAC,KAAK,QAAQ;IAC9B;AAEA;;AAEG;AACH,IAAA,IAAI,IAAI,GAAA;AACN,QAAA,OAAO,SAAS;IAClB;AAEA;;AAEG;IACK,cAAc,GAAA;QACpB,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,QAAQ,KAAI;YAC7E,IAAI,QAAQ,EAAE;AACZ,gBAAA,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC,QAAQ,CAAC;YAC7C;AACF,QAAA,CAAC,CAAC;IACJ;AAEA;;;;;;AAMG;IACI,QAAQ,GAAA;QACb,IAAI,CAAC,cAAc,EAAE;IACvB;AAEA;;;AAGG;IACI,WAAW,GAAA;AAChB,QAAA,IAAI,CAAC,aAAa,CAAC,IAAI,EAAE;AACzB,QAAA,IAAI,CAAC,aAAa,CAAC,QAAQ,EAAE;IAC/B;wGAnDW,kBAAkB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;AAAlB,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,kBAAkB,oMCpB/B,sYAOA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;4FDaa,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAL9B,SAAS;+BACE,qBAAqB,EAAA,eAAA,EAEd,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,sYAAA,EAAA;;sBAM9C,KAAK;uBAAC,EAAE,QAAQ,EAAE,KAAK,EAAE;;sBACzB,KAAK;uBAAC,EAAE,QAAQ,EAAE,KAAK,EAAE;;sBACzB;;;AE1BH;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { OnInit } from '@angular/core';
|
|
3
2
|
import { AbstractControl, FormControl } from '@angular/forms';
|
|
4
3
|
|
|
5
|
-
declare class GovukRadiosConditionalComponent
|
|
4
|
+
declare class GovukRadiosConditionalComponent {
|
|
5
|
+
/**
|
|
6
|
+
* Id used by aria-controls to connect a radio input to this conditional panel.
|
|
7
|
+
*/
|
|
6
8
|
conditionalId: string;
|
|
7
|
-
class: string;
|
|
8
|
-
id: string;
|
|
9
|
-
ngOnInit(): void;
|
|
10
9
|
static ɵfac: i0.ɵɵFactoryDeclaration<GovukRadiosConditionalComponent, never>;
|
|
11
10
|
static ɵcmp: i0.ɵɵComponentDeclaration<GovukRadiosConditionalComponent, "opal-lib-govuk-radios-conditional, [opal-lib-govuk-radios-conditional]", never, { "conditionalId": { "alias": "conditionalId"; "required": true; }; }, {}, never, ["*"], true, never>;
|
|
12
11
|
}
|
|
@@ -26,21 +25,70 @@ declare class GovukRadiosItemComponent {
|
|
|
26
25
|
inputValue: string | boolean;
|
|
27
26
|
inputValueHint: string;
|
|
28
27
|
ariaControls: string;
|
|
28
|
+
/**
|
|
29
|
+
* Assigns the FormControl used to bind the radio input.
|
|
30
|
+
* @param abstractControl - Control instance from the parent form group.
|
|
31
|
+
* @remarks Casts to FormControl for template binding.
|
|
32
|
+
*/
|
|
29
33
|
set control(abstractControl: AbstractControl | null);
|
|
30
34
|
class: string;
|
|
35
|
+
/**
|
|
36
|
+
* Exposes the bound FormControl to the template.
|
|
37
|
+
*/
|
|
31
38
|
get getControl(): FormControl<any>;
|
|
39
|
+
/**
|
|
40
|
+
* Normalizes the input name for safe binding.
|
|
41
|
+
* @returns Trimmed input name or empty string.
|
|
42
|
+
*/
|
|
43
|
+
get resolvedInputName(): string;
|
|
44
|
+
/**
|
|
45
|
+
* Ensures the radio input id is prefixed with the input name when needed.
|
|
46
|
+
* @returns Normalized id used by the input and label.
|
|
47
|
+
*/
|
|
48
|
+
get resolvedInputId(): string;
|
|
49
|
+
/**
|
|
50
|
+
* Normalizes aria-controls to avoid empty attributes.
|
|
51
|
+
* @returns Trimmed value or null when not provided.
|
|
52
|
+
*/
|
|
53
|
+
get dataAriaControls(): string | null;
|
|
54
|
+
/**
|
|
55
|
+
* Exposes the radio value for Angular's RadioControlValueAccessor.
|
|
56
|
+
* IMPORTANT: keep the original type (e.g. boolean) so Reactive Forms emits the correct value.
|
|
57
|
+
*/
|
|
58
|
+
get resolvedInputValue(): string | boolean;
|
|
59
|
+
/**
|
|
60
|
+
* Normalizes the radio value to a string for the HTML attribute binding.
|
|
61
|
+
* @returns String value for the input's `value` attribute.
|
|
62
|
+
*/
|
|
63
|
+
get resolvedInputValueAttr(): string;
|
|
32
64
|
static ɵfac: i0.ɵɵFactoryDeclaration<GovukRadiosItemComponent, never>;
|
|
33
65
|
static ɵcmp: i0.ɵɵComponentDeclaration<GovukRadiosItemComponent, "opal-lib-govuk-radios-item, [opal-lib-govuk-radios-item]", never, { "labelText": { "alias": "labelText"; "required": true; }; "labelClasses": { "alias": "labelClasses"; "required": false; }; "inputId": { "alias": "inputId"; "required": true; }; "inputName": { "alias": "inputName"; "required": true; }; "inputClasses": { "alias": "inputClasses"; "required": false; }; "inputValue": { "alias": "inputValue"; "required": true; }; "inputValueHint": { "alias": "inputValueHint"; "required": false; }; "ariaControls": { "alias": "ariaControls"; "required": false; }; "control": { "alias": "control"; "required": true; }; }, {}, never, never, true, never>;
|
|
34
66
|
}
|
|
35
67
|
|
|
36
68
|
declare class GovukRadioComponent {
|
|
69
|
+
private readonly elementRef;
|
|
37
70
|
fieldSetId: string;
|
|
38
71
|
legendText: string;
|
|
39
72
|
legendHint: string;
|
|
40
73
|
legendClasses: string;
|
|
41
74
|
radioClasses: string;
|
|
42
75
|
errors: string | null;
|
|
76
|
+
/**
|
|
77
|
+
* Builds the aria-describedby value for the fieldset based on hint/error ids.
|
|
78
|
+
* @returns Space-separated id list or null when there is nothing to describe.
|
|
79
|
+
*/
|
|
43
80
|
get describedBy(): string | null;
|
|
81
|
+
constructor();
|
|
82
|
+
/**
|
|
83
|
+
* Initializes govuk-frontend radios behavior for this component's radio group.
|
|
84
|
+
* Side effects: dynamically imports govuk-frontend, mutates dataset, logs warnings on fallback.
|
|
85
|
+
*/
|
|
86
|
+
private initOuterRadios;
|
|
87
|
+
/**
|
|
88
|
+
* Loads the govuk-frontend module.
|
|
89
|
+
* Wrapped for testability so unit tests can stub the dynamic import.
|
|
90
|
+
*/
|
|
91
|
+
protected loadGovukFrontend(): Promise<any>;
|
|
44
92
|
static ɵfac: i0.ɵɵFactoryDeclaration<GovukRadioComponent, never>;
|
|
45
93
|
static ɵcmp: i0.ɵɵComponentDeclaration<GovukRadioComponent, "opal-lib-govuk-radio", never, { "fieldSetId": { "alias": "fieldSetId"; "required": true; }; "legendText": { "alias": "legendText"; "required": false; }; "legendHint": { "alias": "legendHint"; "required": false; }; "legendClasses": { "alias": "legendClasses"; "required": false; }; "radioClasses": { "alias": "radioClasses"; "required": false; }; "errors": { "alias": "errors"; "required": false; }; }, {}, never, ["*"], true, never>;
|
|
46
94
|
}
|