@acorex/cdk 21.0.0-next52 → 21.0.1-next.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,64 @@
1
+ import * as i0 from '@angular/core';
2
+
3
+ /**
4
+ * Fullscreen directive that provides CSS-based fullscreen functionality
5
+ * Usage: <element axFullscreen #fullscreen="axFullscreen"></element>
6
+ * Then: fullscreen.toggle() or fullscreen.enter() or fullscreen.exit()
7
+ */
8
+ declare class AXFullScreenDirective {
9
+ /**
10
+ * Current fullscreen state
11
+ */
12
+ private readonly isFullscreenState;
13
+ /**
14
+ * Original element styles to restore
15
+ */
16
+ private originalStyles;
17
+ /**
18
+ * Original parent element reference
19
+ */
20
+ private originalParent;
21
+ /**
22
+ * Fullscreen container element
23
+ */
24
+ private fullscreenContainer;
25
+ /**
26
+ * Fullscreen change event
27
+ */
28
+ readonly fullscreenChange: i0.OutputEmitterRef<boolean>;
29
+ private readonly renderer;
30
+ private readonly elementRef;
31
+ constructor();
32
+ /**
33
+ * Toggle fullscreen state
34
+ */
35
+ toggle(): void;
36
+ /**
37
+ * Enter fullscreen mode using CSS
38
+ */
39
+ enter(): void;
40
+ /**
41
+ * Exit fullscreen mode
42
+ */
43
+ exit(): void;
44
+ /**
45
+ * Check if currently in fullscreen mode
46
+ */
47
+ isFullscreen(): boolean;
48
+ /**
49
+ * Store original element styles
50
+ */
51
+ private storeOriginalStyles;
52
+ /**
53
+ * Restore original element styles
54
+ */
55
+ private restoreOriginalStyles;
56
+ /**
57
+ * Convert camelCase to kebab-case for CSS properties
58
+ */
59
+ private camelToKebabCase;
60
+ static ɵfac: i0.ɵɵFactoryDeclaration<AXFullScreenDirective, never>;
61
+ static ɵdir: i0.ɵɵDirectiveDeclaration<AXFullScreenDirective, "[axFullscreen]", ["axFullscreen"], {}, { "fullscreenChange": "fullscreenChange"; }, never, never, true, never>;
62
+ }
63
+
64
+ export { AXFullScreenDirective };
@@ -1,10 +1,33 @@
1
1
  import { AXComponentOptions, AXComponentContent } from '@acorex/core/components';
2
- import { AXPlacement } from '@acorex/cdk/common';
2
+ import { AXPlacement, AXPlacementType, AXConnectedPosition } from '@acorex/cdk/common';
3
+ import { AXZToken } from '@acorex/core/z-index';
3
4
  import * as i0 from '@angular/core';
4
- import { EmbeddedViewRef, ComponentRef } from '@angular/core';
5
+ import { ElementRef, EmbeddedViewRef, ComponentRef } from '@angular/core';
5
6
 
6
7
  interface AXOverlayRef<T> {
7
8
  instance: EmbeddedViewRef<T> | ComponentRef<T>;
9
+ /** Updates the overlay position relative to the anchor */
10
+ updatePosition: () => void;
11
+ /** Destroys the overlay and removes it from the DOM */
12
+ dispose: () => void;
13
+ /** The overlay container element */
14
+ overlayElement: HTMLElement | null;
15
+ /** The z-index token for this overlay */
16
+ zToken: AXZToken | null;
17
+ /** Brings this overlay to the front of all other overlays */
18
+ bringToFront: () => void;
19
+ }
20
+ interface AXOverlayAnchorOptions {
21
+ /** The anchor element to position relative to */
22
+ anchor: HTMLElement | ElementRef<HTMLElement>;
23
+ /** Placement of the overlay relative to the anchor */
24
+ placement?: AXPlacementType;
25
+ /** Horizontal offset in pixels */
26
+ offsetX?: number;
27
+ /** Vertical offset in pixels */
28
+ offsetY?: number;
29
+ /** Whether to flip the overlay when it overflows the viewport */
30
+ autoFlip?: boolean;
8
31
  }
