@osovitny/anatoly 2.0.28 → 2.0.29

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.
@@ -543,7 +543,12 @@ const TranslateModuleAtRoot = TranslateModule.forRoot({
543
543
  deps: [HttpClient]
544
544
  }
545
545
  });
546
+ let LocalizationInjectorInstance;
546
547
  class LocalizationSettingsModule {
548
+ constructor(injector) {
549
+ this.injector = injector;
550
+ LocalizationInjectorInstance = this.injector;
551
+ }
547
552
  }
548
553
  LocalizationSettingsModule.decorators = [
549
554
  { type: NgModule, args: [{
@@ -560,6 +565,9 @@ LocalizationSettingsModule.decorators = [
560
565
  ],
561
566
  exports: []
562
567
  },] }
568
+ ];
569
+ LocalizationSettingsModule.ctorParameters = () => [
570
+ { type: Injector }
563
571
  ];
564
572
 
565
573
  /*
@@ -644,7 +652,7 @@ GlobalErrorHandler.ctorParameters = () => [
644
652
  Anatoly Osovitny
645
653
 
646
654
  Created:
647
- 13 Nov 2017
655
+ 2 July 2020
648
656
 
649
657
  Version:
650
658
  1.0
@@ -652,65 +660,29 @@ GlobalErrorHandler.ctorParameters = () => [
652
660
  Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
653
661
  </file>
654
662
  */
