@vsn-ux/ngx-gaia 0.1.4 → 0.1.6

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,13 +1,14 @@
1
1
  import * as i0 from '@angular/core';
2
- import { inject, ElementRef, input, numberAttribute, Component, ViewEncapsulation, Attribute, NgModule, contentChild, computed, ChangeDetectionStrategy, booleanAttribute, forwardRef, Injector, signal, linkedSignal, output, Directive, model, HostListener, InjectionToken, effect, TemplateRef, NgZone, Input } from '@angular/core';
2
+ import { inject, ElementRef, input, numberAttribute, Component, ViewEncapsulation, Attribute, NgModule, ChangeDetectionStrategy, Injectable, makeEnvironmentProviders, booleanAttribute, output, computed, contentChild, forwardRef, Injector, signal, linkedSignal, Directive, model, HostListener, InjectionToken, effect, TemplateRef, NgZone, Input } from '@angular/core';
3
3
  import * as i1 from 'lucide-angular';
4
- import { LucideAngularModule } from 'lucide-angular';
4
+ import { LucideAngularModule, X, CircleCheck, TriangleAlert, OctagonAlert, Info, ChevronUp, ChevronDown } from 'lucide-angular';
5
5
  import { NG_VALUE_ACCESSOR, NgControl, NG_VALIDATORS, CheckboxRequiredValidator } from '@angular/forms';
6
6
  import * as i1$1 from '@angular/cdk/menu';
7
7
  import { CdkMenu, CdkMenuItem, CdkMenuTrigger } from '@angular/cdk/menu';
8
+ import { toSignal } from '@angular/core/rxjs-interop';
9
+ import { merge, map, Subject, takeUntil } from 'rxjs';
8
10
  import { Overlay } from '@angular/cdk/overlay';
9
11
  import { ComponentPortal } from '@angular/cdk/portal';
10
- import { Subject, takeUntil, map } from 'rxjs';
11
12
  import { ESCAPE, hasModifierKey } from '@angular/cdk/keycodes';
12
13
  import { NgTemplateOutlet } from '@angular/common';
13
14
 
@@ -74,21 +75,134 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImpor
74
75
  }]
75
76
  }] });
76
77
 
