@vsn-ux/ngx-gaia 0.6.0 → 0.6.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,17 +1,18 @@
1
1
  import * as i0 from '@angular/core';
2
- import { InjectionToken, makeEnvironmentProviders, inject, ElementRef, input, numberAttribute, computed, Component, ViewEncapsulation, Attribute, NgModule, ChangeDetectionStrategy, Injectable, booleanAttribute, output, contentChild, forwardRef, Injector, signal, linkedSignal, Directive, model, HostListener, TemplateRef, NgZone, Input, effect, afterRender, contentChildren, viewChild } from '@angular/core';
2
+ import { InjectionToken, makeEnvironmentProviders, inject, ElementRef, input, numberAttribute, computed, Component, ViewEncapsulation, Attribute, NgModule, ChangeDetectionStrategy, Injectable, booleanAttribute, output, contentChild, forwardRef, Injector, signal, linkedSignal, Directive, model, HostListener, TemplateRef, NgZone, Input, HostBinding, effect, DestroyRef, afterNextRender, Renderer2, afterRender, contentChildren, viewChild } from '@angular/core';
3
3
  import * as i1 from 'lucide-angular';
4
4
  import { LucideAngularModule, X, CircleCheck, TriangleAlert, OctagonAlert, Info, Minus, Check, ChevronUp, ChevronDown } from 'lucide-angular';
5
5
  import { NG_VALUE_ACCESSOR, NgControl, NG_VALIDATORS, CheckboxRequiredValidator, RequiredValidator } from '@angular/forms';
6
6
  import { NgTemplateOutlet, DOCUMENT } from '@angular/common';
7
7
  import * as i1$3 from '@angular/cdk/overlay';
8
- import { Overlay, CdkOverlayOrigin, OverlayModule } from '@angular/cdk/overlay';
8
+ import { Overlay, OverlayRef, CdkOverlayOrigin, OverlayModule } from '@angular/cdk/overlay';
9
9
  import { ComponentPortal } from '@angular/cdk/portal';
10
- import { Subject, takeUntil, map, merge } from 'rxjs';
10
+ import { Subject, takeUntil, map, merge, filter, Observable, isObservable } from 'rxjs';
11
11
  import { ESCAPE, hasModifierKey } from '@angular/cdk/keycodes';
12
12
  import * as i1$1 from '@angular/cdk/menu';
13
13
  import { CdkMenu, CdkMenuItem, CdkMenuTrigger } from '@angular/cdk/menu';
14
- import { toSignal } from '@angular/core/rxjs-interop';
14
+ import { toSignal, takeUntilDestroyed } from '@angular/core/rxjs-interop';
15
+ import { Router, ResolveStart } from '@angular/router';
15
16
  import * as i1$2 from '@angular/cdk/listbox';
16
17
  import { CdkOption, CdkListbox } from '@angular/cdk/listbox';
17
18
 
@@ -344,11 +345,11 @@ const CHECKBOX_CONTROL_VALUE_ACCESSOR = {
344
345
  };
345
346
  // Increasing integer for generating unique ids for checkbox components.
346
347
  // Inspired by @angular/components
347
- let nextUniqueId$6 = 0;
348
+ let nextUniqueId$7 = 0;
348
349
  class GaCheckboxComponent {
349
350
  tabindex;
350
351
  /** @ignore */
351
- _uniqueId = `ga-checkbox-${++nextUniqueId$6}`;
352
+ _uniqueId = `ga-checkbox-${++nextUniqueId$7}`;
352
353
  /** @ignore */
353
354
  injector = inject(Injector);
354
355
  icons = { Minus, Check };
@@ -683,9 +684,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImpor
683
684
  }]
684
685
  }] });
685
686
 
686
- let nextUniqueId$5 = 0;
687
+ let nextUniqueId$6 = 0;
687
688
  class GaInputDirective {
688
- uniqueId = `ga-input-${++nextUniqueId$5}`;
689
+ uniqueId = `ga-input-${++nextUniqueId$6}`;
689
690
  implicitNgControl = inject(NgControl, {
690
691
  optional: true,
691
692
  self: true,
@@ -754,9 +755,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImpor
754
755
  }]
755
756
  }] });
756
757
 
757
- let nextUniqueId$4 = 0;
758
+ let nextUniqueId$5 = 0;
758
759
  class GaFormFieldComponent {
759
- uniqueId = `ga-form-field-${++nextUniqueId$4}`;
760
+ uniqueId = `ga-form-field-${++nextUniqueId$5}`;
760
761
  formControl = contentChild(GA_FORM_CONTROL, { descendants: true });
761
762
  controlId = computed(() => {
762
763
  return this.formControl()?._formControlId() ?? this.uniqueId;
@@ -771,7 +772,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImpor
771
772
  }, template: "<ng-content />\n" }]
772
773
  }] });
773
774
 
