@vsn-ux/ngx-gaia 1.0.0-alpha.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/README.md +55 -0
- package/fesm2022/vsn-ux-ngx-gaia.mjs +979 -0
- package/fesm2022/vsn-ux-ngx-gaia.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/button/button.directive.d.ts +7 -0
- package/lib/button/button.module.d.ts +8 -0
- package/lib/button/icon-button.directive.d.ts +8 -0
- package/lib/button/index.d.ts +3 -0
- package/lib/checkbox/checkbox-required.validator.d.ts +13 -0
- package/lib/checkbox/checkbox.component.d.ts +62 -0
- package/lib/checkbox/checkbox.module.d.ts +8 -0
- package/lib/checkbox/index.d.ts +3 -0
- package/lib/form-field/field-info.component.d.ts +5 -0
- package/lib/form-field/field-label.component.d.ts +9 -0
- package/lib/form-field/form-control.di.d.ts +10 -0
- package/lib/form-field/form-field.component.d.ts +8 -0
- package/lib/form-field/form-field.module.d.ts +10 -0
- package/lib/form-field/index.d.ts +5 -0
- package/lib/input/index.d.ts +3 -0
- package/lib/input/input.component.d.ts +11 -0
- package/lib/input/input.directive.d.ts +20 -0
- package/lib/input/input.module.d.ts +8 -0
- package/lib/menu/index.d.ts +5 -0
- package/lib/menu/menu-item.component.d.ts +6 -0
- package/lib/menu/menu-separator.componen.d.ts +5 -0
- package/lib/menu/menu-trigger.directive.d.ts +10 -0
- package/lib/menu/menu.component.d.ts +6 -0
- package/lib/menu/menu.module.d.ts +10 -0
- package/lib/segmented-control/index.d.ts +3 -0
- package/lib/segmented-control/segmented-control-button.directive.d.ts +10 -0
- package/lib/segmented-control/segmented-control.component.d.ts +7 -0
- package/lib/segmented-control/segmented-control.module.d.ts +8 -0
- package/lib/tooltip/index.d.ts +3 -0
- package/lib/tooltip/tooltip.component.d.ts +25 -0
- package/lib/tooltip/tooltip.directive.d.ts +60 -0
- package/lib/tooltip/tooltip.module.d.ts +7 -0
- package/package.json +33 -0
- package/public-api.d.ts +7 -0
- package/schematics/collection.json +16 -0
- package/schematics/ng-add/index.d.ts +3 -0
- package/schematics/ng-add/index.js +50 -0
- package/schematics/ng-add/index.js.map +1 -0
- package/schematics/ng-add/messages.d.ts +1 -0
- package/schematics/ng-add/messages.js +7 -0
- package/schematics/ng-add/messages.js.map +1 -0
- package/schematics/ng-add/schema.d.ts +10 -0
- package/schematics/ng-add/schema.js +3 -0
- package/schematics/ng-add/schema.js.map +1 -0
- package/schematics/ng-add/schema.json +21 -0
- package/schematics/ng-add/setup-project.d.ts +3 -0
- package/schematics/ng-add/setup-project.js +89 -0
- package/schematics/ng-add/setup-project.js.map +1 -0
- package/styles/global.scss +5 -0
|
@@ -0,0 +1,979 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { input, Component, ChangeDetectionStrategy, ViewEncapsulation, NgModule, forwardRef, inject, Injector, signal, booleanAttribute, linkedSignal, output, computed, Attribute, Directive, model, HostListener, contentChild, InjectionToken, effect, TemplateRef, ElementRef, NgZone, numberAttribute, Input } from '@angular/core';
|
|
3
|
+
import * as i1 from 'lucide-angular';
|
|
4
|
+
import { LucideAngularModule } from 'lucide-angular';
|
|
5
|
+
import { NG_VALUE_ACCESSOR, NgControl, NG_VALIDATORS, CheckboxRequiredValidator } from '@angular/forms';
|
|
6
|
+
import * as i1$1 from '@angular/cdk/menu';
|
|
7
|
+
import { CdkMenu, CdkMenuItem, CdkMenuTrigger } from '@angular/cdk/menu';
|
|
8
|
+
import { Overlay } from '@angular/cdk/overlay';
|
|
9
|
+
import { ComponentPortal } from '@angular/cdk/portal';
|
|
10
|
+
import { Subject, takeUntil, map } from 'rxjs';
|
|
11
|
+
import { ESCAPE, hasModifierKey } from '@angular/cdk/keycodes';
|
|
12
|
+
import { NgTemplateOutlet } from '@angular/common';
|
|
13
|
+
|
|
14
|
+
class GaButtonDirective {
|
|
15
|
+
variant = input.required({
|
|
16
|
+
alias: 'gaButton',
|
|
17
|
+
});
|
|
18
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: GaButtonDirective, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
19
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.0.1", type: GaButtonDirective, isStandalone: true, selector: "button[gaButton], a[gaButton]", inputs: { variant: { classPropertyName: "variant", publicName: "gaButton", isSignal: true, isRequired: true, transformFunction: null } }, host: { properties: { "class.ga-button--secondary": "!variant() || variant() === 'secondary'", "class.ga-button--primary": "variant() === 'primary'", "class.ga-button--ghost": "variant() === 'ghost'", "class.ga-button--transparent": "variant() === 'transparent'" }, classAttribute: "ga-button" }, ngImport: i0, template: `<ng-content />`, isInline: true });
|
|
20
|
+
}
|
|
21
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: GaButtonDirective, decorators: [{
|
|
22
|
+
type: Component,
|
|
23
|
+
args: [{
|
|
24
|
+
selector: 'button[gaButton], a[gaButton]',
|
|
25
|
+
host: {
|
|
26
|
+
class: 'ga-button',
|
|
27
|
+
'[class.ga-button--secondary]': `!variant() || variant() === 'secondary'`,
|
|
28
|
+
'[class.ga-button--primary]': `variant() === 'primary'`,
|
|
29
|
+
'[class.ga-button--ghost]': `variant() === 'ghost'`,
|
|
30
|
+
'[class.ga-button--transparent]': `variant() === 'transparent'`,
|
|
31
|
+
},
|
|
32
|
+
template: `<ng-content />`,
|
|
33
|
+
}]
|
|
34
|
+
}] });
|
|
35
|
+
|
|
36
|
+
class GaIconButtonDirective {
|
|
37
|
+
icon = input.required({ alias: 'gaIconButton' });
|
|
38
|
+
variant = input('secondary', {
|
|
39
|
+
alias: 'gaIconButtonVariant',
|
|
40
|
+
});
|
|
41
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: GaIconButtonDirective, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
42
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.0.1", type: GaIconButtonDirective, isStandalone: true, selector: "button[gaIconButton], a[gaIconButton]", inputs: { icon: { classPropertyName: "icon", publicName: "gaIconButton", isSignal: true, isRequired: true, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "gaIconButtonVariant", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.ga-button--primary": "variant() === 'primary'", "class.ga-button--secondary": "variant() === 'secondary'", "class.ga-button--ghost": "variant() === 'ghost'" }, classAttribute: "ga-button ga-button--icon-only" }, ngImport: i0, template: `
|
|
43
|
+
<lucide-angular [img]="icon()" />
|
|
44
|
+
<span class="ga-button__icon-label"><ng-content /></span>
|
|
45
|
+
`, isInline: true, styles: [".ga-button__icon-label{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;-webkit-clip-path:inset(50%)!important;clip-path:inset(50%)!important;white-space:nowrap!important;border-width:0!important}\n"], dependencies: [{ kind: "ngmodule", type: LucideAngularModule }, { kind: "component", type: i1.LucideAngularComponent, selector: "lucide-angular, lucide-icon, i-lucide, span-lucide", inputs: ["class", "name", "img", "color", "absoluteStrokeWidth", "size", "strokeWidth"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
46
|
+
}
|
|
47
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: GaIconButtonDirective, decorators: [{
|
|
48
|
+
type: Component,
|
|
49
|
+
args: [{ selector: 'button[gaIconButton], a[gaIconButton]', imports: [LucideAngularModule], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: `
|
|
50
|
+
<lucide-angular [img]="icon()" />
|
|
51
|
+
<span class="ga-button__icon-label"><ng-content /></span>
|
|
52
|
+
`, host: {
|
|
53
|
+
class: 'ga-button ga-button--icon-only',
|
|
54
|
+
'[class.ga-button--primary]': `variant() === 'primary'`,
|
|
55
|
+
'[class.ga-button--secondary]': `variant() === 'secondary'`,
|
|
56
|
+
'[class.ga-button--ghost]': `variant() === 'ghost'`,
|
|
57
|
+
}, styles: [".ga-button__icon-label{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;-webkit-clip-path:inset(50%)!important;clip-path:inset(50%)!important;white-space:nowrap!important;border-width:0!important}\n"] }]
|
|
58
|
+
}] });
|
|
59
|
+
|
|
60
|
+
class GaButtonModule {
|
|
61
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: GaButtonModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
62
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.1", ngImport: i0, type: GaButtonModule, imports: [GaButtonDirective, GaIconButtonDirective], exports: [GaButtonDirective, GaIconButtonDirective] });
|
|
63
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: GaButtonModule, imports: [GaIconButtonDirective] });
|
|
64
|
+
}
|
|
65
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: GaButtonModule, decorators: [{
|
|
66
|
+
type: NgModule,
|
|
67
|
+
args: [{
|
|
68
|
+
imports: [GaButtonDirective, GaIconButtonDirective],
|
|
69
|
+
exports: [GaButtonDirective, GaIconButtonDirective],
|
|
70
|
+
}]
|
|
71
|
+
}] });
|
|
72
|
+
|
|
73
|
+
const CHECKBOX_CONTROL_VALUE_ACCESSOR = {
|
|
74
|
+
provide: NG_VALUE_ACCESSOR,
|
|
75
|
+
useExisting: forwardRef(() => GaCheckboxComponent),
|
|
76
|
+
multi: true,
|
|
77
|
+
};
|
|
78
|
+
// Increasing integer for generating unique ids for checkbox components.
|
|
79
|
+
// Inspired by @angular/components
|
|
80
|
+
let nextUniqueId$2 = 0;
|
|
81
|
+
class GaCheckboxComponent {
|
|
82
|
+
tabindex;
|
|
83
|
+
/** @ignore */
|
|
84
|
+
_uniqueId = `ga-checkbox-${++nextUniqueId$2}`;
|
|
85
|
+
/** @ignore */
|
|
86
|
+
injector = inject(Injector);
|
|
87
|
+
/** @ignore */
|
|
88
|
+
_onTouched;
|
|
89
|
+
/** @ignore */
|
|
90
|
+
_onModelChanged;
|
|
91
|
+
/** @ignore */
|
|
92
|
+
_invalidNgModel = signal(false);
|
|
93
|
+
_ngModelName = signal(null);
|
|
94
|
+
/** The value attribute of the native input element */
|
|
95
|
+
value = input(null);
|
|
96
|
+
disabled = input(false, {
|
|
97
|
+
transform: booleanAttribute,
|
|
98
|
+
});
|
|
99
|
+
checked = input(false, {
|
|
100
|
+
transform: booleanAttribute,
|
|
101
|
+
});
|
|
102
|
+
nameInput = input(null, { alias: 'name' });
|
|
103
|
+
id = input(null);
|
|
104
|
+
indeterminate = input(false, { transform: booleanAttribute });
|
|
105
|
+
ariaLabel = input(null, { alias: 'aria-label' });
|
|
106
|
+
ariaLabelledby = input(null, {
|
|
107
|
+
alias: 'aria-labelledby',
|
|
108
|
+
});
|
|
109
|
+
ariaDescribedby = input(null, {
|
|
110
|
+
alias: 'aria-describedby',
|
|
111
|
+
});
|
|
112
|
+
ariaInvalid = input(null, { alias: 'aria-invalid' });
|
|
113
|
+
ariaErrormessage = input(null, {
|
|
114
|
+
alias: 'aria-errormessage',
|
|
115
|
+
});
|
|
116
|
+
required = input(false, { transform: booleanAttribute });
|
|
117
|
+
disabledModel = linkedSignal(() => this.disabled());
|
|
118
|
+
checkedModel = linkedSignal(() => this.checked());
|
|
119
|
+
change = output();
|
|
120
|
+
indeterminateChange = output();
|
|
121
|
+
/** @ignore */
|
|
122
|
+
inputId = computed(() => (this.id() ? this.id() : this._uniqueId));
|
|
123
|
+
/** @ignore */
|
|
124
|
+
name = computed(() => {
|
|
125
|
+
return this.nameInput() ?? this._ngModelName() ?? this._uniqueId;
|
|
126
|
+
});
|
|
127
|
+
/** @ignore */
|
|
128
|
+
invalid = computed(() => {
|
|
129
|
+
return this.ariaInvalid()
|
|
130
|
+
? this.ariaInvalid() === 'true'
|
|
131
|
+
: this._invalidNgModel();
|
|
132
|
+
});
|
|
133
|
+
constructor(
|
|
134
|
+
/** @ignore */
|
|
135
|
+
tabindex) {
|
|
136
|
+
this.tabindex = tabindex;
|
|
137
|
+
}
|
|
138
|
+
ngDoCheck() {
|
|
139
|
+
const ngControl = this.injector.get(NgControl, null);
|
|
140
|
+
if (ngControl) {
|
|
141
|
+
this._invalidNgModel.set(!!ngControl.invalid);
|
|
142
|
+
this._ngModelName.set(ngControl.name);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
/** @ignore */
|
|
146
|
+
onInputChange(event) {
|
|
147
|
+
// We always have to stop propagation on the change event.
|
|
148
|
+
// Otherwise the change event, from the input element, will bubble up and
|
|
149
|
+
// emit its event object to the `change` output.
|
|
150
|
+
event.stopPropagation();
|
|
151
|
+
if (this.disabled()) {
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
this.checkedModel.set(!this.checkedModel());
|
|
155
|
+
this.updateModel();
|
|
156
|
+
}
|
|
157
|
+
/** @ignore */
|
|
158
|
+
onBlur() {
|
|
159
|
+
this._onTouched?.();
|
|
160
|
+
}
|
|
161
|
+
/** @ignore */
|
|
162
|
+
registerOnChange(fn) {
|
|
163
|
+
this._onModelChanged = fn;
|
|
164
|
+
}
|
|
165
|
+
/** @ignore */
|
|
166
|
+
registerOnTouched(fn) {
|
|
167
|
+
this._onTouched = fn;
|
|
168
|
+
}
|
|
169
|
+
/** @ignore */
|
|
170
|
+
writeValue(value) {
|
|
171
|
+
this.checkedModel.set(!!value);
|
|
172
|
+
}
|
|
173
|
+
/** @ignore */
|
|
174
|
+
setDisabledState(isDisabled) {
|
|
175
|
+
this.disabledModel.set(isDisabled);
|
|
176
|
+
}
|
|
177
|
+
/** @ignore */
|
|
178
|
+
updateModel() {
|
|
179
|
+
this._onModelChanged?.(this.checkedModel());
|
|
180
|
+
this.change.emit(this.checkedModel());
|
|
181
|
+
}
|
|
182
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: GaCheckboxComponent, deps: [{ token: 'tabindex', attribute: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
183
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.0.1", type: GaCheckboxComponent, isStandalone: true, selector: "ga-checkbox", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, nameInput: { classPropertyName: "nameInput", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, indeterminate: { classPropertyName: "indeterminate", publicName: "indeterminate", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledby: { classPropertyName: "ariaLabelledby", publicName: "aria-labelledby", isSignal: true, isRequired: false, transformFunction: null }, ariaDescribedby: { classPropertyName: "ariaDescribedby", publicName: "aria-describedby", isSignal: true, isRequired: false, transformFunction: null }, ariaInvalid: { classPropertyName: "ariaInvalid", publicName: "aria-invalid", isSignal: true, isRequired: false, transformFunction: null }, ariaErrormessage: { classPropertyName: "ariaErrormessage", publicName: "aria-errormessage", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { change: "change", indeterminateChange: "indeterminateChange" }, host: { properties: { "class.ga-checkbox--invalid": "invalid()", "attr.id": "null", "attr.tabindex": "null", "attr.aria-label": "null", "attr.aria-labelledby": "null", "attr.aria-describedby": "null", "attr.aria-invalid": "null", "attr.aria-errormessage": "null" }, classAttribute: "ga-checkbox" }, providers: [CHECKBOX_CONTROL_VALUE_ACCESSOR], ngImport: i0, template: "<input\n type=\"checkbox\"\n class=\"ga-checkbox__native\"\n [attr.id]=\"inputId()\"\n [name]=\"name()\"\n [checked]=\"checkedModel()\"\n [indeterminate]=\"indeterminate()\"\n [disabled]=\"disabledModel()\"\n [required]=\"required()\"\n [attr.value]=\"value()\"\n [attr.tabindex]=\"tabindex\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-labelledby]=\"ariaLabelledby()\"\n [attr.aria-describedby]=\"ariaDescribedby()\"\n [attr.aria-invalid]=\"ariaInvalid()\"\n [attr.aria-errormessage]=\"ariaErrormessage()\"\n (change)=\"onInputChange($event)\"\n (blur)=\"onBlur()\"\n/>\n<div class=\"ga-checkbox__marker\">\n <svg\n class=\"ga-checkbox__marker__indicator-checked\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n >\n <path\n d=\"M4 9L6 11L12 5\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n <svg\n class=\"ga-checkbox__marker__indicator-indeterminate\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n >\n <path\n d=\"M4 8H6.13333H12\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n</div>\n\n<label class=\"ga-checkbox__label\" [attr.for]=\"inputId()\"\n ><ng-content></ng-content\n></label>\n", changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
184
|
+
}
|
|
185
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: GaCheckboxComponent, decorators: [{
|
|
186
|
+
type: Component,
|
|
187
|
+
args: [{ selector: 'ga-checkbox', changeDetection: ChangeDetectionStrategy.OnPush, providers: [CHECKBOX_CONTROL_VALUE_ACCESSOR], host: {
|
|
188
|
+
class: 'ga-checkbox',
|
|
189
|
+
'[class.ga-checkbox--invalid]': 'invalid()',
|
|
190
|
+
'[attr.id]': 'null',
|
|
191
|
+
'[attr.tabindex]': 'null',
|
|
192
|
+
'[attr.aria-label]': 'null',
|
|
193
|
+
'[attr.aria-labelledby]': 'null',
|
|
194
|
+
'[attr.aria-describedby]': 'null',
|
|
195
|
+
'[attr.aria-invalid]': 'null',
|
|
196
|
+
'[attr.aria-errormessage]': 'null',
|
|
197
|
+
}, template: "<input\n type=\"checkbox\"\n class=\"ga-checkbox__native\"\n [attr.id]=\"inputId()\"\n [name]=\"name()\"\n [checked]=\"checkedModel()\"\n [indeterminate]=\"indeterminate()\"\n [disabled]=\"disabledModel()\"\n [required]=\"required()\"\n [attr.value]=\"value()\"\n [attr.tabindex]=\"tabindex\"\n [attr.aria-label]=\"ariaLabel()\"\n [attr.aria-labelledby]=\"ariaLabelledby()\"\n [attr.aria-describedby]=\"ariaDescribedby()\"\n [attr.aria-invalid]=\"ariaInvalid()\"\n [attr.aria-errormessage]=\"ariaErrormessage()\"\n (change)=\"onInputChange($event)\"\n (blur)=\"onBlur()\"\n/>\n<div class=\"ga-checkbox__marker\">\n <svg\n class=\"ga-checkbox__marker__indicator-checked\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n >\n <path\n d=\"M4 9L6 11L12 5\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n <svg\n class=\"ga-checkbox__marker__indicator-indeterminate\"\n viewBox=\"0 0 16 16\"\n fill=\"none\"\n >\n <path\n d=\"M4 8H6.13333H12\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n</div>\n\n<label class=\"ga-checkbox__label\" [attr.for]=\"inputId()\"\n ><ng-content></ng-content\n></label>\n" }]
|
|
198
|
+
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
199
|
+
type: Attribute,
|
|
200
|
+
args: ['tabindex']
|
|
201
|
+
}] }] });
|
|
202
|
+
|
|
203
|
+
const GA_CHECKBOX_REQUIRED_VALIDATOR = {
|
|
204
|
+
provide: NG_VALIDATORS,
|
|
205
|
+
useExisting: forwardRef(() => GaCheckboxRequiredValidator),
|
|
206
|
+
multi: true,
|
|
207
|
+
};
|
|
208
|
+
/**
|
|
209
|
+
* Validator for Gaia checkbox's required attribute in template-driven checkbox.
|
|
210
|
+
* Current CheckboxRequiredValidator only work with `input type=checkbox` and does not
|
|
211
|
+
* work with `ga-checkbox`.
|
|
212
|
+
*/
|
|
213
|
+
class GaCheckboxRequiredValidator extends CheckboxRequiredValidator {
|
|
214
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: GaCheckboxRequiredValidator, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
215
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.1", type: GaCheckboxRequiredValidator, isStandalone: true, selector: "ga-checkbox[required][formControlName], ga-checkbox[required][formControl], ga-checkbox[required][ngModel]", providers: [GA_CHECKBOX_REQUIRED_VALIDATOR], usesInheritance: true, ngImport: i0 });
|
|
216
|
+
}
|
|
217
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: GaCheckboxRequiredValidator, decorators: [{
|
|
218
|
+
type: Directive,
|
|
219
|
+
args: [{
|
|
220
|
+
selector: `ga-checkbox[required][formControlName], ga-checkbox[required][formControl], ga-checkbox[required][ngModel]`,
|
|
221
|
+
providers: [GA_CHECKBOX_REQUIRED_VALIDATOR],
|
|
222
|
+
}]
|
|
223
|
+
}] });
|
|
224
|
+
|
|
225
|
+
class GaCheckboxModule {
|
|
226
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: GaCheckboxModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
227
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.1", ngImport: i0, type: GaCheckboxModule, imports: [GaCheckboxComponent, GaCheckboxRequiredValidator], exports: [GaCheckboxComponent, GaCheckboxRequiredValidator] });
|
|
228
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: GaCheckboxModule });
|
|
229
|
+
}
|
|
230
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: GaCheckboxModule, decorators: [{
|
|
231
|
+
type: NgModule,
|
|
232
|
+
args: [{
|
|
233
|
+
imports: [GaCheckboxComponent, GaCheckboxRequiredValidator],
|
|
234
|
+
exports: [GaCheckboxComponent, GaCheckboxRequiredValidator],
|
|
235
|
+
}]
|
|
236
|
+
}] });
|
|
237
|
+
|
|
238
|
+
class GaSegmentedControlComponent {
|
|
239
|
+
selected = model();
|
|
240
|
+
change = output();
|
|
241
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: GaSegmentedControlComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
242
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.0.1", type: GaSegmentedControlComponent, isStandalone: true, selector: "ga-segmented-control", inputs: { selected: { classPropertyName: "selected", publicName: "selected", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { selected: "selectedChange", change: "change" }, host: { attributes: { "role": "group" }, classAttribute: "ga-segmented-control" }, ngImport: i0, template: "<ng-content select=\"button[gaSegmentedControlButton]\"></ng-content>\n", changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
243
|
+
}
|
|
244
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: GaSegmentedControlComponent, decorators: [{
|
|
245
|
+
type: Component,
|
|
246
|
+
args: [{ selector: 'ga-segmented-control', changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
247
|
+
role: 'group',
|
|
248
|
+
class: 'ga-segmented-control',
|
|
249
|
+
}, template: "<ng-content select=\"button[gaSegmentedControlButton]\"></ng-content>\n" }]
|
|
250
|
+
}] });
|
|
251
|
+
|
|
252
|
+
class GaSegmentedControlButtonDirective {
|
|
253
|
+
/** @ignore */
|
|
254
|
+
group = inject(GaSegmentedControlComponent, { host: true });
|
|
255
|
+
value = input();
|
|
256
|
+
selected = computed(() => {
|
|
257
|
+
return (this.value() !== undefined &&
|
|
258
|
+
this.group.selected() !== undefined &&
|
|
259
|
+
this.group.selected() === this.value());
|
|
260
|
+
});
|
|
261
|
+
onClick() {
|
|
262
|
+
this.group.selected.set(this.value());
|
|
263
|
+
this.group.change.emit(this.value());
|
|
264
|
+
}
|
|
265
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: GaSegmentedControlButtonDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
266
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.0.1", type: GaSegmentedControlButtonDirective, isStandalone: true, selector: "[gaSegmentedControlButton]", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "type": "button" }, listeners: { "click": "onClick()" }, properties: { "class.ga-segmented-control__button--selected": "selected()", "attr.aria-pressed": "selected()" }, classAttribute: "ga-segmented-control__button" }, ngImport: i0 });
|
|
267
|
+
}
|
|
268
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: GaSegmentedControlButtonDirective, decorators: [{
|
|
269
|
+
type: Directive,
|
|
270
|
+
args: [{
|
|
271
|
+
selector: '[gaSegmentedControlButton]',
|
|
272
|
+
host: {
|
|
273
|
+
type: 'button',
|
|
274
|
+
class: 'ga-segmented-control__button',
|
|
275
|
+
'[class.ga-segmented-control__button--selected]': 'selected()',
|
|
276
|
+
'[attr.aria-pressed]': 'selected()',
|
|
277
|
+
},
|
|
278
|
+
}]
|
|
279
|
+
}], propDecorators: { onClick: [{
|
|
280
|
+
type: HostListener,
|
|
281
|
+
args: ['click']
|
|
282
|
+
}] } });
|
|
283
|
+
|
|
284
|
+
class GaSegmentedControlModule {
|
|
285
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: GaSegmentedControlModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
286
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.1", ngImport: i0, type: GaSegmentedControlModule, imports: [GaSegmentedControlComponent, GaSegmentedControlButtonDirective], exports: [GaSegmentedControlComponent, GaSegmentedControlButtonDirective] });
|
|
287
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: GaSegmentedControlModule });
|
|
288
|
+
}
|
|
289
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: GaSegmentedControlModule, decorators: [{
|
|
290
|
+
type: NgModule,
|
|
291
|
+
args: [{
|
|
292
|
+
imports: [GaSegmentedControlComponent, GaSegmentedControlButtonDirective],
|
|
293
|
+
exports: [GaSegmentedControlComponent, GaSegmentedControlButtonDirective],
|
|
294
|
+
}]
|
|
295
|
+
}] });
|
|
296
|
+
|
|
297
|
+
class GaInputComponent {
|
|
298
|
+
implicitNgControl = contentChild(NgControl);
|
|
299
|
+
implicitInvalid = signal(false);
|
|
300
|
+
invalidInput = input(null, { transform: booleanAttribute });
|
|
301
|
+
invalid = computed(() => {
|
|
302
|
+
return this.invalidInput() ?? this.implicitInvalid();
|
|
303
|
+
});
|
|
304
|
+
ngDoCheck() {
|
|
305
|
+
// we can rely on computed because `ivalid` of NgControl is not a signal, yet
|
|
306
|
+
const implicitNgControl = this.implicitNgControl();
|
|
307
|
+
if (implicitNgControl) {
|
|
308
|
+
this.implicitInvalid.set(!!implicitNgControl.invalid && !!implicitNgControl.dirty);
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: GaInputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
312
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "19.0.1", type: GaInputComponent, isStandalone: true, selector: "ga-input", inputs: { invalidInput: { classPropertyName: "invalidInput", publicName: "invalidInput", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.ga-input--invalid": "invalid()" }, classAttribute: "ga-input" }, queries: [{ propertyName: "implicitNgControl", first: true, predicate: NgControl, descendants: true, isSignal: true }], ngImport: i0, template: `<ng-content />`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
313
|
+
}
|
|
314
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: GaInputComponent, decorators: [{
|
|
315
|
+
type: Component,
|
|
316
|
+
args: [{
|
|
317
|
+
selector: 'ga-input',
|
|
318
|
+
template: `<ng-content />`,
|
|
319
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
320
|
+
host: {
|
|
321
|
+
class: 'ga-input',
|
|
322
|
+
'[class.ga-input--invalid]': 'invalid()',
|
|
323
|
+
},
|
|
324
|
+
}]
|
|
325
|
+
}] });
|
|
326
|
+
|
|
327
|
+
const GA_FORM_CONTROL = new InjectionToken('ga-form-control');
|
|
328
|
+
class GaFormControlDirective {
|
|
329
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: GaFormControlDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
330
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.1", type: GaFormControlDirective, isStandalone: true, selector: "[gaFormControl]", providers: [
|
|
331
|
+
{ provide: GA_FORM_CONTROL, useExisting: GaFormControlDirective },
|
|
332
|
+
], ngImport: i0 });
|
|
333
|
+
}
|
|
334
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: GaFormControlDirective, decorators: [{
|
|
335
|
+
type: Directive,
|
|
336
|
+
args: [{
|
|
337
|
+
selector: '[gaFormControl]',
|
|
338
|
+
providers: [
|
|
339
|
+
{ provide: GA_FORM_CONTROL, useExisting: GaFormControlDirective },
|
|
340
|
+
],
|
|
341
|
+
}]
|
|
342
|
+
}] });
|
|
343
|
+
|
|
344
|
+
let nextUniqueId$1 = 0;
|
|
345
|
+
class GaInputDirective {
|
|
346
|
+
uniqueId = `ga-input-${++nextUniqueId$1}`;
|
|
347
|
+
implicitNgControl = inject(NgControl, {
|
|
348
|
+
optional: true,
|
|
349
|
+
self: true,
|
|
350
|
+
});
|
|
351
|
+
hasWrapper = inject(GaInputComponent, { optional: true });
|
|
352
|
+
implicitInvalid = signal(false);
|
|
353
|
+
implicitErrors = signal(null);
|
|
354
|
+
invalidInput = input(null, { transform: booleanAttribute });
|
|
355
|
+
idInput = input(undefined, { alias: 'id' });
|
|
356
|
+
invalid = computed(() => {
|
|
357
|
+
return this.invalidInput() ?? this.implicitInvalid();
|
|
358
|
+
});
|
|
359
|
+
id = computed(() => {
|
|
360
|
+
return this.idInput() ?? this.uniqueId;
|
|
361
|
+
});
|
|
362
|
+
errors = this.implicitErrors.asReadonly();
|
|
363
|
+
ngDoCheck() {
|
|
364
|
+
if (this.hasWrapper)
|
|
365
|
+
return;
|
|
366
|
+
// we can rely on computed because `ivalid` of NgControl is not a signal, yet
|
|
367
|
+
const implicitNgControl = this.implicitNgControl;
|
|
368
|
+
if (implicitNgControl) {
|
|
369
|
+
this.implicitInvalid.set(!!implicitNgControl.invalid && !!implicitNgControl.dirty);
|
|
370
|
+
this.implicitErrors.set(implicitNgControl.errors);
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: GaInputDirective, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
374
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.0.1", type: GaInputDirective, isStandalone: true, selector: "[gaInput]", inputs: { invalidInput: { classPropertyName: "invalidInput", publicName: "invalidInput", isSignal: true, isRequired: false, transformFunction: null }, idInput: { classPropertyName: "idInput", publicName: "id", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.id": "id()", "class.ga-input": "!hasWrapper", "class.ga-input--invalid": "!hasWrapper && invalid()" } }, providers: [{ provide: GA_FORM_CONTROL, useExisting: GaInputDirective }], ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
375
|
+
}
|
|
376
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: GaInputDirective, decorators: [{
|
|
377
|
+
type: Component,
|
|
378
|
+
args: [{
|
|
379
|
+
selector: '[gaInput]',
|
|
380
|
+
template: '',
|
|
381
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
382
|
+
host: {
|
|
383
|
+
'[attr.id]': 'id()',
|
|
384
|
+
'[class.ga-input]': '!hasWrapper',
|
|
385
|
+
'[class.ga-input--invalid]': '!hasWrapper && invalid()',
|
|
386
|
+
},
|
|
387
|
+
providers: [{ provide: GA_FORM_CONTROL, useExisting: GaInputDirective }],
|
|
388
|
+
}]
|
|
389
|
+
}] });
|
|
390
|
+
|
|
391
|
+
class GaInputModule {
|
|
392
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: GaInputModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
393
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.1", ngImport: i0, type: GaInputModule, imports: [GaInputComponent, GaInputDirective], exports: [GaInputComponent, GaInputDirective] });
|
|
394
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: GaInputModule });
|
|
395
|
+
}
|
|
396
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: GaInputModule, decorators: [{
|
|
397
|
+
type: NgModule,
|
|
398
|
+
args: [{
|
|
399
|
+
imports: [GaInputComponent, GaInputDirective],
|
|
400
|
+
exports: [GaInputComponent, GaInputDirective],
|
|
401
|
+
}]
|
|
402
|
+
}] });
|
|
403
|
+
|
|
404
|
+
let nextUniqueId = 0;
|
|
405
|
+
class GaFormFieldComponent {
|
|
406
|
+
uniqueId = `ga-form-field-${++nextUniqueId}`;
|
|
407
|
+
formControl = contentChild(GA_FORM_CONTROL);
|
|
408
|
+
controlId = computed(() => {
|
|
409
|
+
return this.formControl()?.id() ?? this.uniqueId;
|
|
410
|
+
});
|
|
411
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: GaFormFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
412
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "19.0.1", type: GaFormFieldComponent, isStandalone: true, selector: "ga-form-field", host: { classAttribute: "ga-form-field" }, queries: [{ propertyName: "formControl", first: true, predicate: GA_FORM_CONTROL, descendants: true, isSignal: true }], exportAs: ["gaFormField"], ngImport: i0, template: "<ng-content />\n", changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
413
|
+
}
|
|
414
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: GaFormFieldComponent, decorators: [{
|
|
415
|
+
type: Component,
|
|
416
|
+
args: [{ selector: 'ga-form-field', exportAs: 'gaFormField', changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
417
|
+
class: 'ga-form-field',
|
|
418
|
+
}, template: "<ng-content />\n" }]
|
|
419
|
+
}] });
|
|
420
|
+
|
|
421
|
+
class GaFieldLabelComponent {
|
|
422
|
+
formField = inject(GaFormFieldComponent);
|
|
423
|
+
for = input();
|
|
424
|
+
controlId = computed(() => {
|
|
425
|
+
return this.for() ?? this.formField.controlId();
|
|
426
|
+
});
|
|
427
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: GaFieldLabelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
428
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.0.1", type: GaFieldLabelComponent, isStandalone: true, selector: "ga-label", inputs: { for: { classPropertyName: "for", publicName: "for", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `<label [attr.for]="controlId()" class="ga-form-field__label"
|
|
429
|
+
><ng-content
|
|
430
|
+
/></label>`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
431
|
+
}
|
|
432
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: GaFieldLabelComponent, decorators: [{
|
|
433
|
+
type: Component,
|
|
434
|
+
args: [{
|
|
435
|
+
selector: 'ga-label',
|
|
436
|
+
template: `<label [attr.for]="controlId()" class="ga-form-field__label"
|
|
437
|
+
><ng-content
|
|
438
|
+
/></label>`,
|
|
439
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
440
|
+
}]
|
|
441
|
+
}] });
|
|
442
|
+
|
|
443
|
+
class GaFieldInfoComponent {
|
|
444
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: GaFieldInfoComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
445
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.1", type: GaFieldInfoComponent, isStandalone: true, selector: "ga-info", host: { classAttribute: "ga-form-field__info" }, ngImport: i0, template: `<ng-content />`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
446
|
+
}
|
|
447
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: GaFieldInfoComponent, decorators: [{
|
|
448
|
+
type: Component,
|
|
449
|
+
args: [{
|
|
450
|
+
selector: 'ga-info',
|
|
451
|
+
template: `<ng-content />`,
|
|
452
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
453
|
+
host: {
|
|
454
|
+
class: 'ga-form-field__info',
|
|
455
|
+
},
|
|
456
|
+
}]
|
|
457
|
+
}] });
|
|
458
|
+
|
|
459
|
+
class GaFormFieldModule {
|
|
460
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: GaFormFieldModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
461
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.1", ngImport: i0, type: GaFormFieldModule, imports: [GaFormFieldComponent,
|
|
462
|
+
GaFieldLabelComponent,
|
|
463
|
+
GaFieldInfoComponent,
|
|
464
|
+
GaFormControlDirective], exports: [GaFormFieldComponent,
|
|
465
|
+
GaFieldLabelComponent,
|
|
466
|
+
GaFieldInfoComponent,
|
|
467
|
+
GaFormControlDirective] });
|
|
468
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: GaFormFieldModule });
|
|
469
|
+
}
|
|
470
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: GaFormFieldModule, decorators: [{
|
|
471
|
+
type: NgModule,
|
|
472
|
+
args: [{
|
|
473
|
+
imports: [
|
|
474
|
+
GaFormFieldComponent,
|
|
475
|
+
GaFieldLabelComponent,
|
|
476
|
+
GaFieldInfoComponent,
|
|
477
|
+
GaFormControlDirective,
|
|
478
|
+
],
|
|
479
|
+
exports: [
|
|
480
|
+
GaFormFieldComponent,
|
|
481
|
+
GaFieldLabelComponent,
|
|
482
|
+
GaFieldInfoComponent,
|
|
483
|
+
GaFormControlDirective,
|
|
484
|
+
],
|
|
485
|
+
}]
|
|
486
|
+
}] });
|
|
487
|
+
|
|
488
|
+
class GaMenuComponent {
|
|
489
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: GaMenuComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
490
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.1", type: GaMenuComponent, isStandalone: true, selector: "ga-menu", host: { classAttribute: "ga-menu" }, hostDirectives: [{ directive: i1$1.CdkMenu }], ngImport: i0, template: `<ng-content />`, isInline: true });
|
|
491
|
+
}
|
|
492
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: GaMenuComponent, decorators: [{
|
|
493
|
+
type: Component,
|
|
494
|
+
args: [{
|
|
495
|
+
selector: 'ga-menu',
|
|
496
|
+
template: `<ng-content />`,
|
|
497
|
+
hostDirectives: [CdkMenu],
|
|
498
|
+
host: {
|
|
499
|
+
class: 'ga-menu',
|
|
500
|
+
},
|
|
501
|
+
}]
|
|
502
|
+
}] });
|
|
503
|
+
|
|
504
|
+
class GaMenuItemComponent {
|
|
505
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: GaMenuItemComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
506
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.1", type: GaMenuItemComponent, isStandalone: true, selector: "[gaMenuItem]", host: { classAttribute: "ga-menu__item" }, hostDirectives: [{ directive: i1$1.CdkMenuItem }], ngImport: i0, template: `<ng-content />`, isInline: true });
|
|
507
|
+
}
|
|
508
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: GaMenuItemComponent, decorators: [{
|
|
509
|
+
type: Component,
|
|
510
|
+
args: [{
|
|
511
|
+
selector: '[gaMenuItem]',
|
|
512
|
+
template: `<ng-content />`,
|
|
513
|
+
hostDirectives: [CdkMenuItem],
|
|
514
|
+
host: {
|
|
515
|
+
class: 'ga-menu__item',
|
|
516
|
+
},
|
|
517
|
+
}]
|
|
518
|
+
}] });
|
|
519
|
+
|
|
520
|
+
class GaMenuTriggerDirective {
|
|
521
|
+
cdkMenuTrigger = inject(CdkMenuTrigger);
|
|
522
|
+
menuRef = input.required({
|
|
523
|
+
alias: 'gaMenuTrigger',
|
|
524
|
+
});
|
|
525
|
+
constructor() {
|
|
526
|
+
effect(() => {
|
|
527
|
+
this.cdkMenuTrigger.menuTemplateRef = this.menuRef();
|
|
528
|
+
});
|
|
529
|
+
}
|
|
530
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: GaMenuTriggerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
531
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.0.1", type: GaMenuTriggerDirective, isStandalone: true, selector: "[gaMenuTrigger]", inputs: { menuRef: { classPropertyName: "menuRef", publicName: "gaMenuTrigger", isSignal: true, isRequired: true, transformFunction: null } }, hostDirectives: [{ directive: i1$1.CdkMenuTrigger }], ngImport: i0 });
|
|
532
|
+
}
|
|
533
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: GaMenuTriggerDirective, decorators: [{
|
|
534
|
+
type: Directive,
|
|
535
|
+
args: [{
|
|
536
|
+
selector: '[gaMenuTrigger]',
|
|
537
|
+
standalone: true,
|
|
538
|
+
hostDirectives: [CdkMenuTrigger],
|
|
539
|
+
}]
|
|
540
|
+
}], ctorParameters: () => [] });
|
|
541
|
+
|
|
542
|
+
class GaMenuSeparatorComponent {
|
|
543
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: GaMenuSeparatorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
544
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.1", type: GaMenuSeparatorComponent, isStandalone: true, selector: "ga-menu-separator", host: { classAttribute: "ga-menu__separator" }, ngImport: i0, template: `<ng-content />`, isInline: true });
|
|
545
|
+
}
|
|
546
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: GaMenuSeparatorComponent, decorators: [{
|
|
547
|
+
type: Component,
|
|
548
|
+
args: [{
|
|
549
|
+
selector: 'ga-menu-separator',
|
|
550
|
+
template: `<ng-content />`,
|
|
551
|
+
host: {
|
|
552
|
+
class: 'ga-menu__separator',
|
|
553
|
+
},
|
|
554
|
+
}]
|
|
555
|
+
}] });
|
|
556
|
+
|
|
557
|
+
class GaMenuModule {
|
|
558
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: GaMenuModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
559
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.1", ngImport: i0, type: GaMenuModule, imports: [GaMenuComponent,
|
|
560
|
+
GaMenuItemComponent,
|
|
561
|
+
GaMenuTriggerDirective,
|
|
562
|
+
GaMenuSeparatorComponent], exports: [GaMenuComponent,
|
|
563
|
+
GaMenuItemComponent,
|
|
564
|
+
GaMenuTriggerDirective,
|
|
565
|
+
GaMenuSeparatorComponent] });
|
|
566
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: GaMenuModule });
|
|
567
|
+
}
|
|
568
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: GaMenuModule, decorators: [{
|
|
569
|
+
type: NgModule,
|
|
570
|
+
args: [{
|
|
571
|
+
imports: [
|
|
572
|
+
GaMenuComponent,
|
|
573
|
+
GaMenuItemComponent,
|
|
574
|
+
GaMenuTriggerDirective,
|
|
575
|
+
GaMenuSeparatorComponent,
|
|
576
|
+
],
|
|
577
|
+
exports: [
|
|
578
|
+
GaMenuComponent,
|
|
579
|
+
GaMenuItemComponent,
|
|
580
|
+
GaMenuTriggerDirective,
|
|
581
|
+
GaMenuSeparatorComponent,
|
|
582
|
+
],
|
|
583
|
+
}]
|
|
584
|
+
}] });
|
|
585
|
+
|
|
586
|
+
class GaTooltipComponent {
|
|
587
|
+
mouseLeaveSubject = new Subject();
|
|
588
|
+
afterMouseLeave = () => this.mouseLeaveSubject.asObservable();
|
|
589
|
+
mouseOver = signal(false);
|
|
590
|
+
content = input.required();
|
|
591
|
+
template = computed(() => {
|
|
592
|
+
const content = this.content();
|
|
593
|
+
return content instanceof TemplateRef ? content : null;
|
|
594
|
+
});
|
|
595
|
+
text = computed(() => {
|
|
596
|
+
const content = this.content();
|
|
597
|
+
return typeof content === 'string' ? content : null;
|
|
598
|
+
});
|
|
599
|
+
position = input();
|
|
600
|
+
offset = input(0);
|
|
601
|
+
hideTriggered = output();
|
|
602
|
+
triggerHide = () => this.hideTriggered.emit();
|
|
603
|
+
inlineStyle = computed(() => {
|
|
604
|
+
if (!this.position() || !this.offset()) {
|
|
605
|
+
return '';
|
|
606
|
+
}
|
|
607
|
+
return `--ga-tooltip-offset: ${this.offset()}px;`;
|
|
608
|
+
});
|
|
609
|
+
cssClass = computed(() => {
|
|
610
|
+
return ['ga-tooltip', `ga-tooltip--${this.position()}`].join(' ');
|
|
611
|
+
});
|
|
612
|
+
handleMouseEnter() {
|
|
613
|
+
this.mouseOver.set(true);
|
|
614
|
+
}
|
|
615
|
+
handleMouseLeave() {
|
|
616
|
+
this.mouseOver.set(false);
|
|
617
|
+
this.mouseLeaveSubject.next();
|
|
618
|
+
}
|
|
619
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: GaTooltipComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
620
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.1", 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-top :host,.left-center :host,.left-bottom :host{padding-right:var(--ga-tooltip-offset)}.right-top :host,.right-center :host,.right-bottom :host{padding-left:var(--ga-tooltip-offset)}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
621
|
+
}
|
|
622
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: GaTooltipComponent, decorators: [{
|
|
623
|
+
type: Component,
|
|
624
|
+
args: [{ selector: 'ga-tooltip', imports: [NgTemplateOutlet], changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
625
|
+
'[attr.style]': 'inlineStyle()',
|
|
626
|
+
}, 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-top :host,.left-center :host,.left-bottom :host{padding-right:var(--ga-tooltip-offset)}.right-top :host,.right-center :host,.right-bottom :host{padding-left:var(--ga-tooltip-offset)}\n"] }]
|
|
627
|
+
}], propDecorators: { handleMouseEnter: [{
|
|
628
|
+
type: HostListener,
|
|
629
|
+
args: ['mouseenter']
|
|
630
|
+
}], handleMouseLeave: [{
|
|
631
|
+
type: HostListener,
|
|
632
|
+
args: ['mouseleave']
|
|
633
|
+
}] } });
|
|
634
|
+
|
|
635
|
+
class GaTooltipDirective {
|
|
636
|
+
elementRef = inject(ElementRef);
|
|
637
|
+
overlay = inject(Overlay);
|
|
638
|
+
ngZone = inject(NgZone);
|
|
639
|
+
destroyed$ = new Subject();
|
|
640
|
+
_content = null;
|
|
641
|
+
tooltipInstanceDestroyed$ = null;
|
|
642
|
+
outputSubscription = null;
|
|
643
|
+
overlayRef;
|
|
644
|
+
tooltipPortal;
|
|
645
|
+
tooltipRef;
|
|
646
|
+
get tooltipInstance() {
|
|
647
|
+
return this.tooltipRef ? this.tooltipRef.instance : null;
|
|
648
|
+
}
|
|
649
|
+
currentPosition$;
|
|
650
|
+
_placement = 'right-center';
|
|
651
|
+
_offset = 15;
|
|
652
|
+
mouseOver = false;
|
|
653
|
+
_showControlMode = null;
|
|
654
|
+
_hideControlMode = null;
|
|
655
|
+
set content(value) {
|
|
656
|
+
if (value === this._content) {
|
|
657
|
+
return;
|
|
658
|
+
}
|
|
659
|
+
this._content = value;
|
|
660
|
+
// Hide tooltip with empty content
|
|
661
|
+
if (!this._content && this.overlayRef?.hasAttached()) {
|
|
662
|
+
this.hide();
|
|
663
|
+
return;
|
|
664
|
+
}
|
|
665
|
+
// Update the content in case tooltip is already opened
|
|
666
|
+
if (this.tooltipRef && this.overlayRef?.hasAttached()) {
|
|
667
|
+
this.tooltipRef.setInput('content', this._content);
|
|
668
|
+
}
|
|
669
|
+
}
|
|
670
|
+
get content() {
|
|
671
|
+
return this._content;
|
|
672
|
+
}
|
|
673
|
+
disabled = false;
|
|
674
|
+
controlMode = 'hover';
|
|
675
|
+
/**
|
|
676
|
+
* @default `gaTooltipControlMode`
|
|
677
|
+
*/
|
|
678
|
+
set showControlMode(value) {
|
|
679
|
+
this._showControlMode = value;
|
|
680
|
+
}
|
|
681
|
+
get showControlMode() {
|
|
682
|
+
return this._showControlMode ?? this.controlMode;
|
|
683
|
+
}
|
|
684
|
+
/**
|
|
685
|
+
* @default `gaTooltipControlMode`
|
|
686
|
+
*/
|
|
687
|
+
set hideControlMode(value) {
|
|
688
|
+
this._hideControlMode = value;
|
|
689
|
+
}
|
|
690
|
+
get hideControlMode() {
|
|
691
|
+
return this._hideControlMode ?? this.controlMode;
|
|
692
|
+
}
|
|
693
|
+
set offset(value) {
|
|
694
|
+
if (this._offset === value) {
|
|
695
|
+
return;
|
|
696
|
+
}
|
|
697
|
+
this._offset = !isNaN(value) ? value : 15;
|
|
698
|
+
this.updateTooltipPlacement();
|
|
699
|
+
}
|
|
700
|
+
get offset() {
|
|
701
|
+
return this._offset;
|
|
702
|
+
}
|
|
703
|
+
set placement(value) {
|
|
704
|
+
if (this._placement === value) {
|
|
705
|
+
return;
|
|
706
|
+
}
|
|
707
|
+
this._placement = value;
|
|
708
|
+
this.updateTooltipPlacement();
|
|
709
|
+
}
|
|
710
|
+
get placement() {
|
|
711
|
+
return this._placement;
|
|
712
|
+
}
|
|
713
|
+
ngOnDestroy() {
|
|
714
|
+
this.destroyed$.next();
|
|
715
|
+
this.destroyed$.complete();
|
|
716
|
+
this.overlayRef?.detach();
|
|
717
|
+
this.overlayRef?.dispose();
|
|
718
|
+
}
|
|
719
|
+
show() {
|
|
720
|
+
if (this.overlayRef?.hasAttached()) {
|
|
721
|
+
return;
|
|
722
|
+
}
|
|
723
|
+
const overlayRef = this.createOverlay();
|
|
724
|
+
this.tooltipPortal =
|
|
725
|
+
this.tooltipPortal ?? new ComponentPortal(GaTooltipComponent);
|
|
726
|
+
this.tooltipInstanceDestroyed$ = new Subject();
|
|
727
|
+
this.tooltipRef = overlayRef.attach(this.tooltipPortal);
|
|
728
|
+
this.tooltipRef.setInput('content', this.content);
|
|
729
|
+
this.outputSubscription = this.tooltipInstance.hideTriggered.subscribe(() => setTimeout(() => this.hide()));
|
|
730
|
+
if (this.hideControlMode === 'hover') {
|
|
731
|
+
// Soft hide tooltip on mouse leave when control mode is set to 'hover'
|
|
732
|
+
this.tooltipInstance.afterMouseLeave()
|
|
733
|
+
.pipe(takeUntil(this.tooltipInstanceDestroyed$))
|
|
734
|
+
.subscribe(() => setTimeout(() => this.softHide()));
|
|
735
|
+
}
|
|
736
|
+
else if (this.hideControlMode === 'click') {
|
|
737
|
+
// Hide tooltip on outside click when control mode is set to 'click'
|
|
738
|
+
overlayRef
|
|
739
|
+
.outsidePointerEvents()
|
|
740
|
+
.pipe(takeUntil(this.tooltipInstanceDestroyed$))
|
|
741
|
+
.subscribe((event) => {
|
|
742
|
+
const element = this.elementRef.nativeElement;
|
|
743
|
+
if (event.target !== element && !element.contains(event.target)) {
|
|
744
|
+
this.hide();
|
|
745
|
+
}
|
|
746
|
+
});
|
|
747
|
+
}
|
|
748
|
+
// Tell the instance current position (left, right, top, bottom)
|
|
749
|
+
this.currentPosition$.pipe(takeUntil(this.tooltipInstanceDestroyed$)).subscribe((position) => {
|
|
750
|
+
this.ngZone.run(() => {
|
|
751
|
+
if (!this.tooltipRef) {
|
|
752
|
+
return;
|
|
753
|
+
}
|
|
754
|
+
this.tooltipRef.setInput('position', position);
|
|
755
|
+
this.tooltipRef.setInput('offset', this.offset);
|
|
756
|
+
});
|
|
757
|
+
});
|
|
758
|
+
}
|
|
759
|
+
hide() {
|
|
760
|
+
if (!this.overlayRef?.hasAttached()) {
|
|
761
|
+
return;
|
|
762
|
+
}
|
|
763
|
+
this.overlayRef.detach();
|
|
764
|
+
this.tooltipInstanceDestroyed$.next();
|
|
765
|
+
this.tooltipInstanceDestroyed$.complete();
|
|
766
|
+
this.outputSubscription?.unsubscribe();
|
|
767
|
+
this.tooltipRef = undefined;
|
|
768
|
+
}
|
|
769
|
+
toggle() {
|
|
770
|
+
if (!this.overlayRef?.hasAttached()) {
|
|
771
|
+
this.show();
|
|
772
|
+
return;
|
|
773
|
+
}
|
|
774
|
+
this.hide();
|
|
775
|
+
}
|
|
776
|
+
handleMouseClick() {
|
|
777
|
+
if (this.showControlMode !== 'click' || this.disabled || !this._content) {
|
|
778
|
+
return;
|
|
779
|
+
}
|
|
780
|
+
this.toggle();
|
|
781
|
+
}
|
|
782
|
+
handleMouseEnter() {
|
|
783
|
+
if (this.showControlMode !== 'hover' || this.disabled || !this._content) {
|
|
784
|
+
return;
|
|
785
|
+
}
|
|
786
|
+
this.mouseOver = true;
|
|
787
|
+
this.show();
|
|
788
|
+
}
|
|
789
|
+
handleMouseLeave() {
|
|
790
|
+
if (this.hideControlMode !== 'hover' || this.disabled) {
|
|
791
|
+
return;
|
|
792
|
+
}
|
|
793
|
+
this.mouseOver = false;
|
|
794
|
+
setTimeout(() => this.softHide());
|
|
795
|
+
}
|
|
796
|
+
/**
|
|
797
|
+
* hides only if mouse is not over the host element nor the tooltip itself
|
|
798
|
+
*/
|
|
799
|
+
softHide() {
|
|
800
|
+
if (!this.mouseOver && !this.tooltipInstance?.mouseOver()) {
|
|
801
|
+
this.hide();
|
|
802
|
+
}
|
|
803
|
+
}
|
|
804
|
+
createOverlay() {
|
|
805
|
+
if (this.overlayRef) {
|
|
806
|
+
return this.overlayRef;
|
|
807
|
+
}
|
|
808
|
+
const positionStrategy = this.overlay
|
|
809
|
+
.position()
|
|
810
|
+
.flexibleConnectedTo(this.elementRef);
|
|
811
|
+
positionStrategy.positionChanges.subscribe(console.log);
|
|
812
|
+
this.currentPosition$ = positionStrategy.positionChanges.pipe(map((pos) => pos.connectionPair.panelClass));
|
|
813
|
+
const scrollStrategy = this.overlay.scrollStrategies.reposition();
|
|
814
|
+
this.overlayRef = this.overlay.create({ positionStrategy, scrollStrategy });
|
|
815
|
+
if (this.showControlMode !== 'none') {
|
|
816
|
+
this.overlayRef
|
|
817
|
+
.keydownEvents()
|
|
818
|
+
.pipe(takeUntil(this.destroyed$))
|
|
819
|
+
.subscribe((event) => {
|
|
820
|
+
if (this.overlayRef?.hasAttached() &&
|
|
821
|
+
event.keyCode === ESCAPE &&
|
|
822
|
+
!hasModifierKey(event)) {
|
|
823
|
+
this.hide();
|
|
824
|
+
}
|
|
825
|
+
});
|
|
826
|
+
}
|
|
827
|
+
this.updatePosition();
|
|
828
|
+
return this.overlayRef;
|
|
829
|
+
}
|
|
830
|
+
updateTooltipPlacement() {
|
|
831
|
+
if (this.overlayRef) {
|
|
832
|
+
this.updatePosition();
|
|
833
|
+
this.overlayRef.updatePosition();
|
|
834
|
+
}
|
|
835
|
+
}
|
|
836
|
+
updatePosition() {
|
|
837
|
+
const position = this.overlayRef.getConfig()
|
|
838
|
+
.positionStrategy;
|
|
839
|
+
const positions = this.getPositions(this._placement);
|
|
840
|
+
position.withPositions(positions);
|
|
841
|
+
}
|
|
842
|
+
getPositions(preferredPlacement) {
|
|
843
|
+
let positionedOverlayY;
|
|
844
|
+
let positionedOffsetY;
|
|
845
|
+
if (preferredPlacement.endsWith('start')) {
|
|
846
|
+
positionedOverlayY = 'top';
|
|
847
|
+
positionedOffsetY = -24;
|
|
848
|
+
}
|
|
849
|
+
else if (preferredPlacement.endsWith('end')) {
|
|
850
|
+
positionedOverlayY = 'bottom';
|
|
851
|
+
positionedOffsetY = 24;
|
|
852
|
+
}
|
|
853
|
+
else {
|
|
854
|
+
positionedOverlayY = 'center';
|
|
855
|
+
positionedOffsetY = 0;
|
|
856
|
+
}
|
|
857
|
+
let positionedOverlayX;
|
|
858
|
+
let positionedOffsetX;
|
|
859
|
+
if (preferredPlacement.endsWith('start')) {
|
|
860
|
+
positionedOverlayX = 'start';
|
|
861
|
+
positionedOffsetX = -24;
|
|
862
|
+
}
|
|
863
|
+
else if (preferredPlacement.endsWith('end')) {
|
|
864
|
+
positionedOverlayX = 'end';
|
|
865
|
+
positionedOffsetX = 24;
|
|
866
|
+
}
|
|
867
|
+
else {
|
|
868
|
+
positionedOffsetX = 0;
|
|
869
|
+
positionedOverlayX = 'center';
|
|
870
|
+
}
|
|
871
|
+
const right = {
|
|
872
|
+
originX: 'end',
|
|
873
|
+
originY: 'center',
|
|
874
|
+
overlayX: 'start',
|
|
875
|
+
overlayY: positionedOverlayY,
|
|
876
|
+
offsetY: positionedOffsetY,
|
|
877
|
+
panelClass: `right-${positionedOverlayY}`,
|
|
878
|
+
};
|
|
879
|
+
const left = {
|
|
880
|
+
originX: 'start',
|
|
881
|
+
originY: 'center',
|
|
882
|
+
overlayX: 'end',
|
|
883
|
+
overlayY: positionedOverlayY,
|
|
884
|
+
offsetY: positionedOffsetY,
|
|
885
|
+
panelClass: `left-${positionedOverlayY}`,
|
|
886
|
+
};
|
|
887
|
+
const top = {
|
|
888
|
+
originX: 'center',
|
|
889
|
+
originY: 'top',
|
|
890
|
+
overlayX: positionedOverlayX,
|
|
891
|
+
overlayY: 'bottom',
|
|
892
|
+
offsetX: positionedOffsetX,
|
|
893
|
+
panelClass: `top-${positionedOverlayX}`,
|
|
894
|
+
};
|
|
895
|
+
const bottom = {
|
|
896
|
+
originX: 'center',
|
|
897
|
+
originY: 'bottom',
|
|
898
|
+
overlayX: positionedOverlayX,
|
|
899
|
+
overlayY: 'top',
|
|
900
|
+
offsetX: positionedOffsetX,
|
|
901
|
+
panelClass: `bottom-${positionedOverlayX}`,
|
|
902
|
+
};
|
|
903
|
+
if (preferredPlacement.startsWith('right')) {
|
|
904
|
+
return [right, left, bottom, top];
|
|
905
|
+
}
|
|
906
|
+
else if (preferredPlacement.startsWith('left')) {
|
|
907
|
+
return [left, right, bottom, top];
|
|
908
|
+
}
|
|
909
|
+
else if (preferredPlacement.startsWith('top')) {
|
|
910
|
+
return [top, bottom, right, left];
|
|
911
|
+
}
|
|
912
|
+
else {
|
|
913
|
+
return [bottom, top, right, left];
|
|
914
|
+
}
|
|
915
|
+
}
|
|
916
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: GaTooltipDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
917
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "19.0.1", 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 });
|
|
918
|
+
}
|
|
919
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: GaTooltipDirective, decorators: [{
|
|
920
|
+
type: Directive,
|
|
921
|
+
args: [{
|
|
922
|
+
selector: '[gaTooltip]',
|
|
923
|
+
exportAs: 'gaTooltip',
|
|
924
|
+
}]
|
|
925
|
+
}], propDecorators: { content: [{
|
|
926
|
+
type: Input,
|
|
927
|
+
args: ['gaTooltip']
|
|
928
|
+
}], disabled: [{
|
|
929
|
+
type: Input,
|
|
930
|
+
args: [{ alias: 'gaTooltipDisabled', transform: booleanAttribute }]
|
|
931
|
+
}], controlMode: [{
|
|
932
|
+
type: Input,
|
|
933
|
+
args: [{ alias: 'gaTooltipControlMode' }]
|
|
934
|
+
}], showControlMode: [{
|
|
935
|
+
type: Input,
|
|
936
|
+
args: [{ alias: 'gaTooltipShowControlMode' }]
|
|
937
|
+
}], hideControlMode: [{
|
|
938
|
+
type: Input,
|
|
939
|
+
args: [{ alias: 'gaTooltipHideControlMode' }]
|
|
940
|
+
}], offset: [{
|
|
941
|
+
type: Input,
|
|
942
|
+
args: [{ alias: 'gaTooltipOffsetSize', transform: numberAttribute }]
|
|
943
|
+
}], placement: [{
|
|
944
|
+
type: Input,
|
|
945
|
+
args: [{ alias: 'gaTooltipPlacement' }]
|
|
946
|
+
}], handleMouseClick: [{
|
|
947
|
+
type: HostListener,
|
|
948
|
+
args: ['click']
|
|
949
|
+
}], handleMouseEnter: [{
|
|
950
|
+
type: HostListener,
|
|
951
|
+
args: ['mouseenter']
|
|
952
|
+
}], handleMouseLeave: [{
|
|
953
|
+
type: HostListener,
|
|
954
|
+
args: ['mouseleave']
|
|
955
|
+
}] } });
|
|
956
|
+
|
|
957
|
+
class GaTooltipModule {
|
|
958
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: GaTooltipModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
959
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.1", ngImport: i0, type: GaTooltipModule, imports: [GaTooltipDirective], exports: [GaTooltipDirective] });
|
|
960
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: GaTooltipModule });
|
|
961
|
+
}
|
|
962
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.1", ngImport: i0, type: GaTooltipModule, decorators: [{
|
|
963
|
+
type: NgModule,
|
|
964
|
+
args: [{
|
|
965
|
+
imports: [GaTooltipDirective],
|
|
966
|
+
exports: [GaTooltipDirective],
|
|
967
|
+
}]
|
|
968
|
+
}] });
|
|
969
|
+
|
|
970
|
+
/*
|
|
971
|
+
* Public API Surface of ngx-gaia
|
|
972
|
+
*/
|
|
973
|
+
|
|
974
|
+
/**
|
|
975
|
+
* Generated bundle index. Do not edit.
|
|
976
|
+
*/
|
|
977
|
+
|
|
978
|
+
export { CHECKBOX_CONTROL_VALUE_ACCESSOR, GA_CHECKBOX_REQUIRED_VALIDATOR, GA_FORM_CONTROL, GaButtonDirective, GaButtonModule, GaCheckboxComponent, GaCheckboxModule, GaCheckboxRequiredValidator, GaFieldInfoComponent, GaFieldLabelComponent, GaFormControlDirective, GaFormFieldComponent, GaFormFieldModule, GaIconButtonDirective, GaInputComponent, GaInputDirective, GaInputModule, GaMenuComponent, GaMenuItemComponent, GaMenuModule, GaMenuSeparatorComponent, GaMenuTriggerDirective, GaSegmentedControlButtonDirective, GaSegmentedControlComponent, GaSegmentedControlModule, GaTooltipComponent, GaTooltipDirective, GaTooltipModule };
|
|
979
|
+
//# sourceMappingURL=vsn-ux-ngx-gaia.mjs.map
|