78
+ class GaButtonDirective {
79
+ variant = input.required({
80
+ alias: 'gaButton',
81
+ });
82
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: GaButtonDirective, deps: [], target: i0.ɵɵFactoryTarget.Component });
83
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.1.5", type: GaButtonDirective, isStandalone: true, selector: "button[gaButton], a[gaButton]", inputs: { variant: { classPropertyName: "variant", publicName: "gaButton", isSignal: true, isRequired: true, transformFunction: null } }, host: { properties: { "class.ga-button--secondary": "!variant() || variant() === 'secondary'", "class.ga-button--primary": "variant() === 'primary'", "class.ga-button--ghost": "variant() === 'ghost'", "class.ga-button--transparent": "variant() === 'transparent'" }, classAttribute: "ga-button" }, ngImport: i0, template: `<ng-content />`, isInline: true });
84
+ }
85
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: GaButtonDirective, decorators: [{
86
+ type: Component,
87
+ args: [{
88
+ selector: 'button[gaButton], a[gaButton]',
89
+ host: {
90
+ class: 'ga-button',
91
+ '[class.ga-button--secondary]': `!variant() || variant() === 'secondary'`,
92
+ '[class.ga-button--primary]': `variant() === 'primary'`,
93
+ '[class.ga-button--ghost]': `variant() === 'ghost'`,
94
+ '[class.ga-button--transparent]': `variant() === 'transparent'`,
95
+ },
96
+ template: `<ng-content />`,
97
+ }]
98
+ }] });
99
+
100
+ class GaIconButtonDirective {
101
+ icon = input.required({
102
+ alias: 'gaIconButton',
103
+ });
104
+ variant = input('secondary', {
105
+ alias: 'gaIconButtonVariant',
106
+ });
107
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: GaIconButtonDirective, deps: [], target: i0.ɵɵFactoryTarget.Component });
108
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.1.5", type: GaIconButtonDirective, isStandalone: true, selector: "button[gaIconButton], a[gaIconButton]", inputs: { icon: { classPropertyName: "icon", publicName: "gaIconButton", isSignal: true, isRequired: true, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "gaIconButtonVariant", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.ga-button--primary": "variant() === 'primary'", "class.ga-button--secondary": "variant() === 'secondary'", "class.ga-button--ghost": "variant() === 'ghost'" }, classAttribute: "ga-button ga-button--icon-only" }, ngImport: i0, template: `
109
+ <ga-icon [icon]="icon()" />
110
+ <span class="ga-button__icon-label"><ng-content /></span>
111
+ `, isInline: true, styles: [".ga-button__icon-label{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;-webkit-clip-path:inset(50%)!important;clip-path:inset(50%)!important;white-space:nowrap!important;border-width:0!important}\n"], dependencies: [{ kind: "ngmodule", type: GaIconModule }, { kind: "component", type: GaIconComponent, selector: "ga-icon", inputs: ["icon", "size", "color", "strokeWidth"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
112
+ }
113
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: GaIconButtonDirective, decorators: [{
114
+ type: Component,
115
+ args: [{ selector: 'button[gaIconButton], a[gaIconButton]', imports: [GaIconModule], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: `
116
+ <ga-icon [icon]="icon()" />
117
+ <span class="ga-button__icon-label"><ng-content /></span>
118
+ `, host: {
119
+ class: 'ga-button ga-button--icon-only',
120
+ '[class.ga-button--primary]': `variant() === 'primary'`,
121
+ '[class.ga-button--secondary]': `variant() === 'secondary'`,
122
+ '[class.ga-button--ghost]': `variant() === 'ghost'`,
123
+ }, styles: [".ga-button__icon-label{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;-webkit-clip-path:inset(50%)!important;clip-path:inset(50%)!important;white-space:nowrap!important;border-width:0!important}\n"] }]
124
+ }] });
125
+
126
+ class GaButtonModule {
127
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: GaButtonModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
128
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.1.5", ngImport: i0, type: GaButtonModule, imports: [GaButtonDirective, GaIconButtonDirective], exports: [GaButtonDirective, GaIconButtonDirective] });
129
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: GaButtonModule, imports: [GaIconButtonDirective] });
130
+ }
131
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: GaButtonModule, decorators: [{
132
+ type: NgModule,
133
+ args: [{
134
+ imports: [GaButtonDirective, GaIconButtonDirective],
135
+ exports: [GaButtonDirective, GaIconButtonDirective],
136
+ }]
137
+ }] });
138
+
139
+ function GA_ALERT_I18N_FACTORY() {
140
+ return new GaAlertI18nDefault();
141
+ }
142
+ class GaAlertI18n {
143
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: GaAlertI18n, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
144
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: GaAlertI18n, providedIn: 'root', useFactory: GA_ALERT_I18N_FACTORY });
145
+ }
146
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: GaAlertI18n, decorators: [{
147
+ type: Injectable,
148
+ args: [{
149
+ providedIn: 'root',
150
+ useFactory: GA_ALERT_I18N_FACTORY,
151
+ }]
152
+ }] });
153
+ class GaAlertI18nDefault extends GaAlertI18n {
154
+ /** A label for the dismiss button */
155
+ dismissLabel = 'Dismiss';
156
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: GaAlertI18nDefault, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
157
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: GaAlertI18nDefault });
158
+ }
159
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: GaAlertI18nDefault, decorators: [{
160
+ type: Injectable
161
+ }] });
162
+ function provideGaAlertI18n(value) {
163
+ return makeEnvironmentProviders([
164
+ typeof value === 'function'
165
+ ? { provide: GaAlertI18n, useFactory: value }
166
+ : { provide: GaAlertI18n, useValue: value },
167
+ ]);
168
+ }
169
+
77
170
  class GaAlertComponent {
171
+ i18n = inject(GaAlertI18n);
172
+ dismissIcon = X;
78
173
  variant = input('brand');
79
- icon = input();
80
- title = contentChild.required(GaAlertTitleComponent);
174
+ explicitIcon = input(undefined, { alias: 'icon' });
175
+ dismissible = input(false, { transform: booleanAttribute });
176
+ dismiss = output();
177
+ icon = computed(() => {
178
+ if (this.explicitIcon() !== undefined) {
179
+ return this.explicitIcon();
180
+ }
181
+ switch (this.variant()) {
182
+ case 'information':
183
+ return Info;
184
+ case 'error':
185
+ return OctagonAlert;
186
+ case 'warning':
187
+ return TriangleAlert;
188
+ case 'success':
189
+ return CircleCheck;
190
+ }
191
+ return null;
192
+ });
193
+ title = contentChild(GaAlertTitleComponent);
81
194
  variantClass = computed(() => {
82
195
  return `ga-notification ga-notification--${this.variant()}`;
83
196
  });
84
197
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: GaAlertComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
85
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.1.5", type: GaAlertComponent, isStandalone: true, selector: "ga-alert", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "variantClass()" } }, queries: [{ propertyName: "title", first: true, predicate: GaAlertTitleComponent, descendants: true, isSignal: true }], ngImport: i0, template: "@if (icon()) {\n <ga-icon [icon]=\"icon()\" class=\"ga-notification__icon\" />\n}\n<div>\n @if (title()) {\n <div class=\"ga-notification__heading\">\n <ng-content select=\"ga-alert-title\" />\n <ng-content select=\"ga-alert-title-actions\" />\n </div>\n }\n <div class=\"ga-notification__description\">\n <ng-content />\n </div>\n</div>\n", dependencies: [{ kind: "ngmodule", type: GaIconModule }, { kind: "component", type: GaIconComponent, selector: "ga-icon", inputs: ["icon", "size", "color", "strokeWidth"] }] });
198
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.1.5", type: GaAlertComponent, isStandalone: true, selector: "ga-alert", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, explicitIcon: { classPropertyName: "explicitIcon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, dismissible: { classPropertyName: "dismissible", publicName: "dismissible", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { dismiss: "dismiss" }, host: { attributes: { "role": "alert" }, properties: { "class": "variantClass()" } }, queries: [{ propertyName: "title", first: true, predicate: GaAlertTitleComponent, descendants: true, isSignal: true }], ngImport: i0, template: "@if (icon()) {\n <ga-icon [icon]=\"icon()!\" class=\"ga-notification__icon\" />\n}\n<div class=\"ga-notification__content\">\n @if (title()) {\n <div class=\"ga-notification__heading\">\n <ng-content select=\"ga-alert-title\" />\n <ng-content select=\"ga-alert-title-actions\" />\n </div>\n }\n <div class=\"ga-notification__description\">\n <ng-content />\n </div>\n</div>\n\n@if (dismissible()) {\n <button\n type=\"button\"\n [gaIconButton]=\"dismissIcon\"\n gaIconButtonVariant=\"ghost\"\n (click)=\"dismiss.emit()\"\n >\n {{ i18n.dismissLabel }}\n </button>\n}\n", dependencies: [{ kind: "ngmodule", type: GaIconModule }, { kind: "component", type: GaIconComponent, selector: "ga-icon", inputs: ["icon", "size", "color", "strokeWidth"] }, { kind: "ngmodule", type: GaButtonModule }, { kind: "component", type: GaIconButtonDirective, selector: "button[gaIconButton], a[gaIconButton]", inputs: ["gaIconButton", "gaIconButtonVariant"] }] });
86
199
  }
