@acorex/cdk 22.2.9 → 22.2.10
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.
|
@@ -1,193 +1,72 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AXFullScreenService } from '@acorex/core/full-screen';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import {
|
|
3
|
+
import { input, output, inject, ElementRef, effect, untracked, Directive } from '@angular/core';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
* Fullscreen directive
|
|
6
|
+
* Fullscreen directive with overlay and browser modes.
|
|
7
7
|
* Usage: <element axFullscreen #fullscreen="axFullscreen"></element>
|
|
8
8
|
* Then: fullscreen.toggle() or fullscreen.enter() or fullscreen.exit()
|
|
9
9
|
*/
|
|
10
10
|
class AXFullScreenDirective {
|
|
11
11
|
constructor() {
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
13
|
+
* Fullscreen implementation mode.
|
|
14
|
+
* @defaultValue 'overlay'
|
|
14
15
|
*/
|
|
15
|
-
this.
|
|
16
|
-
...(ngDevMode ? [{ debugName: "
|
|
16
|
+
this.mode = input('overlay', /* @ts-ignore */
|
|
17
|
+
...(ngDevMode ? [{ debugName: "mode" }] : /* istanbul ignore next */ []));
|
|
17
18
|
/**
|
|
18
|
-
*
|
|
19
|
-
*/
|
|
20
|
-
this.originalStyles = {};
|
|
21
|
-
/**
|
|
22
|
-
* Original parent element reference
|
|
23
|
-
*/
|
|
24
|
-
this.originalParent = null;
|
|
25
|
-
/**
|
|
26
|
-
* Fullscreen container element
|
|
27
|
-
*/
|
|
28
|
-
this.fullscreenContainer = null;
|
|
29
|
-
/**
|
|
30
|
-
* Fullscreen change event
|
|
19
|
+
* Fullscreen change event for this host element.
|
|
31
20
|
*/
|
|
32
21
|
this.fullscreenChange = output();
|
|
33
|
-
/**
|
|
34
|
-
* Z-index token for this fullscreen instance
|
|
35
|
-
*/
|
|
36
|
-
this.zToken = null;
|
|
37
|
-
this.renderer = inject(Renderer2);
|
|
38
22
|
this.elementRef = inject(ElementRef);
|
|
39
|
-
this.
|
|
40
|
-
// Sync state changes to output
|
|
23
|
+
this.fullScreenService = inject(AXFullScreenService);
|
|
41
24
|
effect(() => {
|
|
42
|
-
const
|
|
25
|
+
const isActive = this.fullScreenService.isActive(this.elementRef.nativeElement);
|
|
43
26
|
untracked(() => {
|
|
44
|
-
this.fullscreenChange.emit(
|
|
27
|
+
this.fullscreenChange.emit(isActive);
|
|
45
28
|
});
|
|
46
29
|
});
|
|
47
30
|
}
|
|
48
31
|
/**
|
|
49
|
-
* Toggle fullscreen state
|
|
32
|
+
* Toggle fullscreen state.
|
|
50
33
|
*/
|
|
51
34
|
toggle() {
|
|
52
|
-
|
|
53
|
-
this.exit();
|
|
54
|
-
}
|
|
55
|
-
else {
|
|
56
|
-
this.enter();
|
|
57
|
-
}
|
|
35
|
+
this.fullScreenService.toggle(this.elementRef.nativeElement, this.mode());
|
|
58
36
|
}
|
|
59
37
|
/**
|
|
60
|
-
* Enter fullscreen mode
|
|
38
|
+
* Enter fullscreen mode.
|
|
61
39
|
*/
|
|
62
40
|
enter() {
|
|
63
|
-
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
const element = this.elementRef.nativeElement;
|
|
67
|
-
try {
|
|
68
|
-
// Store original styles and parent
|
|
69
|
-
this.storeOriginalStyles(element);
|
|
70
|
-
this.originalParent = element.parentElement;
|
|
71
|
-
// Acquire z-index token
|
|
72
|
-
this.zToken = this.zIndexService.acquire();
|
|
73
|
-
// Create fullscreen container
|
|
74
|
-
this.fullscreenContainer = this.renderer.createElement('div');
|
|
75
|
-
this.renderer.setStyle(this.fullscreenContainer, 'position', 'fixed');
|
|
76
|
-
this.renderer.setStyle(this.fullscreenContainer, 'top', '0');
|
|
77
|
-
this.renderer.setStyle(this.fullscreenContainer, 'left', '0');
|
|
78
|
-
this.renderer.setStyle(this.fullscreenContainer, 'width', '100vw');
|
|
79
|
-
this.renderer.setStyle(this.fullscreenContainer, 'height', '100vh');
|
|
80
|
-
this.renderer.setStyle(this.fullscreenContainer, 'z-index', String(this.zToken.zIndex));
|
|
81
|
-
this.renderer.setStyle(this.fullscreenContainer, 'background-color', '#ffffff');
|
|
82
|
-
this.renderer.setStyle(this.fullscreenContainer, 'overflow', 'auto');
|
|
83
|
-
// Move element to container
|
|
84
|
-
this.renderer.appendChild(this.fullscreenContainer, element);
|
|
85
|
-
// Apply fullscreen styles to element
|
|
86
|
-
this.renderer.setStyle(element, 'position', 'relative');
|
|
87
|
-
this.renderer.setStyle(element, 'width', '100%');
|
|
88
|
-
this.renderer.setStyle(element, 'height', '100%');
|
|
89
|
-
this.renderer.setStyle(element, 'margin', '0');
|
|
90
|
-
this.renderer.setStyle(element, 'padding', '0');
|
|
91
|
-
// Append container to body
|
|
92
|
-
this.renderer.appendChild(document.body, this.fullscreenContainer);
|
|
93
|
-
// Prevent body scroll
|
|
94
|
-
this.renderer.setStyle(document.body, 'overflow', 'hidden');
|
|
95
|
-
this.isFullscreenState.set(true);
|
|
96
|
-
}
|
|
97
|
-
catch (error) {
|
|
98
|
-
console.error('Error entering fullscreen:', error);
|
|
99
|
-
this.restoreOriginalStyles(element);
|
|
100
|
-
}
|
|
41
|
+
this.fullScreenService.enter(this.elementRef.nativeElement, this.mode());
|
|
101
42
|
}
|
|
102
43
|
/**
|
|
103
|
-
* Exit fullscreen mode
|
|
44
|
+
* Exit fullscreen mode.
|
|
104
45
|
*/
|
|
105
46
|
exit() {
|
|
106
|
-
|
|
107
|
-
return;
|
|
108
|
-
}
|
|
109
|
-
const element = this.elementRef.nativeElement;
|
|
110
|
-
try {
|
|
111
|
-
// Restore body scroll
|
|
112
|
-
this.renderer.removeStyle(document.body, 'overflow');
|
|
113
|
-
// Move element back to original parent
|
|
114
|
-
if (this.fullscreenContainer && this.originalParent) {
|
|
115
|
-
this.renderer.removeChild(this.fullscreenContainer, element);
|
|
116
|
-
this.renderer.appendChild(this.originalParent, element);
|
|
117
|
-
// Remove container
|
|
118
|
-
this.renderer.removeChild(document.body, this.fullscreenContainer);
|
|
119
|
-
this.fullscreenContainer = null;
|
|
120
|
-
}
|
|
121
|
-
// Release z-index token
|
|
122
|
-
this.zIndexService.release(this.zToken);
|
|
123
|
-
this.zToken = null;
|
|
124
|
-
// Restore original styles
|
|
125
|
-
this.restoreOriginalStyles(element);
|
|
126
|
-
this.isFullscreenState.set(false);
|
|
127
|
-
}
|
|
128
|
-
catch (error) {
|
|
129
|
-
console.error('Error exiting fullscreen:', error);
|
|
130
|
-
}
|
|
47
|
+
this.fullScreenService.exit(this.elementRef.nativeElement);
|
|
131
48
|
}
|
|
132
49
|
/**
|
|
133
|
-
* Check if currently in fullscreen mode
|
|
50
|
+
* Check if this host is currently in fullscreen mode.
|
|
134
51
|
*/
|
|
135
52
|
isFullscreen() {
|
|
136
|
-
return this.
|
|
137
|
-
}
|
|
138
|
-
/**
|
|
139
|
-
* Store original element styles
|
|
140
|
-
*/
|
|
141
|
-
storeOriginalStyles(element) {
|
|
142
|
-
const computedStyle = window.getComputedStyle(element);
|
|
143
|
-
this.originalStyles = {
|
|
144
|
-
position: computedStyle.position,
|
|
145
|
-
top: computedStyle.top,
|
|
146
|
-
left: computedStyle.left,
|
|
147
|
-
width: computedStyle.width,
|
|
148
|
-
height: computedStyle.height,
|
|
149
|
-
zIndex: computedStyle.zIndex,
|
|
150
|
-
backgroundColor: computedStyle.backgroundColor,
|
|
151
|
-
margin: computedStyle.margin,
|
|
152
|
-
padding: computedStyle.padding,
|
|
153
|
-
};
|
|
53
|
+
return this.fullScreenService.isActive(this.elementRef.nativeElement);
|
|
154
54
|
}
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
restoreOriginalStyles(element) {
|
|
159
|
-
if (!this.originalStyles) {
|
|
160
|
-
return;
|
|
55
|
+
ngOnDestroy() {
|
|
56
|
+
if (this.fullScreenService.isActive(this.elementRef.nativeElement)) {
|
|
57
|
+
this.fullScreenService.exit(this.elementRef.nativeElement);
|
|
161
58
|
}
|
|
162
|
-
// Restore each style property
|
|
163
|
-
Object.entries(this.originalStyles).forEach(([key, value]) => {
|
|
164
|
-
const styleKey = this.camelToKebabCase(key);
|
|
165
|
-
if (value) {
|
|
166
|
-
this.renderer.setStyle(element, styleKey, value);
|
|
167
|
-
}
|
|
168
|
-
else {
|
|
169
|
-
this.renderer.removeStyle(element, styleKey);
|
|
170
|
-
}
|
|
171
|
-
});
|
|
172
|
-
this.originalStyles = {};
|
|
173
|
-
}
|
|
174
|
-
/**
|
|
175
|
-
* Convert camelCase to kebab-case for CSS properties
|
|
176
|
-
*/
|
|
177
|
-
camelToKebabCase(str) {
|
|
178
|
-
return str.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, '$1-$2').toLowerCase();
|
|
179
59
|
}
|
|
180
60
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXFullScreenDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
181
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "
|
|
61
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.8", type: AXFullScreenDirective, isStandalone: true, selector: "[axFullscreen]", inputs: { mode: { classPropertyName: "mode", publicName: "mode", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { fullscreenChange: "fullscreenChange" }, exportAs: ["axFullscreen"], ngImport: i0 }); }
|
|
182
62
|
}
|
|
183
63
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXFullScreenDirective, decorators: [{
|
|
184
64
|
type: Directive,
|
|
185
65
|
args: [{
|
|
186
66
|
selector: '[axFullscreen]',
|
|
187
|
-
standalone: true,
|
|
188
67
|
exportAs: 'axFullscreen',
|
|
189
68
|
}]
|
|
190
|
-
}], ctorParameters: () => [], propDecorators: { fullscreenChange: [{ type: i0.Output, args: ["fullscreenChange"] }] } });
|
|
69
|
+
}], ctorParameters: () => [], propDecorators: { mode: [{ type: i0.Input, args: [{ isSignal: true, alias: "mode", required: false }] }], fullscreenChange: [{ type: i0.Output, args: ["fullscreenChange"] }] } });
|
|
191
70
|
|
|
192
71
|
/**
|
|
193
72
|
* Generated bundle index. Do not edit.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-cdk-full-screen.mjs","sources":["../../../../packages/cdk/full-screen/src/lib/full-screen.directive.ts","../../../../packages/cdk/full-screen/src/acorex-cdk-full-screen.ts"],"sourcesContent":["import { AXZIndexService, AXZToken } from '@acorex/core/z-index';\nimport { Directive, effect, ElementRef, inject, output, Renderer2, signal, untracked } from '@angular/core';\n\n/**\n * Fullscreen directive that provides CSS-based fullscreen functionality\n * Usage: <element axFullscreen #fullscreen=\"axFullscreen\"></element>\n * Then: fullscreen.toggle() or fullscreen.enter() or fullscreen.exit()\n */\n@Directive({\n selector: '[axFullscreen]',\n standalone: true,\n exportAs: 'axFullscreen',\n})\nexport class AXFullScreenDirective {\n /**\n * Current fullscreen state\n */\n private readonly isFullscreenState = signal<boolean>(false);\n\n /**\n * Original element styles to restore\n */\n private originalStyles: {\n position?: string;\n top?: string;\n left?: string;\n width?: string;\n height?: string;\n zIndex?: string;\n backgroundColor?: string;\n margin?: string;\n padding?: string;\n } = {};\n\n /**\n * Original parent element reference\n */\n private originalParent: HTMLElement | null = null;\n\n /**\n * Fullscreen container element\n */\n private fullscreenContainer: HTMLElement | null = null;\n\n /**\n * Fullscreen change event\n */\n readonly fullscreenChange = output<boolean>();\n\n /**\n * Z-index token for this fullscreen instance\n */\n private zToken: AXZToken | null = null;\n\n private readonly renderer = inject(Renderer2);\n private readonly elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly zIndexService = inject(AXZIndexService);\n\n constructor() {\n // Sync state changes to output\n effect(() => {\n const isFullscreen = this.isFullscreenState();\n untracked(() => {\n this.fullscreenChange.emit(isFullscreen);\n });\n });\n }\n\n /**\n * Toggle fullscreen state\n */\n toggle(): void {\n if (this.isFullscreenState()) {\n this.exit();\n } else {\n this.enter();\n }\n }\n\n /**\n * Enter fullscreen mode using CSS\n */\n enter(): void {\n if (this.isFullscreenState()) {\n return;\n }\n\n const element = this.elementRef.nativeElement;\n\n try {\n // Store original styles and parent\n this.storeOriginalStyles(element);\n this.originalParent = element.parentElement;\n\n // Acquire z-index token\n this.zToken = this.zIndexService.acquire();\n\n // Create fullscreen container\n this.fullscreenContainer = this.renderer.createElement('div');\n this.renderer.setStyle(this.fullscreenContainer, 'position', 'fixed');\n this.renderer.setStyle(this.fullscreenContainer, 'top', '0');\n this.renderer.setStyle(this.fullscreenContainer, 'left', '0');\n this.renderer.setStyle(this.fullscreenContainer, 'width', '100vw');\n this.renderer.setStyle(this.fullscreenContainer, 'height', '100vh');\n this.renderer.setStyle(this.fullscreenContainer, 'z-index', String(this.zToken.zIndex));\n this.renderer.setStyle(this.fullscreenContainer, 'background-color', '#ffffff');\n this.renderer.setStyle(this.fullscreenContainer, 'overflow', 'auto');\n\n // Move element to container\n this.renderer.appendChild(this.fullscreenContainer, element);\n\n // Apply fullscreen styles to element\n this.renderer.setStyle(element, 'position', 'relative');\n this.renderer.setStyle(element, 'width', '100%');\n this.renderer.setStyle(element, 'height', '100%');\n this.renderer.setStyle(element, 'margin', '0');\n this.renderer.setStyle(element, 'padding', '0');\n\n // Append container to body\n this.renderer.appendChild(document.body, this.fullscreenContainer);\n\n // Prevent body scroll\n this.renderer.setStyle(document.body, 'overflow', 'hidden');\n\n this.isFullscreenState.set(true);\n } catch (error) {\n console.error('Error entering fullscreen:', error);\n this.restoreOriginalStyles(element);\n }\n }\n\n /**\n * Exit fullscreen mode\n */\n exit(): void {\n if (!this.isFullscreenState()) {\n return;\n }\n\n const element = this.elementRef.nativeElement;\n\n try {\n // Restore body scroll\n this.renderer.removeStyle(document.body, 'overflow');\n\n // Move element back to original parent\n if (this.fullscreenContainer && this.originalParent) {\n this.renderer.removeChild(this.fullscreenContainer, element);\n this.renderer.appendChild(this.originalParent, element);\n\n // Remove container\n this.renderer.removeChild(document.body, this.fullscreenContainer);\n this.fullscreenContainer = null;\n }\n\n // Release z-index token\n this.zIndexService.release(this.zToken);\n this.zToken = null;\n\n // Restore original styles\n this.restoreOriginalStyles(element);\n\n this.isFullscreenState.set(false);\n } catch (error) {\n console.error('Error exiting fullscreen:', error);\n }\n }\n\n /**\n * Check if currently in fullscreen mode\n */\n isFullscreen(): boolean {\n return this.isFullscreenState();\n }\n\n /**\n * Store original element styles\n */\n private storeOriginalStyles(element: HTMLElement): void {\n const computedStyle = window.getComputedStyle(element);\n this.originalStyles = {\n position: computedStyle.position,\n top: computedStyle.top,\n left: computedStyle.left,\n width: computedStyle.width,\n height: computedStyle.height,\n zIndex: computedStyle.zIndex,\n backgroundColor: computedStyle.backgroundColor,\n margin: computedStyle.margin,\n padding: computedStyle.padding,\n };\n }\n\n /**\n * Restore original element styles\n */\n private restoreOriginalStyles(element: HTMLElement): void {\n if (!this.originalStyles) {\n return;\n }\n\n // Restore each style property\n Object.entries(this.originalStyles).forEach(([key, value]) => {\n const styleKey = this.camelToKebabCase(key);\n if (value) {\n this.renderer.setStyle(element, styleKey, value);\n } else {\n this.renderer.removeStyle(element, styleKey);\n }\n });\n\n this.originalStyles = {};\n }\n\n /**\n * Convert camelCase to kebab-case for CSS properties\n */\n private camelToKebabCase(str: string): string {\n return str.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, '$1-$2').toLowerCase();\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAGA;;;;AAIG;MAMU,qBAAqB,CAAA;AA6ChC,IAAA,WAAA,GAAA;AA5CA;;AAEG;QACc,IAAA,CAAA,iBAAiB,GAAG,MAAM,CAAU,KAAK;8FAAC;AAE3D;;AAEG;QACK,IAAA,CAAA,cAAc,GAUlB,EAAE;AAEN;;AAEG;Q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ACL,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,OAAO,EAAE,QAAQ,CAAC;YAC9C;AACF,QAAA,CAAC,CAAC;AAEF,QAAA,IAAI,CAAC,cAAc,GAAG,EAAE;IAC1B;AAEA;;AAEG;AACK,IAAA,gBAAgB,CAAC,GAAW,EAAA;QAClC,OAAO,GAAG,CAAC,OAAO,CAAC,8BAA8B,EAAE,OAAO,CAAC,CAAC,WAAW,EAAE;IAC3E;8GA9MW,qBAAqB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;kGAArB,qBAAqB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,gBAAA,EAAA,OAAA,EAAA,EAAA,gBAAA,EAAA,kBAAA,EAAA,EAAA,QAAA,EAAA,CAAA,cAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;2FAArB,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBALjC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,gBAAgB;AAC1B,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,QAAQ,EAAE,cAAc;AACzB,iBAAA;;;ACZD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"acorex-cdk-full-screen.mjs","sources":["../../../../packages/cdk/full-screen/src/lib/full-screen.directive.ts","../../../../packages/cdk/full-screen/src/acorex-cdk-full-screen.ts"],"sourcesContent":["import { AXFullScreenMode, AXFullScreenService } from '@acorex/core/full-screen';\nimport { Directive, effect, ElementRef, inject, input, OnDestroy, output, untracked } from '@angular/core';\n\n/**\n * Fullscreen directive with overlay and browser modes.\n * Usage: <element axFullscreen #fullscreen=\"axFullscreen\"></element>\n * Then: fullscreen.toggle() or fullscreen.enter() or fullscreen.exit()\n */\n@Directive({\n selector: '[axFullscreen]',\n exportAs: 'axFullscreen',\n})\nexport class AXFullScreenDirective implements OnDestroy {\n /**\n * Fullscreen implementation mode.\n * @defaultValue 'overlay'\n */\n readonly mode = input<AXFullScreenMode>('overlay');\n\n /**\n * Fullscreen change event for this host element.\n */\n readonly fullscreenChange = output<boolean>();\n\n private readonly elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly fullScreenService = inject(AXFullScreenService);\n\n constructor() {\n effect(() => {\n const isActive = this.fullScreenService.isActive(this.elementRef.nativeElement);\n untracked(() => {\n this.fullscreenChange.emit(isActive);\n });\n });\n }\n\n /**\n * Toggle fullscreen state.\n */\n toggle(): void {\n this.fullScreenService.toggle(this.elementRef.nativeElement, this.mode());\n }\n\n /**\n * Enter fullscreen mode.\n */\n enter(): void {\n this.fullScreenService.enter(this.elementRef.nativeElement, this.mode());\n }\n\n /**\n * Exit fullscreen mode.\n */\n exit(): void {\n this.fullScreenService.exit(this.elementRef.nativeElement);\n }\n\n /**\n * Check if this host is currently in fullscreen mode.\n */\n isFullscreen(): boolean {\n return this.fullScreenService.isActive(this.elementRef.nativeElement);\n }\n\n ngOnDestroy(): void {\n if (this.fullScreenService.isActive(this.elementRef.nativeElement)) {\n this.fullScreenService.exit(this.elementRef.nativeElement);\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAGA;;;;AAIG;MAKU,qBAAqB,CAAA;AAehC,IAAA,WAAA,GAAA;AAdA;;;AAGG;QACM,IAAA,CAAA,IAAI,GAAG,KAAK,CAAmB,SAAS;iFAAC;AAElD;;AAEG;QACM,IAAA,CAAA,gBAAgB,GAAG,MAAM,EAAW;AAE5B,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAA0B,UAAU,CAAC;AACxD,QAAA,IAAA,CAAA,iBAAiB,GAAG,MAAM,CAAC,mBAAmB,CAAC;QAG9D,MAAM,CAAC,MAAK;AACV,YAAA,MAAM,QAAQ,GAAG,IAAI,CAAC,iBAAiB,CAAC,QAAQ,CAAC,IAAI,CAAC,UAAU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AA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,OAAA,EAAA,EAAA,gBAAA,EAAA,kBAAA,EAAA,EAAA,QAAA,EAAA,CAAA,cAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;2FAArB,qBAAqB,EAAA,UAAA,EAAA,CAAA;kBAJjC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,gBAAgB;AAC1B,oBAAA,QAAQ,EAAE,cAAc;AACzB,iBAAA;;;ACXD;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -1,69 +1,44 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
import { OnDestroy } from '@angular/core';
|
|
3
|
+
import { AXFullScreenMode } from '@acorex/core/full-screen';
|
|
2
4
|
|
|
3
5
|
/**
|
|
4
|
-
* Fullscreen directive
|
|
6
|
+
* Fullscreen directive with overlay and browser modes.
|
|
5
7
|
* Usage: <element axFullscreen #fullscreen="axFullscreen"></element>
|
|
6
8
|
* Then: fullscreen.toggle() or fullscreen.enter() or fullscreen.exit()
|
|
7
9
|
*/
|
|
8
|
-
declare class AXFullScreenDirective {
|
|
10
|
+
declare class AXFullScreenDirective implements OnDestroy {
|
|
9
11
|
/**
|
|
10
|
-
*
|
|
12
|
+
* Fullscreen implementation mode.
|
|
13
|
+
* @defaultValue 'overlay'
|
|
11
14
|
*/
|
|
12
|
-
|
|
15
|
+
readonly mode: _angular_core.InputSignal<AXFullScreenMode>;
|
|
13
16
|
/**
|
|
14
|
-
*
|
|
17
|
+
* Fullscreen change event for this host element.
|
|
15
18
|
*/
|
|
16
|
-
|
|
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
|
-
/**
|
|
30
|
-
* Z-index token for this fullscreen instance
|
|
31
|
-
*/
|
|
32
|
-
private zToken;
|
|
33
|
-
private readonly renderer;
|
|
19
|
+
readonly fullscreenChange: _angular_core.OutputEmitterRef<boolean>;
|
|
34
20
|
private readonly elementRef;
|
|
35
|
-
private readonly
|
|
21
|
+
private readonly fullScreenService;
|
|
36
22
|
constructor();
|
|
37
23
|
/**
|
|
38
|
-
* Toggle fullscreen state
|
|
24
|
+
* Toggle fullscreen state.
|
|
39
25
|
*/
|
|
40
26
|
toggle(): void;
|
|
41
27
|
/**
|
|
42
|
-
* Enter fullscreen mode
|
|
28
|
+
* Enter fullscreen mode.
|
|
43
29
|
*/
|
|
44
30
|
enter(): void;
|
|
45
31
|
/**
|
|
46
|
-
* Exit fullscreen mode
|
|
32
|
+
* Exit fullscreen mode.
|
|
47
33
|
*/
|
|
48
34
|
exit(): void;
|
|
49
35
|
/**
|
|
50
|
-
* Check if currently in fullscreen mode
|
|
36
|
+
* Check if this host is currently in fullscreen mode.
|
|
51
37
|
*/
|
|
52
38
|
isFullscreen(): boolean;
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
private storeOriginalStyles;
|
|
57
|
-
/**
|
|
58
|
-
* Restore original element styles
|
|
59
|
-
*/
|
|
60
|
-
private restoreOriginalStyles;
|
|
61
|
-
/**
|
|
62
|
-
* Convert camelCase to kebab-case for CSS properties
|
|
63
|
-
*/
|
|
64
|
-
private camelToKebabCase;
|
|
65
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<AXFullScreenDirective, never>;
|
|
66
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<AXFullScreenDirective, "[axFullscreen]", ["axFullscreen"], {}, { "fullscreenChange": "fullscreenChange"; }, never, never, true, never>;
|
|
39
|
+
ngOnDestroy(): void;
|
|
40
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<AXFullScreenDirective, never>;
|
|
41
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<AXFullScreenDirective, "[axFullscreen]", ["axFullscreen"], { "mode": { "alias": "mode"; "required": false; "isSignal": true; }; }, { "fullscreenChange": "fullscreenChange"; }, never, never, true, never>;
|
|
67
42
|
}
|
|
68
43
|
|
|
69
44
|
export { AXFullScreenDirective };
|