@elderbyte/ngx-starter 18.7.1 → 18.8.0
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/esm2022/lib/components/page/exit-guard/page-exit-guard.module.mjs +27 -0
- package/esm2022/lib/components/page/exit-guard/page-exit-guard.service.mjs +129 -0
- package/esm2022/lib/components/page/exit-guard/page-exit-lock/page-exit-lock.component.mjs +27 -0
- package/esm2022/lib/components/page/exit-guard/page-exit-lock-indicator/page-exit-lock-indicator.component.mjs +34 -0
- package/esm2022/lib/components/page/exit-guard/page-exit-lock-overview/page-exit-lock-overview.component.mjs +30 -0
- package/esm2022/lib/components/page/public_api.mjs +2 -0
- package/esm2022/lib/components/public_api.mjs +2 -1
- package/fesm2022/elderbyte-ngx-starter.mjs +220 -3
- package/fesm2022/elderbyte-ngx-starter.mjs.map +1 -1
- package/lib/components/page/exit-guard/page-exit-guard.module.d.ts +10 -0
- package/lib/components/page/exit-guard/page-exit-guard.service.d.ts +77 -0
- package/lib/components/page/exit-guard/page-exit-lock/page-exit-lock.component.d.ts +18 -0
- package/lib/components/page/exit-guard/page-exit-lock-indicator/page-exit-lock-indicator.component.d.ts +21 -0
- package/lib/components/page/exit-guard/page-exit-lock-overview/page-exit-lock-overview.component.d.ts +18 -0
- package/lib/components/page/public_api.d.ts +1 -0
- package/lib/components/public_api.d.ts +1 -0
- package/package.json +1 -1
- package/src/lib/components/page/exit-guard/page-exit-lock/page-exit-lock.component.scss +0 -0
- package/src/lib/components/page/exit-guard/page-exit-lock-indicator/page-exit-lock-indicator.component.scss +10 -0
- package/src/lib/components/page/exit-guard/page-exit-lock-overview/page-exit-lock-overview.component.scss +0 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import * as i1 from "@angular/common";
|
|
3
|
+
import * as i2 from "./page-exit-lock-indicator/page-exit-lock-indicator.component";
|
|
4
|
+
export * from './page-exit-guard.service';
|
|
5
|
+
export * from './page-exit-lock-indicator/page-exit-lock-indicator.component';
|
|
6
|
+
export declare class PageExitGuardModule {
|
|
7
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<PageExitGuardModule, never>;
|
|
8
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<PageExitGuardModule, never, [typeof i1.CommonModule, typeof i2.ElderPageExitLockIndicatorComponent], [typeof i2.ElderPageExitLockIndicatorComponent]>;
|
|
9
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<PageExitGuardModule>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
|
+
import { ElderToastService } from '../../toasts/elder-toast.service';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class PageExitLock {
|
|
5
|
+
readonly message: string;
|
|
6
|
+
private lockService;
|
|
7
|
+
readonly id: string;
|
|
8
|
+
constructor(message: string, lockService: PageExitGuardServiceInternal);
|
|
9
|
+
release(): void;
|
|
10
|
+
}
|
|
11
|
+
export declare class PageExitGuardService {
|
|
12
|
+
private toast;
|
|
13
|
+
private internal;
|
|
14
|
+
constructor(toast: ElderToastService);
|
|
15
|
+
get locks$(): Observable<PageExitLock[]>;
|
|
16
|
+
get isPageExitBlocked$(): Observable<boolean>;
|
|
17
|
+
lock(message: string): PageExitLock;
|
|
18
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<PageExitGuardService, never>;
|
|
19
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<PageExitGuardService>;
|
|
20
|
+
}
|
|
21
|
+
/***************************************************************************
|
|
22
|
+
* *
|
|
23
|
+
* Internal *
|
|
24
|
+
* *
|
|
25
|
+
**************************************************************************/
|
|
26
|
+
declare class PageExitGuardServiceInternal {
|
|
27
|
+
private toast;
|
|
28
|
+
/***************************************************************************
|
|
29
|
+
* *
|
|
30
|
+
* Fields *
|
|
31
|
+
* *
|
|
32
|
+
**************************************************************************/
|
|
33
|
+
private readonly _beforeUnloadHandler;
|
|
34
|
+
private readonly _isPageExitBlocked$;
|
|
35
|
+
private readonly _lockMap$;
|
|
36
|
+
/***************************************************************************
|
|
37
|
+
* *
|
|
38
|
+
* Properties *
|
|
39
|
+
* *
|
|
40
|
+
**************************************************************************/
|
|
41
|
+
get locks$(): Observable<PageExitLock[]>;
|
|
42
|
+
get isPageExitBlocked$(): Observable<boolean>;
|
|
43
|
+
/***************************************************************************
|
|
44
|
+
* *
|
|
45
|
+
* Constructor *
|
|
46
|
+
* *
|
|
47
|
+
**************************************************************************/
|
|
48
|
+
constructor(toast: ElderToastService);
|
|
49
|
+
/***************************************************************************
|
|
50
|
+
* *
|
|
51
|
+
* Public methods *
|
|
52
|
+
* *
|
|
53
|
+
**************************************************************************/
|
|
54
|
+
lock(message: string): PageExitLock;
|
|
55
|
+
unlock(lock: PageExitLock): void;
|
|
56
|
+
/***************************************************************************
|
|
57
|
+
* *
|
|
58
|
+
* Private methods *
|
|
59
|
+
* *
|
|
60
|
+
**************************************************************************/
|
|
61
|
+
/**
|
|
62
|
+
* starts an event listener that will prevent the user from immediately closing
|
|
63
|
+
* the tab / reloading, if it isn't already running.
|
|
64
|
+
*
|
|
65
|
+
* try to stop the alert service whenever you can to minimize the effect on
|
|
66
|
+
* performance.
|
|
67
|
+
* [more details here](https://developer.mozilla.org/en-US/docs/Web/API/Window/beforeunload_event#usage_notes)
|
|
68
|
+
*
|
|
69
|
+
*/
|
|
70
|
+
private ensureListenerStarted;
|
|
71
|
+
/**
|
|
72
|
+
* removes the event listener, if the listener is running.
|
|
73
|
+
*/
|
|
74
|
+
private ensureListenerStopped;
|
|
75
|
+
private preventDefaultAndWarnEvent;
|
|
76
|
+
}
|
|
77
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { PageExitLock } from '../page-exit-guard.service';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class ElderPageExitLockComponent {
|
|
4
|
+
/***************************************************************************
|
|
5
|
+
* *
|
|
6
|
+
* Fields *
|
|
7
|
+
* *
|
|
8
|
+
**************************************************************************/
|
|
9
|
+
lock: import("@angular/core").InputSignal<PageExitLock>;
|
|
10
|
+
/***************************************************************************
|
|
11
|
+
* *
|
|
12
|
+
* Constructor *
|
|
13
|
+
* *
|
|
14
|
+
**************************************************************************/
|
|
15
|
+
constructor();
|
|
16
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ElderPageExitLockComponent, never>;
|
|
17
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ElderPageExitLockComponent, "elder-page-exit-lock", never, { "lock": { "alias": "lock"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Signal } from '@angular/core';
|
|
2
|
+
import { PageExitGuardService, PageExitLock } from '../page-exit-guard.service';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class ElderPageExitLockIndicatorComponent {
|
|
5
|
+
private pageExitGuardService;
|
|
6
|
+
/***************************************************************************
|
|
7
|
+
* *
|
|
8
|
+
* Fields *
|
|
9
|
+
* *
|
|
10
|
+
**************************************************************************/
|
|
11
|
+
readonly isPageExitBlocked: Signal<boolean>;
|
|
12
|
+
readonly locks: Signal<PageExitLock[]>;
|
|
13
|
+
/***************************************************************************
|
|
14
|
+
* *
|
|
15
|
+
* Constructor *
|
|
16
|
+
* *
|
|
17
|
+
**************************************************************************/
|
|
18
|
+
constructor(pageExitGuardService: PageExitGuardService);
|
|
19
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ElderPageExitLockIndicatorComponent, never>;
|
|
20
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ElderPageExitLockIndicatorComponent, "elder-page-exit-lock-indicator", never, {}, {}, never, never, true, never>;
|
|
21
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { PageExitLock } from '../page-exit-guard.service';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class ElderPageExitLockOverviewComponent {
|
|
4
|
+
/***************************************************************************
|
|
5
|
+
* *
|
|
6
|
+
* Fields *
|
|
7
|
+
* *
|
|
8
|
+
**************************************************************************/
|
|
9
|
+
locks: import("@angular/core").InputSignal<PageExitLock[]>;
|
|
10
|
+
/***************************************************************************
|
|
11
|
+
* *
|
|
12
|
+
* Constructor *
|
|
13
|
+
* *
|
|
14
|
+
**************************************************************************/
|
|
15
|
+
constructor();
|
|
16
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ElderPageExitLockOverviewComponent, never>;
|
|
17
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ElderPageExitLockOverviewComponent, "elder-page-exit-lock-overview", never, { "locks": { "alias": "locks"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './exit-guard/page-exit-guard.module';
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|