87
200
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: GaAlertComponent, decorators: [{
88
201
  type: Component,
89
- args: [{ selector: 'ga-alert', imports: [GaIconModule], host: {
202
+ args: [{ selector: 'ga-alert', imports: [GaIconModule, GaButtonModule], host: {
203
+ role: 'alert',
90
204
  '[class]': `variantClass()`,
91
- }, template: "@if (icon()) {\n <ga-icon [icon]=\"icon()\" class=\"ga-notification__icon\" />\n}\n<div>\n @if (title()) {\n <div class=\"ga-notification__heading\">\n <ng-content select=\"ga-alert-title\" />\n <ng-content select=\"ga-alert-title-actions\" />\n </div>\n }\n <div class=\"ga-notification__description\">\n <ng-content />\n </div>\n</div>\n" }]
205
+ }, template: "@if (icon()) {\n <ga-icon [icon]=\"icon()!\" class=\"ga-notification__icon\" />\n}\n<div class=\"ga-notification__content\">\n @if (title()) {\n <div class=\"ga-notification__heading\">\n <ng-content select=\"ga-alert-title\" />\n <ng-content select=\"ga-alert-title-actions\" />\n </div>\n }\n <div class=\"ga-notification__description\">\n <ng-content />\n </div>\n</div>\n\n@if (dismissible()) {\n <button\n type=\"button\"\n [gaIconButton]=\"dismissIcon\"\n gaIconButtonVariant=\"ghost\"\n (click)=\"dismiss.emit()\"\n >\n {{ i18n.dismissLabel }}\n </button>\n}\n" }]
92
206
  }] });
93
207
 
94
208
  class GaAlertTitleActionsComponent {
@@ -164,67 +278,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImpor
164
278
  }]
165
279
  }] });
166
280
 
