@agorapulse/ui-components 17.2.0 → 17.2.1-beta.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/avatar/avatar.component.d.ts +3 -1
- package/directives/public_api.d.ts +0 -1
- package/esm2022/autocomplete/autocomplete.component.mjs +7 -5
- package/esm2022/avatar/avatar.component.mjs +16 -5
- package/esm2022/directives/public_api.mjs +1 -2
- package/esm2022/icon-button/icon-button.component.mjs +8 -4
- package/esm2022/index.mjs +2 -2
- package/esm2022/input-search/input-search.component.mjs +3 -3
- package/esm2022/labels/label.component.mjs +2 -2
- package/esm2022/labels-selector/labels-selector.component.mjs +2 -2
- package/esm2022/legacy/select/select.component.mjs +5 -5
- package/esm2022/phone-number-input/phone-number-input.component.mjs +56 -22
- package/esm2022/radio/radio.component.mjs +9 -7
- package/esm2022/select/dropdown-group-item/dropdown-group-item.component.mjs +1 -1
- package/esm2022/select/dropdown-item-multiple-one-line/dropdown-item-multiple-one-line.component.mjs +16 -4
- package/esm2022/select/dropdown-item-multiple-two-lines/dropdown-item-multiple-two-lines.component.mjs +16 -4
- package/esm2022/select/dropdown-item-single-one-line/dropdown-item-single-one-line.component.mjs +19 -4
- package/esm2022/select/dropdown-item-single-two-lines/dropdown-item-single-two-lines.component.mjs +16 -4
- package/esm2022/select/dropdown-search-form/dropdown-search-form.component.mjs +31 -4
- package/esm2022/select/select-label-multiple/select-label-multiple.component.mjs +25 -4
- package/esm2022/select/select-label-single/select-label-single.component.mjs +8 -4
- package/esm2022/snackbars-thread/component/snackbars-thread.component.mjs +14 -6
- package/esm2022/snackbars-thread/model/snackbars-thread.model.mjs +1 -1
- package/esm2022/snackbars-thread/service/snackbars-thread.service.mjs +2 -1
- package/esm2022/social-button/social-button.component.mjs +7 -5
- package/esm2022/src/lib/agorapulse-ui-components.module.mjs +2 -6
- package/esm2022/status/status.component.mjs +2 -2
- package/esm2022/tooltip/tooltip.directive.mjs +33 -44
- package/fesm2022/agorapulse-ui-components-autocomplete.mjs +6 -4
- package/fesm2022/agorapulse-ui-components-autocomplete.mjs.map +1 -1
- package/fesm2022/agorapulse-ui-components-avatar.mjs +16 -5
- package/fesm2022/agorapulse-ui-components-avatar.mjs.map +1 -1
- package/fesm2022/agorapulse-ui-components-directives.mjs +1 -41
- package/fesm2022/agorapulse-ui-components-directives.mjs.map +1 -1
- package/fesm2022/agorapulse-ui-components-icon-button.mjs +7 -3
- package/fesm2022/agorapulse-ui-components-icon-button.mjs.map +1 -1
- package/fesm2022/agorapulse-ui-components-input-search.mjs +2 -2
- package/fesm2022/agorapulse-ui-components-input-search.mjs.map +1 -1
- package/fesm2022/agorapulse-ui-components-labels-selector.mjs +1 -1
- package/fesm2022/agorapulse-ui-components-labels-selector.mjs.map +1 -1
- package/fesm2022/agorapulse-ui-components-labels.mjs +1 -1
- package/fesm2022/agorapulse-ui-components-labels.mjs.map +1 -1
- package/fesm2022/agorapulse-ui-components-legacy-select.mjs +4 -4
- package/fesm2022/agorapulse-ui-components-legacy-select.mjs.map +1 -1
- package/fesm2022/agorapulse-ui-components-phone-number-input.mjs +55 -21
- package/fesm2022/agorapulse-ui-components-phone-number-input.mjs.map +1 -1
- package/fesm2022/agorapulse-ui-components-radio.mjs +8 -6
- package/fesm2022/agorapulse-ui-components-radio.mjs.map +1 -1
- package/fesm2022/agorapulse-ui-components-select.mjs +121 -18
- package/fesm2022/agorapulse-ui-components-select.mjs.map +1 -1
- package/fesm2022/agorapulse-ui-components-snackbars-thread.mjs +14 -5
- package/fesm2022/agorapulse-ui-components-snackbars-thread.mjs.map +1 -1
- package/fesm2022/agorapulse-ui-components-social-button.mjs +5 -4
- package/fesm2022/agorapulse-ui-components-social-button.mjs.map +1 -1
- package/fesm2022/agorapulse-ui-components-status.mjs +2 -2
- package/fesm2022/agorapulse-ui-components-status.mjs.map +1 -1
- package/fesm2022/agorapulse-ui-components-tooltip.mjs +32 -43
- package/fesm2022/agorapulse-ui-components-tooltip.mjs.map +1 -1
- package/fesm2022/agorapulse-ui-components.mjs +2 -6
- package/fesm2022/agorapulse-ui-components.mjs.map +1 -1
- package/index.d.ts +1 -1
- package/package.json +43 -43
- package/phone-number-input/phone-number-input.component.d.ts +13 -6
- package/select/dropdown-item-multiple-one-line/dropdown-item-multiple-one-line.component.d.ts +5 -1
- package/select/dropdown-item-multiple-two-lines/dropdown-item-multiple-two-lines.component.d.ts +5 -1
- package/select/dropdown-item-single-one-line/dropdown-item-single-one-line.component.d.ts +6 -1
- package/select/dropdown-item-single-two-lines/dropdown-item-single-two-lines.component.d.ts +5 -1
- package/select/dropdown-search-form/dropdown-search-form.component.d.ts +11 -2
- package/select/select-label-multiple/select-label-multiple.component.d.ts +3 -2
- package/select/select-label-single/select-label-single.component.d.ts +3 -1
- package/snackbars-thread/component/snackbars-thread.component.d.ts +2 -1
- package/snackbars-thread/model/snackbars-thread.model.d.ts +1 -0
- package/src/lib/agorapulse-ui-components.module.d.ts +1 -1
- package/tooltip/tooltip.directive.d.ts +10 -9
- package/agorapulse-ui-components-17.2.0.tgz +0 -0
- package/directives/truncate-tooltip.directive.d.ts +0 -16
- package/esm2022/directives/truncate-tooltip.directive.mjs +0 -43
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { InputSearchComponent } from '@agorapulse/ui-components/input-search';
|
|
2
|
-
import { AfterViewInit, EventEmitter, TemplateRef } from '@angular/core';
|
|
2
|
+
import { AfterViewInit, EventEmitter, OnDestroy, OutputRefSubscription, TemplateRef } from '@angular/core';
|
|
3
3
|
import { NgSelectComponent } from '@ng-select/ng-select';
|
|
4
4
|
import { BehaviorSubject } from 'rxjs';
|
|
5
5
|
import * as i0 from "@angular/core";
|
|
6
|
-
export declare class DropdownSearchFormComponent implements AfterViewInit {
|
|
6
|
+
export declare class DropdownSearchFormComponent implements AfterViewInit, OnDestroy {
|
|
7
7
|
searchPlaceholder: string;
|
|
8
8
|
createNewEnabled: boolean;
|
|
9
9
|
createText: string;
|
|
@@ -15,8 +15,17 @@ export declare class DropdownSearchFormComponent implements AfterViewInit {
|
|
|
15
15
|
createNew: EventEmitter<string>;
|
|
16
16
|
searchTermSignal: import("@angular/core").WritableSignal<string>;
|
|
17
17
|
searchTerm$: BehaviorSubject<string>;
|
|
18
|
+
submitSubscription: OutputRefSubscription | null;
|
|
18
19
|
constructor();
|
|
20
|
+
ngOnDestroy(): void;
|
|
19
21
|
ngAfterViewInit(): void;
|
|
22
|
+
/**
|
|
23
|
+
* Register the keyboard submit event allowing to press enter to select the first item found.
|
|
24
|
+
* And escape to close the dropdown. This is useful for keyboard navigation.
|
|
25
|
+
* Use case: search for an item by typing the first characters and press enter to select it.
|
|
26
|
+
* Furthermore: arrow keys currently don't work in the dropdown search form.
|
|
27
|
+
*/
|
|
28
|
+
registerKeyboardSubmit(): void;
|
|
20
29
|
onCreateNew(): void;
|
|
21
30
|
static ɵfac: i0.ɵɵFactoryDeclaration<DropdownSearchFormComponent, never>;
|
|
22
31
|
static ɵcmp: i0.ɵɵComponentDeclaration<DropdownSearchFormComponent, "ap-dropdown-search-form", never, { "searchPlaceholder": { "alias": "searchPlaceholder"; "required": false; }; "createNewEnabled": { "alias": "createNewEnabled"; "required": false; }; "createText": { "alias": "createText"; "required": false; }; "select": { "alias": "select"; "required": true; }; }, { "createNew": "createNew"; }, never, never, true, never>;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { AfterViewInit } from '@angular/core';
|
|
2
2
|
import * as i0 from "@angular/core";
|
|
3
3
|
export declare class SelectLabelMultipleComponent implements AfterViewInit {
|
|
4
|
-
displayType: import("@angular/core").InputSignal<"
|
|
4
|
+
displayType: import("@angular/core").InputSignal<"tag" | "label">;
|
|
5
5
|
selectedItems: import("@angular/core").InputSignal<any[]>;
|
|
6
6
|
bindLabel: import("@angular/core").InputSignal<string>;
|
|
7
7
|
bindValue: import("@angular/core").InputSignal<string>;
|
|
8
8
|
bindAvatarUrl: import("@angular/core").InputSignal<string>;
|
|
9
9
|
bindSymbolId: import("@angular/core").InputSignal<string>;
|
|
10
|
+
roundedAvatar: import("@angular/core").InputSignal<boolean>;
|
|
10
11
|
removeItem: import("@angular/core").OutputEmitterRef<any>;
|
|
11
12
|
private elementRef;
|
|
12
13
|
private injector;
|
|
@@ -22,5 +23,5 @@ export declare class SelectLabelMultipleComponent implements AfterViewInit {
|
|
|
22
23
|
ngAfterViewInit(): void;
|
|
23
24
|
calculateResponsiveLabels(containerWidth: number, selectedValues: any[]): void;
|
|
24
25
|
static ɵfac: i0.ɵɵFactoryDeclaration<SelectLabelMultipleComponent, never>;
|
|
25
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<SelectLabelMultipleComponent, "ap-select-label-multiple", never, { "displayType": { "alias": "displayType"; "required": false; "isSignal": true; }; "selectedItems": { "alias": "selectedItems"; "required": true; "isSignal": true; }; "bindLabel": { "alias": "bindLabel"; "required": false; "isSignal": true; }; "bindValue": { "alias": "bindValue"; "required": false; "isSignal": true; }; "bindAvatarUrl": { "alias": "bindAvatarUrl"; "required": false; "isSignal": true; }; "bindSymbolId": { "alias": "bindSymbolId"; "required": false; "isSignal": true; }; }, { "removeItem": "removeItem"; }, never, never, true, never>;
|
|
26
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SelectLabelMultipleComponent, "ap-select-label-multiple", never, { "displayType": { "alias": "displayType"; "required": false; "isSignal": true; }; "selectedItems": { "alias": "selectedItems"; "required": true; "isSignal": true; }; "bindLabel": { "alias": "bindLabel"; "required": false; "isSignal": true; }; "bindValue": { "alias": "bindValue"; "required": false; "isSignal": true; }; "bindAvatarUrl": { "alias": "bindAvatarUrl"; "required": false; "isSignal": true; }; "bindSymbolId": { "alias": "bindSymbolId"; "required": false; "isSignal": true; }; "roundedAvatar": { "alias": "roundedAvatar"; "required": false; "isSignal": true; }; }, { "removeItem": "removeItem"; }, never, never, true, never>;
|
|
26
27
|
}
|
|
@@ -5,6 +5,8 @@ export declare class SelectLabelSingleComponent {
|
|
|
5
5
|
label: string;
|
|
6
6
|
avatarUrl?: string;
|
|
7
7
|
network: AvatarNetwork | undefined;
|
|
8
|
+
showAvatarInitials: boolean;
|
|
9
|
+
roundedAvatar: import("@angular/core").InputSignal<boolean>;
|
|
8
10
|
static ɵfac: i0.ɵɵFactoryDeclaration<SelectLabelSingleComponent, never>;
|
|
9
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<SelectLabelSingleComponent, "ap-select-label-single", never, { "displayType": { "alias": "displayType"; "required": false; }; "label": { "alias": "label"; "required": true; }; "avatarUrl": { "alias": "avatarUrl"; "required": false; }; "network": { "alias": "network"; "required": false; }; }, {}, never, never, true, never>;
|
|
11
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SelectLabelSingleComponent, "ap-select-label-single", never, { "displayType": { "alias": "displayType"; "required": false; }; "label": { "alias": "label"; "required": true; }; "avatarUrl": { "alias": "avatarUrl"; "required": false; }; "network": { "alias": "network"; "required": false; }; "showAvatarInitials": { "alias": "showAvatarInitials"; "required": false; }; "roundedAvatar": { "alias": "roundedAvatar"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
10
12
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { SymbolRegistry } from '@agorapulse/ui-symbol';
|
|
2
2
|
import { Router } from '@angular/router';
|
|
3
3
|
import { SnackbarsThreadService } from '../service/snackbars-thread.service';
|
|
4
|
+
import { SnackbarsThreadBase } from '../public_api';
|
|
4
5
|
import * as i0 from "@angular/core";
|
|
5
6
|
export declare class SnackbarsThreadComponent {
|
|
6
7
|
snackbarsThreadService: SnackbarsThreadService;
|
|
@@ -17,7 +18,7 @@ export declare class SnackbarsThreadComponent {
|
|
|
17
18
|
};
|
|
18
19
|
constructor(snackbarsThreadService: SnackbarsThreadService, symbolRegistry: SymbolRegistry, router: Router);
|
|
19
20
|
remove(id: string): void;
|
|
20
|
-
onActionClick(
|
|
21
|
+
onActionClick(snackbar: SnackbarsThreadBase, id: string): void;
|
|
21
22
|
static ɵfac: i0.ɵɵFactoryDeclaration<SnackbarsThreadComponent, never>;
|
|
22
23
|
static ɵcmp: i0.ɵɵComponentDeclaration<SnackbarsThreadComponent, "ap-snackbars-thread", never, {}, {}, never, never, true, never>;
|
|
23
24
|
}
|
|
@@ -22,6 +22,7 @@ export interface SnackbarsThreadBase {
|
|
|
22
22
|
navigateInternalUrl?: string;
|
|
23
23
|
snackbarType: internalSnackbarTypeAllowed;
|
|
24
24
|
snackbarText: string | SafeHtml;
|
|
25
|
+
openUrlInNewTab?: boolean;
|
|
25
26
|
}
|
|
26
27
|
export interface SnackbarsThreadComplete extends SnackbarsThreadBase {
|
|
27
28
|
id: string;
|
|
@@ -24,6 +24,6 @@ import * as i20 from "@agorapulse/ui-components/popmenu";
|
|
|
24
24
|
*/
|
|
25
25
|
export declare class AgorapulseUiComponentsModule {
|
|
26
26
|
static ɵfac: i0.ɵɵFactoryDeclaration<AgorapulseUiComponentsModule, never>;
|
|
27
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<AgorapulseUiComponentsModule, never, [typeof i1.AvatarComponent, typeof i2.StepperComponent, typeof i3.ConfirmModalComponent, typeof i4.DatepickerComponent, typeof i5.DotStepperComponent, typeof i6.EllipsisDirective, typeof i7.InfoboxComponent, typeof i8.LabelListComponent, typeof i9.LabelsSelectorComponent, typeof i10.NeoDatepickerComponent, typeof i11.MediaDisplayOverlayDialogComponent, typeof i12.ModalComponent, typeof i13.PasswordInputComponent, typeof i8.LabelComponent, typeof i14.NotificationComponent, typeof i15.PaginatorComponent, typeof i15.PaginatorButtonComponent, typeof i16.SlideToggleComponent, typeof i17.SnackbarsThreadComponent, typeof i6.DefaultImageDirective, typeof i6.FrozenGifDirective, typeof i6.EqualValidatorDirective, typeof i6.MultiStyleTextDirective, typeof
|
|
27
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<AgorapulseUiComponentsModule, never, [typeof i1.AvatarComponent, typeof i2.StepperComponent, typeof i3.ConfirmModalComponent, typeof i4.DatepickerComponent, typeof i5.DotStepperComponent, typeof i6.EllipsisDirective, typeof i7.InfoboxComponent, typeof i8.LabelListComponent, typeof i9.LabelsSelectorComponent, typeof i10.NeoDatepickerComponent, typeof i11.MediaDisplayOverlayDialogComponent, typeof i12.ModalComponent, typeof i13.PasswordInputComponent, typeof i8.LabelComponent, typeof i14.NotificationComponent, typeof i15.PaginatorComponent, typeof i15.PaginatorButtonComponent, typeof i16.SlideToggleComponent, typeof i17.SnackbarsThreadComponent, typeof i6.DefaultImageDirective, typeof i6.FrozenGifDirective, typeof i6.EqualValidatorDirective, typeof i6.MultiStyleTextDirective, typeof i18.TooltipDirective, typeof i19.AddCommentComponent, typeof i6.AutosizeTextareaDirective, typeof i10.DayDisabledPipe], [typeof i19.AddCommentComponent, typeof i1.AvatarComponent, typeof i2.StepperComponent, typeof i3.ConfirmModalComponent, typeof i4.DatepickerComponent, typeof i10.NeoDatepickerComponent, typeof i5.DotStepperComponent, typeof i6.EllipsisDirective, typeof i7.InfoboxComponent, typeof i8.LabelComponent, typeof i8.LabelListComponent, typeof i11.MediaDisplayOverlayDialogComponent, typeof i12.ModalComponent, typeof i13.PasswordInputComponent, typeof i9.LabelsSelectorComponent, typeof i14.NotificationComponent, typeof i15.PaginatorComponent, typeof i15.PaginatorButtonComponent, typeof i16.SlideToggleComponent, typeof i17.SnackbarsThreadComponent, typeof i10.DayDisabledPipe, typeof i6.AutosizeTextareaDirective, typeof i6.DefaultImageDirective, typeof i6.FrozenGifDirective, typeof i6.EqualValidatorDirective, typeof i6.MultiStyleTextDirective, typeof i18.TooltipDirective, typeof i20.PopmenuModule]>;
|
|
28
28
|
static ɵinj: i0.ɵɵInjectorDeclaration<AgorapulseUiComponentsModule>;
|
|
29
29
|
}
|
|
@@ -6,14 +6,15 @@ export declare class TooltipDirective implements AfterViewInit, OnDestroy, OnIni
|
|
|
6
6
|
private readonly zone;
|
|
7
7
|
private readonly viewContainerRef;
|
|
8
8
|
private readonly destroyRef;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
apTooltipShowDelay: number
|
|
12
|
-
apTooltipHideDelay: number
|
|
13
|
-
apTooltipDuration: number
|
|
14
|
-
apTooltipDisabled: boolean
|
|
15
|
-
|
|
16
|
-
|
|
9
|
+
apTooltip: import("@angular/core").InputSignal<string | TemplateRef<HTMLElement> | null | undefined>;
|
|
10
|
+
apTooltipPosition: import("@angular/core").InputSignal<"right" | "left" | "top" | "bottom" | "bottom-left" | "bottom-right" | "top-left" | "top-right">;
|
|
11
|
+
apTooltipShowDelay: import("@angular/core").InputSignal<number>;
|
|
12
|
+
apTooltipHideDelay: import("@angular/core").InputSignal<number>;
|
|
13
|
+
apTooltipDuration: import("@angular/core").InputSignal<number>;
|
|
14
|
+
apTooltipDisabled: import("@angular/core").InputSignal<boolean>;
|
|
15
|
+
apTooltipTruncatedTextOnly: import("@angular/core").InputSignal<boolean>;
|
|
16
|
+
apTooltipTemplateContext: import("@angular/core").InputSignal<any>;
|
|
17
|
+
apTooltipVirtualScrollElement: import("@angular/core").InputSignal<CdkVirtualScrollViewport | undefined>;
|
|
17
18
|
clickListener: (() => void) | undefined;
|
|
18
19
|
container: HTMLElement | undefined;
|
|
19
20
|
hideTimeout: number | undefined;
|
|
@@ -54,5 +55,5 @@ export declare class TooltipDirective implements AfterViewInit, OnDestroy, OnIni
|
|
|
54
55
|
updateText(): void;
|
|
55
56
|
setCssVariables(): void;
|
|
56
57
|
static ɵfac: i0.ɵɵFactoryDeclaration<TooltipDirective, never>;
|
|
57
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<TooltipDirective, "[apTooltip]", never, { "
|
|
58
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<TooltipDirective, "[apTooltip]", never, { "apTooltip": { "alias": "apTooltip"; "required": true; "isSignal": true; }; "apTooltipPosition": { "alias": "apTooltipPosition"; "required": false; "isSignal": true; }; "apTooltipShowDelay": { "alias": "apTooltipShowDelay"; "required": false; "isSignal": true; }; "apTooltipHideDelay": { "alias": "apTooltipHideDelay"; "required": false; "isSignal": true; }; "apTooltipDuration": { "alias": "apTooltipDuration"; "required": false; "isSignal": true; }; "apTooltipDisabled": { "alias": "apTooltipDisabled"; "required": false; "isSignal": true; }; "apTooltipTruncatedTextOnly": { "alias": "apTooltipTruncatedTextOnly"; "required": false; "isSignal": true; }; "apTooltipTemplateContext": { "alias": "apTooltipTemplateContext"; "required": false; "isSignal": true; }; "apTooltipVirtualScrollElement": { "alias": "apTooltipVirtualScrollElement"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
58
59
|
}
|
|
Binary file
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { TooltipDirective } from '@agorapulse/ui-components/tooltip';
|
|
2
|
-
import { ElementRef, OnDestroy, OnInit } from '@angular/core';
|
|
3
|
-
import * as i0 from "@angular/core";
|
|
4
|
-
export declare class TruncateTooltipDirective implements OnInit, OnDestroy {
|
|
5
|
-
private tooltip;
|
|
6
|
-
private elementRef;
|
|
7
|
-
truncateTooltip: string;
|
|
8
|
-
displayOnlyOnTruncate: boolean;
|
|
9
|
-
private elementRefMouseOver$;
|
|
10
|
-
constructor(tooltip: TooltipDirective, elementRef: ElementRef<HTMLElement>);
|
|
11
|
-
private updateTruncateState;
|
|
12
|
-
ngOnInit(): void;
|
|
13
|
-
ngOnDestroy(): void;
|
|
14
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<TruncateTooltipDirective, never>;
|
|
15
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<TruncateTooltipDirective, "[apTooltip][truncateTooltip]", never, { "truncateTooltip": { "alias": "truncateTooltip"; "required": true; }; "displayOnlyOnTruncate": { "alias": "displayOnlyOnTruncate"; "required": false; }; }, {}, never, never, true, never>;
|
|
16
|
-
}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
// Angular
|
|
2
|
-
import { Directive, Input } from '@angular/core';
|
|
3
|
-
// Third-parties
|
|
4
|
-
import { fromEvent } from 'rxjs';
|
|
5
|
-
import * as i0 from "@angular/core";
|
|
6
|
-
import * as i1 from "@agorapulse/ui-components/tooltip";
|
|
7
|
-
export class TruncateTooltipDirective {
|
|
8
|
-
tooltip;
|
|
9
|
-
elementRef;
|
|
10
|
-
truncateTooltip;
|
|
11
|
-
displayOnlyOnTruncate = false;
|
|
12
|
-
elementRefMouseOver$;
|
|
13
|
-
constructor(tooltip, elementRef) {
|
|
14
|
-
this.tooltip = tooltip;
|
|
15
|
-
this.elementRef = elementRef;
|
|
16
|
-
}
|
|
17
|
-
updateTruncateState() {
|
|
18
|
-
const element = this.elementRef.nativeElement;
|
|
19
|
-
const truncated = element.scrollWidth > element.clientWidth;
|
|
20
|
-
// In case a default tooltip content exists, even not truncated, the tooltip stay displayed
|
|
21
|
-
this.tooltip.content = truncated ? this.truncateTooltip : this.displayOnlyOnTruncate ? undefined : this.truncateTooltip;
|
|
22
|
-
}
|
|
23
|
-
ngOnInit() {
|
|
24
|
-
this.elementRefMouseOver$ = fromEvent(this.elementRef.nativeElement, 'mouseover').subscribe(() => this.updateTruncateState());
|
|
25
|
-
}
|
|
26
|
-
ngOnDestroy() {
|
|
27
|
-
this.elementRefMouseOver$.unsubscribe();
|
|
28
|
-
}
|
|
29
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: TruncateTooltipDirective, deps: [{ token: i1.TooltipDirective }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
30
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.3", type: TruncateTooltipDirective, isStandalone: true, selector: "[apTooltip][truncateTooltip]", inputs: { truncateTooltip: "truncateTooltip", displayOnlyOnTruncate: "displayOnlyOnTruncate" }, ngImport: i0 });
|
|
31
|
-
}
|
|
32
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.3", ngImport: i0, type: TruncateTooltipDirective, decorators: [{
|
|
33
|
-
type: Directive,
|
|
34
|
-
args: [{ selector: '[apTooltip][truncateTooltip]', standalone: true }]
|
|
35
|
-
}], ctorParameters: () => [{ type: i1.TooltipDirective }, { type: i0.ElementRef }], propDecorators: { truncateTooltip: [{
|
|
36
|
-
type: Input,
|
|
37
|
-
args: [{
|
|
38
|
-
required: true,
|
|
39
|
-
}]
|
|
40
|
-
}], displayOnlyOnTruncate: [{
|
|
41
|
-
type: Input
|
|
42
|
-
}] } });
|
|
43
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHJ1bmNhdGUtdG9vbHRpcC5kaXJlY3RpdmUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9saWJzL3VpLWNvbXBvbmVudHMvZGlyZWN0aXZlcy9zcmMvdHJ1bmNhdGUtdG9vbHRpcC5kaXJlY3RpdmUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBRUEsVUFBVTtBQUNWLE9BQU8sRUFBRSxTQUFTLEVBQWMsS0FBSyxFQUFxQixNQUFNLGVBQWUsQ0FBQztBQUNoRixnQkFBZ0I7QUFDaEIsT0FBTyxFQUFFLFNBQVMsRUFBZ0IsTUFBTSxNQUFNLENBQUM7OztBQUcvQyxNQUFNLE9BQU8sd0JBQXdCO0lBV3JCO0lBQ0E7SUFSWixlQUFlLENBQVU7SUFFaEIscUJBQXFCLEdBQUcsS0FBSyxDQUFDO0lBRS9CLG9CQUFvQixDQUFnQjtJQUU1QyxZQUNZLE9BQXlCLEVBQ3pCLFVBQW1DO1FBRG5DLFlBQU8sR0FBUCxPQUFPLENBQWtCO1FBQ3pCLGVBQVUsR0FBVixVQUFVLENBQXlCO0lBQzVDLENBQUM7SUFFSSxtQkFBbUI7UUFDdkIsTUFBTSxPQUFPLEdBQUcsSUFBSSxDQUFDLFVBQVUsQ0FBQyxhQUFhLENBQUM7UUFDOUMsTUFBTSxTQUFTLEdBQUcsT0FBTyxDQUFDLFdBQVcsR0FBRyxPQUFPLENBQUMsV0FBVy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