655
- class BaseApiService {
656
- constructor(http) {
657
- this.http = http;
658
- this.baseUrl = '';
659
- }
660
- serializeParams(data) {
661
- return data ? '?' + $.param(data) : '';
662
- }
663
- // api
664
- get(action, data, responseType) {
665
- if (!responseType) {
666
- responseType = 'json';
667
- }
668
- const url = `${this.baseUrl}/${action}${this.serializeParams(data)}`;
669
- return this.http
670
- .get(url, { responseType })
671
- .pipe(map((res) => res));
672
- }
673
- post(action, data, responseType) {
674
- if (!responseType) {
675
- responseType = 'text';
676
- }
677
- const url = `${this.baseUrl}/${action}`;
678
- return this.http.post(url, data, { responseType });
663
+ class L10nUtils {
664
+ // @dynamic
665
+ static get localizationService() {
666
+ const ns = LocalizationInjectorInstance.get(LocalizationService);
667
+ return ns;
679
668
  }
680
- postQS(action, data, responseType) {
681
- if (!responseType) {
682
- responseType = 'text';
669
+ static getLocalizedValue(key, params, defaultKey) {
670
+ // VadimOS: DON'T CHANGE THIS CODE. NEED TO BE REVIEWED AND APPROVED BY VADIMOS
671
+ // defaultKey definition:
672
+ // if key is empty and defaultKey is defined => get localization for defaultKey
673
+ // Example: cancel()
674
+ if (!key && defaultKey) {
675
+ return this.localizationService.getLocalizedValue(defaultKey);
683
676
  }
684
- const url = `${this.baseUrl}/${action}${this.serializeParams(data)}`;
685
- return this.http.post(url, null, { responseType });
686
- }
687
- delete(action, data, responseType) {
688
- if (!responseType) {
689
- responseType = 'text';
677
+ // VadimOS:
678
+ // if key is not empty value MUST be in localization table, othewise we will return key
679
+ if (key) {
680
+ const value = this.localizationService.getLocalizedValue(key, params);
681
+ return value;
690
682
  }
691
- const url = `${this.baseUrl}/${action}${this.serializeParams(data)}`;
692
- return this.http.delete(url, { responseType });
693
- }
694
- // gets
695
- getById(id) {
696
- return this.get('getById', { id });
697
- }
698
- getAll(data) {
699
- return this.get('getall', data).pipe(map((res) => res));
700
- }
701
- getJsonFile(fileName) {
702
- const jsonsUrl = AppCoreSettings.jsonsUrl;
703
- const jsonVersion = AppCoreSettings.jsonVersion;
704
- const url = jsonsUrl + '/' + fileName + '?' + jsonVersion;
705
- return this.http.get(url).pipe(map((res) => res));
683
+ return key;
706
684
  }
707
- }
708
- BaseApiService.decorators = [
709
- { type: Injectable }
710
- ];
711
- BaseApiService.ctorParameters = () => [
712
- { type: HttpClient }
713
- ];
685
+ }
714
686
 
715
687
  /*
716
688
  <file>
@@ -722,7 +694,7 @@ BaseApiService.ctorParameters = () => [
722
694
  Anatoly Osovitny
723
695
 
724
696
  Created:
725
- 13 Nov 2017
697
+ 3 March 2020
726
698
 
727
699
  Version:
728
700
  1.0
@@ -730,55 +702,113 @@ BaseApiService.ctorParameters = () => [
730
702
  Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
731
703
  </file>
732
704
  */
733
- class AppContextService extends BaseApiService {
734
- constructor(http) {
735
- super(http);
736
- this.http = http;
737
- this.current = null;
738
- this.successes = [];
739
- this.subscription = null;
740
- this.baseUrl = '/api/appContext';
705
+ class Alerts {
706
+ static success(text, params, title, successAction) {
707
+ text = L10nUtils.getLocalizedValue(text, params, 'OperationSuccessFull');
708
+ title = L10nUtils.getLocalizedValue(title, null, 'Success');
709
+ Swal.fire({
710
+ text,
711
+ title,
712
+ icon: 'success',
713
+ confirmButtonText: L10nUtils.getLocalizedValue('Ok')
714
+ })
715
+ .then(() => {
716
+ if (successAction) {
717
+ successAction();
718
+ }
719
+ });
741
720
  }
742
- getCurrent(success) {
743
- if (typeof success == 'undefined') {
744
- return;
745
- }
746
- if (this.current != null) {
747
- success(this.current);
748
- return;
749
- }
750
- this.successes.push(success);
751
- if (this.subscription != null) {
752
- return;
753
- }
754
- this.subscription = this.get('GetCurrentContext', null).subscribe((data) => {
755
- this.dataReceived(data);
756
- }, (e) => { });
721
+ static info(text, params, title) {
722
+ text = L10nUtils.getLocalizedValue(text, params);
723
+ title = L10nUtils.getLocalizedValue(title, null, 'Info');
724
+ Swal.fire({
725
+ text,
726
+ title,
727
+ icon: 'info',
728
+ confirmButtonText: L10nUtils.getLocalizedValue('Ok')
729
+ });
757
730
  }
758
- dataReceived(data) {
759
- this.current = data;
760
- for (let i = 0; i < this.successes.length; i++) {
761
- let success = this.successes[i];
762
- success(data);
763
- }
764
- this.successes = [];
765
- this.subscription.unsubscribe();
766
- this.subscription = null;
767
- this.current = null;
731
+ static warning(text, params, title) {
732
+ text = L10nUtils.getLocalizedValue(text, params);
733
+ title = L10nUtils.getLocalizedValue(title, null, 'Warning');
734
+ Swal.fire({
735
+ text,
736
+ title,
737
+ icon: 'warning',
738
+ confirmButtonText: L10nUtils.getLocalizedValue('Ok')
739
+ });
768
740
  }
769
- isUserSignedIn() {
770
- return ContextInitState.isUserSignedIn;
741
+ static error(text, params, title) {
742
+ text = L10nUtils.getLocalizedValue(text, params, 'ErrorOccured');
743
+ title = L10nUtils.getLocalizedValue(title, null, 'Error');
744
+ Swal.fire({
745
+ text,
746
+ title,
747
+ icon: 'error',
748
+ confirmButtonText: L10nUtils.getLocalizedValue('Ok')
749
+ });
771
750
  }
772
- isUserAdmin() {
773
- return ContextInitState.isUserAdmin;
751
+ static cancel(text, params, title) {
752
+ text = L10nUtils.getLocalizedValue(text, params, 'OperationCancelled');
753
+ title = L10nUtils.getLocalizedValue(title, null, 'Cancelled');
754
+ Swal.fire({
755
+ text,
756
+ title,
757
+ icon: 'info'
758
+ });
774
759
  }
775
- }
776
- AppContextService.decorators = [
777
- { type: Injectable }
778
- ];
779
- AppContextService.ctorParameters = () => [
780
- { type: HttpClient }
781
- ];
760
+ static notImplemented() {
761
+ this.warning('Not Implemented Yet');
762
+ }
763
+ ;
764
+ static areYouSure(text, title, confirmButtonText, cancelButtonText, successAction, cancelAction) {
765
+ text = L10nUtils.getLocalizedValue(text);
766
+ title = L10nUtils.getLocalizedValue(title, null, 'AreYouSure');
767
+ confirmButtonText = L10nUtils.getLocalizedValue(confirmButtonText, null, 'AreYouSure-ConfirmButtonText');
768
+ cancelButtonText = L10nUtils.getLocalizedValue(cancelButtonText, null, 'AreYouSure-CancelButtonText');
769
+ Swal.fire({
770
+ text,
771
+ title,
772
+ icon: 'warning',
773
+ confirmButtonText,
774
+ cancelButtonText,
775
+ showCancelButton: true
776
+ })
777
+ .then((result) => {
778
+ if (result.value) {
779
+ if (successAction) {
780
+ successAction();
781
+ }
782
+ }
783
+ // result.dismiss can be 'cancel', 'overlay', 'close', and 'timer'
784
+ else if (result.dismiss == Swal.DismissReason.cancel || result.dismiss == Swal.DismissReason.close) {
785
+ if (cancelAction) {
786
+ cancelAction();
787
+ }
788
+ }
789
+ });
790
+ }
791
+ ;
792
+ }
793
+
794
+ /*
795
+ <file>
796
+ Project:
797
+ @osovitny/anatoly
798
+
799
+ Authors:
800
+ Vadim Osovitny
801
+ Anatoly Osovitny
802
+
803
+ Created:
804
+ 2 Jun 2020
805
+
806
+ Version:
807
+ 1.0
808
+
809
+ Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
810
+ </file>
811
+ */
782
812
 
783
813
  /*
784
814
  <file>
@@ -956,8 +986,8 @@ class NotificationService {
956
986
  }
957
987
  }
958
988
  success(text, params, title, createSessionNotification = true) {
959
- text = Utils.getLocalizedValue(text, params, 'OperationSuccessFull');
960
- title = Utils.getLocalizedValue(title);
989
+ text = L10nUtils.getLocalizedValue(text, params, 'OperationSuccessFull');
990
+ title = L10nUtils.getLocalizedValue(title);
961
991
  this.toastrService.success(text, title, {
962
992
  timeOut: 3000,
963
993
  progressBar: true
@@ -967,24 +997,24 @@ class NotificationService {
967
997
  }
968
998
  }
969
999
  info(text, params, title) {
970
- text = Utils.getLocalizedValue(text, params);
971
- title = Utils.getLocalizedValue(title);
1000
+ text = L10nUtils.getLocalizedValue(text, params);
1001
+ title = L10nUtils.getLocalizedValue(title);
972
1002
  this.toastrService.info(text, title, {
973
1003
  timeOut: 3000,
974
1004
  progressBar: true
975
1005
  });
976
1006
  }
977
1007
  warning(text, params, title) {
978
- text = Utils.getLocalizedValue(text, params);
979
- title = Utils.getLocalizedValue(title);
1008
+ text = L10nUtils.getLocalizedValue(text, params);
1009
+ title = L10nUtils.getLocalizedValue(title);
980
1010
  this.toastrService.warning(text, title, {
981
1011
  timeOut: 3000,
982
1012
  progressBar: true
983
1013
  });
984
1014
  }
985
1015
  error(text, params, title, createSessionNotification = true) {
986
- text = Utils.getLocalizedValue(text, params, 'ErrorOccured');
987
- title = Utils.getLocalizedValue(title);
1016
+ text = L10nUtils.getLocalizedValue(text, params, 'ErrorOccured');
1017
+ title = L10nUtils.getLocalizedValue(title);
988
1018
  this.toastrService.error(text, title, {
989
1019
  timeOut: 3000,
990
1020
  progressBar: true
@@ -994,8 +1024,8 @@ class NotificationService {
994
1024
  }
995
1025
  }
996
1026
  cancel(text, params, title) {
997
- text = Utils.getLocalizedValue(text, params, 'OperationCancelled');
998
- title = Utils.getLocalizedValue(title);
1027
+ text = L10nUtils.getLocalizedValue(text, params, 'OperationCancelled');
1028
+ title = L10nUtils.getLocalizedValue(title);
999
1029
  this.toastrService.info(text, title, {
1000
1030
  timeOut: 3000,
1001
1031
  progressBar: true
@@ -1024,31 +1054,6 @@ NotificationService.ctorParameters = () => [
1024
1054
  { type: ToastrService }
1025
1055
  ];
1026
1056
 
1027
- let InjectorInstance;
1028
- class AnatolyCoreModule {
1029
- constructor(injector, parentModule) {
1030
- this.injector = injector;
1031
- throwIfAlreadyLoaded(parentModule, 'AnatolyCoreModule');
1032
- InjectorInstance = this.injector;
1033
- }
1034
- }
1035
- AnatolyCoreModule.decorators = [
1036
- { type: NgModule, args: [{
1037
- imports: [CommonModule],
1038
- exports: [],
1039
- providers: [
1040
- LoggingService,
1041
- NotificationService,
1042
- AppContextService,
1043
- LoadingService
1044
- ],
1045
- },] }
1046
- ];
1047
- AnatolyCoreModule.ctorParameters = () => [
1048
- { type: Injector },
1049
- { type: AnatolyCoreModule, decorators: [{ type: Optional }, { type: SkipSelf }] }
1050
- ];
1051
-
1052
1057
  /*
1053
1058
  <file>
1054
1059
  Project:
@@ -1059,7 +1064,7 @@ AnatolyCoreModule.ctorParameters = () => [
1059
1064
  Anatoly Osovitny
1060
1065
 
1061
1066
  Created:
1062
- 19 March 2020
1067
+ 13 Nov 2017
1063
1068
 
1064
1069
  Version:
1065
1070
  1.0
@@ -1067,68 +1072,65 @@ AnatolyCoreModule.ctorParameters = () => [
1067
1072
  Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
1068
1073
  </file>
1069
1074
  */
1070
- class Utils {
1071
- static getValueByNameInQS(name) {
1072
- return Utils.getValueByName(location.search, name);
1075
+ class BaseApiService {
1076
+ constructor(http) {
1077
+ this.http = http;
1078
+ this.baseUrl = '';
1073
1079
  }
1074
- static getValueByName(url, name) {
1075
- name = name.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]');
1076
- // tslint:disable-next-line:one-variable-per-declaration
1077
- const regex = new RegExp('[\\?&]' + name + '=([^&#]*)'), results = regex.exec(url);
1078
- return results === null ? '' : decodeURIComponent(results[1].replace(/\+/g, ' '));
1080
+ serializeParams(data) {
1081
+ return data ? '?' + $.param(data) : '';
1079
1082
  }
1080
- static copyToClipBoard(event, val) {
1081
- event.preventDefault();
1082
- const selBox = document.createElement('textarea');
1083
- selBox.style.position = 'fixed';
1084
- selBox.style.left = '0';
1085
- selBox.style.top = '0';
1086
- selBox.style.opacity = '0';
1087
- selBox.value = val;
1088
- document.body.appendChild(selBox);
1089
- selBox.focus();
1090
- selBox.select();
1091
- document.execCommand('copy');
1092
- document.body.removeChild(selBox);
1093
- }
1094
- static downloadFile(name, url) {
1095
- const link = document.createElement('a');
1096
- link.download = name;
1097
- link.href = url;
1098
- link.click();
1099
- }
1100
- // Localization
1101
- // @dynamic
1102
- static get localizationService() {
1103
- const ns = InjectorInstance.get(LocalizationService);
1104
- return ns;
1105
- }
1106
- static getLocalizedValue(key, params, defaultKey) {
1107
- // VadimOS: DON'T CHANGE THIS CODE. NEED TO BE REVIEWED AND APPROVED BY VADIMOS
1108
- // defaultKey definition:
1109
- // if key is empty and defaultKey is defined => get localization for defaultKey
1110
- // Example: cancel()
1111
- if (!key && defaultKey) {
1112
- return this.localizationService.getLocalizedValue(defaultKey);
1083
+ // api
1084
+ get(action, data, responseType) {
1085
+ if (!responseType) {
1086
+ responseType = 'json';
1113
1087
  }
1114
- // VadimOS:
1115
- // if key is not empty value MUST be in localization table, othewise we will return key
1116
- if (key) {
1117
- const value = this.localizationService.getLocalizedValue(key, params);
1118
- return value;
1088
+ const url = `${this.baseUrl}/${action}${this.serializeParams(data)}`;
1089
+ return this.http
1090
+ .get(url, { responseType })
1091
+ .pipe(map((res) => res));
1092
+ }
1093
+ post(action, data, responseType) {
1094
+ if (!responseType) {
1095
+ responseType = 'text';
1119
1096
  }
1120
- return key;
1097
+ const url = `${this.baseUrl}/${action}`;
1098
+ return this.http.post(url, data, { responseType });
1121
1099
  }
1122
- static downloadBlobFile(value, fileName) {
1123
- if (window.navigator.msSaveOrOpenBlob) {
1124
- window.navigator.msSaveOrOpenBlob(value, fileName);
1100
+ postQS(action, data, responseType) {
1101
+ if (!responseType) {
1102
+ responseType = 'text';
1125
1103
  }
1126
- else {
1127
- const downloadURL = window.URL.createObjectURL(value);
1128
- Utils.downloadFile(fileName, downloadURL);
1104
+ const url = `${this.baseUrl}/${action}${this.serializeParams(data)}`;
1105
+ return this.http.post(url, null, { responseType });
1106
+ }
1107
+ delete(action, data, responseType) {
1108
+ if (!responseType) {
1109
+ responseType = 'text';
1129
1110
  }
1111
+ const url = `${this.baseUrl}/${action}${this.serializeParams(data)}`;
1112
+ return this.http.delete(url, { responseType });
1130
1113
  }
1131
- }
1114
+ // gets
1115
+ getById(id) {
1116
+ return this.get('getById', { id });
1117
+ }
1118
+ getAll(data) {
1119
+ return this.get('getall', data).pipe(map((res) => res));
1120
+ }
1121
+ getJsonFile(fileName) {
1122
+ const jsonsUrl = AppCoreSettings.jsonsUrl;
1123
+ const jsonVersion = AppCoreSettings.jsonVersion;
1124
+ const url = jsonsUrl + '/' + fileName + '?' + jsonVersion;
1125
+ return this.http.get(url).pipe(map((res) => res));
1126
+ }
1127
+ }
1128
+ BaseApiService.decorators = [
1129
+ { type: Injectable }
1130
+ ];
1131
+ BaseApiService.ctorParameters = () => [
1132
+ { type: HttpClient }
1133
+ ];
1132
1134
 
1133
1135
  /*
1134
1136
  <file>
@@ -1140,7 +1142,7 @@ class Utils {
1140
1142
  Anatoly Osovitny
1141
1143
 
1142
1144
  Created:
1143
- 3 March 2020
1145
+ 13 Nov 2017
1144
1146
 
1145
1147
  Version:
1146
1148
  1.0
@@ -1148,113 +1150,55 @@ class Utils {
1148
1150
  Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
1149
1151
  </file>
1150
1152
  */
1151
- class Alerts {
1152
- static success(text, params, title, successAction) {
1153
- text = Utils.getLocalizedValue(text, params, 'OperationSuccessFull');
1154
- title = Utils.getLocalizedValue(title, null, 'Success');
1155
- Swal.fire({
1156
- text,
1157
- title,
1158
- icon: 'success',
1159
- confirmButtonText: Utils.getLocalizedValue('Ok')
1160
- })
1161
- .then(() => {
1162
- if (successAction) {
1163
- successAction();
1164
- }
1165
- });
1166
- }
1167
- static info(text, params, title) {
1168
- text = Utils.getLocalizedValue(text, params);
1169
- title = Utils.getLocalizedValue(title, null, 'Info');
1170
- Swal.fire({
1171
- text,
1172
- title,
1173
- icon: 'info',
1174
- confirmButtonText: Utils.getLocalizedValue('Ok')
1175
- });
1176
- }
1177
- static warning(text, params, title) {
1178
- text = Utils.getLocalizedValue(text, params);
1179
- title = Utils.getLocalizedValue(title, null, 'Warning');
1180
- Swal.fire({
1181
- text,
1182
- title,
1183
- icon: 'warning',
1184
- confirmButtonText: Utils.getLocalizedValue('Ok')
1185
- });
1153
+ class AppContextService extends BaseApiService {
1154
+ constructor(http) {
1155
+ super(http);
1156
+ this.http = http;
1157
+ this.current = null;
1158
+ this.successes = [];
1159
+ this.subscription = null;
1160
+ this.baseUrl = '/api/appContext';
1186
1161
  }
1187
- static error(text, params, title) {
1188
- text = Utils.getLocalizedValue(text, params, 'ErrorOccured');
1189
- title = Utils.getLocalizedValue(title, null, 'Error');
1190
- Swal.fire({
1191
- text,
1192
- title,
1193
- icon: 'error',
1194
- confirmButtonText: Utils.getLocalizedValue('Ok')
1195
- });
1162
+ getCurrent(success) {
1163
+ if (typeof success == 'undefined') {
1164
+ return;
1165
+ }
1166
+ if (this.current != null) {
1167
+ success(this.current);
1168
+ return;
1169
+ }
1170
+ this.successes.push(success);
1171
+ if (this.subscription != null) {
1172
+ return;
1173
+ }
1174
+ this.subscription = this.get('GetCurrentContext', null).subscribe((data) => {
1175
+ this.dataReceived(data);
1176
+ }, (e) => { });
1196
1177
  }
1197
- static cancel(text, params, title) {
1198
- text = Utils.getLocalizedValue(text, params, 'OperationCancelled');
1199
- title = Utils.getLocalizedValue(title, null, 'Cancelled');
1200
- Swal.fire({
1201
- text,
1202
- title,
1203
- icon: 'info'
1204
- });
1178
+ dataReceived(data) {
1179
+ this.current = data;
1180
+ for (let i = 0; i < this.successes.length; i++) {
1181
+ let success = this.successes[i];
1182
+ success(data);
1183
+ }
1184
+ this.successes = [];
1185
+ this.subscription.unsubscribe();
1186
+ this.subscription = null;
1187
+ this.current = null;
1205
1188
  }
1206
- static notImplemented() {
1207
- this.warning('Not Implemented Yet');
1189
+ isUserSignedIn() {
1190
+ return ContextInitState.isUserSignedIn;
1208
1191
  }
1209
- ;
1210
- static areYouSure(text, title, confirmButtonText, cancelButtonText, successAction, cancelAction) {
1211
- text = Utils.getLocalizedValue(text);
1212
- title = Utils.getLocalizedValue(title, null, 'AreYouSure');
1213
- confirmButtonText = Utils.getLocalizedValue(confirmButtonText, null, 'AreYouSure-ConfirmButtonText');
1214
- cancelButtonText = Utils.getLocalizedValue(cancelButtonText, null, 'AreYouSure-CancelButtonText');
1215
- Swal.fire({
1216
- text,
1217
- title,
1218
- icon: 'warning',
1219
- confirmButtonText,
1220
- cancelButtonText,
1221
- showCancelButton: true
1222
- })
1223
- .then((result) => {
1224
- if (result.value) {
1225
- if (successAction) {
1226
- successAction();
1227
- }
1228
- }
1229
- // result.dismiss can be 'cancel', 'overlay', 'close', and 'timer'
1230
- else if (result.dismiss == Swal.DismissReason.cancel || result.dismiss == Swal.DismissReason.close) {
1231
- if (cancelAction) {
1232
- cancelAction();
1233
- }
1234
- }
1235
- });
1192
+ isUserAdmin() {
1193
+ return ContextInitState.isUserAdmin;
1236
1194
  }
1237
- ;
1238
- }
1239
-
1240
- /*
1241
- <file>
1242
- Project:
1243
- @osovitny/anatoly
1244
-
1245
- Authors:
1246
- Vadim Osovitny
1247
- Anatoly Osovitny
1248
-
1249
- Created:
1250
- 2 Jun 2020
1251
-
1252
- Version:
1253
- 1.0
1254
-
1255
- Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
1256
- </file>
1257
- */
1195
+ }
1196
+ AppContextService.decorators = [
1197
+ { type: Injectable }
1198
+ ];
1199
+ AppContextService.ctorParameters = () => [
1200
+ { type: HttpClient }
1201
+ ];
1258
1202
 
1259
1203
  /*
1260
1204
  <file>
@@ -1377,6 +1321,31 @@ SessionStorageService.decorators = [
1377
1321
  ];
1378
1322
  SessionStorageService.ctorParameters = () => [];
1379
1323
 
1324
+ let InjectorInstance;
1325
+ class AnatolyCoreModule {
1326
+ constructor(injector, parentModule) {
1327
+ this.injector = injector;
1328
+ throwIfAlreadyLoaded(parentModule, 'AnatolyCoreModule');
1329
+ InjectorInstance = this.injector;
1330
+ }
1331
+ }
1332
+ AnatolyCoreModule.decorators = [
1333
+ { type: NgModule, args: [{
1334
+ imports: [CommonModule],
1335
+ exports: [],
1336
+ providers: [
1337
+ LoggingService,
1338
+ NotificationService,
1339
+ AppContextService,
1340
+ LoadingService
1341
+ ],
1342
+ },] }
1343
+ ];
1344
+ AnatolyCoreModule.ctorParameters = () => [
1345
+ { type: Injector },
1346
+ { type: AnatolyCoreModule, decorators: [{ type: Optional }, { type: SkipSelf }] }
1347
+ ];
1348
+
1380
1349
  /*
1381
1350
  <file>
1382
1351
  Project:
@@ -1411,6 +1380,65 @@ class Subs {
1411
1380
  }
1412
1381
  }
1413
1382
 
1383
+ /*
1384
+ <file>
1385
+ Project:
1386
+ @osovitny/anatoly
1387
+
1388
+ Authors:
1389
+ Vadim Osovitny
1390
+ Anatoly Osovitny
1391
+
1392
+ Created:
1393
+ 19 March 2020
1394
+
1395
+ Version:
1396
+ 1.0
1397
+
1398
+ Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
1399
+ </file>
1400
+ */
1401
+ class Utils {
1402
+ static getValueByNameInQS(name) {
1403
+ return Utils.getValueByName(location.search, name);
1404
+ }
1405
+ static getValueByName(url, name) {
1406
+ name = name.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]');
1407
+ // tslint:disable-next-line:one-variable-per-declaration
1408
+ const regex = new RegExp('[\\?&]' + name + '=([^&#]*)'), results = regex.exec(url);
1409
+ return results === null ? '' : decodeURIComponent(results[1].replace(/\+/g, ' '));
1410
+ }
1411
+ static copyToClipBoard(event, val) {
1412
+ event.preventDefault();
1413
+ const selBox = document.createElement('textarea');
1414
+ selBox.style.position = 'fixed';
1415
+ selBox.style.left = '0';
1416
+ selBox.style.top = '0';
1417
+ selBox.style.opacity = '0';
1418
+ selBox.value = val;
1419
+ document.body.appendChild(selBox);
1420
+ selBox.focus();
1421
+ selBox.select();
1422
+ document.execCommand('copy');
1423
+ document.body.removeChild(selBox);
1424
+ }
1425
+ static downloadFile(name, url) {
1426
+ const link = document.createElement('a');
1427
+ link.download = name;
1428
+ link.href = url;
1429
+ link.click();
1430
+ }
1431
+ static downloadBlobFile(value, fileName) {
1432
+ if (window.navigator.msSaveOrOpenBlob) {
1433
+ window.navigator.msSaveOrOpenBlob(value, fileName);
1434
+ }
1435
+ else {
1436
+ const downloadURL = window.URL.createObjectURL(value);
1437
+ Utils.downloadFile(fileName, downloadURL);
1438
+ }
1439
+ }
1440
+ }
1441
+
1414
1442
  /*
1415
1443
  <file>
1416
1444
  Project:
@@ -2925,5 +2953,5 @@ AnatolyUIModule.decorators = [
2925
2953
  * Generated bundle index. Do not edit.
2926
2954
  */
2927
2955
 
2928
- export { Alerts, AnatolyCoreModule, AnatolyDataModule, AnatolyHttpInterceptor, AnatolyUIModule, AppContextService, AppCoreSettings, BaseApiService, BaseComponent, BaseEditComponent, BaseGoService, BaseGridEditService, BaseGridReadService, BaseHtmlEditorComponent, BillingApiService, BuyAccessButtonComponent, ContentHeaderComponent, ContextInitState, Convert, DefaultEditorOptions, FileSizePipe, FormValidationSummaryComponent, FormsHtmlEditorComponent, FroalaEditorModuleWithProviders, FroalaViewModuleWithProviders, GlobalErrorHandler, Guid, HtmlEditorComponent, IdleService, InjectorInstance, ItemValidationSummaryComponent, LoadingComponent, LoadingService, LocalStorageService, LocalizationModule, LocalizationService, LocalizationSettingsModule, LocalizePipe, LoggingService, NativeElementDirective, NotificationService, NotificationsApiService, ReplaceTextPipe, SafeHtmlPipe, SessionStorageService, SignInButtonComponent, SignOutButtonComponent, SignUpButtonComponent, SpinnerComponent, Subs, SubscribePlanButtonComponent, TranslateModuleAtRoot, UpgradePlanButtonComponent, Urls, Utils, ValidationSummaryComponent, consts, customTranslateLoaderFactory, localizationInitializerFactory, throwIfAlreadyLoaded };
2956
+ export { Alerts, AnatolyCoreModule, AnatolyDataModule, AnatolyHttpInterceptor, AnatolyUIModule, AppContextService, AppCoreSettings, BaseApiService, BaseComponent, BaseEditComponent, BaseGoService, BaseGridEditService, BaseGridReadService, BaseHtmlEditorComponent, BillingApiService, BuyAccessButtonComponent, ContentHeaderComponent, ContextInitState, Convert, DefaultEditorOptions, FileSizePipe, FormValidationSummaryComponent, FormsHtmlEditorComponent, FroalaEditorModuleWithProviders, FroalaViewModuleWithProviders, GlobalErrorHandler, Guid, HtmlEditorComponent, IdleService, InjectorInstance, ItemValidationSummaryComponent, LoadingComponent, LoadingService, LocalStorageService, LocalizationInjectorInstance, LocalizationModule, LocalizationService, LocalizationSettingsModule, LocalizePipe, LoggingService, NativeElementDirective, NotificationService, NotificationsApiService, ReplaceTextPipe, SafeHtmlPipe, SessionStorageService, SignInButtonComponent, SignOutButtonComponent, SignUpButtonComponent, SpinnerComponent, Subs, SubscribePlanButtonComponent, TranslateModuleAtRoot, UpgradePlanButtonComponent, Urls, Utils, ValidationSummaryComponent, consts, customTranslateLoaderFactory, localizationInitializerFactory, throwIfAlreadyLoaded };
2929
2957
  //# sourceMappingURL=osovitny-anatoly.js.map