167
- class GaButtonDirective {
168
- variant = input.required({
169
- alias: 'gaButton',
170
- });
171
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: GaButtonDirective, deps: [], target: i0.ɵɵFactoryTarget.Component });
172
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.1.5", type: GaButtonDirective, isStandalone: true, selector: "button[gaButton], a[gaButton]", inputs: { variant: { classPropertyName: "variant", publicName: "gaButton", isSignal: true, isRequired: true, transformFunction: null } }, host: { properties: { "class.ga-button--secondary": "!variant() || variant() === 'secondary'", "class.ga-button--primary": "variant() === 'primary'", "class.ga-button--ghost": "variant() === 'ghost'", "class.ga-button--transparent": "variant() === 'transparent'" }, classAttribute: "ga-button" }, ngImport: i0, template: `<ng-content />`, isInline: true });
173
- }
174
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: GaButtonDirective, decorators: [{
175
- type: Component,
176
- args: [{
177
- selector: 'button[gaButton], a[gaButton]',
178
- host: {
179
- class: 'ga-button',
180
- '[class.ga-button--secondary]': `!variant() || variant() === 'secondary'`,
181
- '[class.ga-button--primary]': `variant() === 'primary'`,
182
- '[class.ga-button--ghost]': `variant() === 'ghost'`,
183
- '[class.ga-button--transparent]': `variant() === 'transparent'`,
184
- },
185
- template: `<ng-content />`,
186
- }]
187
- }] });
188
-
189
- class GaIconButtonDirective {
190
- icon = input.required({
191
- alias: 'gaIconButton',
192
- });
193
- variant = input('secondary', {
194
- alias: 'gaIconButtonVariant',
195
- });
196
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: GaIconButtonDirective, deps: [], target: i0.ɵɵFactoryTarget.Component });
197
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.1.5", type: GaIconButtonDirective, isStandalone: true, selector: "button[gaIconButton], a[gaIconButton]", inputs: { icon: { classPropertyName: "icon", publicName: "gaIconButton", isSignal: true, isRequired: true, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "gaIconButtonVariant", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.ga-button--primary": "variant() === 'primary'", "class.ga-button--secondary": "variant() === 'secondary'", "class.ga-button--ghost": "variant() === 'ghost'" }, classAttribute: "ga-button ga-button--icon-only" }, ngImport: i0, template: `
198
- <ga-icon [icon]="icon()" />
199
- <span class="ga-button__icon-label"><ng-content /></span>
200
- `, isInline: true, styles: [".ga-button__icon-label{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;-webkit-clip-path:inset(50%)!important;clip-path:inset(50%)!important;white-space:nowrap!important;border-width:0!important}\n"], dependencies: [{ kind: "ngmodule", type: GaIconModule }, { kind: "component", type: GaIconComponent, selector: "ga-icon", inputs: ["icon", "size", "color", "strokeWidth"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
201
- }
202
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: GaIconButtonDirective, decorators: [{
203
- type: Component,
204
- args: [{ selector: 'button[gaIconButton], a[gaIconButton]', imports: [GaIconModule], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: `
205
- <ga-icon [icon]="icon()" />
206
- <span class="ga-button__icon-label"><ng-content /></span>
207
- `, host: {
208
- class: 'ga-button ga-button--icon-only',
209
- '[class.ga-button--primary]': `variant() === 'primary'`,
210
- '[class.ga-button--secondary]': `variant() === 'secondary'`,
211
- '[class.ga-button--ghost]': `variant() === 'ghost'`,
212
- }, styles: [".ga-button__icon-label{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;-webkit-clip-path:inset(50%)!important;clip-path:inset(50%)!important;white-space:nowrap!important;border-width:0!important}\n"] }]
213
- }] });
214
-
215
- class GaButtonModule {
216
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: GaButtonModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
217
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.1.5", ngImport: i0, type: GaButtonModule, imports: [GaButtonDirective, GaIconButtonDirective], exports: [GaButtonDirective, GaIconButtonDirective] });
218
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: GaButtonModule, imports: [GaIconButtonDirective] });
219
- }
220
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: GaButtonModule, decorators: [{
221
- type: NgModule,
222
- args: [{
223
- imports: [GaButtonDirective, GaIconButtonDirective],
224
- exports: [GaButtonDirective, GaIconButtonDirective],
225
- }]
226
- }] });
227
-
228
281
  class GaCardComponent {
229
282
  selectable = input(false, { transform: booleanAttribute });
230
283
  disabled = input(false, { transform: booleanAttribute });
@@ -264,11 +317,11 @@ const CHECKBOX_CONTROL_VALUE_ACCESSOR = {
264
317
  };
265
318
  // Increasing integer for generating unique ids for checkbox components.
266
319
  // Inspired by @angular/components
267
- let nextUniqueId$2 = 0;
320
+ let nextUniqueId$4 = 0;
268
321
  class GaCheckboxComponent {
269
322
  tabindex;
270
323
  /** @ignore */
271
- _uniqueId = `ga-checkbox-${++nextUniqueId$2}`;
324
+ _uniqueId = `ga-checkbox-${++nextUniqueId$4}`;
272
325
  /** @ignore */
273
326
  injector = inject(Injector);
274
327
  /** @ignore */
@@ -528,9 +581,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImpor
528
581
  }]
529
582
  }] });
530
583
 
531
- let nextUniqueId$1 = 0;
584
+ let nextUniqueId$3 = 0;
532
585
  class GaInputDirective {
533
- uniqueId = `ga-input-${++nextUniqueId$1}`;
586
+ uniqueId = `ga-input-${++nextUniqueId$3}`;
534
587
  implicitNgControl = inject(NgControl, {
535
588
  optional: true,
536
589
  self: true,
@@ -588,9 +641,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImpor
588
641
  }]
589
642
  }] });
