@leanix/components 0.3.130 → 0.3.131

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.
@@ -3,6 +3,7 @@ import { Overlay } from '@angular/cdk/overlay';
3
3
  import { CdkPortal, Portal } from '@angular/cdk/portal';
4
4
  import { AfterViewInit, EventEmitter, OnChanges, OnDestroy, OnInit, Renderer2, TemplateRef } from '@angular/core';
5
5
  import { Observable, Subject } from 'rxjs';
6
+ import { ModalCloseClickLocation } from '../../modal.constants';
6
7
  import { ModalFooterComponent } from '../modal-footer/modal-footer.component';
7
8
  import { ModalHeaderComponent } from '../modal-header/modal-header.component';
8
9
  import * as i0 from "@angular/core";
@@ -34,13 +35,14 @@ export declare class ModalComponent implements OnChanges, OnInit, OnDestroy, Aft
34
35
  size: 'fullscreen' | 'dialog-large' | 'dialog';
35
36
  isFocusTrap: boolean;
36
37
  canModalBeClosed?: () => Promise<boolean>;
37
- close: EventEmitter<void>;
38
+ close: EventEmitter<ModalCloseClickLocation>;
38
39
  back: EventEmitter<void>;
39
40
  header?: ModalHeaderComponent;
40
41
  footer?: ModalFooterComponent;
41
42
  cdkPortal: Portal<CdkPortal>;
42
43
  private overlayRef;
43
44
  private oldOverflow?;
45
+ closeLocation: typeof ModalCloseClickLocation;
44
46
  readonly destroyed$: Subject<void>;
45
47
  implicitContent: TemplateRef<any>;
46
48
  explicitContent?: TemplateRef<any>;
@@ -53,7 +55,7 @@ export declare class ModalComponent implements OnChanges, OnInit, OnDestroy, Aft
53
55
  openModal(): void;
54
56
  emitBack(): void;
55
57
  ngOnDestroy(): void;
56
- closeModal(): Promise<void>;
58
+ closeModal(closeLocation: ModalCloseClickLocation): Promise<void>;
57
59
  private trapFocusInModal;
58
60
  static ɵfac: i0.ɵɵFactoryDeclaration<ModalComponent, [null, null, { optional: true; }, null]>;
59
61
  static ɵcmp: i0.ɵɵComponentDeclaration<ModalComponent, "lx-modal", never, { "open": "open"; "showCloseButton": "showCloseButton"; "showBackButton": "showBackButton"; "verticalScroll": "verticalScroll"; "size": "size"; "isFocusTrap": "isFocusTrap"; "canModalBeClosed": "canModalBeClosed"; }, { "close": "close"; "back": "back"; }, ["header", "footer", "explicitContent"], ["lx-modal-header", "lx-modal-footer", "*"], false, never>;
@@ -1,3 +1,16 @@
1
1
  import { InjectionToken } from '@angular/core';
2
2
  import { Observable } from 'rxjs';
3
3
  export declare const MODAL_CLOSE: InjectionToken<Observable<void>>;
4
+ /**
5
+ * An enum to track how the modal was closed
6
+ * Escape - Esc key press
7
+ * CloseButton - top right close button (x)
8
+ * OutsideClick - click outside the modal
9
+ * Other - modal close with the trigger through closeModal$ subject
10
+ */
11
+ export declare enum ModalCloseClickLocation {
12
+ Escape = "escape",
13
+ CloseButton = "closeButton",
14
+ OutsideClick = "outsideClick",
15
+ Other = "other"
16
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leanix/components",
3
- "version": "0.3.130",
3
+ "version": "0.3.131",
4
4
  "license": "Apache-2.0",
5
5
  "author": "LeanIX GmbH",
6
6
  "repository": {