775
+ let nextUniqueId$4 = 0;
774
776
  class GaTooltipComponent {
777
+ uniqueId = `ga-tooltip-${++nextUniqueId$4}`;
775
778
  mouseLeaveSubject = new Subject();
776
779
  afterMouseLeave = () => this.mouseLeaveSubject.asObservable();
777
780
  mouseOver = signal(false);
@@ -805,13 +808,13 @@ class GaTooltipComponent {
805
808
  this.mouseLeaveSubject.next();
806
809
  }
807
810
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: GaTooltipComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
808
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.1.5", type: GaTooltipComponent, isStandalone: true, selector: "ga-tooltip", inputs: { content: { classPropertyName: "content", publicName: "content", isSignal: true, isRequired: true, transformFunction: null }, position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: false, transformFunction: null }, offset: { classPropertyName: "offset", publicName: "offset", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { hideTriggered: "hideTriggered" }, host: { listeners: { "mouseenter": "handleMouseEnter()", "mouseleave": "handleMouseLeave()" }, properties: { "attr.style": "inlineStyle()" } }, ngImport: i0, template: "<div [class]=\"cssClass()\">\n @if (text()) {\n {{ text() }}\n } @else if (template()) {\n <ng-container\n [ngTemplateOutlet]=\"template()\"\n [ngTemplateOutletContext]=\"{ hide: triggerHide }\"\n />\n }\n</div>\n", styles: [".top-start :host,.top-center :host,.top-end :host{padding-bottom:var(--ga-tooltip-offset)}.bottom-start :host,.bottom-center :host,.bottom-end :host{padding-top:var(--ga-tooltip-offset)}.left-start :host,.left-center :host,.left-end :host{padding-right:var(--ga-tooltip-offset)}.right-start :host,.right-center :host,.right-end :host{padding-left:var(--ga-tooltip-offset)}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
811
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.1.5", type: GaTooltipComponent, isStandalone: true, selector: "ga-tooltip", inputs: { content: { classPropertyName: "content", publicName: "content", isSignal: true, isRequired: true, transformFunction: null }, position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: false, transformFunction: null }, offset: { classPropertyName: "offset", publicName: "offset", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { hideTriggered: "hideTriggered" }, host: { listeners: { "mouseenter": "handleMouseEnter()", "mouseleave": "handleMouseLeave()" }, properties: { "attr.style": "inlineStyle()" } }, ngImport: i0, template: "<div role=\"tooltip\" [attr.id]=\"uniqueId\" [class]=\"cssClass()\">\n @if (text()) {\n {{ text() }}\n } @else if (template()) {\n <ng-container\n [ngTemplateOutlet]=\"template()\"\n [ngTemplateOutletContext]=\"{ hide: triggerHide }\"\n />\n }\n</div>\n", styles: [".top-start :host,.top-center :host,.top-end :host{padding-bottom:var(--ga-tooltip-offset)}.bottom-start :host,.bottom-center :host,.bottom-end :host{padding-top:var(--ga-tooltip-offset)}.left-start :host,.left-center :host,.left-end :host{padding-right:var(--ga-tooltip-offset)}.right-start :host,.right-center :host,.right-end :host{padding-left:var(--ga-tooltip-offset)}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
809
812
  }
810
813
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: GaTooltipComponent, decorators: [{
811
814
  type: Component,
812
815
  args: [{ selector: 'ga-tooltip', imports: [NgTemplateOutlet], changeDetection: ChangeDetectionStrategy.OnPush, host: {
813
816
  '[attr.style]': 'inlineStyle()',
814
- }, template: "<div [class]=\"cssClass()\">\n @if (text()) {\n {{ text() }}\n } @else if (template()) {\n <ng-container\n [ngTemplateOutlet]=\"template()\"\n [ngTemplateOutletContext]=\"{ hide: triggerHide }\"\n />\n }\n</div>\n", styles: [".top-start :host,.top-center :host,.top-end :host{padding-bottom:var(--ga-tooltip-offset)}.bottom-start :host,.bottom-center :host,.bottom-end :host{padding-top:var(--ga-tooltip-offset)}.left-start :host,.left-center :host,.left-end :host{padding-right:var(--ga-tooltip-offset)}.right-start :host,.right-center :host,.right-end :host{padding-left:var(--ga-tooltip-offset)}\n"] }]
817
+ }, template: "<div role=\"tooltip\" [attr.id]=\"uniqueId\" [class]=\"cssClass()\">\n @if (text()) {\n {{ text() }}\n } @else if (template()) {\n <ng-container\n [ngTemplateOutlet]=\"template()\"\n [ngTemplateOutletContext]=\"{ hide: triggerHide }\"\n />\n }\n</div>\n", styles: [".top-start :host,.top-center :host,.top-end :host{padding-bottom:var(--ga-tooltip-offset)}.bottom-start :host,.bottom-center :host,.bottom-end :host{padding-top:var(--ga-tooltip-offset)}.left-start :host,.left-center :host,.left-end :host{padding-right:var(--ga-tooltip-offset)}.right-start :host,.right-center :host,.right-end :host{padding-left:var(--ga-tooltip-offset)}\n"] }]
815
818
  }], propDecorators: { handleMouseEnter: [{
816
819
  type: HostListener,
817
820
  args: ['mouseenter']
@@ -899,6 +902,9 @@ class GaTooltipDirective {
899
902
  get placement() {
900
903
  return this._placement;
901
904
  }
905
+ get ariaDescribedBy() {
906
+ return this.tooltipInstance?.uniqueId ?? null;
907
+ }
902
908
  ngOnDestroy() {
903
909
  this.destroyed$.next();
904
910
  this.destroyed$.complete();
@@ -1099,7 +1105,7 @@ class GaTooltipDirective {
1099
1105
  }
1100
1106
  }
1101
1107
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: GaTooltipDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1102
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "19.1.5", type: GaTooltipDirective, isStandalone: true, selector: "[gaTooltip]", inputs: { content: ["gaTooltip", "content"], disabled: ["gaTooltipDisabled", "disabled", booleanAttribute], controlMode: ["gaTooltipControlMode", "controlMode"], showControlMode: ["gaTooltipShowControlMode", "showControlMode"], hideControlMode: ["gaTooltipHideControlMode", "hideControlMode"], offset: ["gaTooltipOffsetSize", "offset", numberAttribute], placement: ["gaTooltipPlacement", "placement"] }, host: { listeners: { "click": "handleMouseClick()", "mouseenter": "handleMouseEnter()", "mouseleave": "handleMouseLeave()" } }, exportAs: ["gaTooltip"], ngImport: i0 });
1108
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "19.1.5", type: GaTooltipDirective, isStandalone: true, selector: "[gaTooltip]", inputs: { content: ["gaTooltip", "content"], disabled: ["gaTooltipDisabled", "disabled", booleanAttribute], controlMode: ["gaTooltipControlMode", "controlMode"], showControlMode: ["gaTooltipShowControlMode", "showControlMode"], hideControlMode: ["gaTooltipHideControlMode", "hideControlMode"], offset: ["gaTooltipOffsetSize", "offset", numberAttribute], placement: ["gaTooltipPlacement", "placement"] }, host: { listeners: { "click": "handleMouseClick()", "mouseenter": "handleMouseEnter()", "mouseleave": "handleMouseLeave()" }, properties: { "attr.aria-describedby": "this.ariaDescribedBy" } }, exportAs: ["gaTooltip"], ngImport: i0 });
1103
1109
  }