590
643
 
591
- let nextUniqueId = 0;
644
+ let nextUniqueId$2 = 0;
592
645
  class GaFormFieldComponent {
593
- uniqueId = `ga-form-field-${++nextUniqueId}`;
646
+ uniqueId = `ga-form-field-${++nextUniqueId$2}`;
594
647
  formControl = contentChild(GA_FORM_CONTROL);
595
648
  controlId = computed(() => {
596
649
  return this.formControl()?.id() ?? this.uniqueId;
@@ -719,18 +772,20 @@ class GaMenuTriggerDirective {
719
772
  menuRef = input.required({
720
773
  alias: 'gaMenuTrigger',
721
774
  });
775
+ isOpen = toSignal(merge(this.cdkMenuTrigger.opened.pipe(map(() => true)), this.cdkMenuTrigger.closed.pipe(map(() => false))), { initialValue: this.cdkMenuTrigger.isOpen() });
722
776
  constructor() {
723
777
  effect(() => {
724
778
  this.cdkMenuTrigger.menuTemplateRef = this.menuRef();
725
779
  });
726
780
  }
727
781
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: GaMenuTriggerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
728
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.1.5", type: GaMenuTriggerDirective, isStandalone: true, selector: "[gaMenuTrigger]", inputs: { menuRef: { classPropertyName: "menuRef", publicName: "gaMenuTrigger", isSignal: true, isRequired: true, transformFunction: null } }, hostDirectives: [{ directive: i1$1.CdkMenuTrigger }], ngImport: i0 });
782
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.1.5", type: GaMenuTriggerDirective, isStandalone: true, selector: "[gaMenuTrigger]", inputs: { menuRef: { classPropertyName: "menuRef", publicName: "gaMenuTrigger", isSignal: true, isRequired: true, transformFunction: null } }, exportAs: ["gaMenuTrigger"], hostDirectives: [{ directive: i1$1.CdkMenuTrigger }], ngImport: i0 });
729
783
  }
730
784
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: GaMenuTriggerDirective, decorators: [{
731
785
  type: Directive,
732
786
  args: [{
733
787
  selector: '[gaMenuTrigger]',
788
+ exportAs: 'gaMenuTrigger',
734
789
  standalone: true,
735
790
  hostDirectives: [CdkMenuTrigger],
736
791
  }]
@@ -751,18 +806,37 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImpor
751
806
  }]
752
807
  }] });
753
808
 
809
+ class GaMenuTriggerIconComponent {
810
+ menuTrigger = inject(GaMenuTriggerDirective);
811
+ icon = computed(() => {
812
+ return this.menuTrigger.isOpen() ? ChevronUp : ChevronDown;
813
+ });
814
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: GaMenuTriggerIconComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
815
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.5", type: GaMenuTriggerIconComponent, isStandalone: true, selector: "ga-menu-trigger-icon", ngImport: i0, template: `<ga-icon [icon]="icon()" />`, isInline: true, dependencies: [{ kind: "ngmodule", type: GaIconModule }, { kind: "component", type: GaIconComponent, selector: "ga-icon", inputs: ["icon", "size", "color", "strokeWidth"] }] });
816
+ }
817
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: GaMenuTriggerIconComponent, decorators: [{
818
+ type: Component,
819
+ args: [{
820
+ selector: 'ga-menu-trigger-icon',
821
+ imports: [GaIconModule],
822
+ template: `<ga-icon [icon]="icon()" />`,
823
+ }]
824
+ }] });
825
+
754
826
  class GaMenuModule {
755
827
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: GaMenuModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
756
828
  static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.1.5", ngImport: i0, type: GaMenuModule, imports: [GaMenuComponent,
757
829
  GaMenuItemComponent,
758
830
  GaMenuTriggerDirective,
759
831
  GaMenuSeparatorComponent,
760
- GaMenuTitleComponent], exports: [GaMenuComponent,
832
+ GaMenuTitleComponent,
833
+ GaMenuTriggerIconComponent], exports: [GaMenuComponent,
761
834
  GaMenuItemComponent,
762
835
  GaMenuTriggerDirective,
763
836
  GaMenuSeparatorComponent,
764
- GaMenuTitleComponent] });
765
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: GaMenuModule });
837
+ GaMenuTitleComponent,
838
+ GaMenuTriggerIconComponent] });
839
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: GaMenuModule, imports: [GaMenuTriggerIconComponent] });
766
840
  }
767
841
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: GaMenuModule, decorators: [{
768
842
  type: NgModule,
@@ -773,6 +847,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImpor
773
847
  GaMenuTriggerDirective,
774
848
  GaMenuSeparatorComponent,
775
849
  GaMenuTitleComponent,
850
+ GaMenuTriggerIconComponent,
776
851
  ],
777
852
  exports: [
778
853
  GaMenuComponent,
@@ -780,6 +855,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImpor
780
855
  GaMenuTriggerDirective,
781
856
  GaMenuSeparatorComponent,
782
857
  GaMenuTitleComponent,
858
+ GaMenuTriggerIconComponent,
783
859
  ],
784
860
  }]
