@abgov/angular-components 4.9.0 → 4.9.1-dev.2
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { forwardRef, HostListener, Directive, CUSTOM_ELEMENTS_SCHEMA, NgModule, Input, Component, booleanAttribute, EventEmitter, Output, numberAttribute, TemplateRef } from '@angular/core';
|
|
2
|
+
import { forwardRef, HostListener, Directive, CUSTOM_ELEMENTS_SCHEMA, NgModule, Input, Component, ElementRef, booleanAttribute, ViewChild, EventEmitter, Output, numberAttribute, TemplateRef } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/common';
|
|
4
4
|
import { CommonModule, NgTemplateOutlet, NgIf } from '@angular/common';
|
|
5
5
|
import { NG_VALUE_ACCESSOR, CheckboxControlValueAccessor } from '@angular/forms';
|
|
@@ -240,9 +240,25 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImpor
|
|
|
240
240
|
* - Supports `disabled="true"` and `error="true` attribute bindings for convenience.
|
|
241
241
|
* - Handles form control value changes and touch events via `ControlValueAccessor` methods.
|
|
242
242
|
* - Allows for flexible value types (`unknown`), making it suitable for various data types like integers, dates, or booleans.
|
|
243
|
+
* - Uses ViewChild to capture a reference to the native GOA web component element via `#goaComponentRef`.
|
|
244
|
+
* - Uses Renderer2 for safe DOM manipulation (compatible with SSR and security best practices).
|
|
243
245
|
*
|
|
244
246
|
* ## Usage
|
|
245
|
-
* Extend this class to create custom form controls.
|
|
247
|
+
* Extend this class to create custom form controls. Child components must:
|
|
248
|
+
* 1. Add `#goaComponentRef` template reference to their `goa-*` element in the template
|
|
249
|
+
* 2. Inject `Renderer2` in their constructor and pass it to `super(renderer)`
|
|
250
|
+
*
|
|
251
|
+
* ### Example:
|
|
252
|
+
* ```typescript
|
|
253
|
+
* @Component({
|
|
254
|
+
* template: `<goa-input #goaComponentRef [value]="value" ...></goa-input>`
|
|
255
|
+
* })
|
|
256
|
+
* export class GoabInput extends GoabControlValueAccessor {
|
|
257
|
+
* constructor(private cdr: ChangeDetectorRef, renderer: Renderer2) {
|
|
258
|
+
* super(renderer); // Required: pass Renderer2 to base class
|
|
259
|
+
* }
|
|
260
|
+
* }
|
|
261
|
+
* ```
|
|
246
262
|
*
|
|
247
263
|
* ## Properties
|
|
248
264
|
* - `id?`: An optional identifier for the component.
|
|
@@ -252,20 +268,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImpor
|
|
|
252
268
|
*
|
|
253
269
|
* ## Methods
|
|
254
270
|
* - `markAsTouched()`: Marks the component as touched and triggers the `fcTouched` callback if defined.
|
|
255
|
-
* - `writeValue(value: unknown)`: Writes a new value to the form control.
|
|
271
|
+
* - `writeValue(value: unknown)`: Writes a new value to the form control (can be overridden for special behavior like checkbox).
|
|
256
272
|
* - `registerOnChange(fn: any)`: Registers a function to handle changes in the form control value.
|
|
257
273
|
* - `registerOnTouched(fn: any)`: Registers a function to handle touch events on the form control.
|
|
258
274
|
* - `setDisabledState?(isDisabled: boolean)`: Sets the disabled state of the component.
|
|
275
|
+
* - `convertValueToString(value: unknown)`: Converts a value to a string for DOM attribute assignment (can be overridden).
|
|
259
276
|
*
|
|
260
277
|
* ## Callbacks
|
|
261
278
|
* - `fcChange?`: A function to handle changes in the form control value.
|
|
262
279
|
* - `fcTouched?`: A function to handle touch events on the form control.
|
|
263
280
|
*/
|
|
264
281
|
class GoabControlValueAccessor extends GoabBaseComponent {
|
|
265
|
-
constructor() {
|
|
266
|
-
super(...arguments);
|
|
267
|
-
this.touched = false;
|
|
268
|
-
}
|
|
269
282
|
/**
|
|
270
283
|
* Marks the component as touched. If the component is not already marked as touched,
|
|
271
284
|
* it triggers the `fcTouched` callback (if defined) and sets the `touched` property to `true`.
|
|
@@ -276,12 +289,34 @@ class GoabControlValueAccessor extends GoabBaseComponent {
|
|
|
276
289
|
this.touched = true;
|
|
277
290
|
}
|
|
278
291
|
}
|
|
292
|
+
constructor(renderer) {
|
|
293
|
+
super();
|
|
294
|
+
this.renderer = renderer;
|
|
295
|
+
this.touched = false;
|
|
296
|
+
}
|
|
297
|
+
/**
|
|
298
|
+
* Convert an arbitrary value into a string for DOM attribute assignment.
|
|
299
|
+
* Child classes can override when they need special formatting.
|
|
300
|
+
* @param value The value to convert
|
|
301
|
+
* @returns string representation or empty string for nullish/empty
|
|
302
|
+
*/
|
|
303
|
+
convertValueToString(value) {
|
|
304
|
+
if (value === null || value === undefined || value === "") {
|
|
305
|
+
return "";
|
|
306
|
+
}
|
|
307
|
+
return String(value);
|
|
308
|
+
}
|
|
279
309
|
/**
|
|
280
310
|
* Writes a new value to the form control.
|
|
281
311
|
* @param {unknown} value - The value to write.
|
|
282
312
|
*/
|
|
283
313
|
writeValue(value) {
|
|
284
314
|
this.value = value;
|
|
315
|
+
const el = this.goaComponentRef?.nativeElement;
|
|
316
|
+
if (el) {
|
|
317
|
+
const stringValue = this.convertValueToString(value);
|
|
318
|
+
this.renderer.setAttribute(el, "value", stringValue);
|
|
319
|
+
}
|
|
285
320
|
}
|
|
286
321
|
/**
|
|
287
322
|
* Registers a function to call when the form control value changes.
|
|
@@ -305,8 +340,8 @@ class GoabControlValueAccessor extends GoabBaseComponent {
|
|
|
305
340
|
setDisabledState(isDisabled) {
|
|
306
341
|
this.disabled = isDisabled;
|
|
307
342
|
}
|
|
308
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: GoabControlValueAccessor, deps:
|
|
309
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "20.1.6", type: GoabControlValueAccessor, isStandalone: true, selector: "ng-component", inputs: { id: "id", disabled: ["disabled", "disabled", booleanAttribute], error: ["error", "error", booleanAttribute], value: "value" }, usesInheritance: true, ngImport: i0, template: ``, isInline: true }); }
|
|
343
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: GoabControlValueAccessor, deps: [{ token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
344
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "20.1.6", type: GoabControlValueAccessor, isStandalone: true, selector: "ng-component", inputs: { id: "id", disabled: ["disabled", "disabled", booleanAttribute], error: ["error", "error", booleanAttribute], value: "value" }, viewQueries: [{ propertyName: "goaComponentRef", first: true, predicate: ["goaComponentRef"], descendants: true, read: ElementRef }], usesInheritance: true, ngImport: i0, template: ``, isInline: true }); }
|
|
310
345
|
}
|
|
311
346
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: GoabControlValueAccessor, decorators: [{
|
|
312
347
|
type: Component,
|
|
@@ -314,7 +349,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImpor
|
|
|
314
349
|
standalone: true,
|
|
315
350
|
template: ``, //** IMPLEMENT IN SUBCLASS
|
|
316
351
|
}]
|
|
317
|
-
}], propDecorators: { id: [{
|
|
352
|
+
}], ctorParameters: () => [{ type: i0.Renderer2 }], propDecorators: { id: [{
|
|
318
353
|
type: Input
|
|
319
354
|
}], disabled: [{
|
|
320
355
|
type: Input,
|
|
@@ -324,6 +359,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImpor
|
|
|
324
359
|
args: [{ transform: booleanAttribute }]
|
|
325
360
|
}], value: [{
|
|
326
361
|
type: Input
|
|
362
|
+
}], goaComponentRef: [{
|
|
363
|
+
type: ViewChild,
|
|
364
|
+
args: ["goaComponentRef", { static: false, read: ElementRef }]
|
|
327
365
|
}] } });
|
|
328
366
|
|
|
329
367
|
class GoabAccordion extends GoabBaseComponent {
|
|
@@ -1035,8 +1073,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImpor
|
|
|
1035
1073
|
}] } });
|
|
1036
1074
|
|
|
1037
1075
|
class GoabCheckbox extends GoabControlValueAccessor {
|
|
1038
|
-
constructor(cdr) {
|
|
1039
|
-
super();
|
|
1076
|
+
constructor(cdr, renderer) {
|
|
1077
|
+
super(renderer);
|
|
1040
1078
|
this.cdr = cdr;
|
|
1041
1079
|
this.isReady = false;
|
|
1042
1080
|
this.onChange = new EventEmitter();
|
|
@@ -1064,7 +1102,16 @@ class GoabCheckbox extends GoabControlValueAccessor {
|
|
|
1064
1102
|
this.markAsTouched();
|
|
1065
1103
|
this.fcChange?.(detail.binding === "check" ? detail.checked : detail.value || "");
|
|
1066
1104
|
}
|
|
1067
|
-
|
|
1105
|
+
// Checkbox is a special case: it uses `checked` instead of `value`.
|
|
1106
|
+
writeValue(value) {
|
|
1107
|
+
this.value = value;
|
|
1108
|
+
this.checked = !!value;
|
|
1109
|
+
const el = this.goaComponentRef?.nativeElement;
|
|
1110
|
+
if (el) {
|
|
1111
|
+
this.renderer.setAttribute(el, "checked", this.checked ? "true" : "false");
|
|
1112
|
+
}
|
|
1113
|
+
}
|
|
1114
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: GoabCheckbox, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1068
1115
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "20.1.6", type: GoabCheckbox, isStandalone: true, selector: "goab-checkbox", inputs: { name: "name", checked: ["checked", "checked", booleanAttribute], indeterminate: ["indeterminate", "indeterminate", booleanAttribute], text: "text", value: "value", ariaLabel: "ariaLabel", description: "description", reveal: "reveal", revealArialLabel: "revealArialLabel", maxWidth: "maxWidth" }, outputs: { onChange: "onChange" }, providers: [
|
|
1069
1116
|
{
|
|
1070
1117
|
provide: NG_VALUE_ACCESSOR,
|
|
@@ -1072,34 +1119,35 @@ class GoabCheckbox extends GoabControlValueAccessor {
|
|
|
1072
1119
|
useExisting: forwardRef(() => GoabCheckbox),
|
|
1073
1120
|
},
|
|
1074
1121
|
], usesInheritance: true, ngImport: i0, template: ` <goa-checkbox
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
</
|
|
1122
|
+
#goaComponentRef
|
|
1123
|
+
*ngIf="isReady"
|
|
1124
|
+
[attr.name]="name"
|
|
1125
|
+
[checked]="checked"
|
|
1126
|
+
[disabled]="disabled"
|
|
1127
|
+
[attr.indeterminate]="indeterminate ? 'true' : undefined"
|
|
1128
|
+
[attr.error]="error"
|
|
1129
|
+
[attr.text]="text"
|
|
1130
|
+
[value]="value"
|
|
1131
|
+
[attr.testid]="testId"
|
|
1132
|
+
[attr.arialabel]="ariaLabel"
|
|
1133
|
+
[attr.description]="getDescriptionAsString()"
|
|
1134
|
+
[attr.revealarialabel]="revealArialLabel"
|
|
1135
|
+
[id]="id"
|
|
1136
|
+
[attr.maxwidth]="maxWidth"
|
|
1137
|
+
[attr.mt]="mt"
|
|
1138
|
+
[attr.mb]="mb"
|
|
1139
|
+
[attr.ml]="ml"
|
|
1140
|
+
[attr.mr]="mr"
|
|
1141
|
+
(_change)="_onChange($event)"
|
|
1142
|
+
>
|
|
1143
|
+
<ng-content />
|
|
1144
|
+
<div slot="description">
|
|
1145
|
+
<ng-container [ngTemplateOutlet]="getDescriptionAsTemplate()"></ng-container>
|
|
1146
|
+
</div>
|
|
1147
|
+
<div slot="reveal">
|
|
1148
|
+
<ng-container *ngIf="reveal" [ngTemplateOutlet]="reveal"></ng-container>
|
|
1149
|
+
</div>
|
|
1150
|
+
</goa-checkbox>`, isInline: true, dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] }); }
|
|
1103
1151
|
}
|
|
1104
1152
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: GoabCheckbox, decorators: [{
|
|
1105
1153
|
type: Component,
|
|
@@ -1107,34 +1155,35 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImpor
|
|
|
1107
1155
|
standalone: true,
|
|
1108
1156
|
selector: "goab-checkbox",
|
|
1109
1157
|
template: ` <goa-checkbox
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
</
|
|
1158
|
+
#goaComponentRef
|
|
1159
|
+
*ngIf="isReady"
|
|
1160
|
+
[attr.name]="name"
|
|
1161
|
+
[checked]="checked"
|
|
1162
|
+
[disabled]="disabled"
|
|
1163
|
+
[attr.indeterminate]="indeterminate ? 'true' : undefined"
|
|
1164
|
+
[attr.error]="error"
|
|
1165
|
+
[attr.text]="text"
|
|
1166
|
+
[value]="value"
|
|
1167
|
+
[attr.testid]="testId"
|
|
1168
|
+
[attr.arialabel]="ariaLabel"
|
|
1169
|
+
[attr.description]="getDescriptionAsString()"
|
|
1170
|
+
[attr.revealarialabel]="revealArialLabel"
|
|
1171
|
+
[id]="id"
|
|
1172
|
+
[attr.maxwidth]="maxWidth"
|
|
1173
|
+
[attr.mt]="mt"
|
|
1174
|
+
[attr.mb]="mb"
|
|
1175
|
+
[attr.ml]="ml"
|
|
1176
|
+
[attr.mr]="mr"
|
|
1177
|
+
(_change)="_onChange($event)"
|
|
1178
|
+
>
|
|
1179
|
+
<ng-content />
|
|
1180
|
+
<div slot="description">
|
|
1181
|
+
<ng-container [ngTemplateOutlet]="getDescriptionAsTemplate()"></ng-container>
|
|
1182
|
+
</div>
|
|
1183
|
+
<div slot="reveal">
|
|
1184
|
+
<ng-container *ngIf="reveal" [ngTemplateOutlet]="reveal"></ng-container>
|
|
1185
|
+
</div>
|
|
1186
|
+
</goa-checkbox>`,
|
|
1138
1187
|
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
1139
1188
|
providers: [
|
|
1140
1189
|
{
|
|
@@ -1145,7 +1194,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImpor
|
|
|
1145
1194
|
],
|
|
1146
1195
|
imports: [NgTemplateOutlet, CommonModule],
|
|
1147
1196
|
}]
|
|
1148
|
-
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }], propDecorators: { name: [{
|
|
1197
|
+
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i0.Renderer2 }], propDecorators: { name: [{
|
|
1149
1198
|
type: Input
|
|
1150
1199
|
}], checked: [{
|
|
1151
1200
|
type: Input,
|
|
@@ -1172,8 +1221,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImpor
|
|
|
1172
1221
|
}] } });
|
|
1173
1222
|
|
|
1174
1223
|
class GoabCheckboxList extends GoabControlValueAccessor {
|
|
1175
|
-
constructor(cdr) {
|
|
1176
|
-
super();
|
|
1224
|
+
constructor(cdr, renderer) {
|
|
1225
|
+
super(renderer);
|
|
1177
1226
|
this.cdr = cdr;
|
|
1178
1227
|
this.isReady = false;
|
|
1179
1228
|
this.onChange = new EventEmitter();
|
|
@@ -1210,7 +1259,7 @@ class GoabCheckboxList extends GoabControlValueAccessor {
|
|
|
1210
1259
|
this.value = [];
|
|
1211
1260
|
}
|
|
1212
1261
|
}
|
|
1213
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: GoabCheckboxList, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1262
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: GoabCheckboxList, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1214
1263
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.6", type: GoabCheckboxList, isStandalone: true, selector: "goab-checkbox-list", inputs: { name: "name", maxWidth: "maxWidth", value: "value" }, outputs: { onChange: "onChange" }, providers: [
|
|
1215
1264
|
{
|
|
1216
1265
|
provide: NG_VALUE_ACCESSOR,
|
|
@@ -1267,7 +1316,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImpor
|
|
|
1267
1316
|
},
|
|
1268
1317
|
],
|
|
1269
1318
|
}]
|
|
1270
|
-
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }], propDecorators: { name: [{
|
|
1319
|
+
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i0.Renderer2 }], propDecorators: { name: [{
|
|
1271
1320
|
type: Input
|
|
1272
1321
|
}], maxWidth: [{
|
|
1273
1322
|
type: Input
|
|
@@ -1558,8 +1607,8 @@ class GoabDatePicker extends GoabControlValueAccessor {
|
|
|
1558
1607
|
this.markAsTouched();
|
|
1559
1608
|
this.fcChange?.(detail.value);
|
|
1560
1609
|
}
|
|
1561
|
-
constructor(elementRef, cdr) {
|
|
1562
|
-
super();
|
|
1610
|
+
constructor(elementRef, cdr, renderer) {
|
|
1611
|
+
super(renderer);
|
|
1563
1612
|
this.elementRef = elementRef;
|
|
1564
1613
|
this.cdr = cdr;
|
|
1565
1614
|
this.isReady = false;
|
|
@@ -1582,24 +1631,25 @@ class GoabDatePicker extends GoabControlValueAccessor {
|
|
|
1582
1631
|
}
|
|
1583
1632
|
writeValue(value) {
|
|
1584
1633
|
this.value = value;
|
|
1585
|
-
const datePickerEl = this.
|
|
1634
|
+
const datePickerEl = this.goaComponentRef?.nativeElement;
|
|
1586
1635
|
if (datePickerEl) {
|
|
1587
1636
|
if (!value) {
|
|
1588
|
-
|
|
1637
|
+
this.renderer.setAttribute(datePickerEl, "value", "");
|
|
1589
1638
|
}
|
|
1590
1639
|
else {
|
|
1591
|
-
|
|
1640
|
+
this.renderer.setAttribute(datePickerEl, "value", value instanceof Date ? value.toISOString() : value);
|
|
1592
1641
|
}
|
|
1593
1642
|
}
|
|
1594
1643
|
}
|
|
1595
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: GoabDatePicker, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1596
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.6", type: GoabDatePicker, isStandalone: true, selector: "goab-date-picker", inputs: { name: "name", value: "value", min: "min", max: "max", type: "type", relative: "relative" }, outputs: { onChange: "onChange" }, host: { listeners: { "disabledChange": "listenDisabledChange($event.detail.disabled)" } }, providers: [
|
|
1644
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: GoabDatePicker, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1645
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.6", type: GoabDatePicker, isStandalone: true, selector: "goab-date-picker", inputs: { name: "name", value: "value", min: "min", max: "max", type: "type", relative: "relative", width: "width" }, outputs: { onChange: "onChange" }, host: { listeners: { "disabledChange": "listenDisabledChange($event.detail.disabled)" } }, providers: [
|
|
1597
1646
|
{
|
|
1598
1647
|
provide: NG_VALUE_ACCESSOR,
|
|
1599
1648
|
multi: true,
|
|
1600
1649
|
useExisting: forwardRef(() => GoabDatePicker),
|
|
1601
1650
|
},
|
|
1602
1651
|
], usesInheritance: true, ngImport: i0, template: ` <goa-date-picker
|
|
1652
|
+
#goaComponentRef
|
|
1603
1653
|
*ngIf="isReady"
|
|
1604
1654
|
[attr.name]="name"
|
|
1605
1655
|
[attr.value]="formatValue(value)"
|
|
@@ -1610,6 +1660,7 @@ class GoabDatePicker extends GoabControlValueAccessor {
|
|
|
1610
1660
|
[attr.relative]="relative"
|
|
1611
1661
|
[attr.type]="type"
|
|
1612
1662
|
[attr.testid]="testId"
|
|
1663
|
+
[attr.width]="width"
|
|
1613
1664
|
[attr.mt]="mt"
|
|
1614
1665
|
[attr.mb]="mb"
|
|
1615
1666
|
[attr.ml]="ml"
|
|
@@ -1625,6 +1676,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImpor
|
|
|
1625
1676
|
selector: "goab-date-picker",
|
|
1626
1677
|
imports: [CommonModule],
|
|
1627
1678
|
template: ` <goa-date-picker
|
|
1679
|
+
#goaComponentRef
|
|
1628
1680
|
*ngIf="isReady"
|
|
1629
1681
|
[attr.name]="name"
|
|
1630
1682
|
[attr.value]="formatValue(value)"
|
|
@@ -1635,6 +1687,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImpor
|
|
|
1635
1687
|
[attr.relative]="relative"
|
|
1636
1688
|
[attr.type]="type"
|
|
1637
1689
|
[attr.testid]="testId"
|
|
1690
|
+
[attr.width]="width"
|
|
1638
1691
|
[attr.mt]="mt"
|
|
1639
1692
|
[attr.mb]="mb"
|
|
1640
1693
|
[attr.ml]="ml"
|
|
@@ -1651,7 +1704,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImpor
|
|
|
1651
1704
|
},
|
|
1652
1705
|
],
|
|
1653
1706
|
}]
|
|
1654
|
-
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }], propDecorators: { name: [{
|
|
1707
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i0.Renderer2 }], propDecorators: { name: [{
|
|
1655
1708
|
type: Input
|
|
1656
1709
|
}], value: [{
|
|
1657
1710
|
type: Input
|
|
@@ -1663,6 +1716,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImpor
|
|
|
1663
1716
|
type: Input
|
|
1664
1717
|
}], relative: [{
|
|
1665
1718
|
type: Input
|
|
1719
|
+
}], width: [{
|
|
1720
|
+
type: Input
|
|
1666
1721
|
}], onChange: [{
|
|
1667
1722
|
type: Output
|
|
1668
1723
|
}], listenDisabledChange: [{
|
|
@@ -1875,8 +1930,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImpor
|
|
|
1875
1930
|
|
|
1876
1931
|
// "disabled", "value", "id" is an exposed property of HTMLInputElement, no need to bind with attr
|
|
1877
1932
|
class GoabDropdown extends GoabControlValueAccessor {
|
|
1878
|
-
constructor(cdr) {
|
|
1879
|
-
super();
|
|
1933
|
+
constructor(cdr, renderer) {
|
|
1934
|
+
super(renderer);
|
|
1880
1935
|
this.cdr = cdr;
|
|
1881
1936
|
this.onChange = new EventEmitter();
|
|
1882
1937
|
this.isReady = false;
|
|
@@ -1891,11 +1946,13 @@ class GoabDropdown extends GoabControlValueAccessor {
|
|
|
1891
1946
|
}
|
|
1892
1947
|
_onChange(e) {
|
|
1893
1948
|
const detail = e.detail;
|
|
1949
|
+
// Keep local value in sync with emitted detail
|
|
1950
|
+
this.value = detail.value || null;
|
|
1894
1951
|
this.onChange.emit(detail);
|
|
1895
1952
|
this.markAsTouched();
|
|
1896
1953
|
this.fcChange?.(detail.value || "");
|
|
1897
1954
|
}
|
|
1898
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: GoabDropdown, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1955
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: GoabDropdown, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1899
1956
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "20.1.6", type: GoabDropdown, isStandalone: true, selector: "goab-dropdown", inputs: { name: "name", ariaLabel: "ariaLabel", ariaLabelledBy: "ariaLabelledBy", filterable: ["filterable", "filterable", booleanAttribute], leadingIcon: "leadingIcon", maxHeight: "maxHeight", multiselect: ["multiselect", "multiselect", booleanAttribute], native: ["native", "native", booleanAttribute], placeholder: "placeholder", width: "width", maxWidth: "maxWidth", autoComplete: "autoComplete", relative: "relative" }, outputs: { onChange: "onChange" }, providers: [
|
|
1900
1957
|
{
|
|
1901
1958
|
provide: NG_VALUE_ACCESSOR,
|
|
@@ -1904,6 +1961,7 @@ class GoabDropdown extends GoabControlValueAccessor {
|
|
|
1904
1961
|
},
|
|
1905
1962
|
], usesInheritance: true, ngImport: i0, template: `
|
|
1906
1963
|
<goa-dropdown
|
|
1964
|
+
#goaComponentRef
|
|
1907
1965
|
*ngIf="isReady"
|
|
1908
1966
|
[attr.name]="name"
|
|
1909
1967
|
[value]="value"
|
|
@@ -1941,6 +1999,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImpor
|
|
|
1941
1999
|
imports: [CommonModule],
|
|
1942
2000
|
template: `
|
|
1943
2001
|
<goa-dropdown
|
|
2002
|
+
#goaComponentRef
|
|
1944
2003
|
*ngIf="isReady"
|
|
1945
2004
|
[attr.name]="name"
|
|
1946
2005
|
[value]="value"
|
|
@@ -1978,7 +2037,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImpor
|
|
|
1978
2037
|
},
|
|
1979
2038
|
],
|
|
1980
2039
|
}]
|
|
1981
|
-
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }], propDecorators: { name: [{
|
|
2040
|
+
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i0.Renderer2 }], propDecorators: { name: [{
|
|
1982
2041
|
type: Input
|
|
1983
2042
|
}], ariaLabel: [{
|
|
1984
2043
|
type: Input
|
|
@@ -3471,8 +3530,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImpor
|
|
|
3471
3530
|
}] } });
|
|
3472
3531
|
|
|
3473
3532
|
class GoabInput extends GoabControlValueAccessor {
|
|
3474
|
-
constructor(cdr) {
|
|
3475
|
-
super();
|
|
3533
|
+
constructor(cdr, renderer) {
|
|
3534
|
+
super(renderer);
|
|
3476
3535
|
this.cdr = cdr;
|
|
3477
3536
|
this.type = "text";
|
|
3478
3537
|
this.textAlign = "left";
|
|
@@ -3538,7 +3597,7 @@ class GoabInput extends GoabControlValueAccessor {
|
|
|
3538
3597
|
return null;
|
|
3539
3598
|
return this.trailingContent instanceof TemplateRef ? this.trailingContent : null;
|
|
3540
3599
|
}
|
|
3541
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: GoabInput, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3600
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: GoabInput, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
3542
3601
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "20.1.6", type: GoabInput, isStandalone: true, selector: "goab-input", inputs: { type: "type", name: "name", debounce: ["debounce", "debounce", numberAttribute], autoCapitalize: "autoCapitalize", autoComplete: "autoComplete", placeholder: "placeholder", leadingIcon: "leadingIcon", trailingIcon: "trailingIcon", variant: "variant", focused: ["focused", "focused", booleanAttribute], readonly: ["readonly", "readonly", booleanAttribute], width: "width", prefix: "prefix", suffix: "suffix", ariaLabel: "ariaLabel", maxLength: ["maxLength", "maxLength", numberAttribute], min: "min", max: "max", step: ["step", "step", numberAttribute], ariaLabelledBy: "ariaLabelledBy", trailingIconAriaLabel: "trailingIconAriaLabel", textAlign: "textAlign", leadingContent: "leadingContent", trailingContent: "trailingContent" }, outputs: { onTrailingIconClick: "onTrailingIconClick", onFocus: "onFocus", onBlur: "onBlur", onKeyPress: "onKeyPress", onChange: "onChange" }, providers: [
|
|
3543
3602
|
{
|
|
3544
3603
|
provide: NG_VALUE_ACCESSOR,
|
|
@@ -3547,6 +3606,7 @@ class GoabInput extends GoabControlValueAccessor {
|
|
|
3547
3606
|
},
|
|
3548
3607
|
], usesInheritance: true, ngImport: i0, template: `
|
|
3549
3608
|
<goa-input
|
|
3609
|
+
#goaComponentRef
|
|
3550
3610
|
*ngIf="isReady"
|
|
3551
3611
|
[attr.type]="type"
|
|
3552
3612
|
[attr.name]="name"
|
|
@@ -3620,6 +3680,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImpor
|
|
|
3620
3680
|
imports: [NgIf, NgTemplateOutlet, CommonModule],
|
|
3621
3681
|
template: `
|
|
3622
3682
|
<goa-input
|
|
3683
|
+
#goaComponentRef
|
|
3623
3684
|
*ngIf="isReady"
|
|
3624
3685
|
[attr.type]="type"
|
|
3625
3686
|
[attr.name]="name"
|
|
@@ -3693,7 +3754,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImpor
|
|
|
3693
3754
|
},
|
|
3694
3755
|
],
|
|
3695
3756
|
}]
|
|
3696
|
-
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }], propDecorators: { type: [{
|
|
3757
|
+
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i0.Renderer2 }], propDecorators: { type: [{
|
|
3697
3758
|
type: Input
|
|
3698
3759
|
}], name: [{
|
|
3699
3760
|
type: Input
|
|
@@ -4762,8 +4823,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImpor
|
|
|
4762
4823
|
}] } });
|
|
4763
4824
|
|
|
4764
4825
|
class GoabRadioGroup extends GoabControlValueAccessor {
|
|
4765
|
-
constructor(cdr) {
|
|
4766
|
-
super();
|
|
4826
|
+
constructor(cdr, renderer) {
|
|
4827
|
+
super(renderer);
|
|
4767
4828
|
this.cdr = cdr;
|
|
4768
4829
|
this.isReady = false;
|
|
4769
4830
|
this.onChange = new EventEmitter();
|
|
@@ -4780,7 +4841,7 @@ class GoabRadioGroup extends GoabControlValueAccessor {
|
|
|
4780
4841
|
this.onChange.emit(detail);
|
|
4781
4842
|
this.fcChange?.(detail.value);
|
|
4782
4843
|
}
|
|
4783
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: GoabRadioGroup, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
4844
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: GoabRadioGroup, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
4784
4845
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.6", type: GoabRadioGroup, isStandalone: true, selector: "goab-radio-group", inputs: { name: "name", orientation: "orientation", ariaLabel: "ariaLabel" }, outputs: { onChange: "onChange" }, providers: [
|
|
4785
4846
|
{
|
|
4786
4847
|
provide: NG_VALUE_ACCESSOR,
|
|
@@ -4789,6 +4850,7 @@ class GoabRadioGroup extends GoabControlValueAccessor {
|
|
|
4789
4850
|
},
|
|
4790
4851
|
], usesInheritance: true, ngImport: i0, template: `
|
|
4791
4852
|
<goa-radio-group
|
|
4853
|
+
#goaComponentRef
|
|
4792
4854
|
*ngIf="isReady"
|
|
4793
4855
|
[attr.name]="name"
|
|
4794
4856
|
[attr.value]="value"
|
|
@@ -4815,6 +4877,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImpor
|
|
|
4815
4877
|
selector: "goab-radio-group",
|
|
4816
4878
|
template: `
|
|
4817
4879
|
<goa-radio-group
|
|
4880
|
+
#goaComponentRef
|
|
4818
4881
|
*ngIf="isReady"
|
|
4819
4882
|
[attr.name]="name"
|
|
4820
4883
|
[attr.value]="value"
|
|
@@ -4843,7 +4906,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImpor
|
|
|
4843
4906
|
},
|
|
4844
4907
|
],
|
|
4845
4908
|
}]
|
|
4846
|
-
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }], propDecorators: { name: [{
|
|
4909
|
+
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i0.Renderer2 }], propDecorators: { name: [{
|
|
4847
4910
|
type: Input
|
|
4848
4911
|
}], orientation: [{
|
|
4849
4912
|
type: Input
|
|
@@ -5563,8 +5626,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImpor
|
|
|
5563
5626
|
}] } });
|
|
5564
5627
|
|
|
5565
5628
|
class GoabTextArea extends GoabControlValueAccessor {
|
|
5566
|
-
constructor(cdr) {
|
|
5567
|
-
super();
|
|
5629
|
+
constructor(cdr, renderer) {
|
|
5630
|
+
super(renderer);
|
|
5568
5631
|
this.cdr = cdr;
|
|
5569
5632
|
this.countBy = "";
|
|
5570
5633
|
this.maxCount = -1;
|
|
@@ -5598,7 +5661,7 @@ class GoabTextArea extends GoabControlValueAccessor {
|
|
|
5598
5661
|
this.markAsTouched();
|
|
5599
5662
|
this.onBlur.emit(detail);
|
|
5600
5663
|
}
|
|
5601
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: GoabTextArea, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
5664
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: GoabTextArea, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
5602
5665
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "20.1.6", type: GoabTextArea, isStandalone: true, selector: "goab-textarea", inputs: { name: "name", placeholder: "placeholder", rows: ["rows", "rows", numberAttribute], readOnly: ["readOnly", "readOnly", booleanAttribute], width: "width", ariaLabel: "ariaLabel", countBy: "countBy", maxCount: "maxCount", maxWidth: "maxWidth", autoComplete: "autoComplete" }, outputs: { onChange: "onChange", onKeyPress: "onKeyPress", onBlur: "onBlur" }, providers: [
|
|
5603
5666
|
{
|
|
5604
5667
|
provide: NG_VALUE_ACCESSOR,
|
|
@@ -5607,6 +5670,7 @@ class GoabTextArea extends GoabControlValueAccessor {
|
|
|
5607
5670
|
},
|
|
5608
5671
|
], usesInheritance: true, ngImport: i0, template: `
|
|
5609
5672
|
<goa-textarea
|
|
5673
|
+
#goaComponentRef
|
|
5610
5674
|
*ngIf="isReady"
|
|
5611
5675
|
[attr.name]="name"
|
|
5612
5676
|
[attr.value]="value"
|
|
@@ -5641,6 +5705,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImpor
|
|
|
5641
5705
|
imports: [CommonModule],
|
|
5642
5706
|
template: `
|
|
5643
5707
|
<goa-textarea
|
|
5708
|
+
#goaComponentRef
|
|
5644
5709
|
*ngIf="isReady"
|
|
5645
5710
|
[attr.name]="name"
|
|
5646
5711
|
[attr.value]="value"
|
|
@@ -5675,7 +5740,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImpor
|
|
|
5675
5740
|
},
|
|
5676
5741
|
],
|
|
5677
5742
|
}]
|
|
5678
|
-
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }], propDecorators: { name: [{
|
|
5743
|
+
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i0.Renderer2 }], propDecorators: { name: [{
|
|
5679
5744
|
type: Input
|
|
5680
5745
|
}], placeholder: [{
|
|
5681
5746
|
type: Input
|