@vsn-ux/ngx-gaia 0.5.1 → 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.
- package/fesm2022/vsn-ux-ngx-gaia.mjs +657 -47
- package/fesm2022/vsn-ux-ngx-gaia.mjs.map +1 -1
- package/lib/modal/index.d.ts +12 -0
- package/lib/modal/modal-actions.component.d.ts +5 -0
- package/lib/modal/modal-content.component.d.ts +5 -0
- package/lib/modal/modal-data.token.d.ts +2 -0
- package/lib/modal/modal-description.component.d.ts +6 -0
- package/lib/modal/modal-header.component.d.ts +16 -0
- package/lib/modal/modal-i18n.service.d.ts +14 -0
- package/lib/modal/modal-ref.d.ts +4 -0
- package/lib/modal/modal.component.d.ts +44 -0
- package/lib/modal/modal.directives.d.ts +29 -0
- package/lib/modal/modal.module.d.ts +11 -0
- package/lib/modal/modal.options.d.ts +47 -0
- package/lib/modal/modal.service.d.ts +25 -0
- package/lib/modal/modal.utils.d.ts +3 -0
- package/lib/select/select-default-value.component.d.ts +8 -2
- package/lib/select/select.component.d.ts +2 -0
- package/lib/text-area/index.d.ts +2 -0
- package/lib/text-area/text-area.directive.d.ts +19 -0
- package/lib/text-area/text-area.module.d.ts +7 -0
- package/lib/tooltip/tooltip.component.d.ts +1 -0
- package/lib/tooltip/tooltip.directive.d.ts +1 -0
- package/package.json +2 -2
- package/public-api.d.ts +2 -0
|
@@ -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$
|
|
348
|
+
let nextUniqueId$7 = 0;
|
|
348
349
|
class GaCheckboxComponent {
|
|
349
350
|
tabindex;
|
|
350
351
|
/** @ignore */
|
|
351
|
-
_uniqueId = `ga-checkbox-${++nextUniqueId$
|
|
352
|
+
_uniqueId = `ga-checkbox-${++nextUniqueId$7}`;
|
|
352
353
|
/** @ignore */
|
|
353
354
|
injector = inject(Injector);
|
|
354
355
|
icons = { Minus, Check };
|
|
@@ -404,7 +405,7 @@ class GaCheckboxComponent {
|
|
|
404
405
|
this.tabindex = tabindex;
|
|
405
406
|
}
|
|
406
407
|
ngDoCheck() {
|
|
407
|
-
const ngControl = this.injector.get(NgControl, null);
|
|
408
|
+
const ngControl = this.injector.get(NgControl, null, { self: true });
|
|
408
409
|
if (ngControl) {
|
|
409
410
|
this._invalidNgModel.set(!!ngControl.invalid);
|
|
410
411
|
this._ngModelName.set(ngControl.name);
|
|
@@ -683,9 +684,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImpor
|
|
|
683
684
|
}]
|
|
684
685
|
}] });
|
|
685
686
|
|
|
686
|
-
let nextUniqueId$
|
|
687
|
+
let nextUniqueId$6 = 0;
|
|
687
688
|
class GaInputDirective {
|
|
688
|
-
uniqueId = `ga-input-${++nextUniqueId$
|
|
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$
|
|
758
|
+
let nextUniqueId$5 = 0;
|
|
758
759
|
class GaFormFieldComponent {
|
|
759
|
-
uniqueId = `ga-form-field-${++nextUniqueId$
|
|
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.
|
|
@@ -1380,10 +1925,10 @@ const RADIO_CONTROL_VALUE_ACCESSOR = {
|
|
|
1380
1925
|
multi: true,
|
|
1381
1926
|
};
|
|
1382
1927
|
// Increasing integer for generating unique ids for radio components.
|
|
1383
|
-
let nextUniqueId$
|
|
1928
|
+
let nextUniqueId$3 = 0;
|
|
1384
1929
|
class GaRadioGroupComponent {
|
|
1385
1930
|
/** Name of the radio button group. All radio buttons inside this group will use this name. */
|
|
1386
|
-
name = input(`ga-radio-group-${nextUniqueId$
|
|
1931
|
+
name = input(`ga-radio-group-${nextUniqueId$3++}`);
|
|
1387
1932
|
/**
|
|
1388
1933
|
* Value for the radio-group. Should equal the value of the selected radio button if there is
|
|
1389
1934
|
* a corresponding radio button with a matching value. If there is not such a corresponding
|
|
@@ -1442,13 +1987,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImpor
|
|
|
1442
1987
|
}] });
|
|
1443
1988
|
|
|
1444
1989
|
// Increasing integer for generating unique ids for radio button components.
|
|
1445
|
-
let nextUniqueId$
|
|
1990
|
+
let nextUniqueId$2 = 0;
|
|
1446
1991
|
class GaRadioButtonComponent {
|
|
1447
1992
|
tabindex;
|
|
1448
1993
|
radioGroup = inject(GaRadioGroupComponent, {
|
|
1449
1994
|
optional: true,
|
|
1450
1995
|
});
|
|
1451
|
-
_uniqueId = `ga-radio-button-${++nextUniqueId$
|
|
1996
|
+
_uniqueId = `ga-radio-button-${++nextUniqueId$2}`;
|
|
1452
1997
|
/** The value attribute of the native input element */
|
|
1453
1998
|
value = input(null);
|
|
1454
1999
|
inputId = input(null, { alias: 'id' });
|
|
@@ -1538,18 +2083,22 @@ class GaOptionComponent {
|
|
|
1538
2083
|
cdkOption = inject(CdkOption, { self: true });
|
|
1539
2084
|
value = input(null);
|
|
1540
2085
|
disabled = input(false, { transform: booleanAttribute });
|
|
1541
|
-
withInput = input(
|
|
2086
|
+
withInput = input(this.selectComponent.multiple(), {
|
|
2087
|
+
transform: booleanAttribute,
|
|
2088
|
+
});
|
|
1542
2089
|
selected = computed(() => this._isSelected() &&
|
|
1543
2090
|
this.cdkOption.value !== undefined &&
|
|
1544
2091
|
this.cdkOption.value !== null &&
|
|
1545
2092
|
this.cdkOption.value !== '');
|
|
1546
2093
|
active = this._isActive.asReadonly();
|
|
1547
2094
|
constructor() {
|
|
1548
|
-
afterRender(
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
2095
|
+
afterRender({
|
|
2096
|
+
read: () => {
|
|
2097
|
+
// NOTE: currently there is no other reliable way to track the selected state,
|
|
2098
|
+
// refactor once cdk will be based on signals or more appropriate events introduced
|
|
2099
|
+
this._isSelected.set(this.cdkOption.isSelected());
|
|
2100
|
+
this._isActive.set(this.cdkOption.isActive());
|
|
2101
|
+
},
|
|
1553
2102
|
});
|
|
1554
2103
|
}
|
|
1555
2104
|
onClick() {
|
|
@@ -1594,29 +2143,30 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImpor
|
|
|
1594
2143
|
|
|
1595
2144
|
class GaSelectDefaultValueComponent {
|
|
1596
2145
|
selectComponent = inject(GaSelectComponent);
|
|
1597
|
-
|
|
2146
|
+
icons = { X };
|
|
2147
|
+
singleViewValue = computed(() => {
|
|
1598
2148
|
const options = this.selectComponent.selectedOptions();
|
|
1599
2149
|
if (!options.length) {
|
|
1600
|
-
return
|
|
2150
|
+
return '';
|
|
1601
2151
|
}
|
|
1602
|
-
return options
|
|
1603
|
-
.map((option) => option.cdkOption.element.textContent?.trim() ?? '')
|
|
1604
|
-
.join(', ');
|
|
2152
|
+
return options[0].cdkOption.getLabel();
|
|
1605
2153
|
});
|
|
2154
|
+
deselectOption(option) {
|
|
2155
|
+
this.selectComponent.deselectValue(option.cdkOption.value);
|
|
2156
|
+
}
|
|
1606
2157
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: GaSelectDefaultValueComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1607
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
2158
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.1.5", type: GaSelectDefaultValueComponent, isStandalone: true, selector: "ga-select-default-value", host: { classAttribute: "ga-select__value" }, ngImport: i0, template: "@if (selectComponent.multiple()) {\n @for (option of selectComponent.selectedOptions(); track option) {\n <div class=\"ga-tag ga-tag ga-tag--interactive-selected\">\n <span class=\"ga-tag__label\">{{ option.cdkOption.getLabel() }}</span>\n <div class=\"ga-tag__separator\"></div>\n <ga-icon\n [icon]=\"icons.X\"\n size=\"16\"\n class=\"ga-tag__icon\"\n (click)=\"deselectOption(option); $event.stopPropagation()\"\n />\n </div>\n }\n} @else {\n {{ singleViewValue() }}\n}\n", dependencies: [{ kind: "ngmodule", type: GaIconModule }, { kind: "component", type: GaIconComponent, selector: "ga-icon", inputs: ["icon", "size", "color", "strokeWidth"] }] });
|
|
1608
2159
|
}
|
|
1609
2160
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: GaSelectDefaultValueComponent, decorators: [{
|
|
1610
2161
|
type: Component,
|
|
1611
|
-
args: [{
|
|
1612
|
-
|
|
1613
|
-
template:
|
|
1614
|
-
}]
|
|
2162
|
+
args: [{ selector: 'ga-select-default-value', imports: [GaIconModule], host: {
|
|
2163
|
+
class: 'ga-select__value',
|
|
2164
|
+
}, template: "@if (selectComponent.multiple()) {\n @for (option of selectComponent.selectedOptions(); track option) {\n <div class=\"ga-tag ga-tag ga-tag--interactive-selected\">\n <span class=\"ga-tag__label\">{{ option.cdkOption.getLabel() }}</span>\n <div class=\"ga-tag__separator\"></div>\n <ga-icon\n [icon]=\"icons.X\"\n size=\"16\"\n class=\"ga-tag__icon\"\n (click)=\"deselectOption(option); $event.stopPropagation()\"\n />\n </div>\n }\n} @else {\n {{ singleViewValue() }}\n}\n" }]
|
|
1615
2165
|
}] });
|
|
1616
2166
|
|
|
1617
|
-
let nextUniqueId = 0;
|
|
2167
|
+
let nextUniqueId$1 = 0;
|
|
1618
2168
|
class GaSelectComponent {
|
|
1619
|
-
_uniqueId = `ga-select-${++nextUniqueId}`;
|
|
2169
|
+
_uniqueId = `ga-select-${++nextUniqueId$1}`;
|
|
1620
2170
|
focusedTriggerElement = null;
|
|
1621
2171
|
_onTouched;
|
|
1622
2172
|
_onModelChanged;
|
|
@@ -1737,7 +2287,9 @@ class GaSelectComponent {
|
|
|
1737
2287
|
});
|
|
1738
2288
|
}
|
|
1739
2289
|
ngDoCheck() {
|
|
1740
|
-
const implicitNgControl = this.injector.get(NgControl, null
|
|
2290
|
+
const implicitNgControl = this.injector.get(NgControl, null, {
|
|
2291
|
+
self: true,
|
|
2292
|
+
});
|
|
1741
2293
|
// we can rely on computed because `ivalid` of NgControl is not a signal, yet
|
|
1742
2294
|
if (implicitNgControl) {
|
|
1743
2295
|
this.implicitInvalid.set(!!implicitNgControl.invalid && !!implicitNgControl.dirty);
|
|
@@ -1799,11 +2351,7 @@ class GaSelectComponent {
|
|
|
1799
2351
|
if (activeOption) {
|
|
1800
2352
|
const { cdkOption } = activeOption;
|
|
1801
2353
|
this.cdkListbox().toggle(cdkOption);
|
|
1802
|
-
|
|
1803
|
-
if (!this.multiple()) {
|
|
1804
|
-
[value] = value;
|
|
1805
|
-
}
|
|
1806
|
-
this.value.set(value);
|
|
2354
|
+
this.syncValue();
|
|
1807
2355
|
}
|
|
1808
2356
|
}
|
|
1809
2357
|
onInputKeyDown(event) {
|
|
@@ -1842,11 +2390,24 @@ class GaSelectComponent {
|
|
|
1842
2390
|
}
|
|
1843
2391
|
onOverlayDetach() {
|
|
1844
2392
|
this._isOpen.set(false);
|
|
1845
|
-
this.
|
|
2393
|
+
if (this.inputSearch()?.nativeElement !== this.focusedTriggerElement) {
|
|
2394
|
+
this.focusedTriggerElement?.focus();
|
|
2395
|
+
}
|
|
1846
2396
|
this.textValue.set('');
|
|
1847
2397
|
this._onTouched?.();
|
|
1848
2398
|
this.closed.emit();
|
|
1849
2399
|
}
|
|
2400
|
+
deselectValue(value) {
|
|
2401
|
+
this.cdkListbox().deselectValue(value);
|
|
2402
|
+
this.syncValue();
|
|
2403
|
+
}
|
|
2404
|
+
syncValue() {
|
|
2405
|
+
let { value } = this.cdkListbox();
|
|
2406
|
+
if (!this.multiple()) {
|
|
2407
|
+
[value] = value;
|
|
2408
|
+
}
|
|
2409
|
+
this.value.set(value);
|
|
2410
|
+
}
|
|
1850
2411
|
setItemActive(direction) {
|
|
1851
2412
|
const options = this.gaOptions();
|
|
1852
2413
|
const currentIndex = options.findIndex(({ cdkOption }) => cdkOption.isActive());
|
|
@@ -1867,7 +2428,7 @@ class GaSelectComponent {
|
|
|
1867
2428
|
}
|
|
1868
2429
|
}
|
|
1869
2430
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: GaSelectComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1870
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.1.5", type: GaSelectComponent, isStandalone: true, selector: "ga-select", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, disabledInput: { classPropertyName: "disabledInput", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, invalidInput: { classPropertyName: "invalidInput", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, compareWith: { classPropertyName: "compareWith", publicName: "compareWith", isSignal: true, isRequired: false, transformFunction: null }, searchable: { classPropertyName: "searchable", publicName: "searchable", isSignal: true, isRequired: false, transformFunction: null }, textValue: { classPropertyName: "textValue", publicName: "textValue", isSignal: true, isRequired: false, transformFunction: null }, leftIcon: { classPropertyName: "leftIcon", publicName: "leftIcon", isSignal: true, isRequired: false, transformFunction: null }, idInput: { classPropertyName: "idInput", publicName: "id", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", textValue: "textValueChange", opened: "opened", closed: "closed" }, host: { attributes: { "role": "combobox", "aria-haspopup": "listbox" }, listeners: { "click": "toggle()", "keydown.arrowdown": "open(); $event.preventDefault()", "keydown.space": "open(); $event.preventDefault()", "keydown.enter": "open(); $event.preventDefault()" }, properties: { "attr.id": "id()", "class.ga-select--expanded": "isOpen()", "class.ga-select--disabled": "disabled()", "class.ga-select--invalid": "invalid()", "class.ga-select--empty": "!hasValue()", "attr.aria-expanded": "isOpen()", "attr.aria-controls": "cdkListbox().id", "attr.aria-invalid": "invalid()", "attr.aria-disabled": "disabled()", "attr.aria-owns": "searchable() ? cdkListbox().id : null", "attr.aria-activedescendant": "!searchable() ? activeDescendantId() : null", "attr.tabindex": "disabled() ? -1 : 0" }, classAttribute: "ga-select" }, providers: [
|
|
2431
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.1.5", type: GaSelectComponent, isStandalone: true, selector: "ga-select", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, disabledInput: { classPropertyName: "disabledInput", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, invalidInput: { classPropertyName: "invalidInput", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: true, isRequired: false, transformFunction: null }, compareWith: { classPropertyName: "compareWith", publicName: "compareWith", isSignal: true, isRequired: false, transformFunction: null }, searchable: { classPropertyName: "searchable", publicName: "searchable", isSignal: true, isRequired: false, transformFunction: null }, textValue: { classPropertyName: "textValue", publicName: "textValue", isSignal: true, isRequired: false, transformFunction: null }, leftIcon: { classPropertyName: "leftIcon", publicName: "leftIcon", isSignal: true, isRequired: false, transformFunction: null }, idInput: { classPropertyName: "idInput", publicName: "id", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", textValue: "textValueChange", opened: "opened", closed: "closed" }, host: { attributes: { "role": "combobox", "aria-haspopup": "listbox" }, listeners: { "click": "toggle()", "keydown.arrowdown": "open(); $event.preventDefault()", "keydown.space": "open(); $event.preventDefault()", "keydown.enter": "open(); $event.preventDefault()" }, properties: { "attr.id": "id()", "class.ga-select--multi": "multiple()", "class.ga-select--expanded": "isOpen()", "class.ga-select--disabled": "disabled()", "class.ga-select--invalid": "invalid()", "class.ga-select--empty": "!hasValue()", "attr.aria-expanded": "isOpen()", "attr.aria-controls": "cdkListbox().id", "attr.aria-invalid": "invalid()", "attr.aria-disabled": "disabled()", "attr.aria-owns": "searchable() ? cdkListbox().id : null", "attr.aria-activedescendant": "!searchable() ? activeDescendantId() : null", "attr.tabindex": "disabled() ? -1 : 0" }, classAttribute: "ga-select" }, providers: [
|
|
1871
2432
|
{
|
|
1872
2433
|
provide: NG_VALUE_ACCESSOR,
|
|
1873
2434
|
useExisting: forwardRef(() => GaSelectComponent),
|
|
@@ -1877,7 +2438,7 @@ class GaSelectComponent {
|
|
|
1877
2438
|
provide: GA_FORM_CONTROL,
|
|
1878
2439
|
useExisting: forwardRef(() => GaSelectComponent),
|
|
1879
2440
|
},
|
|
1880
|
-
], queries: [{ propertyName: "gaOptions", predicate: GaOptionComponent, descendants: true, read: GaOptionComponent, isSignal: true }, { propertyName: "cdkListbox", first: true, predicate: CdkListbox, descendants: true, isSignal: true }, { propertyName: "customSelectValue", first: true, predicate: GaSelectValueComponent, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "inputSearch", first: true, predicate: ["inputSearch"], descendants: true, isSignal: true }, { propertyName: "content", first: true, predicate: ["ngContent"], descendants: true, read: ElementRef, isSignal: true }], hostDirectives: [{ directive: i1$3.CdkOverlayOrigin }], ngImport: i0, template: "@if (leftIcon()) {\n <ga-icon [icon]=\"leftIcon()!\" />\n}\n@if (
|
|
2441
|
+
], queries: [{ propertyName: "gaOptions", predicate: GaOptionComponent, descendants: true, read: GaOptionComponent, isSignal: true }, { propertyName: "cdkListbox", first: true, predicate: CdkListbox, descendants: true, isSignal: true }, { propertyName: "customSelectValue", first: true, predicate: GaSelectValueComponent, descendants: true, isSignal: true }], viewQueries: [{ propertyName: "inputSearch", first: true, predicate: ["inputSearch"], descendants: true, isSignal: true }, { propertyName: "content", first: true, predicate: ["ngContent"], descendants: true, read: ElementRef, isSignal: true }], hostDirectives: [{ directive: i1$3.CdkOverlayOrigin }], ngImport: i0, template: "@if (leftIcon()) {\n <ga-icon [icon]=\"leftIcon()!\" />\n}\n\n<div class=\"ga-select__main-area\">\n @if (hasValue() && (!textValue() || multiple())) {\n @if (customSelectValue()) {\n <div class=\"ga-select__value\">\n <ng-content select=\"ga-select-value\" />\n </div>\n } @else {\n <ga-select-default-value />\n }\n } @else if (!searchable()) {\n <div class=\"ga-select__placeholder\">\n {{ placeholder() }}\n </div>\n }\n\n @if (searchable()) {\n <input\n #inputSearch\n type=\"text\"\n class=\"ga-select__input\"\n aria-autocomplete=\"list\"\n [value]=\"textValue()\"\n (input)=\"open(); textValue.set(inputSearch.value)\"\n (click)=\"open(); $event.stopPropagation()\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-controls]=\"cdkListbox().id\"\n [attr.aria-activedescendant]=\"activeDescendantId()\"\n [placeholder]=\"hasValue() ? '' : placeholder()\"\n (keydown)=\"onInputKeyDown($event)\"\n tabindex=\"-1\"\n />\n }\n</div>\n\n<div class=\"ga-select__suffix\">\n <ga-icon [icon]=\"menuStatusIcon()\" class=\"ga-select__action-icon\" />\n</div>\n\n<ng-template\n cdkConnectedOverlay\n cdkConnectedOverlayLockPosition\n [cdkConnectedOverlayOrigin]=\"overlayOrigin\"\n [cdkConnectedOverlayOpen]=\"isOpen()\"\n [cdkConnectedOverlayPositions]=\"positions\"\n (overlayOutsideClick)=\"close()\"\n (attach)=\"onOverlayAttach()\"\n (detach)=\"onOverlayDetach()\"\n>\n <ng-content select=\"ga-select-dropdown\" />\n</ng-template>\n", dependencies: [{ kind: "ngmodule", type: GaIconModule }, { kind: "component", type: GaIconComponent, selector: "ga-icon", inputs: ["icon", "size", "color", "strokeWidth"] }, { kind: "ngmodule", type: GaButtonModule }, { kind: "ngmodule", type: OverlayModule }, { kind: "directive", type: i1$3.CdkConnectedOverlay, selector: "[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]", inputs: ["cdkConnectedOverlayOrigin", "cdkConnectedOverlayPositions", "cdkConnectedOverlayPositionStrategy", "cdkConnectedOverlayOffsetX", "cdkConnectedOverlayOffsetY", "cdkConnectedOverlayWidth", "cdkConnectedOverlayHeight", "cdkConnectedOverlayMinWidth", "cdkConnectedOverlayMinHeight", "cdkConnectedOverlayBackdropClass", "cdkConnectedOverlayPanelClass", "cdkConnectedOverlayViewportMargin", "cdkConnectedOverlayScrollStrategy", "cdkConnectedOverlayOpen", "cdkConnectedOverlayDisableClose", "cdkConnectedOverlayTransformOriginOn", "cdkConnectedOverlayHasBackdrop", "cdkConnectedOverlayLockPosition", "cdkConnectedOverlayFlexibleDimensions", "cdkConnectedOverlayGrowAfterOpen", "cdkConnectedOverlayPush", "cdkConnectedOverlayDisposeOnNavigation"], outputs: ["backdropClick", "positionChange", "attach", "detach", "overlayKeydown", "overlayOutsideClick"], exportAs: ["cdkConnectedOverlay"] }, { kind: "component", type: GaSelectDefaultValueComponent, selector: "ga-select-default-value" }] });
|
|
1881
2442
|
}
|
|
1882
2443
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: GaSelectComponent, decorators: [{
|
|
1883
2444
|
type: Component,
|
|
@@ -1900,6 +2461,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImpor
|
|
|
1900
2461
|
role: 'combobox',
|
|
1901
2462
|
'[attr.id]': 'id()',
|
|
1902
2463
|
class: 'ga-select',
|
|
2464
|
+
'[class.ga-select--multi]': 'multiple()',
|
|
1903
2465
|
'[class.ga-select--expanded]': 'isOpen()',
|
|
1904
2466
|
'[class.ga-select--disabled]': 'disabled()',
|
|
1905
2467
|
'[class.ga-select--invalid]': 'invalid()',
|
|
@@ -1916,7 +2478,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImpor
|
|
|
1916
2478
|
'(keydown.arrowdown)': 'open(); $event.preventDefault()',
|
|
1917
2479
|
'(keydown.space)': 'open(); $event.preventDefault()',
|
|
1918
2480
|
'(keydown.enter)': 'open(); $event.preventDefault()',
|
|
1919
|
-
}, template: "@if (leftIcon()) {\n <ga-icon [icon]=\"leftIcon()!\" />\n}\n@if (
|
|
2481
|
+
}, template: "@if (leftIcon()) {\n <ga-icon [icon]=\"leftIcon()!\" />\n}\n\n<div class=\"ga-select__main-area\">\n @if (hasValue() && (!textValue() || multiple())) {\n @if (customSelectValue()) {\n <div class=\"ga-select__value\">\n <ng-content select=\"ga-select-value\" />\n </div>\n } @else {\n <ga-select-default-value />\n }\n } @else if (!searchable()) {\n <div class=\"ga-select__placeholder\">\n {{ placeholder() }}\n </div>\n }\n\n @if (searchable()) {\n <input\n #inputSearch\n type=\"text\"\n class=\"ga-select__input\"\n aria-autocomplete=\"list\"\n [value]=\"textValue()\"\n (input)=\"open(); textValue.set(inputSearch.value)\"\n (click)=\"open(); $event.stopPropagation()\"\n [attr.aria-expanded]=\"isOpen()\"\n [attr.aria-controls]=\"cdkListbox().id\"\n [attr.aria-activedescendant]=\"activeDescendantId()\"\n [placeholder]=\"hasValue() ? '' : placeholder()\"\n (keydown)=\"onInputKeyDown($event)\"\n tabindex=\"-1\"\n />\n }\n</div>\n\n<div class=\"ga-select__suffix\">\n <ga-icon [icon]=\"menuStatusIcon()\" class=\"ga-select__action-icon\" />\n</div>\n\n<ng-template\n cdkConnectedOverlay\n cdkConnectedOverlayLockPosition\n [cdkConnectedOverlayOrigin]=\"overlayOrigin\"\n [cdkConnectedOverlayOpen]=\"isOpen()\"\n [cdkConnectedOverlayPositions]=\"positions\"\n (overlayOutsideClick)=\"close()\"\n (attach)=\"onOverlayAttach()\"\n (detach)=\"onOverlayDetach()\"\n>\n <ng-content select=\"ga-select-dropdown\" />\n</ng-template>\n" }]
|
|
1920
2482
|
}], ctorParameters: () => [] });
|
|
1921
2483
|
|
|
1922
2484
|
class GaOptgroupComponent {
|
|
@@ -2204,6 +2766,54 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImpor
|
|
|
2204
2766
|
}]
|
|
2205
2767
|
}] });
|
|
2206
2768
|
|
|
2769
|
+
let nextUniqueId = 0;
|
|
2770
|
+
class GaTextAreaDirective {
|
|
2771
|
+
id = input(undefined);
|
|
2772
|
+
disabled = input(false, { transform: booleanAttribute });
|
|
2773
|
+
invalid = input(undefined, { transform: booleanAttribute });
|
|
2774
|
+
_formControlId = computed(() => this.uniqueId());
|
|
2775
|
+
_formControlDisabled = computed(() => this.disabledModel());
|
|
2776
|
+
uniqueId = computed(() => this.id() ?? this.generatedUniqueId);
|
|
2777
|
+
invalidInput = computed(() => this.invalid() ?? this.implicitInvalid());
|
|
2778
|
+
generatedUniqueId = `ga-text-area-${++nextUniqueId}`;
|
|
2779
|
+
injector = inject(Injector);
|
|
2780
|
+
implicitInvalid = signal(false);
|
|
2781
|
+
disabledModel = linkedSignal(() => this.disabled());
|
|
2782
|
+
ngDoCheck() {
|
|
2783
|
+
const ngControl = this.injector.get(NgControl, null, { self: true });
|
|
2784
|
+
if (ngControl) {
|
|
2785
|
+
this.implicitInvalid.set(!!ngControl.invalid && !!ngControl.dirty);
|
|
2786
|
+
this.disabledModel.set(!!ngControl.disabled);
|
|
2787
|
+
}
|
|
2788
|
+
}
|
|
2789
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: GaTextAreaDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
2790
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.1.5", type: GaTextAreaDirective, isStandalone: true, selector: "[gaTextArea]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.ga-text-area--invalid": "invalidInput()", "attr.id": "uniqueId()" }, classAttribute: "ga-text-area" }, ngImport: i0 });
|
|
2791
|
+
}
|
|
2792
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: GaTextAreaDirective, decorators: [{
|
|
2793
|
+
type: Directive,
|
|
2794
|
+
args: [{
|
|
2795
|
+
selector: '[gaTextArea]',
|
|
2796
|
+
host: {
|
|
2797
|
+
class: 'ga-text-area',
|
|
2798
|
+
'[class.ga-text-area--invalid]': 'invalidInput()',
|
|
2799
|
+
'[attr.id]': 'uniqueId()',
|
|
2800
|
+
},
|
|
2801
|
+
}]
|
|
2802
|
+
}] });
|
|
2803
|
+
|
|
2804
|
+
class GaTextAreaModule {
|
|
2805
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: GaTextAreaModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
2806
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.1.5", ngImport: i0, type: GaTextAreaModule, imports: [GaTextAreaDirective], exports: [GaTextAreaDirective] });
|
|
2807
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: GaTextAreaModule });
|
|
2808
|
+
}
|
|
2809
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImport: i0, type: GaTextAreaModule, decorators: [{
|
|
2810
|
+
type: NgModule,
|
|
2811
|
+
args: [{
|
|
2812
|
+
imports: [GaTextAreaDirective],
|
|
2813
|
+
exports: [GaTextAreaDirective],
|
|
2814
|
+
}]
|
|
2815
|
+
}] });
|
|
2816
|
+
|
|
2207
2817
|
/*
|
|
2208
2818
|
* Public API Surface of ngx-gaia
|
|
2209
2819
|
*/
|
|
@@ -2212,5 +2822,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.1.5", ngImpor
|
|
|
2212
2822
|
* Generated bundle index. Do not edit.
|
|
2213
2823
|
*/
|
|
2214
2824
|
|
|
2215
|
-
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, 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 };
|
|
2216
2826
|
//# sourceMappingURL=vsn-ux-ngx-gaia.mjs.map
|