785
861
  }] });
@@ -1252,6 +1328,167 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImpor
1252
1328
  }]
1253
1329
  }] });
1254
1330
 
1331
+ /**
1332
+ * Provider Expression that allows ga-radio-group to register as a ControlValueAccessor.
1333
+ * This allows it to support [(ngModel)] and ngControl.
1334
+ */
1335
+ const RADIO_CONTROL_VALUE_ACCESSOR = {
1336
+ provide: NG_VALUE_ACCESSOR,
1337
+ useExisting: forwardRef(() => GaRadioGroupComponent),
1338
+ multi: true,
1339
+ };
1340
+ // Increasing integer for generating unique ids for radio components.
1341
+ let nextUniqueId$1 = 0;
1342
+ class GaRadioGroupComponent {
1343
+ /** Name of the radio button group. All radio buttons inside this group will use this name. */
1344
+ name = input(`ga-radio-group-${nextUniqueId$1++}`);
1345
+ /**
1346
+ * Value for the radio-group. Should equal the value of the selected radio button if there is
1347
+ * a corresponding radio button with a matching value. If there is not such a corresponding
1348
+ * radio button, this value persists to be applied in case a new radio button is added with a
1349
+ * matching value.
1350
+ */
1351
+ value = input(null);
1352
+ /** Whether the radio group is disabled */
1353
+ disabled = input(false, { transform: booleanAttribute });
1354
+ /**
1355
+ * Event emitted when the group value changes.
1356
+ * Change events are only emitted when the value changes due to user interaction with
1357
+ * a radio button (the same behavior as `<input type="radio">`).
1358
+ */
1359
+ change = output();
1360
+ valueModel = linkedSignal(() => this.value());
1361
+ disabledModel = linkedSignal(() => this.disabled());
1362
+ _onTouched;
1363
+ _onModelChanged;
1364
+ registerOnChange(fn) {
1365
+ this._onModelChanged = fn;
1366
+ }
1367
+ registerOnTouched(fn) {
1368
+ this._onTouched = fn;
1369
+ }
1370
+ writeValue(value) {
1371
+ this.valueModel.set(value);
1372
+ }
1373
+ setDisabledState(isDisabled) {
1374
+ this.disabledModel.set(isDisabled);
1375
+ }
1376
+ onValueChange(value) {
1377
+ if (this.valueModel() === value) {
1378
+ return;
1379
+ }
1380
+ this.valueModel.set(value);
1381
+ this.change.emit(value);
1382
+ if (this._onModelChanged) {
1383
+ this._onModelChanged(value);
1384
+ }
1385
+ }
1386
+ onBlur() {
1387
+ if (this._onTouched) {
1388
+ this._onTouched();
1389
+ }
1390
+ }
1391
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: GaRadioGroupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1392
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.1.5", type: GaRadioGroupComponent, isStandalone: true, selector: "ga-radio-group", inputs: { name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { change: "change" }, host: { attributes: { "role": "radiogroup" }, classAttribute: "ga-radio-group" }, providers: [RADIO_CONTROL_VALUE_ACCESSOR], ngImport: i0, template: "<ng-content></ng-content>\n", changeDetection: i0.ChangeDetectionStrategy.OnPush });
1393
+ }
1394
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: GaRadioGroupComponent, decorators: [{
1395
+ type: Component,
1396
+ args: [{ selector: 'ga-radio-group', providers: [RADIO_CONTROL_VALUE_ACCESSOR], changeDetection: ChangeDetectionStrategy.OnPush, host: {
1397
+ role: 'radiogroup',
1398
+ class: 'ga-radio-group',
1399
+ }, template: "<ng-content></ng-content>\n" }]
1400
+ }] });
1401
+
1402
+ // Increasing integer for generating unique ids for radio button components.
1403
+ let nextUniqueId = 0;
1404
+ class GaRadioButtonComponent {
1405
+ tabindex;
1406
+ radioGroup = inject(GaRadioGroupComponent, {
1407
+ optional: true,
1408
+ });
1409
+ _uniqueId = `ga-radio-button-${++nextUniqueId}`;
1410
+ /** The value attribute of the native input element */
1411
+ value = input(null);
1412
+ inputId = input(null, { alias: 'id' });
1413
+ inputName = input(null, { alias: 'name' });
1414
+ inputChecked = input(false, {
1415
+ alias: 'checked',
1416
+ transform: booleanAttribute,
1417
+ });
1418
+ inputDisabled = input(false, {
1419
+ alias: 'disabled',
1420
+ transform: booleanAttribute,
1421
+ });
1422
+ ariaLabel = input(null, { alias: 'aria-label' });
1423
+ ariaLabelledby = input(null, {
1424
+ alias: 'aria-labelledby',
1425
+ });
1426
+ ariaDescribedby = input(null, {
1427
+ alias: 'aria-describedby',
1428
+ });
1429
+ ariaInvalid = input(null, { alias: 'aria-invalid' });
1430
+ ariaErrormessage = input(null, {
1431
+ alias: 'aria-errormessage',
1432
+ });
1433
+ /**
1434
+ * Event emitted when the group value changes.
1435
+ * Change events are only emitted when the value changes due to user interaction with
1436
+ * a radio button (the same behavior as `<input type="radio">`).
1437
+ */
1438
+ change = output();
1439
+ id = computed(() => this.inputId() ?? this._uniqueId);
1440
+ name = computed(() => this.radioGroup?.name() ?? this.inputName() ?? this._uniqueId);
1441
+ disabled = computed(() => this.radioGroup?.disabledModel() || this.inputDisabled());
1442
+ checked = computed(() => this.radioGroup?.valueModel() === this.value() || this.inputChecked());
1443
+ constructor(tabindex) {
1444
+ this.tabindex = tabindex;
1445
+ }
1446
+ onInputChange(event) {
1447
+ // We always have to stop propagation on the change event.
1448
+ // Otherwise the change event, from the input element, will bubble up and
1449
+ // emit its event object to the `change` output.
1450
+ event.stopPropagation();
1451
+ if (this.disabled()) {
1452
+ return;
1453
+ }
1454
+ this.change.emit(this.value());
1455
+ this.radioGroup?.onValueChange(this.value());
1456
+ }
1457
+ onBlur() {
1458
+ this.radioGroup?.onBlur();
1459
+ }
1460
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: GaRadioButtonComponent, deps: [{ token: 'tabindex', attribute: true }], target: i0.ɵɵFactoryTarget.Component });
1461
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.1.5", type: GaRadioButtonComponent, isStandalone: true, selector: "ga-radio-button", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, inputId: { classPropertyName: "inputId", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, inputName: { classPropertyName: "inputName", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, inputChecked: { classPropertyName: "inputChecked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, inputDisabled: { classPropertyName: "inputDisabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledby: { classPropertyName: "ariaLabelledby", publicName: "aria-labelledby", isSignal: true, isRequired: false, transformFunction: null }, ariaDescribedby: { classPropertyName: "ariaDescribedby", publicName: "aria-describedby", isSignal: true, isRequired: false, transformFunction: null }, ariaInvalid: { classPropertyName: "ariaInvalid", publicName: "aria-invalid", isSignal: true, isRequired: false, transformFunction: null }, ariaErrormessage: { classPropertyName: "ariaErrormessage", publicName: "aria-errormessage", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { change: "change" }, host: { properties: { "class.ga-radio-button--invalid": "ariaInvalid()", "attr.id": "null", "attr.tabindex": "null", "attr.aria-label": "null", "attr.aria-labelledby": "null", "attr.aria-describedby": "null" }, classAttribute: "ga-radio-button" }, ngImport: i0, template: "<input\n type=\"radio\"\n class=\"ga-radio-button__native\"\n [attr.id]=\"id()\"\n [name]=\"name()\"\n [checked]=\"checked()\"\n [disabled]=\"disabled()\"\n [attr.tabindex]=\"tabindex\"\n [attr.value]=\"value()\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-labelledby]=\"ariaLabelledby()\"\n [attr.aria-describedby]=\"ariaDescribedby()\"\n [attr.aria-invalid]=\"ariaInvalid()\"\n [attr.aria-errormessage]=\"ariaErrormessage()\"\n (change)=\"onInputChange($event)\"\n (blur)=\"onBlur()\"\n/>\n\n<div class=\"ga-radio-button__marker\"></div>\n<label class=\"ga-radio-button__label\" [attr.for]=\"id()\"\n ><ng-content></ng-content\n></label>\n", changeDetection: i0.ChangeDetectionStrategy.OnPush });
1462
+ }
1463
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: GaRadioButtonComponent, decorators: [{
1464
+ type: Component,
1465
+ args: [{ selector: 'ga-radio-button', changeDetection: ChangeDetectionStrategy.OnPush, host: {
1466
+ class: 'ga-radio-button',
1467
+ '[class.ga-radio-button--invalid]': 'ariaInvalid()',
1468
+ '[attr.id]': 'null',
1469
+ '[attr.tabindex]': 'null',
1470
+ '[attr.aria-label]': 'null',
1471
+ '[attr.aria-labelledby]': 'null',
1472
+ '[attr.aria-describedby]': 'null',
1473
+ }, template: "<input\n type=\"radio\"\n class=\"ga-radio-button__native\"\n [attr.id]=\"id()\"\n [name]=\"name()\"\n [checked]=\"checked()\"\n [disabled]=\"disabled()\"\n [attr.tabindex]=\"tabindex\"\n [attr.value]=\"value()\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-labelledby]=\"ariaLabelledby()\"\n [attr.aria-describedby]=\"ariaDescribedby()\"\n [attr.aria-invalid]=\"ariaInvalid()\"\n [attr.aria-errormessage]=\"ariaErrormessage()\"\n (change)=\"onInputChange($event)\"\n (blur)=\"onBlur()\"\n/>\n\n<div class=\"ga-radio-button__marker\"></div>\n<label class=\"ga-radio-button__label\" [attr.for]=\"id()\"\n ><ng-content></ng-content\n></label>\n" }]
1474
+ }], ctorParameters: () => [{ type: undefined, decorators: [{
1475
+ type: Attribute,
1476
+ args: ['tabindex']
1477
+ }] }] });
1478
+
1479
+ class GaRadioModule {
1480
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: GaRadioModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1481
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.1.5", ngImport: i0, type: GaRadioModule, imports: [GaRadioButtonComponent, GaRadioGroupComponent], exports: [GaRadioButtonComponent, GaRadioGroupComponent] });
1482
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: GaRadioModule });
1483
+ }
1484
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: GaRadioModule, decorators: [{
1485
+ type: NgModule,
1486
+ args: [{
1487
+ imports: [GaRadioButtonComponent, GaRadioGroupComponent],
1488
+ exports: [GaRadioButtonComponent, GaRadioGroupComponent],
1489
+ }]
1490
+ }] });
1491
+
1255
1492
  /*
1256
1493
  * Public API Surface of ngx-gaia
1257
1494
  */
@@ -1260,5 +1497,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImpor
1260
1497
  * Generated bundle index. Do not edit.
1261
1498
  */
1262
1499
 
1263
- export { CHECKBOX_CONTROL_VALUE_ACCESSOR, GA_CHECKBOX_REQUIRED_VALIDATOR, GA_FORM_CONTROL, GA_TOOLTIP_DEFAULT_OFFSET, GaAlertComponent, GaAlertModule, GaAlertTitleActionsComponent, GaAlertTitleComponent, GaBadgeComponent, GaBadgeModule, GaButtonDirective, GaButtonModule, GaCardComponent, GaCardModule, GaCheckboxComponent, GaCheckboxModule, GaCheckboxRequiredValidator, GaFieldInfoComponent, GaFieldLabelComponent, GaFormControlDirective, GaFormFieldComponent, GaFormFieldModule, GaIconButtonDirective, GaIconComponent, GaIconModule, GaInputComponent, GaInputDirective, GaInputModule, GaMenuComponent, GaMenuItemComponent, GaMenuModule, GaMenuSeparatorComponent, GaMenuTitleComponent, GaMenuTriggerDirective, GaSegmentedControlButtonDirective, GaSegmentedControlComponent, GaSegmentedControlModule, GaSpinnerComponent, GaSpinnerModule, GaTooltipComponent, GaTooltipDirective, GaTooltipModule };
1500
+ export { CHECKBOX_CONTROL_VALUE_ACCESSOR, GA_ALERT_I18N_FACTORY, GA_CHECKBOX_REQUIRED_VALIDATOR, GA_FORM_CONTROL, GA_TOOLTIP_DEFAULT_OFFSET, GaAlertComponent, GaAlertI18n, GaAlertI18nDefault, GaAlertModule, GaAlertTitleActionsComponent, GaAlertTitleComponent, GaBadgeComponent, GaBadgeModule, GaButtonDirective, GaButtonModule, GaCardComponent, GaCardModule, GaCheckboxComponent, GaCheckboxModule, GaCheckboxRequiredValidator, GaFieldInfoComponent, GaFieldLabelComponent, GaFormControlDirective, GaFormFieldComponent, GaFormFieldModule, GaIconButtonDirective, GaIconComponent, GaIconModule, GaInputComponent, GaInputDirective, GaInputModule, GaMenuComponent, GaMenuItemComponent, GaMenuModule, GaMenuSeparatorComponent, GaMenuTitleComponent, GaMenuTriggerDirective, GaMenuTriggerIconComponent, GaRadioButtonComponent, GaRadioGroupComponent, GaRadioModule, GaSegmentedControlButtonDirective, GaSegmentedControlComponent, GaSegmentedControlModule, GaSpinnerComponent, GaSpinnerModule, GaTooltipComponent, GaTooltipDirective, GaTooltipModule, RADIO_CONTROL_VALUE_ACCESSOR, provideGaAlertI18n };
1264
1501
  //# sourceMappingURL=vsn-ux-ngx-gaia.mjs.map