9
32
  interface AXOverlayOptions extends AXComponentOptions {
10
33
  backdrop?: {
@@ -14,14 +37,78 @@ interface AXOverlayOptions extends AXComponentOptions {
14
37
  closeOnClick?: boolean;
15
38
  };
16
39
  position?: AXPlacement;
40
+ /** Anchor-based positioning options for tooltips, popovers, etc. */
41
+ anchorOptions?: AXOverlayAnchorOptions;
42
+ /** Custom CSS class for the overlay panel */
43
+ panelClass?: string | string[];
44
+ /** Whether to close when clicking outside */
45
+ closeOnOutsideClick?: boolean;
46
+ /** Whether to close when pressing Escape */
47
+ closeOnEscape?: boolean;
48
+ /** Width of the overlay container (e.g., 'auto', '200px', '100%') */
49
+ width?: string;
50
+ /** Callback when the overlay is disposed (e.g., due to scroll) */
51
+ onDispose?: () => void;
17
52
  }
53
+ /**
54
+ * Calculates the position of an overlay element relative to an anchor element.
55
+ */
56
+ declare function calculateAnchorPosition(anchorRect: DOMRect, overlayRect: DOMRect, position: AXConnectedPosition): {
57
+ top: number;
58
+ left: number;
59
+ };
60
+ /**
61
+ * Checks if the overlay position fits within the viewport.
62
+ */
63
+ declare function fitsInViewport(position: {
64
+ top: number;
65
+ left: number;
66
+ }, overlayRect: DOMRect, viewportWidth: number, viewportHeight: number, margin?: number): boolean;
67
+ /**
68
+ * Finds the best position for an overlay that fits in the viewport.
69
+ */
70
+ declare function findBestPosition(anchorRect: DOMRect, overlayRect: DOMRect, positions: AXConnectedPosition[], viewportWidth: number, viewportHeight: number): {
71
+ position: AXConnectedPosition;
72
+ coords: {
73
+ top: number;
74
+ left: number;
75
+ };
76
+ };
18
77
 
19
78
  declare class AXOverlayService {
20
79
  private componentService;
21
- create<T = any>(content: AXComponentContent<T>, options?: AXOverlayOptions): Promise<AXOverlayRef<T>>;
80
+ private document;
81
+ private zIndexService;
82
+ /**
83
+ * Creates an overlay with optional anchor-based positioning.
84
+ * @param content - Component or template to display
85
+ * @param options - Configuration options for the overlay
86
+ * @returns Promise<AXOverlayRef> - Reference to the created overlay
87
+ */
88
+ create<T = unknown>(content: AXComponentContent<T>, options?: AXOverlayOptions): Promise<AXOverlayRef<T>>;
89
+ /**
90
+ * Creates a backdrop element.
91
+ */
92
+ private createBackdrop;
93
+ /**
94
+ * Creates a centered overlay container (for modals/popups).
95
+ */
96
+ private createCenteredOverlayContainer;
97
+ /**
98
+ * Gets the host element from a ComponentRef or EmbeddedViewRef.
99
+ */
100
+ private getHostElement;
101
+ /**
102
+ * Creates an overlay container element and appends the content to it.
103
+ */
104
+ private createOverlayContainer;
105
+ /**
106
+ * Positions the overlay container relative to the anchor element.
107
+ */
108
+ private positionOverlay;
22
109
  static ɵfac: i0.ɵɵFactoryDeclaration<AXOverlayService, never>;
23
110
  static ɵprov: i0.ɵɵInjectableDeclaration<AXOverlayService>;
24
111
  }
25
112
 
26
- export { AXOverlayService };
27
- export type { AXOverlayOptions, AXOverlayRef };
113
+ export { AXOverlayService, calculateAnchorPosition, findBestPosition, fitsInViewport };
114
+ export type { AXOverlayAnchorOptions, AXOverlayOptions, AXOverlayRef };
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@acorex/cdk",
3
- "version": "21.0.0-next52",
3
+ "version": "21.0.1-next.1",
4
4
  "peerDependencies": {
5
- "@acorex/core": "21.0.0-next52",
5
+ "@acorex/core": "21.0.1-next.1",
6
6
  "@angular/common": "^20.0.0",
7
7
  "@angular/core": "^20.0.0",
8
8
  "quill": ">=2.0.2",
@@ -41,6 +41,10 @@
41
41
  "types": "./dom/index.d.ts",
42
42
  "default": "./fesm2022/acorex-cdk-dom.mjs"
43
43
  },
44
+ "./double-click": {
45
+ "types": "./double-click/index.d.ts",
46
+ "default": "./fesm2022/acorex-cdk-double-click.mjs"
47
+ },
44
48
  "./drag-drop": {
45
49
  "types": "./drag-drop/index.d.ts",
46
50
  "default": "./fesm2022/acorex-cdk-drag-drop.mjs"
@@ -53,6 +57,10 @@
53
57
  "types": "./focus-trap/index.d.ts",
54
58
  "default": "./fesm2022/acorex-cdk-focus-trap.mjs"
55
59
  },
60
+ "./full-screen": {
61
+ "types": "./full-screen/index.d.ts",
62
+ "default": "./fesm2022/acorex-cdk-full-screen.mjs"
63
+ },
56
64
  "./input-mask": {
57
65
  "types": "./input-mask/index.d.ts",
58
66
  "default": "./fesm2022/acorex-cdk-input-mask.mjs"
@@ -104,6 +112,10 @@
104
112
  "./wysiwyg": {
105
113
  "types": "./wysiwyg/index.d.ts",
106
114
  "default": "./fesm2022/acorex-cdk-wysiwyg.mjs"
115
+ },
116
+ "./z-index": {
117
+ "types": "./z-index/index.d.ts",
118
+ "default": "./fesm2022/acorex-cdk-z-index.mjs"
107
119
  }
108
120
  },
109
121
  "dependencies": {
@@ -0,0 +1,3 @@
1
+ # @acorex/cdk/z-index
2
+
3
+ Secondary entry point of `@acorex/cdk`. It can be used by importing from `@acorex/cdk/z-index`.
@@ -0,0 +1,14 @@
1
+ import * as i0 from '@angular/core';
2
+ import { OnDestroy } from '@angular/core';
3
+
4
+ declare class AXZindexDirective implements OnDestroy {
5
+ #private;
6
+ private el;
7
+ private z;
8
+ private token;
9
+ ngOnDestroy(): void;
10
+ static ɵfac: i0.ɵɵFactoryDeclaration<AXZindexDirective, never>;
11
+ static ɵdir: i0.ɵɵDirectiveDeclaration<AXZindexDirective, "[axZindex]", ["axZindex"], {}, {}, never, never, true, never>;
12
+ }
13
+
14
+ export { AXZindexDirective };