@abgov/angular-components
Version:
Government of Alberta - UI components for Angular
1,259 lines (1,238 loc) • 180 kB
JavaScript
import * as i0 from '@angular/core';
import { forwardRef, HostListener, Directive, CUSTOM_ELEMENTS_SCHEMA, NgModule, Input, Component, booleanAttribute, EventEmitter, Output, numberAttribute, TemplateRef } from '@angular/core';
import { NG_VALUE_ACCESSOR, CheckboxControlValueAccessor } from '@angular/forms';
import { NgTemplateOutlet, NgIf } from '@angular/common';
export * from '@abgov/ui-components-common';
// @deprecated: Use the new <goab-input .. /> component
class ValueDirective {
get value() {
return this._value;
}
set value(val) {
this._value = val;
this.onChange(this._value);
this.onTouched();
this.elementRef.nativeElement.value = val;
}
writeValue(value) {
this.value = value;
}
registerOnChange(fn) {
this.onChange = fn;
}
registerOnTouched(fn) {
this.onTouched = fn;
}
setDisabledState(isDisabled) {
this._disabled = isDisabled;
this.elementRef.nativeElement.disabled = isDisabled;
}
constructor(elementRef) {
this.elementRef = elementRef;
this._value = "";
this._disabled = false;
/* eslint-disable @typescript-eslint/no-explicit-any */
this.onChange = () => { };
this.onTouched = () => { };
}
listenForValueChange(value) {
this.value = value;
}
listenForDisabledChange(isDisabled) {
this.setDisabledState(isDisabled);
}
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.3", ngImport: i0, type: ValueDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); }
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.0.3", type: ValueDirective, selector: "[goaValue]", host: { listeners: { "_change": "listenForValueChange($event.detail.value)", "disabledChange": "listenForDisabledChange($event.detail.disabled)" } }, providers: [{
provide: NG_VALUE_ACCESSOR,
useExisting: forwardRef(() => ValueDirective),
multi: true,
}], ngImport: i0 }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.3", ngImport: i0, type: ValueDirective, decorators: [{
type: Directive,
args: [{
selector: "[goaValue]", providers: [{
provide: NG_VALUE_ACCESSOR,
useExisting: forwardRef(() => ValueDirective),
multi: true,
}],
}]
}], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { listenForValueChange: [{
type: HostListener,
args: ["_change", ["$event.detail.value"]]
}], listenForDisabledChange: [{
type: HostListener,
args: ["disabledChange", ["$event.detail.disabled"]]
}] } });
class ValueListDirective {
get value() {
return this._value;
}
set value(val) {
if (val && val !== this._value) {
this._setValue(val);
this.elementRef.nativeElement.value = JSON.stringify(val);
}
}
writeValue(value) {
if (value) {
this.value = value;
}
}
registerOnChange(fn) {
this.onChange = fn;
}
registerOnTouched(fn) {
this.onTouched = fn;
}
constructor(elementRef) {
this.elementRef = elementRef;
this._value = [];
this.onChange = () => { };
this.onTouched = () => { };
}
listenForValueChange(value) {
if (!value) {
this._setValue(undefined);
return;
}
try {
this.value = JSON.parse(value);
}
catch (e) {
// we still need to trigger the events to prevent any previous valid value to remain set.
const v = value.match(/^[\w\s,]*$/) ? value.split(",") : undefined;
this._setValue(v);
}
}
_setValue(value) {
this._value = value;
this.onChange(value);
this.onTouched();
}
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.3", ngImport: i0, type: ValueListDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); }
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.0.3", type: ValueListDirective, selector: "[goaValueList]", host: { listeners: { "_change": "listenForValueChange($event.detail.value)" } }, providers: [{
provide: NG_VALUE_ACCESSOR,
useExisting: forwardRef(() => ValueListDirective),
multi: true,
}], ngImport: i0 }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.3", ngImport: i0, type: ValueListDirective, decorators: [{
type: Directive,
args: [{
selector: "[goaValueList]",
providers: [{
provide: NG_VALUE_ACCESSOR,
useExisting: forwardRef(() => ValueListDirective),
multi: true,
}],
}]
}], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { listenForValueChange: [{
type: HostListener,
args: ["_change", ["$event.detail.value"]]
}] } });
// @deprecated: Use the new <goab-checkbox .. /> component
class CheckedDirective extends CheckboxControlValueAccessor {
constructor(renderer, elementRef) {
super(renderer, elementRef);
this.renderer = renderer;
this.elementRef = elementRef;
this._checked = false;
/* eslint-disable @typescript-eslint/no-explicit-any */
this.onChange = () => { };
this.onTouched = () => { };
}
get value() {
return this._checked ? "checked" : "";
}
set value(checked) {
this._checked = !!checked;
this.onChange(this._checked);
this.onTouched();
this.elementRef.nativeElement.checked = checked;
}
writeValue(checked) {
this.value = checked;
}
registerOnChange(fn) {
this.onChange = fn;
}
registerOnTouched(fn) {
this.onTouched = fn;
}
listenForValueChange(checked) {
this.value = checked;
}
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.3", ngImport: i0, type: CheckedDirective, deps: [{ token: i0.Renderer2 }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); }
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.0.3", type: CheckedDirective, selector: "[goaChecked]", host: { listeners: { "_change": "listenForValueChange($event.detail.checked)" } }, providers: [
{
useExisting: forwardRef(() => CheckedDirective),
provide: NG_VALUE_ACCESSOR,
multi: true,
},
], usesInheritance: true, ngImport: i0 }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.3", ngImport: i0, type: CheckedDirective, decorators: [{
type: Directive,
args: [{
selector: "[goaChecked]",
providers: [
{
useExisting: forwardRef(() => CheckedDirective),
provide: NG_VALUE_ACCESSOR,
multi: true,
},
],
}]
}], ctorParameters: () => [{ type: i0.Renderer2 }, { type: i0.ElementRef }], propDecorators: { listenForValueChange: [{
type: HostListener,
args: ["_change", ["$event.detail.checked"]]
}] } });
class AngularComponentsModule {
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.3", ngImport: i0, type: AngularComponentsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.0.3", ngImport: i0, type: AngularComponentsModule, declarations: [ValueDirective, ValueListDirective, CheckedDirective], exports: [ValueDirective, ValueListDirective, CheckedDirective] }); }
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.0.3", ngImport: i0, type: AngularComponentsModule }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.3", ngImport: i0, type: AngularComponentsModule, decorators: [{
type: NgModule,
args: [{
declarations: [ValueDirective, ValueListDirective, CheckedDirective],
exports: [ValueDirective, ValueListDirective, CheckedDirective],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
}]
}] });
class GoabBaseComponent {
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.3", ngImport: i0, type: GoabBaseComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.0.3", type: GoabBaseComponent, isStandalone: true, selector: "ng-component", inputs: { mt: "mt", mb: "mb", ml: "ml", mr: "mr", testId: "testId" }, ngImport: i0, template: ``, isInline: true }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.3", ngImport: i0, type: GoabBaseComponent, decorators: [{
type: Component,
args: [{
standalone: true,
template: ``, //** IMPLEMENT IN SUBCLASS
}]
}], propDecorators: { mt: [{
type: Input
}], mb: [{
type: Input
}], ml: [{
type: Input
}], mr: [{
type: Input
}], testId: [{
type: Input
}] } });
/**
* An abstract base class that extends `GoabBaseComponent` and implements the `ControlValueAccessor` interface.
* This class provides a foundation for creating custom form controls in Angular, enabling them to integrate
* seamlessly with Angular forms. It includes support for handling value changes, touch events, and disabled states.
*
* ## Features
* - Supports `disabled="true"` and `error="true` attribute bindings for convenience.
* - Handles form control value changes and touch events via `ControlValueAccessor` methods.
* - Allows for flexible value types (`unknown`), making it suitable for various data types like integers, dates, or booleans.
*
* ## Usage
* Extend this class to create custom form controls. Implement additional functionality as needed for your specific use case.
*
* ## Properties
* - `id?`: An optional identifier for the component.
* - `disabled?`: A boolean indicating whether the component is disabled.
* - `error?`: A boolean indicating whether the component is in an error state.
* - `value?`: The current value of the component, which can be of any type.
*
* ## Methods
* - `markAsTouched()`: Marks the component as touched and triggers the `fcTouched` callback if defined.
* - `writeValue(value: unknown)`: Writes a new value to the form control.
* - `registerOnChange(fn: any)`: Registers a function to handle changes in the form control value.
* - `registerOnTouched(fn: any)`: Registers a function to handle touch events on the form control.
* - `setDisabledState?(isDisabled: boolean)`: Sets the disabled state of the component.
*
* ## Callbacks
* - `fcChange?`: A function to handle changes in the form control value.
* - `fcTouched?`: A function to handle touch events on the form control.
*/
class GoabControlValueAccessor extends GoabBaseComponent {
constructor() {
super(...arguments);
this.touched = false;
}
/**
* Marks the component as touched. If the component is not already marked as touched,
* it triggers the `fcTouched` callback (if defined) and sets the `touched` property to `true`.
*/
markAsTouched() {
if (!this.touched) {
this.fcTouched?.();
this.touched = true;
}
}
/**
* Writes a new value to the form control.
* @param {unknown} value - The value to write.
*/
writeValue(value) {
this.value = value;
}
/**
* Registers a function to call when the form control value changes.
* @param {function} fn - The function to call.
*/
registerOnChange(fn) {
this.fcChange = fn;
}
/**
* Registers a function to call when the form control is touched.
* @param {function} fn - The function to call.
*/
registerOnTouched(fn) {
this.fcTouched = fn;
}
/**
* Sets the disabled state of the component.
*
* @param isDisabled - A boolean indicating whether the component should be disabled.
*/
setDisabledState(isDisabled) {
this.disabled = isDisabled;
}
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.3", ngImport: i0, type: GoabControlValueAccessor, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "18.0.3", 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 }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.3", ngImport: i0, type: GoabControlValueAccessor, decorators: [{
type: Component,
args: [{
standalone: true,
template: ``, //** IMPLEMENT IN SUBCLASS
}]
}], propDecorators: { id: [{
type: Input
}], disabled: [{
type: Input,
args: [{ transform: booleanAttribute }]
}], error: [{
type: Input,
args: [{ transform: booleanAttribute }]
}], value: [{
type: Input
}] } });
class GoabAccordion extends GoabBaseComponent {
constructor() {
super(...arguments);
this.onChange = new EventEmitter();
}
_onChange(e) {
const detail = e.detail;
this.onChange.emit(detail.open);
}
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.3", ngImport: i0, type: GoabAccordion, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "18.0.3", type: GoabAccordion, isStandalone: true, selector: "goab-accordion", inputs: { heading: "heading", secondaryText: "secondaryText", open: ["open", "open", booleanAttribute], headingSize: "headingSize", headingContent: "headingContent", maxWidth: "maxWidth", iconPosition: "iconPosition" }, outputs: { onChange: "onChange" }, usesInheritance: true, ngImport: i0, template: `
<goa-accordion
[attr.heading]="heading"
[attr.secondarytext]="secondaryText"
[attr.open]="open"
[attr.headingsize]="headingSize"
[attr.maxwidth]="maxWidth"
[attr.testid]="testId"
[attr.iconposition]="iconPosition"
[attr.mt]="mt"
[attr.mb]="mb"
[attr.ml]="ml"
[attr.mr]="mr"
(_change)="_onChange($event)"
>
<div slot="headingcontent">
<ng-container [ngTemplateOutlet]="headingContent"></ng-container>
</div>
<ng-content></ng-content>
</goa-accordion>
`, isInline: true, dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.3", ngImport: i0, type: GoabAccordion, decorators: [{
type: Component,
args: [{
standalone: true,
selector: "goab-accordion",
imports: [NgTemplateOutlet],
template: `
<goa-accordion
[attr.heading]="heading"
[attr.secondarytext]="secondaryText"
[attr.open]="open"
[attr.headingsize]="headingSize"
[attr.maxwidth]="maxWidth"
[attr.testid]="testId"
[attr.iconposition]="iconPosition"
[attr.mt]="mt"
[attr.mb]="mb"
[attr.ml]="ml"
[attr.mr]="mr"
(_change)="_onChange($event)"
>
<div slot="headingcontent">
<ng-container [ngTemplateOutlet]="headingContent"></ng-container>
</div>
<ng-content></ng-content>
</goa-accordion>
`,
schemas: [CUSTOM_ELEMENTS_SCHEMA],
}]
}], propDecorators: { heading: [{
type: Input
}], secondaryText: [{
type: Input
}], open: [{
type: Input,
args: [{ transform: booleanAttribute }]
}], headingSize: [{
type: Input
}], headingContent: [{
type: Input
}], maxWidth: [{
type: Input
}], iconPosition: [{
type: Input
}], onChange: [{
type: Output
}] } });
class GoabBadge extends GoabBaseComponent {
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.3", ngImport: i0, type: GoabBadge, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "18.0.3", type: GoabBadge, isStandalone: true, selector: "goab-badge", inputs: { type: "type", content: "content", icon: ["icon", "icon", booleanAttribute], ariaLabel: "ariaLabel" }, usesInheritance: true, ngImport: i0, template: `
<goa-badge
[attr.type]="type"
[attr.icon]="icon"
[attr.arialabel]="ariaLabel"
[attr.content]="content"
[attr.testid]="testId"
[attr.mt]="mt"
[attr.mb]="mb"
[attr.ml]="ml"
[attr.mr]="mr"
>
</goa-badge>
`, isInline: true, styles: [":host{display:contents}\n"] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.3", ngImport: i0, type: GoabBadge, decorators: [{
type: Component,
args: [{ standalone: true, selector: "goab-badge", template: `
<goa-badge
[attr.type]="type"
[attr.icon]="icon"
[attr.arialabel]="ariaLabel"
[attr.content]="content"
[attr.testid]="testId"
[attr.mt]="mt"
[attr.mb]="mb"
[attr.ml]="ml"
[attr.mr]="mr"
>
</goa-badge>
`, schemas: [CUSTOM_ELEMENTS_SCHEMA], styles: [":host{display:contents}\n"] }]
}], propDecorators: { type: [{
type: Input
}], content: [{
type: Input
}], icon: [{
type: Input,
args: [{ transform: booleanAttribute }]
}], ariaLabel: [{
type: Input
}] } });
class GoabBlock extends GoabBaseComponent {
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.3", ngImport: i0, type: GoabBlock, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.0.3", type: GoabBlock, isStandalone: true, selector: "goab-block", inputs: { gap: "gap", direction: "direction", alignment: "alignment" }, usesInheritance: true, ngImport: i0, template: `
<goa-block
[attr.gap]="gap"
[attr.direction]="direction"
[attr.alignment]="alignment"
[attr.testid]="testId"
[attr.mt]="mt"
[attr.mb]="mb"
[attr.ml]="ml"
[attr.mr]="mr"
>
<ng-content />
</goa-block>
`, isInline: true }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.3", ngImport: i0, type: GoabBlock, decorators: [{
type: Component,
args: [{
standalone: true,
selector: "goab-block",
template: `
<goa-block
[attr.gap]="gap"
[attr.direction]="direction"
[attr.alignment]="alignment"
[attr.testid]="testId"
[attr.mt]="mt"
[attr.mb]="mb"
[attr.ml]="ml"
[attr.mr]="mr"
>
<ng-content />
</goa-block>
`,
schemas: [CUSTOM_ELEMENTS_SCHEMA],
}]
}], propDecorators: { gap: [{
type: Input
}], direction: [{
type: Input
}], alignment: [{
type: Input
}] } });
class GoabButton extends GoabBaseComponent {
constructor() {
super(...arguments);
this.type = "primary";
this.onClick = new EventEmitter();
this.JSON = JSON;
}
_onClick() {
this.onClick.emit();
}
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.3", ngImport: i0, type: GoabButton, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "18.0.3", type: GoabButton, isStandalone: true, selector: "goab-button", inputs: { type: "type", size: "size", variant: "variant", disabled: ["disabled", "disabled", booleanAttribute], leadingIcon: "leadingIcon", trailingIcon: "trailingIcon", width: "width", action: "action", actionArg: "actionArg", actionArgs: "actionArgs" }, outputs: { onClick: "onClick" }, usesInheritance: true, ngImport: i0, template: `
<goa-button
[attr.type]="type"
[attr.size]="size"
[attr.variant]="variant"
[disabled]="disabled"
[attr.leadingicon]="leadingIcon"
[attr.trailingicon]="trailingIcon"
[attr.width]="width"
[attr.testid]="testId"
[attr.action]="action"
[attr.action-arg]="actionArg"
[attr.action-args]="JSON.stringify(actionArgs)"
[attr.mt]="mt"
[attr.mb]="mb"
[attr.ml]="ml"
[attr.mr]="mr"
(_click)="_onClick()"
>
<ng-content />
</goa-button>
`, isInline: true }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.3", ngImport: i0, type: GoabButton, decorators: [{
type: Component,
args: [{
standalone: true,
selector: "goab-button",
template: `
<goa-button
[attr.type]="type"
[attr.size]="size"
[attr.variant]="variant"
[disabled]="disabled"
[attr.leadingicon]="leadingIcon"
[attr.trailingicon]="trailingIcon"
[attr.width]="width"
[attr.testid]="testId"
[attr.action]="action"
[attr.action-arg]="actionArg"
[attr.action-args]="JSON.stringify(actionArgs)"
[attr.mt]="mt"
[attr.mb]="mb"
[attr.ml]="ml"
[attr.mr]="mr"
(_click)="_onClick()"
>
<ng-content />
</goa-button>
`,
schemas: [CUSTOM_ELEMENTS_SCHEMA],
}]
}], propDecorators: { type: [{
type: Input
}], size: [{
type: Input
}], variant: [{
type: Input
}], disabled: [{
type: Input,
args: [{ transform: booleanAttribute }]
}], leadingIcon: [{
type: Input
}], trailingIcon: [{
type: Input
}], width: [{
type: Input
}], action: [{
type: Input
}], actionArg: [{
type: Input
}], actionArgs: [{
type: Input
}], onClick: [{
type: Output
}] } });
class GoabButtonGroup extends GoabBaseComponent {
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.3", ngImport: i0, type: GoabButtonGroup, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.0.3", type: GoabButtonGroup, isStandalone: true, selector: "goab-button-group", inputs: { alignment: "alignment", gap: "gap" }, usesInheritance: true, ngImport: i0, template: `
<goa-button-group
[attr.alignment]="alignment"
[attr.gap]="gap"
[attr.testid]="testId"
[attr.mt]="mt"
[attr.mb]="mb"
[attr.ml]="ml"
[attr.mr]="mr"
>
<ng-content />
</goa-button-group>
`, isInline: true }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.3", ngImport: i0, type: GoabButtonGroup, decorators: [{
type: Component,
args: [{
standalone: true,
selector: "goab-button-group",
template: `
<goa-button-group
[attr.alignment]="alignment"
[attr.gap]="gap"
[attr.testid]="testId"
[attr.mt]="mt"
[attr.mb]="mb"
[attr.ml]="ml"
[attr.mr]="mr"
>
<ng-content />
</goa-button-group>
`,
schemas: [CUSTOM_ELEMENTS_SCHEMA],
}]
}], propDecorators: { alignment: [{
type: Input
}], gap: [{
type: Input
}] } });
class GoabCallout extends GoabBaseComponent {
constructor() {
super(...arguments);
this.type = "information";
this.heading = "";
this.size = "large";
this.ariaLive = "off";
this.iconTheme = "outline";
}
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.3", ngImport: i0, type: GoabCallout, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.0.3", type: GoabCallout, isStandalone: true, selector: "goab-callout", inputs: { type: "type", heading: "heading", size: "size", maxWidth: "maxWidth", ariaLive: "ariaLive", iconTheme: "iconTheme" }, usesInheritance: true, ngImport: i0, template: `
<goa-callout
[attr.type]="type"
[attr.heading]="heading"
[attr.size]="size"
[attr.maxwidth]="maxWidth"
[attr.arialive]="ariaLive"
[attr.icontheme]="iconTheme"
[attr.testid]="testId"
[attr.mt]="mt"
[attr.mb]="mb"
[attr.ml]="ml"
[attr.mr]="mr"
>
<ng-content />
</goa-callout>
`, isInline: true }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.3", ngImport: i0, type: GoabCallout, decorators: [{
type: Component,
args: [{
standalone: true,
selector: "goab-callout",
template: `
<goa-callout
[attr.type]="type"
[attr.heading]="heading"
[attr.size]="size"
[attr.maxwidth]="maxWidth"
[attr.arialive]="ariaLive"
[attr.icontheme]="iconTheme"
[attr.testid]="testId"
[attr.mt]="mt"
[attr.mb]="mb"
[attr.ml]="ml"
[attr.mr]="mr"
>
<ng-content />
</goa-callout>
`,
schemas: [CUSTOM_ELEMENTS_SCHEMA],
}]
}], propDecorators: { type: [{
type: Input
}], heading: [{
type: Input
}], size: [{
type: Input
}], maxWidth: [{
type: Input
}], ariaLive: [{
type: Input
}], iconTheme: [{
type: Input
}] } });
class GoabCard extends GoabBaseComponent {
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.3", ngImport: i0, type: GoabCard, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "18.0.3", type: GoabCard, isStandalone: true, selector: "goab-card", inputs: { elevation: ["elevation", "elevation", numberAttribute], width: "width" }, usesInheritance: true, ngImport: i0, template: `
<goa-card
[attr.elevation]="elevation"
[attr.width]="width"
[attr.testid]="testId"
[attr.mt]="mt"
[attr.mb]="mb"
[attr.ml]="ml"
[attr.mr]="mr"
>
<ng-content />
</goa-card>
`, isInline: true }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.3", ngImport: i0, type: GoabCard, decorators: [{
type: Component,
args: [{
standalone: true,
selector: "goab-card",
template: `
<goa-card
[attr.elevation]="elevation"
[attr.width]="width"
[attr.testid]="testId"
[attr.mt]="mt"
[attr.mb]="mb"
[attr.ml]="ml"
[attr.mr]="mr"
>
<ng-content />
</goa-card>
`,
schemas: [CUSTOM_ELEMENTS_SCHEMA],
}]
}], propDecorators: { elevation: [{
type: Input,
args: [{ transform: numberAttribute }]
}], width: [{
type: Input
}] } });
class GoabCardContent {
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.3", ngImport: i0, type: GoabCardContent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.0.3", type: GoabCardContent, isStandalone: true, selector: "goab-card-content", ngImport: i0, template: `
<goa-card-content>
<ng-content />
</goa-card-content>
`, isInline: true }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.3", ngImport: i0, type: GoabCardContent, decorators: [{
type: Component,
args: [{
standalone: true,
selector: "goab-card-content",
template: `
<goa-card-content>
<ng-content />
</goa-card-content>
`,
schemas: [CUSTOM_ELEMENTS_SCHEMA]
}]
}] });
class GoabCardActions {
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.3", ngImport: i0, type: GoabCardActions, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.0.3", type: GoabCardActions, isStandalone: true, selector: "goab-card-actions", ngImport: i0, template: `
<goa-card-actions>
<ng-content />
</goa-card-actions>
`, isInline: true }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.3", ngImport: i0, type: GoabCardActions, decorators: [{
type: Component,
args: [{
standalone: true,
selector: "goab-card-actions",
template: `
<goa-card-actions>
<ng-content />
</goa-card-actions>
`,
schemas: [CUSTOM_ELEMENTS_SCHEMA]
}]
}] });
class GoabCardImage {
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.3", ngImport: i0, type: GoabCardImage, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.0.3", type: GoabCardImage, isStandalone: true, selector: "goab-card-image", inputs: { src: "src", height: "height" }, ngImport: i0, template: `
<goa-card-image
[attr.src]="src"
[attr.height]="height"
>
<ng-content />
</goa-card-image>
`, isInline: true }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.3", ngImport: i0, type: GoabCardImage, decorators: [{
type: Component,
args: [{
standalone: true,
selector: "goab-card-image",
template: `
<goa-card-image
[attr.src]="src"
[attr.height]="height"
>
<ng-content />
</goa-card-image>
`,
schemas: [CUSTOM_ELEMENTS_SCHEMA]
}]
}], propDecorators: { src: [{
type: Input,
args: [{ required: true }]
}], height: [{
type: Input,
args: [{ required: true }]
}] } });
class GoabCheckbox extends GoabControlValueAccessor {
constructor() {
super(...arguments);
this.onChange = new EventEmitter();
}
getDescriptionAsString() {
return typeof this.description === "string" ? this.description : "";
}
getDescriptionAsTemplate() {
if (this.description) {
return typeof this.description === "string" ? null : this.description;
}
return null;
}
_onChange(e) {
const detail = e.detail;
this.onChange.emit(detail);
this.markAsTouched();
this.fcChange?.(detail.binding === "check" ? detail.checked : detail.value || "");
}
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.3", ngImport: i0, type: GoabCheckbox, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "18.0.3", type: GoabCheckbox, isStandalone: true, selector: "goab-checkbox", inputs: { name: "name", checked: ["checked", "checked", booleanAttribute], text: "text", value: "value", ariaLabel: "ariaLabel", description: "description", reveal: "reveal", revealArialLabel: "revealArialLabel", maxWidth: "maxWidth" }, outputs: { onChange: "onChange" }, providers: [
{
provide: NG_VALUE_ACCESSOR,
multi: true,
useExisting: forwardRef(() => GoabCheckbox),
},
], usesInheritance: true, ngImport: i0, template: ` <goa-checkbox
[attr.name]="name"
[checked]="checked"
[disabled]="disabled"
[attr.error]="error"
[attr.text]="text"
[value]="value"
[attr.testid]="testId"
[attr.arialabel]="ariaLabel"
[attr.description]="getDescriptionAsString()"
[attr.revealarialabel]="revealArialLabel"
[id]="id"
[attr.maxwidth]="maxWidth"
[attr.mt]="mt"
[attr.mb]="mb"
[attr.ml]="ml"
[attr.mr]="mr"
(_change)="_onChange($event)"
>
<ng-content />
<div slot="description">
<ng-container [ngTemplateOutlet]="getDescriptionAsTemplate()"></ng-container>
</div>
<div slot="reveal">
<ng-container *ngIf="reveal" [ngTemplateOutlet]="reveal"></ng-container>
</div>
</goa-checkbox>`, isInline: true, dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.3", ngImport: i0, type: GoabCheckbox, decorators: [{
type: Component,
args: [{
standalone: true,
selector: "goab-checkbox",
template: ` <goa-checkbox
[attr.name]="name"
[checked]="checked"
[disabled]="disabled"
[attr.error]="error"
[attr.text]="text"
[value]="value"
[attr.testid]="testId"
[attr.arialabel]="ariaLabel"
[attr.description]="getDescriptionAsString()"
[attr.revealarialabel]="revealArialLabel"
[id]="id"
[attr.maxwidth]="maxWidth"
[attr.mt]="mt"
[attr.mb]="mb"
[attr.ml]="ml"
[attr.mr]="mr"
(_change)="_onChange($event)"
>
<ng-content />
<div slot="description">
<ng-container [ngTemplateOutlet]="getDescriptionAsTemplate()"></ng-container>
</div>
<div slot="reveal">
<ng-container *ngIf="reveal" [ngTemplateOutlet]="reveal"></ng-container>
</div>
</goa-checkbox>`,
schemas: [CUSTOM_ELEMENTS_SCHEMA],
providers: [
{
provide: NG_VALUE_ACCESSOR,
multi: true,
useExisting: forwardRef(() => GoabCheckbox),
},
],
imports: [NgTemplateOutlet, NgIf],
}]
}], propDecorators: { name: [{
type: Input
}], checked: [{
type: Input,
args: [{ transform: booleanAttribute }]
}], text: [{
type: Input
}], value: [{
type: Input
}], ariaLabel: [{
type: Input
}], description: [{
type: Input
}], reveal: [{
type: Input
}], revealArialLabel: [{
type: Input
}], maxWidth: [{
type: Input
}], onChange: [{
type: Output
}] } });
class GoabChip extends GoabBaseComponent {
constructor() {
super(...arguments);
this.content = "";
this.onClick = new EventEmitter();
}
_onClick() {
this.onClick.emit();
}
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.3", ngImport: i0, type: GoabChip, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "18.0.3", type: GoabChip, isStandalone: true, selector: "goab-chip", inputs: { leadingIcon: "leadingIcon", error: ["error", "error", booleanAttribute], deletable: ["deletable", "deletable", booleanAttribute], content: "content", variant: "variant", iconTheme: "iconTheme" }, outputs: { onClick: "onClick" }, usesInheritance: true, ngImport: i0, template: `<goa-chip
[attr.leadingicon]="leadingIcon"
[attr.variant]="variant"
[attr.error]="error"
[attr.deletable]="deletable"
[attr.icontheme]="iconTheme"
[attr.content]="content"
[attr.testid]="testId"
[attr.mt]="mt"
[attr.mb]="mb"
[attr.ml]="ml"
[attr.mr]="mr"
(_click)="_onClick()"
>
<ng-content />
</goa-chip>`, isInline: true }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.3", ngImport: i0, type: GoabChip, decorators: [{
type: Component,
args: [{
standalone: true,
selector: "goab-chip",
template: `<goa-chip
[attr.leadingicon]="leadingIcon"
[attr.variant]="variant"
[attr.error]="error"
[attr.deletable]="deletable"
[attr.icontheme]="iconTheme"
[attr.content]="content"
[attr.testid]="testId"
[attr.mt]="mt"
[attr.mb]="mb"
[attr.ml]="ml"
[attr.mr]="mr"
(_click)="_onClick()"
>
<ng-content />
</goa-chip>`,
schemas: [CUSTOM_ELEMENTS_SCHEMA],
}]
}], propDecorators: { leadingIcon: [{
type: Input
}], error: [{
type: Input,
args: [{ transform: booleanAttribute }]
}], deletable: [{
type: Input,
args: [{ transform: booleanAttribute }]
}], content: [{
type: Input
}], variant: [{
type: Input
}], iconTheme: [{
type: Input
}], onClick: [{
type: Output
}] } });
class GoabCircularProgress {
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.3", ngImport: i0, type: GoabCircularProgress, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "18.0.3", type: GoabCircularProgress, isStandalone: true, selector: "goab-circular-progress", inputs: { variant: "variant", size: "size", message: "message", visible: ["visible", "visible", booleanAttribute], progress: ["progress", "progress", numberAttribute], testId: "testId" }, ngImport: i0, template: `
<goa-circular-progress
[attr.variant]="variant"
[attr.size]="size"
[attr.message]="message"
[attr.visible]="visible"
[attr.progress]="progress"
[attr.testid]="testId"
>
</goa-circular-progress>
`, isInline: true }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.3", ngImport: i0, type: GoabCircularProgress, decorators: [{
type: Component,
args: [{
standalone: true,
selector: "goab-circular-progress",
template: `
<goa-circular-progress
[attr.variant]="variant"
[attr.size]="size"
[attr.message]="message"
[attr.visible]="visible"
[attr.progress]="progress"
[attr.testid]="testId"
>
</goa-circular-progress>
`,
schemas: [CUSTOM_ELEMENTS_SCHEMA],
}]
}], propDecorators: { variant: [{
type: Input
}], size: [{
type: Input
}], message: [{
type: Input
}], visible: [{
type: Input,
args: [{ transform: booleanAttribute }]
}], progress: [{
type: Input,
args: [{ transform: numberAttribute }]
}], testId: [{
type: Input
}] } });
class GoabColumnLayout {
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.3", ngImport: i0, type: GoabColumnLayout, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.0.3", type: GoabColumnLayout, isStandalone: true, selector: "goab-column-layout", ngImport: i0, template: `
<goa-one-column-layout>
<ng-content />
</goa-one-column-layout>
`, isInline: true }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.3", ngImport: i0, type: GoabColumnLayout, decorators: [{
type: Component,
args: [{
standalone: true,
selector: "goab-column-layout",
template: `
<goa-one-column-layout>
<ng-content />
</goa-one-column-layout>
`,
schemas: [CUSTOM_ELEMENTS_SCHEMA],
}]
}] });
class GoabContainer extends GoabBaseComponent {
constructor() {
super(...arguments);
this.type = "interactive";
this.accent = "filled";
this.padding = "relaxed";
this.width = "full";
}
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.3", ngImport: i0, type: GoabContainer, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.0.3", type: GoabContainer, isStandalone: true, selector: "goab-container", inputs: { type: "type", accent: "accent", padding: "padding", width: "width", maxWidth: "maxWidth", title: "title", actions: "actions" }, usesInheritance: true, ngImport: i0, template: `<goa-container
[attr.type]="type"
[attr.accent]="accent"
[attr.padding]="padding"
[attr.width]="width"
[attr.maxwidth]="maxWidth"
[attr.testid]="testId"
[attr.mt]="mt"
[attr.mb]="mb"
[attr.ml]="ml"
[attr.mr]="mr"
>
<div slot="title">
<ng-container [ngTemplateOutlet]="title"></ng-container>
</div>
<ng-content />
<div slot="actions">
<ng-container [ngTemplateOutlet]="actions"></ng-container>
</div>
</goa-container>`, isInline: true, dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.3", ngImport: i0, type: GoabContainer, decorators: [{
type: Component,
args: [{
standalone: true,
selector: "goab-container",
imports: [NgTemplateOutlet],
template: `<goa-container
[attr.type]="type"
[attr.accent]="accent"
[attr.padding]="padding"
[attr.width]="width"
[attr.maxwidth]="maxWidth"
[attr.testid]="testId"
[attr.mt]="mt"
[attr.mb]="mb"
[attr.ml]="ml"
[attr.mr]="mr"
>
<div slot="title">
<ng-container [ngTemplateOutlet]="title"></ng-container>
</div>
<ng-content />
<div slot="actions">
<ng-container [ngTemplateOutlet]="actions"></ng-container>
</div>
</goa-container>`,
schemas: [CUSTOM_ELEMENTS_SCHEMA],
}]
}], propDecorators: { type: [{
type: Input
}], accent: [{
type: Input
}], padding: [{
type: Input
}], width: [{
type: Input
}], maxWidth: [{
type: Input
}], title: [{
type: Input
}], actions: [{
type: Input
}] } });
class GoabDatePicker extends GoabControlValueAccessor {
formatValue(val) {
if (!val)
return "";
if (val instanceof Date) {
return val.toISOString();
}
return val;
}
_onChange(e) {
const detail = e.detail;
this.onChange.emit(detail);
this.markAsTouched();
this.fcChange?.(detail.value);
}
constructor(elementRef) {
super();
this.elementRef = elementRef;
this.onChange = new EventEmitter();
}
setDisabledState(isDisabled) {
this.disabled = isDisabled;
this.elementRef.nativeElement.disabled = isDisabled;
}
listenDisabledChange(isDisabled) {
this.setDisabledState(isDisabled);
}
writeValue(value) {
this.value = value;
const datePickerEl = this.elementRef?.nativeElement?.querySelector("goa-date-picker");
if (datePickerEl) {
if (!value) {
datePickerEl.setAttribute("value", "");
}
else {
datePickerEl.setAttribute("value", value instanceof Date ? value.toISOString() : value);
}
}
}
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.3", ngImport: i0, type: GoabDatePicker, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.0.3", 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: [
{
provide: NG_VALUE_ACCESSOR,
multi: true,
useExisting: forwardRef(() => GoabDatePicker),
},
], usesInheritance: true, ngImport: i0, template: ` <goa-date-picker
[attr.name]="name"
[attr.value]="formatValue(value)"
[attr.min]="min"
[attr.max]="max"
[attr.error]="error"
[attr.disabled]="disabled"
[attr.relative]="relative"
[attr.type]="type"
[attr.testid]="testId"
[attr.mt]="mt"
[attr.mb]="mb"
[attr.ml]="ml"
[attr.mr]="mr"
(_change)="_onChange($event)"
>
</goa-date-picker>`, isInline: true }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.3", ngImport: i0, type: GoabDatePicker, decorators: [{
type: Component,
args: [{
standalone: true,
selector: "goab-date-picker",
template: ` <goa-date-picker
[attr.name]="name"
[attr.value]="formatValue(value)"
[attr.min]="min"
[attr.max]="max"
[attr.error]="error"
[attr.disabled]="disabled"
[attr.relative]="relative"
[attr.type]="type"
[attr.testid]="testId"
[attr.mt]="mt"
[attr.mb]="mb"
[attr.ml]="ml"
[attr.mr]="mr"
(_change)="_onChange($event)"
>
</goa-date-picker>`,
schemas: [CUSTOM_ELEMENTS_SCHEMA],
providers: [
{
provide: NG_VALUE_ACCESSOR,
multi: true,
useExisting: forwardRef(() => GoabDatePicker),
},
],
}]
}], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { name: [{
type: Input
}], value: [{
type: Input
}], min: [{
type: Input
}], max: [{
type: Input
}], type: [{
type: Input
}], relative: [{
type: Input
}], onChange: [{
type: Output
}], listenDisabledChange: [{
type: HostListener,
args: ["disabledChange", ["$event.detail.disabled"]]
}] } });
class GoabDetails extends GoabBaseComponent {
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.3", ngImport: i0, type: GoabDetails, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "18.0.3", type: GoabDetails, isStandalone: true, selector: "goab-details", inputs: { heading: "heading", open: ["open", "open", booleanAttribute], maxWidth: