@genesislcap/foundation-utils 14.310.2-alpha-d0e9836.0 → 14.310.2-alpha-c4ff8c2.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.
@@ -586,6 +586,205 @@
586
586
  }
587
587
  ]
588
588
  },
589
+ {
590
+ "kind": "javascript-module",
591
+ "path": "src/error/errorMap.ts",
592
+ "declarations": [
593
+ {
594
+ "kind": "class",
595
+ "description": "",
596
+ "name": "DefaultErrorMap",
597
+ "members": [
598
+ {
599
+ "kind": "field",
600
+ "name": "map",
601
+ "privacy": "private",
602
+ "default": "new Map<keyof TErrorDetailMap, Error>()"
603
+ },
604
+ {
605
+ "kind": "field",
606
+ "name": "lastError",
607
+ "type": {
608
+ "text": "Error"
609
+ },
610
+ "description": "{@inheritDoc ErrorMap.lastError}"
611
+ },
612
+ {
613
+ "kind": "method",
614
+ "name": "set",
615
+ "return": {
616
+ "type": {
617
+ "text": "void"
618
+ }
619
+ },
620
+ "parameters": [
621
+ {
622
+ "name": "key",
623
+ "type": {
624
+ "text": "keyof TErrorDetailMap"
625
+ }
626
+ },
627
+ {
628
+ "name": "error",
629
+ "type": {
630
+ "text": "Error"
631
+ }
632
+ }
633
+ ],
634
+ "description": "{@inheritDoc ErrorMap.set}"
635
+ },
636
+ {
637
+ "kind": "method",
638
+ "name": "get",
639
+ "return": {
640
+ "type": {
641
+ "text": ""
642
+ }
643
+ },
644
+ "parameters": [
645
+ {
646
+ "name": "key",
647
+ "type": {
648
+ "text": "keyof TErrorDetailMap"
649
+ },
650
+ "description": "The key."
651
+ }
652
+ ],
653
+ "description": "Get an error by key.",
654
+ "privacy": "public"
655
+ },
656
+ {
657
+ "kind": "method",
658
+ "name": "has",
659
+ "return": {
660
+ "type": {
661
+ "text": ""
662
+ }
663
+ },
664
+ "parameters": [
665
+ {
666
+ "name": "key",
667
+ "type": {
668
+ "text": "keyof TErrorDetailMap"
669
+ },
670
+ "description": "The key."
671
+ }
672
+ ],
673
+ "description": "Has an error for key.",
674
+ "privacy": "public"
675
+ },
676
+ {
677
+ "kind": "method",
678
+ "name": "delete",
679
+ "return": {
680
+ "type": {
681
+ "text": ""
682
+ }
683
+ },
684
+ "parameters": [
685
+ {
686
+ "name": "key",
687
+ "type": {
688
+ "text": "keyof TErrorDetailMap"
689
+ },
690
+ "description": "The key."
691
+ }
692
+ ],
693
+ "description": "Delete an error.",
694
+ "privacy": "public"
695
+ },
696
+ {
697
+ "kind": "method",
698
+ "name": "clear",
699
+ "description": "Clear errors.",
700
+ "privacy": "public"
701
+ },
702
+ {
703
+ "kind": "field",
704
+ "name": "size",
705
+ "type": {
706
+ "text": "number"
707
+ },
708
+ "description": "The size of the error map.",
709
+ "return": {
710
+ "type": {
711
+ "text": ""
712
+ }
713
+ },
714
+ "privacy": "public",
715
+ "readonly": true
716
+ },
717
+ {
718
+ "kind": "method",
719
+ "name": "values",
720
+ "privacy": "public"
721
+ },
722
+ {
723
+ "kind": "field",
724
+ "name": "messages",
725
+ "type": {
726
+ "text": "string"
727
+ },
728
+ "description": "{@inheritDoc ErrorMap.messages}",
729
+ "readonly": true
730
+ }
731
+ ]
732
+ },
733
+ {
734
+ "kind": "function",
735
+ "name": "createErrorMap",
736
+ "return": {
737
+ "type": {
738
+ "text": ""
739
+ }
740
+ },
741
+ "parameters": [
742
+ {
743
+ "name": "logger",
744
+ "type": {
745
+ "text": "ErrorMapLogger"
746
+ },
747
+ "description": "A logger error method reference."
748
+ }
749
+ ],
750
+ "description": "A factory to create the error map.",
751
+ "privacy": "public"
752
+ }
753
+ ],
754
+ "exports": [
755
+ {
756
+ "kind": "js",
757
+ "name": "DefaultErrorMap",
758
+ "declaration": {
759
+ "name": "DefaultErrorMap",
760
+ "module": "src/error/errorMap.ts"
761
+ }
762
+ },
763
+ {
764
+ "kind": "js",
765
+ "name": "createErrorMap",
766
+ "declaration": {
767
+ "name": "createErrorMap",
768
+ "module": "src/error/errorMap.ts"
769
+ }
770
+ }
771
+ ]
772
+ },
773
+ {
774
+ "kind": "javascript-module",
775
+ "path": "src/error/index.ts",
776
+ "declarations": [],
777
+ "exports": [
778
+ {
779
+ "kind": "js",
780
+ "name": "*",
781
+ "declaration": {
782
+ "name": "*",
783
+ "package": "./errorMap"
784
+ }
785
+ }
786
+ ]
787
+ },
589
788
  {
590
789
  "kind": "javascript-module",
591
790
  "path": "src/env/index.ts",
@@ -1044,205 +1243,6 @@
1044
1243
  }
1045
1244
  ]
1046
1245
  },
1047
- {
1048
- "kind": "javascript-module",
1049
- "path": "src/error/errorMap.ts",
1050
- "declarations": [
1051
- {
1052
- "kind": "class",
1053
- "description": "",
1054
- "name": "DefaultErrorMap",
1055
- "members": [
1056
- {
1057
- "kind": "field",
1058
- "name": "map",
1059
- "privacy": "private",
1060
- "default": "new Map<keyof TErrorDetailMap, Error>()"
1061
- },
1062
- {
1063
- "kind": "field",
1064
- "name": "lastError",
1065
- "type": {
1066
- "text": "Error"
1067
- },
1068
- "description": "{@inheritDoc ErrorMap.lastError}"
1069
- },
1070
- {
1071
- "kind": "method",
1072
- "name": "set",
1073
- "return": {
1074
- "type": {
1075
- "text": "void"
1076
- }
1077
- },
1078
- "parameters": [
1079
- {
1080
- "name": "key",
1081
- "type": {
1082
- "text": "keyof TErrorDetailMap"
1083
- }
1084
- },
1085
- {
1086
- "name": "error",
1087
- "type": {
1088
- "text": "Error"
1089
- }
1090
- }
1091
- ],
1092
- "description": "{@inheritDoc ErrorMap.set}"
1093
- },
1094
- {
1095
- "kind": "method",
1096
- "name": "get",
1097
- "return": {
1098
- "type": {
1099
- "text": ""
1100
- }
1101
- },
1102
- "parameters": [
1103
- {
1104
- "name": "key",
1105
- "type": {
1106
- "text": "keyof TErrorDetailMap"
1107
- },
1108
- "description": "The key."
1109
- }
1110
- ],
1111
- "description": "Get an error by key.",
1112
- "privacy": "public"
1113
- },
1114
- {
1115
- "kind": "method",
1116
- "name": "has",
1117
- "return": {
1118
- "type": {
1119
- "text": ""
1120
- }
1121
- },
1122
- "parameters": [
1123
- {
1124
- "name": "key",
1125
- "type": {
1126
- "text": "keyof TErrorDetailMap"
1127
- },
1128
- "description": "The key."
1129
- }
1130
- ],
1131
- "description": "Has an error for key.",
1132
- "privacy": "public"
1133
- },
1134
- {
1135
- "kind": "method",
1136
- "name": "delete",
1137
- "return": {
1138
- "type": {
1139
- "text": ""
1140
- }
1141
- },
1142
- "parameters": [
1143
- {
1144
- "name": "key",
1145
- "type": {
1146
- "text": "keyof TErrorDetailMap"
1147
- },
1148
- "description": "The key."
1149
- }
1150
- ],
1151
- "description": "Delete an error.",
1152
- "privacy": "public"
1153
- },
1154
- {
1155
- "kind": "method",
1156
- "name": "clear",
1157
- "description": "Clear errors.",
1158
- "privacy": "public"
1159
- },
1160
- {
1161
- "kind": "field",
1162
- "name": "size",
1163
- "type": {
1164
- "text": "number"
1165
- },
1166
- "description": "The size of the error map.",
1167
- "return": {
1168
- "type": {
1169
- "text": ""
1170
- }
1171
- },
1172
- "privacy": "public",
1173
- "readonly": true
1174
- },
1175
- {
1176
- "kind": "method",
1177
- "name": "values",
1178
- "privacy": "public"
1179
- },
1180
- {
1181
- "kind": "field",
1182
- "name": "messages",
1183
- "type": {
1184
- "text": "string"
1185
- },
1186
- "description": "{@inheritDoc ErrorMap.messages}",
1187
- "readonly": true
1188
- }
1189
- ]
1190
- },
1191
- {
1192
- "kind": "function",
1193
- "name": "createErrorMap",
1194
- "return": {
1195
- "type": {
1196
- "text": ""
1197
- }
1198
- },
1199
- "parameters": [
1200
- {
1201
- "name": "logger",
1202
- "type": {
1203
- "text": "ErrorMapLogger"
1204
- },
1205
- "description": "A logger error method reference."
1206
- }
1207
- ],
1208
- "description": "A factory to create the error map.",
1209
- "privacy": "public"
1210
- }
1211
- ],
1212
- "exports": [
1213
- {
1214
- "kind": "js",
1215
- "name": "DefaultErrorMap",
1216
- "declaration": {
1217
- "name": "DefaultErrorMap",
1218
- "module": "src/error/errorMap.ts"
1219
- }
1220
- },
1221
- {
1222
- "kind": "js",
1223
- "name": "createErrorMap",
1224
- "declaration": {
1225
- "name": "createErrorMap",
1226
- "module": "src/error/errorMap.ts"
1227
- }
1228
- }
1229
- ]
1230
- },
1231
- {
1232
- "kind": "javascript-module",
1233
- "path": "src/error/index.ts",
1234
- "declarations": [],
1235
- "exports": [
1236
- {
1237
- "kind": "js",
1238
- "name": "*",
1239
- "declaration": {
1240
- "name": "*",
1241
- "package": "./errorMap"
1242
- }
1243
- }
1244
- ]
1245
- },
1246
1246
  {
1247
1247
  "kind": "javascript-module",
1248
1248
  "path": "src/formatters/datetime.ts",
@@ -1740,10 +1740,10 @@
1740
1740
  "kind": "field",
1741
1741
  "name": "dialog",
1742
1742
  "type": {
1743
- "text": "InactivityDialog"
1743
+ "text": "InactivityDialog | null"
1744
1744
  },
1745
1745
  "privacy": "private",
1746
- "default": "document.createElement('inactivity-dialog')"
1746
+ "default": "null"
1747
1747
  },