1104
1110
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: GaTooltipDirective, decorators: [{
1105
1111
  type: Directive,
@@ -1128,6 +1134,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImpor
1128
1134
  }], placement: [{
1129
1135
  type: Input,
1130
1136
  args: [{ alias: 'gaTooltipPlacement' }]
1137
+ }], ariaDescribedBy: [{
1138
+ type: HostBinding,
1139
+ args: ['attr.aria-describedby']
1131
1140
  }], handleMouseClick: [{
1132
1141
  type: HostListener,
1133
1142
  args: ['click']
@@ -1370,6 +1379,542 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImpor
1370
1379
  }]
1371
1380
  }] });
1372
1381
 
1382
+ class GaModalRef {
1383
+ instance;
1384
+ }
1385
+
1386
+ const GA_MODAL_DATA = new InjectionToken('GaModalData');
1387
+
1388
+ class GaModalService {
1389
+ /** @ignore */
1390
+ overlay = inject(Overlay);
1391
+ /** @ignore */
1392
+ injector = inject(Injector);
1393
+ /** @ignore */
1394
+ parentModalService = inject(GaModalService, {
1395
+ optional: true,
1396
+ skipSelf: true,
1397
+ });
1398
+ /** @ignore */
1399
+ openModalsAtThisLevel = [];
1400
+ get activeModals() {
1401
+ return this.parentModalService
1402
+ ? this.parentModalService.activeModals
1403
+ : this.openModalsAtThisLevel;
1404
+ }
1405
+ open(component, ...args) {
1406
+ let [data] = args;
1407
+ const overlayRef = this.createOverlay();
1408
+ return this.attachContent(component, data, overlayRef);
1409
+ }
1410
+ closeAll() {
1411
+ while (this.activeModals.length > 0) {
1412
+ this.activeModals.pop()?.close();
1413
+ }
1414
+ }
1415
+ /** @ignore */
1416
+ attachContent(component, data, overlayRef) {
1417
+ const modalRef = new GaModalRef();
1418
+ const injector = this.createInjector(this.injector, overlayRef, modalRef, data);
1419
+ const modalPortal = new ComponentPortal(component, null, injector);
1420
+ const result = overlayRef.attach(modalPortal);
1421
+ modalRef.instance = result.instance;
1422
+ this.activeModals.push(modalRef.instance);
1423
+ modalRef.instance
1424
+ .afterClosed({ closeOnUnsubscribe: false })
1425
+ .subscribe(() => {
1426
+ const index = this.activeModals.indexOf(modalRef.instance);
1427
+ if (index > -1) {
1428
+ this.activeModals.splice(index, 1);
1429
+ }
1430
+ });
1431
+ return result.instance;
1432
+ }
1433
+ /** @ignore */
1434
+ createOverlay() {
1435
+ const positionStrategy = this.overlay
1436
+ .position()
1437
+ .global()
1438
+ .centerHorizontally()
1439
+ .top('calc(4rem*var(--ga-base-scaling-factor,1))');
1440
+ const scrollStrategy = this.overlay.scrollStrategies.block();
1441
+ return this.overlay.create({
1442
+ positionStrategy,
1443
+ scrollStrategy,
1444
+ hasBackdrop: true,
1445
+ backdropClass: 'ga-modal__backdrop',
1446
+ // NOTE: handled manually inside the modal component
1447
+ disposeOnNavigation: false,
1448
+ height: 'auto',
1449
+ });
1450
+ }
1451
+ /** @ignore */
1452
+ createInjector(parentInjector, overlayRef, modalRef, data) {
1453
+ return Injector.create({
1454
+ parent: parentInjector,
1455
+ providers: [
1456
+ { provide: OverlayRef, useValue: overlayRef },
1457
+ { provide: GaModalRef, useValue: modalRef },
1458
+ { provide: GA_MODAL_DATA, useValue: data ?? null },
1459
+ ],
1460
+ });
1461
+ }
1462
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: GaModalService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1463
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: GaModalService, providedIn: 'root' });
1464
+ }
1465
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: GaModalService, decorators: [{
1466
+ type: Injectable,
1467
+ args: [{ providedIn: 'root' }]
1468
+ }] });
1469
+
1470
+ class GaModalOptions {
1471
+ /**
1472
+ * Defines the predefined size of the modal.
1473
+ *
1474
+ * @default `md`
1475
+ */
1476
+ size;
1477
+ /**
1478
+ * Defines the type of the modal:
1479
+ * - `none` for no icon.
1480
+ * - `information` for info dialog.
1481
+ * - `danger` for danger dialog.
1482
+ * - `warning` for warning dialog.
1483
+ * - `success` for success dialog.
1484
+ */
1485
+ type;
1486
+ /**
1487
+ * The ARIA role of the dialog element.
1488
+ *
1489
+ * @default `dialog`
1490
+ */
1491
+ role;
1492
+ /**
1493
+ * Defines if the modal should be closed when the escape key is pressed.
1494
+ *
1495
+ * @default `true`
1496
+ */
1497
+ closeOnEscape;
1498
+ /**
1499
+ * Defines if the modal should be closed when the backdrop is clicked.
1500
+ *
1501
+ * @default `true`
1502
+ */
1503
+ closeOnOutsideClick;
1504
+ /**
1505
+ * Defines if the modal should be closed when the route changes.
1506
+ *
1507
+ * @default `true`
1508
+ */
1509
+ closeOnNavigation;
1510
+ }
1511
+ const DEFAULT_MODAL_OPTIONS = {
1512
+ role: 'dialog',
1513
+ type: 'none',
1514
+ size: 'md',
1515
+ closeOnEscape: true,
1516
+ closeOnOutsideClick: true,
1517
+ closeOnNavigation: true,
1518
+ };
1519
+ function provideGaModalOptions(options) {
1520
+ return { provide: GaModalOptions, useValue: options };
1521
+ }
1522
+
1523
+ class GaModalComponent {
1524
+ closeSubject = new Subject();
1525
+ overlayRef = inject(OverlayRef);
1526
+ destroyRef = inject(DestroyRef);
1527
+ router = inject(Router, { optional: true });
1528
+ globalOptions = inject(GaModalOptions, { optional: true });
1529
+ options = this.createOptions();
1530
+ data = inject(GA_MODAL_DATA);
1531
+ labelledBy = signal(null);
1532
+ describedBy = signal(null);
1533
+ constructor() {
1534
+ // Using next render to delay the initialization, so that there is more time
1535
+ // to set the modal options
1536
+ afterNextRender({
1537
+ read: () => {
1538
+ if (this.options.closeOnNavigation) {
1539
+ this.router?.events
1540
+ .pipe(
1541
+ /**
1542
+ * Listen for `ResolveStart` to be friendly with route-guards.
1543
+ * i.e. don't close the modal in case a guard prevents the route change,
1544
+ * beneficial for pending changes check.
1545
+ */
1546
+ filter((event) => event instanceof ResolveStart), takeUntilDestroyed(this.destroyRef))
1547
+ .subscribe(() => this.close());
1548
+ }
1549
+ if (this.options.closeOnEscape) {
1550
+ this.overlayRef
1551
+ .keydownEvents()
1552
+ .pipe(filter((event) => event.key === 'Escape' && !hasModifierKey(event)), takeUntilDestroyed(this.destroyRef))
1553
+ .subscribe((event) => {
1554
+ event.preventDefault();
1555
+ this.softClose();
1556
+ });
1557
+ }
1558
+ if (this.options.closeOnOutsideClick) {
1559
+ this.overlayRef
1560
+ .backdropClick()
1561
+ .pipe(takeUntilDestroyed(this.destroyRef))
1562
+ .subscribe(() => this.softClose());
1563
+ }
1564
+ },
1565
+ });
1566
+ }
1567
+ close(result) {
1568
+ if (!this.overlayRef.hasAttached()) {
1569
+ return;
1570
+ }
1571
+ this.overlayRef.dispose();
1572
+ this.closeSubject.next(result);
1573
+ this.closeSubject.complete();
1574
+ }
1575
+ afterClosed({ closeOnUnsubscribe } = { closeOnUnsubscribe: true }) {
1576
+ return new Observable((observer) => {
1577
+ this.closeSubject.subscribe(observer);
1578
+ return () => closeOnUnsubscribe && this.close();
1579
+ });
1580
+ }
1581
+ /**
1582
+ * "Soft close" hook which is called whenever the modal is being closed
1583
+ * by "Escape" key or Backdrop click.
1584
+ * Return true to permit closing. False - to refuse.
1585
+ */
1586
+ onSoftClose() {
1587
+ return true;
1588
+ }
1589
+ softClose() {
1590
+ const shouldClose = this.onSoftClose();
1591
+ if (typeof shouldClose === 'boolean' && shouldClose) {
1592
+ this.close();
1593
+ }
1594
+ if (isObservable(shouldClose)) {
1595
+ shouldClose
1596
+ .pipe(takeUntilDestroyed(this.destroyRef))
1597
+ .subscribe((result) => result && this.close());
1598
+ }
1599
+ }
1600
+ createOptions(options) {
1601
+ return {
1602
+ ...DEFAULT_MODAL_OPTIONS,
1603
+ ...this.globalOptions,
1604
+ ...options,
1605
+ };
1606
+ }
1607
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: GaModalComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1608
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.5", type: GaModalComponent, isStandalone: true, selector: "ng-component", host: { properties: { "attr.role": "options.role", "attr.aria-labelledby": "options.labelledBy ?? labelledBy()", "attr.aria-describedby": "options.describedBy ?? describedBy()", "class.ga-modal--small": "options.size === 'sm'", "class.ga-modal--medium": "options.size === 'md'", "class.ga-modal--large": "options.size === 'lg'", "class.ga-modal--information": "options.type === 'info'", "class.ga-modal--danger": "options.type === 'danger'", "class.ga-modal--warning": "options.type === 'warning'", "class.ga-modal--success": "options.type === 'success'" }, classAttribute: "ga-modal" }, ngImport: i0, template: '', isInline: true });
1609
+ }
1610
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: GaModalComponent, decorators: [{
1611
+ type: Component,
1612
+ args: [{
1613
+ template: '',
1614
+ host: {
1615
+ class: 'ga-modal',
1616
+ '[attr.role]': 'options.role',
1617
+ '[attr.aria-labelledby]': 'options.labelledBy ?? labelledBy()',
1618
+ '[attr.aria-describedby]': 'options.describedBy ?? describedBy()',
1619
+ '[class.ga-modal--small]': "options.size === 'sm'",
1620
+ '[class.ga-modal--medium]': "options.size === 'md'",
1621
+ '[class.ga-modal--large]': "options.size === 'lg'",
1622
+ '[class.ga-modal--information]': "options.type === 'info'",
1623
+ '[class.ga-modal--danger]': "options.type === 'danger'",
1624
+ '[class.ga-modal--warning]': "options.type === 'warning'",
1625
+ '[class.ga-modal--success]': "options.type === 'success'",
1626
+ },
1627
+ }]
1628
+ }], ctorParameters: () => [] });
1629
+
1630
+ class GaModalCloseDirective {
1631
+ modalRef = inject(GaModalRef);
1632
+ modalResult = input({ alias: 'gaModalClose' });
1633
+ onClick() {
1634
+ this.modalRef.instance.close(this.modalResult);
1635
+ }
1636
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: GaModalCloseDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
1637
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.1.5", type: GaModalCloseDirective, isStandalone: true, selector: "[gaModalClose]", inputs: { modalResult: { classPropertyName: "modalResult", publicName: "modalResult", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "click": "onClick()" } }, ngImport: i0 });
1638
+ }
1639
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: GaModalCloseDirective, decorators: [{
1640
+ type: Directive,
1641
+ args: [{
1642
+ selector: '[gaModalClose]',
1643
+ }]
1644
+ }], propDecorators: { onClick: [{
1645
+ type: HostListener,
1646
+ args: ['click']
1647
+ }] } });
1648
+ let nextUniqueModalTitleId = 0;
1649
+ class GaModalTitleDirective {
1650
+ renderer = inject(Renderer2);
1651
+ elementRef = inject(ElementRef);
1652
+ modalRef = inject(GaModalRef);
1653
+ id;
1654
+ constructor(id) {
1655
+ if (id) {
1656
+ this.id = id;
1657
+ }
1658
+ else {
1659
+ this.id = `gaModalTitle${nextUniqueModalTitleId++}`;
1660
+ this.renderer.setAttribute(this.elementRef.nativeElement, 'id', this.id);
1661
+ }
1662
+ }
1663
+ ngAfterViewInit() {
1664
+ this.modalRef.instance.labelledBy.set(this.id);
1665
+ }
1666
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: GaModalTitleDirective, deps: [{ token: 'id', attribute: true }], target: i0.ɵɵFactoryTarget.Directive });
1667
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.1.5", type: GaModalTitleDirective, isStandalone: true, selector: "[gaModalTitle]", host: { classAttribute: "ga-modal__title" }, ngImport: i0 });
1668
+ }
1669
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: GaModalTitleDirective, decorators: [{
1670
+ type: Directive,
1671
+ args: [{
1672
+ selector: '[gaModalTitle]',
1673
+ host: { class: 'ga-modal__title' },
1674
+ }]
1675
+ }], ctorParameters: () => [{ type: undefined, decorators: [{
1676
+ type: Attribute,
1677
+ args: ['id']
1678
+ }] }] });
1679
+ let nextUniqueModalDescriptionId = 0;
1680
+ class GaModalDescriptionDirective {
1681
+ renderer = inject(Renderer2);
1682
+ elementRef = inject(ElementRef);
1683
+ modalRef = inject(GaModalRef);
1684
+ id;
1685
+ constructor(id) {
1686
+ if (id) {
1687
+ this.id = id;
1688
+ }
1689
+ else {
1690
+ this.id = `gaModalDescription${nextUniqueModalDescriptionId++}`;
1691
+ this.renderer.setAttribute(this.elementRef.nativeElement, 'id', this.id);
1692
+ }
1693
+ }
1694
+ ngAfterViewInit() {
1695
+ this.modalRef.instance.describedBy.set(this.id);
1696
+ }
1697
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: GaModalDescriptionDirective, deps: [{ token: 'id', attribute: true }], target: i0.ɵɵFactoryTarget.Directive });
1698
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.1.5", type: GaModalDescriptionDirective, isStandalone: true, selector: "[gaModalDescription]", host: { classAttribute: "ga-modal__description" }, ngImport: i0 });
1699
+ }
1700
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: GaModalDescriptionDirective, decorators: [{
1701
+ type: Directive,
1702
+ args: [{
1703
+ selector: '[gaModalDescription]',
1704
+ host: { class: 'ga-modal__description' },
1705
+ }]
1706
+ }], ctorParameters: () => [{ type: undefined, decorators: [{
1707
+ type: Attribute,
1708
+ args: ['id']
1709
+ }] }] });
1710
+
1711
+ class GaModalDescriptionComponent {
1712
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: GaModalDescriptionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1713
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.5", type: GaModalDescriptionComponent, isStandalone: true, selector: "ga-modal-description", host: { classAttribute: "ga-modal__description" }, hostDirectives: [{ directive: GaModalDescriptionDirective }], ngImport: i0, template: `<ng-content />`, isInline: true });
1714
+ }
1715
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: GaModalDescriptionComponent, decorators: [{
1716
+ type: Component,
1717
+ args: [{
1718
+ selector: 'ga-modal-description',
1719
+ template: `<ng-content />`,
1720
+ hostDirectives: [GaModalDescriptionDirective],
1721
+ host: {
1722
+ class: 'ga-modal__description',
1723
+ },
1724
+ }]
1725
+ }] });
1726
+
1727
+ class GaModalContentComponent {
1728
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: GaModalContentComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1729
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.5", type: GaModalContentComponent, isStandalone: true, selector: "ga-modal-content", host: { classAttribute: "ga-modal__content" }, ngImport: i0, template: `<ng-content />`, isInline: true });
1730
+ }
1731
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: GaModalContentComponent, decorators: [{
1732
+ type: Component,
1733
+ args: [{
1734
+ selector: 'ga-modal-content',
1735
+ template: `<ng-content />`,
1736
+ host: {
1737
+ class: 'ga-modal__content',
1738
+ },
1739
+ }]
1740
+ }] });
1741
+
1742
+ class GaModalActionsComponent {
1743
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: GaModalActionsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1744
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.1.5", type: GaModalActionsComponent, isStandalone: true, selector: "ga-modal-actions", host: { classAttribute: "ga-modal__actions" }, ngImport: i0, template: ` <ng-content />`, isInline: true });
1745
+ }
1746
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: GaModalActionsComponent, decorators: [{
1747
+ type: Component,
1748
+ args: [{
1749
+ selector: 'ga-modal-actions',
1750
+ template: ` <ng-content />`,
1751
+ host: {
1752
+ class: 'ga-modal__actions',
1753
+ },
1754
+ }]
1755
+ }] });
1756
+
1757
+ function GA_MODAL_I18N_FACTORY() {
1758
+ return new GaModalI18nDefault();
1759
+ }
1760
+ class GaModalI18n {
1761
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: GaModalI18n, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1762
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: GaModalI18n, providedIn: 'root', useFactory: GA_MODAL_I18N_FACTORY });
1763
+ }
1764
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: GaModalI18n, decorators: [{
1765
+ type: Injectable,
1766
+ args: [{
1767
+ providedIn: 'root',
1768
+ useFactory: GA_MODAL_I18N_FACTORY,
1769
+ }]
1770
+ }] });
1771
+ class GaModalI18nDefault extends GaModalI18n {
1772
+ /** A label for the dismiss button */
1773
+ dismissLabel = 'Dismiss';
1774
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: GaModalI18nDefault, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
1775
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: GaModalI18nDefault });
1776
+ }
1777
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: GaModalI18nDefault, decorators: [{
1778
+ type: Injectable
1779
+ }] });
1780
+ function provideGaModalI18n(value) {
1781
+ return makeEnvironmentProviders([
1782
+ typeof value === 'function'
1783
+ ? { provide: GaModalI18n, useFactory: value }
1784
+ : { provide: GaModalI18n, useValue: value },
1785
+ ]);
1786
+ }
1787
+
1788
+ class GaModalHeaderComponent {
1789
+ icons = {
1790
+ X,
1791
+ Info,
1792
+ CircleCheck,
1793
+ TriangleAlert,
1794
+ OctagonAlert,
1795
+ };
1796
+ modalRef = inject(GaModalRef);
1797
+ i18n = inject(GaModalI18n);
1798
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: GaModalHeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
1799
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.1.5", type: GaModalHeaderComponent, isStandalone: true, selector: "ga-modal-header", host: { classAttribute: "ga-modal__top-section" }, ngImport: i0, template: `
1800
+ @if (modalRef.instance.options.type !== 'none') {
1801
+ <div class="ga-modal__icon">
1802
+ @switch (modalRef.instance.options.type) {
1803
+ @case ('info') {
1804
+ <ga-icon [icon]="icons.Info" size="48" />
1805
+ }
1806
+ @case ('warning') {
1807
+ <ga-icon [icon]="icons.TriangleAlert" size="48" />
1808
+ }
1809
+ @case ('danger') {
1810
+ <ga-icon [icon]="icons.OctagonAlert" size="48" />
1811
+ }
1812
+ @case ('success') {
1813
+ <ga-icon [icon]="icons.CircleCheck" size="48" />
1814
+ }
1815
+ }
1816
+ </div>
1817
+ }
1818
+ <div class="ga-modal__heading">
1819
+ <ng-content select="[gaModalTitle]" />
1820
+ <ng-content select="ga-modal-description" />
1821
+ </div>
1822
+ <button
1823
+ type="button"
1824
+ [gaIconButton]="icons.X"
1825
+ gaIconButtonVariant="ghost"
1826
+ class="ga-modal__close-icon"
1827
+ (click)="modalRef.instance.close()"
1828
+ >
1829
+ {{ i18n.dismissLabel }}
1830
+ </button>
1831
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: GaButtonModule }, { kind: "component", type: GaIconButtonDirective, selector: "button[gaIconButton], a[gaIconButton]", inputs: ["gaIconButton", "gaIconButtonVariant"] }, { kind: "ngmodule", type: GaIconModule }, { kind: "component", type: GaIconComponent, selector: "ga-icon", inputs: ["icon", "size", "color", "strokeWidth"] }] });
1832
+ }
1833
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: GaModalHeaderComponent, decorators: [{
1834
+ type: Component,
1835
+ args: [{
1836
+ selector: 'ga-modal-header',
1837
+ imports: [GaButtonModule, GaIconModule],
1838
+ template: `
1839
+ @if (modalRef.instance.options.type !== 'none') {
1840
+ <div class="ga-modal__icon">
1841
+ @switch (modalRef.instance.options.type) {
1842
+ @case ('info') {
1843
+ <ga-icon [icon]="icons.Info" size="48" />
1844
+ }
1845
+ @case ('warning') {
1846
+ <ga-icon [icon]="icons.TriangleAlert" size="48" />
1847
+ }
1848
+ @case ('danger') {
1849
+ <ga-icon [icon]="icons.OctagonAlert" size="48" />
1850
+ }
1851
+ @case ('success') {
1852
+ <ga-icon [icon]="icons.CircleCheck" size="48" />
1853
+ }
1854
+ }
1855
+ </div>
1856
+ }
1857
+ <div class="ga-modal__heading">
1858
+ <ng-content select="[gaModalTitle]" />
1859
+ <ng-content select="ga-modal-description" />
1860
+ </div>
1861
+ <button
1862
+ type="button"
1863
+ [gaIconButton]="icons.X"
1864
+ gaIconButtonVariant="ghost"
1865
+ class="ga-modal__close-icon"
1866
+ (click)="modalRef.instance.close()"
1867
+ >
1868
+ {{ i18n.dismissLabel }}
1869
+ </button>
1870
+ `,
1871
+ host: {
1872
+ class: 'ga-modal__top-section',
1873
+ },
1874
+ }]
1875
+ }] });
1876
+
1877
+ class GaModalModule {
1878
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: GaModalModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1879
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.1.5", ngImport: i0, type: GaModalModule, imports: [GaModalCloseDirective,
1880
+ GaModalTitleDirective,
1881
+ GaModalDescriptionDirective,
1882
+ GaModalDescriptionComponent,
1883
+ GaModalContentComponent,
1884
+ GaModalActionsComponent,
1885
+ GaModalHeaderComponent], exports: [GaModalCloseDirective,
1886
+ GaModalTitleDirective,
1887
+ GaModalDescriptionDirective,
1888
+ GaModalDescriptionComponent,
1889
+ GaModalContentComponent,
1890
+ GaModalActionsComponent,
1891
+ GaModalHeaderComponent] });
1892
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: GaModalModule, imports: [GaModalHeaderComponent] });
1893
+ }
1894
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: GaModalModule, decorators: [{
1895
+ type: NgModule,
1896
+ args: [{
1897
+ imports: [
1898
+ GaModalCloseDirective,
1899
+ GaModalTitleDirective,
1900
+ GaModalDescriptionDirective,
1901
+ GaModalDescriptionComponent,
1902
+ GaModalContentComponent,
1903
+ GaModalActionsComponent,
1904
+ GaModalHeaderComponent,
1905
+ ],
1906
+ exports: [
1907
+ GaModalCloseDirective,
1908
+ GaModalTitleDirective,
1909
+ GaModalDescriptionDirective,
1910
+ GaModalDescriptionComponent,
1911
+ GaModalContentComponent,
1912
+ GaModalActionsComponent,
1913
+ GaModalHeaderComponent,
1914
+ ],
1915
+ }]
1916
+ }] });
1917
+
1373
1918
  /**
1374
1919
  * Provider Expression that allows ga-radio-group to register as a ControlValueAccessor.
1375
1920
  * This allows it to support [(ngModel)] and ngControl.
@@ -2277,5 +2822,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImpor
2277
2822
  * Generated bundle index. Do not edit.
2278
2823
  */
