@abgov/angular-components 4.9.0-alpha.3 → 4.9.1-dev.1
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,17 +1631,17 @@ 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 }); }
|
|
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 }); }
|
|
1596
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" }, outputs: { onChange: "onChange" }, host: { listeners: { "disabledChange": "listenDisabledChange($event.detail.disabled)" } }, providers: [
|
|
1597
1646
|
{
|
|
1598
1647
|
provide: NG_VALUE_ACCESSOR,
|
|
@@ -1600,6 +1649,7 @@ class GoabDatePicker extends GoabControlValueAccessor {
|
|
|
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)"
|
|
@@ -1625,6 +1675,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImpor
|
|
|
1625
1675
|
selector: "goab-date-picker",
|
|
1626
1676
|
imports: [CommonModule],
|
|
1627
1677
|
template: ` <goa-date-picker
|
|
1678
|
+
#goaComponentRef
|
|
1628
1679
|
*ngIf="isReady"
|
|
1629
1680
|
[attr.name]="name"
|
|
1630
1681
|
[attr.value]="formatValue(value)"
|
|
@@ -1651,7 +1702,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImpor
|
|
|
1651
1702
|
},
|
|
1652
1703
|
],
|
|
1653
1704
|
}]
|
|
1654
|
-
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }], propDecorators: { name: [{
|
|
1705
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i0.Renderer2 }], propDecorators: { name: [{
|
|
1655
1706
|
type: Input
|
|
1656
1707
|
}], value: [{
|
|
1657
1708
|
type: Input
|
|
@@ -1875,8 +1926,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImpor
|
|
|
1875
1926
|
|
|
1876
1927
|
// "disabled", "value", "id" is an exposed property of HTMLInputElement, no need to bind with attr
|
|
1877
1928
|
class GoabDropdown extends GoabControlValueAccessor {
|
|
1878
|
-
constructor(cdr) {
|
|
1879
|
-
super();
|
|
1929
|
+
constructor(cdr, renderer) {
|
|
1930
|
+
super(renderer);
|
|
1880
1931
|
this.cdr = cdr;
|
|
1881
1932
|
this.onChange = new EventEmitter();
|
|
1882
1933
|
this.isReady = false;
|
|
@@ -1891,11 +1942,13 @@ class GoabDropdown extends GoabControlValueAccessor {
|
|
|
1891
1942
|
}
|
|
1892
1943
|
_onChange(e) {
|
|
1893
1944
|
const detail = e.detail;
|
|
1945
|
+
// Keep local value in sync with emitted detail
|
|
1946
|
+
this.value = detail.value || null;
|
|
1894
1947
|
this.onChange.emit(detail);
|
|
1895
1948
|
this.markAsTouched();
|
|
1896
1949
|
this.fcChange?.(detail.value || "");
|
|
1897
1950
|
}
|
|
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 }); }
|
|
1951
|
+
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
1952
|
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
1953
|
{
|
|
1901
1954
|
provide: NG_VALUE_ACCESSOR,
|
|
@@ -1904,6 +1957,7 @@ class GoabDropdown extends GoabControlValueAccessor {
|
|
|
1904
1957
|
},
|
|
1905
1958
|
], usesInheritance: true, ngImport: i0, template: `
|
|
1906
1959
|
<goa-dropdown
|
|
1960
|
+
#goaComponentRef
|
|
1907
1961
|
*ngIf="isReady"
|
|
1908
1962
|
[attr.name]="name"
|
|
1909
1963
|
[value]="value"
|
|
@@ -1941,6 +1995,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImpor
|
|
|
1941
1995
|
imports: [CommonModule],
|
|
1942
1996
|
template: `
|
|
1943
1997
|
<goa-dropdown
|
|
1998
|
+
#goaComponentRef
|
|
1944
1999
|
*ngIf="isReady"
|
|
1945
2000
|
[attr.name]="name"
|
|
1946
2001
|
[value]="value"
|
|
@@ -1978,7 +2033,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImpor
|
|
|
1978
2033
|
},
|
|
1979
2034
|
],
|
|
1980
2035
|
}]
|
|
1981
|
-
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }], propDecorators: { name: [{
|
|
2036
|
+
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i0.Renderer2 }], propDecorators: { name: [{
|
|
1982
2037
|
type: Input
|
|
1983
2038
|
}], ariaLabel: [{
|
|
1984
2039
|
type: Input
|
|
@@ -3471,8 +3526,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImpor
|
|
|
3471
3526
|
}] } });
|
|
3472
3527
|
|
|
3473
3528
|
class GoabInput extends GoabControlValueAccessor {
|
|
3474
|
-
constructor(cdr) {
|
|
3475
|
-
super();
|
|
3529
|
+
constructor(cdr, renderer) {
|
|
3530
|
+
super(renderer);
|
|
3476
3531
|
this.cdr = cdr;
|
|
3477
3532
|
this.type = "text";
|
|
3478
3533
|
this.textAlign = "left";
|
|
@@ -3538,7 +3593,7 @@ class GoabInput extends GoabControlValueAccessor {
|
|
|
3538
3593
|
return null;
|
|
3539
3594
|
return this.trailingContent instanceof TemplateRef ? this.trailingContent : null;
|
|
3540
3595
|
}
|
|
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 }); }
|
|
3596
|
+
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
3597
|
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
3598
|
{
|
|
3544
3599
|
provide: NG_VALUE_ACCESSOR,
|
|
@@ -3547,6 +3602,7 @@ class GoabInput extends GoabControlValueAccessor {
|
|
|
3547
3602
|
},
|
|
3548
3603
|
], usesInheritance: true, ngImport: i0, template: `
|
|
3549
3604
|
<goa-input
|
|
3605
|
+
#goaComponentRef
|
|
3550
3606
|
*ngIf="isReady"
|
|
3551
3607
|
[attr.type]="type"
|
|
3552
3608
|
[attr.name]="name"
|
|
@@ -3620,6 +3676,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImpor
|
|
|
3620
3676
|
imports: [NgIf, NgTemplateOutlet, CommonModule],
|
|
3621
3677
|
template: `
|
|
3622
3678
|
<goa-input
|
|
3679
|
+
#goaComponentRef
|
|
3623
3680
|
*ngIf="isReady"
|
|
3624
3681
|
[attr.type]="type"
|
|
3625
3682
|
[attr.name]="name"
|
|
@@ -3693,7 +3750,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImpor
|
|
|
3693
3750
|
},
|
|
3694
3751
|
],
|
|
3695
3752
|
}]
|
|
3696
|
-
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }], propDecorators: { type: [{
|
|
3753
|
+
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i0.Renderer2 }], propDecorators: { type: [{
|
|
3697
3754
|
type: Input
|
|
3698
3755
|
}], name: [{
|
|
3699
3756
|
type: Input
|
|
@@ -4762,8 +4819,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImpor
|
|
|
4762
4819
|
}] } });
|
|
4763
4820
|
|
|
4764
4821
|
class GoabRadioGroup extends GoabControlValueAccessor {
|
|
4765
|
-
constructor(cdr) {
|
|
4766
|
-
super();
|
|
4822
|
+
constructor(cdr, renderer) {
|
|
4823
|
+
super(renderer);
|
|
4767
4824
|
this.cdr = cdr;
|
|
4768
4825
|
this.isReady = false;
|
|
4769
4826
|
this.onChange = new EventEmitter();
|
|
@@ -4780,7 +4837,7 @@ class GoabRadioGroup extends GoabControlValueAccessor {
|
|
|
4780
4837
|
this.onChange.emit(detail);
|
|
4781
4838
|
this.fcChange?.(detail.value);
|
|
4782
4839
|
}
|
|
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 }); }
|
|
4840
|
+
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
4841
|
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
4842
|
{
|
|
4786
4843
|
provide: NG_VALUE_ACCESSOR,
|
|
@@ -4789,6 +4846,7 @@ class GoabRadioGroup extends GoabControlValueAccessor {
|
|
|
4789
4846
|
},
|
|
4790
4847
|
], usesInheritance: true, ngImport: i0, template: `
|
|
4791
4848
|
<goa-radio-group
|
|
4849
|
+
#goaComponentRef
|
|
4792
4850
|
*ngIf="isReady"
|
|
4793
4851
|
[attr.name]="name"
|
|
4794
4852
|
[attr.value]="value"
|
|
@@ -4815,6 +4873,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImpor
|
|
|
4815
4873
|
selector: "goab-radio-group",
|
|
4816
4874
|
template: `
|
|
4817
4875
|
<goa-radio-group
|
|
4876
|
+
#goaComponentRef
|
|
4818
4877
|
*ngIf="isReady"
|
|
4819
4878
|
[attr.name]="name"
|
|
4820
4879
|
[attr.value]="value"
|
|
@@ -4843,7 +4902,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImpor
|
|
|
4843
4902
|
},
|
|
4844
4903
|
],
|
|
4845
4904
|
}]
|
|
4846
|
-
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }], propDecorators: { name: [{
|
|
4905
|
+
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i0.Renderer2 }], propDecorators: { name: [{
|
|
4847
4906
|
type: Input
|
|
4848
4907
|
}], orientation: [{
|
|
4849
4908
|
type: Input
|
|
@@ -5563,8 +5622,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImpor
|
|
|
5563
5622
|
}] } });
|
|
5564
5623
|
|
|
5565
5624
|
class GoabTextArea extends GoabControlValueAccessor {
|
|
5566
|
-
constructor(cdr) {
|
|
5567
|
-
super();
|
|
5625
|
+
constructor(cdr, renderer) {
|
|
5626
|
+
super(renderer);
|
|
5568
5627
|
this.cdr = cdr;
|
|
5569
5628
|
this.countBy = "";
|
|
5570
5629
|
this.maxCount = -1;
|
|
@@ -5598,7 +5657,7 @@ class GoabTextArea extends GoabControlValueAccessor {
|
|
|
5598
5657
|
this.markAsTouched();
|
|
5599
5658
|
this.onBlur.emit(detail);
|
|
5600
5659
|
}
|
|
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 }); }
|
|
5660
|
+
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
5661
|
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
5662
|
{
|
|
5604
5663
|
provide: NG_VALUE_ACCESSOR,
|
|
@@ -5607,6 +5666,7 @@ class GoabTextArea extends GoabControlValueAccessor {
|
|
|
5607
5666
|
},
|
|
5608
5667
|
], usesInheritance: true, ngImport: i0, template: `
|
|
5609
5668
|
<goa-textarea
|
|
5669
|
+
#goaComponentRef
|
|
5610
5670
|
*ngIf="isReady"
|
|
5611
5671
|
[attr.name]="name"
|
|
5612
5672
|
[attr.value]="value"
|
|
@@ -5641,6 +5701,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImpor
|
|
|
5641
5701
|
imports: [CommonModule],
|
|
5642
5702
|
template: `
|
|
5643
5703
|
<goa-textarea
|
|
5704
|
+
#goaComponentRef
|
|
5644
5705
|
*ngIf="isReady"
|
|
5645
5706
|
[attr.name]="name"
|
|
5646
5707
|
[attr.value]="value"
|
|
@@ -5675,7 +5736,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImpor
|
|
|
5675
5736
|
},
|
|
5676
5737
|
],
|
|
5677
5738
|
}]
|
|
5678
|
-
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }], propDecorators: { name: [{
|
|
5739
|
+
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i0.Renderer2 }], propDecorators: { name: [{
|
|
5679
5740
|
type: Input
|
|
5680
5741
|
}], placeholder: [{
|
|
5681
5742
|
type: Input
|