1748
1748
  {
1749
1749
  "kind": "field",
@@ -1 +1 @@
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,CAAmB;IACjC,OAAO,CAAC,MAAM,CAA0B;IACxC,OAAO,CAAC,eAAe,CAAkB;gBAE7B,MAAM,EAAE,uBAAuB;IAW3C,OAAO,CAAC,mBAAmB;IAU3B,OAAO,CAAC,iBAAiB;IAgBzB,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
+ {"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;IAsBzB,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,15 +1,15 @@
1
1
  import { InactivityService } from './inactivity-service';
2
2
  export class InactivityManager {
3
3
  constructor(config) {
4
+ this.dialog = null;
4
5
  this.isDialogVisible = false;
5
6
  this.config = config;
6
7
  this.service = new InactivityService({
7
8
  timeoutMinutes: config.timeoutMinutes,
8
9
  warningMinutes: config.warningMinutes,
9
10
  });
10
- this.dialog = document.createElement('inactivity-dialog');
11
- console.log('Creating dialog', this.dialog);
12
11
  this.setupEventListeners();
12
+ console.log('Loading InactivityManager 1');
13
13
  }
14
14
  setupEventListeners() {
15
15
  this.service.on('inactivity-warning', (data) => {
@@ -22,6 +22,11 @@ export class InactivityManager {
22
22
  showWarningDialog(remainingSeconds) {
23
23
  if (this.isDialogVisible)
24
24
  return;
25
+ // Create dialog lazily if it doesn't exist
26
+ if (!this.dialog) {
27
+ this.dialog = document.createElement('inactivity-dialog');
28
+ console.log('Creating dialog', this.dialog);
29
+ }
25
30
  // Add dialog to DOM if not already there
26
31
  if (!this.dialog.isConnected) {
27
32
  document.body.appendChild(this.dialog);
@@ -34,7 +39,7 @@ export class InactivityManager {
34
39
  });
35
40
  }
36
41
  hideWarningDialog() {
37
- if (!this.isDialogVisible)
42
+ if (!this.isDialogVisible || !this.dialog)
38
43
  return;
39
44
  this.isDialogVisible = false;
40
45
  this.dialog.hide();
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-alpha-d0e9836.0",
4
+ "version": "14.310.2-alpha-c4ff8c2.0",
5
5
  "sideEffects": false,
6
6
  "license": "SEE LICENSE IN license.txt",
7
7
  "main": "dist/esm/index.js",
@@ -27,19 +27,19 @@
27
27
  }
28
28
  },
29
29
  "devDependencies": {
30
- "@genesislcap/foundation-testing": "14.310.2-alpha-d0e9836.0",
31
- "@genesislcap/genx": "14.310.2-alpha-d0e9836.0",
32
- "@genesislcap/rollup-builder": "14.310.2-alpha-d0e9836.0",
33
- "@genesislcap/ts-builder": "14.310.2-alpha-d0e9836.0",
34
- "@genesislcap/uvu-playwright-builder": "14.310.2-alpha-d0e9836.0",
35
- "@genesislcap/vite-builder": "14.310.2-alpha-d0e9836.0",
36
- "@genesislcap/webpack-builder": "14.310.2-alpha-d0e9836.0",
30
+ "@genesislcap/foundation-testing": "14.310.2-alpha-c4ff8c2.0",
31
+ "@genesislcap/genx": "14.310.2-alpha-c4ff8c2.0",
32
+ "@genesislcap/rollup-builder": "14.310.2-alpha-c4ff8c2.0",
33
+ "@genesislcap/ts-builder": "14.310.2-alpha-c4ff8c2.0",
34
+ "@genesislcap/uvu-playwright-builder": "14.310.2-alpha-c4ff8c2.0",
35
+ "@genesislcap/vite-builder": "14.310.2-alpha-c4ff8c2.0",
36
+ "@genesislcap/webpack-builder": "14.310.2-alpha-c4ff8c2.0",
37
37
  "@types/json-schema": "^7.0.11"
38
38
  },
39
39
  "dependencies": {
40
- "@genesislcap/expression-builder": "14.310.2-alpha-d0e9836.0",
41
- "@genesislcap/foundation-logger": "14.310.2-alpha-d0e9836.0",
42
- "@genesislcap/web-core": "14.310.2-alpha-d0e9836.0",
40
+ "@genesislcap/expression-builder": "14.310.2-alpha-c4ff8c2.0",
41
+ "@genesislcap/foundation-logger": "14.310.2-alpha-c4ff8c2.0",
42
+ "@genesislcap/web-core": "14.310.2-alpha-c4ff8c2.0",
43
43
  "@microsoft/fast-components": "2.30.6",
44
44
  "@microsoft/fast-element": "1.14.0",
45
45
  "@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": "b0a1e3ba8632b81ea64d4930aacb8f17376caad9"
59
+ "gitHead": "783f8ba44283630d074b9063df244ca56b86ccb2"
60
60
  }