@agorapulse/ui-components 20.3.38 → 20.3.39

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/button/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import * as i0 from '@angular/core';
2
- import { ElementRef, EventEmitter } from '@angular/core';
1
+ import * as _angular_core from '@angular/core';
2
+ import { ElementRef } from '@angular/core';
3
3
  import * as i1 from '@agorapulse/ui-components/directives';
4
4
  import { BaseButtonDirective } from '@agorapulse/ui-components/directives';
5
5
  import { MatMenuPanel } from '@angular/material/menu';
@@ -23,24 +23,34 @@ type ButtonConfig = {
23
23
  style: 'mermaid';
24
24
  color?: never;
25
25
  };
26
+ declare const defaultButtonConfig: ButtonConfig;
26
27
  declare class ButtonComponent {
27
28
  readonly baseButtonDirective: BaseButtonDirective;
28
- buttonElement: ElementRef<HTMLButtonElement>;
29
- ariaLabel: string;
30
- disabled: boolean | undefined;
31
- name: string;
32
- form: string | undefined;
33
- config: ButtonConfig;
34
- loading: boolean | undefined;
35
- locked: boolean;
36
- menuTrigger: MatMenuPanel | null;
37
- symbolPosition: 'left' | 'right';
38
- symbolId: i0.InputSignal<string | undefined>;
39
- menuOpened: EventEmitter<void>;
40
- menuClosed: EventEmitter<void>;
41
- click: EventEmitter<MouseEvent>;
42
- focus: EventEmitter<FocusEvent>;
43
- blur: EventEmitter<FocusEvent>;
29
+ buttonElement: _angular_core.Signal<ElementRef<HTMLButtonElement>>;
30
+ ariaLabel: _angular_core.InputSignal<string | undefined>;
31
+ disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
32
+ name: _angular_core.InputSignal<string | undefined>;
33
+ form: _angular_core.InputSignal<string | undefined>;
34
+ config: _angular_core.InputSignalWithTransform<ButtonConfig, ButtonConfig | undefined>;
35
+ loading: _angular_core.InputSignalWithTransform<boolean, unknown>;
36
+ locked: _angular_core.InputSignalWithTransform<boolean, unknown>;
37
+ menuTrigger: _angular_core.InputSignal<MatMenuPanel<any> | null>;
38
+ symbolPosition: _angular_core.InputSignal<"left" | "right">;
39
+ symbolId: _angular_core.InputSignal<string | undefined>;
40
+ menuOpened: _angular_core.OutputEmitterRef<void>;
41
+ menuClosed: _angular_core.OutputEmitterRef<void>;
42
+ click: _angular_core.OutputEmitterRef<MouseEvent>;
43
+ focus: _angular_core.OutputEmitterRef<FocusEvent>;
44
+ blur: _angular_core.OutputEmitterRef<FocusEvent>;
45
+ buttonClasses: _angular_core.Signal<{
46
+ locked: boolean;
47
+ inverse: boolean;
48
+ } | {
49
+ loading: boolean;
50
+ transparent: boolean;
51
+ stroked: boolean;
52
+ inverse: boolean;
53
+ }>;
44
54
  focused: boolean;
45
55
  private readonly symbolRegistry;
46
56
  constructor();
@@ -48,9 +58,9 @@ declare class ButtonComponent {
48
58
  onBlurHandle($event: FocusEvent): void;
49
59
  onFocusHandle($event: FocusEvent): void;
50
60
  onSpaceKeyUp(event: KeyboardEvent): void;
51
- static ɵfac: i0.ɵɵFactoryDeclaration<ButtonComponent, never>;
52
- static ɵcmp: i0.ɵɵComponentDeclaration<ButtonComponent, "ap-button", never, { "ariaLabel": { "alias": "ariaLabel"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "name": { "alias": "name"; "required": true; }; "form": { "alias": "form"; "required": false; }; "config": { "alias": "config"; "required": false; }; "loading": { "alias": "loading"; "required": false; }; "locked": { "alias": "locked"; "required": false; }; "menuTrigger": { "alias": "menuTrigger"; "required": false; }; "symbolPosition": { "alias": "symbolPosition"; "required": false; }; "symbolId": { "alias": "symbolId"; "required": false; "isSignal": true; }; }, { "menuOpened": "menuOpened"; "menuClosed": "menuClosed"; "click": "click"; "focus": "focus"; "blur": "blur"; }, never, ["*", "ap-symbol"], true, [{ directive: typeof i1.BaseButtonDirective; inputs: {}; outputs: {}; }]>;
53
- static ngAcceptInputType_disabled: unknown;
61
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<ButtonComponent, never>;
62
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<ButtonComponent, "ap-button", never, { "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": false; "isSignal": true; }; "form": { "alias": "form"; "required": false; "isSignal": true; }; "config": { "alias": "config"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "locked": { "alias": "locked"; "required": false; "isSignal": true; }; "menuTrigger": { "alias": "menuTrigger"; "required": false; "isSignal": true; }; "symbolPosition": { "alias": "symbolPosition"; "required": false; "isSignal": true; }; "symbolId": { "alias": "symbolId"; "required": false; "isSignal": true; }; }, { "menuOpened": "menuOpened"; "menuClosed": "menuClosed"; "click": "click"; "focus": "focus"; "blur": "blur"; }, never, ["*", "ap-symbol"], true, [{ directive: typeof i1.BaseButtonDirective; inputs: {}; outputs: {}; }]>;
54
63
  }
55
64
 
56
- export { ButtonComponent };
65
+ export { ButtonComponent, defaultButtonConfig };
66
+ export type { ButtonConfig };
@@ -1,5 +1,4 @@
1
1
  import { ModalConfig } from '@agorapulse/ui-components/modal';
2
- import { ComponentType } from '@angular/cdk/portal';
3
2
  import { MatDialogRef, MatDialog } from '@angular/material/dialog';
4
3
  import * as i0 from '@angular/core';
5
4
 
@@ -13,17 +12,17 @@ interface ConfirmModalTexts {
13
12
  }
14
13
 
15
14
  declare class ConfirmModalComponent {
16
- dialogRef: MatDialogRef<ComponentType<any>>;
15
+ dialogRef: MatDialogRef<ConfirmModalComponent, boolean>;
17
16
  contentText: string;
18
17
  footerCancelButtonId: string;
19
18
  footerCancelButtonLabel: string;
20
19
  footerConfirmButtonId: string;
21
20
  footerConfirmButtonLabel: string;
22
21
  headerTitle: string;
23
- constructor(dialogRef: MatDialogRef<ComponentType<any>>);
22
+ constructor(dialogRef: MatDialogRef<ConfirmModalComponent, boolean>);
24
23
  onCancel(): void;
25
24
  onConfirm(): void;
26
- static open(dialog: MatDialog, confirmModalTexts: ConfirmModalTexts, modalConfig?: ModalConfig | null): MatDialogRef<ConfirmModalComponent, any>;
25
+ static open(dialog: MatDialog, confirmModalTexts: ConfirmModalTexts, modalConfig?: ModalConfig | null): MatDialogRef<ConfirmModalComponent, boolean>;
27
26
  static ɵfac: i0.ɵɵFactoryDeclaration<ConfirmModalComponent, never>;
28
27
  static ɵcmp: i0.ɵɵComponentDeclaration<ConfirmModalComponent, "ap-confirm-modal", never, { "contentText": { "alias": "contentText"; "required": false; }; "footerCancelButtonId": { "alias": "footerCancelButtonId"; "required": false; }; "footerCancelButtonLabel": { "alias": "footerCancelButtonLabel"; "required": false; }; "footerConfirmButtonId": { "alias": "footerConfirmButtonId"; "required": false; }; "footerConfirmButtonLabel": { "alias": "footerConfirmButtonLabel"; "required": false; }; "headerTitle": { "alias": "headerTitle"; "required": false; }; }, {}, never, never, true, never>;
29
28
  }
@@ -3,46 +3,66 @@ import { BaseButtonDirective } from '@agorapulse/ui-components/directives';
3
3
  import { UI_COMPONENTS_SYMBOLS } from '@agorapulse/ui-components/providers';
4
4
  import { SymbolRegistry, SymbolComponent } from '@agorapulse/ui-symbol';
5
5
  import * as i0 from '@angular/core';
6
- import { inject, input, EventEmitter, booleanAttribute, HostListener, Output, Input, ViewChild, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
6
+ import { inject, viewChild, input, booleanAttribute, output, computed, HostListener, ViewEncapsulation, ChangeDetectionStrategy, Component } from '@angular/core';
7
7
  import * as i2 from '@angular/material/menu';
8
8
  import { MatMenuModule } from '@angular/material/menu';
9
9
 
10
+ const defaultButtonConfig = {
11
+ style: 'primary',
12
+ color: 'orange',
13
+ };
10
14
  class ButtonComponent {
11
15
  baseButtonDirective = inject(BaseButtonDirective, { self: true });
12
- buttonElement;
13
- ariaLabel = '';
14
- disabled = false;
15
- name = '';
16
- form = undefined;
17
- config = {
18
- style: 'primary',
19
- color: 'orange',
20
- };
21
- loading = false;
22
- locked = false;
23
- menuTrigger = null;
24
- symbolPosition = 'right';
16
+ buttonElement = viewChild.required('button');
17
+ ariaLabel = input(...(ngDevMode ? [undefined, { debugName: "ariaLabel" }] : []));
18
+ disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
19
+ name = input(...(ngDevMode ? [undefined, { debugName: "name" }] : []));
20
+ form = input(...(ngDevMode ? [undefined, { debugName: "form" }] : []));
21
+ config = input(defaultButtonConfig, ...(ngDevMode ? [{ debugName: "config", transform: (value) => value ?? defaultButtonConfig }] : [{ transform: (value) => value ?? defaultButtonConfig }]));
22
+ loading = input(false, ...(ngDevMode ? [{ debugName: "loading", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
23
+ locked = input(false, ...(ngDevMode ? [{ debugName: "locked", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
24
+ menuTrigger = input(null, ...(ngDevMode ? [{ debugName: "menuTrigger" }] : []));
25
+ symbolPosition = input('right', ...(ngDevMode ? [{ debugName: "symbolPosition" }] : []));
25
26
  symbolId = input(...(ngDevMode ? [undefined, { debugName: "symbolId" }] : []));
26
- menuOpened = new EventEmitter();
27
- menuClosed = new EventEmitter();
27
+ menuOpened = output();
28
+ menuClosed = output();
28
29
  // eslint-disable-next-line @angular-eslint/no-output-native
29
- click = new EventEmitter();
30
+ click = output();
30
31
  // eslint-disable-next-line @angular-eslint/no-output-native
31
- focus = new EventEmitter();
32
+ focus = output();
32
33
  // eslint-disable-next-line @angular-eslint/no-output-native
33
- blur = new EventEmitter();
34
+ blur = output();
35
+ buttonClasses = computed(() => {
36
+ const cfg = this.config();
37
+ const isLocked = this.locked();
38
+ return {
39
+ inverse: this.symbolPosition() === 'left',
40
+ ...(isLocked
41
+ ? { locked: true }
42
+ : {
43
+ // Style
44
+ [cfg.style]: true,
45
+ transparent: cfg.style === 'stroked-transparent',
46
+ stroked: cfg.style === 'stroked' || cfg.style === 'stroked-transparent',
47
+ // Color
48
+ ...(cfg.color ? { [cfg.color]: true } : {}),
49
+ // Loading state
50
+ loading: this.loading(),
51
+ }),
52
+ };
53
+ }, ...(ngDevMode ? [{ debugName: "buttonClasses" }] : []));
34
54
  focused = false;
35
55
  symbolRegistry = inject(SymbolRegistry);
36
56
  constructor() {
37
57
  this.symbolRegistry.withSymbols(...(inject(UI_COMPONENTS_SYMBOLS, { optional: true })?.flat() ?? []));
38
58
  }
39
59
  onClickHandle($event) {
40
- if (this.disabled || this.loading) {
60
+ if (this.disabled() || this.loading()) {
41
61
  return;
42
62
  }
43
63
  $event.stopImmediatePropagation();
44
64
  this.click.emit($event);
45
- this.buttonElement.nativeElement.blur();
65
+ this.buttonElement().nativeElement.blur();
46
66
  this.blur.emit($event);
47
67
  }
48
68
  onBlurHandle($event) {
@@ -54,57 +74,20 @@ class ButtonComponent {
54
74
  this.focus.emit($event);
55
75
  }
56
76
  onSpaceKeyUp(event) {
57
- if (this.focused && !this.disabled && !this.loading) {
77
+ if (this.focused && !this.disabled() && !this.loading()) {
58
78
  event.preventDefault();
59
- this.buttonElement.nativeElement.click();
79
+ this.buttonElement().nativeElement.click();
60
80
  }
61
81
  }
62
82
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: ButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
63
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.3", type: ButtonComponent, isStandalone: true, selector: "ap-button", inputs: { ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: false, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: false, isRequired: false, transformFunction: booleanAttribute }, name: { classPropertyName: "name", publicName: "name", isSignal: false, isRequired: true, transformFunction: null }, form: { classPropertyName: "form", publicName: "form", isSignal: false, isRequired: false, transformFunction: null }, config: { classPropertyName: "config", publicName: "config", isSignal: false, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: false, isRequired: false, transformFunction: null }, locked: { classPropertyName: "locked", publicName: "locked", isSignal: false, isRequired: false, transformFunction: null }, menuTrigger: { classPropertyName: "menuTrigger", publicName: "menuTrigger", isSignal: false, isRequired: false, transformFunction: null }, symbolPosition: { classPropertyName: "symbolPosition", publicName: "symbolPosition", isSignal: false, isRequired: false, transformFunction: null }, symbolId: { classPropertyName: "symbolId", publicName: "symbolId", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { menuOpened: "menuOpened", menuClosed: "menuClosed", click: "click", focus: "focus", blur: "blur" }, host: { listeners: { "window:keyup.space": "onSpaceKeyUp($event)" }, properties: { "attr.disabled": "loading || disabled || null" } }, viewQueries: [{ propertyName: "buttonElement", first: true, predicate: ["button"], descendants: true }], hostDirectives: [{ directive: i1.BaseButtonDirective }], ngImport: i0, template: "<button\n #button\n #trigger=\"matMenuTrigger\"\n role=\"button\"\n [matMenuTriggerFor]=\"menuTrigger\"\n [class.primary]=\"config.style === 'primary' && !locked\"\n [class.secondary]=\"config.style === 'secondary' && !locked\"\n [class.ghost]=\"config.style === 'ghost' && !locked\"\n [class.stroked]=\"(config.style === 'stroked' || config.style === 'stroked-transparent') && !locked\"\n [class.transparent]=\"config.style === 'stroked-transparent' && !locked\"\n [class.mermaid]=\"config.style === 'mermaid' && !locked\"\n [class.orange]=\"config.color === 'orange' && !locked\"\n [class.blue]=\"config.color === 'blue' && !locked\"\n [class.red]=\"config.color === 'red' && !locked\"\n [class.grey]=\"config.color === 'grey' && !locked\"\n [class.green]=\"config.color === 'green' && !locked\"\n [class.loading]=\"loading && !locked\"\n [class.locked]=\"locked\"\n [class.inverse]=\"symbolPosition === 'left'\"\n [disabled]=\"disabled && !locked\"\n [name]=\"name\"\n [attr.data-test]=\"baseButtonDirective.hostDataTest ?? name\"\n [attr.id]=\"baseButtonDirective.hostId\"\n [attr.type]=\"baseButtonDirective.hostType\"\n [attr.form]=\"form\"\n [attr.aria-label]=\"ariaLabel || null\"\n [attr.aria-disabled]=\"disabled?.toString()\"\n (click)=\"onClickHandle($event)\"\n (focus)=\"onFocusHandle($event)\"\n (blur)=\"onBlurHandle($event)\"\n (menuOpened)=\"menuOpened.emit()\"\n (menuClosed)=\"menuClosed.emit()\">\n <ng-content />\n @if (symbolId()) {\n <ap-symbol [symbolId]=\"symbolId()\" />\n } @else {\n <ng-content select=\"ap-symbol\" />\n }\n @if (loading && !locked) {\n <div class=\"loading-bar\"></div>\n }\n</button>\n@if (locked) {\n <div class=\"locked-symbol\">\n <ap-symbol\n symbolId=\"feature-lock\"\n size=\"sm\" />\n </div>\n}\n", styles: ["ap-button{--loading-bar-width: 50px;display:inline-block;position:relative}ap-button[disabled]{pointer-events:none}ap-button button{border:none;border-radius:var(--comp-button-border-radius);padding:var(--comp-button-padding-horizontal) var(--comp-button-padding-vertical);position:relative;overflow:hidden;display:flex;justify-content:center;align-items:center;gap:var(--comp-split-button-spacing);flex-direction:row;font-size:var(--comp-button-text-size);font-family:var(--comp-button-text-font-family);line-height:var(--comp-button-text-line-height);font-weight:var(--comp-button-text-weight);max-height:var(--comp-button-height);min-height:var(--comp-button-height);white-space:nowrap;text-overflow:ellipsis;width:100%}ap-button button ap-symbol{width:16px;min-width:16px;max-width:16px;height:16px;min-height:16px;max-height:16px}ap-button button.inverse{flex-direction:row-reverse}ap-button button:hover:not(:disabled):not(.loading){cursor:pointer}ap-button button:disabled{pointer-events:none}@media (hover: hover){ap-button button:focus:not(:disabled):not(:active):not(.loading){outline:2px solid var(--ref-color-electric-blue-100);outline-offset:1px}}ap-button button.loading{pointer-events:none}ap-button button.primary{color:var(--ref-color-white)}ap-button button.primary ap-symbol{color:var(--ref-color-white)}ap-button button.primary.orange{background:var(--ref-color-orange-100)}ap-button button.primary.orange:hover{background-color:var(--ref-color-orange-80)}ap-button button.primary.orange:active:not(:disabled){background-color:var(--ref-color-orange-60)}ap-button button.primary.orange:disabled{background-color:var(--ref-color-orange-20)}ap-button button.primary.orange.loading{background-color:var(--ref-color-orange-60)}ap-button button.primary.orange .loading-bar{background-color:var(--ref-color-orange-100)}ap-button button.primary.blue{background:var(--ref-color-electric-blue-100)}ap-button button.primary.blue:hover{background-color:var(--ref-color-electric-blue-80)}ap-button button.primary.blue:active:not(:disabled){background-color:var(--ref-color-electric-blue-60)}ap-button button.primary.blue:disabled{background-color:var(--ref-color-electric-blue-20)}ap-button button.primary.blue.loading{background-color:var(--ref-color-electric-blue-60)}ap-button button.primary.blue .loading-bar{background-color:var(--ref-color-electric-blue-100)}ap-button button.secondary.orange{background:var(--ref-color-orange-10);color:var(--ref-color-orange-100)}ap-button button.secondary.orange ap-symbol{color:var(--ref-color-orange-100)}ap-button button.secondary.orange:hover{background-color:var(--ref-color-orange-20)}ap-button button.secondary.orange:active:not(:disabled){background-color:var(--ref-color-orange-40)}ap-button button.secondary.orange:focus:not(:disabled):not(:active){background-color:var(--ref-color-orange-10)}ap-button button.secondary.orange:disabled{background-color:var(--ref-color-orange-10);color:var(--ref-color-orange-20)}ap-button button.secondary.orange:disabled ap-symbol{color:var(--ref-color-orange-20)}ap-button button.secondary.orange.loading{background-color:var(--ref-color-orange-40)}ap-button button.secondary.orange .loading-bar{background-color:var(--ref-color-orange-100)}ap-button button.secondary.blue{background:var(--ref-color-electric-blue-10);color:var(--ref-color-electric-blue-100)}ap-button button.secondary.blue ap-symbol{color:var(--ref-color-electric-blue-100)}ap-button button.secondary.blue:hover{background-color:var(--ref-color-electric-blue-20)}ap-button button.secondary.blue:active:not(:disabled){background-color:var(--ref-color-electric-blue-40)}ap-button button.secondary.blue:focus:not(:disabled):not(:active){background-color:var(--ref-color-electric-blue-10)}ap-button button.secondary.blue:disabled{background-color:var(--ref-color-electric-blue-10);color:var(--ref-color-electric-blue-20)}ap-button button.secondary.blue:disabled ap-symbol{color:var(--ref-color-electric-blue-20)}ap-button button.secondary.blue.loading{background-color:var(--ref-color-electric-blue-40)}ap-button button.secondary.blue .loading-bar{background-color:var(--ref-color-electric-blue-100)}ap-button button.mermaid{background:linear-gradient(90deg,#578fff,#df52ff);color:var(--ref-color-grey-100);border:none;border-radius:var(--ref-border-radius-sm);position:relative;z-index:1}ap-button button.mermaid:after{content:\"\";position:absolute;inset:1px;background:var(--ref-color-white);border-radius:calc(var(--ref-border-radius-sm) - 1px);z-index:-1;pointer-events:none}ap-button button.mermaid ng-content,ap-button button.mermaid ap-symbol,ap-button button.mermaid .loading-bar{position:relative;z-index:1}ap-button button.mermaid:first-line{position:relative;z-index:1}ap-button button.mermaid:hover:after{background:var(--ref-color-mermaid-10)}ap-button button.mermaid:active:not(:disabled):after{background:var(--ref-color-mermaid-20)}@media (hover: hover){ap-button button.mermaid:focus:not(:disabled):not(:active):not(.loading){outline:2px solid var(--ref-color-electric-blue-100);outline-offset:1px}}ap-button button.mermaid:disabled{background:linear-gradient(90deg,var(--ref-color-mermaid-gradient-from40) 0%,var(--ref-color-mermaid-gradient-to40) 100%)}ap-button button.mermaid:disabled:after{background:var(--ref-color-white)}ap-button button.mermaid:disabled ap-symbol{opacity:.4}ap-button button.mermaid:disabled{color:var(--ref-color-grey-20)}ap-button button.mermaid.loading{background:linear-gradient(90deg,var(--ref-color-mermaid-gradient-from40) 0%,var(--ref-color-mermaid-gradient-to40) 100%)}ap-button button.mermaid.loading:after{background:var(--ref-color-white)}ap-button button.mermaid.loading ap-symbol{opacity:.4}ap-button button.mermaid.loading{color:var(--ref-color-grey-40)}ap-button button.mermaid .loading-bar{background:linear-gradient(90deg,var(--ref-color-mermaid-gradient-from) 0%,var(--ref-color-mermaid-gradient-to) 100%);position:absolute;z-index:2}ap-button button.stroked{background:var(--ref-color-white);border-width:1px;border-style:solid}ap-button button.stroked.grey{border-color:var(--ref-color-grey-20);color:var(--ref-color-grey-80)}ap-button button.stroked.grey ap-symbol{color:var(--ref-color-grey-80)}ap-button button.stroked.grey:hover{border-color:var(--ref-color-grey-40)}ap-button button.stroked.grey:active:not(:disabled){border-color:var(--ref-color-grey-60)}ap-button button.stroked.grey:focus:not(:disabled):not(:active){border-color:var(--ref-color-grey-20)}ap-button button.stroked.grey:disabled{border-color:var(--ref-color-grey-20);color:var(--ref-color-grey-20)}ap-button button.stroked.grey:disabled ap-symbol{color:var(--ref-color-grey-20)}ap-button button.stroked.grey.loading{border-color:var(--ref-color-grey-20);color:var(--ref-color-grey-40)}ap-button button.stroked.grey.loading ap-symbol{color:var(--ref-color-grey-40)}ap-button button.stroked.grey .loading-bar{background-color:var(--ref-color-grey-80)}ap-button button.stroked.blue{border-color:var(--ref-color-electric-blue-60);color:var(--ref-color-electric-blue-100)}ap-button button.stroked.blue ap-symbol{color:var(--ref-color-electric-blue-100)}ap-button button.stroked.blue:hover{border-color:var(--ref-color-electric-blue-80)}ap-button button.stroked.blue:active:not(:disabled){border-color:var(--ref-color-electric-blue-100)}ap-button button.stroked.blue:focus:not(:disabled):not(:active){border-color:var(--ref-color-electric-blue-60)}ap-button button.stroked.blue:disabled{border-color:var(--ref-color-electric-blue-20);color:var(--ref-color-electric-blue-20)}ap-button button.stroked.blue:disabled ap-symbol{color:var(--ref-color-electric-blue-20)}ap-button button.stroked.blue.loading{border-color:var(--ref-color-electric-blue-20);color:var(--ref-color-electric-blue-40)}ap-button button.stroked.blue.loading ap-symbol{color:var(--ref-color-electric-blue-40)}ap-button button.stroked.blue .loading-bar{background-color:var(--ref-color-electric-blue-100)}ap-button button.stroked.red{border-color:var(--ref-color-red-60);color:var(--ref-color-red-100)}ap-button button.stroked.red ap-symbol{color:var(--ref-color-red-100)}ap-button button.stroked.red:hover{border-color:var(--ref-color-red-80)}ap-button button.stroked.red:active:not(:disabled){border-color:var(--ref-color-red-100)}ap-button button.stroked.red:focus:not(:disabled):not(:active){border-color:var(--ref-color-red-60)}ap-button button.stroked.red:disabled{border-color:var(--ref-color-red-20);color:var(--ref-color-red-20)}ap-button button.stroked.red:disabled ap-symbol{color:var(--ref-color-red-20)}ap-button button.stroked.red.loading{border-color:var(--ref-color-red-20);color:var(--ref-color-red-40)}ap-button button.stroked.red.loading ap-symbol{color:var(--ref-color-red-40)}ap-button button.stroked.red .loading-bar{background-color:var(--ref-color-red-100)}ap-button button.transparent{background:transparent}ap-button button.ghost{background:transparent}ap-button button.ghost.grey{color:var(--ref-color-grey-80)}ap-button button.ghost.grey ap-symbol{color:var(--ref-color-grey-80)}ap-button button.ghost.grey:hover{background-color:var(--ref-color-grey-05)}ap-button button.ghost.grey:active:not(:disabled){background-color:var(--ref-color-grey-10)}ap-button button.ghost.grey:focus:not(:disabled):not(:active){background-color:var(--ref-color-grey-10)}ap-button button.ghost.grey:disabled{color:var(--ref-color-grey-20)}ap-button button.ghost.grey:disabled ap-symbol{color:var(--ref-color-grey-20)}ap-button button.ghost.grey.loading:not(.locked){color:var(--ref-color-grey-40)}ap-button button.ghost.grey.loading:not(.locked) ap-symbol{color:var(--ref-color-grey-40)}ap-button button.ghost.grey .loading-bar{background-color:var(--ref-color-grey-80)}ap-button button.ghost.blue{color:var(--ref-color-electric-blue-100)}ap-button button.ghost.blue ap-symbol{color:var(--ref-color-electric-blue-100)}ap-button button.ghost.blue:hover{background-color:var(--ref-color-electric-blue-10)}ap-button button.ghost.blue:active:not(:disabled){background-color:var(--ref-color-electric-blue-20)}ap-button button.ghost.blue:focus:not(:disabled):not(:active){background-color:var(--ref-color-electric-blue-20)}ap-button button.ghost.blue:disabled{color:var(--ref-color-electric-blue-20)}ap-button button.ghost.blue:disabled ap-symbol{color:var(--ref-color-electric-blue-20)}ap-button button.ghost.blue.loading:not(.locked){color:var(--ref-color-electric-blue-40)}ap-button button.ghost.blue.loading:not(.locked) ap-symbol{color:var(--ref-color-electric-blue-40)}ap-button button.ghost.blue .loading-bar{background-color:var(--ref-color-electric-blue-100)}ap-button button.ghost.red{color:var(--ref-color-red-100)}ap-button button.ghost.red ap-symbol{color:var(--ref-color-red-100)}ap-button button.ghost.red:hover{background-color:var(--ref-color-red-10)}ap-button button.ghost.red:active:not(:disabled){background-color:var(--ref-color-red-20)}ap-button button.ghost.red:focus:not(:disabled):not(:active){background-color:var(--ref-color-red-20)}ap-button button.ghost.red:disabled{color:var(--ref-color-red-20)}ap-button button.ghost.red:disabled ap-symbol{color:var(--ref-color-red-20)}ap-button button.ghost.red.loading:not(.locked){color:var(--ref-color-red-40)}ap-button button.ghost.red.loading:not(.locked) ap-symbol{color:var(--ref-color-red-40)}ap-button button.ghost.red .loading-bar{background-color:var(--ref-color-red-100)}ap-button button.ghost.green{color:var(--ref-color-green-100)}ap-button button.ghost.green ap-symbol{color:var(--ref-color-green-100)}ap-button button.ghost.green:hover{background-color:var(--ref-color-green-10)}ap-button button.ghost.green:active:not(:disabled){background-color:var(--ref-color-green-20)}ap-button button.ghost.green:focus:not(:disabled):not(:active){background-color:var(--ref-color-green-20)}ap-button button.ghost.green:disabled{color:var(--ref-color-green-20)}ap-button button.ghost.green:disabled ap-symbol{color:var(--ref-color-green-20)}ap-button button.ghost.green.loading:not(.locked){color:var(--ref-color-green-40)}ap-button button.ghost.green.loading:not(.locked) ap-symbol{color:var(--ref-color-green-40)}ap-button button.ghost.green .loading-bar{background-color:var(--ref-color-green-100)}ap-button button.locked{background-color:var(--ref-color-purple-10);color:var(--ref-color-purple-80)}ap-button button.locked ap-symbol{color:var(--ref-color-purple-80)}ap-button button.locked:hover{background-color:var(--ref-color-purple-20);border-color:var(--ref-color-purple-40)}ap-button button.locked:active:not(:disabled){background-color:var(--ref-color-purple-40);border-color:var(--ref-color-purple-60)}ap-button button.locked:focus:not(:disabled):not(:active){background-color:var(--ref-color-purple-20);border-color:var(--ref-color-purple-20)}ap-button button.locked:disabled{color:var(--ref-color-purple-)}ap-button button.locked:disabled ap-symbol{color:var(--ref-color-purple-)}ap-button button.locked.loading:not(.locked){color:var(--ref-color-purple-)}ap-button button.locked.loading:not(.locked) ap-symbol{color:var(--ref-color-purple-)}ap-button button.locked .loading-bar{background-color:var(--ref-color-purple-)}ap-button button.locked{border:1px solid var(--ref-color-purple-20)}ap-button .loading-bar{position:absolute;bottom:0;left:var(--comp-button-padding-vertical);width:var(--loading-bar-width);height:5px;border-radius:8px;animation:slide 1.5s ease-in-out infinite}@keyframes slide{0%{left:calc(var(--loading-bar-width) * -1)}to{left:100%}}ap-button .locked-symbol{position:absolute;top:-6px;right:-6px;border-radius:100%;background:var(--ref-color-white)}ap-button .locked-symbol ap-symbol{color:var(--ref-color-purple-100)}\n"], dependencies: [{ kind: "component", type: SymbolComponent, selector: "ap-symbol", inputs: ["symbolId", "color", "size"], outputs: ["sizeChange"] }, { kind: "ngmodule", type: MatMenuModule }, { kind: "directive", type: i2.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
83
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.3", type: ButtonComponent, isStandalone: true, selector: "ap-button", inputs: { ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, form: { classPropertyName: "form", publicName: "form", isSignal: true, isRequired: false, transformFunction: null }, config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, locked: { classPropertyName: "locked", publicName: "locked", isSignal: true, isRequired: false, transformFunction: null }, menuTrigger: { classPropertyName: "menuTrigger", publicName: "menuTrigger", isSignal: true, isRequired: false, transformFunction: null }, symbolPosition: { classPropertyName: "symbolPosition", publicName: "symbolPosition", isSignal: true, isRequired: false, transformFunction: null }, symbolId: { classPropertyName: "symbolId", publicName: "symbolId", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { menuOpened: "menuOpened", menuClosed: "menuClosed", click: "click", focus: "focus", blur: "blur" }, host: { listeners: { "window:keyup.space": "onSpaceKeyUp($event)" }, properties: { "attr.disabled": "loading() || disabled() || null" } }, viewQueries: [{ propertyName: "buttonElement", first: true, predicate: ["button"], descendants: true, isSignal: true }], hostDirectives: [{ directive: i1.BaseButtonDirective }], ngImport: i0, template: "<button\n #button\n role=\"button\"\n [matMenuTriggerFor]=\"menuTrigger()\"\n [class]=\"buttonClasses()\"\n [disabled]=\"disabled() && !locked()\"\n [attr.name]=\"name()\"\n [attr.data-test]=\"baseButtonDirective.hostDataTest ?? name()\"\n [attr.id]=\"baseButtonDirective.hostId\"\n [attr.type]=\"baseButtonDirective.hostType\"\n [attr.form]=\"form()\"\n [attr.aria-label]=\"ariaLabel() || null\"\n [attr.aria-disabled]=\"disabled()?.toString()\"\n (click)=\"onClickHandle($event)\"\n (focus)=\"onFocusHandle($event)\"\n (blur)=\"onBlurHandle($event)\"\n (menuOpened)=\"menuOpened.emit()\"\n (menuClosed)=\"menuClosed.emit()\">\n <ng-content />\n @if (symbolId()) {\n <ap-symbol [symbolId]=\"symbolId()\" />\n } @else {\n <ng-content select=\"ap-symbol\" />\n }\n @if (loading() && !locked()) {\n <div class=\"loading-bar\"></div>\n }\n</button>\n@if (locked()) {\n <div class=\"locked-symbol\">\n <ap-symbol\n symbolId=\"feature-lock\"\n size=\"sm\" />\n </div>\n}\n", styles: ["ap-button{--loading-bar-width: 50px;display:inline-block;position:relative}ap-button[disabled]{pointer-events:none}ap-button button{border:none;border-radius:var(--comp-button-border-radius);padding:var(--comp-button-padding-horizontal) var(--comp-button-padding-vertical);position:relative;overflow:hidden;display:flex;justify-content:center;align-items:center;gap:var(--comp-split-button-spacing);flex-direction:row;font-size:var(--comp-button-text-size);font-family:var(--comp-button-text-font-family);line-height:var(--comp-button-text-line-height);font-weight:var(--comp-button-text-weight);max-height:var(--comp-button-height);min-height:var(--comp-button-height);white-space:nowrap;text-overflow:ellipsis;width:100%}ap-button button ap-symbol{width:16px;min-width:16px;max-width:16px;height:16px;min-height:16px;max-height:16px}ap-button button.inverse{flex-direction:row-reverse}ap-button button:hover:not(:disabled):not(.loading){cursor:pointer}ap-button button:disabled{pointer-events:none}@media (hover: hover){ap-button button:focus:not(:disabled):not(:active):not(.loading){outline:2px solid var(--ref-color-electric-blue-100);outline-offset:1px}}ap-button button.loading{pointer-events:none}ap-button button.primary{color:var(--ref-color-white)}ap-button button.primary ap-symbol{color:var(--ref-color-white)}ap-button button.primary.orange{background:var(--ref-color-orange-100)}ap-button button.primary.orange:hover{background-color:var(--ref-color-orange-80)}ap-button button.primary.orange:active:not(:disabled){background-color:var(--ref-color-orange-60)}ap-button button.primary.orange:disabled{background-color:var(--ref-color-orange-20)}ap-button button.primary.orange.loading{background-color:var(--ref-color-orange-60)}ap-button button.primary.orange .loading-bar{background-color:var(--ref-color-orange-100)}ap-button button.primary.blue{background:var(--ref-color-electric-blue-100)}ap-button button.primary.blue:hover{background-color:var(--ref-color-electric-blue-80)}ap-button button.primary.blue:active:not(:disabled){background-color:var(--ref-color-electric-blue-60)}ap-button button.primary.blue:disabled{background-color:var(--ref-color-electric-blue-20)}ap-button button.primary.blue.loading{background-color:var(--ref-color-electric-blue-60)}ap-button button.primary.blue .loading-bar{background-color:var(--ref-color-electric-blue-100)}ap-button button.secondary.orange{background:var(--ref-color-orange-10);color:var(--ref-color-orange-100)}ap-button button.secondary.orange ap-symbol{color:var(--ref-color-orange-100)}ap-button button.secondary.orange:hover{background-color:var(--ref-color-orange-20)}ap-button button.secondary.orange:active:not(:disabled){background-color:var(--ref-color-orange-40)}ap-button button.secondary.orange:focus:not(:disabled):not(:active){background-color:var(--ref-color-orange-10)}ap-button button.secondary.orange:disabled{background-color:var(--ref-color-orange-10);color:var(--ref-color-orange-20)}ap-button button.secondary.orange:disabled ap-symbol{color:var(--ref-color-orange-20)}ap-button button.secondary.orange.loading{background-color:var(--ref-color-orange-40)}ap-button button.secondary.orange .loading-bar{background-color:var(--ref-color-orange-100)}ap-button button.secondary.blue{background:var(--ref-color-electric-blue-10);color:var(--ref-color-electric-blue-100)}ap-button button.secondary.blue ap-symbol{color:var(--ref-color-electric-blue-100)}ap-button button.secondary.blue:hover{background-color:var(--ref-color-electric-blue-20)}ap-button button.secondary.blue:active:not(:disabled){background-color:var(--ref-color-electric-blue-40)}ap-button button.secondary.blue:focus:not(:disabled):not(:active){background-color:var(--ref-color-electric-blue-10)}ap-button button.secondary.blue:disabled{background-color:var(--ref-color-electric-blue-10);color:var(--ref-color-electric-blue-20)}ap-button button.secondary.blue:disabled ap-symbol{color:var(--ref-color-electric-blue-20)}ap-button button.secondary.blue.loading{background-color:var(--ref-color-electric-blue-40)}ap-button button.secondary.blue .loading-bar{background-color:var(--ref-color-electric-blue-100)}ap-button button.mermaid{background:linear-gradient(90deg,#578fff,#df52ff);color:var(--ref-color-grey-100);border:none;border-radius:var(--ref-border-radius-sm);position:relative;z-index:1}ap-button button.mermaid:after{content:\"\";position:absolute;inset:1px;background:var(--ref-color-white);border-radius:calc(var(--ref-border-radius-sm) - 1px);z-index:-1;pointer-events:none}ap-button button.mermaid ng-content,ap-button button.mermaid ap-symbol,ap-button button.mermaid .loading-bar{position:relative;z-index:1}ap-button button.mermaid:first-line{position:relative;z-index:1}ap-button button.mermaid:hover:after{background:var(--ref-color-mermaid-10)}ap-button button.mermaid:active:not(:disabled):after{background:var(--ref-color-mermaid-20)}@media (hover: hover){ap-button button.mermaid:focus:not(:disabled):not(:active):not(.loading){outline:2px solid var(--ref-color-electric-blue-100);outline-offset:1px}}ap-button button.mermaid:disabled{background:linear-gradient(90deg,var(--ref-color-mermaid-gradient-from40) 0%,var(--ref-color-mermaid-gradient-to40) 100%)}ap-button button.mermaid:disabled:after{background:var(--ref-color-white)}ap-button button.mermaid:disabled ap-symbol{opacity:.4}ap-button button.mermaid:disabled{color:var(--ref-color-grey-20)}ap-button button.mermaid.loading{background:linear-gradient(90deg,var(--ref-color-mermaid-gradient-from40) 0%,var(--ref-color-mermaid-gradient-to40) 100%)}ap-button button.mermaid.loading:after{background:var(--ref-color-white)}ap-button button.mermaid.loading ap-symbol{opacity:.4}ap-button button.mermaid.loading{color:var(--ref-color-grey-40)}ap-button button.mermaid .loading-bar{background:linear-gradient(90deg,var(--ref-color-mermaid-gradient-from) 0%,var(--ref-color-mermaid-gradient-to) 100%);position:absolute;z-index:2}ap-button button.stroked{background:var(--ref-color-white);border-width:1px;border-style:solid}ap-button button.stroked.grey{border-color:var(--ref-color-grey-20);color:var(--ref-color-grey-80)}ap-button button.stroked.grey ap-symbol{color:var(--ref-color-grey-80)}ap-button button.stroked.grey:hover{border-color:var(--ref-color-grey-40)}ap-button button.stroked.grey:active:not(:disabled){border-color:var(--ref-color-grey-60)}ap-button button.stroked.grey:focus:not(:disabled):not(:active){border-color:var(--ref-color-grey-20)}ap-button button.stroked.grey:disabled{border-color:var(--ref-color-grey-20);color:var(--ref-color-grey-20)}ap-button button.stroked.grey:disabled ap-symbol{color:var(--ref-color-grey-20)}ap-button button.stroked.grey.loading{border-color:var(--ref-color-grey-20);color:var(--ref-color-grey-40)}ap-button button.stroked.grey.loading ap-symbol{color:var(--ref-color-grey-40)}ap-button button.stroked.grey .loading-bar{background-color:var(--ref-color-grey-80)}ap-button button.stroked.blue{border-color:var(--ref-color-electric-blue-60);color:var(--ref-color-electric-blue-100)}ap-button button.stroked.blue ap-symbol{color:var(--ref-color-electric-blue-100)}ap-button button.stroked.blue:hover{border-color:var(--ref-color-electric-blue-80)}ap-button button.stroked.blue:active:not(:disabled){border-color:var(--ref-color-electric-blue-100)}ap-button button.stroked.blue:focus:not(:disabled):not(:active){border-color:var(--ref-color-electric-blue-60)}ap-button button.stroked.blue:disabled{border-color:var(--ref-color-electric-blue-20);color:var(--ref-color-electric-blue-20)}ap-button button.stroked.blue:disabled ap-symbol{color:var(--ref-color-electric-blue-20)}ap-button button.stroked.blue.loading{border-color:var(--ref-color-electric-blue-20);color:var(--ref-color-electric-blue-40)}ap-button button.stroked.blue.loading ap-symbol{color:var(--ref-color-electric-blue-40)}ap-button button.stroked.blue .loading-bar{background-color:var(--ref-color-electric-blue-100)}ap-button button.stroked.red{border-color:var(--ref-color-red-60);color:var(--ref-color-red-100)}ap-button button.stroked.red ap-symbol{color:var(--ref-color-red-100)}ap-button button.stroked.red:hover{border-color:var(--ref-color-red-80)}ap-button button.stroked.red:active:not(:disabled){border-color:var(--ref-color-red-100)}ap-button button.stroked.red:focus:not(:disabled):not(:active){border-color:var(--ref-color-red-60)}ap-button button.stroked.red:disabled{border-color:var(--ref-color-red-20);color:var(--ref-color-red-20)}ap-button button.stroked.red:disabled ap-symbol{color:var(--ref-color-red-20)}ap-button button.stroked.red.loading{border-color:var(--ref-color-red-20);color:var(--ref-color-red-40)}ap-button button.stroked.red.loading ap-symbol{color:var(--ref-color-red-40)}ap-button button.stroked.red .loading-bar{background-color:var(--ref-color-red-100)}ap-button button.transparent{background:transparent}ap-button button.ghost{background:transparent}ap-button button.ghost.grey{color:var(--ref-color-grey-80)}ap-button button.ghost.grey ap-symbol{color:var(--ref-color-grey-80)}ap-button button.ghost.grey:hover{background-color:var(--ref-color-grey-05)}ap-button button.ghost.grey:active:not(:disabled){background-color:var(--ref-color-grey-10)}ap-button button.ghost.grey:focus:not(:disabled):not(:active){background-color:var(--ref-color-grey-10)}ap-button button.ghost.grey:disabled{color:var(--ref-color-grey-20)}ap-button button.ghost.grey:disabled ap-symbol{color:var(--ref-color-grey-20)}ap-button button.ghost.grey.loading:not(.locked){color:var(--ref-color-grey-40)}ap-button button.ghost.grey.loading:not(.locked) ap-symbol{color:var(--ref-color-grey-40)}ap-button button.ghost.grey .loading-bar{background-color:var(--ref-color-grey-80)}ap-button button.ghost.blue{color:var(--ref-color-electric-blue-100)}ap-button button.ghost.blue ap-symbol{color:var(--ref-color-electric-blue-100)}ap-button button.ghost.blue:hover{background-color:var(--ref-color-electric-blue-10)}ap-button button.ghost.blue:active:not(:disabled){background-color:var(--ref-color-electric-blue-20)}ap-button button.ghost.blue:focus:not(:disabled):not(:active){background-color:var(--ref-color-electric-blue-20)}ap-button button.ghost.blue:disabled{color:var(--ref-color-electric-blue-20)}ap-button button.ghost.blue:disabled ap-symbol{color:var(--ref-color-electric-blue-20)}ap-button button.ghost.blue.loading:not(.locked){color:var(--ref-color-electric-blue-40)}ap-button button.ghost.blue.loading:not(.locked) ap-symbol{color:var(--ref-color-electric-blue-40)}ap-button button.ghost.blue .loading-bar{background-color:var(--ref-color-electric-blue-100)}ap-button button.ghost.red{color:var(--ref-color-red-100)}ap-button button.ghost.red ap-symbol{color:var(--ref-color-red-100)}ap-button button.ghost.red:hover{background-color:var(--ref-color-red-10)}ap-button button.ghost.red:active:not(:disabled){background-color:var(--ref-color-red-20)}ap-button button.ghost.red:focus:not(:disabled):not(:active){background-color:var(--ref-color-red-20)}ap-button button.ghost.red:disabled{color:var(--ref-color-red-20)}ap-button button.ghost.red:disabled ap-symbol{color:var(--ref-color-red-20)}ap-button button.ghost.red.loading:not(.locked){color:var(--ref-color-red-40)}ap-button button.ghost.red.loading:not(.locked) ap-symbol{color:var(--ref-color-red-40)}ap-button button.ghost.red .loading-bar{background-color:var(--ref-color-red-100)}ap-button button.ghost.green{color:var(--ref-color-green-100)}ap-button button.ghost.green ap-symbol{color:var(--ref-color-green-100)}ap-button button.ghost.green:hover{background-color:var(--ref-color-green-10)}ap-button button.ghost.green:active:not(:disabled){background-color:var(--ref-color-green-20)}ap-button button.ghost.green:focus:not(:disabled):not(:active){background-color:var(--ref-color-green-20)}ap-button button.ghost.green:disabled{color:var(--ref-color-green-20)}ap-button button.ghost.green:disabled ap-symbol{color:var(--ref-color-green-20)}ap-button button.ghost.green.loading:not(.locked){color:var(--ref-color-green-40)}ap-button button.ghost.green.loading:not(.locked) ap-symbol{color:var(--ref-color-green-40)}ap-button button.ghost.green .loading-bar{background-color:var(--ref-color-green-100)}ap-button button.locked{background-color:var(--ref-color-purple-10);color:var(--ref-color-purple-80)}ap-button button.locked ap-symbol{color:var(--ref-color-purple-80)}ap-button button.locked:hover{background-color:var(--ref-color-purple-20);border-color:var(--ref-color-purple-40)}ap-button button.locked:active:not(:disabled){background-color:var(--ref-color-purple-40);border-color:var(--ref-color-purple-60)}ap-button button.locked:focus:not(:disabled):not(:active){background-color:var(--ref-color-purple-20);border-color:var(--ref-color-purple-20)}ap-button button.locked:disabled{color:var(--ref-color-purple-)}ap-button button.locked:disabled ap-symbol{color:var(--ref-color-purple-)}ap-button button.locked.loading:not(.locked){color:var(--ref-color-purple-)}ap-button button.locked.loading:not(.locked) ap-symbol{color:var(--ref-color-purple-)}ap-button button.locked .loading-bar{background-color:var(--ref-color-purple-)}ap-button button.locked{border:1px solid var(--ref-color-purple-20)}ap-button .loading-bar{position:absolute;bottom:0;left:var(--comp-button-padding-vertical);width:var(--loading-bar-width);height:5px;border-radius:8px;animation:slide 1.5s ease-in-out infinite}@keyframes slide{0%{left:calc(var(--loading-bar-width) * -1)}to{left:100%}}ap-button .locked-symbol{position:absolute;top:-6px;right:-6px;border-radius:100%;background:var(--ref-color-white)}ap-button .locked-symbol ap-symbol{color:var(--ref-color-purple-100)}\n"], dependencies: [{ kind: "component", type: SymbolComponent, selector: "ap-symbol", inputs: ["symbolId", "color", "size"], outputs: ["sizeChange"] }, { kind: "ngmodule", type: MatMenuModule }, { kind: "directive", type: i2.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
64
84
  }
65
85
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: ButtonComponent, decorators: [{
66
86
  type: Component,
67
87
  args: [{ changeDetection: ChangeDetectionStrategy.OnPush, selector: 'ap-button', imports: [SymbolComponent, MatMenuModule], encapsulation: ViewEncapsulation.None, hostDirectives: [BaseButtonDirective], host: {
68
- '[attr.disabled]': 'loading || disabled || null',
69
- }, template: "<button\n #button\n #trigger=\"matMenuTrigger\"\n role=\"button\"\n [matMenuTriggerFor]=\"menuTrigger\"\n [class.primary]=\"config.style === 'primary' && !locked\"\n [class.secondary]=\"config.style === 'secondary' && !locked\"\n [class.ghost]=\"config.style === 'ghost' && !locked\"\n [class.stroked]=\"(config.style === 'stroked' || config.style === 'stroked-transparent') && !locked\"\n [class.transparent]=\"config.style === 'stroked-transparent' && !locked\"\n [class.mermaid]=\"config.style === 'mermaid' && !locked\"\n [class.orange]=\"config.color === 'orange' && !locked\"\n [class.blue]=\"config.color === 'blue' && !locked\"\n [class.red]=\"config.color === 'red' && !locked\"\n [class.grey]=\"config.color === 'grey' && !locked\"\n [class.green]=\"config.color === 'green' && !locked\"\n [class.loading]=\"loading && !locked\"\n [class.locked]=\"locked\"\n [class.inverse]=\"symbolPosition === 'left'\"\n [disabled]=\"disabled && !locked\"\n [name]=\"name\"\n [attr.data-test]=\"baseButtonDirective.hostDataTest ?? name\"\n [attr.id]=\"baseButtonDirective.hostId\"\n [attr.type]=\"baseButtonDirective.hostType\"\n [attr.form]=\"form\"\n [attr.aria-label]=\"ariaLabel || null\"\n [attr.aria-disabled]=\"disabled?.toString()\"\n (click)=\"onClickHandle($event)\"\n (focus)=\"onFocusHandle($event)\"\n (blur)=\"onBlurHandle($event)\"\n (menuOpened)=\"menuOpened.emit()\"\n (menuClosed)=\"menuClosed.emit()\">\n <ng-content />\n @if (symbolId()) {\n <ap-symbol [symbolId]=\"symbolId()\" />\n } @else {\n <ng-content select=\"ap-symbol\" />\n }\n @if (loading && !locked) {\n <div class=\"loading-bar\"></div>\n }\n</button>\n@if (locked) {\n <div class=\"locked-symbol\">\n <ap-symbol\n symbolId=\"feature-lock\"\n size=\"sm\" />\n </div>\n}\n", styles: ["ap-button{--loading-bar-width: 50px;display:inline-block;position:relative}ap-button[disabled]{pointer-events:none}ap-button button{border:none;border-radius:var(--comp-button-border-radius);padding:var(--comp-button-padding-horizontal) var(--comp-button-padding-vertical);position:relative;overflow:hidden;display:flex;justify-content:center;align-items:center;gap:var(--comp-split-button-spacing);flex-direction:row;font-size:var(--comp-button-text-size);font-family:var(--comp-button-text-font-family);line-height:var(--comp-button-text-line-height);font-weight:var(--comp-button-text-weight);max-height:var(--comp-button-height);min-height:var(--comp-button-height);white-space:nowrap;text-overflow:ellipsis;width:100%}ap-button button ap-symbol{width:16px;min-width:16px;max-width:16px;height:16px;min-height:16px;max-height:16px}ap-button button.inverse{flex-direction:row-reverse}ap-button button:hover:not(:disabled):not(.loading){cursor:pointer}ap-button button:disabled{pointer-events:none}@media (hover: hover){ap-button button:focus:not(:disabled):not(:active):not(.loading){outline:2px solid var(--ref-color-electric-blue-100);outline-offset:1px}}ap-button button.loading{pointer-events:none}ap-button button.primary{color:var(--ref-color-white)}ap-button button.primary ap-symbol{color:var(--ref-color-white)}ap-button button.primary.orange{background:var(--ref-color-orange-100)}ap-button button.primary.orange:hover{background-color:var(--ref-color-orange-80)}ap-button button.primary.orange:active:not(:disabled){background-color:var(--ref-color-orange-60)}ap-button button.primary.orange:disabled{background-color:var(--ref-color-orange-20)}ap-button button.primary.orange.loading{background-color:var(--ref-color-orange-60)}ap-button button.primary.orange .loading-bar{background-color:var(--ref-color-orange-100)}ap-button button.primary.blue{background:var(--ref-color-electric-blue-100)}ap-button button.primary.blue:hover{background-color:var(--ref-color-electric-blue-80)}ap-button button.primary.blue:active:not(:disabled){background-color:var(--ref-color-electric-blue-60)}ap-button button.primary.blue:disabled{background-color:var(--ref-color-electric-blue-20)}ap-button button.primary.blue.loading{background-color:var(--ref-color-electric-blue-60)}ap-button button.primary.blue .loading-bar{background-color:var(--ref-color-electric-blue-100)}ap-button button.secondary.orange{background:var(--ref-color-orange-10);color:var(--ref-color-orange-100)}ap-button button.secondary.orange ap-symbol{color:var(--ref-color-orange-100)}ap-button button.secondary.orange:hover{background-color:var(--ref-color-orange-20)}ap-button button.secondary.orange:active:not(:disabled){background-color:var(--ref-color-orange-40)}ap-button button.secondary.orange:focus:not(:disabled):not(:active){background-color:var(--ref-color-orange-10)}ap-button button.secondary.orange:disabled{background-color:var(--ref-color-orange-10);color:var(--ref-color-orange-20)}ap-button button.secondary.orange:disabled ap-symbol{color:var(--ref-color-orange-20)}ap-button button.secondary.orange.loading{background-color:var(--ref-color-orange-40)}ap-button button.secondary.orange .loading-bar{background-color:var(--ref-color-orange-100)}ap-button button.secondary.blue{background:var(--ref-color-electric-blue-10);color:var(--ref-color-electric-blue-100)}ap-button button.secondary.blue ap-symbol{color:var(--ref-color-electric-blue-100)}ap-button button.secondary.blue:hover{background-color:var(--ref-color-electric-blue-20)}ap-button button.secondary.blue:active:not(:disabled){background-color:var(--ref-color-electric-blue-40)}ap-button button.secondary.blue:focus:not(:disabled):not(:active){background-color:var(--ref-color-electric-blue-10)}ap-button button.secondary.blue:disabled{background-color:var(--ref-color-electric-blue-10);color:var(--ref-color-electric-blue-20)}ap-button button.secondary.blue:disabled ap-symbol{color:var(--ref-color-electric-blue-20)}ap-button button.secondary.blue.loading{background-color:var(--ref-color-electric-blue-40)}ap-button button.secondary.blue .loading-bar{background-color:var(--ref-color-electric-blue-100)}ap-button button.mermaid{background:linear-gradient(90deg,#578fff,#df52ff);color:var(--ref-color-grey-100);border:none;border-radius:var(--ref-border-radius-sm);position:relative;z-index:1}ap-button button.mermaid:after{content:\"\";position:absolute;inset:1px;background:var(--ref-color-white);border-radius:calc(var(--ref-border-radius-sm) - 1px);z-index:-1;pointer-events:none}ap-button button.mermaid ng-content,ap-button button.mermaid ap-symbol,ap-button button.mermaid .loading-bar{position:relative;z-index:1}ap-button button.mermaid:first-line{position:relative;z-index:1}ap-button button.mermaid:hover:after{background:var(--ref-color-mermaid-10)}ap-button button.mermaid:active:not(:disabled):after{background:var(--ref-color-mermaid-20)}@media (hover: hover){ap-button button.mermaid:focus:not(:disabled):not(:active):not(.loading){outline:2px solid var(--ref-color-electric-blue-100);outline-offset:1px}}ap-button button.mermaid:disabled{background:linear-gradient(90deg,var(--ref-color-mermaid-gradient-from40) 0%,var(--ref-color-mermaid-gradient-to40) 100%)}ap-button button.mermaid:disabled:after{background:var(--ref-color-white)}ap-button button.mermaid:disabled ap-symbol{opacity:.4}ap-button button.mermaid:disabled{color:var(--ref-color-grey-20)}ap-button button.mermaid.loading{background:linear-gradient(90deg,var(--ref-color-mermaid-gradient-from40) 0%,var(--ref-color-mermaid-gradient-to40) 100%)}ap-button button.mermaid.loading:after{background:var(--ref-color-white)}ap-button button.mermaid.loading ap-symbol{opacity:.4}ap-button button.mermaid.loading{color:var(--ref-color-grey-40)}ap-button button.mermaid .loading-bar{background:linear-gradient(90deg,var(--ref-color-mermaid-gradient-from) 0%,var(--ref-color-mermaid-gradient-to) 100%);position:absolute;z-index:2}ap-button button.stroked{background:var(--ref-color-white);border-width:1px;border-style:solid}ap-button button.stroked.grey{border-color:var(--ref-color-grey-20);color:var(--ref-color-grey-80)}ap-button button.stroked.grey ap-symbol{color:var(--ref-color-grey-80)}ap-button button.stroked.grey:hover{border-color:var(--ref-color-grey-40)}ap-button button.stroked.grey:active:not(:disabled){border-color:var(--ref-color-grey-60)}ap-button button.stroked.grey:focus:not(:disabled):not(:active){border-color:var(--ref-color-grey-20)}ap-button button.stroked.grey:disabled{border-color:var(--ref-color-grey-20);color:var(--ref-color-grey-20)}ap-button button.stroked.grey:disabled ap-symbol{color:var(--ref-color-grey-20)}ap-button button.stroked.grey.loading{border-color:var(--ref-color-grey-20);color:var(--ref-color-grey-40)}ap-button button.stroked.grey.loading ap-symbol{color:var(--ref-color-grey-40)}ap-button button.stroked.grey .loading-bar{background-color:var(--ref-color-grey-80)}ap-button button.stroked.blue{border-color:var(--ref-color-electric-blue-60);color:var(--ref-color-electric-blue-100)}ap-button button.stroked.blue ap-symbol{color:var(--ref-color-electric-blue-100)}ap-button button.stroked.blue:hover{border-color:var(--ref-color-electric-blue-80)}ap-button button.stroked.blue:active:not(:disabled){border-color:var(--ref-color-electric-blue-100)}ap-button button.stroked.blue:focus:not(:disabled):not(:active){border-color:var(--ref-color-electric-blue-60)}ap-button button.stroked.blue:disabled{border-color:var(--ref-color-electric-blue-20);color:var(--ref-color-electric-blue-20)}ap-button button.stroked.blue:disabled ap-symbol{color:var(--ref-color-electric-blue-20)}ap-button button.stroked.blue.loading{border-color:var(--ref-color-electric-blue-20);color:var(--ref-color-electric-blue-40)}ap-button button.stroked.blue.loading ap-symbol{color:var(--ref-color-electric-blue-40)}ap-button button.stroked.blue .loading-bar{background-color:var(--ref-color-electric-blue-100)}ap-button button.stroked.red{border-color:var(--ref-color-red-60);color:var(--ref-color-red-100)}ap-button button.stroked.red ap-symbol{color:var(--ref-color-red-100)}ap-button button.stroked.red:hover{border-color:var(--ref-color-red-80)}ap-button button.stroked.red:active:not(:disabled){border-color:var(--ref-color-red-100)}ap-button button.stroked.red:focus:not(:disabled):not(:active){border-color:var(--ref-color-red-60)}ap-button button.stroked.red:disabled{border-color:var(--ref-color-red-20);color:var(--ref-color-red-20)}ap-button button.stroked.red:disabled ap-symbol{color:var(--ref-color-red-20)}ap-button button.stroked.red.loading{border-color:var(--ref-color-red-20);color:var(--ref-color-red-40)}ap-button button.stroked.red.loading ap-symbol{color:var(--ref-color-red-40)}ap-button button.stroked.red .loading-bar{background-color:var(--ref-color-red-100)}ap-button button.transparent{background:transparent}ap-button button.ghost{background:transparent}ap-button button.ghost.grey{color:var(--ref-color-grey-80)}ap-button button.ghost.grey ap-symbol{color:var(--ref-color-grey-80)}ap-button button.ghost.grey:hover{background-color:var(--ref-color-grey-05)}ap-button button.ghost.grey:active:not(:disabled){background-color:var(--ref-color-grey-10)}ap-button button.ghost.grey:focus:not(:disabled):not(:active){background-color:var(--ref-color-grey-10)}ap-button button.ghost.grey:disabled{color:var(--ref-color-grey-20)}ap-button button.ghost.grey:disabled ap-symbol{color:var(--ref-color-grey-20)}ap-button button.ghost.grey.loading:not(.locked){color:var(--ref-color-grey-40)}ap-button button.ghost.grey.loading:not(.locked) ap-symbol{color:var(--ref-color-grey-40)}ap-button button.ghost.grey .loading-bar{background-color:var(--ref-color-grey-80)}ap-button button.ghost.blue{color:var(--ref-color-electric-blue-100)}ap-button button.ghost.blue ap-symbol{color:var(--ref-color-electric-blue-100)}ap-button button.ghost.blue:hover{background-color:var(--ref-color-electric-blue-10)}ap-button button.ghost.blue:active:not(:disabled){background-color:var(--ref-color-electric-blue-20)}ap-button button.ghost.blue:focus:not(:disabled):not(:active){background-color:var(--ref-color-electric-blue-20)}ap-button button.ghost.blue:disabled{color:var(--ref-color-electric-blue-20)}ap-button button.ghost.blue:disabled ap-symbol{color:var(--ref-color-electric-blue-20)}ap-button button.ghost.blue.loading:not(.locked){color:var(--ref-color-electric-blue-40)}ap-button button.ghost.blue.loading:not(.locked) ap-symbol{color:var(--ref-color-electric-blue-40)}ap-button button.ghost.blue .loading-bar{background-color:var(--ref-color-electric-blue-100)}ap-button button.ghost.red{color:var(--ref-color-red-100)}ap-button button.ghost.red ap-symbol{color:var(--ref-color-red-100)}ap-button button.ghost.red:hover{background-color:var(--ref-color-red-10)}ap-button button.ghost.red:active:not(:disabled){background-color:var(--ref-color-red-20)}ap-button button.ghost.red:focus:not(:disabled):not(:active){background-color:var(--ref-color-red-20)}ap-button button.ghost.red:disabled{color:var(--ref-color-red-20)}ap-button button.ghost.red:disabled ap-symbol{color:var(--ref-color-red-20)}ap-button button.ghost.red.loading:not(.locked){color:var(--ref-color-red-40)}ap-button button.ghost.red.loading:not(.locked) ap-symbol{color:var(--ref-color-red-40)}ap-button button.ghost.red .loading-bar{background-color:var(--ref-color-red-100)}ap-button button.ghost.green{color:var(--ref-color-green-100)}ap-button button.ghost.green ap-symbol{color:var(--ref-color-green-100)}ap-button button.ghost.green:hover{background-color:var(--ref-color-green-10)}ap-button button.ghost.green:active:not(:disabled){background-color:var(--ref-color-green-20)}ap-button button.ghost.green:focus:not(:disabled):not(:active){background-color:var(--ref-color-green-20)}ap-button button.ghost.green:disabled{color:var(--ref-color-green-20)}ap-button button.ghost.green:disabled ap-symbol{color:var(--ref-color-green-20)}ap-button button.ghost.green.loading:not(.locked){color:var(--ref-color-green-40)}ap-button button.ghost.green.loading:not(.locked) ap-symbol{color:var(--ref-color-green-40)}ap-button button.ghost.green .loading-bar{background-color:var(--ref-color-green-100)}ap-button button.locked{background-color:var(--ref-color-purple-10);color:var(--ref-color-purple-80)}ap-button button.locked ap-symbol{color:var(--ref-color-purple-80)}ap-button button.locked:hover{background-color:var(--ref-color-purple-20);border-color:var(--ref-color-purple-40)}ap-button button.locked:active:not(:disabled){background-color:var(--ref-color-purple-40);border-color:var(--ref-color-purple-60)}ap-button button.locked:focus:not(:disabled):not(:active){background-color:var(--ref-color-purple-20);border-color:var(--ref-color-purple-20)}ap-button button.locked:disabled{color:var(--ref-color-purple-)}ap-button button.locked:disabled ap-symbol{color:var(--ref-color-purple-)}ap-button button.locked.loading:not(.locked){color:var(--ref-color-purple-)}ap-button button.locked.loading:not(.locked) ap-symbol{color:var(--ref-color-purple-)}ap-button button.locked .loading-bar{background-color:var(--ref-color-purple-)}ap-button button.locked{border:1px solid var(--ref-color-purple-20)}ap-button .loading-bar{position:absolute;bottom:0;left:var(--comp-button-padding-vertical);width:var(--loading-bar-width);height:5px;border-radius:8px;animation:slide 1.5s ease-in-out infinite}@keyframes slide{0%{left:calc(var(--loading-bar-width) * -1)}to{left:100%}}ap-button .locked-symbol{position:absolute;top:-6px;right:-6px;border-radius:100%;background:var(--ref-color-white)}ap-button .locked-symbol ap-symbol{color:var(--ref-color-purple-100)}\n"] }]
70
- }], ctorParameters: () => [], propDecorators: { buttonElement: [{
71
- type: ViewChild,
72
- args: ['button']
73
- }], ariaLabel: [{
74
- type: Input
75
- }], disabled: [{
76
- type: Input,
77
- args: [{
78
- transform: booleanAttribute,
79
- }]
80
- }], name: [{
81
- type: Input,
82
- args: [{
83
- required: true,
84
- }]
85
- }], form: [{
86
- type: Input
87
- }], config: [{
88
- type: Input
89
- }], loading: [{
90
- type: Input
91
- }], locked: [{
92
- type: Input
93
- }], menuTrigger: [{
94
- type: Input
95
- }], symbolPosition: [{
96
- type: Input
97
- }], menuOpened: [{
98
- type: Output
99
- }], menuClosed: [{
100
- type: Output
101
- }], click: [{
102
- type: Output
103
- }], focus: [{
104
- type: Output
105
- }], blur: [{
106
- type: Output
107
- }], onSpaceKeyUp: [{
88
+ '[attr.disabled]': 'loading() || disabled() || null',
89
+ }, template: "<button\n #button\n role=\"button\"\n [matMenuTriggerFor]=\"menuTrigger()\"\n [class]=\"buttonClasses()\"\n [disabled]=\"disabled() && !locked()\"\n [attr.name]=\"name()\"\n [attr.data-test]=\"baseButtonDirective.hostDataTest ?? name()\"\n [attr.id]=\"baseButtonDirective.hostId\"\n [attr.type]=\"baseButtonDirective.hostType\"\n [attr.form]=\"form()\"\n [attr.aria-label]=\"ariaLabel() || null\"\n [attr.aria-disabled]=\"disabled()?.toString()\"\n (click)=\"onClickHandle($event)\"\n (focus)=\"onFocusHandle($event)\"\n (blur)=\"onBlurHandle($event)\"\n (menuOpened)=\"menuOpened.emit()\"\n (menuClosed)=\"menuClosed.emit()\">\n <ng-content />\n @if (symbolId()) {\n <ap-symbol [symbolId]=\"symbolId()\" />\n } @else {\n <ng-content select=\"ap-symbol\" />\n }\n @if (loading() && !locked()) {\n <div class=\"loading-bar\"></div>\n }\n</button>\n@if (locked()) {\n <div class=\"locked-symbol\">\n <ap-symbol\n symbolId=\"feature-lock\"\n size=\"sm\" />\n </div>\n}\n", styles: ["ap-button{--loading-bar-width: 50px;display:inline-block;position:relative}ap-button[disabled]{pointer-events:none}ap-button button{border:none;border-radius:var(--comp-button-border-radius);padding:var(--comp-button-padding-horizontal) var(--comp-button-padding-vertical);position:relative;overflow:hidden;display:flex;justify-content:center;align-items:center;gap:var(--comp-split-button-spacing);flex-direction:row;font-size:var(--comp-button-text-size);font-family:var(--comp-button-text-font-family);line-height:var(--comp-button-text-line-height);font-weight:var(--comp-button-text-weight);max-height:var(--comp-button-height);min-height:var(--comp-button-height);white-space:nowrap;text-overflow:ellipsis;width:100%}ap-button button ap-symbol{width:16px;min-width:16px;max-width:16px;height:16px;min-height:16px;max-height:16px}ap-button button.inverse{flex-direction:row-reverse}ap-button button:hover:not(:disabled):not(.loading){cursor:pointer}ap-button button:disabled{pointer-events:none}@media (hover: hover){ap-button button:focus:not(:disabled):not(:active):not(.loading){outline:2px solid var(--ref-color-electric-blue-100);outline-offset:1px}}ap-button button.loading{pointer-events:none}ap-button button.primary{color:var(--ref-color-white)}ap-button button.primary ap-symbol{color:var(--ref-color-white)}ap-button button.primary.orange{background:var(--ref-color-orange-100)}ap-button button.primary.orange:hover{background-color:var(--ref-color-orange-80)}ap-button button.primary.orange:active:not(:disabled){background-color:var(--ref-color-orange-60)}ap-button button.primary.orange:disabled{background-color:var(--ref-color-orange-20)}ap-button button.primary.orange.loading{background-color:var(--ref-color-orange-60)}ap-button button.primary.orange .loading-bar{background-color:var(--ref-color-orange-100)}ap-button button.primary.blue{background:var(--ref-color-electric-blue-100)}ap-button button.primary.blue:hover{background-color:var(--ref-color-electric-blue-80)}ap-button button.primary.blue:active:not(:disabled){background-color:var(--ref-color-electric-blue-60)}ap-button button.primary.blue:disabled{background-color:var(--ref-color-electric-blue-20)}ap-button button.primary.blue.loading{background-color:var(--ref-color-electric-blue-60)}ap-button button.primary.blue .loading-bar{background-color:var(--ref-color-electric-blue-100)}ap-button button.secondary.orange{background:var(--ref-color-orange-10);color:var(--ref-color-orange-100)}ap-button button.secondary.orange ap-symbol{color:var(--ref-color-orange-100)}ap-button button.secondary.orange:hover{background-color:var(--ref-color-orange-20)}ap-button button.secondary.orange:active:not(:disabled){background-color:var(--ref-color-orange-40)}ap-button button.secondary.orange:focus:not(:disabled):not(:active){background-color:var(--ref-color-orange-10)}ap-button button.secondary.orange:disabled{background-color:var(--ref-color-orange-10);color:var(--ref-color-orange-20)}ap-button button.secondary.orange:disabled ap-symbol{color:var(--ref-color-orange-20)}ap-button button.secondary.orange.loading{background-color:var(--ref-color-orange-40)}ap-button button.secondary.orange .loading-bar{background-color:var(--ref-color-orange-100)}ap-button button.secondary.blue{background:var(--ref-color-electric-blue-10);color:var(--ref-color-electric-blue-100)}ap-button button.secondary.blue ap-symbol{color:var(--ref-color-electric-blue-100)}ap-button button.secondary.blue:hover{background-color:var(--ref-color-electric-blue-20)}ap-button button.secondary.blue:active:not(:disabled){background-color:var(--ref-color-electric-blue-40)}ap-button button.secondary.blue:focus:not(:disabled):not(:active){background-color:var(--ref-color-electric-blue-10)}ap-button button.secondary.blue:disabled{background-color:var(--ref-color-electric-blue-10);color:var(--ref-color-electric-blue-20)}ap-button button.secondary.blue:disabled ap-symbol{color:var(--ref-color-electric-blue-20)}ap-button button.secondary.blue.loading{background-color:var(--ref-color-electric-blue-40)}ap-button button.secondary.blue .loading-bar{background-color:var(--ref-color-electric-blue-100)}ap-button button.mermaid{background:linear-gradient(90deg,#578fff,#df52ff);color:var(--ref-color-grey-100);border:none;border-radius:var(--ref-border-radius-sm);position:relative;z-index:1}ap-button button.mermaid:after{content:\"\";position:absolute;inset:1px;background:var(--ref-color-white);border-radius:calc(var(--ref-border-radius-sm) - 1px);z-index:-1;pointer-events:none}ap-button button.mermaid ng-content,ap-button button.mermaid ap-symbol,ap-button button.mermaid .loading-bar{position:relative;z-index:1}ap-button button.mermaid:first-line{position:relative;z-index:1}ap-button button.mermaid:hover:after{background:var(--ref-color-mermaid-10)}ap-button button.mermaid:active:not(:disabled):after{background:var(--ref-color-mermaid-20)}@media (hover: hover){ap-button button.mermaid:focus:not(:disabled):not(:active):not(.loading){outline:2px solid var(--ref-color-electric-blue-100);outline-offset:1px}}ap-button button.mermaid:disabled{background:linear-gradient(90deg,var(--ref-color-mermaid-gradient-from40) 0%,var(--ref-color-mermaid-gradient-to40) 100%)}ap-button button.mermaid:disabled:after{background:var(--ref-color-white)}ap-button button.mermaid:disabled ap-symbol{opacity:.4}ap-button button.mermaid:disabled{color:var(--ref-color-grey-20)}ap-button button.mermaid.loading{background:linear-gradient(90deg,var(--ref-color-mermaid-gradient-from40) 0%,var(--ref-color-mermaid-gradient-to40) 100%)}ap-button button.mermaid.loading:after{background:var(--ref-color-white)}ap-button button.mermaid.loading ap-symbol{opacity:.4}ap-button button.mermaid.loading{color:var(--ref-color-grey-40)}ap-button button.mermaid .loading-bar{background:linear-gradient(90deg,var(--ref-color-mermaid-gradient-from) 0%,var(--ref-color-mermaid-gradient-to) 100%);position:absolute;z-index:2}ap-button button.stroked{background:var(--ref-color-white);border-width:1px;border-style:solid}ap-button button.stroked.grey{border-color:var(--ref-color-grey-20);color:var(--ref-color-grey-80)}ap-button button.stroked.grey ap-symbol{color:var(--ref-color-grey-80)}ap-button button.stroked.grey:hover{border-color:var(--ref-color-grey-40)}ap-button button.stroked.grey:active:not(:disabled){border-color:var(--ref-color-grey-60)}ap-button button.stroked.grey:focus:not(:disabled):not(:active){border-color:var(--ref-color-grey-20)}ap-button button.stroked.grey:disabled{border-color:var(--ref-color-grey-20);color:var(--ref-color-grey-20)}ap-button button.stroked.grey:disabled ap-symbol{color:var(--ref-color-grey-20)}ap-button button.stroked.grey.loading{border-color:var(--ref-color-grey-20);color:var(--ref-color-grey-40)}ap-button button.stroked.grey.loading ap-symbol{color:var(--ref-color-grey-40)}ap-button button.stroked.grey .loading-bar{background-color:var(--ref-color-grey-80)}ap-button button.stroked.blue{border-color:var(--ref-color-electric-blue-60);color:var(--ref-color-electric-blue-100)}ap-button button.stroked.blue ap-symbol{color:var(--ref-color-electric-blue-100)}ap-button button.stroked.blue:hover{border-color:var(--ref-color-electric-blue-80)}ap-button button.stroked.blue:active:not(:disabled){border-color:var(--ref-color-electric-blue-100)}ap-button button.stroked.blue:focus:not(:disabled):not(:active){border-color:var(--ref-color-electric-blue-60)}ap-button button.stroked.blue:disabled{border-color:var(--ref-color-electric-blue-20);color:var(--ref-color-electric-blue-20)}ap-button button.stroked.blue:disabled ap-symbol{color:var(--ref-color-electric-blue-20)}ap-button button.stroked.blue.loading{border-color:var(--ref-color-electric-blue-20);color:var(--ref-color-electric-blue-40)}ap-button button.stroked.blue.loading ap-symbol{color:var(--ref-color-electric-blue-40)}ap-button button.stroked.blue .loading-bar{background-color:var(--ref-color-electric-blue-100)}ap-button button.stroked.red{border-color:var(--ref-color-red-60);color:var(--ref-color-red-100)}ap-button button.stroked.red ap-symbol{color:var(--ref-color-red-100)}ap-button button.stroked.red:hover{border-color:var(--ref-color-red-80)}ap-button button.stroked.red:active:not(:disabled){border-color:var(--ref-color-red-100)}ap-button button.stroked.red:focus:not(:disabled):not(:active){border-color:var(--ref-color-red-60)}ap-button button.stroked.red:disabled{border-color:var(--ref-color-red-20);color:var(--ref-color-red-20)}ap-button button.stroked.red:disabled ap-symbol{color:var(--ref-color-red-20)}ap-button button.stroked.red.loading{border-color:var(--ref-color-red-20);color:var(--ref-color-red-40)}ap-button button.stroked.red.loading ap-symbol{color:var(--ref-color-red-40)}ap-button button.stroked.red .loading-bar{background-color:var(--ref-color-red-100)}ap-button button.transparent{background:transparent}ap-button button.ghost{background:transparent}ap-button button.ghost.grey{color:var(--ref-color-grey-80)}ap-button button.ghost.grey ap-symbol{color:var(--ref-color-grey-80)}ap-button button.ghost.grey:hover{background-color:var(--ref-color-grey-05)}ap-button button.ghost.grey:active:not(:disabled){background-color:var(--ref-color-grey-10)}ap-button button.ghost.grey:focus:not(:disabled):not(:active){background-color:var(--ref-color-grey-10)}ap-button button.ghost.grey:disabled{color:var(--ref-color-grey-20)}ap-button button.ghost.grey:disabled ap-symbol{color:var(--ref-color-grey-20)}ap-button button.ghost.grey.loading:not(.locked){color:var(--ref-color-grey-40)}ap-button button.ghost.grey.loading:not(.locked) ap-symbol{color:var(--ref-color-grey-40)}ap-button button.ghost.grey .loading-bar{background-color:var(--ref-color-grey-80)}ap-button button.ghost.blue{color:var(--ref-color-electric-blue-100)}ap-button button.ghost.blue ap-symbol{color:var(--ref-color-electric-blue-100)}ap-button button.ghost.blue:hover{background-color:var(--ref-color-electric-blue-10)}ap-button button.ghost.blue:active:not(:disabled){background-color:var(--ref-color-electric-blue-20)}ap-button button.ghost.blue:focus:not(:disabled):not(:active){background-color:var(--ref-color-electric-blue-20)}ap-button button.ghost.blue:disabled{color:var(--ref-color-electric-blue-20)}ap-button button.ghost.blue:disabled ap-symbol{color:var(--ref-color-electric-blue-20)}ap-button button.ghost.blue.loading:not(.locked){color:var(--ref-color-electric-blue-40)}ap-button button.ghost.blue.loading:not(.locked) ap-symbol{color:var(--ref-color-electric-blue-40)}ap-button button.ghost.blue .loading-bar{background-color:var(--ref-color-electric-blue-100)}ap-button button.ghost.red{color:var(--ref-color-red-100)}ap-button button.ghost.red ap-symbol{color:var(--ref-color-red-100)}ap-button button.ghost.red:hover{background-color:var(--ref-color-red-10)}ap-button button.ghost.red:active:not(:disabled){background-color:var(--ref-color-red-20)}ap-button button.ghost.red:focus:not(:disabled):not(:active){background-color:var(--ref-color-red-20)}ap-button button.ghost.red:disabled{color:var(--ref-color-red-20)}ap-button button.ghost.red:disabled ap-symbol{color:var(--ref-color-red-20)}ap-button button.ghost.red.loading:not(.locked){color:var(--ref-color-red-40)}ap-button button.ghost.red.loading:not(.locked) ap-symbol{color:var(--ref-color-red-40)}ap-button button.ghost.red .loading-bar{background-color:var(--ref-color-red-100)}ap-button button.ghost.green{color:var(--ref-color-green-100)}ap-button button.ghost.green ap-symbol{color:var(--ref-color-green-100)}ap-button button.ghost.green:hover{background-color:var(--ref-color-green-10)}ap-button button.ghost.green:active:not(:disabled){background-color:var(--ref-color-green-20)}ap-button button.ghost.green:focus:not(:disabled):not(:active){background-color:var(--ref-color-green-20)}ap-button button.ghost.green:disabled{color:var(--ref-color-green-20)}ap-button button.ghost.green:disabled ap-symbol{color:var(--ref-color-green-20)}ap-button button.ghost.green.loading:not(.locked){color:var(--ref-color-green-40)}ap-button button.ghost.green.loading:not(.locked) ap-symbol{color:var(--ref-color-green-40)}ap-button button.ghost.green .loading-bar{background-color:var(--ref-color-green-100)}ap-button button.locked{background-color:var(--ref-color-purple-10);color:var(--ref-color-purple-80)}ap-button button.locked ap-symbol{color:var(--ref-color-purple-80)}ap-button button.locked:hover{background-color:var(--ref-color-purple-20);border-color:var(--ref-color-purple-40)}ap-button button.locked:active:not(:disabled){background-color:var(--ref-color-purple-40);border-color:var(--ref-color-purple-60)}ap-button button.locked:focus:not(:disabled):not(:active){background-color:var(--ref-color-purple-20);border-color:var(--ref-color-purple-20)}ap-button button.locked:disabled{color:var(--ref-color-purple-)}ap-button button.locked:disabled ap-symbol{color:var(--ref-color-purple-)}ap-button button.locked.loading:not(.locked){color:var(--ref-color-purple-)}ap-button button.locked.loading:not(.locked) ap-symbol{color:var(--ref-color-purple-)}ap-button button.locked .loading-bar{background-color:var(--ref-color-purple-)}ap-button button.locked{border:1px solid var(--ref-color-purple-20)}ap-button .loading-bar{position:absolute;bottom:0;left:var(--comp-button-padding-vertical);width:var(--loading-bar-width);height:5px;border-radius:8px;animation:slide 1.5s ease-in-out infinite}@keyframes slide{0%{left:calc(var(--loading-bar-width) * -1)}to{left:100%}}ap-button .locked-symbol{position:absolute;top:-6px;right:-6px;border-radius:100%;background:var(--ref-color-white)}ap-button .locked-symbol ap-symbol{color:var(--ref-color-purple-100)}\n"] }]
90
+ }], ctorParameters: () => [], propDecorators: { onSpaceKeyUp: [{
108
91
  type: HostListener,
109
92
  args: ['window:keyup.space', ['$event']]
110
93
  }] } });
@@ -113,5 +96,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.3", ngImpor
113
96
  * Generated bundle index. Do not edit.
114
97
  */
115
98
 
116
- export { ButtonComponent };
99
+ export { ButtonComponent, defaultButtonConfig };
117
100
  //# sourceMappingURL=agorapulse-ui-components-button.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"agorapulse-ui-components-button.mjs","sources":["../../../libs/ui-components/button/src/button.component.ts","../../../libs/ui-components/button/src/button.component.html","../../../libs/ui-components/button/src/agorapulse-ui-components-button.ts"],"sourcesContent":["import { BaseButtonDirective } from '@agorapulse/ui-components/directives';\nimport { UI_COMPONENTS_SYMBOLS } from '@agorapulse/ui-components/providers';\nimport { agorapulseSymbol, SymbolComponent, SymbolRegistry } from '@agorapulse/ui-symbol';\nimport {\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n ElementRef,\n EventEmitter,\n HostListener,\n inject,\n input,\n Input,\n Output,\n ViewChild,\n ViewEncapsulation,\n} from '@angular/core';\nimport { MatMenuModule, MatMenuPanel } from '@angular/material/menu';\n\ntype ButtonConfig =\n | { style: 'primary'; color: 'orange' | 'blue' }\n | { style: 'secondary'; color: 'orange' | 'blue' }\n | { style: 'stroked'; color: 'grey' | 'blue' | 'red' }\n | { style: 'stroked-transparent'; color: 'grey' | 'blue' | 'red' }\n | { style: 'ghost'; color: 'grey' | 'blue' | 'red' | 'green' }\n | { style: 'mermaid'; color?: never };\n\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n selector: 'ap-button',\n styleUrls: ['./button.component.scss'],\n imports: [SymbolComponent, MatMenuModule],\n templateUrl: './button.component.html',\n encapsulation: ViewEncapsulation.None,\n hostDirectives: [BaseButtonDirective],\n host: {\n '[attr.disabled]': 'loading || disabled || null',\n },\n})\nexport class ButtonComponent {\n readonly baseButtonDirective: BaseButtonDirective = inject(BaseButtonDirective, { self: true });\n\n @ViewChild('button') buttonElement!: ElementRef<HTMLButtonElement>;\n\n @Input() ariaLabel: string = '';\n @Input({\n transform: booleanAttribute,\n })\n disabled: boolean | undefined = false;\n @Input({\n required: true,\n })\n name: string = '';\n @Input() form: string | undefined = undefined;\n @Input() config: ButtonConfig = {\n style: 'primary',\n color: 'orange',\n };\n @Input() loading: boolean | undefined = false;\n @Input() locked: boolean = false;\n @Input() menuTrigger: MatMenuPanel | null = null;\n @Input() symbolPosition: 'left' | 'right' = 'right';\n\n symbolId = input<agorapulseSymbol>();\n\n @Output() menuOpened: EventEmitter<void> = new EventEmitter();\n @Output() menuClosed: EventEmitter<void> = new EventEmitter();\n // eslint-disable-next-line @angular-eslint/no-output-native\n @Output() click: EventEmitter<MouseEvent> = new EventEmitter();\n // eslint-disable-next-line @angular-eslint/no-output-native\n @Output() focus: EventEmitter<FocusEvent> = new EventEmitter();\n // eslint-disable-next-line @angular-eslint/no-output-native\n @Output() blur: EventEmitter<FocusEvent> = new EventEmitter();\n\n focused: boolean = false;\n\n private readonly symbolRegistry = inject(SymbolRegistry);\n\n constructor() {\n this.symbolRegistry.withSymbols(...(inject(UI_COMPONENTS_SYMBOLS, { optional: true })?.flat() ?? []));\n }\n\n onClickHandle($event: MouseEvent): void {\n if (this.disabled || this.loading) {\n return;\n }\n $event.stopImmediatePropagation();\n this.click.emit($event);\n this.buttonElement.nativeElement.blur();\n this.blur.emit($event);\n }\n\n onBlurHandle($event: FocusEvent): void {\n this.focused = false;\n this.blur.emit($event);\n }\n\n onFocusHandle($event: FocusEvent): void {\n this.focused = true;\n this.focus.emit($event);\n }\n\n @HostListener('window:keyup.space', ['$event'])\n onSpaceKeyUp(event: KeyboardEvent) {\n if (this.focused && !this.disabled && !this.loading) {\n event.preventDefault();\n this.buttonElement.nativeElement.click();\n }\n }\n}\n","<button\n #button\n #trigger=\"matMenuTrigger\"\n role=\"button\"\n [matMenuTriggerFor]=\"menuTrigger\"\n [class.primary]=\"config.style === 'primary' && !locked\"\n [class.secondary]=\"config.style === 'secondary' && !locked\"\n [class.ghost]=\"config.style === 'ghost' && !locked\"\n [class.stroked]=\"(config.style === 'stroked' || config.style === 'stroked-transparent') && !locked\"\n [class.transparent]=\"config.style === 'stroked-transparent' && !locked\"\n [class.mermaid]=\"config.style === 'mermaid' && !locked\"\n [class.orange]=\"config.color === 'orange' && !locked\"\n [class.blue]=\"config.color === 'blue' && !locked\"\n [class.red]=\"config.color === 'red' && !locked\"\n [class.grey]=\"config.color === 'grey' && !locked\"\n [class.green]=\"config.color === 'green' && !locked\"\n [class.loading]=\"loading && !locked\"\n [class.locked]=\"locked\"\n [class.inverse]=\"symbolPosition === 'left'\"\n [disabled]=\"disabled && !locked\"\n [name]=\"name\"\n [attr.data-test]=\"baseButtonDirective.hostDataTest ?? name\"\n [attr.id]=\"baseButtonDirective.hostId\"\n [attr.type]=\"baseButtonDirective.hostType\"\n [attr.form]=\"form\"\n [attr.aria-label]=\"ariaLabel || null\"\n [attr.aria-disabled]=\"disabled?.toString()\"\n (click)=\"onClickHandle($event)\"\n (focus)=\"onFocusHandle($event)\"\n (blur)=\"onBlurHandle($event)\"\n (menuOpened)=\"menuOpened.emit()\"\n (menuClosed)=\"menuClosed.emit()\">\n <ng-content />\n @if (symbolId()) {\n <ap-symbol [symbolId]=\"symbolId()\" />\n } @else {\n <ng-content select=\"ap-symbol\" />\n }\n @if (loading && !locked) {\n <div class=\"loading-bar\"></div>\n }\n</button>\n@if (locked) {\n <div class=\"locked-symbol\">\n <ap-symbol\n symbolId=\"feature-lock\"\n size=\"sm\" />\n </div>\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;MAuCa,eAAe,CAAA;IACf,mBAAmB,GAAwB,MAAM,CAAC,mBAAmB,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;AAE1E,IAAA,aAAa;IAEzB,SAAS,GAAW,EAAE;IAI/B,QAAQ,GAAwB,KAAK;IAIrC,IAAI,GAAW,EAAE;IACR,IAAI,GAAuB,SAAS;AACpC,IAAA,MAAM,GAAiB;AAC5B,QAAA,KAAK,EAAE,SAAS;AAChB,QAAA,KAAK,EAAE,QAAQ;KAClB;IACQ,OAAO,GAAwB,KAAK;IACpC,MAAM,GAAY,KAAK;IACvB,WAAW,GAAwB,IAAI;IACvC,cAAc,GAAqB,OAAO;IAEnD,QAAQ,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SA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AA,CAAA;sBAAd;gBAES,KAAK,EAAA,CAAA;sBAAd;gBAES,IAAI,EAAA,CAAA;sBAAb;gBA+BD,YAAY,EAAA,CAAA;sBADX,YAAY;uBAAC,oBAAoB,EAAE,CAAC,QAAQ,CAAC;;;AEtGlD;;AAEG;;;;"}
1
+ {"version":3,"file":"agorapulse-ui-components-button.mjs","sources":["../../../libs/ui-components/button/src/button.component.ts","../../../libs/ui-components/button/src/button.component.html","../../../libs/ui-components/button/src/agorapulse-ui-components-button.ts"],"sourcesContent":["import { BaseButtonDirective } from '@agorapulse/ui-components/directives';\nimport { UI_COMPONENTS_SYMBOLS } from '@agorapulse/ui-components/providers';\nimport { agorapulseSymbol, SymbolComponent, SymbolRegistry } from '@agorapulse/ui-symbol';\nimport {\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n computed,\n ElementRef,\n HostListener,\n inject,\n input,\n output,\n viewChild,\n ViewEncapsulation,\n} from '@angular/core';\nimport { MatMenuModule, MatMenuPanel } from '@angular/material/menu';\n\nexport type ButtonConfig =\n | { style: 'primary'; color: 'orange' | 'blue' }\n | { style: 'secondary'; color: 'orange' | 'blue' }\n | { style: 'stroked'; color: 'grey' | 'blue' | 'red' }\n | { style: 'stroked-transparent'; color: 'grey' | 'blue' | 'red' }\n | { style: 'ghost'; color: 'grey' | 'blue' | 'red' | 'green' }\n | { style: 'mermaid'; color?: never };\n\nexport const defaultButtonConfig: ButtonConfig = {\n style: 'primary',\n color: 'orange',\n};\n\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n selector: 'ap-button',\n styleUrls: ['./button.component.scss'],\n imports: [SymbolComponent, MatMenuModule],\n templateUrl: './button.component.html',\n encapsulation: ViewEncapsulation.None,\n hostDirectives: [BaseButtonDirective],\n host: {\n '[attr.disabled]': 'loading() || disabled() || null',\n },\n})\nexport class ButtonComponent {\n readonly baseButtonDirective: BaseButtonDirective = inject(BaseButtonDirective, { self: true });\n\n buttonElement = viewChild.required<ElementRef<HTMLButtonElement>>('button');\n\n ariaLabel = input<string>();\n disabled = input(false, { transform: booleanAttribute });\n name = input<string>();\n form = input<string>();\n config = input(defaultButtonConfig, { transform: (value?: ButtonConfig) => value ?? defaultButtonConfig });\n loading = input(false, { transform: booleanAttribute });\n locked = input(false, { transform: booleanAttribute });\n menuTrigger = input<MatMenuPanel | null>(null);\n symbolPosition = input<'left' | 'right'>('right');\n symbolId = input<agorapulseSymbol>();\n\n menuOpened = output<void>();\n menuClosed = output<void>();\n // eslint-disable-next-line @angular-eslint/no-output-native\n click = output<MouseEvent>();\n // eslint-disable-next-line @angular-eslint/no-output-native\n focus = output<FocusEvent>();\n // eslint-disable-next-line @angular-eslint/no-output-native\n blur = output<FocusEvent>();\n\n buttonClasses = computed(() => {\n const cfg = this.config();\n const isLocked = this.locked();\n\n return {\n inverse: this.symbolPosition() === 'left',\n ...(isLocked\n ? { locked: true }\n : {\n // Style\n [cfg.style]: true,\n transparent: cfg.style === 'stroked-transparent',\n stroked: cfg.style === 'stroked' || cfg.style === 'stroked-transparent',\n // Color\n ...(cfg.color ? { [cfg.color]: true } : {}),\n // Loading state\n loading: this.loading(),\n }),\n };\n });\n\n focused: boolean = false;\n\n private readonly symbolRegistry = inject(SymbolRegistry);\n\n constructor() {\n this.symbolRegistry.withSymbols(...(inject(UI_COMPONENTS_SYMBOLS, { optional: true })?.flat() ?? []));\n }\n\n onClickHandle($event: MouseEvent): void {\n if (this.disabled() || this.loading()) {\n return;\n }\n $event.stopImmediatePropagation();\n this.click.emit($event);\n this.buttonElement().nativeElement.blur();\n this.blur.emit($event);\n }\n\n onBlurHandle($event: FocusEvent): void {\n this.focused = false;\n this.blur.emit($event);\n }\n\n onFocusHandle($event: FocusEvent): void {\n this.focused = true;\n this.focus.emit($event);\n }\n\n @HostListener('window:keyup.space', ['$event'])\n onSpaceKeyUp(event: KeyboardEvent) {\n if (this.focused && !this.disabled() && !this.loading()) {\n event.preventDefault();\n this.buttonElement().nativeElement.click();\n }\n }\n}\n","<button\n #button\n role=\"button\"\n [matMenuTriggerFor]=\"menuTrigger()\"\n [class]=\"buttonClasses()\"\n [disabled]=\"disabled() && !locked()\"\n [attr.name]=\"name()\"\n [attr.data-test]=\"baseButtonDirective.hostDataTest ?? name()\"\n [attr.id]=\"baseButtonDirective.hostId\"\n [attr.type]=\"baseButtonDirective.hostType\"\n [attr.form]=\"form()\"\n [attr.aria-label]=\"ariaLabel() || null\"\n [attr.aria-disabled]=\"disabled()?.toString()\"\n (click)=\"onClickHandle($event)\"\n (focus)=\"onFocusHandle($event)\"\n (blur)=\"onBlurHandle($event)\"\n (menuOpened)=\"menuOpened.emit()\"\n (menuClosed)=\"menuClosed.emit()\">\n <ng-content />\n @if (symbolId()) {\n <ap-symbol [symbolId]=\"symbolId()\" />\n } @else {\n <ng-content select=\"ap-symbol\" />\n }\n @if (loading() && !locked()) {\n <div class=\"loading-bar\"></div>\n }\n</button>\n@if (locked()) {\n <div class=\"locked-symbol\">\n <ap-symbol\n symbolId=\"feature-lock\"\n size=\"sm\" />\n </div>\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;AA0BO,MAAM,mBAAmB,GAAiB;AAC7C,IAAA,KAAK,EAAE,SAAS;AAChB,IAAA,KAAK,EAAE,QAAQ;;MAeN,eAAe,CAAA;IACf,mBAAmB,GAAwB,MAAM,CAAC,mBAAmB,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;AAE/F,IAAA,aAAa,GAAG,SAAS,CAAC,QAAQ,CAAgC,QAAQ,CAAC;IAE3E,SAAS,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,WAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAAU;AAC3B,IAAA,QAAQ,GAAG,KAAK,CAAC,KAAK,4CAAI,SAAS,EAAE,gBAAgB,EAAA,CAAA,GAAA,CAA7B,EAAE,SAAS,EAAE,gBAAgB,EAAE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;AACF,wBAAA,iBAAiB,EAAE,iCAAiC;AACvD,qBAAA,EAAA,QAAA,EAAA,skCAAA,EAAA,MAAA,EAAA,CAAA,03aAAA,CAAA,EAAA;wDA6ED,YAAY,EAAA,CAAA;sBADX,YAAY;uBAAC,oBAAoB,EAAE,CAAC,QAAQ,CAAC;;;AErHlD;;AAEG;;;;"}
@@ -31,7 +31,7 @@ class ConfirmModalComponent {
31
31
  width: '550px',
32
32
  };
33
33
  }
34
- const confirmModal = ModalComponent.openWithComponent(dialog, modalConfig, ConfirmModalComponent);
34
+ const confirmModal = ModalComponent.openDialog(dialog, modalConfig, ConfirmModalComponent);
35
35
  confirmModal.componentInstance.contentText = confirmModalTexts.contentText;
36
36
  confirmModal.componentInstance.footerConfirmButtonId = confirmModalTexts.footerConfirmButtonId;
37
37
  confirmModal.componentInstance.footerConfirmButtonLabel = confirmModalTexts.footerConfirmButtonLabel;
@@ -1 +1 @@
1
- {"version":3,"file":"agorapulse-ui-components-confirm-modal.mjs","sources":["../../../libs/ui-components/confirm-modal/src/confirm-modal.component.ts","../../../libs/ui-components/confirm-modal/src/confirm-modal.component.html","../../../libs/ui-components/confirm-modal/src/agorapulse-ui-components-confirm-modal.ts"],"sourcesContent":["import { ButtonComponent } from '@agorapulse/ui-components/button';\nimport { ModalComponent, ModalConfig } from '@agorapulse/ui-components/modal';\nimport { ComponentType } from '@angular/cdk/portal';\nimport { ChangeDetectionStrategy, Component, Input } from '@angular/core';\nimport { MatDialog, MatDialogRef } from '@angular/material/dialog';\nimport { ConfirmModalTexts } from './confirm-modal-texts.model';\n\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n selector: 'ap-confirm-modal',\n templateUrl: 'confirm-modal.component.html',\n styleUrls: ['./confirm-modal.component.scss'],\n imports: [ButtonComponent, ModalComponent],\n})\nexport class ConfirmModalComponent {\n @Input() contentText: string = '';\n @Input() footerCancelButtonId: string = 'cancel';\n @Input() footerCancelButtonLabel: string = '';\n @Input() footerConfirmButtonId: string = 'confirm';\n @Input() footerConfirmButtonLabel: string = '';\n @Input() headerTitle: string = '';\n\n constructor(public dialogRef: MatDialogRef<ComponentType<any>>) {\n dialogRef.disableClose = true;\n }\n\n onCancel() {\n this.dialogRef.close(false);\n }\n\n onConfirm() {\n this.dialogRef.close(true);\n }\n\n static open(dialog: MatDialog, confirmModalTexts: ConfirmModalTexts, modalConfig: ModalConfig | null = null) {\n if (!modalConfig) {\n modalConfig = {};\n }\n if (!modalConfig.matDialogConfig) {\n modalConfig.matDialogConfig = {\n width: '550px',\n };\n }\n const confirmModal = ModalComponent.openWithComponent(dialog, modalConfig, ConfirmModalComponent);\n confirmModal.componentInstance.contentText = confirmModalTexts.contentText;\n confirmModal.componentInstance.footerConfirmButtonId = confirmModalTexts.footerConfirmButtonId;\n confirmModal.componentInstance.footerConfirmButtonLabel = confirmModalTexts.footerConfirmButtonLabel;\n confirmModal.componentInstance.footerCancelButtonId = confirmModalTexts.footerCancelButtonId;\n confirmModal.componentInstance.footerCancelButtonLabel = confirmModalTexts.footerCancelButtonLabel;\n confirmModal.componentInstance.headerTitle = confirmModalTexts.headerTitle;\n return confirmModal;\n }\n}\n","<ng-template #headerTemplate>\n <h2>{{ headerTitle }}</h2>\n</ng-template>\n\n<ng-template #mainTemplate>\n <p>{{ contentText }}</p>\n</ng-template>\n\n<ng-template #footerTemplate>\n <div class=\"buttons\">\n <ap-button\n name=\"confirm-modal-cancel-button\"\n [config]=\"{\n style: 'ghost',\n color: 'grey'\n }\"\n [id]=\"footerCancelButtonId\"\n (click)=\"onCancel()\">\n <span>\n {{ footerCancelButtonLabel }}\n </span>\n </ap-button>\n <ap-button\n name=\"confirm-modal-confirm-button\"\n cdkFocusInitial\n [config]=\"{\n style: 'primary',\n color: 'orange'\n }\"\n [id]=\"footerConfirmButtonId\"\n (click)=\"onConfirm()\">\n <span>\n {{ footerConfirmButtonLabel }}\n </span>\n </ap-button>\n </div>\n</ng-template>\n\n<ap-modal\n [closable]=\"true\"\n [headerTemplate]=\"headerTemplate\"\n [mainTemplate]=\"mainTemplate\"\n [footerTemplate]=\"footerTemplate\" />\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;MAca,qBAAqB,CAAA;AAQX,IAAA,SAAA;IAPV,WAAW,GAAW,EAAE;IACxB,oBAAoB,GAAW,QAAQ;IACvC,uBAAuB,GAAW,EAAE;IACpC,qBAAqB,GAAW,SAAS;IACzC,wBAAwB,GAAW,EAAE;IACrC,WAAW,GAAW,EAAE;AAEjC,IAAA,WAAA,CAAmB,SAA2C,EAAA;QAA3C,IAAA,CAAA,SAAS,GAAT,SAAS;AACxB,QAAA,SAAS,CAAC,YAAY,GAAG,IAAI;IACjC;IAEA,QAAQ,GAAA;AACJ,QAAA,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC;IAC/B;IAEA,SAAS,GAAA;AACL,QAAA,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC;IAC9B;IAEA,OAAO,IAAI,CAAC,MAAiB,EAAE,iBAAoC,EAAE,cAAkC,IAAI,EAAA;QACvG,IAAI,CAAC,WAAW,EAAE;YACd,WAAW,GAAG,EAAE;QACpB;AACA,QAAA,IAAI,CAAC,WAAW,CAAC,eAAe,EAAE;YAC9B,WAAW,CAAC,eAAe,GAAG;AAC1B,gBAAA,KAAK,EAAE,OAAO;aACjB;QACL;AACA,QAAA,MAAM,YAAY,GAAG,cAAc,CAAC,iBAAiB,CAAC,MAAM,EAAE,WAAW,EAAE,qBAAqB,CAAC;QACjG,YAAY,CAAC,iBAAiB,CAAC,WAAW,GAAG,iBAAiB,CAAC,WAAW;QAC1E,YAAY,CAAC,iBAAiB,CAAC,qBAAqB,GAAG,iBAAiB,CAAC,qBAAqB;QAC9F,YAAY,CAAC,iBAAiB,CAAC,wBAAwB,GAAG,iBAAiB,CAAC,wBAAwB;QACpG,YAAY,CAAC,iBAAiB,CAAC,oBAAoB,GAAG,iBAAi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B,CAAC,MAAM,EAAA,QAAA,EACrC,kBAAkB,WAGnB,CAAC,eAAe,EAAE,cAAc,CAAC,EAAA,QAAA,EAAA,2pCAAA,EAAA,MAAA,EAAA,CAAA,oDAAA,CAAA,EAAA;iFAGjC,WAAW,EAAA,CAAA;sBAAnB;gBACQ,oBAAoB,EAAA,CAAA;sBAA5B;gBACQ,uBAAuB,EAAA,CAAA;sBAA/B;gBACQ,qBAAqB,EAAA,CAAA;sBAA7B;gBACQ,wBAAwB,EAAA,CAAA;sBAAhC;gBACQ,WAAW,EAAA,CAAA;sBAAnB;;;AEpBL;;AAEG;;;;"}
1
+ {"version":3,"file":"agorapulse-ui-components-confirm-modal.mjs","sources":["../../../libs/ui-components/confirm-modal/src/confirm-modal.component.ts","../../../libs/ui-components/confirm-modal/src/confirm-modal.component.html","../../../libs/ui-components/confirm-modal/src/agorapulse-ui-components-confirm-modal.ts"],"sourcesContent":["import { ButtonComponent } from '@agorapulse/ui-components/button';\nimport { ModalComponent, ModalConfig } from '@agorapulse/ui-components/modal';\nimport { ChangeDetectionStrategy, Component, Input } from '@angular/core';\nimport { MatDialog, MatDialogRef } from '@angular/material/dialog';\nimport { ConfirmModalTexts } from './confirm-modal-texts.model';\n\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n selector: 'ap-confirm-modal',\n templateUrl: 'confirm-modal.component.html',\n styleUrls: ['./confirm-modal.component.scss'],\n imports: [ButtonComponent, ModalComponent],\n})\nexport class ConfirmModalComponent {\n @Input() contentText: string = '';\n @Input() footerCancelButtonId: string = 'cancel';\n @Input() footerCancelButtonLabel: string = '';\n @Input() footerConfirmButtonId: string = 'confirm';\n @Input() footerConfirmButtonLabel: string = '';\n @Input() headerTitle: string = '';\n\n constructor(public dialogRef: MatDialogRef<ConfirmModalComponent, boolean>) {\n dialogRef.disableClose = true;\n }\n\n onCancel() {\n this.dialogRef.close(false);\n }\n\n onConfirm() {\n this.dialogRef.close(true);\n }\n\n static open(dialog: MatDialog, confirmModalTexts: ConfirmModalTexts, modalConfig: ModalConfig | null = null) {\n if (!modalConfig) {\n modalConfig = {};\n }\n if (!modalConfig.matDialogConfig) {\n modalConfig.matDialogConfig = {\n width: '550px',\n };\n }\n const confirmModal = ModalComponent.openDialog(dialog, modalConfig, ConfirmModalComponent);\n confirmModal.componentInstance.contentText = confirmModalTexts.contentText;\n confirmModal.componentInstance.footerConfirmButtonId = confirmModalTexts.footerConfirmButtonId;\n confirmModal.componentInstance.footerConfirmButtonLabel = confirmModalTexts.footerConfirmButtonLabel;\n confirmModal.componentInstance.footerCancelButtonId = confirmModalTexts.footerCancelButtonId;\n confirmModal.componentInstance.footerCancelButtonLabel = confirmModalTexts.footerCancelButtonLabel;\n confirmModal.componentInstance.headerTitle = confirmModalTexts.headerTitle;\n return confirmModal;\n }\n}\n","<ng-template #headerTemplate>\n <h2>{{ headerTitle }}</h2>\n</ng-template>\n\n<ng-template #mainTemplate>\n <p>{{ contentText }}</p>\n</ng-template>\n\n<ng-template #footerTemplate>\n <div class=\"buttons\">\n <ap-button\n name=\"confirm-modal-cancel-button\"\n [config]=\"{\n style: 'ghost',\n color: 'grey'\n }\"\n [id]=\"footerCancelButtonId\"\n (click)=\"onCancel()\">\n <span>\n {{ footerCancelButtonLabel }}\n </span>\n </ap-button>\n <ap-button\n name=\"confirm-modal-confirm-button\"\n cdkFocusInitial\n [config]=\"{\n style: 'primary',\n color: 'orange'\n }\"\n [id]=\"footerConfirmButtonId\"\n (click)=\"onConfirm()\">\n <span>\n {{ footerConfirmButtonLabel }}\n </span>\n </ap-button>\n </div>\n</ng-template>\n\n<ap-modal\n [closable]=\"true\"\n [headerTemplate]=\"headerTemplate\"\n [mainTemplate]=\"mainTemplate\"\n [footerTemplate]=\"footerTemplate\" />\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;MAaa,qBAAqB,CAAA;AAQX,IAAA,SAAA;IAPV,WAAW,GAAW,EAAE;IACxB,oBAAoB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B;gBACQ,uBAAuB,EAAA,CAAA;sBAA/B;gBACQ,qBAAqB,EAAA,CAAA;sBAA7B;gBACQ,wBAAwB,EAAA,CAAA;sBAAhC;gBACQ,WAAW,EAAA,CAAA;sBAAnB;;;AEnBL;;AAEG;;;;"}
@@ -1,10 +1,10 @@
1
- import { ButtonComponent } from '@agorapulse/ui-components/button';
2
1
  import { IconButtonComponent } from '@agorapulse/ui-components/icon-button';
3
2
  import * as i2 from '@agorapulse/ui-symbol';
4
3
  import { apClose, SymbolComponent } from '@agorapulse/ui-symbol';
5
4
  import { NgStyle, NgClass, NgTemplateOutlet } from '@angular/common';
6
5
  import * as i0 from '@angular/core';
7
6
  import { Input, ChangeDetectionStrategy, Component } from '@angular/core';
7
+ import { firstValueFrom } from 'rxjs';
8
8
  import * as i1 from '@angular/material/dialog';
9
9
 
10
10
  class ModalComponent {
@@ -34,6 +34,19 @@ class ModalComponent {
34
34
  /**
35
35
  * Use it to open a modal containing the {@link componentType} component, with the right configuration.
36
36
  */
37
+ static openDialog(matDialog, config, componentType) {
38
+ return this.openWithComponent(matDialog, config, componentType);
39
+ }
40
+ /**
41
+ * Use it to open a modal containing the {@link componentType} component, with the right configuration, and wait for it to be closed.
42
+ */
43
+ static async openDialogAndWait(matDialog, config, componentType) {
44
+ return firstValueFrom(ModalComponent.openDialog(matDialog, config, componentType).afterClosed());
45
+ }
46
+ /**
47
+ * Use it to open a modal containing the {@link componentType} component, with the right configuration.
48
+ * @deprecated use {@link openDialog} instead for better type inference
49
+ */
37
50
  static openWithComponent(matDialog, config, componentType) {
38
51
  let matDialogConfig;
39
52
  if (config) {
@@ -63,7 +76,7 @@ class ModalComponent {
63
76
  * Use it to open a modal containing the provided templates, with the right configuration.
64
77
  */
65
78
  static openWithTemplates(matDialog, headerTemplate, mainTemplate, footerTemplate, config, sidePaneTemplate) {
66
- const dialogRef = ModalComponent.openWithComponent(matDialog, config, ModalComponent);
79
+ const dialogRef = ModalComponent.openDialog(matDialog, config, ModalComponent);
67
80
  dialogRef.componentInstance.closable = config && config.closable ? config.closable : false;
68
81
  dialogRef.componentInstance.headerBottomBorderEnabled =
69
82
  config && config.headerBottomBorderEnabled ? config.headerBottomBorderEnabled : false;
@@ -81,7 +94,7 @@ class ModalComponent {
81
94
  }
82
95
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: ModalComponent, decorators: [{
83
96
  type: Component,
84
- args: [{ changeDetection: ChangeDetectionStrategy.OnPush, selector: 'ap-modal', imports: [SymbolComponent, NgStyle, NgClass, ButtonComponent, NgTemplateOutlet, IconButtonComponent], template: "@if (sidePaneTemplate) {\n <div\n [ngStyle]=\"sidePaneStyle\"\n [ngClass]=\"{ pane: defaultLayout }\">\n <ng-template [ngTemplateOutlet]=\"sidePaneTemplate\" />\n </div>\n}\n\n<div\n class=\"modal-wrapper\"\n [ngStyle]=\"containerStyle\"\n [class.default-layout]=\"defaultLayout\">\n @if (closable) {\n <ap-icon-button\n class=\"close-button\"\n ariaLabel=\"Close button\"\n name=\"close-button\"\n color=\"none\"\n type=\"flat\"\n (onClick)=\"close()\">\n <ap-symbol symbolId=\"close\" />\n </ap-icon-button>\n }\n @if (headerTemplate && headerVisible) {\n <div\n [ngStyle]=\"headerStyle\"\n [ngClass]=\"{ header: defaultLayout }\"\n [class.border-bottom]=\"headerBottomBorderEnabled\">\n <ng-template [ngTemplateOutlet]=\"headerTemplate\" />\n </div>\n }\n @if (mainTemplate) {\n <div\n [ngStyle]=\"contentStyle\"\n [class.content]=\"defaultLayout\">\n <ng-template [ngTemplateOutlet]=\"mainTemplate\" />\n </div>\n }\n @if (footerTemplate && footerVisible) {\n <div\n [ngStyle]=\"footerStyle\"\n [ngClass]=\"{ footer: defaultLayout }\">\n <ng-template [ngTemplateOutlet]=\"footerTemplate\" />\n </div>\n }\n</div>\n", styles: ["[color=facebook]{color:#0866ff}[bgcolor=facebook],[hcolor=facebook]:hover{background-color:#0866ff}[border=facebook]{border:1px solid #0866ff}[color=google]{color:#4e85e8}[bgcolor=google],[hcolor=google]:hover{background-color:#4e85e8}[border=google]{border:1px solid #4e85e8}[color=instagram]{color:#e1306c}[bgcolor=instagram],[hcolor=instagram]:hover{background-color:#e1306c}[border=instagram]{border:1px solid #e1306c}[color=instagrammagenta]{color:#c13584}[bgcolor=instagrammagenta],[hcolor=instagrammagenta]:hover{background-color:#c13584}[border=instagrammagenta]{border:1px solid #c13584}[color=instagramblue]{color:#5851db}[bgcolor=instagramblue],[hcolor=instagramblue]:hover{background-color:#5851db}[border=instagramblue]{border:1px solid #5851db}[color=instagrampurple]{color:#833ab4}[bgcolor=instagrampurple],[hcolor=instagrampurple]:hover{background-color:#833ab4}[border=instagrampurple]{border:1px solid #833ab4}[color=instagramorange]{color:#f56040}[bgcolor=instagramorange],[hcolor=instagramorange]:hover{background-color:#f56040}[border=instagramorange]{border:1px solid #f56040}[color=instagramyellow]{color:#ffdc80}[bgcolor=instagramyellow],[hcolor=instagramyellow]:hover{background-color:#ffdc80}[border=instagramyellow]{border:1px solid #ffdc80}[color=linkedin]{color:#2c67bc}[bgcolor=linkedin],[hcolor=linkedin]:hover{background-color:#2c67bc}[border=linkedin]{border:1px solid #2c67bc}[color=twitter]{color:#55acee}[bgcolor=twitter],[hcolor=twitter]:hover{background-color:#55acee}[border=twitter]{border:1px solid #55acee}[color=youtube]{color:red}[bgcolor=youtube],[hcolor=youtube]:hover{background-color:red}[border=youtube]{border:1px solid #ff0000}[color=reddit]{color:#ff4500}[bgcolor=reddit],[hcolor=reddit]:hover{background-color:#ff4500}[border=reddit]{border:1px solid #ff4500}[color=blood-orange]{color:#ff4d00}[bgcolor=blood-orange],[hcolor=blood-orange]:hover{background-color:#ff4d00}[border=blood-orange]{border:1px solid #ff4d00}[color=pinkish-orange]{color:#ff7b49}[bgcolor=pinkish-orange],[hcolor=pinkish-orange]:hover{background-color:#ff7b49}[border=pinkish-orange]{border:1px solid #ff7b49}[color=charcoal-grey]{color:#2a2f34}[bgcolor=charcoal-grey],[hcolor=charcoal-grey]:hover{background-color:#2a2f34}[border=charcoal-grey]{border:1px solid #2a2f34}[color=azure]{color:#00aeef}[bgcolor=azure],[hcolor=azure]:hover{background-color:#00aeef}[border=azure]{border:1px solid #00aeef}[color=light-azure]{color:#eaf5fd}[bgcolor=light-azure],[hcolor=light-azure]:hover{background-color:#eaf5fd}[border=light-azure]{border:1px solid #eaf5fd}[color=blue-grey]{color:#8d98a9}[bgcolor=blue-grey],[hcolor=blue-grey]:hover{background-color:#8d98a9}[border=blue-grey]{border:1px solid #8d98a9}[color=silver]{color:#ced0da}[bgcolor=silver],[hcolor=silver]:hover{background-color:#ced0da}[border=silver]{border:1px solid #ced0da}[color=pale-grey]{color:#dfe3e9}[bgcolor=pale-grey],[hcolor=pale-grey]:hover{background-color:#dfe3e9}[border=pale-grey]{border:1px solid #dfe3e9}[color=grey-white]{color:#f5f7f8}[bgcolor=grey-white],[hcolor=grey-white]:hover{background-color:#f5f7f8}[border=grey-white]{border:1px solid #f5f7f8}[color=cool-grey]{color:#b4bbc6}[bgcolor=cool-grey],[hcolor=cool-grey]:hover{background-color:#b4bbc6}[border=cool-grey]{border:1px solid #b4bbc6}[color=black]{color:#344563}[bgcolor=black],[hcolor=black]:hover{background-color:#344563}[border=black]{border:1px solid #344563}[color=grey-blue]{color:#68768c}[bgcolor=grey-blue],[hcolor=grey-blue]:hover{background-color:#68768c}[border=grey-blue]{border:1px solid #68768c}[color=strawberry]{color:#f4282d}[bgcolor=strawberry],[hcolor=strawberry]:hover{background-color:#f4282d}[border=strawberry]{border:1px solid #f4282d}[color=light-strawberry]{color:#f8eded}[bgcolor=light-strawberry],[hcolor=light-strawberry]:hover{background-color:#f8eded}[border=light-strawberry]{border:1px solid #f8eded}[color=white]{color:#fff}[bgcolor=white],[hcolor=white]:hover{background-color:#fff}[border=white]{border:1px solid #ffffff}[color=cool-green]{color:#33c15d}[bgcolor=cool-green],[hcolor=cool-green]:hover{background-color:#33c15d}[border=cool-green]{border:1px solid #33c15d}[color=light-green]{color:#ebfaef}[bgcolor=light-green],[hcolor=light-green]:hover{background-color:#ebfaef}[border=light-green]{border:1px solid #ebfaef}[color=transparent]{color:transparent}[bgcolor=transparent],[hcolor=transparent]:hover{background-color:transparent}[border=transparent]{border:1px solid transparent}[color=c0]{color:#a566a5}[bgcolor=c0],[hcolor=c0]:hover{background-color:#a566a5}[border=c0]{border:1px solid #a566a5}[color=c1]{color:#c7ab82}[bgcolor=c1],[hcolor=c1]:hover{background-color:#c7ab82}[border=c1]{border:1px solid #c7ab82}[color=c2]{color:#f2713c}[bgcolor=c2],[hcolor=c2]:hover{background-color:#f2713c}[border=c2]{border:1px solid #f2713c}[color=c3]{color:#ffd006}[bgcolor=c3],[hcolor=c3]:hover{background-color:#ffd006}[border=c3]{border:1px solid #ffd006}[color=c4]{color:#94c5aa}[bgcolor=c4],[hcolor=c4]:hover{background-color:#94c5aa}[border=c4]{border:1px solid #94c5aa}[color=c5]{color:#2a9d8f}[bgcolor=c5],[hcolor=c5]:hover{background-color:#2a9d8f}[border=c5]{border:1px solid #2a9d8f}[color=c6]{color:#78acd8}[bgcolor=c6],[hcolor=c6]:hover{background-color:#78acd8}[border=c6]{border:1px solid #78acd8}[color=c7]{color:#525a9e}[bgcolor=c7],[hcolor=c7]:hover{background-color:#525a9e}[border=c7]{border:1px solid #525a9e}[color=c8]{color:#6a2459}[bgcolor=c8],[hcolor=c8]:hover{background-color:#6a2459}[border=c8]{border:1px solid #6a2459}[color=c9]{color:#74729e}[bgcolor=c9],[hcolor=c9]:hover{background-color:#74729e}[border=c9]{border:1px solid #74729e}:host{display:flex;flex-direction:row;max-height:90vh}.modal-wrapper{position:relative;width:100%;display:flex;flex-direction:column}.modal-wrapper.default-layout{padding-top:24px;padding-bottom:16px}.modal-wrapper .close-button{margin:-12px;position:absolute;right:24px;top:24px}.modal-wrapper .close-button ap-symbol{height:12px;width:12px}.modal-wrapper .header ::ng-deep h2{margin-top:0}.modal-wrapper .header{padding:0 24px 16px}.modal-wrapper .header.border-bottom{border-bottom:1px solid #eaecef;margin-bottom:16px}.modal-wrapper .content{color:#5d6a82;font-size:16px;padding:0 24px;flex:1;overflow-y:auto;overflow-x:hidden}.modal-wrapper .footer{align-items:center;box-shadow:0 1px #eaecef inset;display:flex;justify-content:flex-end;margin-top:24px;padding:16px 24px 0}.pane{padding:24px}::ng-deep .modal-container{max-width:100vw!important;margin:24px 24px 64px}::ng-deep .modal-container .mat-mdc-dialog-container .mdc-dialog__surface{border-radius:10px;box-shadow:0 25px 50px #0000000a;max-width:100vw;padding:0}::ng-deep .cdk-overlay-dark-backdrop{background:#344563b3}\n"] }]
97
+ args: [{ changeDetection: ChangeDetectionStrategy.OnPush, selector: 'ap-modal', imports: [SymbolComponent, NgStyle, NgClass, NgTemplateOutlet, IconButtonComponent], template: "@if (sidePaneTemplate) {\n <div\n [ngStyle]=\"sidePaneStyle\"\n [ngClass]=\"{ pane: defaultLayout }\">\n <ng-template [ngTemplateOutlet]=\"sidePaneTemplate\" />\n </div>\n}\n\n<div\n class=\"modal-wrapper\"\n [ngStyle]=\"containerStyle\"\n [class.default-layout]=\"defaultLayout\">\n @if (closable) {\n <ap-icon-button\n class=\"close-button\"\n ariaLabel=\"Close button\"\n name=\"close-button\"\n color=\"none\"\n type=\"flat\"\n (onClick)=\"close()\">\n <ap-symbol symbolId=\"close\" />\n </ap-icon-button>\n }\n @if (headerTemplate && headerVisible) {\n <div\n [ngStyle]=\"headerStyle\"\n [ngClass]=\"{ header: defaultLayout }\"\n [class.border-bottom]=\"headerBottomBorderEnabled\">\n <ng-template [ngTemplateOutlet]=\"headerTemplate\" />\n </div>\n }\n @if (mainTemplate) {\n <div\n [ngStyle]=\"contentStyle\"\n [class.content]=\"defaultLayout\">\n <ng-template [ngTemplateOutlet]=\"mainTemplate\" />\n </div>\n }\n @if (footerTemplate && footerVisible) {\n <div\n [ngStyle]=\"footerStyle\"\n [ngClass]=\"{ footer: defaultLayout }\">\n <ng-template [ngTemplateOutlet]=\"footerTemplate\" />\n </div>\n }\n</div>\n", styles: ["[color=facebook]{color:#0866ff}[bgcolor=facebook],[hcolor=facebook]:hover{background-color:#0866ff}[border=facebook]{border:1px solid #0866ff}[color=google]{color:#4e85e8}[bgcolor=google],[hcolor=google]:hover{background-color:#4e85e8}[border=google]{border:1px solid #4e85e8}[color=instagram]{color:#e1306c}[bgcolor=instagram],[hcolor=instagram]:hover{background-color:#e1306c}[border=instagram]{border:1px solid #e1306c}[color=instagrammagenta]{color:#c13584}[bgcolor=instagrammagenta],[hcolor=instagrammagenta]:hover{background-color:#c13584}[border=instagrammagenta]{border:1px solid #c13584}[color=instagramblue]{color:#5851db}[bgcolor=instagramblue],[hcolor=instagramblue]:hover{background-color:#5851db}[border=instagramblue]{border:1px solid #5851db}[color=instagrampurple]{color:#833ab4}[bgcolor=instagrampurple],[hcolor=instagrampurple]:hover{background-color:#833ab4}[border=instagrampurple]{border:1px solid #833ab4}[color=instagramorange]{color:#f56040}[bgcolor=instagramorange],[hcolor=instagramorange]:hover{background-color:#f56040}[border=instagramorange]{border:1px solid #f56040}[color=instagramyellow]{color:#ffdc80}[bgcolor=instagramyellow],[hcolor=instagramyellow]:hover{background-color:#ffdc80}[border=instagramyellow]{border:1px solid #ffdc80}[color=linkedin]{color:#2c67bc}[bgcolor=linkedin],[hcolor=linkedin]:hover{background-color:#2c67bc}[border=linkedin]{border:1px solid #2c67bc}[color=twitter]{color:#55acee}[bgcolor=twitter],[hcolor=twitter]:hover{background-color:#55acee}[border=twitter]{border:1px solid #55acee}[color=youtube]{color:red}[bgcolor=youtube],[hcolor=youtube]:hover{background-color:red}[border=youtube]{border:1px solid #ff0000}[color=reddit]{color:#ff4500}[bgcolor=reddit],[hcolor=reddit]:hover{background-color:#ff4500}[border=reddit]{border:1px solid #ff4500}[color=blood-orange]{color:#ff4d00}[bgcolor=blood-orange],[hcolor=blood-orange]:hover{background-color:#ff4d00}[border=blood-orange]{border:1px solid #ff4d00}[color=pinkish-orange]{color:#ff7b49}[bgcolor=pinkish-orange],[hcolor=pinkish-orange]:hover{background-color:#ff7b49}[border=pinkish-orange]{border:1px solid #ff7b49}[color=charcoal-grey]{color:#2a2f34}[bgcolor=charcoal-grey],[hcolor=charcoal-grey]:hover{background-color:#2a2f34}[border=charcoal-grey]{border:1px solid #2a2f34}[color=azure]{color:#00aeef}[bgcolor=azure],[hcolor=azure]:hover{background-color:#00aeef}[border=azure]{border:1px solid #00aeef}[color=light-azure]{color:#eaf5fd}[bgcolor=light-azure],[hcolor=light-azure]:hover{background-color:#eaf5fd}[border=light-azure]{border:1px solid #eaf5fd}[color=blue-grey]{color:#8d98a9}[bgcolor=blue-grey],[hcolor=blue-grey]:hover{background-color:#8d98a9}[border=blue-grey]{border:1px solid #8d98a9}[color=silver]{color:#ced0da}[bgcolor=silver],[hcolor=silver]:hover{background-color:#ced0da}[border=silver]{border:1px solid #ced0da}[color=pale-grey]{color:#dfe3e9}[bgcolor=pale-grey],[hcolor=pale-grey]:hover{background-color:#dfe3e9}[border=pale-grey]{border:1px solid #dfe3e9}[color=grey-white]{color:#f5f7f8}[bgcolor=grey-white],[hcolor=grey-white]:hover{background-color:#f5f7f8}[border=grey-white]{border:1px solid #f5f7f8}[color=cool-grey]{color:#b4bbc6}[bgcolor=cool-grey],[hcolor=cool-grey]:hover{background-color:#b4bbc6}[border=cool-grey]{border:1px solid #b4bbc6}[color=black]{color:#344563}[bgcolor=black],[hcolor=black]:hover{background-color:#344563}[border=black]{border:1px solid #344563}[color=grey-blue]{color:#68768c}[bgcolor=grey-blue],[hcolor=grey-blue]:hover{background-color:#68768c}[border=grey-blue]{border:1px solid #68768c}[color=strawberry]{color:#f4282d}[bgcolor=strawberry],[hcolor=strawberry]:hover{background-color:#f4282d}[border=strawberry]{border:1px solid #f4282d}[color=light-strawberry]{color:#f8eded}[bgcolor=light-strawberry],[hcolor=light-strawberry]:hover{background-color:#f8eded}[border=light-strawberry]{border:1px solid #f8eded}[color=white]{color:#fff}[bgcolor=white],[hcolor=white]:hover{background-color:#fff}[border=white]{border:1px solid #ffffff}[color=cool-green]{color:#33c15d}[bgcolor=cool-green],[hcolor=cool-green]:hover{background-color:#33c15d}[border=cool-green]{border:1px solid #33c15d}[color=light-green]{color:#ebfaef}[bgcolor=light-green],[hcolor=light-green]:hover{background-color:#ebfaef}[border=light-green]{border:1px solid #ebfaef}[color=transparent]{color:transparent}[bgcolor=transparent],[hcolor=transparent]:hover{background-color:transparent}[border=transparent]{border:1px solid transparent}[color=c0]{color:#a566a5}[bgcolor=c0],[hcolor=c0]:hover{background-color:#a566a5}[border=c0]{border:1px solid #a566a5}[color=c1]{color:#c7ab82}[bgcolor=c1],[hcolor=c1]:hover{background-color:#c7ab82}[border=c1]{border:1px solid #c7ab82}[color=c2]{color:#f2713c}[bgcolor=c2],[hcolor=c2]:hover{background-color:#f2713c}[border=c2]{border:1px solid #f2713c}[color=c3]{color:#ffd006}[bgcolor=c3],[hcolor=c3]:hover{background-color:#ffd006}[border=c3]{border:1px solid #ffd006}[color=c4]{color:#94c5aa}[bgcolor=c4],[hcolor=c4]:hover{background-color:#94c5aa}[border=c4]{border:1px solid #94c5aa}[color=c5]{color:#2a9d8f}[bgcolor=c5],[hcolor=c5]:hover{background-color:#2a9d8f}[border=c5]{border:1px solid #2a9d8f}[color=c6]{color:#78acd8}[bgcolor=c6],[hcolor=c6]:hover{background-color:#78acd8}[border=c6]{border:1px solid #78acd8}[color=c7]{color:#525a9e}[bgcolor=c7],[hcolor=c7]:hover{background-color:#525a9e}[border=c7]{border:1px solid #525a9e}[color=c8]{color:#6a2459}[bgcolor=c8],[hcolor=c8]:hover{background-color:#6a2459}[border=c8]{border:1px solid #6a2459}[color=c9]{color:#74729e}[bgcolor=c9],[hcolor=c9]:hover{background-color:#74729e}[border=c9]{border:1px solid #74729e}:host{display:flex;flex-direction:row;max-height:90vh}.modal-wrapper{position:relative;width:100%;display:flex;flex-direction:column}.modal-wrapper.default-layout{padding-top:24px;padding-bottom:16px}.modal-wrapper .close-button{margin:-12px;position:absolute;right:24px;top:24px}.modal-wrapper .close-button ap-symbol{height:12px;width:12px}.modal-wrapper .header ::ng-deep h2{margin-top:0}.modal-wrapper .header{padding:0 24px 16px}.modal-wrapper .header.border-bottom{border-bottom:1px solid #eaecef;margin-bottom:16px}.modal-wrapper .content{color:#5d6a82;font-size:16px;padding:0 24px;flex:1;overflow-y:auto;overflow-x:hidden}.modal-wrapper .footer{align-items:center;box-shadow:0 1px #eaecef inset;display:flex;justify-content:flex-end;margin-top:24px;padding:16px 24px 0}.pane{padding:24px}::ng-deep .modal-container{max-width:100vw!important;margin:24px 24px 64px}::ng-deep .modal-container .mat-mdc-dialog-container .mdc-dialog__surface{border-radius:10px;box-shadow:0 25px 50px #0000000a;max-width:100vw;padding:0}::ng-deep .cdk-overlay-dark-backdrop{background:#344563b3}\n"] }]
85
98
  }], ctorParameters: () => [{ type: i1.MatDialogRef }, { type: i2.SymbolRegistry }], propDecorators: { closable: [{
86
99
  type: Input
87
100
  }], headerBottomBorderEnabled: [{
@@ -1 +1 @@
1
- {"version":3,"file":"agorapulse-ui-components-modal.mjs","sources":["../../../libs/ui-components/modal/src/modal.component.ts","../../../libs/ui-components/modal/src/modal.component.html","../../../libs/ui-components/modal/src/agorapulse-ui-components-modal.ts"],"sourcesContent":["import { ButtonComponent } from '@agorapulse/ui-components/button';\nimport { IconButtonComponent } from '@agorapulse/ui-components/icon-button';\nimport { apClose, SymbolComponent, SymbolRegistry } from '@agorapulse/ui-symbol';\nimport { ComponentType } from '@angular/cdk/portal';\nimport { NgClass, NgStyle, NgTemplateOutlet } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, Input, TemplateRef } from '@angular/core';\nimport { MatDialog, MatDialogConfig, MatDialogRef } from '@angular/material/dialog';\n\nexport interface ModalConfig<T = unknown> extends ModalConfigBase<T> {\n closable?: boolean;\n headerBottomBorderEnabled?: boolean;\n}\n\nexport interface ModalConfigBase<T> {\n backdropCloseEnable?: boolean;\n matDialogConfig?: MatDialogConfig<T>;\n}\n\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n selector: 'ap-modal',\n templateUrl: 'modal.component.html',\n imports: [SymbolComponent, NgStyle, NgClass, ButtonComponent, NgTemplateOutlet, IconButtonComponent],\n styleUrls: ['modal.component.scss'],\n})\nexport class ModalComponent {\n static readonly PANEL_CLASS = 'modal-container';\n\n constructor(\n public dialogRef: MatDialogRef<ComponentType<any>>,\n public symbolRegistry: SymbolRegistry\n ) {\n dialogRef.disableClose = true;\n this.symbolRegistry.registerSymbols([apClose]);\n }\n\n @Input() closable = false;\n @Input() headerBottomBorderEnabled = false;\n @Input() footerTemplate: TemplateRef<any> | undefined = undefined;\n @Input() footerVisible = true;\n @Input() headerTemplate: TemplateRef<any> | undefined = undefined;\n @Input() headerVisible = true;\n @Input({\n required: true,\n })\n mainTemplate!: TemplateRef<any>;\n @Input() sidePaneTemplate: TemplateRef<any> | undefined = undefined;\n @Input() sidePaneStyle: { [arg: string]: string } | undefined = {};\n @Input() containerStyle: { [arg: string]: string } | undefined = {};\n @Input() headerStyle: { [arg: string]: string } | undefined = {};\n @Input() contentStyle: { [arg: string]: string } | undefined = {};\n @Input() footerStyle: { [arg: string]: string } | undefined = {};\n @Input() defaultLayout = true;\n\n /**\n * Use it to open a modal containing the {@link componentType} component, with the right configuration.\n */\n static openWithComponent<T, Y>(\n matDialog: MatDialog,\n config: ModalConfigBase<Y> | undefined,\n componentType: ComponentType<T>\n ): MatDialogRef<T> {\n let matDialogConfig: MatDialogConfig<Y> | undefined;\n if (config) {\n matDialogConfig = config.matDialogConfig;\n if (matDialogConfig && config.matDialogConfig) {\n matDialogConfig.panelClass = Array.isArray(config.matDialogConfig.panelClass)\n ? [...config.matDialogConfig.panelClass, ModalComponent.PANEL_CLASS] // in case where the panelClass is an array\n : [config.matDialogConfig.panelClass ?? '', ModalComponent.PANEL_CLASS]; // in the other case, it's a String\n } else {\n matDialogConfig = { panelClass: ModalComponent.PANEL_CLASS };\n }\n } else {\n matDialogConfig = {\n panelClass: ModalComponent.PANEL_CLASS,\n };\n }\n matDialogConfig.autoFocus = false; // Prevent first button to be focused\n\n const dialogRef = matDialog.open(componentType, matDialogConfig);\n if (config?.backdropCloseEnable === true) {\n dialogRef.disableClose = false;\n }\n return dialogRef;\n }\n\n /**\n * Use it to open a modal containing the provided templates, with the right configuration.\n */\n static openWithTemplates<T>(\n matDialog: MatDialog,\n headerTemplate: TemplateRef<any> | undefined,\n mainTemplate: TemplateRef<any>,\n footerTemplate?: TemplateRef<any> | undefined,\n config?: ModalConfig<T>,\n sidePaneTemplate?: TemplateRef<any> | undefined\n ): MatDialogRef<ModalComponent> {\n const dialogRef = ModalComponent.openWithComponent(matDialog, config, ModalComponent);\n dialogRef.componentInstance.closable = config && config.closable ? config.closable : false;\n dialogRef.componentInstance.headerBottomBorderEnabled =\n config && config.headerBottomBorderEnabled ? config.headerBottomBorderEnabled : false;\n dialogRef.componentInstance.headerTemplate = headerTemplate;\n dialogRef.componentInstance.mainTemplate = mainTemplate;\n dialogRef.componentInstance.footerTemplate = footerTemplate;\n dialogRef.componentInstance.sidePaneTemplate = sidePaneTemplate;\n return dialogRef;\n }\n\n close(): void {\n this.dialogRef.close();\n }\n}\n","@if (sidePaneTemplate) {\n <div\n [ngStyle]=\"sidePaneStyle\"\n [ngClass]=\"{ pane: defaultLayout }\">\n <ng-template [ngTemplateOutlet]=\"sidePaneTemplate\" />\n </div>\n}\n\n<div\n class=\"modal-wrapper\"\n [ngStyle]=\"containerStyle\"\n [class.default-layout]=\"defaultLayout\">\n @if (closable) {\n <ap-icon-button\n class=\"close-button\"\n ariaLabel=\"Close button\"\n name=\"close-button\"\n color=\"none\"\n type=\"flat\"\n (onClick)=\"close()\">\n <ap-symbol symbolId=\"close\" />\n </ap-icon-button>\n }\n @if (headerTemplate && headerVisible) {\n <div\n [ngStyle]=\"headerStyle\"\n [ngClass]=\"{ header: defaultLayout }\"\n [class.border-bottom]=\"headerBottomBorderEnabled\">\n <ng-template [ngTemplateOutlet]=\"headerTemplate\" />\n </div>\n }\n @if (mainTemplate) {\n <div\n [ngStyle]=\"contentStyle\"\n [class.content]=\"defaultLayout\">\n <ng-template [ngTemplateOutlet]=\"mainTemplate\" />\n </div>\n }\n @if (footerTemplate && footerVisible) {\n <div\n [ngStyle]=\"footerStyle\"\n [ngClass]=\"{ footer: defaultLayout }\">\n <ng-template [ngTemplateOutlet]=\"footerTemplate\" />\n </div>\n }\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;MAyBa,cAAc,CAAA;AAIZ,IAAA,SAAA;AACA,IAAA,cAAA;AAJX,IAAA,OAAgB,WAAW,GAAG,iBAAiB;IAE/C,WAAA,CACW,SAA2C,EAC3C,cAA8B,EAAA;QAD9B,IAAA,CAAA,SAAS,GAAT,SAAS;QACT,IAAA,CAAA,cAAc,GAAd,cAAc;AAErB,QAAA,SAAS,CAAC,YAAY,GAAG,IAAI;QAC7B,IAAI,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC,OAAO,CAAC,CAAC;IAClD;IAES,QAAQ,GAAG,KAAK;IAChB,yBAAyB,GAAG,KAAK;IACjC,cAAc,GAAiC,SAAS;IACxD,aAAa,GAAG,IAAI;IACpB,cAAc,GAAiC,SAAS;IACxD,aAAa,GAAG,IAAI;AAI7B,IAAA,YAAY;IACH,gBAAgB,GAAiC,SAAS;IAC1D,aAAa,GAA0C,EAAE;IACzD,cAAc,GAA0C,EAAE;IAC1D,WAAW,GAA0C,EAAE;IACvD,YAAY,GAA0C,EAAE;IACxD,WAAW,GAA0C,EAAE;IACvD,aAAa,GAAG,IAAI;AAE7B;;AAEG;AACH,IAAA,OAAO,iBAAiB,CACpB,SAAoB,EACpB,MAAsC,EACtC,aAA+B,EAAA;AAE/B,QAAA,IAAI,eAA+C;QACnD,IAAI,MAAM,EAAE;AACR,YAAA,eAAe,GAAG,MAAM,CAAC,eAAe;AACx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cAAc,EAAA,CAAA;sBAAtB;gBACQ,aAAa,EAAA,CAAA;sBAArB;gBAID,YAAY,EAAA,CAAA;sBAHX,KAAK;AAAC,gBAAA,IAAA,EAAA,CAAA;AACH,wBAAA,QAAQ,EAAE,IAAI;AACjB,qBAAA;gBAEQ,gBAAgB,EAAA,CAAA;sBAAxB;gBACQ,aAAa,EAAA,CAAA;sBAArB;gBACQ,cAAc,EAAA,CAAA;sBAAtB;gBACQ,WAAW,EAAA,CAAA;sBAAnB;gBACQ,YAAY,EAAA,CAAA;sBAApB;gBACQ,WAAW,EAAA,CAAA;sBAAnB;gBACQ,aAAa,EAAA,CAAA;sBAArB;;;AEpDL;;AAEG;;;;"}
1
+ {"version":3,"file":"agorapulse-ui-components-modal.mjs","sources":["../../../libs/ui-components/modal/src/modal.component.ts","../../../libs/ui-components/modal/src/modal.component.html","../../../libs/ui-components/modal/src/agorapulse-ui-components-modal.ts"],"sourcesContent":["import { IconButtonComponent } from '@agorapulse/ui-components/icon-button';\nimport { apClose, SymbolComponent, SymbolRegistry } from '@agorapulse/ui-symbol';\nimport { ComponentType } from '@angular/cdk/portal';\nimport { NgClass, NgStyle, NgTemplateOutlet } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, Input, TemplateRef } from '@angular/core';\nimport { MatDialog, MatDialogConfig, MatDialogRef } from '@angular/material/dialog';\nimport { firstValueFrom } from 'rxjs';\n\nexport interface ModalConfig<T = unknown> extends ModalConfigBase<T> {\n closable?: boolean;\n headerBottomBorderEnabled?: boolean;\n}\n\nexport interface ModalConfigBase<T> {\n backdropCloseEnable?: boolean;\n matDialogConfig?: MatDialogConfig<T>;\n}\n\ninterface HasDialogRef<T, R> {\n dialogRef: MatDialogRef<T, R>;\n}\ntype HasModalData<D> = {\n [x in 'modalData' | 'dialogData' | 'data']: D;\n};\n\ntype ExtractDialogRef<C> = C extends HasDialogRef<infer T, infer R> ? MatDialogRef<T, R> : MatDialogRef<C>;\ntype ExtractModalData<C> = C extends HasModalData<infer D> ? D : unknown;\n\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n selector: 'ap-modal',\n templateUrl: 'modal.component.html',\n imports: [SymbolComponent, NgStyle, NgClass, NgTemplateOutlet, IconButtonComponent],\n styleUrls: ['modal.component.scss'],\n})\nexport class ModalComponent {\n static readonly PANEL_CLASS = 'modal-container';\n\n constructor(\n public dialogRef: MatDialogRef<ModalComponent, void>,\n public symbolRegistry: SymbolRegistry\n ) {\n dialogRef.disableClose = true;\n this.symbolRegistry.registerSymbols([apClose]);\n }\n\n @Input() closable = false;\n @Input() headerBottomBorderEnabled = false;\n @Input() footerTemplate: TemplateRef<any> | undefined = undefined;\n @Input() footerVisible = true;\n @Input() headerTemplate: TemplateRef<any> | undefined = undefined;\n @Input() headerVisible = true;\n @Input({\n required: true,\n })\n mainTemplate!: TemplateRef<any>;\n @Input() sidePaneTemplate: TemplateRef<any> | undefined = undefined;\n @Input() sidePaneStyle: { [arg: string]: string } | undefined = {};\n @Input() containerStyle: { [arg: string]: string } | undefined = {};\n @Input() headerStyle: { [arg: string]: string } | undefined = {};\n @Input() contentStyle: { [arg: string]: string } | undefined = {};\n @Input() footerStyle: { [arg: string]: string } | undefined = {};\n @Input() defaultLayout = true;\n\n /**\n * Use it to open a modal containing the {@link componentType} component, with the right configuration.\n */\n static openDialog<C>(matDialog: MatDialog, config: ModalConfigBase<ExtractModalData<C>> | undefined, componentType: ComponentType<C>) {\n return this.openWithComponent(matDialog, config, componentType) as ExtractDialogRef<C>;\n }\n\n /**\n * Use it to open a modal containing the {@link componentType} component, with the right configuration, and wait for it to be closed.\n */\n static async openDialogAndWait<C>(\n matDialog: MatDialog,\n config: ModalConfigBase<ExtractModalData<C>> | undefined,\n componentType: ComponentType<C>\n ): Promise<C extends HasDialogRef<unknown, infer R> ? R : unknown> {\n return firstValueFrom(ModalComponent.openDialog(matDialog, config, componentType).afterClosed());\n }\n\n /**\n * Use it to open a modal containing the {@link componentType} component, with the right configuration.\n * @deprecated use {@link openDialog} instead for better type inference\n */\n static openWithComponent<T, Y>(\n matDialog: MatDialog,\n config: ModalConfigBase<Y> | undefined,\n componentType: ComponentType<T>\n ): MatDialogRef<T> {\n let matDialogConfig: MatDialogConfig<Y> | undefined;\n if (config) {\n matDialogConfig = config.matDialogConfig;\n if (matDialogConfig && config.matDialogConfig) {\n matDialogConfig.panelClass = Array.isArray(config.matDialogConfig.panelClass)\n ? [...config.matDialogConfig.panelClass, ModalComponent.PANEL_CLASS] // in case where the panelClass is an array\n : [config.matDialogConfig.panelClass ?? '', ModalComponent.PANEL_CLASS]; // in the other case, it's a String\n } else {\n matDialogConfig = { panelClass: ModalComponent.PANEL_CLASS };\n }\n } else {\n matDialogConfig = {\n panelClass: ModalComponent.PANEL_CLASS,\n };\n }\n matDialogConfig.autoFocus = false; // Prevent first button to be focused\n\n const dialogRef = matDialog.open(componentType, matDialogConfig);\n if (config?.backdropCloseEnable === true) {\n dialogRef.disableClose = false;\n }\n return dialogRef;\n }\n\n /**\n * Use it to open a modal containing the provided templates, with the right configuration.\n */\n static openWithTemplates<T>(\n matDialog: MatDialog,\n headerTemplate: TemplateRef<any> | undefined,\n mainTemplate: TemplateRef<any>,\n footerTemplate?: TemplateRef<any> | undefined,\n config?: ModalConfig<T>,\n sidePaneTemplate?: TemplateRef<any> | undefined\n ): MatDialogRef<ModalComponent> {\n const dialogRef = ModalComponent.openDialog(matDialog, config, ModalComponent);\n dialogRef.componentInstance.closable = config && config.closable ? config.closable : false;\n dialogRef.componentInstance.headerBottomBorderEnabled =\n config && config.headerBottomBorderEnabled ? config.headerBottomBorderEnabled : false;\n dialogRef.componentInstance.headerTemplate = headerTemplate;\n dialogRef.componentInstance.mainTemplate = mainTemplate;\n dialogRef.componentInstance.footerTemplate = footerTemplate;\n dialogRef.componentInstance.sidePaneTemplate = sidePaneTemplate;\n return dialogRef;\n }\n\n close(): void {\n this.dialogRef.close();\n }\n}\n","@if (sidePaneTemplate) {\n <div\n [ngStyle]=\"sidePaneStyle\"\n [ngClass]=\"{ pane: defaultLayout }\">\n <ng-template [ngTemplateOutlet]=\"sidePaneTemplate\" />\n </div>\n}\n\n<div\n class=\"modal-wrapper\"\n [ngStyle]=\"containerStyle\"\n [class.default-layout]=\"defaultLayout\">\n @if (closable) {\n <ap-icon-button\n class=\"close-button\"\n ariaLabel=\"Close button\"\n name=\"close-button\"\n color=\"none\"\n type=\"flat\"\n (onClick)=\"close()\">\n <ap-symbol symbolId=\"close\" />\n </ap-icon-button>\n }\n @if (headerTemplate && headerVisible) {\n <div\n [ngStyle]=\"headerStyle\"\n [ngClass]=\"{ header: defaultLayout }\"\n [class.border-bottom]=\"headerBottomBorderEnabled\">\n <ng-template [ngTemplateOutlet]=\"headerTemplate\" />\n </div>\n }\n @if (mainTemplate) {\n <div\n [ngStyle]=\"contentStyle\"\n [class.content]=\"defaultLayout\">\n <ng-template [ngTemplateOutlet]=\"mainTemplate\" />\n </div>\n }\n @if (footerTemplate && footerVisible) {\n <div\n [ngStyle]=\"footerStyle\"\n [ngClass]=\"{ footer: defaultLayout }\">\n <ng-template [ngTemplateOutlet]=\"footerTemplate\" />\n </div>\n }\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;MAmCa,cAAc,CAAA;AAIZ,IAAA,SAAA;AACA,IAAA,cAAA;AAJX,IAAA,OAAgB,WAAW,GAAG,iBAAiB;IAE/C,WAAA,CACW,SAA6C,EAC7C,cAA8B,EAAA;QAD9B,IAAA,CAAA,SAAS,GAAT,SAAS;QACT,IAAA,CAAA,cAAc,GAAd,cAAc;AAErB,QAAA,SAAS,CAAC,YAAY,GAAG,IAAI;QAC7B,IAAI,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC,OAAO,CAAC,CAAC;IAClD;IAES,QAAQ,GAAG,KAAK;IAChB,yBAAyB,GAAG,KAAK;IACjC,cAAc,GAAiC,SAAS;IACxD,aAAa,GAAG,IAAI;IACpB,cAAc,GAAiC,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, ViewEncapsulation, ChangeDetectionStrategy, Component, Injectable, inject, ElementRef, NgZone, ViewContainerRef, DestroyRef, computed, TemplateRef, Directive } from '@angular/core';
2
+ import { input, ViewEncapsulation, ChangeDetectionStrategy, Component, Injectable, inject, ElementRef, NgZone, ViewContainerRef, DestroyRef, computed, TemplateRef, HostListener, Directive } from '@angular/core';
3
3
  import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
4
4
  import DOMPurify from 'dompurify';
5
5
  import { AvatarComponent } from '@agorapulse/ui-components/avatar';
@@ -19,11 +19,11 @@ class TooltipComponent {
19
19
  presentationContext = input(...(ngDevMode ? [undefined, { debugName: "presentationContext" }] : []));
20
20
  tooltipListItems = input([], ...(ngDevMode ? [{ debugName: "tooltipListItems" }] : []));
21
21
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: TooltipComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
22
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.3", type: TooltipComponent, isStandalone: true, selector: "ap-tooltip", inputs: { type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, presentationContext: { classPropertyName: "presentationContext", publicName: "presentationContext", isSignal: true, isRequired: false, transformFunction: null }, tooltipListItems: { classPropertyName: "tooltipListItems", publicName: "tooltipListItems", isSignal: true, isRequired: false, transformFunction: null } }, providers: [], ngImport: i0, template: "<div class=\"custom-tooltip-container\">\n @switch (type()) {\n @case (CUSTOM_TOOLTIP_TYPE.PRESENTATION) {\n @let presentation = presentationContext();\n @if (presentation) {\n <div class=\"tooltip-presentation-title\">{{ presentation.title }}</div>\n <div class=\"tooltip-presentation-caption\">{{ presentation.description }}</div>\n }\n }\n @case (CUSTOM_TOOLTIP_TYPE.LIST) {\n <div class=\"tooltip-list-container\">\n @for (item of tooltipListItems(); track item) {\n <div class=\"tooltip-item\">\n <ap-avatar\n [profilePicture]=\"item.profilePicture\"\n [network]=\"item.network\"\n [size]=\"24\" />\n\n <div class=\"tooltip-item-info\">\n <div class=\"tooltip-item-title\">\n {{ item.title }}\n </div>\n @if (item.caption) {\n <div class=\"tooltip-item-caption\">\n {{ item.caption }}\n </div>\n }\n </div>\n </div>\n }\n </div>\n }\n @default {\n\n }\n }\n\n</div>\n", styles: [".custom-tooltip-container{display:flex;flex-direction:column;width:100%;height:100%;max-height:280px;overflow:auto;padding:var(--ref-spacing-xs)}.custom-tooltip-container .tooltip-presentation-title{color:var(--ref-color-grey-100);font-family:Averta;font-size:var(--ref-font-size-md);font-style:normal;font-weight:var(--ref-font-weight-bold);line-height:var(--ref-font-line-height-lg)}.custom-tooltip-container .tooltip-presentation-caption{color:var(--ref-color-grey-80);font-size:var(--ref-font-size-sm);font-style:normal;font-weight:var(--ref-font-weight-regular);line-height:var(--ref-font-line-height-sm)}.custom-tooltip-container .tooltip-list-container{display:flex;flex-direction:column;align-items:flex-start;gap:var(--ref-spacing-xs)}.custom-tooltip-container .tooltip-list-container .tooltip-item{display:flex;flex-direction:row;align-items:center;gap:var(--ref-spacing-xxs)}.custom-tooltip-container .tooltip-list-container .tooltip-item .tooltip-item-info{display:flex;flex-direction:column;justify-content:center;align-items:flex-start;flex:1 0 0}.custom-tooltip-container .tooltip-list-container .tooltip-item .tooltip-item-info .tooltip-item-title{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1;align-self:stretch;overflow:hidden;color:var(--ref-color-grey-100);text-overflow:ellipsis;font-family:Averta;font-size:var(--ref-font-size-sm);font-style:normal;font-weight:var(--ref-font-weight-bold);line-height:var(--ref-font-line-height-sm)}.custom-tooltip-container .tooltip-list-container .tooltip-item .tooltip-item-info .tooltip-item-caption{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1;align-self:stretch;overflow:hidden;color:var(--ref-color-grey-80);text-overflow:ellipsis;font-family:Averta;font-size:var(--ref-font-size-xs);font-style:normal;font-weight:var(--ref-font-weight-regular);line-height:var(--ref-font-line-height-xs)}\n"], dependencies: [{ kind: "component", type: AvatarComponent, selector: "ap-avatar", inputs: ["profilePicture", "alt", "network", "size", "username", "showInitials", "bigNetwork", "anonymous", "online", "youtubeAvatarMode", "rounded"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
22
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.3", type: TooltipComponent, isStandalone: true, selector: "ap-tooltip", inputs: { type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, presentationContext: { classPropertyName: "presentationContext", publicName: "presentationContext", isSignal: true, isRequired: false, transformFunction: null }, tooltipListItems: { classPropertyName: "tooltipListItems", publicName: "tooltipListItems", isSignal: true, isRequired: false, transformFunction: null } }, providers: [], ngImport: i0, template: "<div class=\"custom-tooltip-container\">\n @switch (type()) {\n @case (CUSTOM_TOOLTIP_TYPE.PRESENTATION) {\n @let presentation = presentationContext();\n @if (presentation) {\n <div class=\"tooltip-presentation-title\">{{ presentation.title }}</div>\n <div class=\"tooltip-presentation-caption\">{{ presentation.description }}</div>\n }\n }\n @case (CUSTOM_TOOLTIP_TYPE.LIST) {\n <div class=\"tooltip-list-container\">\n @for (item of tooltipListItems(); track item) {\n <div class=\"tooltip-item\">\n <ap-avatar\n [profilePicture]=\"item.profilePicture\"\n [network]=\"item.network\"\n [size]=\"item.caption ? 32 : 24\" />\n\n <div class=\"tooltip-item-info\">\n <div class=\"tooltip-item-title\">\n {{ item.title }}\n </div>\n @if (item.caption) {\n <div class=\"tooltip-item-caption\">\n {{ item.caption }}\n </div>\n }\n </div>\n </div>\n }\n </div>\n }\n @default {\n\n }\n }\n\n</div>\n", styles: [".custom-tooltip-container{display:flex;flex-direction:column;width:100%;height:100%;max-height:280px;overflow:auto;padding:var(--ref-spacing-xs);gap:var(--ref-spacing-xxxs);scrollbar-color:var(--ref-color-grey-20) transparent;scrollbar-width:thin}.custom-tooltip-container .tooltip-presentation-title{color:var(--ref-color-grey-100);font-family:Averta;font-size:var(--ref-font-size-md);font-style:normal;font-weight:var(--ref-font-weight-bold);line-height:var(--ref-font-line-height-lg)}.custom-tooltip-container .tooltip-presentation-caption{color:var(--ref-color-grey-80);font-family:Averta;font-size:var(--ref-font-size-sm);font-style:normal;font-weight:var(--ref-font-weight-regular);line-height:var(--ref-font-line-height-sm)}.custom-tooltip-container .tooltip-list-container{display:flex;flex-direction:column;align-items:flex-start;gap:var(--ref-spacing-xs)}.custom-tooltip-container .tooltip-list-container .tooltip-item{display:flex;flex-direction:row;align-items:center;gap:var(--ref-spacing-xxs)}.custom-tooltip-container .tooltip-list-container .tooltip-item .tooltip-item-info{display:flex;flex-direction:column;justify-content:center;align-items:flex-start;flex:1 0 0}.custom-tooltip-container .tooltip-list-container .tooltip-item .tooltip-item-info .tooltip-item-title{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1;align-self:stretch;overflow:hidden;color:var(--ref-color-grey-100);text-overflow:ellipsis;font-family:Averta;font-size:var(--ref-font-size-sm);font-style:normal;font-weight:var(--ref-font-weight-bold);line-height:var(--ref-font-line-height-sm)}.custom-tooltip-container .tooltip-list-container .tooltip-item .tooltip-item-info .tooltip-item-caption{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1;align-self:stretch;overflow:hidden;color:var(--ref-color-grey-80);text-overflow:ellipsis;font-family:Averta;font-size:var(--ref-font-size-xs);font-style:normal;font-weight:var(--ref-font-weight-regular);line-height:var(--ref-font-line-height-xs)}\n"], dependencies: [{ kind: "component", type: AvatarComponent, selector: "ap-avatar", inputs: ["profilePicture", "alt", "network", "size", "username", "showInitials", "bigNetwork", "anonymous", "online", "youtubeAvatarMode", "rounded"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
23
23
  }
24
24
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: TooltipComponent, decorators: [{
25
25
  type: Component,
26
- args: [{ changeDetection: ChangeDetectionStrategy.OnPush, selector: 'ap-tooltip', imports: [AvatarComponent], providers: [], encapsulation: ViewEncapsulation.None, template: "<div class=\"custom-tooltip-container\">\n @switch (type()) {\n @case (CUSTOM_TOOLTIP_TYPE.PRESENTATION) {\n @let presentation = presentationContext();\n @if (presentation) {\n <div class=\"tooltip-presentation-title\">{{ presentation.title }}</div>\n <div class=\"tooltip-presentation-caption\">{{ presentation.description }}</div>\n }\n }\n @case (CUSTOM_TOOLTIP_TYPE.LIST) {\n <div class=\"tooltip-list-container\">\n @for (item of tooltipListItems(); track item) {\n <div class=\"tooltip-item\">\n <ap-avatar\n [profilePicture]=\"item.profilePicture\"\n [network]=\"item.network\"\n [size]=\"24\" />\n\n <div class=\"tooltip-item-info\">\n <div class=\"tooltip-item-title\">\n {{ item.title }}\n </div>\n @if (item.caption) {\n <div class=\"tooltip-item-caption\">\n {{ item.caption }}\n </div>\n }\n </div>\n </div>\n }\n </div>\n }\n @default {\n\n }\n }\n\n</div>\n", styles: [".custom-tooltip-container{display:flex;flex-direction:column;width:100%;height:100%;max-height:280px;overflow:auto;padding:var(--ref-spacing-xs)}.custom-tooltip-container .tooltip-presentation-title{color:var(--ref-color-grey-100);font-family:Averta;font-size:var(--ref-font-size-md);font-style:normal;font-weight:var(--ref-font-weight-bold);line-height:var(--ref-font-line-height-lg)}.custom-tooltip-container .tooltip-presentation-caption{color:var(--ref-color-grey-80);font-size:var(--ref-font-size-sm);font-style:normal;font-weight:var(--ref-font-weight-regular);line-height:var(--ref-font-line-height-sm)}.custom-tooltip-container .tooltip-list-container{display:flex;flex-direction:column;align-items:flex-start;gap:var(--ref-spacing-xs)}.custom-tooltip-container .tooltip-list-container .tooltip-item{display:flex;flex-direction:row;align-items:center;gap:var(--ref-spacing-xxs)}.custom-tooltip-container .tooltip-list-container .tooltip-item .tooltip-item-info{display:flex;flex-direction:column;justify-content:center;align-items:flex-start;flex:1 0 0}.custom-tooltip-container .tooltip-list-container .tooltip-item .tooltip-item-info .tooltip-item-title{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1;align-self:stretch;overflow:hidden;color:var(--ref-color-grey-100);text-overflow:ellipsis;font-family:Averta;font-size:var(--ref-font-size-sm);font-style:normal;font-weight:var(--ref-font-weight-bold);line-height:var(--ref-font-line-height-sm)}.custom-tooltip-container .tooltip-list-container .tooltip-item .tooltip-item-info .tooltip-item-caption{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1;align-self:stretch;overflow:hidden;color:var(--ref-color-grey-80);text-overflow:ellipsis;font-family:Averta;font-size:var(--ref-font-size-xs);font-style:normal;font-weight:var(--ref-font-weight-regular);line-height:var(--ref-font-line-height-xs)}\n"] }]
26
+ args: [{ changeDetection: ChangeDetectionStrategy.OnPush, selector: 'ap-tooltip', imports: [AvatarComponent], providers: [], encapsulation: ViewEncapsulation.None, template: "<div class=\"custom-tooltip-container\">\n @switch (type()) {\n @case (CUSTOM_TOOLTIP_TYPE.PRESENTATION) {\n @let presentation = presentationContext();\n @if (presentation) {\n <div class=\"tooltip-presentation-title\">{{ presentation.title }}</div>\n <div class=\"tooltip-presentation-caption\">{{ presentation.description }}</div>\n }\n }\n @case (CUSTOM_TOOLTIP_TYPE.LIST) {\n <div class=\"tooltip-list-container\">\n @for (item of tooltipListItems(); track item) {\n <div class=\"tooltip-item\">\n <ap-avatar\n [profilePicture]=\"item.profilePicture\"\n [network]=\"item.network\"\n [size]=\"item.caption ? 32 : 24\" />\n\n <div class=\"tooltip-item-info\">\n <div class=\"tooltip-item-title\">\n {{ item.title }}\n </div>\n @if (item.caption) {\n <div class=\"tooltip-item-caption\">\n {{ item.caption }}\n </div>\n }\n </div>\n </div>\n }\n </div>\n }\n @default {\n\n }\n }\n\n</div>\n", styles: [".custom-tooltip-container{display:flex;flex-direction:column;width:100%;height:100%;max-height:280px;overflow:auto;padding:var(--ref-spacing-xs);gap:var(--ref-spacing-xxxs);scrollbar-color:var(--ref-color-grey-20) transparent;scrollbar-width:thin}.custom-tooltip-container .tooltip-presentation-title{color:var(--ref-color-grey-100);font-family:Averta;font-size:var(--ref-font-size-md);font-style:normal;font-weight:var(--ref-font-weight-bold);line-height:var(--ref-font-line-height-lg)}.custom-tooltip-container .tooltip-presentation-caption{color:var(--ref-color-grey-80);font-family:Averta;font-size:var(--ref-font-size-sm);font-style:normal;font-weight:var(--ref-font-weight-regular);line-height:var(--ref-font-line-height-sm)}.custom-tooltip-container .tooltip-list-container{display:flex;flex-direction:column;align-items:flex-start;gap:var(--ref-spacing-xs)}.custom-tooltip-container .tooltip-list-container .tooltip-item{display:flex;flex-direction:row;align-items:center;gap:var(--ref-spacing-xxs)}.custom-tooltip-container .tooltip-list-container .tooltip-item .tooltip-item-info{display:flex;flex-direction:column;justify-content:center;align-items:flex-start;flex:1 0 0}.custom-tooltip-container .tooltip-list-container .tooltip-item .tooltip-item-info .tooltip-item-title{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1;align-self:stretch;overflow:hidden;color:var(--ref-color-grey-100);text-overflow:ellipsis;font-family:Averta;font-size:var(--ref-font-size-sm);font-style:normal;font-weight:var(--ref-font-weight-bold);line-height:var(--ref-font-line-height-sm)}.custom-tooltip-container .tooltip-list-container .tooltip-item .tooltip-item-info .tooltip-item-caption{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1;align-self:stretch;overflow:hidden;color:var(--ref-color-grey-80);text-overflow:ellipsis;font-family:Averta;font-size:var(--ref-font-size-xs);font-style:normal;font-weight:var(--ref-font-weight-regular);line-height:var(--ref-font-line-height-xs)}\n"] }]
27
27
  }] });
28
28
 
29
29
  class TooltipService {
@@ -58,6 +58,15 @@ class TooltipDirective {
58
58
  zone = inject(NgZone);
59
59
  viewContainerRef = inject(ViewContainerRef);
60
60
  destroyRef = inject(DestroyRef);
61
+ onClick(targetElement) {
62
+ if (!this.container) {
63
+ return;
64
+ }
65
+ const clickedInside = this.container.contains(targetElement);
66
+ if (!clickedInside) {
67
+ this.deactivate();
68
+ }
69
+ }
61
70
  apTooltip = input.required(...(ngDevMode ? [{ debugName: "apTooltip" }] : []));
62
71
  apTooltipPosition = input('top', ...(ngDevMode ? [{ debugName: "apTooltipPosition" }] : []));
63
72
  apTooltipShowDelay = input(80, ...(ngDevMode ? [{ debugName: "apTooltipShowDelay" }] : []));
@@ -452,6 +461,7 @@ class TooltipDirective {
452
461
  }
453
462
  }
454
463
  preAlign(position) {
464
+ this.removePreviousAlignHtmlClasses();
455
465
  if (this.container) {
456
466
  this.container.style.left = -999 + 'px';
457
467
  this.container.style.top = -999 + 'px';
@@ -520,6 +530,11 @@ class TooltipDirective {
520
530
  this.container.style.setProperty('--ap-tooltip-height', this.container.offsetHeight + 'px');
521
531
  }
522
532
  }
533
+ removePreviousAlignHtmlClasses() {
534
+ if (this.container) {
535
+ this.container.classList.remove('ap-tooltip-top', 'ap-tooltip-top-left', 'ap-tooltip-top-right', 'ap-tooltip-bottom', 'ap-tooltip-bottom-left', 'ap-tooltip-bottom-right', 'ap-tooltip-left', 'ap-tooltip-right');
536
+ }
537
+ }
523
538
  get externallyTriggerred() {
524
539
  return this._externallyTriggerred;
525
540
  }
@@ -527,12 +542,15 @@ class TooltipDirective {
527
542
  this._externallyTriggerred = value;
528
543
  }
529
544
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: TooltipDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
530
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.1.3", type: TooltipDirective, isStandalone: true, selector: "[apTooltip]", inputs: { apTooltip: { classPropertyName: "apTooltip", publicName: "apTooltip", isSignal: true, isRequired: true, transformFunction: null }, apTooltipPosition: { classPropertyName: "apTooltipPosition", publicName: "apTooltipPosition", isSignal: true, isRequired: false, transformFunction: null }, apTooltipShowDelay: { classPropertyName: "apTooltipShowDelay", publicName: "apTooltipShowDelay", isSignal: true, isRequired: false, transformFunction: null }, apTooltipHideDelay: { classPropertyName: "apTooltipHideDelay", publicName: "apTooltipHideDelay", isSignal: true, isRequired: false, transformFunction: null }, apTooltipDuration: { classPropertyName: "apTooltipDuration", publicName: "apTooltipDuration", isSignal: true, isRequired: false, transformFunction: null }, apTooltipDisabled: { classPropertyName: "apTooltipDisabled", publicName: "apTooltipDisabled", isSignal: true, isRequired: false, transformFunction: null }, apTooltipTruncatedTextOnly: { classPropertyName: "apTooltipTruncatedTextOnly", publicName: "apTooltipTruncatedTextOnly", isSignal: true, isRequired: false, transformFunction: null }, apTooltipTemplateContext: { classPropertyName: "apTooltipTemplateContext", publicName: "apTooltipTemplateContext", isSignal: true, isRequired: false, transformFunction: null }, apTooltipVirtualScrollElement: { classPropertyName: "apTooltipVirtualScrollElement", publicName: "apTooltipVirtualScrollElement", isSignal: true, isRequired: false, transformFunction: null }, apTooltipTrigger: { classPropertyName: "apTooltipTrigger", publicName: "apTooltipTrigger", isSignal: true, isRequired: false, transformFunction: null }, apTooltipType: { classPropertyName: "apTooltipType", publicName: "apTooltipType", isSignal: true, isRequired: false, transformFunction: null }, apTooltipPresentationContext: { classPropertyName: "apTooltipPresentationContext", publicName: "apTooltipPresentationContext", isSignal: true, isRequired: false, transformFunction: null }, apTooltipListItems: { classPropertyName: "apTooltipListItems", publicName: "apTooltipListItems", isSignal: true, isRequired: false, transformFunction: null } }, exportAs: ["apTooltip"], ngImport: i0 });
545
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.1.3", type: TooltipDirective, isStandalone: true, selector: "[apTooltip]", inputs: { apTooltip: { classPropertyName: "apTooltip", publicName: "apTooltip", isSignal: true, isRequired: true, transformFunction: null }, apTooltipPosition: { classPropertyName: "apTooltipPosition", publicName: "apTooltipPosition", isSignal: true, isRequired: false, transformFunction: null }, apTooltipShowDelay: { classPropertyName: "apTooltipShowDelay", publicName: "apTooltipShowDelay", isSignal: true, isRequired: false, transformFunction: null }, apTooltipHideDelay: { classPropertyName: "apTooltipHideDelay", publicName: "apTooltipHideDelay", isSignal: true, isRequired: false, transformFunction: null }, apTooltipDuration: { classPropertyName: "apTooltipDuration", publicName: "apTooltipDuration", isSignal: true, isRequired: false, transformFunction: null }, apTooltipDisabled: { classPropertyName: "apTooltipDisabled", publicName: "apTooltipDisabled", isSignal: true, isRequired: false, transformFunction: null }, apTooltipTruncatedTextOnly: { classPropertyName: "apTooltipTruncatedTextOnly", publicName: "apTooltipTruncatedTextOnly", isSignal: true, isRequired: false, transformFunction: null }, apTooltipTemplateContext: { classPropertyName: "apTooltipTemplateContext", publicName: "apTooltipTemplateContext", isSignal: true, isRequired: false, transformFunction: null }, apTooltipVirtualScrollElement: { classPropertyName: "apTooltipVirtualScrollElement", publicName: "apTooltipVirtualScrollElement", isSignal: true, isRequired: false, transformFunction: null }, apTooltipTrigger: { classPropertyName: "apTooltipTrigger", publicName: "apTooltipTrigger", isSignal: true, isRequired: false, transformFunction: null }, apTooltipType: { classPropertyName: "apTooltipType", publicName: "apTooltipType", isSignal: true, isRequired: false, transformFunction: null }, apTooltipPresentationContext: { classPropertyName: "apTooltipPresentationContext", publicName: "apTooltipPresentationContext", isSignal: true, isRequired: false, transformFunction: null }, apTooltipListItems: { classPropertyName: "apTooltipListItems", publicName: "apTooltipListItems", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "document:click": "onClick($event.target)" } }, exportAs: ["apTooltip"], ngImport: i0 });
531
546
  }
532
547
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.3", ngImport: i0, type: TooltipDirective, decorators: [{
533
548
  type: Directive,
534
549
  args: [{ selector: '[apTooltip]', standalone: true, exportAs: 'apTooltip' }]
535
- }] });
550
+ }], propDecorators: { onClick: [{
551
+ type: HostListener,
552
+ args: ['document:click', ['$event.target']]
553
+ }] } });
536
554
 
537
555
  /**
538
556
  * Directive that triggers a tooltip to show/hide
@@ -1 +1 @@
1
- {"version":3,"file":"agorapulse-ui-components-tooltip.mjs","sources":["../../../libs/ui-components/tooltip/src/tooltip.component.ts","../../../libs/ui-components/tooltip/src/tooltip.component.html","../../../libs/ui-components/tooltip/src/tooltip.service.ts","../../../libs/ui-components/tooltip/src/tooltip.directive.ts","../../../libs/ui-components/tooltip/src/tooltip-trigger.directive.ts","../../../libs/ui-components/tooltip/src/agorapulse-ui-components-tooltip.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, input, ViewEncapsulation } from '@angular/core';\nimport { AvatarComponent } from '@agorapulse/ui-components/avatar';\n\nexport const CustomTooltipType = {\n DEFAULT: 'DEFAULT', // default type\n PRESENTATION: 'PRESENTATION',\n LIST: 'LIST',\n}\nexport type CustomTooltipType = (typeof CustomTooltipType)[keyof typeof CustomTooltipType];\n\nexport type CustomTooltipPresentationItem = {\n title: string;\n description: string;\n}\n\nexport type CustomTooltipListItem = {\n profilePicture: string;\n title: string;\n caption?: string;\n network?: string;\n}\n\n/**\n * A tooltip component that is used for predefined templates: Presentation and List.\n * Not to be used directly, use TooltipDirective instead.\n */\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n selector: 'ap-tooltip',\n templateUrl: './tooltip.component.html',\n styleUrls: ['./tooltip.component.scss'],\n imports: [AvatarComponent],\n providers: [],\n encapsulation: ViewEncapsulation.None\n})\nexport class TooltipComponent {\n protected readonly CUSTOM_TOOLTIP_TYPE = CustomTooltipType;\n\n type = input<CustomTooltipType>(CustomTooltipType.DEFAULT);\n presentationContext = input<CustomTooltipPresentationItem>();\n\n tooltipListItems = input<CustomTooltipListItem[]>([]);\n}\n","<div class=\"custom-tooltip-container\">\n @switch (type()) {\n @case (CUSTOM_TOOLTIP_TYPE.PRESENTATION) {\n @let presentation = presentationContext();\n @if (presentation) {\n <div class=\"tooltip-presentation-title\">{{ presentation.title }}</div>\n <div class=\"tooltip-presentation-caption\">{{ presentation.description }}</div>\n }\n }\n @case (CUSTOM_TOOLTIP_TYPE.LIST) {\n <div class=\"tooltip-list-container\">\n @for (item of tooltipListItems(); track item) {\n <div class=\"tooltip-item\">\n <ap-avatar\n [profilePicture]=\"item.profilePicture\"\n [network]=\"item.network\"\n [size]=\"24\" />\n\n <div class=\"tooltip-item-info\">\n <div class=\"tooltip-item-title\">\n {{ item.title }}\n </div>\n @if (item.caption) {\n <div class=\"tooltip-item-caption\">\n {{ item.caption }}\n </div>\n }\n </div>\n </div>\n }\n </div>\n }\n @default {\n\n }\n }\n\n</div>\n","import { Injectable } from '@angular/core';\n\n@Injectable()\nexport class TooltipService {\n static readonly defaultOffset = 12;\n\n static getOuterWidth(el: HTMLElement): number {\n return el.offsetWidth;\n }\n\n static getOuterHeight(el: HTMLElement): number {\n return el.offsetHeight;\n }\n\n static getViewport(): any {\n const win = window,\n d = document,\n e = d.documentElement,\n g = d.getElementsByTagName('body')[0],\n w = win.innerWidth || e.clientWidth || g.clientWidth,\n h = win.innerHeight || e.clientHeight || g.clientHeight;\n\n return { width: w, height: h };\n }\n\n static getWindowScrollLeft(): number {\n const doc = document.documentElement;\n return (window.pageXOffset || doc.scrollLeft) - (doc.clientLeft || 0);\n }\n\n static getWindowScrollTop(): number {\n const doc = document.documentElement;\n return (window.pageYOffset || doc.scrollTop) - (doc.clientTop || 0);\n }\n}\n","import { CdkVirtualScrollViewport } from '@angular/cdk/scrolling';\nimport {\n AfterViewInit,\n computed,\n DestroyRef,\n Directive,\n ElementRef,\n inject,\n input,\n NgZone,\n OnDestroy,\n OnInit,\n TemplateRef,\n ViewContainerRef,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport DOMPurify from 'dompurify';\nimport { CustomTooltipListItem, CustomTooltipPresentationItem, CustomTooltipType, TooltipComponent } from './tooltip.component';\nimport { TooltipService } from './tooltip.service';\n\n@Directive({ selector: '[apTooltip]', standalone: true, exportAs: 'apTooltip' })\nexport class TooltipDirective implements AfterViewInit, OnDestroy, OnInit {\n private readonly elementRef: ElementRef = inject(ElementRef);\n private readonly zone: NgZone = inject(NgZone);\n private readonly viewContainerRef: ViewContainerRef = inject(ViewContainerRef);\n private readonly destroyRef = inject(DestroyRef);\n\n apTooltip = input.required<string | TemplateRef<HTMLElement> | undefined | null>();\n apTooltipPosition = input<'right' | 'left' | 'top' | 'bottom' | 'bottom-left' | 'bottom-right' | 'top-left' | 'top-right'>('top');\n apTooltipShowDelay = input<number>(80);\n apTooltipHideDelay = input<number>(0);\n apTooltipDuration = input<number>(0);\n apTooltipDisabled = input<boolean>(false);\n apTooltipTruncatedTextOnly = input<boolean>(false);\n apTooltipTemplateContext = input<any>();\n apTooltipVirtualScrollElement = input<CdkVirtualScrollViewport>();\n apTooltipTrigger = input<'hover' | 'click'>('hover');\n\n // Predefined template variables\n apTooltipType = input<CustomTooltipType>(CustomTooltipType.DEFAULT);\n apTooltipPresentationContext = input<CustomTooltipPresentationItem>();\n apTooltipListItems = input<CustomTooltipListItem[]>([]);\n\n isDefaultTooltipType = computed(() => !this.apTooltipType() || this.apTooltipType() === CustomTooltipType.DEFAULT);\n isValidPredefinedTooltip = computed(\n () =>\n (this.apTooltipType() === CustomTooltipType.PRESENTATION &&\n this.apTooltipPresentationContext()?.title &&\n this.apTooltipPresentationContext()?.description) ||\n (this.apTooltipType() === CustomTooltipType.LIST && this.apTooltipListItems().length > 0)\n );\n\n clickListener: (() => void) | undefined = undefined;\n\n container: HTMLElement | undefined = undefined;\n\n hideTimeout: number | undefined;\n\n mouseEnterListener: (() => void) | undefined = undefined;\n\n mouseLeaveListener: (() => void) | undefined = undefined;\n\n nativeElement: HTMLElement = this.elementRef.nativeElement;\n\n showTimeout: number | undefined;\n\n tooltipText: HTMLElement | undefined;\n\n _externallyTriggerred: boolean = false;\n\n ngOnInit(): void {\n const apTooltipVirtualScrollElement = this.apTooltipVirtualScrollElement();\n if (apTooltipVirtualScrollElement) {\n apTooltipVirtualScrollElement.renderedRangeStream.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(range => {\n if (range.start === 0 && range.end === 0) {\n this.deactivate();\n }\n });\n }\n }\n\n ngAfterViewInit(): void {\n this.setupEventListeners(this.apTooltipTrigger());\n }\n\n private setupEventListeners(trigger: 'hover' | 'click'): void {\n // Close any open tooltip when switching modes\n if (this.container) {\n this.remove();\n }\n\n this.cleanupEventListeners();\n\n this.zone.runOutsideAngular(() => {\n this.clickListener = this.onInputClick.bind(this);\n this.nativeElement.addEventListener('click', this.clickListener, true);\n if (trigger === 'hover') {\n this.mouseEnterListener = this.onMouseEnter.bind(this);\n this.mouseLeaveListener = this.onMouseLeave.bind(this);\n this.nativeElement.addEventListener('mouseenter', this.mouseEnterListener);\n this.nativeElement.addEventListener('mouseleave', this.mouseLeaveListener);\n }\n });\n }\n\n private cleanupEventListeners(): void {\n if (this.mouseEnterListener) {\n this.nativeElement.removeEventListener('mouseenter', this.mouseEnterListener);\n this.mouseEnterListener = undefined;\n }\n if (this.clickListener) {\n this.nativeElement.removeEventListener('click', this.clickListener, true);\n this.clickListener = undefined;\n }\n if (this.mouseLeaveListener) {\n this.nativeElement.removeEventListener('mouseleave', this.mouseLeaveListener);\n this.mouseLeaveListener = undefined;\n }\n }\n\n ngOnDestroy(): void {\n if (this.container) {\n this.deactivate();\n }\n this.cleanupEventListeners();\n }\n\n onMouseEnter(): void {\n if (!this.container) {\n this.activate();\n }\n }\n\n onMouseLeave(): void {\n if (!this._externallyTriggerred) {\n this.deactivate();\n }\n }\n\n onInputClick(): void {\n this.zone.run(() => {\n const trigger = this.apTooltipTrigger();\n\n if (trigger === 'click') {\n if (this.container) {\n this.deactivate();\n } else {\n this.activate();\n }\n } else {\n this.deactivate();\n }\n });\n }\n\n activate(): void {\n this.clearHideTimeout();\n if (this.apTooltipShowDelay()) {\n this.showTimeout = window.setTimeout(() => {\n this.show();\n }, this.apTooltipShowDelay());\n } else {\n this.show();\n }\n\n if (this.apTooltipDuration()) {\n const duration = this.apTooltipShowDelay() ? this.apTooltipDuration() + this.apTooltipShowDelay() : this.apTooltipDuration();\n this.hideTimeout = window.setTimeout(() => {\n this.remove();\n }, duration);\n }\n }\n\n deactivate(): void {\n this.clearShowTimeout();\n if (this.apTooltipHideDelay()) {\n this.clearHideTimeout();\n this.hideTimeout = window.setTimeout(() => {\n this.remove();\n }, this.apTooltipHideDelay());\n } else {\n this.remove();\n }\n }\n\n show(): void {\n if (this.apTooltipTruncatedTextOnly() && this.elementRef.nativeElement.scrollWidth === this.elementRef.nativeElement.clientWidth) {\n return;\n }\n if (\n (this.isDefaultTooltipType() && !this.apTooltip()) ||\n (!this.isDefaultTooltipType() && !this.isValidPredefinedTooltip()) ||\n this.apTooltipDisabled()\n ) {\n return;\n }\n\n this.create();\n\n // For predefined tooltips, alignment is deferred after component rendering\n if (this.isDefaultTooltipType()) {\n this.align();\n }\n }\n\n create(): void {\n if (this.container) {\n this.clearHideTimeout();\n this.remove();\n }\n if (this.isDefaultTooltipType()) {\n this.createDefaultTooltip();\n } else {\n this.createPredefinedTooltip();\n }\n }\n\n createDefaultTooltip(): void {\n this.container = document.createElement('div');\n this.container.setAttribute('role', 'tooltip');\n\n this.tooltipText = document.createElement('div');\n this.tooltipText.className = 'ap-tooltip-text';\n this.updateText();\n\n const contentContainer = document.createElement('div');\n contentContainer.classList.add('ap-content-container');\n\n contentContainer.appendChild(this.tooltipText);\n contentContainer.appendChild(this.createSvgElement());\n this.container.appendChild(contentContainer);\n\n document.body.appendChild(this.container);\n this.container.classList.add('ap-tooltip');\n\n if (this.apTooltip() instanceof TemplateRef) {\n this.container.classList.add('ap-tooltip-custom-template');\n }\n this.setCssVariables();\n }\n\n createPredefinedTooltip(): void {\n const componentRef = this.viewContainerRef.createComponent(TooltipComponent);\n\n // Set inputs\n componentRef.setInput('type', this.apTooltipType());\n componentRef.setInput('presentationContext', this.apTooltipPresentationContext());\n componentRef.setInput('tooltipListItems', this.apTooltipListItems());\n\n // Force change detection to render the component immediately\n componentRef.changeDetectorRef.detectChanges();\n\n this.container = document.createElement('div');\n this.container.setAttribute('role', 'tooltip');\n\n const contentContainer = document.createElement('div');\n contentContainer.classList.add('ap-content-container', 'ap-content-predefined-container');\n\n contentContainer.appendChild(componentRef.location.nativeElement);\n contentContainer.appendChild(this.createSvgElement());\n this.container.appendChild(contentContainer);\n\n document.body.appendChild(this.container);\n\n this.container.classList.add('ap-tooltip', 'ap-predefined-tooltip');\n\n // Has to wait for the TooltipComponent to be rendered in order to align and then set the CSS variable --ap-tooltip-height\n requestAnimationFrame(() => {\n this.align();\n this.setCssVariables();\n });\n }\n\n createSvgElement(): SVGElement {\n const svgNamespace = 'http://www.w3.org/2000/svg';\n const arrowSvg = document.createElementNS(svgNamespace, 'svg');\n arrowSvg.classList.add('ap-tooltip-arrow');\n arrowSvg.setAttribute('xmlns', svgNamespace);\n arrowSvg.setAttribute('viewBox', '0 0 16 8');\n arrowSvg.setAttribute('fill', 'none');\n const path = document.createElementNS(svgNamespace, 'path');\n path.setAttribute('d', 'M6.68299 1.15238C7.43705 0.492586 8.56296 0.492588 9.31701 1.15238L16 7L0 7L6.68299 1.15238Z');\n arrowSvg.appendChild(path);\n\n return arrowSvg;\n }\n\n align(): void {\n switch (this.apTooltipPosition()) {\n case 'top-left':\n this.alignTopLeft();\n if (this.isOutOfBounds()) {\n this.alignBottom();\n if (this.isOutOfBounds()) {\n this.alignRight();\n if (this.isOutOfBounds()) {\n this.alignLeft();\n }\n }\n }\n break;\n case 'top-right':\n this.alignTopRight();\n if (this.isOutOfBounds()) {\n this.alignBottom();\n if (this.isOutOfBounds()) {\n this.alignRight();\n if (this.isOutOfBounds()) {\n this.alignLeft();\n }\n }\n }\n break;\n case 'top':\n this.alignTop();\n if (this.isOutOfBounds()) {\n this.alignBottom();\n if (this.isOutOfBounds()) {\n this.alignRight();\n\n if (this.isOutOfBounds()) {\n this.alignLeft();\n }\n }\n }\n break;\n\n case 'bottom':\n this.alignBottom();\n if (this.isOutOfBounds()) {\n this.alignTop();\n if (this.isOutOfBounds()) {\n this.alignRight();\n\n if (this.isOutOfBounds()) {\n this.alignLeft();\n }\n }\n }\n break;\n\n case 'bottom-left':\n this.alignBottomLeft();\n if (this.isOutOfBounds()) {\n this.alignTop();\n if (this.isOutOfBounds()) {\n this.alignRight();\n\n if (this.isOutOfBounds()) {\n this.alignLeft();\n }\n }\n }\n break;\n\n case 'bottom-right':\n this.alignBottomRight();\n if (this.isOutOfBounds()) {\n this.alignTop();\n if (this.isOutOfBounds()) {\n this.alignRight();\n\n if (this.isOutOfBounds()) {\n this.alignLeft();\n }\n }\n }\n break;\n\n case 'left':\n this.alignLeft();\n if (this.isOutOfBounds()) {\n this.alignRight();\n\n if (this.isOutOfBounds()) {\n this.alignTop();\n\n if (this.isOutOfBounds()) {\n this.alignBottom();\n }\n }\n }\n break;\n\n case 'right':\n this.alignRight();\n if (this.isOutOfBounds()) {\n this.alignLeft();\n\n if (this.isOutOfBounds()) {\n this.alignTop();\n\n if (this.isOutOfBounds()) {\n this.alignBottom();\n }\n }\n }\n break;\n }\n }\n\n alignRight(): void {\n this.preAlign('right');\n if (this.container) {\n const hostOffset = this.getHostOffset();\n const left = hostOffset.left + TooltipService.getOuterWidth(this.nativeElement) + TooltipService.defaultOffset;\n const top =\n hostOffset.top + (TooltipService.getOuterHeight(this.nativeElement) - TooltipService.getOuterHeight(this.container)) / 2;\n this.container.style.left = left + 'px';\n this.container.style.top = top + 'px';\n }\n }\n\n alignLeft(): void {\n this.preAlign('left');\n if (this.container) {\n const hostOffset = this.getHostOffset();\n const left = hostOffset.left - TooltipService.getOuterWidth(this.container) - TooltipService.defaultOffset;\n const top =\n hostOffset.top + (TooltipService.getOuterHeight(this.nativeElement) - TooltipService.getOuterHeight(this.container)) / 2;\n this.container.style.left = left + 'px';\n this.container.style.top = top + 'px';\n }\n }\n\n alignTop(): void {\n this.preAlign('top');\n if (this.container) {\n const hostOffset = this.getHostOffset();\n const left =\n hostOffset.left + (TooltipService.getOuterWidth(this.nativeElement) - TooltipService.getOuterWidth(this.container)) / 2;\n const top = hostOffset.top - TooltipService.getOuterHeight(this.container) - TooltipService.defaultOffset;\n this.container.style.left = left + 'px';\n this.container.style.top = top + 'px';\n }\n }\n\n alignTopLeft(): void {\n this.preAlign('top-left');\n if (this.container) {\n const hostOffset = this.getHostOffset();\n const left = hostOffset.left;\n const top = hostOffset.top - TooltipService.getOuterHeight(this.container) - TooltipService.defaultOffset;\n this.container.style.left = left + 'px';\n this.container.style.top = top + 'px';\n }\n }\n\n alignTopRight(): void {\n this.preAlign('top-right');\n if (this.container) {\n const hostOffset = this.getHostOffset();\n const left = hostOffset.left + TooltipService.getOuterWidth(this.nativeElement) - TooltipService.getOuterWidth(this.container);\n const top = hostOffset.top - TooltipService.getOuterHeight(this.container) - TooltipService.defaultOffset;\n this.container.style.left = left + 'px';\n this.container.style.top = top + 'px';\n }\n }\n\n alignBottom(): void {\n this.preAlign('bottom');\n if (this.container) {\n const hostOffset = this.getHostOffset();\n const left =\n hostOffset.left + (TooltipService.getOuterWidth(this.nativeElement) - TooltipService.getOuterWidth(this.container)) / 2;\n const top = hostOffset.top + TooltipService.getOuterHeight(this.nativeElement) + TooltipService.defaultOffset;\n this.container.style.left = left + 'px';\n this.container.style.top = top + 'px';\n }\n }\n\n alignBottomLeft(): void {\n this.preAlign('bottom-left');\n if (this.container) {\n const hostOffset = this.getHostOffset();\n const left = hostOffset.left;\n const top = hostOffset.top + TooltipService.getOuterHeight(this.nativeElement) + TooltipService.defaultOffset;\n this.container.style.left = left + 'px';\n this.container.style.top = top + 'px';\n }\n }\n\n alignBottomRight(): void {\n this.preAlign('bottom-right');\n if (this.container) {\n const hostOffset = this.getHostOffset();\n const left =\n hostOffset.left + (TooltipService.getOuterWidth(this.nativeElement) - TooltipService.getOuterWidth(this.container));\n const top = hostOffset.top + TooltipService.getOuterHeight(this.nativeElement) + TooltipService.defaultOffset;\n this.container.style.left = left + 'px';\n this.container.style.top = top + 'px';\n }\n }\n\n preAlign(position: string) {\n if (this.container) {\n this.container.style.left = -999 + 'px';\n this.container.style.top = -999 + 'px';\n\n const defaultClassName = 'ap-tooltip-' + position;\n this.container.classList.add(defaultClassName);\n }\n }\n\n getHostOffset() {\n const offset = this.nativeElement.getBoundingClientRect();\n const targetLeft = offset.left + TooltipService.getWindowScrollLeft();\n const targetTop = offset.top + TooltipService.getWindowScrollTop();\n\n return { left: targetLeft, top: targetTop };\n }\n\n isOutOfBounds(): boolean {\n if (this.container) {\n const offset = this.container.getBoundingClientRect();\n const targetTop = offset.top;\n const targetLeft = offset.left;\n const width = TooltipService.getOuterWidth(this.container);\n const height = TooltipService.getOuterHeight(this.container);\n const viewport = TooltipService.getViewport();\n\n return targetLeft + width > viewport.width || targetLeft < 0 || targetTop < 0 || targetTop + height > viewport.height;\n } else {\n return false;\n }\n }\n\n remove(): void {\n if (this.container && this.container.parentElement) {\n document.body.removeChild(this.container);\n }\n\n this.clearTimeouts();\n this._externallyTriggerred = false;\n this.container = undefined;\n }\n\n clearShowTimeout() {\n if (this.showTimeout) {\n clearTimeout(this.showTimeout);\n this.showTimeout = undefined;\n }\n }\n\n clearHideTimeout() {\n if (this.hideTimeout) {\n clearTimeout(this.hideTimeout);\n this.hideTimeout = undefined;\n }\n }\n\n clearTimeouts() {\n this.clearShowTimeout();\n this.clearHideTimeout();\n }\n\n updateText() {\n const apTooltip = this.apTooltip();\n if (apTooltip instanceof TemplateRef) {\n const embeddedViewRef = this.viewContainerRef.createEmbeddedView(apTooltip);\n embeddedViewRef.context = this.apTooltipTemplateContext();\n embeddedViewRef.detectChanges();\n embeddedViewRef.rootNodes.forEach(node => this.tooltipText?.appendChild(node));\n } else if (this.tooltipText) {\n this.tooltipText.innerHTML = apTooltip ? DOMPurify.sanitize(apTooltip) : '';\n }\n }\n\n setCssVariables(): void {\n if (this.container) {\n this.container.style.setProperty('--ap-tooltip-height', this.container.offsetHeight + 'px');\n }\n }\n\n get externallyTriggerred(): boolean {\n return this._externallyTriggerred;\n }\n\n set externallyTriggerred(value: boolean) {\n this._externallyTriggerred = value;\n }\n}\n","import {\n AfterViewInit,\n Directive,\n ElementRef,\n inject,\n input,\n NgZone,\n OnDestroy,\n} from '@angular/core';\nimport { TooltipDirective } from './tooltip.directive';\n\n/**\n * Directive that triggers a tooltip to show/hide\n *\n * ```html\n * <div #myTooltip=\"apTooltip\" apTooltip>Content</div>\n * <div [apTooltipTrigger]=\"myTooltip\">Click me</div>\n * ```\n */\n@Directive({\n selector: '[apTooltipTrigger]',\n standalone: true,\n})\nexport class TooltipTriggerDirective implements AfterViewInit, OnDestroy {\n private readonly elementRef: ElementRef = inject(ElementRef);\n private readonly zone: NgZone = inject(NgZone);\n\n // Accept a TooltipDirective reference for sibling usage\n apTooltipTrigger = input<TooltipDirective>();\n\n private clickListener: (() => void) | undefined = undefined;\n\n private get targetTooltip(): TooltipDirective | null {\n // Prefer explicit reference, fall back to parent\n return this.apTooltipTrigger() ?? null;\n }\n\n ngAfterViewInit(): void {\n if (!this.targetTooltip) {\n return;\n }\n\n this.setupEventListeners();\n }\n\n private setupEventListeners(): void {\n this.cleanupEventListeners();\n\n this.zone.runOutsideAngular(() => {\n const nativeElement = this.elementRef.nativeElement;\n\n this.clickListener = this.onClick.bind(this);\n nativeElement.addEventListener('click', this.clickListener, true);\n });\n }\n\n private cleanupEventListeners(): void {\n const nativeElement = this.elementRef.nativeElement;\n\n if (this.clickListener) {\n nativeElement.removeEventListener('click', this.clickListener, true);\n this.clickListener = undefined;\n }\n }\n\n ngOnDestroy(): void {\n this.cleanupEventListeners();\n }\n\n private onClick(): void {\n this.zone.run(() => {\n const tooltip = this.targetTooltip;\n if (!tooltip) return;\n\n if (tooltip.container) {\n tooltip.deactivate();\n } else {\n tooltip.externallyTriggerred = true;\n tooltip.activate();\n }\n });\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;AAGO,MAAM,iBAAiB,GAAG;IAC7B,OAAO,EAAE,SAAS;AAClB,IAAA,YAAY,EAAE,cAAc;AAC5B,IAAA,IAAI,EAAE,MAAM;;AAgBhB;;;AAGG;MAUU,gBAA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C,OAAO;gBAAE;AAEd,YAAA,IAAI,OAAO,CAAC,SAAS,EAAE;gBACnB,OAAO,CAAC,UAAU,EAAE;YACxB;iBAAO;AACH,gBAAA,OAAO,CAAC,oBAAoB,GAAG,IAAI;gBACnC,OAAO,CAAC,QAAQ,EAAE;YACtB;AACJ,QAAA,CAAC,CAAC;IACN;uGA1DS,uBAAuB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAvB,uBAAuB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,oBAAA,EAAA,MAAA,EAAA,EAAA,gBAAA,EAAA,EAAA,iBAAA,EAAA,kBAAA,EAAA,UAAA,EAAA,kBAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAvB,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBAJnC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,oBAAoB;AAC9B,oBAAA,UAAU,EAAE,IAAI;AACnB,iBAAA;;;ACtBD;;AAEG;;;;"}
1
+ {"version":3,"file":"agorapulse-ui-components-tooltip.mjs","sources":["../../../libs/ui-components/tooltip/src/tooltip.component.ts","../../../libs/ui-components/tooltip/src/tooltip.component.html","../../../libs/ui-components/tooltip/src/tooltip.service.ts","../../../libs/ui-components/tooltip/src/tooltip.directive.ts","../../../libs/ui-components/tooltip/src/tooltip-trigger.directive.ts","../../../libs/ui-components/tooltip/src/agorapulse-ui-components-tooltip.ts"],"sourcesContent":["import { AvatarComponent } from '@agorapulse/ui-components/avatar';\nimport { ChangeDetectionStrategy, Component, input, ViewEncapsulation } from '@angular/core';\n\nexport const CustomTooltipType = {\n DEFAULT: 'DEFAULT', // default type\n PRESENTATION: 'PRESENTATION',\n LIST: 'LIST',\n};\nexport type CustomTooltipType = (typeof CustomTooltipType)[keyof typeof CustomTooltipType];\n\nexport type CustomTooltipPresentationItem = {\n title: string;\n description: string;\n};\n\nexport type CustomTooltipListItem = {\n profilePicture: string;\n title: string;\n caption?: string;\n network?: string;\n};\n\n/**\n * A tooltip component that is used for predefined templates: Presentation and List.\n * Not to be used directly, use TooltipDirective instead.\n */\n@Component({\n changeDetection: ChangeDetectionStrategy.OnPush,\n selector: 'ap-tooltip',\n templateUrl: './tooltip.component.html',\n styleUrls: ['./tooltip.component.scss'],\n imports: [AvatarComponent],\n providers: [],\n encapsulation: ViewEncapsulation.None,\n})\nexport class TooltipComponent {\n protected readonly CUSTOM_TOOLTIP_TYPE = CustomTooltipType;\n\n type = input<CustomTooltipType>(CustomTooltipType.DEFAULT);\n presentationContext = input<CustomTooltipPresentationItem>();\n\n tooltipListItems = input<CustomTooltipListItem[]>([]);\n}\n","<div class=\"custom-tooltip-container\">\n @switch (type()) {\n @case (CUSTOM_TOOLTIP_TYPE.PRESENTATION) {\n @let presentation = presentationContext();\n @if (presentation) {\n <div class=\"tooltip-presentation-title\">{{ presentation.title }}</div>\n <div class=\"tooltip-presentation-caption\">{{ presentation.description }}</div>\n }\n }\n @case (CUSTOM_TOOLTIP_TYPE.LIST) {\n <div class=\"tooltip-list-container\">\n @for (item of tooltipListItems(); track item) {\n <div class=\"tooltip-item\">\n <ap-avatar\n [profilePicture]=\"item.profilePicture\"\n [network]=\"item.network\"\n [size]=\"item.caption ? 32 : 24\" />\n\n <div class=\"tooltip-item-info\">\n <div class=\"tooltip-item-title\">\n {{ item.title }}\n </div>\n @if (item.caption) {\n <div class=\"tooltip-item-caption\">\n {{ item.caption }}\n </div>\n }\n </div>\n </div>\n }\n </div>\n }\n @default {\n\n }\n }\n\n</div>\n","import { Injectable } from '@angular/core';\n\n@Injectable()\nexport class TooltipService {\n static readonly defaultOffset = 12;\n\n static getOuterWidth(el: HTMLElement): number {\n return el.offsetWidth;\n }\n\n static getOuterHeight(el: HTMLElement): number {\n return el.offsetHeight;\n }\n\n static getViewport(): any {\n const win = window,\n d = document,\n e = d.documentElement,\n g = d.getElementsByTagName('body')[0],\n w = win.innerWidth || e.clientWidth || g.clientWidth,\n h = win.innerHeight || e.clientHeight || g.clientHeight;\n\n return { width: w, height: h };\n }\n\n static getWindowScrollLeft(): number {\n const doc = document.documentElement;\n return (window.pageXOffset || doc.scrollLeft) - (doc.clientLeft || 0);\n }\n\n static getWindowScrollTop(): number {\n const doc = document.documentElement;\n return (window.pageYOffset || doc.scrollTop) - (doc.clientTop || 0);\n }\n}\n","import { CdkVirtualScrollViewport } from '@angular/cdk/scrolling';\nimport {\n AfterViewInit,\n computed,\n DestroyRef,\n Directive,\n ElementRef,\n HostListener,\n inject,\n input,\n NgZone,\n OnDestroy,\n OnInit,\n TemplateRef,\n ViewContainerRef,\n} from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport DOMPurify from 'dompurify';\nimport { CustomTooltipListItem, CustomTooltipPresentationItem, CustomTooltipType, TooltipComponent } from './tooltip.component';\nimport { TooltipService } from './tooltip.service';\n\n@Directive({ selector: '[apTooltip]', standalone: true, exportAs: 'apTooltip' })\nexport class TooltipDirective implements AfterViewInit, OnDestroy, OnInit {\n private readonly elementRef: ElementRef = inject(ElementRef);\n private readonly zone: NgZone = inject(NgZone);\n private readonly viewContainerRef: ViewContainerRef = inject(ViewContainerRef);\n private readonly destroyRef = inject(DestroyRef);\n\n @HostListener('document:click', ['$event.target'])\n public onClick(targetElement: HTMLElement) {\n if (!this.container) {\n return;\n }\n const clickedInside = this.container.contains(targetElement);\n if (!clickedInside) {\n this.deactivate();\n }\n }\n\n apTooltip = input.required<string | TemplateRef<HTMLElement> | undefined | null>();\n apTooltipPosition = input<'right' | 'left' | 'top' | 'bottom' | 'bottom-left' | 'bottom-right' | 'top-left' | 'top-right'>('top');\n apTooltipShowDelay = input<number>(80);\n apTooltipHideDelay = input<number>(0);\n apTooltipDuration = input<number>(0);\n apTooltipDisabled = input<boolean>(false);\n apTooltipTruncatedTextOnly = input<boolean>(false);\n apTooltipTemplateContext = input<any>();\n apTooltipVirtualScrollElement = input<CdkVirtualScrollViewport>();\n apTooltipTrigger = input<'hover' | 'click'>('hover');\n\n // Predefined template variables\n apTooltipType = input<CustomTooltipType>(CustomTooltipType.DEFAULT);\n apTooltipPresentationContext = input<CustomTooltipPresentationItem>();\n apTooltipListItems = input<CustomTooltipListItem[]>([]);\n\n isDefaultTooltipType = computed(() => !this.apTooltipType() || this.apTooltipType() === CustomTooltipType.DEFAULT);\n isValidPredefinedTooltip = computed(\n () =>\n (this.apTooltipType() === CustomTooltipType.PRESENTATION &&\n this.apTooltipPresentationContext()?.title &&\n this.apTooltipPresentationContext()?.description) ||\n (this.apTooltipType() === CustomTooltipType.LIST && this.apTooltipListItems().length > 0)\n );\n\n clickListener: (() => void) | undefined = undefined;\n\n container: HTMLElement | undefined = undefined;\n\n hideTimeout: number | undefined;\n\n mouseEnterListener: (() => void) | undefined = undefined;\n\n mouseLeaveListener: (() => void) | undefined = undefined;\n\n nativeElement: HTMLElement = this.elementRef.nativeElement;\n\n showTimeout: number | undefined;\n\n tooltipText: HTMLElement | undefined;\n\n _externallyTriggerred: boolean = false;\n\n ngOnInit(): void {\n const apTooltipVirtualScrollElement = this.apTooltipVirtualScrollElement();\n if (apTooltipVirtualScrollElement) {\n apTooltipVirtualScrollElement.renderedRangeStream.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(range => {\n if (range.start === 0 && range.end === 0) {\n this.deactivate();\n }\n });\n }\n }\n\n ngAfterViewInit(): void {\n this.setupEventListeners(this.apTooltipTrigger());\n }\n\n private setupEventListeners(trigger: 'hover' | 'click'): void {\n // Close any open tooltip when switching modes\n if (this.container) {\n this.remove();\n }\n\n this.cleanupEventListeners();\n\n this.zone.runOutsideAngular(() => {\n this.clickListener = this.onInputClick.bind(this);\n this.nativeElement.addEventListener('click', this.clickListener, true);\n if (trigger === 'hover') {\n this.mouseEnterListener = this.onMouseEnter.bind(this);\n this.mouseLeaveListener = this.onMouseLeave.bind(this);\n this.nativeElement.addEventListener('mouseenter', this.mouseEnterListener);\n this.nativeElement.addEventListener('mouseleave', this.mouseLeaveListener);\n }\n });\n }\n\n private cleanupEventListeners(): void {\n if (this.mouseEnterListener) {\n this.nativeElement.removeEventListener('mouseenter', this.mouseEnterListener);\n this.mouseEnterListener = undefined;\n }\n if (this.clickListener) {\n this.nativeElement.removeEventListener('click', this.clickListener, true);\n this.clickListener = undefined;\n }\n if (this.mouseLeaveListener) {\n this.nativeElement.removeEventListener('mouseleave', this.mouseLeaveListener);\n this.mouseLeaveListener = undefined;\n }\n }\n\n ngOnDestroy(): void {\n if (this.container) {\n this.deactivate();\n }\n this.cleanupEventListeners();\n }\n\n onMouseEnter(): void {\n if (!this.container) {\n this.activate();\n }\n }\n\n onMouseLeave(): void {\n if (!this._externallyTriggerred) {\n this.deactivate();\n }\n }\n\n onInputClick(): void {\n this.zone.run(() => {\n const trigger = this.apTooltipTrigger();\n\n if (trigger === 'click') {\n if (this.container) {\n this.deactivate();\n } else {\n this.activate();\n }\n } else {\n this.deactivate();\n }\n });\n }\n\n activate(): void {\n this.clearHideTimeout();\n if (this.apTooltipShowDelay()) {\n this.showTimeout = window.setTimeout(() => {\n this.show();\n }, this.apTooltipShowDelay());\n } else {\n this.show();\n }\n\n if (this.apTooltipDuration()) {\n const duration = this.apTooltipShowDelay() ? this.apTooltipDuration() + this.apTooltipShowDelay() : this.apTooltipDuration();\n this.hideTimeout = window.setTimeout(() => {\n this.remove();\n }, duration);\n }\n }\n\n deactivate(): void {\n this.clearShowTimeout();\n if (this.apTooltipHideDelay()) {\n this.clearHideTimeout();\n this.hideTimeout = window.setTimeout(() => {\n this.remove();\n }, this.apTooltipHideDelay());\n } else {\n this.remove();\n }\n }\n\n show(): void {\n if (this.apTooltipTruncatedTextOnly() && this.elementRef.nativeElement.scrollWidth === this.elementRef.nativeElement.clientWidth) {\n return;\n }\n if (\n (this.isDefaultTooltipType() && !this.apTooltip()) ||\n (!this.isDefaultTooltipType() && !this.isValidPredefinedTooltip()) ||\n this.apTooltipDisabled()\n ) {\n return;\n }\n\n this.create();\n\n // For predefined tooltips, alignment is deferred after component rendering\n if (this.isDefaultTooltipType()) {\n this.align();\n }\n }\n\n create(): void {\n if (this.container) {\n this.clearHideTimeout();\n this.remove();\n }\n if (this.isDefaultTooltipType()) {\n this.createDefaultTooltip();\n } else {\n this.createPredefinedTooltip();\n }\n }\n\n createDefaultTooltip(): void {\n this.container = document.createElement('div');\n this.container.setAttribute('role', 'tooltip');\n\n this.tooltipText = document.createElement('div');\n this.tooltipText.className = 'ap-tooltip-text';\n this.updateText();\n\n const contentContainer = document.createElement('div');\n contentContainer.classList.add('ap-content-container');\n\n contentContainer.appendChild(this.tooltipText);\n contentContainer.appendChild(this.createSvgElement());\n this.container.appendChild(contentContainer);\n\n document.body.appendChild(this.container);\n this.container.classList.add('ap-tooltip');\n\n if (this.apTooltip() instanceof TemplateRef) {\n this.container.classList.add('ap-tooltip-custom-template');\n }\n this.setCssVariables();\n }\n\n createPredefinedTooltip(): void {\n const componentRef = this.viewContainerRef.createComponent(TooltipComponent);\n\n // Set inputs\n componentRef.setInput('type', this.apTooltipType());\n componentRef.setInput('presentationContext', this.apTooltipPresentationContext());\n componentRef.setInput('tooltipListItems', this.apTooltipListItems());\n\n // Force change detection to render the component immediately\n componentRef.changeDetectorRef.detectChanges();\n\n this.container = document.createElement('div');\n this.container.setAttribute('role', 'tooltip');\n\n const contentContainer = document.createElement('div');\n contentContainer.classList.add('ap-content-container', 'ap-content-predefined-container');\n\n contentContainer.appendChild(componentRef.location.nativeElement);\n contentContainer.appendChild(this.createSvgElement());\n this.container.appendChild(contentContainer);\n\n document.body.appendChild(this.container);\n\n this.container.classList.add('ap-tooltip', 'ap-predefined-tooltip');\n\n // Has to wait for the TooltipComponent to be rendered in order to align and then set the CSS variable --ap-tooltip-height\n requestAnimationFrame(() => {\n this.align();\n this.setCssVariables();\n });\n }\n\n createSvgElement(): SVGElement {\n const svgNamespace = 'http://www.w3.org/2000/svg';\n const arrowSvg = document.createElementNS(svgNamespace, 'svg');\n arrowSvg.classList.add('ap-tooltip-arrow');\n arrowSvg.setAttribute('xmlns', svgNamespace);\n arrowSvg.setAttribute('viewBox', '0 0 16 8');\n arrowSvg.setAttribute('fill', 'none');\n const path = document.createElementNS(svgNamespace, 'path');\n path.setAttribute('d', 'M6.68299 1.15238C7.43705 0.492586 8.56296 0.492588 9.31701 1.15238L16 7L0 7L6.68299 1.15238Z');\n arrowSvg.appendChild(path);\n\n return arrowSvg;\n }\n\n align(): void {\n switch (this.apTooltipPosition()) {\n case 'top-left':\n this.alignTopLeft();\n if (this.isOutOfBounds()) {\n this.alignBottom();\n if (this.isOutOfBounds()) {\n this.alignRight();\n if (this.isOutOfBounds()) {\n this.alignLeft();\n }\n }\n }\n break;\n case 'top-right':\n this.alignTopRight();\n if (this.isOutOfBounds()) {\n this.alignBottom();\n if (this.isOutOfBounds()) {\n this.alignRight();\n if (this.isOutOfBounds()) {\n this.alignLeft();\n }\n }\n }\n break;\n case 'top':\n this.alignTop();\n if (this.isOutOfBounds()) {\n this.alignBottom();\n if (this.isOutOfBounds()) {\n this.alignRight();\n\n if (this.isOutOfBounds()) {\n this.alignLeft();\n }\n }\n }\n break;\n\n case 'bottom':\n this.alignBottom();\n if (this.isOutOfBounds()) {\n this.alignTop();\n if (this.isOutOfBounds()) {\n this.alignRight();\n\n if (this.isOutOfBounds()) {\n this.alignLeft();\n }\n }\n }\n break;\n\n case 'bottom-left':\n this.alignBottomLeft();\n if (this.isOutOfBounds()) {\n this.alignTop();\n if (this.isOutOfBounds()) {\n this.alignRight();\n\n if (this.isOutOfBounds()) {\n this.alignLeft();\n }\n }\n }\n break;\n\n case 'bottom-right':\n this.alignBottomRight();\n if (this.isOutOfBounds()) {\n this.alignTop();\n if (this.isOutOfBounds()) {\n this.alignRight();\n\n if (this.isOutOfBounds()) {\n this.alignLeft();\n }\n }\n }\n break;\n\n case 'left':\n this.alignLeft();\n if (this.isOutOfBounds()) {\n this.alignRight();\n\n if (this.isOutOfBounds()) {\n this.alignTop();\n\n if (this.isOutOfBounds()) {\n this.alignBottom();\n }\n }\n }\n break;\n\n case 'right':\n this.alignRight();\n if (this.isOutOfBounds()) {\n this.alignLeft();\n\n if (this.isOutOfBounds()) {\n this.alignTop();\n\n if (this.isOutOfBounds()) {\n this.alignBottom();\n }\n }\n }\n break;\n }\n }\n\n alignRight(): void {\n this.preAlign('right');\n if (this.container) {\n const hostOffset = this.getHostOffset();\n const left = hostOffset.left + TooltipService.getOuterWidth(this.nativeElement) + TooltipService.defaultOffset;\n const top =\n hostOffset.top + (TooltipService.getOuterHeight(this.nativeElement) - TooltipService.getOuterHeight(this.container)) / 2;\n this.container.style.left = left + 'px';\n this.container.style.top = top + 'px';\n }\n }\n\n alignLeft(): void {\n this.preAlign('left');\n if (this.container) {\n const hostOffset = this.getHostOffset();\n const left = hostOffset.left - TooltipService.getOuterWidth(this.container) - TooltipService.defaultOffset;\n const top =\n hostOffset.top + (TooltipService.getOuterHeight(this.nativeElement) - TooltipService.getOuterHeight(this.container)) / 2;\n this.container.style.left = left + 'px';\n this.container.style.top = top + 'px';\n }\n }\n\n alignTop(): void {\n this.preAlign('top');\n if (this.container) {\n const hostOffset = this.getHostOffset();\n const left =\n hostOffset.left + (TooltipService.getOuterWidth(this.nativeElement) - TooltipService.getOuterWidth(this.container)) / 2;\n const top = hostOffset.top - TooltipService.getOuterHeight(this.container) - TooltipService.defaultOffset;\n this.container.style.left = left + 'px';\n this.container.style.top = top + 'px';\n }\n }\n\n alignTopLeft(): void {\n this.preAlign('top-left');\n if (this.container) {\n const hostOffset = this.getHostOffset();\n const left = hostOffset.left;\n const top = hostOffset.top - TooltipService.getOuterHeight(this.container) - TooltipService.defaultOffset;\n this.container.style.left = left + 'px';\n this.container.style.top = top + 'px';\n }\n }\n\n alignTopRight(): void {\n this.preAlign('top-right');\n if (this.container) {\n const hostOffset = this.getHostOffset();\n const left = hostOffset.left + TooltipService.getOuterWidth(this.nativeElement) - TooltipService.getOuterWidth(this.container);\n const top = hostOffset.top - TooltipService.getOuterHeight(this.container) - TooltipService.defaultOffset;\n this.container.style.left = left + 'px';\n this.container.style.top = top + 'px';\n }\n }\n\n alignBottom(): void {\n this.preAlign('bottom');\n if (this.container) {\n const hostOffset = this.getHostOffset();\n const left =\n hostOffset.left + (TooltipService.getOuterWidth(this.nativeElement) - TooltipService.getOuterWidth(this.container)) / 2;\n const top = hostOffset.top + TooltipService.getOuterHeight(this.nativeElement) + TooltipService.defaultOffset;\n this.container.style.left = left + 'px';\n this.container.style.top = top + 'px';\n }\n }\n\n alignBottomLeft(): void {\n this.preAlign('bottom-left');\n if (this.container) {\n const hostOffset = this.getHostOffset();\n const left = hostOffset.left;\n const top = hostOffset.top + TooltipService.getOuterHeight(this.nativeElement) + TooltipService.defaultOffset;\n this.container.style.left = left + 'px';\n this.container.style.top = top + 'px';\n }\n }\n\n alignBottomRight(): void {\n this.preAlign('bottom-right');\n if (this.container) {\n const hostOffset = this.getHostOffset();\n const left =\n hostOffset.left + (TooltipService.getOuterWidth(this.nativeElement) - TooltipService.getOuterWidth(this.container));\n const top = hostOffset.top + TooltipService.getOuterHeight(this.nativeElement) + TooltipService.defaultOffset;\n this.container.style.left = left + 'px';\n this.container.style.top = top + 'px';\n }\n }\n\n preAlign(position: string) {\n this.removePreviousAlignHtmlClasses();\n if (this.container) {\n this.container.style.left = -999 + 'px';\n this.container.style.top = -999 + 'px';\n\n const defaultClassName = 'ap-tooltip-' + position;\n this.container.classList.add(defaultClassName);\n }\n }\n\n getHostOffset() {\n const offset = this.nativeElement.getBoundingClientRect();\n const targetLeft = offset.left + TooltipService.getWindowScrollLeft();\n const targetTop = offset.top + TooltipService.getWindowScrollTop();\n\n return { left: targetLeft, top: targetTop };\n }\n\n isOutOfBounds(): boolean {\n if (this.container) {\n const offset = this.container.getBoundingClientRect();\n const targetTop = offset.top;\n const targetLeft = offset.left;\n const width = TooltipService.getOuterWidth(this.container);\n const height = TooltipService.getOuterHeight(this.container);\n const viewport = TooltipService.getViewport();\n\n return targetLeft + width > viewport.width || targetLeft < 0 || targetTop < 0 || targetTop + height > viewport.height;\n } else {\n return false;\n }\n }\n\n remove(): void {\n if (this.container && this.container.parentElement) {\n document.body.removeChild(this.container);\n }\n\n this.clearTimeouts();\n this._externallyTriggerred = false;\n this.container = undefined;\n }\n\n clearShowTimeout() {\n if (this.showTimeout) {\n clearTimeout(this.showTimeout);\n this.showTimeout = undefined;\n }\n }\n\n clearHideTimeout() {\n if (this.hideTimeout) {\n clearTimeout(this.hideTimeout);\n this.hideTimeout = undefined;\n }\n }\n\n clearTimeouts() {\n this.clearShowTimeout();\n this.clearHideTimeout();\n }\n\n updateText() {\n const apTooltip = this.apTooltip();\n if (apTooltip instanceof TemplateRef) {\n const embeddedViewRef = this.viewContainerRef.createEmbeddedView(apTooltip);\n embeddedViewRef.context = this.apTooltipTemplateContext();\n embeddedViewRef.detectChanges();\n embeddedViewRef.rootNodes.forEach(node => this.tooltipText?.appendChild(node));\n } else if (this.tooltipText) {\n this.tooltipText.innerHTML = apTooltip ? DOMPurify.sanitize(apTooltip) : '';\n }\n }\n\n setCssVariables(): void {\n if (this.container) {\n this.container.style.setProperty('--ap-tooltip-height', this.container.offsetHeight + 'px');\n }\n }\n\n private removePreviousAlignHtmlClasses() {\n if (this.container) {\n this.container.classList.remove(\n 'ap-tooltip-top',\n 'ap-tooltip-top-left',\n 'ap-tooltip-top-right',\n 'ap-tooltip-bottom',\n 'ap-tooltip-bottom-left',\n 'ap-tooltip-bottom-right',\n 'ap-tooltip-left',\n 'ap-tooltip-right'\n );\n }\n }\n\n get externallyTriggerred(): boolean {\n return this._externallyTriggerred;\n }\n\n set externallyTriggerred(value: boolean) {\n this._externallyTriggerred = value;\n }\n}\n","import {\n AfterViewInit,\n Directive,\n ElementRef,\n inject,\n input,\n NgZone,\n OnDestroy,\n} from '@angular/core';\nimport { TooltipDirective } from './tooltip.directive';\n\n/**\n * Directive that triggers a tooltip to show/hide\n *\n * ```html\n * <div #myTooltip=\"apTooltip\" apTooltip>Content</div>\n * <div [apTooltipTrigger]=\"myTooltip\">Click me</div>\n * ```\n */\n@Directive({\n selector: '[apTooltipTrigger]',\n standalone: true,\n})\nexport class TooltipTriggerDirective implements AfterViewInit, OnDestroy {\n private readonly elementRef: ElementRef = inject(ElementRef);\n private readonly zone: NgZone = inject(NgZone);\n\n // Accept a TooltipDirective reference for sibling usage\n apTooltipTrigger = input<TooltipDirective>();\n\n private clickListener: (() => void) | undefined = undefined;\n\n private get targetTooltip(): TooltipDirective | null {\n // Prefer explicit reference, fall back to parent\n return this.apTooltipTrigger() ?? null;\n }\n\n ngAfterViewInit(): void {\n if (!this.targetTooltip) {\n return;\n }\n\n this.setupEventListeners();\n }\n\n private setupEventListeners(): void {\n this.cleanupEventListeners();\n\n this.zone.runOutsideAngular(() => {\n const nativeElement = this.elementRef.nativeElement;\n\n this.clickListener = this.onClick.bind(this);\n nativeElement.addEventListener('click', this.clickListener, true);\n });\n }\n\n private cleanupEventListeners(): void {\n const nativeElement = this.elementRef.nativeElement;\n\n if (this.clickListener) {\n nativeElement.removeEventListener('click', this.clickListener, true);\n this.clickListener = undefined;\n }\n }\n\n ngOnDestroy(): void {\n this.cleanupEventListeners();\n }\n\n private onClick(): void {\n this.zone.run(() => {\n const tooltip = this.targetTooltip;\n if (!tooltip) return;\n\n if (tooltip.container) {\n tooltip.deactivate();\n } else {\n tooltip.externallyTriggerred = true;\n tooltip.activate();\n }\n });\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;AAGO,MAAM,iBAAiB,GAAG;IAC7B,OAAO,EAAE,SAAS;AAClB,IAAA,YAAY,EAAE,cAAc;AAC5B,IAAA,IAAI,EAAE,MAAM;;AAgBhB;;;AAGG;MAUU,gBAAgB,CAAA;IACN,mBAA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AAA,EAAA,CAAA;;2FAAvB,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBAJnC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,oBAAoB;AAC9B,oBAAA,UAAU,EAAE,IAAI;AACnB,iBAAA;;;ACtBD;;AAEG;;;;"}
package/modal/index.d.ts CHANGED
@@ -12,11 +12,19 @@ interface ModalConfigBase<T> {
12
12
  backdropCloseEnable?: boolean;
13
13
  matDialogConfig?: MatDialogConfig<T>;
14
14
  }
15
+ interface HasDialogRef<T, R> {
16
+ dialogRef: MatDialogRef<T, R>;
17
+ }
18
+ type HasModalData<D> = {
19
+ [x in 'modalData' | 'dialogData' | 'data']: D;
20
+ };
21
+ type ExtractDialogRef<C> = C extends HasDialogRef<infer T, infer R> ? MatDialogRef<T, R> : MatDialogRef<C>;
22
+ type ExtractModalData<C> = C extends HasModalData<infer D> ? D : unknown;
15
23
  declare class ModalComponent {
16
- dialogRef: MatDialogRef<ComponentType<any>>;
24
+ dialogRef: MatDialogRef<ModalComponent, void>;
17
25
  symbolRegistry: SymbolRegistry;
18
26
  static readonly PANEL_CLASS = "modal-container";
19
- constructor(dialogRef: MatDialogRef<ComponentType<any>>, symbolRegistry: SymbolRegistry);
27
+ constructor(dialogRef: MatDialogRef<ModalComponent, void>, symbolRegistry: SymbolRegistry);
20
28
  closable: boolean;
21
29
  headerBottomBorderEnabled: boolean;
22
30
  footerTemplate: TemplateRef<any> | undefined;
@@ -44,6 +52,15 @@ declare class ModalComponent {
44
52
  /**
45
53
  * Use it to open a modal containing the {@link componentType} component, with the right configuration.
46
54
  */
55
+ static openDialog<C>(matDialog: MatDialog, config: ModalConfigBase<ExtractModalData<C>> | undefined, componentType: ComponentType<C>): ExtractDialogRef<C>;
56
+ /**
57
+ * Use it to open a modal containing the {@link componentType} component, with the right configuration, and wait for it to be closed.
58
+ */
59
+ static openDialogAndWait<C>(matDialog: MatDialog, config: ModalConfigBase<ExtractModalData<C>> | undefined, componentType: ComponentType<C>): Promise<C extends HasDialogRef<unknown, infer R> ? R : unknown>;
60
+ /**
61
+ * Use it to open a modal containing the {@link componentType} component, with the right configuration.
62
+ * @deprecated use {@link openDialog} instead for better type inference
63
+ */
47
64
  static openWithComponent<T, Y>(matDialog: MatDialog, config: ModalConfigBase<Y> | undefined, componentType: ComponentType<T>): MatDialogRef<T>;
48
65
  /**
49
66
  * Use it to open a modal containing the provided templates, with the right configuration.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@agorapulse/ui-components",
3
3
  "description": "Agorapulse UI Components Library",
4
- "version": "20.3.38",
4
+ "version": "20.3.39",
5
5
  "author": "Benoit Hediard",
6
6
  "repository": {
7
7
  "type": "git",
@@ -76,14 +76,14 @@
76
76
  "types": "./confirm-modal/index.d.ts",
77
77
  "default": "./fesm2022/agorapulse-ui-components-confirm-modal.mjs"
78
78
  },
79
- "./counter": {
80
- "types": "./counter/index.d.ts",
81
- "default": "./fesm2022/agorapulse-ui-components-counter.mjs"
82
- },
83
79
  "./datepicker": {
84
80
  "types": "./datepicker/index.d.ts",
85
81
  "default": "./fesm2022/agorapulse-ui-components-datepicker.mjs"
86
82
  },
83
+ "./counter": {
84
+ "types": "./counter/index.d.ts",
85
+ "default": "./fesm2022/agorapulse-ui-components-counter.mjs"
86
+ },
87
87
  "./directives": {
88
88
  "types": "./directives/index.d.ts",
89
89
  "default": "./fesm2022/agorapulse-ui-components-directives.mjs"
@@ -24,6 +24,7 @@ declare class TooltipDirective implements AfterViewInit, OnDestroy, OnInit {
24
24
  private readonly zone;
25
25
  private readonly viewContainerRef;
26
26
  private readonly destroyRef;
27
+ onClick(targetElement: HTMLElement): void;
27
28
  apTooltip: _angular_core.InputSignal<string | TemplateRef<HTMLElement> | null | undefined>;
28
29
  apTooltipPosition: _angular_core.InputSignal<"left" | "right" | "top" | "bottom" | "bottom-left" | "bottom-right" | "top-left" | "top-right">;
29
30
  apTooltipShowDelay: _angular_core.InputSignal<number>;
@@ -84,6 +85,7 @@ declare class TooltipDirective implements AfterViewInit, OnDestroy, OnInit {
84
85
  clearTimeouts(): void;
85
86
  updateText(): void;
86
87
  setCssVariables(): void;
88
+ private removePreviousAlignHtmlClasses;
87
89
  get externallyTriggerred(): boolean;
88
90
  set externallyTriggerred(value: boolean);
89
91
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<TooltipDirective, never>;