@testgorilla/tgo-ui 4.1.3-beta → 4.1.3
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/components/accordion/accordion.component.d.ts +2 -2
- package/components/accordion/accordion.component.module.d.ts +2 -2
- package/components/ai-feedback/ai-feedback.module.d.ts +2 -2
- package/components/alert-banner/alert-banner.component.d.ts +2 -2
- package/components/alert-banner/alert-banner.component.module.d.ts +3 -3
- package/components/autocomplete/autocomplete.component.d.ts +2 -2
- package/components/autocomplete/autocomplete.component.module.d.ts +10 -9
- package/components/avatar/avatar.component.d.ts +2 -2
- package/components/avatar/avatar.component.module.d.ts +4 -4
- package/components/avatar/avatar.model.d.ts +2 -2
- package/components/badge/badge.component.d.ts +2 -2
- package/components/badge/badge.component.module.d.ts +1 -1
- package/components/breadcrumb/breadcrumb.component.d.ts +5 -3
- package/components/breadcrumb/breadcrumb.component.module.d.ts +4 -4
- package/components/button/button.component.d.ts +2 -2
- package/components/button/button.component.module.d.ts +5 -4
- package/components/button/button.model.d.ts +1 -1
- package/components/card/card.component.d.ts +2 -2
- package/components/card/card.component.module.d.ts +1 -1
- package/components/card/card.model.d.ts +1 -1
- package/components/checkbox/checkbox.component.d.ts +2 -2
- package/components/checkbox/checkbox.component.module.d.ts +8 -6
- package/components/checklist/checklist.component.d.ts +2 -2
- package/components/confirm-dialog/confirm-dialog.component.d.ts +4 -4
- package/components/confirm-dialog/confirm-dialog.component.module.d.ts +2 -2
- package/components/confirm-dialog/confirm-dialog.model.d.ts +3 -3
- package/components/datepicker/datepicker.component.d.ts +1 -1
- package/components/datepicker/datepicker.component.module.d.ts +3 -3
- package/components/dialog/dialog.component.d.ts +4 -4
- package/components/dialog/dialog.component.module.d.ts +2 -2
- package/components/dialog/dialog.model.d.ts +1 -1
- package/components/dialog/dialog.service.d.ts +1 -1
- package/components/divider/divider.component.d.ts +1 -1
- package/components/donut-chart/donut-chart.component.d.ts +5 -17
- package/components/dropdown/dropdown.component.d.ts +2 -2
- package/components/dropdown/dropdown.component.module.d.ts +6 -5
- package/components/elevation-shadow/elevation-shadow.component.d.ts +1 -1
- package/components/empty-state/empty-state.component.d.ts +3 -3
- package/components/empty-state/empty-state.component.module.d.ts +3 -3
- package/components/field/field.component.d.ts +4 -4
- package/components/field/field.component.module.d.ts +8 -6
- package/components/file-upload/file-upload.component.d.ts +1 -1
- package/components/file-upload/file-upload.component.module.d.ts +3 -3
- package/components/filter-button/filter-button.component.d.ts +3 -3
- package/components/filter-button/filter-button.component.module.d.ts +8 -7
- package/components/filter-button/filter-button.model.d.ts +1 -1
- package/components/gaussian-chart/gaussian-chart.component.d.ts +1 -1
- package/components/gaussian-chart/gaussian-chart.module.d.ts +2 -2
- package/components/icon/icon.component.d.ts +2 -2
- package/components/icon-label/icon-label.component.d.ts +2 -2
- package/components/icon-label/icon-label.component.module.d.ts +1 -1
- package/components/inline-field/inline-field.component.d.ts +3 -3
- package/components/inline-field/inline-field.component.module.d.ts +3 -3
- package/components/inline-field/inline-field.model.d.ts +1 -1
- package/components/logo/logo.component.d.ts +1 -1
- package/components/multi-input/multi-input.component.module.d.ts +8 -7
- package/components/navbar/mobile-navbar-side-sheet/mobile-navbar-side-sheet.component.d.ts +2 -2
- package/components/navbar/navbar.component.d.ts +3 -3
- package/components/navbar/navbar.component.module.d.ts +6 -6
- package/components/navbar/navbar.model.d.ts +2 -2
- package/components/overflow-menu/overflow-menu.component.d.ts +3 -3
- package/components/overflow-menu/overflow-menu.component.module.d.ts +5 -4
- package/components/overflow-menu/overflow-menu.model.d.ts +1 -1
- package/components/page-header/page-header.component.d.ts +1 -1
- package/components/page-header/page-header.component.module.d.ts +2 -2
- package/components/paginator/paginator.component.d.ts +1 -1
- package/components/password-criteria/password.component.module.d.ts +4 -4
- package/components/password-strength/password-strength.component.d.ts +2 -2
- package/components/password-strength/password-strength.component.module.d.ts +3 -3
- package/components/phone-input/phone-input.component.d.ts +1 -1
- package/components/phone-input/phone-input.component.module.d.ts +4 -4
- package/components/progress-bar/progress-bar.component.d.ts +1 -1
- package/components/progress-bar/progress-bar.component.module.d.ts +1 -1
- package/components/prompt/prompt.component.d.ts +1 -1
- package/components/prompt/prompt.module.d.ts +7 -7
- package/components/radial-progress/radial-progress.component.d.ts +2 -2
- package/components/radial-progress/radial-progress.component.module.d.ts +1 -1
- package/components/radio-button/radio-button.component.d.ts +2 -2
- package/components/radio-button/radio-button.component.module.d.ts +2 -2
- package/components/rating/rating.component.d.ts +1 -1
- package/components/scale/scale.component.d.ts +1 -1
- package/components/scale-table/scale-table.component.d.ts +1 -1
- package/components/segmented-bar/segmented-bar.component.d.ts +1 -1
- package/components/segmented-bar/segmented-bar.component.module.d.ts +2 -2
- package/components/segmented-bar/segmented-bar.model.d.ts +1 -1
- package/components/segmented-button/segmented-button.component.d.ts +1 -1
- package/components/selectable-card/selectable-card.component.d.ts +6 -2
- package/components/selectable-card/selectable-card.component.module.d.ts +2 -2
- package/components/side-panel/side-panel.component.d.ts +1 -1
- package/components/side-sheet/side-sheet.component.d.ts +1 -1
- package/components/side-sheet/side-sheet.component.module.d.ts +4 -4
- package/components/skeleton/skeleton.component.d.ts +2 -2
- package/components/slider/slider.component.d.ts +1 -1
- package/components/snackbar/snackbar.component.d.ts +2 -2
- package/components/snackbar/snackbar.component.module.d.ts +3 -3
- package/components/snackbar/snackbar.service.d.ts +1 -1
- package/components/spider-chart/spider-chart.component.d.ts +1 -1
- package/components/spider-chart/spider-chart.module.d.ts +2 -2
- package/components/spinner/spinner.component.d.ts +2 -2
- package/components/spinner/spinner.module.d.ts +2 -2
- package/components/step/step.component.d.ts +3 -3
- package/components/step/step.component.module.d.ts +2 -2
- package/components/stepper/stepper.component.d.ts +1 -1
- package/components/stepper/stepper.component.module.d.ts +3 -3
- package/components/stepper/stepper.model.d.ts +1 -1
- package/components/table/table.component.d.ts +1 -1
- package/components/table/table.component.module.d.ts +5 -5
- package/components/tabs/tab.directive.d.ts +1 -1
- package/components/tabs/tabs.component.d.ts +1 -1
- package/components/tabs/tabs.component.module.d.ts +3 -3
- package/components/tabs/tabs.model.d.ts +1 -1
- package/components/tag/tag.component.d.ts +2 -2
- package/components/tag/tag.component.module.d.ts +3 -3
- package/components/toggle/toggle.component.d.ts +1 -1
- package/components/toggle/toggle.component.module.d.ts +5 -4
- package/components/tooltip/tooltip.component.d.ts +1 -1
- package/components/tooltip/tooltip.component.module.d.ts +3 -2
- package/components/universal-skills-report/universal-skills-report.component.d.ts +2 -2
- package/components/universal-skills-report/universal-skills-report.component.module.d.ts +3 -3
- package/components/universal-skills-spider-charts/universal-skills-spider-charts.component.d.ts +2 -2
- package/components/universal-skills-spider-charts/universal-skills-spider-charts.component.module.d.ts +4 -4
- package/components/validation-error/validation-error.component.d.ts +1 -1
- package/components/validation-error/validation-error.module.d.ts +2 -2
- package/fesm2022/testgorilla-tgo-ui.mjs +22749 -3564
- package/fesm2022/testgorilla-tgo-ui.mjs.map +1 -1
- package/models/application-theme.model.d.ts +1 -0
- package/package.json +9 -142
- package/{components/core → pipes}/ui-translate.pipe.d.ts +1 -1
- package/projects/tgo-canopy-ui/assets/i18n/da-dk.json +820 -0
- package/projects/tgo-canopy-ui/assets/i18n/de.json +820 -0
- package/projects/tgo-canopy-ui/assets/i18n/en.json +829 -0
- package/projects/tgo-canopy-ui/assets/i18n/es.json +820 -0
- package/projects/tgo-canopy-ui/assets/i18n/fr.json +820 -0
- package/projects/tgo-canopy-ui/assets/i18n/it-it.json +820 -0
- package/projects/tgo-canopy-ui/assets/i18n/ja-jp.json +820 -0
- package/projects/tgo-canopy-ui/assets/i18n/nb-no.json +820 -0
- package/projects/tgo-canopy-ui/assets/i18n/nl.json +820 -0
- package/projects/tgo-canopy-ui/assets/i18n/pl-pl.json +820 -0
- package/projects/tgo-canopy-ui/assets/i18n/pt-br.json +820 -0
- package/projects/tgo-canopy-ui/assets/i18n/sv-se.json +820 -0
- package/public-api.d.ts +87 -0
- package/utils/alert-bars.utils.d.ts +1 -1
- package/components/autocomplete/index.d.ts +0 -5
- package/components/autocomplete/public-api.d.ts +0 -4
- package/components/avatar/index.d.ts +0 -5
- package/components/avatar/public-api.d.ts +0 -4
- package/components/badge/index.d.ts +0 -5
- package/components/badge/public-api.d.ts +0 -4
- package/components/button/color-contrast.d.ts +0 -28
- package/components/button/index.d.ts +0 -5
- package/components/button/public-api.d.ts +0 -5
- package/components/card/index.d.ts +0 -5
- package/components/card/public-api.d.ts +0 -4
- package/components/checkbox/index.d.ts +0 -5
- package/components/checkbox/public-api.d.ts +0 -4
- package/components/core/application-theme.model.d.ts +0 -7
- package/components/core/has-validation-error.pipe.d.ts +0 -15
- package/components/core/index.d.ts +0 -5
- package/components/core/keyboard-events.model.d.ts +0 -11
- package/components/core/public-api.d.ts +0 -12
- package/components/core/select-text.directive.d.ts +0 -19
- package/components/divider/index.d.ts +0 -5
- package/components/divider/public-api.d.ts +0 -4
- package/components/dropdown/index.d.ts +0 -5
- package/components/dropdown/public-api.d.ts +0 -4
- package/components/elevation-shadow/index.d.ts +0 -5
- package/components/elevation-shadow/public-api.d.ts +0 -3
- package/components/empty-state/index.d.ts +0 -5
- package/components/empty-state/public-api.d.ts +0 -4
- package/components/field/index.d.ts +0 -5
- package/components/field/public-api.d.ts +0 -4
- package/components/filter-button/index.d.ts +0 -5
- package/components/filter-button/public-api.d.ts +0 -4
- package/components/icon/index.d.ts +0 -5
- package/components/icon/public-api.d.ts +0 -5
- package/components/inline-field/index.d.ts +0 -5
- package/components/inline-field/public-api.d.ts +0 -4
- package/components/logo/index.d.ts +0 -5
- package/components/logo/public-api.d.ts +0 -4
- package/components/paginator/index.d.ts +0 -5
- package/components/paginator/public-api.d.ts +0 -3
- package/components/progress-bar/index.d.ts +0 -5
- package/components/progress-bar/public-api.d.ts +0 -3
- package/components/radial-progress/index.d.ts +0 -5
- package/components/radial-progress/public-api.d.ts +0 -4
- package/components/radio-button/index.d.ts +0 -5
- package/components/radio-button/public-api.d.ts +0 -4
- package/components/rating/index.d.ts +0 -5
- package/components/rating/public-api.d.ts +0 -3
- package/components/scale/index.d.ts +0 -5
- package/components/scale/public-api.d.ts +0 -3
- package/components/segmented-bar/index.d.ts +0 -5
- package/components/segmented-bar/public-api.d.ts +0 -4
- package/components/segmented-button/index.d.ts +0 -5
- package/components/segmented-button/public-api.d.ts +0 -4
- package/components/skeleton/index.d.ts +0 -5
- package/components/skeleton/public-api.d.ts +0 -3
- package/components/slider/index.d.ts +0 -5
- package/components/slider/public-api.d.ts +0 -4
- package/components/spinner/index.d.ts +0 -5
- package/components/spinner/public-api.d.ts +0 -4
- package/components/tag/index.d.ts +0 -5
- package/components/tag/public-api.d.ts +0 -4
- package/components/toggle/index.d.ts +0 -5
- package/components/toggle/public-api.d.ts +0 -3
- package/components/tooltip/index.d.ts +0 -5
- package/components/tooltip/public-api.d.ts +0 -5
- package/components/validation-error/index.d.ts +0 -5
- package/components/validation-error/public-api.d.ts +0 -3
- package/fesm2022/testgorilla-tgo-ui-components-autocomplete.mjs +0 -1045
- package/fesm2022/testgorilla-tgo-ui-components-autocomplete.mjs.map +0 -1
- package/fesm2022/testgorilla-tgo-ui-components-avatar.mjs +0 -173
- package/fesm2022/testgorilla-tgo-ui-components-avatar.mjs.map +0 -1
- package/fesm2022/testgorilla-tgo-ui-components-badge.mjs +0 -180
- package/fesm2022/testgorilla-tgo-ui-components-badge.mjs.map +0 -1
- package/fesm2022/testgorilla-tgo-ui-components-button.mjs +0 -635
- package/fesm2022/testgorilla-tgo-ui-components-button.mjs.map +0 -1
- package/fesm2022/testgorilla-tgo-ui-components-card.mjs +0 -164
- package/fesm2022/testgorilla-tgo-ui-components-card.mjs.map +0 -1
- package/fesm2022/testgorilla-tgo-ui-components-checkbox.mjs +0 -402
- package/fesm2022/testgorilla-tgo-ui-components-checkbox.mjs.map +0 -1
- package/fesm2022/testgorilla-tgo-ui-components-core.mjs +0 -10807
- package/fesm2022/testgorilla-tgo-ui-components-core.mjs.map +0 -1
- package/fesm2022/testgorilla-tgo-ui-components-divider.mjs +0 -88
- package/fesm2022/testgorilla-tgo-ui-components-divider.mjs.map +0 -1
- package/fesm2022/testgorilla-tgo-ui-components-dropdown.mjs +0 -434
- package/fesm2022/testgorilla-tgo-ui-components-dropdown.mjs.map +0 -1
- package/fesm2022/testgorilla-tgo-ui-components-elevation-shadow.mjs +0 -75
- package/fesm2022/testgorilla-tgo-ui-components-elevation-shadow.mjs.map +0 -1
- package/fesm2022/testgorilla-tgo-ui-components-empty-state.mjs +0 -326
- package/fesm2022/testgorilla-tgo-ui-components-empty-state.mjs.map +0 -1
- package/fesm2022/testgorilla-tgo-ui-components-field.mjs +0 -638
- package/fesm2022/testgorilla-tgo-ui-components-field.mjs.map +0 -1
- package/fesm2022/testgorilla-tgo-ui-components-filter-button.mjs +0 -314
- package/fesm2022/testgorilla-tgo-ui-components-filter-button.mjs.map +0 -1
- package/fesm2022/testgorilla-tgo-ui-components-icon.mjs +0 -1496
- package/fesm2022/testgorilla-tgo-ui-components-icon.mjs.map +0 -1
- package/fesm2022/testgorilla-tgo-ui-components-inline-field.mjs +0 -367
- package/fesm2022/testgorilla-tgo-ui-components-inline-field.mjs.map +0 -1
- package/fesm2022/testgorilla-tgo-ui-components-logo.mjs +0 -218
- package/fesm2022/testgorilla-tgo-ui-components-logo.mjs.map +0 -1
- package/fesm2022/testgorilla-tgo-ui-components-paginator.mjs +0 -110
- package/fesm2022/testgorilla-tgo-ui-components-paginator.mjs.map +0 -1
- package/fesm2022/testgorilla-tgo-ui-components-progress-bar.mjs +0 -128
- package/fesm2022/testgorilla-tgo-ui-components-progress-bar.mjs.map +0 -1
- package/fesm2022/testgorilla-tgo-ui-components-radial-progress.mjs +0 -152
- package/fesm2022/testgorilla-tgo-ui-components-radial-progress.mjs.map +0 -1
- package/fesm2022/testgorilla-tgo-ui-components-radio-button.mjs +0 -373
- package/fesm2022/testgorilla-tgo-ui-components-radio-button.mjs.map +0 -1
- package/fesm2022/testgorilla-tgo-ui-components-rating.mjs +0 -150
- package/fesm2022/testgorilla-tgo-ui-components-rating.mjs.map +0 -1
- package/fesm2022/testgorilla-tgo-ui-components-scale.mjs +0 -158
- package/fesm2022/testgorilla-tgo-ui-components-scale.mjs.map +0 -1
- package/fesm2022/testgorilla-tgo-ui-components-segmented-bar.mjs +0 -137
- package/fesm2022/testgorilla-tgo-ui-components-segmented-bar.mjs.map +0 -1
- package/fesm2022/testgorilla-tgo-ui-components-segmented-button.mjs +0 -128
- package/fesm2022/testgorilla-tgo-ui-components-segmented-button.mjs.map +0 -1
- package/fesm2022/testgorilla-tgo-ui-components-skeleton.mjs +0 -81
- package/fesm2022/testgorilla-tgo-ui-components-skeleton.mjs.map +0 -1
- package/fesm2022/testgorilla-tgo-ui-components-slider.mjs +0 -274
- package/fesm2022/testgorilla-tgo-ui-components-slider.mjs.map +0 -1
- package/fesm2022/testgorilla-tgo-ui-components-spinner.mjs +0 -108
- package/fesm2022/testgorilla-tgo-ui-components-spinner.mjs.map +0 -1
- package/fesm2022/testgorilla-tgo-ui-components-tag.mjs +0 -239
- package/fesm2022/testgorilla-tgo-ui-components-tag.mjs.map +0 -1
- package/fesm2022/testgorilla-tgo-ui-components-toggle.mjs +0 -216
- package/fesm2022/testgorilla-tgo-ui-components-toggle.mjs.map +0 -1
- package/fesm2022/testgorilla-tgo-ui-components-tooltip.mjs +0 -272
- package/fesm2022/testgorilla-tgo-ui-components-tooltip.mjs.map +0 -1
- package/fesm2022/testgorilla-tgo-ui-components-validation-error.mjs +0 -79
- package/fesm2022/testgorilla-tgo-ui-components-validation-error.mjs.map +0 -1
- /package/{components/core → directives}/digits-only.directive.d.ts +0 -0
- /package/{components/core → directives}/ellipse-text.directive.d.ts +0 -0
- /package/{components/autocomplete → directives}/select-text.directive.d.ts +0 -0
- /package/{components/core → models}/checkbox.model.d.ts +0 -0
- /package/{components/avatar → pipes}/name-initials.pipe.d.ts +0 -0
- /package/{components/icon → services}/icons.service.d.ts +0 -0
- /package/{components/core → utils}/autocomplete-utils.d.ts +0 -0
- /package/{components/core → utils}/hex-to-rgb.d.ts +0 -0
- /package/{components/core → utils/localization}/language.model.d.ts +0 -0
- /package/{components/core → utils/localization}/language.service.d.ts +0 -0
|
@@ -1,272 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { HostListener, Input, Inject, Directive, booleanAttribute, Optional, ChangeDetectionStrategy, Component, NgModule } from '@angular/core';
|
|
3
|
-
import * as i1$1 from '@angular/material/tooltip';
|
|
4
|
-
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
5
|
-
import * as i2$1 from '@angular/common';
|
|
6
|
-
import { CommonModule } from '@angular/common';
|
|
7
|
-
import { ComponentPortal } from '@angular/cdk/portal';
|
|
8
|
-
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
9
|
-
import * as i1 from '@angular/cdk/overlay';
|
|
10
|
-
import * as i2 from '@angular/cdk/a11y';
|
|
11
|
-
import * as i4 from '@testgorilla/tgo-ui/components/core';
|
|
12
|
-
import { EllipseTextDirective, UiTranslatePipe } from '@testgorilla/tgo-ui/components/core';
|
|
13
|
-
|
|
14
|
-
var TooltipPositionType;
|
|
15
|
-
(function (TooltipPositionType) {
|
|
16
|
-
TooltipPositionType["TOP"] = "top";
|
|
17
|
-
TooltipPositionType["BOTTOM"] = "bottom";
|
|
18
|
-
TooltipPositionType["LEFT"] = "left";
|
|
19
|
-
TooltipPositionType["RIGHT"] = "right";
|
|
20
|
-
})(TooltipPositionType || (TooltipPositionType = {}));
|
|
21
|
-
|
|
22
|
-
class TooltipTemplateDirective {
|
|
23
|
-
constructor(_overlay, _overlayPositionBuilder, _elementRef, focusMonitor, ngZone, injector, tooltipComponentToken) {
|
|
24
|
-
this._overlay = _overlay;
|
|
25
|
-
this._overlayPositionBuilder = _overlayPositionBuilder;
|
|
26
|
-
this._elementRef = _elementRef;
|
|
27
|
-
this.focusMonitor = focusMonitor;
|
|
28
|
-
this.ngZone = ngZone;
|
|
29
|
-
this.injector = injector;
|
|
30
|
-
this.tooltipComponentToken = tooltipComponentToken;
|
|
31
|
-
this.tooltipPosition = TooltipPositionType.RIGHT;
|
|
32
|
-
this.showTooltip = true;
|
|
33
|
-
if (this._elementRef.nativeElement) {
|
|
34
|
-
this.focusMonitor.monitor(this._elementRef.nativeElement).pipe(takeUntilDestroyed()).subscribe(origin => this.ngZone.run(() => {
|
|
35
|
-
if (origin === 'keyboard') {
|
|
36
|
-
this.show();
|
|
37
|
-
}
|
|
38
|
-
else {
|
|
39
|
-
this.hide();
|
|
40
|
-
}
|
|
41
|
-
}));
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
ngOnChanges() {
|
|
45
|
-
this.setPosition(this.tooltipPosition);
|
|
46
|
-
}
|
|
47
|
-
show() {
|
|
48
|
-
if (!this.showTooltip) {
|
|
49
|
-
return;
|
|
50
|
-
}
|
|
51
|
-
if (this._overlayRef && !this._overlayRef.hasAttached()) {
|
|
52
|
-
const tooltipRef = this._overlayRef.attach(new ComponentPortal(this.tooltipComponentToken, null, this.injector));
|
|
53
|
-
tooltipRef.instance.templateRef = this.templateRef;
|
|
54
|
-
tooltipRef.instance.position = this.tooltipPosition;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
hide() {
|
|
58
|
-
this.closeToolTip();
|
|
59
|
-
}
|
|
60
|
-
ngOnDestroy() {
|
|
61
|
-
this.closeToolTip();
|
|
62
|
-
}
|
|
63
|
-
closeToolTip() {
|
|
64
|
-
if (this._overlayRef) {
|
|
65
|
-
this._overlayRef.detach();
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
setPosition(position) {
|
|
69
|
-
const positions = {
|
|
70
|
-
[TooltipPositionType.TOP]: {
|
|
71
|
-
originX: 'center',
|
|
72
|
-
originY: 'top',
|
|
73
|
-
overlayX: 'center',
|
|
74
|
-
overlayY: 'bottom',
|
|
75
|
-
offsetX: 0,
|
|
76
|
-
offsetY: -8,
|
|
77
|
-
panelClass: TooltipPositionType.TOP
|
|
78
|
-
},
|
|
79
|
-
[TooltipPositionType.BOTTOM]: {
|
|
80
|
-
originX: 'center',
|
|
81
|
-
originY: 'bottom',
|
|
82
|
-
overlayX: 'center',
|
|
83
|
-
overlayY: 'top',
|
|
84
|
-
offsetX: 0,
|
|
85
|
-
offsetY: 8,
|
|
86
|
-
panelClass: TooltipPositionType.BOTTOM
|
|
87
|
-
},
|
|
88
|
-
[TooltipPositionType.LEFT]: {
|
|
89
|
-
originX: 'start',
|
|
90
|
-
originY: 'center',
|
|
91
|
-
overlayX: 'end',
|
|
92
|
-
overlayY: 'center',
|
|
93
|
-
offsetX: -8,
|
|
94
|
-
offsetY: 0,
|
|
95
|
-
panelClass: TooltipPositionType.LEFT
|
|
96
|
-
},
|
|
97
|
-
[TooltipPositionType.RIGHT]: {
|
|
98
|
-
originX: 'end',
|
|
99
|
-
originY: 'center',
|
|
100
|
-
overlayX: 'start',
|
|
101
|
-
overlayY: 'center',
|
|
102
|
-
offsetX: 8,
|
|
103
|
-
offsetY: 0,
|
|
104
|
-
panelClass: TooltipPositionType.RIGHT
|
|
105
|
-
}
|
|
106
|
-
};
|
|
107
|
-
const fallbackPositions = {
|
|
108
|
-
[TooltipPositionType.TOP]: positions[TooltipPositionType.BOTTOM],
|
|
109
|
-
[TooltipPositionType.BOTTOM]: positions[TooltipPositionType.TOP],
|
|
110
|
-
[TooltipPositionType.LEFT]: positions[TooltipPositionType.RIGHT],
|
|
111
|
-
[TooltipPositionType.RIGHT]: positions[TooltipPositionType.BOTTOM]
|
|
112
|
-
};
|
|
113
|
-
const positionConfig = positions[position];
|
|
114
|
-
const fallbackPositionConfig = fallbackPositions[position];
|
|
115
|
-
const positionStrategy = this._overlayPositionBuilder
|
|
116
|
-
.flexibleConnectedTo(this._elementRef)
|
|
117
|
-
.withPositions([positionConfig, fallbackPositionConfig])
|
|
118
|
-
.withPush(true);
|
|
119
|
-
this._overlayRef = this._overlay.create({ positionStrategy });
|
|
120
|
-
}
|
|
121
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TooltipTemplateDirective, deps: [{ token: i1.Overlay }, { token: i1.OverlayPositionBuilder }, { token: i0.ElementRef }, { token: i2.FocusMonitor }, { token: i0.NgZone }, { token: i0.Injector }, { token: 'TooltipComponentToken' }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
122
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.17", type: TooltipTemplateDirective, isStandalone: true, selector: "[uiTooltipTemplate]", inputs: { tooltipPosition: "tooltipPosition", showTooltip: "showTooltip", templateRef: ["uiTooltipTemplate", "templateRef"] }, host: { listeners: { "mouseenter": "show()", "mouseleave": "hide()" } }, usesOnChanges: true, ngImport: i0 }); }
|
|
123
|
-
}
|
|
124
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TooltipTemplateDirective, decorators: [{
|
|
125
|
-
type: Directive,
|
|
126
|
-
args: [{
|
|
127
|
-
selector: '[uiTooltipTemplate]',
|
|
128
|
-
standalone: true,
|
|
129
|
-
}]
|
|
130
|
-
}], ctorParameters: () => [{ type: i1.Overlay }, { type: i1.OverlayPositionBuilder }, { type: i0.ElementRef }, { type: i2.FocusMonitor }, { type: i0.NgZone }, { type: i0.Injector }, { type: undefined, decorators: [{
|
|
131
|
-
type: Inject,
|
|
132
|
-
args: ['TooltipComponentToken']
|
|
133
|
-
}] }], propDecorators: { tooltipPosition: [{
|
|
134
|
-
type: Input
|
|
135
|
-
}], showTooltip: [{
|
|
136
|
-
type: Input
|
|
137
|
-
}], templateRef: [{
|
|
138
|
-
type: Input,
|
|
139
|
-
args: ['uiTooltipTemplate']
|
|
140
|
-
}], show: [{
|
|
141
|
-
type: HostListener,
|
|
142
|
-
args: ['mouseenter']
|
|
143
|
-
}], hide: [{
|
|
144
|
-
type: HostListener,
|
|
145
|
-
args: ['mouseleave']
|
|
146
|
-
}] } });
|
|
147
|
-
|
|
148
|
-
class TooltipComponent {
|
|
149
|
-
constructor(defaultAppTheme) {
|
|
150
|
-
this.defaultAppTheme = defaultAppTheme;
|
|
151
|
-
/**
|
|
152
|
-
* Allows the user to define the position of the tooltip relative to the parent element.
|
|
153
|
-
*
|
|
154
|
-
* @type {TooltipPositionType}
|
|
155
|
-
* @memberof TooltipComponent
|
|
156
|
-
*/
|
|
157
|
-
this.position = TooltipPositionType.TOP;
|
|
158
|
-
/**
|
|
159
|
-
* Disables the display of the tooltip.
|
|
160
|
-
*
|
|
161
|
-
* @type {boolean}
|
|
162
|
-
* @memberof TooltipComponent
|
|
163
|
-
*/
|
|
164
|
-
this.disabled = false;
|
|
165
|
-
/**
|
|
166
|
-
* The message to be displayed in the tooltip.
|
|
167
|
-
*
|
|
168
|
-
* @type {string}
|
|
169
|
-
* @memberof TooltipComponent
|
|
170
|
-
*/
|
|
171
|
-
this.message = '';
|
|
172
|
-
/**
|
|
173
|
-
*
|
|
174
|
-
* Defines the application theme
|
|
175
|
-
*
|
|
176
|
-
* @type {ApplicationTheme}
|
|
177
|
-
* @memberof TooltipComponent
|
|
178
|
-
*/
|
|
179
|
-
this.applicationTheme = 'light';
|
|
180
|
-
/**
|
|
181
|
-
* The label for definition variant
|
|
182
|
-
* @type {string}
|
|
183
|
-
* @memberof TooltipComponent
|
|
184
|
-
*/
|
|
185
|
-
this.labelForDefinition = '';
|
|
186
|
-
/**
|
|
187
|
-
* Defines size for definition variant
|
|
188
|
-
* @type {string}
|
|
189
|
-
* @memberof TooltipComponent
|
|
190
|
-
*/
|
|
191
|
-
this.definitionTooltipSize = 'medium';
|
|
192
|
-
/**
|
|
193
|
-
* Variant render tooltip
|
|
194
|
-
* @type {string}
|
|
195
|
-
* @memberof TooltipComponent
|
|
196
|
-
*/
|
|
197
|
-
this.variant = 'basic';
|
|
198
|
-
this.isLabelEllipse = false;
|
|
199
|
-
if (defaultAppTheme) {
|
|
200
|
-
this.applicationTheme = defaultAppTheme;
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
ngOnInit() {
|
|
204
|
-
this.setPosition();
|
|
205
|
-
}
|
|
206
|
-
//set position
|
|
207
|
-
setPosition() {
|
|
208
|
-
switch (this.position) {
|
|
209
|
-
case TooltipPositionType.TOP:
|
|
210
|
-
this.matPosition = 'above';
|
|
211
|
-
break;
|
|
212
|
-
case TooltipPositionType.BOTTOM:
|
|
213
|
-
this.matPosition = 'below';
|
|
214
|
-
break;
|
|
215
|
-
default:
|
|
216
|
-
this.matPosition = this.position;
|
|
217
|
-
break;
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TooltipComponent, deps: [{ token: 'CANOPYUI_DEFAULT_APPLICATION_THEME', optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
221
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.17", type: TooltipComponent, isStandalone: false, selector: "ui-tooltip", inputs: { position: "position", disabled: ["disabled", "disabled", booleanAttribute], message: "message", applicationTheme: "applicationTheme", labelForDefinition: "labelForDefinition", definitionTooltipSize: "definitionTooltipSize", variant: "variant" }, ngImport: i0, template: "@if (variant === 'definition') {\n <div\n [tabindex]=\"0\"\n class=\"definition-tooltip\"\n [attr.aria-label]=\"labelForDefinition + ', ' + ('TOOLTIP.DETAILS' | uiTranslate | async) + ':' + message\"\n style=\"position: relative;\"\n [tooltipPosition]=\"position\"\n [uiTooltipTemplate]=\"dif\"\n >\n <span\n class=\"label-definition-outside\"\n [ngClass]=\"'tooltip-size-' + definitionTooltipSize\"\n uiEllipseText\n (onChangeTextState)=\"isLabelEllipse = $event\"\n >\n {{ labelForDefinition }}\n </span>\n </div>\n\n <ng-template #dif>\n <div [attr.aria-label]=\"labelForDefinition + ' ' + message\"></div>\n <div class=\"label-definition-inner\" *ngIf=\"isLabelEllipse\">\n {{ labelForDefinition }}\n </div>\n <div class=\"text-definition\">\n {{ message }}\n </div>\n </ng-template>\n\n} @else {\n <div\n [matTooltip]=\"message\"\n [matTooltipDisabled]=\"disabled\"\n [matTooltipPosition]=\"matPosition\"\n [matTooltipClass]=\"applicationTheme\"\n [attr.aria-label]=\"message\"\n tabindex=\"0\"\n style=\"position: relative;\"\n >\n <div\n style=\"position: absolute; left: -9999px\"\n [attr.aria-live]=\"'polite'\"\n >{{ message }}\n </div>\n <ng-content></ng-content>\n @if (templateRef) {\n <div [class]=\"'template-tooltip'\">\n <ng-container *ngTemplateOutlet=\"templateRef\"></ng-container>\n </div>\n }\n </div>\n}\n", dependencies: [{ kind: "directive", type: i1$1.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "directive", type: i2$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: TooltipTemplateDirective, selector: "[uiTooltipTemplate]", inputs: ["tooltipPosition", "showTooltip", "uiTooltipTemplate"] }, { kind: "directive", type: i4.EllipseTextDirective, selector: "[uiEllipseText]", inputs: ["isMultiline", "maxDiffPixels", "refresh"], outputs: ["onChangeTextState"] }, { kind: "pipe", type: i2$1.AsyncPipe, name: "async" }, { kind: "pipe", type: i4.UiTranslatePipe, name: "uiTranslate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
222
|
-
}
|
|
223
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TooltipComponent, decorators: [{
|
|
224
|
-
type: Component,
|
|
225
|
-
args: [{ selector: 'ui-tooltip', changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, template: "@if (variant === 'definition') {\n <div\n [tabindex]=\"0\"\n class=\"definition-tooltip\"\n [attr.aria-label]=\"labelForDefinition + ', ' + ('TOOLTIP.DETAILS' | uiTranslate | async) + ':' + message\"\n style=\"position: relative;\"\n [tooltipPosition]=\"position\"\n [uiTooltipTemplate]=\"dif\"\n >\n <span\n class=\"label-definition-outside\"\n [ngClass]=\"'tooltip-size-' + definitionTooltipSize\"\n uiEllipseText\n (onChangeTextState)=\"isLabelEllipse = $event\"\n >\n {{ labelForDefinition }}\n </span>\n </div>\n\n <ng-template #dif>\n <div [attr.aria-label]=\"labelForDefinition + ' ' + message\"></div>\n <div class=\"label-definition-inner\" *ngIf=\"isLabelEllipse\">\n {{ labelForDefinition }}\n </div>\n <div class=\"text-definition\">\n {{ message }}\n </div>\n </ng-template>\n\n} @else {\n <div\n [matTooltip]=\"message\"\n [matTooltipDisabled]=\"disabled\"\n [matTooltipPosition]=\"matPosition\"\n [matTooltipClass]=\"applicationTheme\"\n [attr.aria-label]=\"message\"\n tabindex=\"0\"\n style=\"position: relative;\"\n >\n <div\n style=\"position: absolute; left: -9999px\"\n [attr.aria-live]=\"'polite'\"\n >{{ message }}\n </div>\n <ng-content></ng-content>\n @if (templateRef) {\n <div [class]=\"'template-tooltip'\">\n <ng-container *ngTemplateOutlet=\"templateRef\"></ng-container>\n </div>\n }\n </div>\n}\n" }]
|
|
226
|
-
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
227
|
-
type: Optional
|
|
228
|
-
}, {
|
|
229
|
-
type: Inject,
|
|
230
|
-
args: ['CANOPYUI_DEFAULT_APPLICATION_THEME']
|
|
231
|
-
}] }], propDecorators: { position: [{
|
|
232
|
-
type: Input
|
|
233
|
-
}], disabled: [{
|
|
234
|
-
type: Input,
|
|
235
|
-
args: [{ transform: booleanAttribute }]
|
|
236
|
-
}], message: [{
|
|
237
|
-
type: Input
|
|
238
|
-
}], applicationTheme: [{
|
|
239
|
-
type: Input
|
|
240
|
-
}], labelForDefinition: [{
|
|
241
|
-
type: Input
|
|
242
|
-
}], definitionTooltipSize: [{
|
|
243
|
-
type: Input
|
|
244
|
-
}], variant: [{
|
|
245
|
-
type: Input
|
|
246
|
-
}] } });
|
|
247
|
-
|
|
248
|
-
class TooltipComponentModule {
|
|
249
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TooltipComponentModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
250
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.17", ngImport: i0, type: TooltipComponentModule, declarations: [TooltipComponent], imports: [MatTooltipModule, CommonModule, TooltipTemplateDirective, EllipseTextDirective, UiTranslatePipe], exports: [TooltipComponent, TooltipTemplateDirective] }); }
|
|
251
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TooltipComponentModule, providers: [
|
|
252
|
-
{ provide: 'TooltipComponentToken', useValue: TooltipComponent }
|
|
253
|
-
], imports: [MatTooltipModule, CommonModule] }); }
|
|
254
|
-
}
|
|
255
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: TooltipComponentModule, decorators: [{
|
|
256
|
-
type: NgModule,
|
|
257
|
-
args: [{
|
|
258
|
-
declarations: [TooltipComponent],
|
|
259
|
-
imports: [MatTooltipModule, CommonModule, TooltipTemplateDirective, EllipseTextDirective, UiTranslatePipe],
|
|
260
|
-
exports: [TooltipComponent, TooltipTemplateDirective],
|
|
261
|
-
providers: [
|
|
262
|
-
{ provide: 'TooltipComponentToken', useValue: TooltipComponent }
|
|
263
|
-
]
|
|
264
|
-
}]
|
|
265
|
-
}] });
|
|
266
|
-
|
|
267
|
-
/**
|
|
268
|
-
* Generated bundle index. Do not edit.
|
|
269
|
-
*/
|
|
270
|
-
|
|
271
|
-
export { TooltipComponent, TooltipComponentModule, TooltipPositionType, TooltipTemplateDirective };
|
|
272
|
-
//# sourceMappingURL=testgorilla-tgo-ui-components-tooltip.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"testgorilla-tgo-ui-components-tooltip.mjs","sources":["../../../components/tooltip/tooltip.model.ts","../../../components/tooltip/tooltip-template.directive.ts","../../../components/tooltip/tooltip.component.ts","../../../components/tooltip/tooltip.component.html","../../../components/tooltip/tooltip.component.module.ts","../../../components/tooltip/testgorilla-tgo-ui-components-tooltip.ts"],"sourcesContent":["export enum TooltipPositionType {\n TOP = 'top',\n BOTTOM = 'bottom',\n LEFT = 'left',\n RIGHT = 'right'\n}\n\nexport type TooltipVariant = 'basic' | 'definition';\nexport type TooltipDefinitionSize = 'small' | 'medium' | 'large';\n","import {\n ComponentRef,\n Directive,\n ElementRef,\n HostListener, Inject, Injector,\n Input,\n NgZone,\n OnChanges,\n OnDestroy,\n TemplateRef\n} from '@angular/core';\nimport {\n ConnectedPosition,\n Overlay,\n OverlayPositionBuilder,\n OverlayRef\n} from '@angular/cdk/overlay';\nimport { ComponentPortal } from '@angular/cdk/portal';\nimport { TooltipPositionType } from './tooltip.model';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { FocusMonitor } from '@angular/cdk/a11y';\n\n@Directive({\n selector: '[uiTooltipTemplate]',\n standalone: true,\n})\nexport class TooltipTemplateDirective implements OnChanges, OnDestroy {\n @Input() tooltipPosition: TooltipPositionType = TooltipPositionType.RIGHT;\n @Input() showTooltip = true;\n @Input('uiTooltipTemplate') templateRef: TemplateRef<any>;\n\n private _overlayRef: OverlayRef;\n\n constructor(\n private _overlay: Overlay,\n private _overlayPositionBuilder: OverlayPositionBuilder,\n private _elementRef: ElementRef,\n private focusMonitor: FocusMonitor,\n private ngZone: NgZone,\n private injector: Injector,\n @Inject('TooltipComponentToken') private tooltipComponentToken: any\n ) {\n if (this._elementRef.nativeElement) {\n this.focusMonitor.monitor(this._elementRef.nativeElement).pipe(\n takeUntilDestroyed()\n ).subscribe(origin =>\n this.ngZone.run(() => {\n if (origin === 'keyboard') {\n this.show();\n } else {\n this.hide();\n }\n }),\n );\n }\n }\n\n ngOnChanges(): void {\n this.setPosition(this.tooltipPosition);\n }\n\n @HostListener('mouseenter')\n show() {\n if (!this.showTooltip) {\n return;\n }\n\n if (this._overlayRef && !this._overlayRef.hasAttached()) {\n const tooltipRef: ComponentRef<any> = this._overlayRef.attach(new ComponentPortal(this.tooltipComponentToken, null, this.injector));\n tooltipRef.instance.templateRef = this.templateRef;\n tooltipRef.instance.position = this.tooltipPosition;\n }\n }\n\n @HostListener('mouseleave')\n hide() {\n this.closeToolTip();\n }\n\n ngOnDestroy() {\n this.closeToolTip();\n }\n\n private closeToolTip() {\n if (this._overlayRef) {\n this._overlayRef.detach();\n }\n }\n\n private setPosition(position: TooltipPositionType) {\n const positions: Record<string, ConnectedPosition> = {\n [TooltipPositionType.TOP]: {\n originX: 'center',\n originY: 'top',\n overlayX: 'center',\n overlayY: 'bottom',\n offsetX: 0,\n offsetY: -8,\n panelClass: TooltipPositionType.TOP\n },\n [TooltipPositionType.BOTTOM]: {\n originX: 'center',\n originY: 'bottom',\n overlayX: 'center',\n overlayY: 'top',\n offsetX: 0,\n offsetY: 8,\n panelClass: TooltipPositionType.BOTTOM\n },\n [TooltipPositionType.LEFT]: {\n originX: 'start',\n originY: 'center',\n overlayX: 'end',\n overlayY: 'center',\n offsetX: -8,\n offsetY: 0,\n panelClass: TooltipPositionType.LEFT\n },\n [TooltipPositionType.RIGHT]: {\n originX: 'end',\n originY: 'center',\n overlayX: 'start',\n overlayY: 'center',\n offsetX: 8,\n offsetY: 0,\n panelClass: TooltipPositionType.RIGHT\n }\n };\n\n const fallbackPositions = {\n [TooltipPositionType.TOP]: positions[TooltipPositionType.BOTTOM],\n [TooltipPositionType.BOTTOM]: positions[TooltipPositionType.TOP],\n [TooltipPositionType.LEFT]: positions[TooltipPositionType.RIGHT],\n [TooltipPositionType.RIGHT]: positions[TooltipPositionType.BOTTOM]\n };\n\n const positionConfig = positions[position];\n\n const fallbackPositionConfig = fallbackPositions[position];\n\n const positionStrategy = this._overlayPositionBuilder\n .flexibleConnectedTo(this._elementRef)\n .withPositions([positionConfig, fallbackPositionConfig])\n .withPush(true);\n\n this._overlayRef = this._overlay.create({ positionStrategy });\n }\n}\n","import {\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n Inject,\n Input,\n OnInit,\n Optional,\n} from '@angular/core';\nimport { TooltipDefinitionSize, TooltipPositionType, TooltipVariant } from './tooltip.model';\nimport { TooltipPosition } from '@angular/material/tooltip';\nimport { ApplicationTheme } from '@testgorilla/tgo-ui/components/core';\n\n@Component({\n selector: 'ui-tooltip',\n templateUrl: './tooltip.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: false\n})\nexport class TooltipComponent implements OnInit {\n /**\n * Allows the user to define the position of the tooltip relative to the parent element.\n *\n * @type {TooltipPositionType}\n * @memberof TooltipComponent\n */\n @Input() position: TooltipPositionType = TooltipPositionType.TOP;\n\n /**\n * Disables the display of the tooltip.\n *\n * @type {boolean}\n * @memberof TooltipComponent\n */\n @Input({ transform: booleanAttribute }) disabled = false;\n\n /**\n * The message to be displayed in the tooltip.\n *\n * @type {string}\n * @memberof TooltipComponent\n */\n @Input() message = '';\n\n /**\n *\n * Defines the application theme\n *\n * @type {ApplicationTheme}\n * @memberof TooltipComponent\n */\n @Input() applicationTheme: ApplicationTheme = 'light';\n\n /**\n * The label for definition variant\n * @type {string}\n * @memberof TooltipComponent\n */\n @Input() labelForDefinition = '';\n\n /**\n * Defines size for definition variant\n * @type {string}\n * @memberof TooltipComponent\n */\n @Input() definitionTooltipSize: TooltipDefinitionSize = 'medium'\n\n /**\n * Variant render tooltip\n * @type {string}\n * @memberof TooltipComponent\n */\n @Input() variant: TooltipVariant = 'basic'\n\n isLabelEllipse = false;\n templateRef: any;\n\n constructor(\n @Optional() @Inject('CANOPYUI_DEFAULT_APPLICATION_THEME') private readonly defaultAppTheme: ApplicationTheme,\n ) {\n if (defaultAppTheme) {\n this.applicationTheme = defaultAppTheme;\n }\n }\n\n matPosition: TooltipPosition;\n\n ngOnInit() {\n this.setPosition();\n }\n\n //set position\n setPosition(): void {\n switch (this.position) {\n case TooltipPositionType.TOP:\n this.matPosition = 'above';\n break;\n case TooltipPositionType.BOTTOM:\n this.matPosition = 'below';\n break;\n default:\n this.matPosition = this.position;\n break;\n }\n }\n}\n","@if (variant === 'definition') {\n <div\n [tabindex]=\"0\"\n class=\"definition-tooltip\"\n [attr.aria-label]=\"labelForDefinition + ', ' + ('TOOLTIP.DETAILS' | uiTranslate | async) + ':' + message\"\n style=\"position: relative;\"\n [tooltipPosition]=\"position\"\n [uiTooltipTemplate]=\"dif\"\n >\n <span\n class=\"label-definition-outside\"\n [ngClass]=\"'tooltip-size-' + definitionTooltipSize\"\n uiEllipseText\n (onChangeTextState)=\"isLabelEllipse = $event\"\n >\n {{ labelForDefinition }}\n </span>\n </div>\n\n <ng-template #dif>\n <div [attr.aria-label]=\"labelForDefinition + ' ' + message\"></div>\n <div class=\"label-definition-inner\" *ngIf=\"isLabelEllipse\">\n {{ labelForDefinition }}\n </div>\n <div class=\"text-definition\">\n {{ message }}\n </div>\n </ng-template>\n\n} @else {\n <div\n [matTooltip]=\"message\"\n [matTooltipDisabled]=\"disabled\"\n [matTooltipPosition]=\"matPosition\"\n [matTooltipClass]=\"applicationTheme\"\n [attr.aria-label]=\"message\"\n tabindex=\"0\"\n style=\"position: relative;\"\n >\n <div\n style=\"position: absolute; left: -9999px\"\n [attr.aria-live]=\"'polite'\"\n >{{ message }}\n </div>\n <ng-content></ng-content>\n @if (templateRef) {\n <div [class]=\"'template-tooltip'\">\n <ng-container *ngTemplateOutlet=\"templateRef\"></ng-container>\n </div>\n }\n </div>\n}\n","import { NgModule } from '@angular/core';\nimport { MatTooltipModule } from '@angular/material/tooltip';\nimport { TooltipComponent } from './tooltip.component';\nimport { CommonModule } from '@angular/common';\nimport { TooltipTemplateDirective } from './tooltip-template.directive';\nimport { EllipseTextDirective } from '@testgorilla/tgo-ui/components/core';\nimport { UiTranslatePipe } from '@testgorilla/tgo-ui/components/core';\n\n@NgModule({\n declarations: [TooltipComponent],\n imports: [MatTooltipModule, CommonModule, TooltipTemplateDirective, EllipseTextDirective, UiTranslatePipe],\n exports: [TooltipComponent, TooltipTemplateDirective],\n providers: [\n { provide: 'TooltipComponentToken', useValue: TooltipComponent }\n ]\n})\nexport class TooltipComponentModule {\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1","i2","i3.TooltipTemplateDirective"],"mappings":";;;;;;;;;;;;;IAAY;AAAZ,CAAA,UAAY,mBAAmB,EAAA;AAC7B,IAAA,mBAAA,CAAA,KAAA,CAAA,GAAA,KAAW;AACX,IAAA,mBAAA,CAAA,QAAA,CAAA,GAAA,QAAiB;AACjB,IAAA,mBAAA,CAAA,MAAA,CAAA,GAAA,MAAa;AACb,IAAA,mBAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACjB,CAAC,EALW,mBAAmB,KAAnB,mBAAmB,GAK9B,EAAA,CAAA,CAAA;;MCqBY,wBAAwB,CAAA;AAOnC,IAAA,WAAA,CACU,QAAiB,EACjB,uBAA+C,EAC/C,WAAuB,EACvB,YAA0B,EAC1B,MAAc,EACd,QAAkB,EACe,qBAA0B,EAAA;QAN3D,IAAQ,CAAA,QAAA,GAAR,QAAQ;QACR,IAAuB,CAAA,uBAAA,GAAvB,uBAAuB;QACvB,IAAW,CAAA,WAAA,GAAX,WAAW;QACX,IAAY,CAAA,YAAA,GAAZ,YAAY;QACZ,IAAM,CAAA,MAAA,GAAN,MAAM;QACN,IAAQ,CAAA,QAAA,GAAR,QAAQ;QACyB,IAAqB,CAAA,qBAAA,GAArB,qBAAqB;AA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ChC,OAAO,EAAE,CAAC,gBAAgB,EAAE,YAAY,EAAE,wBAAwB,EAAE,oBAAoB,EAAE,eAAe,CAAC;AAC1G,oBAAA,OAAO,EAAE,CAAC,gBAAgB,EAAE,wBAAwB,CAAC;AACrD,oBAAA,SAAS,EAAE;AACT,wBAAA,EAAE,OAAO,EAAE,uBAAuB,EAAE,QAAQ,EAAE,gBAAgB;AAC/D;AACF,iBAAA;;;ACfD;;AAEG;;;;"}
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { HostBinding, Input, Component, NgModule } from '@angular/core';
|
|
3
|
-
import * as i1 from '@angular/common';
|
|
4
|
-
import { CommonModule } from '@angular/common';
|
|
5
|
-
import * as i2 from '@testgorilla/tgo-ui/components/icon';
|
|
6
|
-
import { IconComponentModule } from '@testgorilla/tgo-ui/components/icon';
|
|
7
|
-
import * as i3 from '@testgorilla/tgo-ui/components/core';
|
|
8
|
-
import { UiTranslatePipe } from '@testgorilla/tgo-ui/components/core';
|
|
9
|
-
|
|
10
|
-
class ValidationErrorComponent {
|
|
11
|
-
constructor() {
|
|
12
|
-
this.touchedOn = true;
|
|
13
|
-
this.errorMessage = '';
|
|
14
|
-
/**
|
|
15
|
-
*
|
|
16
|
-
* Defines the application theme
|
|
17
|
-
*
|
|
18
|
-
* @type {ApplicationTheme}
|
|
19
|
-
* @memberof ValidationErrorComponent
|
|
20
|
-
*/
|
|
21
|
-
this.applicationTheme = 'light';
|
|
22
|
-
this.translationContextErrors = 'ERRORS.';
|
|
23
|
-
}
|
|
24
|
-
getErrorValue(type) {
|
|
25
|
-
const ngControlErrors = this.ngControl.errors;
|
|
26
|
-
switch (type) {
|
|
27
|
-
case 'maxlength':
|
|
28
|
-
return ngControlErrors.maxlength.requiredLength;
|
|
29
|
-
case 'minlength':
|
|
30
|
-
return ngControlErrors.minlength.requiredLength;
|
|
31
|
-
case 'max':
|
|
32
|
-
return ngControlErrors.max.max;
|
|
33
|
-
case 'min':
|
|
34
|
-
return ngControlErrors.min.min;
|
|
35
|
-
default:
|
|
36
|
-
return 0;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: ValidationErrorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
40
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.17", type: ValidationErrorComponent, isStandalone: false, selector: "ui-validation-error", inputs: { ngControl: "ngControl", touchedOn: "touchedOn", errorMessage: "errorMessage", label: "label", applicationTheme: "applicationTheme" }, host: { properties: { "attr.theme": "this.applicationTheme" } }, ngImport: i0, template: "<div class=\"errors\" *ngIf=\"ngControl?.hasError('maxlength')\">\n <ui-icon [applicationTheme]=\"applicationTheme\" [name]=\"'Error'\"></ui-icon>\n <span>{{ translationContextErrors + 'MAX_LENGTH' | uiTranslate : { maxlength: getErrorValue('maxlength') } | async }}</span>\n</div>\n\n<div class=\"errors\" *ngIf=\"ngControl?.hasError('minlength')\">\n <ui-icon [applicationTheme]=\"applicationTheme\" [name]=\"'Error'\"></ui-icon>\n <span>{{ translationContextErrors + 'MIN_LENGTH' | uiTranslate : { maxlength: getErrorValue('minlength') } | async }}</span>\n</div>\n\n<div class=\"errors\" *ngIf=\"ngControl?.hasError('min')\">\n <ui-icon [applicationTheme]=\"applicationTheme\" [name]=\"'Error'\"></ui-icon>\n <span>{{ translationContextErrors + 'MIN' | uiTranslate : { min: getErrorValue('min') } | async }}</span>\n</div>\n\n<div class=\"errors\" *ngIf=\"ngControl?.hasError('max')\">\n <ui-icon [applicationTheme]=\"applicationTheme\" [name]=\"'Error'\"></ui-icon>\n <span>{{ translationContextErrors + 'MAX' | uiTranslate : { max: getErrorValue('max') } | async }}</span>\n</div>\n\n<div class=\"errors\" *ngIf=\"ngControl?.hasError('required') && (touchedOn ? ngControl?.touched : true)\">\n <ui-icon [applicationTheme]=\"applicationTheme\" [name]=\"'Error'\"></ui-icon>\n <span>{{ translationContextErrors + (label ? 'REQUIRED_FIELD' : 'REQUIRED') | uiTranslate : { label } | async }}</span>\n</div>\n\n<div class=\"errors\" *ngIf=\"ngControl?.hasError('email')\">\n <ui-icon [applicationTheme]=\"applicationTheme\" [name]=\"'Error'\"></ui-icon>\n <span>{{ translationContextErrors + 'EMAIL_INCORRECT' | uiTranslate | async }}</span>\n</div>\n\n<div class=\"custom-errors\" *ngIf=\"errorMessage\">\n <ui-icon [applicationTheme]=\"applicationTheme\" [name]=\"'Error'\"></ui-icon>\n <span>{{ errorMessage }}</span>\n</div>\n", styles: [""], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2.IconComponent, selector: "ui-icon", inputs: ["size", "cssClass", "name", "color", "filled", "toggleIconStyle", "applicationTheme", "useFullIconName"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: i3.UiTranslatePipe, name: "uiTranslate" }] }); }
|
|
41
|
-
}
|
|
42
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: ValidationErrorComponent, decorators: [{
|
|
43
|
-
type: Component,
|
|
44
|
-
args: [{ selector: 'ui-validation-error', standalone: false, template: "<div class=\"errors\" *ngIf=\"ngControl?.hasError('maxlength')\">\n <ui-icon [applicationTheme]=\"applicationTheme\" [name]=\"'Error'\"></ui-icon>\n <span>{{ translationContextErrors + 'MAX_LENGTH' | uiTranslate : { maxlength: getErrorValue('maxlength') } | async }}</span>\n</div>\n\n<div class=\"errors\" *ngIf=\"ngControl?.hasError('minlength')\">\n <ui-icon [applicationTheme]=\"applicationTheme\" [name]=\"'Error'\"></ui-icon>\n <span>{{ translationContextErrors + 'MIN_LENGTH' | uiTranslate : { maxlength: getErrorValue('minlength') } | async }}</span>\n</div>\n\n<div class=\"errors\" *ngIf=\"ngControl?.hasError('min')\">\n <ui-icon [applicationTheme]=\"applicationTheme\" [name]=\"'Error'\"></ui-icon>\n <span>{{ translationContextErrors + 'MIN' | uiTranslate : { min: getErrorValue('min') } | async }}</span>\n</div>\n\n<div class=\"errors\" *ngIf=\"ngControl?.hasError('max')\">\n <ui-icon [applicationTheme]=\"applicationTheme\" [name]=\"'Error'\"></ui-icon>\n <span>{{ translationContextErrors + 'MAX' | uiTranslate : { max: getErrorValue('max') } | async }}</span>\n</div>\n\n<div class=\"errors\" *ngIf=\"ngControl?.hasError('required') && (touchedOn ? ngControl?.touched : true)\">\n <ui-icon [applicationTheme]=\"applicationTheme\" [name]=\"'Error'\"></ui-icon>\n <span>{{ translationContextErrors + (label ? 'REQUIRED_FIELD' : 'REQUIRED') | uiTranslate : { label } | async }}</span>\n</div>\n\n<div class=\"errors\" *ngIf=\"ngControl?.hasError('email')\">\n <ui-icon [applicationTheme]=\"applicationTheme\" [name]=\"'Error'\"></ui-icon>\n <span>{{ translationContextErrors + 'EMAIL_INCORRECT' | uiTranslate | async }}</span>\n</div>\n\n<div class=\"custom-errors\" *ngIf=\"errorMessage\">\n <ui-icon [applicationTheme]=\"applicationTheme\" [name]=\"'Error'\"></ui-icon>\n <span>{{ errorMessage }}</span>\n</div>\n" }]
|
|
45
|
-
}], propDecorators: { ngControl: [{
|
|
46
|
-
type: Input
|
|
47
|
-
}], touchedOn: [{
|
|
48
|
-
type: Input
|
|
49
|
-
}], errorMessage: [{
|
|
50
|
-
type: Input
|
|
51
|
-
}], label: [{
|
|
52
|
-
type: Input
|
|
53
|
-
}], applicationTheme: [{
|
|
54
|
-
type: HostBinding,
|
|
55
|
-
args: ['attr.theme']
|
|
56
|
-
}, {
|
|
57
|
-
type: Input
|
|
58
|
-
}] } });
|
|
59
|
-
|
|
60
|
-
class ValidationErrorModule {
|
|
61
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: ValidationErrorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
62
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.17", ngImport: i0, type: ValidationErrorModule, declarations: [ValidationErrorComponent], imports: [CommonModule, IconComponentModule, UiTranslatePipe], exports: [ValidationErrorComponent] }); }
|
|
63
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: ValidationErrorModule, imports: [CommonModule, IconComponentModule] }); }
|
|
64
|
-
}
|
|
65
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: ValidationErrorModule, decorators: [{
|
|
66
|
-
type: NgModule,
|
|
67
|
-
args: [{
|
|
68
|
-
declarations: [ValidationErrorComponent],
|
|
69
|
-
exports: [ValidationErrorComponent],
|
|
70
|
-
imports: [CommonModule, IconComponentModule, UiTranslatePipe],
|
|
71
|
-
}]
|
|
72
|
-
}] });
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* Generated bundle index. Do not edit.
|
|
76
|
-
*/
|
|
77
|
-
|
|
78
|
-
export { ValidationErrorComponent, ValidationErrorModule };
|
|
79
|
-
//# sourceMappingURL=testgorilla-tgo-ui-components-validation-error.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"testgorilla-tgo-ui-components-validation-error.mjs","sources":["../../../components/validation-error/validation-error.component.ts","../../../components/validation-error/validation-error.component.html","../../../components/validation-error/validation-error.module.ts","../../../components/validation-error/testgorilla-tgo-ui-components-validation-error.ts"],"sourcesContent":["import { Component, HostBinding, Input } from '@angular/core';\nimport { errorType } from './validation-error.model';\nimport { NgControl } from '@angular/forms';\nimport { ApplicationTheme } from '@testgorilla/tgo-ui/components/core';\n\n@Component({\n selector: 'ui-validation-error',\n templateUrl: './validation-error.component.html',\n styleUrls: ['./validation-error.component.scss'],\n standalone: false\n})\nexport class ValidationErrorComponent {\n @Input() ngControl: NgControl;\n @Input() touchedOn = true;\n @Input() errorMessage = '';\n\n @Input() label: string | undefined | null;\n\n /**\n *\n * Defines the application theme\n *\n * @type {ApplicationTheme}\n * @memberof ValidationErrorComponent\n */\n @HostBinding('attr.theme')\n @Input()\n applicationTheme: ApplicationTheme = 'light';\n\n getErrorValue(type: errorType): number {\n const ngControlErrors: any = this.ngControl.errors;\n switch (type) {\n case 'maxlength':\n return ngControlErrors.maxlength.requiredLength;\n case 'minlength':\n return ngControlErrors.minlength.requiredLength;\n case 'max':\n return ngControlErrors.max.max;\n case 'min':\n return ngControlErrors.min.min;\n default:\n return 0;\n }\n }\n\n translationContextErrors = 'ERRORS.';\n}\n","<div class=\"errors\" *ngIf=\"ngControl?.hasError('maxlength')\">\n <ui-icon [applicationTheme]=\"applicationTheme\" [name]=\"'Error'\"></ui-icon>\n <span>{{ translationContextErrors + 'MAX_LENGTH' | uiTranslate : { maxlength: getErrorValue('maxlength') } | async }}</span>\n</div>\n\n<div class=\"errors\" *ngIf=\"ngControl?.hasError('minlength')\">\n <ui-icon [applicationTheme]=\"applicationTheme\" [name]=\"'Error'\"></ui-icon>\n <span>{{ translationContextErrors + 'MIN_LENGTH' | uiTranslate : { maxlength: getErrorValue('minlength') } | async }}</span>\n</div>\n\n<div class=\"errors\" *ngIf=\"ngControl?.hasError('min')\">\n <ui-icon [applicationTheme]=\"applicationTheme\" [name]=\"'Error'\"></ui-icon>\n <span>{{ translationContextErrors + 'MIN' | uiTranslate : { min: getErrorValue('min') } | async }}</span>\n</div>\n\n<div class=\"errors\" *ngIf=\"ngControl?.hasError('max')\">\n <ui-icon [applicationTheme]=\"applicationTheme\" [name]=\"'Error'\"></ui-icon>\n <span>{{ translationContextErrors + 'MAX' | uiTranslate : { max: getErrorValue('max') } | async }}</span>\n</div>\n\n<div class=\"errors\" *ngIf=\"ngControl?.hasError('required') && (touchedOn ? ngControl?.touched : true)\">\n <ui-icon [applicationTheme]=\"applicationTheme\" [name]=\"'Error'\"></ui-icon>\n <span>{{ translationContextErrors + (label ? 'REQUIRED_FIELD' : 'REQUIRED') | uiTranslate : { label } | async }}</span>\n</div>\n\n<div class=\"errors\" *ngIf=\"ngControl?.hasError('email')\">\n <ui-icon [applicationTheme]=\"applicationTheme\" [name]=\"'Error'\"></ui-icon>\n <span>{{ translationContextErrors + 'EMAIL_INCORRECT' | uiTranslate | async }}</span>\n</div>\n\n<div class=\"custom-errors\" *ngIf=\"errorMessage\">\n <ui-icon [applicationTheme]=\"applicationTheme\" [name]=\"'Error'\"></ui-icon>\n <span>{{ errorMessage }}</span>\n</div>\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { ValidationErrorComponent } from './validation-error.component';\nimport { IconComponentModule } from '@testgorilla/tgo-ui/components/icon';\nimport { UiTranslatePipe } from '@testgorilla/tgo-ui/components/core';\n\n@NgModule({\n declarations: [ValidationErrorComponent],\n exports: [ValidationErrorComponent],\n imports: [CommonModule, IconComponentModule, UiTranslatePipe],\n})\nexport class ValidationErrorModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;MAWa,wBAAwB,CAAA;AANrC,IAAA,WAAA,GAAA;QAQW,IAAS,CAAA,SAAA,GAAG,IAAI;QAChB,IAAY,CAAA,YAAA,GAAG,EAAE;AAI1B;;;;;;AAMG;QAGH,IAAgB,CAAA,gBAAA,GAAqB,OAAO;QAkB5C,IAAwB,CAAA,wBAAA,GAAG,SAAS;AACrC;AAjBC,IAAA,aAAa,CAAC,IAAe,EAAA;AAC3B,QAAA,MAAM,eAAe,GAAQ,IAAI,CAAC,SAAS,CAAC,MAAM;QAClD,QAAQ,IAAI;AACV,YAAA,KAAK,WAAW;AACd,gBAAA,OAAO,eAAe,CAAC,SAAS,CAAC,cAAc;AACjD,YAAA,KAAK,WAAW;AACd,gBAAA,OAAO,eAAe,CAAC,SAAS,CAAC,cAAc;AACjD,YAAA,KAAK,KAAK;AACR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V,SAAS,EAAA,CAAA;sBAAjB;gBACQ,SAAS,EAAA,CAAA;sBAAjB;gBACQ,YAAY,EAAA,CAAA;sBAApB;gBAEQ,KAAK,EAAA,CAAA;sBAAb;gBAWD,gBAAgB,EAAA,CAAA;sBAFf,WAAW;uBAAC,YAAY;;sBACxB;;;MEfU,qBAAqB,CAAA;+GAArB,qBAAqB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;gHAArB,qBAAqB,EAAA,YAAA,EAAA,CAJjB,wBAAwB,CAE7B,EAAA,OAAA,EAAA,CAAA,YAAY,EAAE,mBAAmB,EAAE,eAAe,CAAA,EAAA,OAAA,EAAA,CADlD,wBAAwB,CAAA,EAAA,CAAA,CAAA;gHAGvB,qBAAqB,EAAA,OAAA,EAAA,CAFtB,YAAY,EAAE,mBAAmB,CAAA,EAAA,CAAA,CAAA;;4FAEhC,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBALjC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,YAAY,EAAE,CAAC,wBAAwB,CAAC;oBACxC,OAAO,EAAE,CAAC,wBAAwB,CAAC;AACnC,oBAAA,OAAO,EAAE,CAAC,YAAY,EAAE,mBAAmB,EAAE,eAAe,CAAC;AAC9D,iBAAA;;;ACVD;;AAEG;;;;"}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|