2279
2824
 
2280
- export { CHECKBOX_CONTROL_VALUE_ACCESSOR, GA_ALERT_I18N_FACTORY, GA_BASE_FONT_SIZE, GA_CHECKBOX_REQUIRED_VALIDATOR, GA_FORM_CONTROL, GA_ICON_DEFAULT_SIZE, GA_SELECT_REQUIRED_VALIDATOR, 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, GaLinkDirective, GaLinkModule, GaMenuComponent, GaMenuItemComponent, GaMenuModule, GaMenuSeparatorComponent, GaMenuTitleComponent, GaMenuTriggerDirective, GaMenuTriggerIconComponent, GaOptgroupComponent, GaOptionComponent, GaRadioButtonComponent, GaRadioGroupComponent, GaRadioModule, GaSegmentedControlButtonDirective, GaSegmentedControlComponent, GaSegmentedControlIconButtonComponent, GaSegmentedControlModule, GaSegmentedControlTextButtonComponent, GaSelectComponent, GaSelectDropdownComponent, GaSelectDropdownSpinnerComponent, GaSelectModule, GaSelectRequiredValidator, GaSelectValueComponent, GaSpinnerComponent, GaSpinnerModule, GaTextAreaDirective, GaTextAreaModule, GaTooltipComponent, GaTooltipDirective, GaTooltipModule, RADIO_CONTROL_VALUE_ACCESSOR, provideGaAlertI18n, provideGaBaseFontSize };
2825
+ export { CHECKBOX_CONTROL_VALUE_ACCESSOR, DEFAULT_MODAL_OPTIONS, GA_ALERT_I18N_FACTORY, GA_BASE_FONT_SIZE, GA_CHECKBOX_REQUIRED_VALIDATOR, GA_FORM_CONTROL, GA_ICON_DEFAULT_SIZE, GA_MODAL_DATA, GA_MODAL_I18N_FACTORY, GA_SELECT_REQUIRED_VALIDATOR, 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, GaLinkDirective, GaLinkModule, GaMenuComponent, GaMenuItemComponent, GaMenuModule, GaMenuSeparatorComponent, GaMenuTitleComponent, GaMenuTriggerDirective, GaMenuTriggerIconComponent, GaModalActionsComponent, GaModalCloseDirective, GaModalComponent, GaModalContentComponent, GaModalDescriptionComponent, GaModalDescriptionDirective, GaModalHeaderComponent, GaModalI18n, GaModalI18nDefault, GaModalModule, GaModalOptions, GaModalRef, GaModalService, GaModalTitleDirective, GaOptgroupComponent, GaOptionComponent, GaRadioButtonComponent, GaRadioGroupComponent, GaRadioModule, GaSegmentedControlButtonDirective, GaSegmentedControlComponent, GaSegmentedControlIconButtonComponent, GaSegmentedControlModule, GaSegmentedControlTextButtonComponent, GaSelectComponent, GaSelectDropdownComponent, GaSelectDropdownSpinnerComponent, GaSelectModule, GaSelectRequiredValidator, GaSelectValueComponent, GaSpinnerComponent, GaSpinnerModule, GaTextAreaDirective, GaTextAreaModule, GaTooltipComponent, GaTooltipDirective, GaTooltipModule, RADIO_CONTROL_VALUE_ACCESSOR, provideGaAlertI18n, provideGaBaseFontSize, provideGaModalI18n, provideGaModalOptions };
2281
2826
  //# sourceMappingURL=vsn-ux-ngx-gaia.mjs.map