@genesislcap/foundation-utils 14.310.2-alpha-c0a4919.0 → 14.310.2
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 +174 -792
- 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 -1155
- package/dist/foundation-utils.d.ts +0 -84
- package/docs/api/foundation-utils.md +0 -63
- package/docs/api-report.md.api.md +0 -87
- package/package.json +11 -12
- 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 -209
- 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.hide.md +0 -15
- package/docs/api/foundation-utils.inactivitydialog.isvisible.md +0 -11
- package/docs/api/foundation-utils.inactivitydialog.md +0 -128
- 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
@@ -7,7 +7,6 @@ import { CSSDesignToken } from '@microsoft/fast-foundation';
|
|
7
7
|
import { DesignSystem } from '@microsoft/fast-foundation';
|
8
8
|
import { ElementStyles } from '@microsoft/fast-element';
|
9
9
|
import { FASTElement } from '@microsoft/fast-element';
|
10
|
-
import { GenesisElement } from '@genesislcap/web-core';
|
11
10
|
import { InterfaceSymbol } from '@microsoft/fast-foundation';
|
12
11
|
import type { JSONSchema7 } from 'json-schema';
|
13
12
|
import { Logger as Logger_2 } from '@genesislcap/foundation-logger';
|
@@ -442,8 +441,6 @@ export declare interface ErrorMap<TErrorDetailMap extends ErrorDetailMap> extend
|
|
442
441
|
*/
|
443
442
|
export declare type ErrorMapLogger = (...args: any[]) => void;
|
444
443
|
|
445
|
-
declare type EventListener_2<T = any> = (data: T) => void;
|
446
|
-
|
447
444
|
/**
|
448
445
|
* Represents the possible event names for data synchronization.
|
449
446
|
* @public
|
@@ -617,87 +614,6 @@ export declare function getNumberFormatter(format: string, locale?: string | nul
|
|
617
614
|
*/
|
618
615
|
export declare let HTTP_CONFIG: string;
|
619
616
|
|
620
|
-
export declare interface InactivityConfig {
|
621
|
-
timeoutMinutes: number;
|
622
|
-
warningMinutes: number;
|
623
|
-
}
|
624
|
-
|
625
|
-
export declare class InactivityDialog extends GenesisElement {
|
626
|
-
isVisible: boolean;
|
627
|
-
remainingSeconds: number;
|
628
|
-
private onContinue?;
|
629
|
-
private onLogout?;
|
630
|
-
private countdownInterval?;
|
631
|
-
private startTime;
|
632
|
-
private totalSeconds;
|
633
|
-
show(options: InactivityDialogOptions): void;
|
634
|
-
hide(): void;
|
635
|
-
private startCountdown;
|
636
|
-
private stopCountdown;
|
637
|
-
private handleContinue;
|
638
|
-
private handleLogout;
|
639
|
-
disconnectedCallback(): void;
|
640
|
-
}
|
641
|
-
|
642
|
-
export declare interface InactivityDialogOptions {
|
643
|
-
remainingSeconds: number;
|
644
|
-
onContinue: () => void;
|
645
|
-
onLogout: () => void;
|
646
|
-
}
|
647
|
-
|
648
|
-
export declare interface InactivityEvents {
|
649
|
-
'inactivity-warning': {
|
650
|
-
remainingSeconds: number;
|
651
|
-
};
|
652
|
-
'inactivity-timeout': void;
|
653
|
-
'inactivity-reset': void;
|
654
|
-
}
|
655
|
-
|
656
|
-
export declare class InactivityManager {
|
657
|
-
private service;
|
658
|
-
private dialog;
|
659
|
-
private config;
|
660
|
-
private isDialogVisible;
|
661
|
-
constructor(config: InactivityManagerConfig);
|
662
|
-
private setupEventListeners;
|
663
|
-
private showWarningDialog;
|
664
|
-
private hideWarningDialog;
|
665
|
-
private handleContinue;
|
666
|
-
private handleLogout;
|
667
|
-
private handleTimeout;
|
668
|
-
start(): void;
|
669
|
-
stop(): void;
|
670
|
-
reset(): void;
|
671
|
-
destroy(): void;
|
672
|
-
getService(): InactivityService;
|
673
|
-
isWarningVisible(): boolean;
|
674
|
-
}
|
675
|
-
|
676
|
-
export declare interface InactivityManagerConfig extends InactivityConfig {
|
677
|
-
onLogout: () => void;
|
678
|
-
}
|
679
|
-
|
680
|
-
export declare class InactivityService {
|
681
|
-
private config;
|
682
|
-
private warningId;
|
683
|
-
private timeoutId;
|
684
|
-
private lastActivity;
|
685
|
-
private isActive;
|
686
|
-
private eventListeners;
|
687
|
-
constructor(config: InactivityConfig);
|
688
|
-
private setupActivityListeners;
|
689
|
-
private checkTimeout;
|
690
|
-
on<K extends keyof InactivityEvents>(event: K, listener: EventListener_2<InactivityEvents[K]>): void;
|
691
|
-
off<K extends keyof InactivityEvents>(event: K, listener: EventListener_2<InactivityEvents[K]>): void;
|
692
|
-
private emit;
|
693
|
-
start(): void;
|
694
|
-
stop(): void;
|
695
|
-
resetTimer(): void;
|
696
|
-
private scheduleTimers;
|
697
|
-
private clearTimers;
|
698
|
-
destroy(): void;
|
699
|
-
}
|
700
|
-
|
701
617
|
/**
|
702
618
|
* Returns a boolean value indicating whether the current window is inside an iframe.
|
703
619
|
* @returns true if the window is inside an iframe, false otherwise.
|
@@ -37,33 +37,6 @@ Description
|
|
37
37
|
The default `ServerRowDTOMapper`<!-- -->.
|
38
38
|
|
39
39
|
|
40
|
-
</td></tr>
|
41
|
-
<tr><td>
|
42
|
-
|
43
|
-
[InactivityDialog](./foundation-utils.inactivitydialog.md)
|
44
|
-
|
45
|
-
|
46
|
-
</td><td>
|
47
|
-
|
48
|
-
|
49
|
-
</td></tr>
|
50
|
-
<tr><td>
|
51
|
-
|
52
|
-
[InactivityManager](./foundation-utils.inactivitymanager.md)
|
53
|
-
|
54
|
-
|
55
|
-
</td><td>
|
56
|
-
|
57
|
-
|
58
|
-
</td></tr>
|
59
|
-
<tr><td>
|
60
|
-
|
61
|
-
[InactivityService](./foundation-utils.inactivityservice.md)
|
62
|
-
|
63
|
-
|
64
|
-
</td><td>
|
65
|
-
|
66
|
-
|
67
40
|
</td></tr>
|
68
41
|
<tr><td>
|
69
42
|
|
@@ -678,42 +651,6 @@ DesignSystemModule.
|
|
678
651
|
|
679
652
|
|
680
653
|
|
681
|
-
</td></tr>
|
682
|
-
<tr><td>
|
683
|
-
|
684
|
-
[InactivityConfig](./foundation-utils.inactivityconfig.md)
|
685
|
-
|
686
|
-
|
687
|
-
</td><td>
|
688
|
-
|
689
|
-
|
690
|
-
</td></tr>
|
691
|
-
<tr><td>
|
692
|
-
|
693
|
-
[InactivityDialogOptions](./foundation-utils.inactivitydialogoptions.md)
|
694
|
-
|
695
|
-
|
696
|
-
</td><td>
|
697
|
-
|
698
|
-
|
699
|
-
</td></tr>
|
700
|
-
<tr><td>
|
701
|
-
|
702
|
-
[InactivityEvents](./foundation-utils.inactivityevents.md)
|
703
|
-
|
704
|
-
|
705
|
-
</td><td>
|
706
|
-
|
707
|
-
|
708
|
-
</td></tr>
|
709
|
-
<tr><td>
|
710
|
-
|
711
|
-
[InactivityManagerConfig](./foundation-utils.inactivitymanagerconfig.md)
|
712
|
-
|
713
|
-
|
714
|
-
</td><td>
|
715
|
-
|
716
|
-
|
717
654
|
</td></tr>
|
718
655
|
<tr><td>
|
719
656
|
|
@@ -13,7 +13,6 @@ import { CSSDesignToken } from '@microsoft/fast-foundation';
|
|
13
13
|
import { DesignSystem } from '@microsoft/fast-foundation';
|
14
14
|
import { ElementStyles } from '@microsoft/fast-element';
|
15
15
|
import { FASTElement } from '@microsoft/fast-element';
|
16
|
-
import { GenesisElement } from '@genesislcap/web-core';
|
17
16
|
import { InterfaceSymbol } from '@microsoft/fast-foundation';
|
18
17
|
import type { JSONSchema7 } from 'json-schema';
|
19
18
|
import { Logger as Logger_2 } from '@genesislcap/foundation-logger';
|
@@ -331,92 +330,6 @@ export function getNumberFormatter(format: string, locale?: string | null): (par
|
|
331
330
|
// @public
|
332
331
|
export let HTTP_CONFIG: string;
|
333
332
|
|
334
|
-
// @public (undocumented)
|
335
|
-
export interface InactivityConfig {
|
336
|
-
// (undocumented)
|
337
|
-
timeoutMinutes: number;
|
338
|
-
// (undocumented)
|
339
|
-
warningMinutes: number;
|
340
|
-
}
|
341
|
-
|
342
|
-
// @public (undocumented)
|
343
|
-
export class InactivityDialog extends GenesisElement {
|
344
|
-
// (undocumented)
|
345
|
-
disconnectedCallback(): void;
|
346
|
-
// (undocumented)
|
347
|
-
hide(): void;
|
348
|
-
// (undocumented)
|
349
|
-
isVisible: boolean;
|
350
|
-
// (undocumented)
|
351
|
-
remainingSeconds: number;
|
352
|
-
// (undocumented)
|
353
|
-
show(options: InactivityDialogOptions): void;
|
354
|
-
}
|
355
|
-
|
356
|
-
// @public (undocumented)
|
357
|
-
export interface InactivityDialogOptions {
|
358
|
-
// (undocumented)
|
359
|
-
onContinue: () => void;
|
360
|
-
// (undocumented)
|
361
|
-
onLogout: () => void;
|
362
|
-
// (undocumented)
|
363
|
-
remainingSeconds: number;
|
364
|
-
}
|
365
|
-
|
366
|
-
// @public (undocumented)
|
367
|
-
export interface InactivityEvents {
|
368
|
-
// (undocumented)
|
369
|
-
'inactivity-reset': void;
|
370
|
-
// (undocumented)
|
371
|
-
'inactivity-timeout': void;
|
372
|
-
// (undocumented)
|
373
|
-
'inactivity-warning': {
|
374
|
-
remainingSeconds: number;
|
375
|
-
};
|
376
|
-
}
|
377
|
-
|
378
|
-
// @public (undocumented)
|
379
|
-
export class InactivityManager {
|
380
|
-
constructor(config: InactivityManagerConfig);
|
381
|
-
// (undocumented)
|
382
|
-
destroy(): void;
|
383
|
-
// (undocumented)
|
384
|
-
getService(): InactivityService;
|
385
|
-
// (undocumented)
|
386
|
-
isWarningVisible(): boolean;
|
387
|
-
// (undocumented)
|
388
|
-
reset(): void;
|
389
|
-
// (undocumented)
|
390
|
-
start(): void;
|
391
|
-
// (undocumented)
|
392
|
-
stop(): void;
|
393
|
-
}
|
394
|
-
|
395
|
-
// @public (undocumented)
|
396
|
-
export interface InactivityManagerConfig extends InactivityConfig {
|
397
|
-
// (undocumented)
|
398
|
-
onLogout: () => void;
|
399
|
-
}
|
400
|
-
|
401
|
-
// @public (undocumented)
|
402
|
-
export class InactivityService {
|
403
|
-
constructor(config: InactivityConfig);
|
404
|
-
// (undocumented)
|
405
|
-
destroy(): void;
|
406
|
-
// (undocumented)
|
407
|
-
off<K extends keyof InactivityEvents>(event: K, listener: EventListener_2<InactivityEvents[K]>): void;
|
408
|
-
// Warning: (ae-forgotten-export) The symbol "EventListener_2" needs to be exported by the entry point index.d.ts
|
409
|
-
//
|
410
|
-
// (undocumented)
|
411
|
-
on<K extends keyof InactivityEvents>(event: K, listener: EventListener_2<InactivityEvents[K]>): void;
|
412
|
-
// (undocumented)
|
413
|
-
resetTimer(): void;
|
414
|
-
// (undocumented)
|
415
|
-
start(): void;
|
416
|
-
// (undocumented)
|
417
|
-
stop(): void;
|
418
|
-
}
|
419
|
-
|
420
333
|
// @public
|
421
334
|
export const inIFrame: () => boolean;
|
422
335
|
|
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.310.2
|
4
|
+
"version": "14.310.2",
|
5
5
|
"sideEffects": false,
|
6
6
|
"license": "SEE LICENSE IN license.txt",
|
7
7
|
"main": "dist/esm/index.js",
|
@@ -27,19 +27,18 @@
|
|
27
27
|
}
|
28
28
|
},
|
29
29
|
"devDependencies": {
|
30
|
-
"@genesislcap/foundation-testing": "14.310.2
|
31
|
-
"@genesislcap/genx": "14.310.2
|
32
|
-
"@genesislcap/rollup-builder": "14.310.2
|
33
|
-
"@genesislcap/ts-builder": "14.310.2
|
34
|
-
"@genesislcap/uvu-playwright-builder": "14.310.2
|
35
|
-
"@genesislcap/vite-builder": "14.310.2
|
36
|
-
"@genesislcap/webpack-builder": "14.310.2
|
30
|
+
"@genesislcap/foundation-testing": "14.310.2",
|
31
|
+
"@genesislcap/genx": "14.310.2",
|
32
|
+
"@genesislcap/rollup-builder": "14.310.2",
|
33
|
+
"@genesislcap/ts-builder": "14.310.2",
|
34
|
+
"@genesislcap/uvu-playwright-builder": "14.310.2",
|
35
|
+
"@genesislcap/vite-builder": "14.310.2",
|
36
|
+
"@genesislcap/webpack-builder": "14.310.2",
|
37
37
|
"@types/json-schema": "^7.0.11"
|
38
38
|
},
|
39
39
|
"dependencies": {
|
40
|
-
"@genesislcap/expression-builder": "14.310.2
|
41
|
-
"@genesislcap/foundation-logger": "14.310.2
|
42
|
-
"@genesislcap/web-core": "14.310.2-alpha-c0a4919.0",
|
40
|
+
"@genesislcap/expression-builder": "14.310.2",
|
41
|
+
"@genesislcap/foundation-logger": "14.310.2",
|
43
42
|
"@microsoft/fast-components": "2.30.6",
|
44
43
|
"@microsoft/fast-element": "1.14.0",
|
45
44
|
"@microsoft/fast-foundation": "2.49.6",
|
@@ -56,5 +55,5 @@
|
|
56
55
|
"access": "public"
|
57
56
|
},
|
58
57
|
"customElements": "dist/custom-elements.json",
|
59
|
-
"gitHead": "
|
58
|
+
"gitHead": "f8d0be4f4a55523a1709af257f540d31a8abe02b"
|
60
59
|
}
|
@@ -1,23 +0,0 @@
|
|
1
|
-
import { GenesisElement } from '@genesislcap/web-core';
|
2
|
-
export interface InactivityDialogOptions {
|
3
|
-
remainingSeconds: number;
|
4
|
-
onContinue: () => void;
|
5
|
-
onLogout: () => void;
|
6
|
-
}
|
7
|
-
export declare class InactivityDialog extends GenesisElement {
|
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
|
-
private handleContinue;
|
20
|
-
private handleLogout;
|
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,cAAc,EAAyB,MAAM,uBAAuB,CAAC;AAK7F,MAAM,WAAW,uBAAuB;IACtC,gBAAgB,EAAE,MAAM,CAAC;IACzB,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,qBAoIa,gBAAiB,SAAQ,cAAc;IACtC,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;IAOrB,OAAO,CAAC,cAAc;IAOtB,OAAO,CAAC,YAAY;IAOpB,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,209 +0,0 @@
|
|
1
|
-
import { __decorate } from "tslib";
|
2
|
-
import { customElement, GenesisElement, observable, html, css } from '@genesislcap/web-core';
|
3
|
-
// Constants for time conversions
|
4
|
-
const MILLISECONDS_PER_SECOND = 1000;
|
5
|
-
let InactivityDialog = class InactivityDialog extends GenesisElement {
|
6
|
-
constructor() {
|
7
|
-
super(...arguments);
|
8
|
-
this.isVisible = false;
|
9
|
-
this.remainingSeconds = 0;
|
10
|
-
this.startTime = 0;
|
11
|
-
this.totalSeconds = 0;
|
12
|
-
}
|
13
|
-
show(options) {
|
14
|
-
this.totalSeconds = options.remainingSeconds;
|
15
|
-
this.remainingSeconds = options.remainingSeconds;
|
16
|
-
this.onContinue = options.onContinue;
|
17
|
-
this.onLogout = options.onLogout;
|
18
|
-
this.isVisible = true;
|
19
|
-
this.startCountdown();
|
20
|
-
}
|
21
|
-
hide() {
|
22
|
-
this.isVisible = false;
|
23
|
-
this.stopCountdown();
|
24
|
-
}
|
25
|
-
startCountdown() {
|
26
|
-
this.startTime = Date.now();
|
27
|
-
this.countdownInterval = window.setInterval(() => {
|
28
|
-
try {
|
29
|
-
// Calculate actual elapsed time since dialog started
|
30
|
-
const elapsedMs = Date.now() - this.startTime;
|
31
|
-
const elapsedSeconds = Math.floor(elapsedMs / MILLISECONDS_PER_SECOND);
|
32
|
-
// Calculate remaining time based on actual elapsed time
|
33
|
-
this.remainingSeconds = Math.max(0, this.totalSeconds - elapsedSeconds);
|
34
|
-
if (this.remainingSeconds <= 0) {
|
35
|
-
this.stopCountdown();
|
36
|
-
this.handleLogout();
|
37
|
-
}
|
38
|
-
}
|
39
|
-
catch (error) {
|
40
|
-
// If there's an error during countdown, stop the timer
|
41
|
-
this.stopCountdown();
|
42
|
-
console.warn('Error during inactivity countdown:', error);
|
43
|
-
}
|
44
|
-
}, MILLISECONDS_PER_SECOND);
|
45
|
-
}
|
46
|
-
stopCountdown() {
|
47
|
-
if (this.countdownInterval) {
|
48
|
-
clearInterval(this.countdownInterval);
|
49
|
-
this.countdownInterval = undefined;
|
50
|
-
}
|
51
|
-
}
|
52
|
-
handleContinue() {
|
53
|
-
this.hide();
|
54
|
-
if (this.onContinue) {
|
55
|
-
this.onContinue();
|
56
|
-
}
|
57
|
-
}
|
58
|
-
handleLogout() {
|
59
|
-
this.hide();
|
60
|
-
if (this.onLogout) {
|
61
|
-
this.onLogout();
|
62
|
-
}
|
63
|
-
}
|
64
|
-
disconnectedCallback() {
|
65
|
-
super.disconnectedCallback();
|
66
|
-
this.stopCountdown();
|
67
|
-
}
|
68
|
-
};
|
69
|
-
__decorate([
|
70
|
-
observable
|
71
|
-
], InactivityDialog.prototype, "isVisible", void 0);
|
72
|
-
__decorate([
|
73
|
-
observable
|
74
|
-
], InactivityDialog.prototype, "remainingSeconds", void 0);
|
75
|
-
InactivityDialog = __decorate([
|
76
|
-
customElement({
|
77
|
-
name: 'inactivity-dialog',
|
78
|
-
template: html `
|
79
|
-
<div class="inactivity-overlay" ?hidden=${(x) => !x.isVisible}>
|
80
|
-
<rapid-card class="dialog-card">
|
81
|
-
<div class="card-body">
|
82
|
-
<div class="dialog-header">
|
83
|
-
<rapid-icon name="warning" class="warning-icon"></rapid-icon>
|
84
|
-
<h2>Session Timeout Warning</h2>
|
85
|
-
</div>
|
86
|
-
<div class="dialog-content">
|
87
|
-
<p>
|
88
|
-
You have been inactive for too long. You will be automatically logged out in
|
89
|
-
<strong>${(x) => x.remainingSeconds}</strong>
|
90
|
-
seconds.
|
91
|
-
</p>
|
92
|
-
<p>
|
93
|
-
Click "Continue Session" to stay logged in, or "Logout Now" to end your session
|
94
|
-
immediately.
|
95
|
-
</p>
|
96
|
-
</div>
|
97
|
-
<div class="dialog-actions">
|
98
|
-
<rapid-button
|
99
|
-
appearance="accent"
|
100
|
-
@click=${(x) => x.handleContinue()}
|
101
|
-
class="continue-button"
|
102
|
-
>
|
103
|
-
Continue Session
|
104
|
-
</rapid-button>
|
105
|
-
<rapid-button
|
106
|
-
appearance="outline"
|
107
|
-
@click=${(x) => x.handleLogout()}
|
108
|
-
class="logout-button"
|
109
|
-
>
|
110
|
-
Logout Now
|
111
|
-
</rapid-button>
|
112
|
-
</div>
|
113
|
-
</div>
|
114
|
-
</rapid-card>
|
115
|
-
</div>
|
116
|
-
`,
|
117
|
-
styles: css `
|
118
|
-
.inactivity-overlay {
|
119
|
-
position: fixed;
|
120
|
-
inset: 0;
|
121
|
-
width: 100vw;
|
122
|
-
height: 100vh;
|
123
|
-
background-color: rgba(0, 0, 0, 0.6);
|
124
|
-
display: flex;
|
125
|
-
align-items: center;
|
126
|
-
justify-content: center;
|
127
|
-
z-index: 9999;
|
128
|
-
backdrop-filter: blur(2px);
|
129
|
-
}
|
130
|
-
|
131
|
-
.dialog-card {
|
132
|
-
height: 260px;
|
133
|
-
max-height: 260px;
|
134
|
-
max-width: 520px;
|
135
|
-
width: 92%;
|
136
|
-
}
|
137
|
-
|
138
|
-
.card-body {
|
139
|
-
padding: 24px;
|
140
|
-
box-sizing: border-box;
|
141
|
-
}
|
142
|
-
|
143
|
-
.dialog-header {
|
144
|
-
display: flex;
|
145
|
-
align-items: center;
|
146
|
-
gap: 12px;
|
147
|
-
margin-bottom: 16px;
|
148
|
-
}
|
149
|
-
|
150
|
-
.warning-icon {
|
151
|
-
color: var(--accent-fill-rest);
|
152
|
-
font-size: 24px;
|
153
|
-
}
|
154
|
-
|
155
|
-
.dialog-header h2 {
|
156
|
-
margin: 0;
|
157
|
-
color: var(--neutral-foreground-rest);
|
158
|
-
font-size: 20px;
|
159
|
-
font-weight: 600;
|
160
|
-
}
|
161
|
-
|
162
|
-
.dialog-content {
|
163
|
-
margin-bottom: 24px;
|
164
|
-
}
|
165
|
-
|
166
|
-
.dialog-content p {
|
167
|
-
margin: 0 0 12px 0;
|
168
|
-
color: var(--neutral-foreground-rest);
|
169
|
-
line-height: 1.5;
|
170
|
-
}
|
171
|
-
|
172
|
-
.dialog-content p:last-child {
|
173
|
-
margin-bottom: 0;
|
174
|
-
}
|
175
|
-
|
176
|
-
.dialog-content strong {
|
177
|
-
color: var(--accent-foreground-rest);
|
178
|
-
font-weight: 600;
|
179
|
-
}
|
180
|
-
|
181
|
-
.dialog-actions {
|
182
|
-
display: flex;
|
183
|
-
gap: 12px;
|
184
|
-
justify-content: flex-end;
|
185
|
-
}
|
186
|
-
|
187
|
-
.continue-button {
|
188
|
-
min-width: 140px;
|
189
|
-
}
|
190
|
-
.logout-button {
|
191
|
-
min-width: 120px;
|
192
|
-
}
|
193
|
-
|
194
|
-
@media (max-width: 480px) {
|
195
|
-
.card-body {
|
196
|
-
padding: 20px;
|
197
|
-
}
|
198
|
-
.dialog-actions {
|
199
|
-
flex-direction: column;
|
200
|
-
}
|
201
|
-
.continue-button,
|
202
|
-
.logout-button {
|
203
|
-
width: 100%;
|
204
|
-
}
|
205
|
-
}
|
206
|
-
`,
|
207
|
-
})
|
208
|
-
], InactivityDialog);
|
209
|
-
export { InactivityDialog };
|