@genesislcap/foundation-utils 14.314.3-alpha-c442ac5.0 → 14.316.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/dist/custom-elements.json +250 -868
- package/dist/dts/index.d.ts +0 -1
- package/dist/dts/index.d.ts.map +1 -1
- package/dist/esm/index.js +0 -1
- package/dist/foundation-utils.api.json +0 -1217
- package/dist/foundation-utils.d.ts +0 -83
- package/docs/api/foundation-utils.md +0 -63
- package/docs/api-report.md.api.md +0 -90
- package/package.json +11 -11
- package/dist/dts/inactivity/inactivity-dialog.d.ts +0 -23
- package/dist/dts/inactivity/inactivity-dialog.d.ts.map +0 -1
- package/dist/dts/inactivity/inactivity-manager.d.ts +0 -24
- package/dist/dts/inactivity/inactivity-manager.d.ts.map +0 -1
- package/dist/dts/inactivity/inactivity-service.d.ts +0 -34
- package/dist/dts/inactivity/inactivity-service.d.ts.map +0 -1
- package/dist/dts/inactivity/index.d.ts +0 -4
- package/dist/dts/inactivity/index.d.ts.map +0 -1
- package/dist/esm/inactivity/inactivity-dialog.js +0 -213
- package/dist/esm/inactivity/inactivity-manager.js +0 -87
- package/dist/esm/inactivity/inactivity-service.js +0 -128
- package/dist/esm/inactivity/index.js +0 -3
- package/docs/api/foundation-utils.inactivityconfig.md +0 -71
- package/docs/api/foundation-utils.inactivityconfig.timeoutminutes.md +0 -11
- package/docs/api/foundation-utils.inactivityconfig.warningminutes.md +0 -11
- package/docs/api/foundation-utils.inactivitydialog.disconnectedcallback.md +0 -15
- package/docs/api/foundation-utils.inactivitydialog.handlecontinue.md +0 -15
- package/docs/api/foundation-utils.inactivitydialog.handlelogout.md +0 -15
- package/docs/api/foundation-utils.inactivitydialog.hide.md +0 -15
- package/docs/api/foundation-utils.inactivitydialog.isvisible.md +0 -11
- package/docs/api/foundation-utils.inactivitydialog.md +0 -152
- package/docs/api/foundation-utils.inactivitydialog.remainingseconds.md +0 -11
- package/docs/api/foundation-utils.inactivitydialog.show.md +0 -50
- package/docs/api/foundation-utils.inactivitydialogoptions.md +0 -88
- package/docs/api/foundation-utils.inactivitydialogoptions.oncontinue.md +0 -11
- package/docs/api/foundation-utils.inactivitydialogoptions.onlogout.md +0 -11
- package/docs/api/foundation-utils.inactivitydialogoptions.remainingseconds.md +0 -11
- package/docs/api/foundation-utils.inactivityevents._inactivity-reset_.md +0 -11
- package/docs/api/foundation-utils.inactivityevents._inactivity-timeout_.md +0 -11
- package/docs/api/foundation-utils.inactivityevents._inactivity-warning_.md +0 -13
- package/docs/api/foundation-utils.inactivityevents.md +0 -88
- package/docs/api/foundation-utils.inactivitymanager._constructor_.md +0 -48
- package/docs/api/foundation-utils.inactivitymanager.destroy.md +0 -15
- package/docs/api/foundation-utils.inactivitymanager.getservice.md +0 -15
- package/docs/api/foundation-utils.inactivitymanager.iswarningvisible.md +0 -15
- package/docs/api/foundation-utils.inactivitymanager.md +0 -138
- package/docs/api/foundation-utils.inactivitymanager.reset.md +0 -15
- package/docs/api/foundation-utils.inactivitymanager.start.md +0 -15
- package/docs/api/foundation-utils.inactivitymanager.stop.md +0 -15
- package/docs/api/foundation-utils.inactivitymanagerconfig.md +0 -55
- package/docs/api/foundation-utils.inactivitymanagerconfig.onlogout.md +0 -11
- package/docs/api/foundation-utils.inactivityservice._constructor_.md +0 -48
- package/docs/api/foundation-utils.inactivityservice.destroy.md +0 -15
- package/docs/api/foundation-utils.inactivityservice.md +0 -138
- package/docs/api/foundation-utils.inactivityservice.off.md +0 -64
- package/docs/api/foundation-utils.inactivityservice.on.md +0 -64
- package/docs/api/foundation-utils.inactivityservice.resettimer.md +0 -15
- package/docs/api/foundation-utils.inactivityservice.start.md +0 -15
- package/docs/api/foundation-utils.inactivityservice.stop.md +0 -15
@@ -482,8 +482,6 @@ export declare interface ErrorMap<TErrorDetailMap extends ErrorDetailMap> extend
|
|
482
482
|
*/
|
483
483
|
export declare type ErrorMapLogger = (...args: any[]) => void;
|
484
484
|
|
485
|
-
declare type EventListener_2<T = any> = (data: T) => void;
|
486
|
-
|
487
485
|
/**
|
488
486
|
* Represents the possible event names for data synchronization.
|
489
487
|
* @public
|
@@ -676,87 +674,6 @@ export declare function getNumberFormatter(format: string, locale?: string | nul
|
|
676
674
|
*/
|
677
675
|
export declare let HTTP_CONFIG: string;
|
678
676
|
|
679
|
-
export declare interface InactivityConfig {
|
680
|
-
timeoutMinutes: number;
|
681
|
-
warningMinutes: number;
|
682
|
-
}
|
683
|
-
|
684
|
-
export declare class InactivityDialog extends FASTElement {
|
685
|
-
isVisible: boolean;
|
686
|
-
remainingSeconds: number;
|
687
|
-
private onContinue?;
|
688
|
-
private onLogout?;
|
689
|
-
private countdownInterval?;
|
690
|
-
private startTime;
|
691
|
-
private totalSeconds;
|
692
|
-
show(options: InactivityDialogOptions): void;
|
693
|
-
hide(): void;
|
694
|
-
private startCountdown;
|
695
|
-
private stopCountdown;
|
696
|
-
handleContinue(): void;
|
697
|
-
handleLogout(): void;
|
698
|
-
disconnectedCallback(): void;
|
699
|
-
}
|
700
|
-
|
701
|
-
export declare interface InactivityDialogOptions {
|
702
|
-
remainingSeconds: number;
|
703
|
-
onContinue: () => void;
|
704
|
-
onLogout: () => void;
|
705
|
-
}
|
706
|
-
|
707
|
-
export declare interface InactivityEvents {
|
708
|
-
'inactivity-warning': {
|
709
|
-
remainingSeconds: number;
|
710
|
-
};
|
711
|
-
'inactivity-timeout': void;
|
712
|
-
'inactivity-reset': void;
|
713
|
-
}
|
714
|
-
|
715
|
-
export declare class InactivityManager {
|
716
|
-
private service;
|
717
|
-
private dialog;
|
718
|
-
private config;
|
719
|
-
private isDialogVisible;
|
720
|
-
constructor(config: InactivityManagerConfig);
|
721
|
-
private setupEventListeners;
|
722
|
-
private showWarningDialog;
|
723
|
-
private hideWarningDialog;
|
724
|
-
private handleContinue;
|
725
|
-
private handleLogout;
|
726
|
-
private handleTimeout;
|
727
|
-
start(): void;
|
728
|
-
stop(): void;
|
729
|
-
reset(): void;
|
730
|
-
destroy(): void;
|
731
|
-
getService(): InactivityService;
|
732
|
-
isWarningVisible(): boolean;
|
733
|
-
}
|
734
|
-
|
735
|
-
export declare interface InactivityManagerConfig extends InactivityConfig {
|
736
|
-
onLogout: () => void;
|
737
|
-
}
|
738
|
-
|
739
|
-
export declare class InactivityService {
|
740
|
-
private config;
|
741
|
-
private warningId;
|
742
|
-
private timeoutId;
|
743
|
-
private lastActivity;
|
744
|
-
private isActive;
|
745
|
-
private eventListeners;
|
746
|
-
constructor(config: InactivityConfig);
|
747
|
-
private setupActivityListeners;
|
748
|
-
private checkTimeout;
|
749
|
-
on<K extends keyof InactivityEvents>(event: K, listener: EventListener_2<InactivityEvents[K]>): void;
|
750
|
-
off<K extends keyof InactivityEvents>(event: K, listener: EventListener_2<InactivityEvents[K]>): void;
|
751
|
-
private emit;
|
752
|
-
start(): void;
|
753
|
-
stop(): void;
|
754
|
-
resetTimer(): void;
|
755
|
-
private scheduleTimers;
|
756
|
-
private clearTimers;
|
757
|
-
destroy(): void;
|
758
|
-
}
|
759
|
-
|
760
677
|
/**
|
761
678
|
* Returns a boolean value indicating whether the current window is inside an iframe.
|
762
679
|
* @returns true if the window is inside an iframe, false otherwise.
|
@@ -59,33 +59,6 @@ Default implementation of the ShortcutManager interface
|
|
59
59
|
A custom element that listens for keyboard shortcuts.
|
60
60
|
|
61
61
|
|
62
|
-
</td></tr>
|
63
|
-
<tr><td>
|
64
|
-
|
65
|
-
[InactivityDialog](./foundation-utils.inactivitydialog.md)
|
66
|
-
|
67
|
-
|
68
|
-
</td><td>
|
69
|
-
|
70
|
-
|
71
|
-
</td></tr>
|
72
|
-
<tr><td>
|
73
|
-
|
74
|
-
[InactivityManager](./foundation-utils.inactivitymanager.md)
|
75
|
-
|
76
|
-
|
77
|
-
</td><td>
|
78
|
-
|
79
|
-
|
80
|
-
</td></tr>
|
81
|
-
<tr><td>
|
82
|
-
|
83
|
-
[InactivityService](./foundation-utils.inactivityservice.md)
|
84
|
-
|
85
|
-
|
86
|
-
</td><td>
|
87
|
-
|
88
|
-
|
89
62
|
</td></tr>
|
90
63
|
<tr><td>
|
91
64
|
|
@@ -700,42 +673,6 @@ DesignSystemModule.
|
|
700
673
|
|
701
674
|
|
702
675
|
|
703
|
-
</td></tr>
|
704
|
-
<tr><td>
|
705
|
-
|
706
|
-
[InactivityConfig](./foundation-utils.inactivityconfig.md)
|
707
|
-
|
708
|
-
|
709
|
-
</td><td>
|
710
|
-
|
711
|
-
|
712
|
-
</td></tr>
|
713
|
-
<tr><td>
|
714
|
-
|
715
|
-
[InactivityDialogOptions](./foundation-utils.inactivitydialogoptions.md)
|
716
|
-
|
717
|
-
|
718
|
-
</td><td>
|
719
|
-
|
720
|
-
|
721
|
-
</td></tr>
|
722
|
-
<tr><td>
|
723
|
-
|
724
|
-
[InactivityEvents](./foundation-utils.inactivityevents.md)
|
725
|
-
|
726
|
-
|
727
|
-
</td><td>
|
728
|
-
|
729
|
-
|
730
|
-
</td></tr>
|
731
|
-
<tr><td>
|
732
|
-
|
733
|
-
[InactivityManagerConfig](./foundation-utils.inactivitymanagerconfig.md)
|
734
|
-
|
735
|
-
|
736
|
-
</td><td>
|
737
|
-
|
738
|
-
|
739
676
|
</td></tr>
|
740
677
|
<tr><td>
|
741
678
|
|
@@ -386,96 +386,6 @@ export function getNumberFormatter(format: string, locale?: string | null): (par
|
|
386
386
|
// @public
|
387
387
|
export let HTTP_CONFIG: string;
|
388
388
|
|
389
|
-
// @public (undocumented)
|
390
|
-
export interface InactivityConfig {
|
391
|
-
// (undocumented)
|
392
|
-
timeoutMinutes: number;
|
393
|
-
// (undocumented)
|
394
|
-
warningMinutes: number;
|
395
|
-
}
|
396
|
-
|
397
|
-
// @public (undocumented)
|
398
|
-
export class InactivityDialog extends FASTElement {
|
399
|
-
// (undocumented)
|
400
|
-
disconnectedCallback(): void;
|
401
|
-
// (undocumented)
|
402
|
-
handleContinue(): void;
|
403
|
-
// (undocumented)
|
404
|
-
handleLogout(): void;
|
405
|
-
// (undocumented)
|
406
|
-
hide(): void;
|
407
|
-
// (undocumented)
|
408
|
-
isVisible: boolean;
|
409
|
-
// (undocumented)
|
410
|
-
remainingSeconds: number;
|
411
|
-
// (undocumented)
|
412
|
-
show(options: InactivityDialogOptions): void;
|
413
|
-
}
|
414
|
-
|
415
|
-
// @public (undocumented)
|
416
|
-
export interface InactivityDialogOptions {
|
417
|
-
// (undocumented)
|
418
|
-
onContinue: () => void;
|
419
|
-
// (undocumented)
|
420
|
-
onLogout: () => void;
|
421
|
-
// (undocumented)
|
422
|
-
remainingSeconds: number;
|
423
|
-
}
|
424
|
-
|
425
|
-
// @public (undocumented)
|
426
|
-
export interface InactivityEvents {
|
427
|
-
// (undocumented)
|
428
|
-
'inactivity-reset': void;
|
429
|
-
// (undocumented)
|
430
|
-
'inactivity-timeout': void;
|
431
|
-
// (undocumented)
|
432
|
-
'inactivity-warning': {
|
433
|
-
remainingSeconds: number;
|
434
|
-
};
|
435
|
-
}
|
436
|
-
|
437
|
-
// @public (undocumented)
|
438
|
-
export class InactivityManager {
|
439
|
-
constructor(config: InactivityManagerConfig);
|
440
|
-
// (undocumented)
|
441
|
-
destroy(): void;
|
442
|
-
// (undocumented)
|
443
|
-
getService(): InactivityService;
|
444
|
-
// (undocumented)
|
445
|
-
isWarningVisible(): boolean;
|
446
|
-
// (undocumented)
|
447
|
-
reset(): void;
|
448
|
-
// (undocumented)
|
449
|
-
start(): void;
|
450
|
-
// (undocumented)
|
451
|
-
stop(): void;
|
452
|
-
}
|
453
|
-
|
454
|
-
// @public (undocumented)
|
455
|
-
export interface InactivityManagerConfig extends InactivityConfig {
|
456
|
-
// (undocumented)
|
457
|
-
onLogout: () => void;
|
458
|
-
}
|
459
|
-
|
460
|
-
// @public (undocumented)
|
461
|
-
export class InactivityService {
|
462
|
-
constructor(config: InactivityConfig);
|
463
|
-
// (undocumented)
|
464
|
-
destroy(): void;
|
465
|
-
// (undocumented)
|
466
|
-
off<K extends keyof InactivityEvents>(event: K, listener: EventListener_2<InactivityEvents[K]>): void;
|
467
|
-
// Warning: (ae-forgotten-export) The symbol "EventListener_2" needs to be exported by the entry point index.d.ts
|
468
|
-
//
|
469
|
-
// (undocumented)
|
470
|
-
on<K extends keyof InactivityEvents>(event: K, listener: EventListener_2<InactivityEvents[K]>): void;
|
471
|
-
// (undocumented)
|
472
|
-
resetTimer(): void;
|
473
|
-
// (undocumented)
|
474
|
-
start(): void;
|
475
|
-
// (undocumented)
|
476
|
-
stop(): void;
|
477
|
-
}
|
478
|
-
|
479
389
|
// @public
|
480
390
|
export const inIFrame: () => boolean;
|
481
391
|
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@genesislcap/foundation-utils",
|
3
3
|
"description": "Genesis Foundation Utils",
|
4
|
-
"version": "14.
|
4
|
+
"version": "14.316.0",
|
5
5
|
"sideEffects": false,
|
6
6
|
"license": "SEE LICENSE IN license.txt",
|
7
7
|
"main": "dist/esm/index.js",
|
@@ -27,18 +27,18 @@
|
|
27
27
|
}
|
28
28
|
},
|
29
29
|
"devDependencies": {
|
30
|
-
"@genesislcap/foundation-testing": "14.
|
31
|
-
"@genesislcap/genx": "14.
|
32
|
-
"@genesislcap/rollup-builder": "14.
|
33
|
-
"@genesislcap/ts-builder": "14.
|
34
|
-
"@genesislcap/uvu-playwright-builder": "14.
|
35
|
-
"@genesislcap/vite-builder": "14.
|
36
|
-
"@genesislcap/webpack-builder": "14.
|
30
|
+
"@genesislcap/foundation-testing": "14.316.0",
|
31
|
+
"@genesislcap/genx": "14.316.0",
|
32
|
+
"@genesislcap/rollup-builder": "14.316.0",
|
33
|
+
"@genesislcap/ts-builder": "14.316.0",
|
34
|
+
"@genesislcap/uvu-playwright-builder": "14.316.0",
|
35
|
+
"@genesislcap/vite-builder": "14.316.0",
|
36
|
+
"@genesislcap/webpack-builder": "14.316.0",
|
37
37
|
"@types/json-schema": "^7.0.11"
|
38
38
|
},
|
39
39
|
"dependencies": {
|
40
|
-
"@genesislcap/expression-builder": "14.
|
41
|
-
"@genesislcap/foundation-logger": "14.
|
40
|
+
"@genesislcap/expression-builder": "14.316.0",
|
41
|
+
"@genesislcap/foundation-logger": "14.316.0",
|
42
42
|
"@microsoft/fast-components": "2.30.6",
|
43
43
|
"@microsoft/fast-element": "1.14.0",
|
44
44
|
"@microsoft/fast-foundation": "2.49.6",
|
@@ -56,5 +56,5 @@
|
|
56
56
|
"access": "public"
|
57
57
|
},
|
58
58
|
"customElements": "dist/custom-elements.json",
|
59
|
-
"gitHead": "
|
59
|
+
"gitHead": "0048114de0bd415c8aeb73de4ca785eaea39d89e"
|
60
60
|
}
|
@@ -1,23 +0,0 @@
|
|
1
|
-
import { FASTElement } from '@microsoft/fast-element';
|
2
|
-
export interface InactivityDialogOptions {
|
3
|
-
remainingSeconds: number;
|
4
|
-
onContinue: () => void;
|
5
|
-
onLogout: () => void;
|
6
|
-
}
|
7
|
-
export declare class InactivityDialog extends FASTElement {
|
8
|
-
isVisible: boolean;
|
9
|
-
remainingSeconds: number;
|
10
|
-
private onContinue?;
|
11
|
-
private onLogout?;
|
12
|
-
private countdownInterval?;
|
13
|
-
private startTime;
|
14
|
-
private totalSeconds;
|
15
|
-
show(options: InactivityDialogOptions): void;
|
16
|
-
hide(): void;
|
17
|
-
private startCountdown;
|
18
|
-
private stopCountdown;
|
19
|
-
handleContinue(): void;
|
20
|
-
handleLogout(): void;
|
21
|
-
disconnectedCallback(): void;
|
22
|
-
}
|
23
|
-
//# sourceMappingURL=inactivity-dialog.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"inactivity-dialog.d.ts","sourceRoot":"","sources":["../../../src/inactivity/inactivity-dialog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,WAAW,EAAyB,MAAM,yBAAyB,CAAC;AAM5F,MAAM,WAAW,uBAAuB;IACtC,gBAAgB,EAAE,MAAM,CAAC;IACzB,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB;AA0CD,qBAgGa,gBAAiB,SAAQ,WAAW;IACnC,SAAS,EAAE,OAAO,CAAS;IAC3B,gBAAgB,EAAE,MAAM,CAAK;IAEzC,OAAO,CAAC,UAAU,CAAC,CAAa;IAChC,OAAO,CAAC,QAAQ,CAAC,CAAa;IAC9B,OAAO,CAAC,iBAAiB,CAAC,CAAS;IACnC,OAAO,CAAC,SAAS,CAAa;IAC9B,OAAO,CAAC,YAAY,CAAa;IAE1B,IAAI,CAAC,OAAO,EAAE,uBAAuB,GAAG,IAAI;IAS5C,IAAI,IAAI,IAAI;IAKnB,OAAO,CAAC,cAAc;IAuBtB,OAAO,CAAC,aAAa;IAOd,cAAc,IAAI,IAAI;IAOtB,YAAY,IAAI,IAAI;IAO3B,oBAAoB,IAAI,IAAI;CAI7B"}
|
@@ -1,24 +0,0 @@
|
|
1
|
-
import { InactivityService, InactivityConfig } from './inactivity-service';
|
2
|
-
export interface InactivityManagerConfig extends InactivityConfig {
|
3
|
-
onLogout: () => void;
|
4
|
-
}
|
5
|
-
export declare class InactivityManager {
|
6
|
-
private service;
|
7
|
-
private dialog;
|
8
|
-
private config;
|
9
|
-
private isDialogVisible;
|
10
|
-
constructor(config: InactivityManagerConfig);
|
11
|
-
private setupEventListeners;
|
12
|
-
private showWarningDialog;
|
13
|
-
private hideWarningDialog;
|
14
|
-
private handleContinue;
|
15
|
-
private handleLogout;
|
16
|
-
private handleTimeout;
|
17
|
-
start(): void;
|
18
|
-
stop(): void;
|
19
|
-
reset(): void;
|
20
|
-
destroy(): void;
|
21
|
-
getService(): InactivityService;
|
22
|
-
isWarningVisible(): boolean;
|
23
|
-
}
|
24
|
-
//# sourceMappingURL=inactivity-manager.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"inactivity-manager.d.ts","sourceRoot":"","sources":["../../../src/inactivity/inactivity-manager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAE3E,MAAM,WAAW,uBAAwB,SAAQ,gBAAgB;IAC/D,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,OAAO,CAAoB;IACnC,OAAO,CAAC,MAAM,CAAiC;IAC/C,OAAO,CAAC,MAAM,CAA0B;IACxC,OAAO,CAAC,eAAe,CAAkB;gBAE7B,MAAM,EAAE,uBAAuB;IAU3C,OAAO,CAAC,mBAAmB;IAU3B,OAAO,CAAC,iBAAiB;IAoBzB,OAAO,CAAC,iBAAiB;IAYzB,OAAO,CAAC,cAAc;IAKtB,OAAO,CAAC,YAAY;IAMpB,OAAO,CAAC,aAAa;IAQd,KAAK,IAAI,IAAI;IAIb,IAAI,IAAI,IAAI;IAKZ,KAAK,IAAI,IAAI;IAKb,OAAO,IAAI,IAAI;IAKf,UAAU,IAAI,iBAAiB;IAI/B,gBAAgB,IAAI,OAAO;CAGnC"}
|
@@ -1,34 +0,0 @@
|
|
1
|
-
export interface InactivityConfig {
|
2
|
-
timeoutMinutes: number;
|
3
|
-
warningMinutes: number;
|
4
|
-
}
|
5
|
-
export interface InactivityEvents {
|
6
|
-
'inactivity-warning': {
|
7
|
-
remainingSeconds: number;
|
8
|
-
};
|
9
|
-
'inactivity-timeout': void;
|
10
|
-
'inactivity-reset': void;
|
11
|
-
}
|
12
|
-
type EventListener<T = any> = (data: T) => void;
|
13
|
-
export declare class InactivityService {
|
14
|
-
private config;
|
15
|
-
private warningId;
|
16
|
-
private timeoutId;
|
17
|
-
private lastActivity;
|
18
|
-
private isActive;
|
19
|
-
private eventListeners;
|
20
|
-
constructor(config: InactivityConfig);
|
21
|
-
private setupActivityListeners;
|
22
|
-
private checkTimeout;
|
23
|
-
on<K extends keyof InactivityEvents>(event: K, listener: EventListener<InactivityEvents[K]>): void;
|
24
|
-
off<K extends keyof InactivityEvents>(event: K, listener: EventListener<InactivityEvents[K]>): void;
|
25
|
-
private emit;
|
26
|
-
start(): void;
|
27
|
-
stop(): void;
|
28
|
-
resetTimer(): void;
|
29
|
-
private scheduleTimers;
|
30
|
-
private clearTimers;
|
31
|
-
destroy(): void;
|
32
|
-
}
|
33
|
-
export {};
|
34
|
-
//# sourceMappingURL=inactivity-service.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"inactivity-service.d.ts","sourceRoot":"","sources":["../../../src/inactivity/inactivity-service.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,gBAAgB;IAC/B,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,gBAAgB;IAC/B,oBAAoB,EAAE;QAAE,gBAAgB,EAAE,MAAM,CAAA;KAAE,CAAC;IACnD,oBAAoB,EAAE,IAAI,CAAC;IAC3B,kBAAkB,EAAE,IAAI,CAAC;CAC1B;AAED,KAAK,aAAa,CAAC,CAAC,GAAG,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,CAAC;AAEhD,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,MAAM,CAAmB;IACjC,OAAO,CAAC,SAAS,CAAuB;IACxC,OAAO,CAAC,SAAS,CAAuB;IACxC,OAAO,CAAC,YAAY,CAAsB;IAC1C,OAAO,CAAC,QAAQ,CAAkB;IAClC,OAAO,CAAC,cAAc,CAA2D;gBAErE,MAAM,EAAE,gBAAgB;IAKpC,OAAO,CAAC,sBAAsB;IA6B9B,OAAO,CAAC,YAAY;IAkBb,EAAE,CAAC,CAAC,SAAS,MAAM,gBAAgB,EACxC,KAAK,EAAE,CAAC,EACR,QAAQ,EAAE,aAAa,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,GAC3C,IAAI;IAKA,GAAG,CAAC,CAAC,SAAS,MAAM,gBAAgB,EACzC,KAAK,EAAE,CAAC,EACR,QAAQ,EAAE,aAAa,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,GAC3C,IAAI;IAOP,OAAO,CAAC,IAAI;IAYL,KAAK,IAAI,IAAI;IAMb,IAAI,IAAI,IAAI;IAKZ,UAAU,IAAI,IAAI;IAQzB,OAAO,CAAC,cAAc;IAkBtB,OAAO,CAAC,WAAW;IAWZ,OAAO,IAAI,IAAI;CAIvB"}
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/inactivity/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC"}
|
@@ -1,213 +0,0 @@
|
|
1
|
-
import { __decorate } from "tslib";
|
2
|
-
import { customElement, FASTElement, observable, html, css } from '@microsoft/fast-element';
|
3
|
-
import { getCurrentDesignSystemPrefix } from '../design-system/design-system';
|
4
|
-
// Constants for time conversions
|
5
|
-
const MILLISECONDS_PER_SECOND = 1000;
|
6
|
-
const getPrefixedInactivityDialog = (prefix) => html `
|
7
|
-
<div class="inactivity-overlay" ?hidden=${(x) => !x.isVisible}>
|
8
|
-
<${prefix}-card class="dialog-card">
|
9
|
-
<div class="card-body">
|
10
|
-
<div class="dialog-header">
|
11
|
-
<${prefix}-icon name="warning" class="warning-icon"></${prefix}-icon>
|
12
|
-
<h2>Session Timeout Warning</h2>
|
13
|
-
</div>
|
14
|
-
<div class="dialog-content">
|
15
|
-
<p>
|
16
|
-
You have been inactive for too long. You will be automatically logged out in
|
17
|
-
<strong>${(x) => x.remainingSeconds}</strong>
|
18
|
-
seconds.
|
19
|
-
</p>
|
20
|
-
<p>
|
21
|
-
Click "Continue Session" to stay logged in, or "Logout Now" to end your session
|
22
|
-
immediately.
|
23
|
-
</p>
|
24
|
-
</div>
|
25
|
-
<div class="dialog-actions">
|
26
|
-
<${prefix}-button
|
27
|
-
appearance="accent"
|
28
|
-
@click=${(x) => x.handleContinue()}
|
29
|
-
class="continue-button"
|
30
|
-
>
|
31
|
-
Continue Session
|
32
|
-
</${prefix}-button>
|
33
|
-
<${prefix}-button
|
34
|
-
appearance="outline"
|
35
|
-
@click=${(x) => x.handleLogout()}
|
36
|
-
class="logout-button"
|
37
|
-
>
|
38
|
-
Logout Now
|
39
|
-
</${prefix}-button>
|
40
|
-
</div>
|
41
|
-
</div>
|
42
|
-
</${prefix}-card>
|
43
|
-
</div>
|
44
|
-
`;
|
45
|
-
let InactivityDialog = class InactivityDialog extends FASTElement {
|
46
|
-
constructor() {
|
47
|
-
super(...arguments);
|
48
|
-
this.isVisible = false;
|
49
|
-
this.remainingSeconds = 0;
|
50
|
-
this.startTime = 0;
|
51
|
-
this.totalSeconds = 0;
|
52
|
-
}
|
53
|
-
show(options) {
|
54
|
-
this.totalSeconds = options.remainingSeconds;
|
55
|
-
this.remainingSeconds = options.remainingSeconds;
|
56
|
-
this.onContinue = options.onContinue;
|
57
|
-
this.onLogout = options.onLogout;
|
58
|
-
this.isVisible = true;
|
59
|
-
this.startCountdown();
|
60
|
-
}
|
61
|
-
hide() {
|
62
|
-
this.isVisible = false;
|
63
|
-
this.stopCountdown();
|
64
|
-
}
|
65
|
-
startCountdown() {
|
66
|
-
this.startTime = Date.now();
|
67
|
-
this.countdownInterval = window.setInterval(() => {
|
68
|
-
try {
|
69
|
-
// Calculate actual elapsed time since dialog started
|
70
|
-
const elapsedMs = Date.now() - this.startTime;
|
71
|
-
const elapsedSeconds = Math.floor(elapsedMs / MILLISECONDS_PER_SECOND);
|
72
|
-
// Calculate remaining time based on actual elapsed time
|
73
|
-
this.remainingSeconds = Math.max(0, this.totalSeconds - elapsedSeconds);
|
74
|
-
if (this.remainingSeconds <= 0) {
|
75
|
-
this.stopCountdown();
|
76
|
-
this.handleLogout();
|
77
|
-
}
|
78
|
-
}
|
79
|
-
catch (error) {
|
80
|
-
// If there's an error during countdown, stop the timer
|
81
|
-
this.stopCountdown();
|
82
|
-
console.warn('Error during inactivity countdown:', error);
|
83
|
-
}
|
84
|
-
}, MILLISECONDS_PER_SECOND);
|
85
|
-
}
|
86
|
-
stopCountdown() {
|
87
|
-
if (this.countdownInterval) {
|
88
|
-
clearInterval(this.countdownInterval);
|
89
|
-
this.countdownInterval = undefined;
|
90
|
-
}
|
91
|
-
}
|
92
|
-
handleContinue() {
|
93
|
-
this.hide();
|
94
|
-
if (this.onContinue) {
|
95
|
-
this.onContinue();
|
96
|
-
}
|
97
|
-
}
|
98
|
-
handleLogout() {
|
99
|
-
this.hide();
|
100
|
-
if (this.onLogout) {
|
101
|
-
this.onLogout();
|
102
|
-
}
|
103
|
-
}
|
104
|
-
disconnectedCallback() {
|
105
|
-
super.disconnectedCallback();
|
106
|
-
this.stopCountdown();
|
107
|
-
}
|
108
|
-
};
|
109
|
-
__decorate([
|
110
|
-
observable
|
111
|
-
], InactivityDialog.prototype, "isVisible", void 0);
|
112
|
-
__decorate([
|
113
|
-
observable
|
114
|
-
], InactivityDialog.prototype, "remainingSeconds", void 0);
|
115
|
-
InactivityDialog = __decorate([
|
116
|
-
customElement({
|
117
|
-
name: 'inactivity-dialog',
|
118
|
-
template: html `
|
119
|
-
${(x) => getPrefixedInactivityDialog(getCurrentDesignSystemPrefix(x, 'rapid'))}
|
120
|
-
`,
|
121
|
-
styles: css `
|
122
|
-
.inactivity-overlay {
|
123
|
-
position: fixed;
|
124
|
-
inset: 0;
|
125
|
-
width: 100vw;
|
126
|
-
height: 100vh;
|
127
|
-
background-color: rgba(0, 0, 0, 0.6);
|
128
|
-
display: flex;
|
129
|
-
align-items: center;
|
130
|
-
justify-content: center;
|
131
|
-
z-index: 9999;
|
132
|
-
backdrop-filter: blur(2px);
|
133
|
-
}
|
134
|
-
|
135
|
-
.dialog-card {
|
136
|
-
height: 260px;
|
137
|
-
max-height: 260px;
|
138
|
-
max-width: 520px;
|
139
|
-
width: 92%;
|
140
|
-
}
|
141
|
-
|
142
|
-
.card-body {
|
143
|
-
padding: 24px;
|
144
|
-
box-sizing: border-box;
|
145
|
-
}
|
146
|
-
|
147
|
-
.dialog-header {
|
148
|
-
display: flex;
|
149
|
-
align-items: center;
|
150
|
-
gap: 12px;
|
151
|
-
margin-bottom: 16px;
|
152
|
-
}
|
153
|
-
|
154
|
-
.warning-icon {
|
155
|
-
color: var(--accent-fill-rest);
|
156
|
-
font-size: 24px;
|
157
|
-
}
|
158
|
-
|
159
|
-
.dialog-header h2 {
|
160
|
-
margin: 0;
|
161
|
-
color: var(--neutral-foreground-rest);
|
162
|
-
font-size: 20px;
|
163
|
-
font-weight: 600;
|
164
|
-
}
|
165
|
-
|
166
|
-
.dialog-content {
|
167
|
-
margin-bottom: 24px;
|
168
|
-
}
|
169
|
-
|
170
|
-
.dialog-content p {
|
171
|
-
margin: 0 0 12px 0;
|
172
|
-
color: var(--neutral-foreground-rest);
|
173
|
-
line-height: 1.5;
|
174
|
-
}
|
175
|
-
|
176
|
-
.dialog-content p:last-child {
|
177
|
-
margin-bottom: 0;
|
178
|
-
}
|
179
|
-
|
180
|
-
.dialog-content strong {
|
181
|
-
color: var(--accent-foreground-rest);
|
182
|
-
font-weight: 600;
|
183
|
-
}
|
184
|
-
|
185
|
-
.dialog-actions {
|
186
|
-
display: flex;
|
187
|
-
gap: 12px;
|
188
|
-
justify-content: flex-end;
|
189
|
-
}
|
190
|
-
|
191
|
-
.continue-button {
|
192
|
-
min-width: 140px;
|
193
|
-
}
|
194
|
-
.logout-button {
|
195
|
-
min-width: 120px;
|
196
|
-
}
|
197
|
-
|
198
|
-
@media (max-width: 480px) {
|
199
|
-
.card-body {
|
200
|
-
padding: 20px;
|
201
|
-
}
|
202
|
-
.dialog-actions {
|
203
|
-
flex-direction: column;
|
204
|
-
}
|
205
|
-
.continue-button,
|
206
|
-
.logout-button {
|
207
|
-
width: 100%;
|
208
|
-
}
|
209
|
-
}
|
210
|
-
`,
|
211
|
-
})
|
212
|
-
], InactivityDialog);
|
213
|
-
export { InactivityDialog };
|