@osovitny/anatoly 2.0.23 → 2.0.26

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.
Files changed (78) hide show
  1. package/bundles/osovitny-anatoly.umd.js +2039 -1292
  2. package/bundles/osovitny-anatoly.umd.js.map +1 -1
  3. package/bundles/osovitny-anatoly.umd.min.js +2 -3
  4. package/bundles/osovitny-anatoly.umd.min.js.map +1 -1
  5. package/esm2015/lib/core/consts/urls.js +22 -0
  6. package/esm2015/lib/core/convert.js +27 -0
  7. package/esm2015/lib/core/core.module.js +12 -9
  8. package/esm2015/lib/core/go/base-go.service.js +4 -4
  9. package/esm2015/lib/core/interceptors/httpInterceptor.js +2 -2
  10. package/esm2015/lib/core/localization/localization.module.js +41 -0
  11. package/esm2015/lib/core/localization/localization.service.js +5 -5
  12. package/esm2015/lib/core/localization/localizationSettings.module.js +70 -0
  13. package/esm2015/lib/core/localization/localize.pipe.js +65 -0
  14. package/esm2015/lib/core/notifications/alerts.js +107 -0
  15. package/esm2015/lib/core/notifications/interfaces/notification.js +19 -0
  16. package/esm2015/lib/core/notifications/services/notification-service.js +230 -0
  17. package/esm2015/lib/core/services/appcontext.service.js +12 -12
  18. package/esm2015/lib/core/services/idle.service.js +65 -0
  19. package/esm2015/lib/core/services/web-storage.service.js +65 -0
  20. package/esm2015/lib/core/subs.js +1 -1
  21. package/esm2015/lib/core/utils.js +3 -14
  22. package/esm2015/lib/data/base/base-api.service.js +26 -30
  23. package/esm2015/lib/data/consts.js +24 -0
  24. package/esm2015/lib/data/data.module.js +19 -8
  25. package/esm2015/lib/data/services/billing-api.service.js +4 -5
  26. package/esm2015/lib/data/services/notifications/notifications-api-service.js +45 -0
  27. package/esm2015/lib/ui/components/billing/buyaccess-button.component.js +9 -9
  28. package/esm2015/lib/ui/components/billing/upgrade-plan-button.component.js +7 -7
  29. package/esm2015/lib/ui/components/html-editor/base-html-editor.component.js +19 -19
  30. package/esm2015/lib/ui/components/loading/loading.component.js +49 -0
  31. package/esm2015/lib/ui/components/spinner/spinner.component.js +73 -0
  32. package/esm2015/lib/ui/pipes/filesize.pipe.js +41 -0
  33. package/esm2015/lib/ui/pipes/replace-text.pipe.js +36 -0
  34. package/esm2015/lib/ui/pipes/safeHtml.pipe.js +36 -0
  35. package/esm2015/lib/ui/ui.module.js +19 -13
  36. package/esm2015/public-api.js +57 -4
  37. package/fesm2015/osovitny-anatoly.js +1449 -709
  38. package/fesm2015/osovitny-anatoly.js.map +1 -1
  39. package/lib/core/consts/urls.d.ts +3 -0
  40. package/lib/core/convert.d.ts +3 -0
  41. package/lib/core/go/base-go.service.d.ts +1 -1
  42. package/lib/core/localization/localization.module.d.ts +2 -0
  43. package/lib/core/localization/localizationSettings.module.d.ts +10 -0
  44. package/lib/core/localization/localize.pipe.d.ts +7 -0
  45. package/lib/core/notifications/alerts.d.ts +9 -0
  46. package/lib/core/notifications/interfaces/notification.d.ts +10 -0
  47. package/lib/core/notifications/services/notification-service.d.ts +22 -0
  48. package/lib/core/services/appcontext.service.d.ts +2 -2
  49. package/lib/core/services/idle.service.d.ts +13 -0
  50. package/lib/core/services/web-storage.service.d.ts +17 -0
  51. package/lib/core/subs.d.ts +1 -1
  52. package/lib/core/utils.d.ts +0 -5
  53. package/lib/data/base/base-api.service.d.ts +2 -3
  54. package/lib/data/consts.d.ts +4 -0
  55. package/lib/data/data.module.d.ts +1 -0
  56. package/lib/data/services/notifications/notifications-api-service.d.ts +9 -0
  57. package/lib/ui/components/billing/buyaccess-button.component.d.ts +3 -3
  58. package/lib/ui/components/billing/upgrade-plan-button.component.d.ts +1 -1
  59. package/lib/ui/components/html-editor/base-html-editor.component.d.ts +2 -2
  60. package/lib/ui/components/loading/loading.component.d.ts +10 -0
  61. package/lib/ui/components/spinner/spinner.component.d.ts +22 -0
  62. package/lib/ui/pipes/filesize.pipe.d.ts +5 -0
  63. package/lib/ui/pipes/replace-text.pipe.d.ts +4 -0
  64. package/lib/ui/pipes/safeHtml.pipe.d.ts +7 -0
  65. package/lib/ui/ui.module.d.ts +2 -3
  66. package/osovitny-anatoly.metadata.json +1 -1
  67. package/package.json +1 -1
  68. package/public-api.d.ts +53 -3
  69. package/esm2015/lib/core/alerts.js +0 -145
  70. package/esm2015/lib/core/consts/index.js +0 -20
  71. package/esm2015/lib/core/index.js +0 -37
  72. package/esm2015/lib/data/index.js +0 -26
  73. package/esm2015/lib/ui/index.js +0 -43
  74. package/lib/core/alerts.d.ts +0 -12
  75. package/lib/core/consts/index.d.ts +0 -1
  76. package/lib/core/index.d.ts +0 -13
  77. package/lib/data/index.d.ts +0 -5
  78. package/lib/ui/index.d.ts +0 -16
@@ -1,15 +1,18 @@
1
- import Swal from 'sweetalert2';
2
- import { ɵɵdefineInjectable, ɵɵinject, Injectable, NgModule, Injector, Optional, SkipSelf, Component, Input, Directive, ElementRef } from '@angular/core';
3
- import { TranslateService } from '@ngx-translate/core';
1
+ import { Injectable, ɵɵdefineInjectable, ɵɵinject, Pipe, NgModule, APP_INITIALIZER, Injector, Optional, SkipSelf, Component, Input, ViewEncapsulation, Inject, Directive, ElementRef } from '@angular/core';
2
+ import { ActivatedRoute, Router, NavigationStart, NavigationEnd, NavigationCancel, NavigationError } from '@angular/router';
3
+ import { HttpResponse, HttpClient } from '@angular/common/http';
4
+ import { tap, map } from 'rxjs/operators';
5
+ import { BehaviorSubject, Subject, merge, fromEvent, timer } from 'rxjs';
6
+ import { TranslateService, TranslateModule, TranslateLoader } from '@ngx-translate/core';
4
7
  import { isValid, format, formatDistanceToNow, formatDistance } from 'date-fns';
5
8
  import enUS from 'date-fns/locale/en-US';
6
- import { CommonModule } from '@angular/common';
7
- import { HttpClient, HttpResponse } from '@angular/common/http';
8
- import { map, tap } from 'rxjs/operators';
9
- import { BehaviorSubject } from 'rxjs';
9
+ import { LOCATION_INITIALIZED, CommonModule, DOCUMENT } from '@angular/common';
10
+ import { TranslateHttpLoader } from '@ngx-translate/http-loader';
11
+ import Swal from 'sweetalert2';
12
+ import { ToastrService } from 'ngx-toastr';
10
13
  import { v4 } from 'uuid';
11
- import { ActivatedRoute, Router } from '@angular/router';
12
14
  import { NgControl, ReactiveFormsModule, FormsModule } from '@angular/forms';
15
+ import { DomSanitizer } from '@angular/platform-browser';
13
16
  import { FroalaEditorModule, FroalaViewModule } from 'angular-froala-wysiwyg';
14
17
 
15
18
  /*
@@ -33,6 +36,28 @@ import { FroalaEditorModule, FroalaViewModule } from 'angular-froala-wysiwyg';
33
36
  const ContextInitState = JSON.parse((document.getElementById('contextInitState')).getAttribute('data-contextinitstate'));
34
37
  const AppCoreSettings = JSON.parse((document.getElementById('appCoreSettings')).getAttribute('data-appcoresettings'));
35
38
 
39
+ /*
40
+ <file>
41
+ Project:
42
+ MICE
43
+
44
+ Authors:
45
+ Vadim Osovitny vaosovitny@deloitte.com
46
+
47
+ Created:
48
+ 5 May 2020
49
+
50
+ Version:
51
+ 1.0
52
+
53
+ Copyright (c) 2020 Deloitte Tax. All rights reserved.
54
+ </file>
55
+ */
56
+ const Urls = {
57
+ // SignalR Notifications
58
+ notificationsSocketUrl: '/hubs/notifications'
59
+ };
60
+
36
61
  /*
37
62
  <file>
38
63
  Project:
@@ -43,14 +68,31 @@ const AppCoreSettings = JSON.parse((document.getElementById('appCoreSettings')).
43
68
  Anatoly Osovitny
44
69
 
45
70
  Created:
46
- 26 Jun 2020
71
+ 17 Jun 2018
47
72
 
48
73
  Version:
49
74
  1.0
50
75
 
51
76
  Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
52
77
  </file>
53
- */
78
+ */
79
+ class BaseGoService {
80
+ constructor(route, router) {
81
+ this.route = route;
82
+ this.router = router;
83
+ }
84
+ locationReload() {
85
+ // this.router.navigate([this.route.url]);
86
+ window.location.reload();
87
+ }
88
+ }
89
+ BaseGoService.decorators = [
90
+ { type: Injectable }
91
+ ];
92
+ BaseGoService.ctorParameters = () => [
93
+ { type: ActivatedRoute },
94
+ { type: Router }
95
+ ];
54
96
 
55
97
  /*
56
98
  <file>
@@ -86,7 +128,7 @@ function throwIfAlreadyLoaded(parentModule, moduleName) {
86
128
  Anatoly Osovitny
87
129
 
88
130
  Created:
89
- 4 Mar 2020
131
+ 26 Jun 2020
90
132
 
91
133
  Version:
92
134
  1.0
@@ -94,129 +136,205 @@ function throwIfAlreadyLoaded(parentModule, moduleName) {
94
136
  Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
95
137
  </file>
96
138
  */
97
- class Alerts {
98
- static Info(text) {
99
- Swal.fire({
100
- title: "Information",
101
- text: text,
102
- icon: "info",
103
- confirmButtonText: "OK",
104
- });
139
+ class LoadingService extends BehaviorSubject {
140
+ constructor() {
141
+ super(false);
142
+ this.counter = 0;
143
+ //Public
144
+ this.isFreezed = false;
105
145
  }
106
- static Warning(text) {
107
- Swal.fire({
108
- title: "Warning",
109
- text: text,
110
- icon: "warning",
111
- confirmButtonText: "OK",
112
- });
146
+ show() {
147
+ this.counter++;
148
+ let that = this;
149
+ setTimeout(() => {
150
+ if (that.counter > 0) {
151
+ that.next(true);
152
+ }
153
+ }, 1000);
113
154
  }
114
- static Error(text) {
115
- Swal.fire({
116
- title: "Error",
117
- text: text,
118
- icon: "error",
119
- confirmButtonText: "OK",
120
- });
155
+ hide() {
156
+ if (this.counter <= 0) {
157
+ return;
158
+ }
159
+ this.counter--;
160
+ if (this.counter == 0) {
161
+ this.next(false);
162
+ }
163
+ }
164
+ freeze(timeout = 1000) {
165
+ this.isFreezed = true;
166
+ let that = this;
167
+ setTimeout(() => {
168
+ this.isFreezed = false;
169
+ }, timeout);
121
170
  }
122
- static NotImplemented() {
123
- this.Warning("Not Implemented Yet");
171
+ }
172
+ LoadingService.ɵprov = ɵɵdefineInjectable({ factory: function LoadingService_Factory() { return new LoadingService(); }, token: LoadingService, providedIn: "root" });
173
+ LoadingService.decorators = [
174
+ { type: Injectable, args: [{
175
+ providedIn: "root",
176
+ },] }
177
+ ];
178
+ LoadingService.ctorParameters = () => [];
179
+
180
+ /*
181
+ <file>
182
+ Project:
183
+ @osovitny/anatoly
184
+
185
+ Authors:
186
+ Vadim Osovitny
187
+ Anatoly Osovitny
188
+
189
+ Created:
190
+ 26 Jun 2020
191
+
192
+ Version:
193
+ 1.0
194
+
195
+ Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
196
+ </file>
197
+ */
198
+ class LoggingService {
199
+ constructor() { }
200
+ logError(error) {
201
+ console.error(error);
124
202
  }
125
- static ErrorOccurred() {
126
- this.Error("Sorry, an unexpected error occurred");
203
+ logInformation(info) {
204
+ console.info(info);
127
205
  }
128
- static AreYouSure(text, title, confirmButtonText, cancelButtonText, successAction, cancelAction) {
129
- if (typeof title == "undefined" || title == null)
130
- title = "Are you sure?";
131
- Swal.fire({
132
- title: title,
133
- text: text,
134
- icon: "warning",
135
- confirmButtonText: confirmButtonText,
136
- cancelButtonText: cancelButtonText,
137
- showCancelButton: true,
138
- }).then((result) => {
139
- if (result.value) {
140
- if (successAction) {
141
- successAction();
206
+ }
207
+ LoggingService.ɵprov = ɵɵdefineInjectable({ factory: function LoggingService_Factory() { return new LoggingService(); }, token: LoggingService, providedIn: "root" });
208
+ LoggingService.decorators = [
209
+ { type: Injectable, args: [{
210
+ providedIn: "root",
211
+ },] }
212
+ ];
213
+ LoggingService.ctorParameters = () => [];
214
+
215
+ /*
216
+ <file>
217
+ Project:
218
+ @osovitny/anatoly
219
+
220
+ Authors:
221
+ Vadim Osovitny
222
+ Anatoly Osovitny
223
+
224
+ Created:
225
+ 25 March 2020
226
+
227
+ Version:
228
+ 1.0
229
+
230
+ Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
231
+ </file>
232
+ */
233
+ class AnatolyHttpInterceptor {
234
+ constructor(loadingService, loggingService) {
235
+ this.loadingService = loadingService;
236
+ this.loggingService = loggingService;
237
+ this.longRunningExceptionsList = [];
238
+ this.autoCDNSASTokenUrls = ['chunks', 'resources'];
239
+ this.externalSiteUrls = ['azurewebsites.net'];
240
+ }
241
+ intercept(req, next) {
242
+ const isCDNEnabled = AppCoreSettings.IsCDNEnabled;
243
+ const cdnSasToken = AppCoreSettings.CDNSASToken;
244
+ const isLoadingFreezed = this.loadingService.isFreezed;
245
+ let loadingRequired = !isLoadingFreezed;
246
+ const authorizationTokenRequired = true;
247
+ const url = req.url.toLowerCase();
248
+ const originalUrl = req.url;
249
+ let isExternalSite = false;
250
+ if (!isLoadingFreezed) {
251
+ for (const i of this.longRunningExceptionsList) {
252
+ if (url.indexOf(this.longRunningExceptionsList[i]) >= 0) {
253
+ loadingRequired = false;
254
+ break;
142
255
  }
143
256
  }
144
- // result.dismiss can be 'cancel', 'overlay', 'close', and 'timer'
145
- else if (result.dismiss == Swal.DismissReason.cancel ||
146
- result.dismiss == Swal.DismissReason.close) {
147
- if (cancelAction) {
148
- cancelAction();
257
+ }
258
+ if (isCDNEnabled) {
259
+ for (const i of this.autoCDNSASTokenUrls) {
260
+ if (url.indexOf(this.autoCDNSASTokenUrls[i]) >= 0) {
261
+ req = req.clone({ url: originalUrl + cdnSasToken });
262
+ break;
149
263
  }
150
264
  }
151
- });
152
- }
153
- static Success(text, title, successAction) {
154
- if (typeof title == "undefined" || title == null)
155
- title = "Success";
156
- if (!text) {
157
- text = "Operation was successful";
158
265
  }
159
- Swal.fire({
160
- title: title,
161
- text: text,
162
- icon: "success",
163
- confirmButtonText: "OK",
164
- }).then(function () {
165
- if (successAction) {
166
- successAction();
266
+ for (const i of this.externalSiteUrls) {
267
+ if (url.indexOf(this.externalSiteUrls[i]) >= 0) {
268
+ isExternalSite = true;
269
+ break;
167
270
  }
168
- });
169
- }
170
- static Cancel(text) {
171
- if (!text) {
172
- text = "Operation has been cancled";
173
271
  }
174
- Swal.fire({
175
- title: "Cancelled",
176
- text: text,
177
- icon: "info",
178
- });
179
- }
180
- //Notifications
181
- static NotificationCancel(text, title) {
182
- if (typeof title == "undefined" || title == null) {
183
- title = "Canceled";
272
+ // VadimOS: IE11-fix
273
+ if (url.indexOf('/api/') > -1) {
274
+ let newUrl = '';
275
+ const t = new Date().getTime().toString();
276
+ if (url.indexOf('?') > -1) {
277
+ newUrl = originalUrl + '&t=' + t;
278
+ }
279
+ else {
280
+ newUrl = originalUrl + '?t=' + t;
281
+ }
282
+ req = req.clone({ url: newUrl });
184
283
  }
185
- if (!text) {
186
- text = "Operation has been canceled";
284
+ req = req.clone({ headers: req.headers.set('Accept', 'application/json') });
285
+ this.onRequestStart(loadingRequired);
286
+ return next.handle(req).pipe(tap((event) => {
287
+ if (event instanceof HttpResponse) {
288
+ this.onRequestEnd(loadingRequired);
289
+ }
290
+ }, (err) => {
291
+ this.onRequestEnd(loadingRequired);
292
+ this.loggingService.logError(err);
293
+ }));
294
+ }
295
+ onRequestStart(loadingRequired) {
296
+ if (loadingRequired) {
297
+ this.loadingService.show();
187
298
  }
188
- const toast = Swal.mixin({
189
- toast: true,
190
- position: "top-end",
191
- showConfirmButton: false,
192
- timer: 3000,
193
- timerProgressBar: true,
194
- });
195
- toast.fire({
196
- title: title,
197
- text: text,
198
- icon: "info",
199
- });
200
299
  }
201
- static NotificationSuccess(text, title) {
202
- if (typeof title == "undefined" || title == null) {
203
- title = "Success";
300
+ onRequestEnd(loadingRequired) {
301
+ if (loadingRequired) {
302
+ this.loadingService.hide();
204
303
  }
205
- if (!text) {
206
- text = "Operation was successful";
304
+ }
305
+ }
306
+ AnatolyHttpInterceptor.decorators = [
307
+ { type: Injectable }
308
+ ];
309
+ AnatolyHttpInterceptor.ctorParameters = () => [
310
+ { type: LoadingService },
311
+ { type: LoggingService }
312
+ ];
313
+
314
+ /*
315
+ <file>
316
+ Project:
317
+ @osovitny/anatoly
318
+
319
+ Authors:
320
+ Vadim Osovitny
321
+ Anatoly Osovitny
322
+
323
+ Created:
324
+ 29 June 2020
325
+
326
+ Version:
327
+ 1.0
328
+
329
+ Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
330
+ </file>
331
+ */
332
+ class Convert {
333
+ static toLocalizedDateTime(value) {
334
+ if (value) {
335
+ return new Date(Date.UTC(value.getFullYear(), value.getMonth(), value.getDate(), value.getHours(), value.getMinutes(), value.getSeconds(), value.getMilliseconds()));
207
336
  }
208
- const toast = Swal.mixin({
209
- toast: true,
210
- position: "top-end",
211
- showConfirmButton: false,
212
- timer: 3000,
213
- timerProgressBar: true,
214
- });
215
- toast.fire({
216
- title: title,
217
- text: text,
218
- icon: "success",
219
- });
337
+ return null;
220
338
  }
221
339
  }
222
340
 
@@ -293,7 +411,7 @@ class LocalizationService {
293
411
  // To Do Manoj: Test in IE and make TimeZone specific changes accordingly
294
412
  const dateValue = new Date(key);
295
413
  if (isValid(dateValue)) {
296
- const localDate = Utils.convertToLocalizedDateTime(dateValue);
414
+ const localDate = Convert.toLocalizedDateTime(dateValue);
297
415
  return format(localDate, AppCoreSettings.DATE_FORMATS.angularWithTime, this.dateFnsLocale);
298
416
  }
299
417
  return 'Invalid Date';
@@ -332,7 +450,7 @@ LocalizationService.ctorParameters = () => [
332
450
  Anatoly Osovitny
333
451
 
334
452
  Created:
335
- 26 Jun 2020
453
+ 10 May 2020
336
454
 
337
455
  Version:
338
456
  1.0
@@ -340,22 +458,181 @@ LocalizationService.ctorParameters = () => [
340
458
  Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
341
459
  </file>
342
460
  */
343
- class LoggingService {
344
- constructor() { }
345
- logError(error) {
346
- console.error(error);
347
- }
348
- logInformation(info) {
349
- console.info(info);
461
+ class LocalizePipe {
462
+ constructor(localizeService) {
463
+ this.localizeService = localizeService;
350
464
  }
351
- }
352
- LoggingService.ɵprov = ɵɵdefineInjectable({ factory: function LoggingService_Factory() { return new LoggingService(); }, token: LoggingService, providedIn: "root" });
353
- LoggingService.decorators = [
354
- { type: Injectable, args: [{
355
- providedIn: "root",
465
+ transform(inputData, type, param2) {
466
+ if (!inputData) {
467
+ return;
468
+ }
469
+ if (!type) {
470
+ type = 't';
471
+ }
472
+ // Translate
473
+ if (type === 't') {
474
+ return this.localizeService.getLocalizedValue(inputData);
475
+ }
476
+ // Date
477
+ if (type === 'd') {
478
+ return this.localizeService.getLocalizedDate(inputData);
479
+ }
480
+ // DateTime
481
+ if (type === 'dt') {
482
+ return this.localizeService.getLocalizedDateTime(inputData);
483
+ }
484
+ // DistanceToNowInWords
485
+ if (type === 'dis2now') {
486
+ return this.localizeService.getLocalizedDistanceToNowInWords(inputData);
487
+ }
488
+ // DistanceInWords
489
+ if (type === 'dis') {
490
+ return this.localizeService.getLocalizedDistanceInWords(inputData, param2);
491
+ }
492
+ return inputData;
493
+ }
494
+ }
495
+ LocalizePipe.decorators = [
496
+ { type: Pipe, args: [{
497
+ name: 'localize'
356
498
  },] }
357
499
  ];
358
- LoggingService.ctorParameters = () => [];
500
+ LocalizePipe.ctorParameters = () => [
501
+ { type: LocalizationService }
502
+ ];
503
+
504
+ /*
505
+ <file>
506
+ Project:
507
+ @osovitny/anatoly
508
+
509
+ Authors:
510
+ Vadim Osovitny
511
+ Anatoly Osovitny
512
+
513
+ Created:
514
+ 05 May 2020
515
+
516
+ Version:
517
+ 1.0
518
+
519
+ Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
520
+ </file>
521
+ */
522
+ function customTranslateLoaderFactory(http) {
523
+ return new TranslateHttpLoader(http, AppCoreSettings.resourcesUrl + "/", '.json');
524
+ }
525
+ function localizationInitializerFactory(translate, localizationService, injector) {
526
+ return () => new Promise((resolve) => {
527
+ let locationInitialized = injector.get(LOCATION_INITIALIZED, Promise.resolve(null));
528
+ locationInitialized.then(() => {
529
+ let languageToSet = localizationService.configureTranslationSettings(translate);
530
+ translate.use(languageToSet).subscribe(() => {
531
+ }, () => {
532
+ resolve(null);
533
+ }, () => {
534
+ resolve(null);
535
+ });
536
+ });
537
+ });
538
+ }
539
+ const TranslateModuleAtRoot = TranslateModule.forRoot({
540
+ loader: {
541
+ provide: TranslateLoader,
542
+ useFactory: customTranslateLoaderFactory,
543
+ deps: [HttpClient]
544
+ }
545
+ });
546
+ class LocalizationSettingsModule {
547
+ }
548
+ LocalizationSettingsModule.decorators = [
549
+ { type: NgModule, args: [{
550
+ imports: [
551
+ TranslateModuleAtRoot
552
+ ],
553
+ providers: [
554
+ {
555
+ provide: APP_INITIALIZER,
556
+ useFactory: localizationInitializerFactory,
557
+ deps: [TranslateService, LocalizationService, Injector],
558
+ multi: true
559
+ }
560
+ ],
561
+ exports: []
562
+ },] }
563
+ ];
564
+
565
+ /*
566
+ <file>
567
+ Project:
568
+ @osovitny/anatoly
569
+
570
+ Authors:
571
+ Vadim Osovitny
572
+ Anatoly Osovitny
573
+
574
+ Created:
575
+ 12 May 2020
576
+
577
+ Version:
578
+ 1.0
579
+
580
+ Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
581
+ </file>
582
+ */
583
+ class LocalizationModule {
584
+ }
585
+ LocalizationModule.decorators = [
586
+ { type: NgModule, args: [{
587
+ imports: [
588
+ TranslateModule
589
+ ],
590
+ exports: [
591
+ TranslateModule,
592
+ LocalizePipe
593
+ ],
594
+ declarations: [
595
+ LocalizePipe
596
+ ],
597
+ providers: []
598
+ },] }
599
+ ];
600
+
601
+ /*
602
+ <file>
603
+ Project:
604
+ @osovitny/anatoly
605
+
606
+ Authors:
607
+ Vadim Osovitny
608
+ Anatoly Osovitny
609
+
610
+ Created:
611
+ 26 Jun 2020
612
+
613
+ Version:
614
+ 1.0
615
+
616
+ Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
617
+ </file>
618
+ */
619
+ class GlobalErrorHandler {
620
+ constructor(injector) {
621
+ this.injector = injector;
622
+ }
623
+ handleError(error) {
624
+ const loggingService = this.injector.get(LoggingService);
625
+ loggingService.logError(error);
626
+ // IMPORTANT: Rethrow the error otherwise it gets swallowed
627
+ throw error;
628
+ }
629
+ }
630
+ GlobalErrorHandler.decorators = [
631
+ { type: Injectable }
632
+ ];
633
+ GlobalErrorHandler.ctorParameters = () => [
634
+ { type: Injector }
635
+ ];
359
636
 
360
637
  /*
361
638
  <file>
@@ -378,63 +655,59 @@ LoggingService.ctorParameters = () => [];
378
655
  class BaseApiService {
379
656
  constructor(http) {
380
657
  this.http = http;
381
- this.baseUrl = "";
658
+ this.baseUrl = '';
382
659
  }
383
660
  serializeParams(data) {
384
- return data ? "?" + $.param(data) : "";
661
+ return data ? '?' + $.param(data) : '';
385
662
  }
386
- //api
663
+ // api
387
664
  get(action, data, responseType) {
388
665
  if (!responseType) {
389
- responseType = "json";
666
+ responseType = 'json';
390
667
  }
391
- var url = `${this.baseUrl}/${action}${this.serializeParams(data)}`;
668
+ const url = `${this.baseUrl}/${action}${this.serializeParams(data)}`;
392
669
  return this.http
393
- .get(url, { responseType: responseType })
670
+ .get(url, { responseType })
394
671
  .pipe(map((res) => res));
395
672
  }
396
673
  post(action, data, responseType) {
397
674
  if (!responseType) {
398
- responseType = "text";
675
+ responseType = 'text';
399
676
  }
400
- var url = `${this.baseUrl}/${action}`;
401
- return this.http.post(url, data, { responseType: responseType });
677
+ const url = `${this.baseUrl}/${action}`;
678
+ return this.http.post(url, data, { responseType });
402
679
  }
403
680
  postQS(action, data, responseType) {
404
681
  if (!responseType) {
405
- responseType = "text";
682
+ responseType = 'text';
406
683
  }
407
- var url = `${this.baseUrl}/${action}${this.serializeParams(data)}`;
408
- return this.http.post(url, null, { responseType: responseType });
684
+ const url = `${this.baseUrl}/${action}${this.serializeParams(data)}`;
685
+ return this.http.post(url, null, { responseType });
409
686
  }
410
687
  delete(action, data, responseType) {
411
688
  if (!responseType) {
412
- responseType = "text";
689
+ responseType = 'text';
413
690
  }
414
- var url = `${this.baseUrl}/${action}${this.serializeParams(data)}`;
415
- return this.http.delete(url, { responseType: responseType });
691
+ const url = `${this.baseUrl}/${action}${this.serializeParams(data)}`;
692
+ return this.http.delete(url, { responseType });
416
693
  }
417
- //gets
694
+ // gets
418
695
  getById(id) {
419
- return this.get("getById", { id: id });
696
+ return this.get('getById', { id });
420
697
  }
421
698
  getAll(data) {
422
- return this.get("getall", data).pipe(map((res) => res));
699
+ return this.get('getall', data).pipe(map((res) => res));
423
700
  }
424
701
  getJsonFile(fileName, jsonUrl, jsonVersion) {
425
702
  if (!jsonUrl) {
426
- jsonUrl = "/dist/jsons";
703
+ jsonUrl = '/dist/jsons';
427
704
  }
428
705
  if (!jsonVersion) {
429
- jsonVersion = "1.0";
706
+ jsonVersion = '1.0';
430
707
  }
431
- var url = jsonUrl + "/" + fileName + "?" + jsonVersion;
708
+ const url = jsonUrl + '/' + fileName + '?' + jsonVersion;
432
709
  return this.http.get(url).pipe(map((res) => res));
433
710
  }
434
- getNewGuid() {
435
- var url = `${this.baseUrl}/getNewGuid`;
436
- return this.http.get(url, { responseType: "text" });
437
- }
438
711
  }
439
712
  BaseApiService.decorators = [
440
713
  { type: Injectable }
@@ -468,10 +741,10 @@ class AppContextService extends BaseApiService {
468
741
  this.current = null;
469
742
  this.successes = [];
470
743
  this.subscription = null;
471
- this.baseUrl = "/api/appContext";
744
+ this.baseUrl = '/api/appContext';
472
745
  }
473
746
  getCurrent(success) {
474
- if (typeof success == "undefined") {
747
+ if (typeof success == 'undefined') {
475
748
  return;
476
749
  }
477
750
  if (this.current != null) {
@@ -482,14 +755,14 @@ class AppContextService extends BaseApiService {
482
755
  if (this.subscription != null) {
483
756
  return;
484
757
  }
485
- this.subscription = this.get("GetCurrentContext", null).subscribe((data) => {
758
+ this.subscription = this.get('GetCurrentContext', null).subscribe((data) => {
486
759
  this.dataReceived(data);
487
760
  }, (e) => { });
488
761
  }
489
762
  dataReceived(data) {
490
763
  this.current = data;
491
- for (var i = 0; i < this.successes.length; i++) {
492
- var success = this.successes[i];
764
+ for (let i = 0; i < this.successes.length; i++) {
765
+ let success = this.successes[i];
493
766
  success(data);
494
767
  }
495
768
  this.successes = [];
@@ -529,52 +802,232 @@ AppContextService.ctorParameters = () => [
529
802
  Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
530
803
  </file>
531
804
  */
532
- class LoadingService extends BehaviorSubject {
533
- constructor() {
534
- super(false);
535
- this.counter = 0;
536
- //Public
537
- this.isFreezed = false;
805
+ class Guid {
806
+ static newGuid() {
807
+ return v4();
538
808
  }
539
- show() {
540
- this.counter++;
541
- let that = this;
542
- setTimeout(() => {
543
- if (that.counter > 0) {
544
- that.next(true);
545
- }
546
- }, 1000);
809
+ }
810
+
811
+ /*
812
+ <file>
813
+ Project:
814
+ @osovitny/anatoly
815
+
816
+ Authors:
817
+ Vadim Osovitny
818
+ Anatoly Osovitny
819
+
820
+ Created:
821
+ 2 Jun 2020
822
+
823
+ Version:
824
+ 1.0
825
+
826
+ Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
827
+ </file>
828
+ */
829
+ // SignalR
830
+ // import * as signalR from '@microsoft/signalr';
831
+ // import { NotificationsApiService } from '../../../data/services/notifications/notifications-api-service';
832
+ class NotificationService {
833
+ constructor(toastrService) {
834
+ this.toastrService = toastrService;
835
+ // SignalR
836
+ // private hubConnection: signalR.HubConnection;
837
+ // private socketUrl: string;
838
+ // Notifications
839
+ this._sessionNotifications = new BehaviorSubject([]);
840
+ this._serverNotifications = new BehaviorSubject([]);
841
+ // Public
842
+ this.sessionNotifications$ = this._sessionNotifications.asObservable();
843
+ this.serverNotifications$ = this._serverNotifications.asObservable();
844
+ // this.onInit();
547
845
  }
548
- hide() {
549
- if (this.counter <= 0) {
550
- return;
846
+ /*
847
+ onInit() {
848
+ if (AppCoreSettings.AzureAD) {
849
+ this.authService.getAuthToken().subscribe((token: string) => {
850
+ this.startSignalRConnection(token);
851
+ });
852
+
853
+ return;
854
+ }
855
+
856
+ this.startSignalRConnection();
857
+ }
858
+
859
+ ngOnDestroy() {
860
+ this.stopSignalRConnection();
861
+ }
862
+
863
+ // SignalR
864
+ private startSignalRConnection(accessToken?) {
865
+ const cskii = AppCoreSettings.selectedClientID;
866
+ // tslint:disable-next-line:variable-name
867
+ const cskii_upn = AppCoreSettings.CSKII_UPN;
868
+ // tslint:disable-next-line:variable-name
869
+ const cli_sessionguid = AppCoreSettings.CLI_SessionGUID;
870
+
871
+ const url = this.socketUrl + '?cskii=' + cskii + '&cskii_upn=' + cskii_upn + '&cli_sessionguid=' + cli_sessionguid;
872
+
873
+ if (accessToken) {
874
+ this.hubConnection = new signalR.HubConnectionBuilder()
875
+ .withUrl(url, {
876
+ skipNegotiation: false,
877
+ transport: signalR.HttpTransportType.WebSockets,
878
+ accessTokenFactory: () => accessToken
879
+ })
880
+ .withAutomaticReconnect()
881
+ .configureLogging(signalR.LogLevel.Debug)
882
+ .build();
883
+ }
884
+ else {
885
+ this.hubConnection = new signalR.HubConnectionBuilder()
886
+ .withUrl(this.socketUrl, {
887
+ skipNegotiation: true,
888
+ transport: signalR.HttpTransportType.WebSockets
889
+ })
890
+ .withAutomaticReconnect()
891
+ .configureLogging(signalR.LogLevel.Debug)
892
+ .build();
893
+ }
894
+
895
+ this.hubConnection
896
+ .start()
897
+ .then(() => this.signalRConnection_onSuccess())
898
+ .catch(err => {
899
+ console.error('Connection failed to SignalR Notification Hub')
900
+ })
901
+ }
902
+
903
+ private signalRConnection_onSuccess() {
904
+ this.addReceiveMessageDataListener();
905
+
906
+ this.notificationsApiService.retrieveNotifications().subscribe(data => {
907
+ this.serverNotifications = data;
908
+ });
909
+ }
910
+
911
+ stopSignalRConnection() {
912
+ if (this.hubConnection) {
913
+ this.hubConnection.stop();
914
+ this.hubConnection = null;
915
+ }
916
+ }
917
+
918
+ private addReceiveMessageDataListener = () => {
919
+ this.hubConnection.on('ReceiveMessage', (message) => {
920
+ if (message) {
921
+ if (message.type === 'error') {
922
+ this.error(message.text, null, null, false);
923
+ }
924
+ else {
925
+ this.success(message.text, null, null, false);
926
+ }
927
+
928
+ const notification = {
929
+ id: message.id,
930
+ isNew: message.isNew,
931
+ isSession: true,
932
+ text: message.text,
933
+ type: message.type,
934
+ createdDate: message.createdDate
935
+ };
936
+
937
+ this.addSessionNotificationToList(notification);
551
938
  }
552
- this.counter--;
553
- if (this.counter == 0) {
554
- this.next(false);
939
+ });
940
+ }
941
+ */
942
+ addSessionNotification(text, type) {
943
+ const id = Guid.newGuid();
944
+ const notification = { id, isNew: true, isSession: true, text, type, createdDate: new Date(Date.now()).toISOString() };
945
+ this.addSessionNotificationToList(notification);
946
+ }
947
+ addSessionNotificationToList(notification) {
948
+ this.sessionNotifications = [
949
+ notification,
950
+ ...this.sessionNotifications,
951
+ ];
952
+ }
953
+ // Public API
954
+ removeNotification(id, isSession) {
955
+ if (isSession) {
956
+ this.sessionNotifications = this.sessionNotifications.filter(notifications => notifications.id !== id);
957
+ }
958
+ else {
959
+ this.serverNotifications = this.serverNotifications.filter(notifications => notifications.id !== id);
555
960
  }
556
961
  }
557
- freeze(timeout = 1000) {
558
- this.isFreezed = true;
559
- let that = this;
560
- setTimeout(() => {
561
- this.isFreezed = false;
562
- }, timeout);
962
+ success(text, params, title, createSessionNotification = true) {
963
+ text = Utils.getLocalizedValue(text, params, 'OperationSuccessFull');
964
+ title = Utils.getLocalizedValue(title);
965
+ this.toastrService.success(text, title, {
966
+ timeOut: 3000,
967
+ progressBar: true
968
+ });
969
+ if (createSessionNotification) {
970
+ this.addSessionNotification(text, 'success');
971
+ }
972
+ }
973
+ info(text, params, title) {
974
+ text = Utils.getLocalizedValue(text, params);
975
+ title = Utils.getLocalizedValue(title);
976
+ this.toastrService.info(text, title, {
977
+ timeOut: 3000,
978
+ progressBar: true
979
+ });
980
+ }
981
+ warning(text, params, title) {
982
+ text = Utils.getLocalizedValue(text, params);
983
+ title = Utils.getLocalizedValue(title);
984
+ this.toastrService.warning(text, title, {
985
+ timeOut: 3000,
986
+ progressBar: true
987
+ });
988
+ }
989
+ error(text, params, title, createSessionNotification = true) {
990
+ text = Utils.getLocalizedValue(text, params, 'ErrorOccured');
991
+ title = Utils.getLocalizedValue(title);
992
+ this.toastrService.error(text, title, {
993
+ timeOut: 3000,
994
+ progressBar: true
995
+ });
996
+ if (createSessionNotification) {
997
+ this.addSessionNotification(text, 'error');
998
+ }
999
+ }
1000
+ cancel(text, params, title) {
1001
+ text = Utils.getLocalizedValue(text, params, 'OperationCancelled');
1002
+ title = Utils.getLocalizedValue(title);
1003
+ this.toastrService.info(text, title, {
1004
+ timeOut: 3000,
1005
+ progressBar: true
1006
+ });
1007
+ }
1008
+ // SessionNotifications
1009
+ get sessionNotifications() {
1010
+ return this._sessionNotifications.getValue();
1011
+ }
1012
+ set sessionNotifications(val) {
1013
+ this._sessionNotifications.next(val);
1014
+ }
1015
+ // ServerNotifications
1016
+ get serverNotifications() {
1017
+ return this._serverNotifications.getValue();
1018
+ }
1019
+ set serverNotifications(val) {
1020
+ this._serverNotifications.next(val);
563
1021
  }
564
1022
  }
565
- LoadingService.ɵprov = ɵɵdefineInjectable({ factory: function LoadingService_Factory() { return new LoadingService(); }, token: LoadingService, providedIn: "root" });
566
- LoadingService.decorators = [
567
- { type: Injectable, args: [{
568
- providedIn: "root",
569
- },] }
1023
+ NotificationService.ɵprov = ɵɵdefineInjectable({ factory: function NotificationService_Factory() { return new NotificationService(ɵɵinject(ToastrService)); }, token: NotificationService, providedIn: "root" });
1024
+ NotificationService.decorators = [
1025
+ { type: Injectable, args: [{ providedIn: 'root' },] }
570
1026
  ];
571
- LoadingService.ctorParameters = () => [];
1027
+ NotificationService.ctorParameters = () => [
1028
+ { type: ToastrService }
1029
+ ];
572
1030
 
573
- const providers = [
574
- LoggingService,
575
- AppContextService,
576
- LoadingService
577
- ];
578
1031
  let InjectorInstance;
579
1032
  class AnatolyCoreModule {
580
1033
  constructor(injector, parentModule) {
@@ -586,7 +1039,13 @@ class AnatolyCoreModule {
586
1039
  AnatolyCoreModule.decorators = [
587
1040
  { type: NgModule, args: [{
588
1041
  imports: [CommonModule],
589
- providers: [...providers],
1042
+ exports: [],
1043
+ providers: [
1044
+ LoggingService,
1045
+ NotificationService,
1046
+ AppContextService,
1047
+ LoadingService
1048
+ ],
590
1049
  },] }
591
1050
  ];
592
1051
  AnatolyCoreModule.ctorParameters = () => [
@@ -612,13 +1071,13 @@ AnatolyCoreModule.ctorParameters = () => [
612
1071
  Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
613
1072
  </file>
614
1073
  */
615
- // @dynamic
616
1074
  class Utils {
617
1075
  static getValueByNameInQS(name) {
618
1076
  return Utils.getValueByName(location.search, name);
619
1077
  }
620
1078
  static getValueByName(url, name) {
621
1079
  name = name.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]');
1080
+ // tslint:disable-next-line:one-variable-per-declaration
622
1081
  const regex = new RegExp('[\\?&]' + name + '=([^&#]*)'), results = regex.exec(url);
623
1082
  return results === null ? '' : decodeURIComponent(results[1].replace(/\+/g, ' '));
624
1083
  }
@@ -664,16 +1123,6 @@ class Utils {
664
1123
  }
665
1124
  return key;
666
1125
  }
667
- /**
668
- * Convert date time lo local time zone value.
669
- * @param value
670
- */
671
- static convertToLocalizedDateTime(value) {
672
- if (value) {
673
- return new Date(Date.UTC(value.getFullYear(), value.getMonth(), value.getDate(), value.getHours(), value.getMinutes(), value.getSeconds(), value.getMilliseconds()));
674
- }
675
- return null;
676
- }
677
1126
  static downloadBlobFile(value, fileName) {
678
1127
  if (window.navigator.msSaveOrOpenBlob) {
679
1128
  window.navigator.msSaveOrOpenBlob(value, fileName);
@@ -695,7 +1144,7 @@ class Utils {
695
1144
  Anatoly Osovitny
696
1145
 
697
1146
  Created:
698
- 26 Jun 2020
1147
+ 3 March 2020
699
1148
 
700
1149
  Version:
701
1150
  1.0
@@ -703,20 +1152,91 @@ class Utils {
703
1152
  Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
704
1153
  </file>
705
1154
  */
706
- class Subs {
707
- constructor() {
708
- this.subs = [];
1155
+ class Alerts {
1156
+ static success(text, params, title, successAction) {
1157
+ text = Utils.getLocalizedValue(text, params, 'OperationSuccessFull');
1158
+ title = Utils.getLocalizedValue(title, null, 'Success');
1159
+ Swal.fire({
1160
+ text,
1161
+ title,
1162
+ icon: 'success',
1163
+ confirmButtonText: Utils.getLocalizedValue('Ok')
1164
+ })
1165
+ .then(() => {
1166
+ if (successAction) {
1167
+ successAction();
1168
+ }
1169
+ });
709
1170
  }
710
- add(...subscriptions) {
711
- this.subs = this.subs.concat(subscriptions);
1171
+ static info(text, params, title) {
1172
+ text = Utils.getLocalizedValue(text, params);
1173
+ title = Utils.getLocalizedValue(title, null, 'Info');
1174
+ Swal.fire({
1175
+ text,
1176
+ title,
1177
+ icon: 'info',
1178
+ confirmButtonText: Utils.getLocalizedValue('Ok')
1179
+ });
712
1180
  }
713
- set sink(subscription) {
714
- this.subs.push(subscription);
1181
+ static warning(text, params, title) {
1182
+ text = Utils.getLocalizedValue(text, params);
1183
+ title = Utils.getLocalizedValue(title, null, 'Warning');
1184
+ Swal.fire({
1185
+ text,
1186
+ title,
1187
+ icon: 'warning',
1188
+ confirmButtonText: Utils.getLocalizedValue('Ok')
1189
+ });
715
1190
  }
716
- unsubscribe() {
717
- this.subs.forEach((sub) => sub && sub.unsubscribe());
718
- this.subs = [];
1191
+ static error(text, params, title) {
1192
+ text = Utils.getLocalizedValue(text, params, 'ErrorOccured');
1193
+ title = Utils.getLocalizedValue(title, null, 'Error');
1194
+ Swal.fire({
1195
+ text,
1196
+ title,
1197
+ icon: 'error',
1198
+ confirmButtonText: Utils.getLocalizedValue('Ok')
1199
+ });
1200
+ }
1201
+ static cancel(text, params, title) {
1202
+ text = Utils.getLocalizedValue(text, params, 'OperationCancelled');
1203
+ title = Utils.getLocalizedValue(title, null, 'Cancelled');
1204
+ Swal.fire({
1205
+ text,
1206
+ title,
1207
+ icon: 'info'
1208
+ });
1209
+ }
1210
+ static notImplemented() {
1211
+ this.warning('Not Implemented Yet');
719
1212
  }
1213
+ ;
1214
+ static areYouSure(text, title, confirmButtonText, cancelButtonText, successAction, cancelAction) {
1215
+ text = Utils.getLocalizedValue(text);
1216
+ title = Utils.getLocalizedValue(title, null, 'AreYouSure');
1217
+ Swal.fire({
1218
+ text,
1219
+ title,
1220
+ icon: 'warning',
1221
+ confirmButtonText: Utils.getLocalizedValue(confirmButtonText),
1222
+ cancelButtonText: Utils.getLocalizedValue(cancelButtonText),
1223
+ showCancelButton: true
1224
+ })
1225
+ .then((result) => {
1226
+ if (result.value) {
1227
+ if (successAction) {
1228
+ successAction();
1229
+ }
1230
+ }
1231
+ // result.dismiss can be 'cancel', 'overlay', 'close', and 'timer'
1232
+ else if (result.dismiss == Swal.DismissReason.cancel || result.dismiss == Swal.DismissReason.close) {
1233
+ if (cancelAction) {
1234
+ cancelAction();
1235
+ }
1236
+ }
1237
+ });
1238
+ }
1239
+ ;
720
1240
  }
721
1241
 
722
1242
  /*
@@ -729,19 +1249,14 @@ class Subs {
729
1249
  Anatoly Osovitny
730
1250
 
731
1251
  Created:
732
- 26 Jun 2020
1252
+ 2 Jun 2020
733
1253
 
734
1254
  Version:
735
1255
  1.0
736
1256
 
737
1257
  Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
738
1258
  </file>
739
- */
740
- class Guid {
741
- static newGuid() {
742
- return v4();
743
- }
744
- }
1259
+ */
745
1260
 
746
1261
  /*
747
1262
  <file>
@@ -753,7 +1268,7 @@ class Guid {
753
1268
  Anatoly Osovitny
754
1269
 
755
1270
  Created:
756
- 17 Jun 2018
1271
+ 26 Jun 2020
757
1272
 
758
1273
  Version:
759
1274
  1.0
@@ -761,22 +1276,46 @@ class Guid {
761
1276
  Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
762
1277
  </file>
763
1278
  */
764
- class BaseGoService {
765
- constructor(route, router) {
766
- this.route = route;
767
- this.router = router;
1279
+ class IdleService {
1280
+ constructor() {
1281
+ this.expired$ = new Subject();
768
1282
  }
769
- locationReload() {
770
- //this.router.navigate([this.route.url]);
771
- window.location.reload();
1283
+ startWatching(timeOutSeconds) {
1284
+ this.idle$ = merge(fromEvent(document, "mousemove"), fromEvent(document, "click"), fromEvent(document, "mousedown"), fromEvent(document, "keypress"), fromEvent(document, "DOMMouseScroll"), fromEvent(document, "mousewheel"), fromEvent(document, "touchmove"), fromEvent(document, "MSPointerMove"), fromEvent(window, "mousemove"), fromEvent(window, "resize"));
1285
+ this.timeOutMilliSeconds = timeOutSeconds * 1000;
1286
+ this.idleSubscription = this.idle$.subscribe((res) => {
1287
+ this.resetTimer();
1288
+ });
1289
+ this.startTimer();
1290
+ return this.expired$;
1291
+ }
1292
+ startTimer() {
1293
+ this.timer$ = timer(this.timeOutMilliSeconds, this.timeOutMilliSeconds).subscribe((res) => {
1294
+ this.expired$.next(true);
1295
+ });
1296
+ }
1297
+ resetTimer() {
1298
+ this.timer$.unsubscribe();
1299
+ this.startTimer();
1300
+ }
1301
+ stopTimer() {
1302
+ this.timer$.unsubscribe();
1303
+ this.idleSubscription.unsubscribe();
1304
+ }
1305
+ restartIdleTimer() {
1306
+ this.timer$.unsubscribe();
1307
+ this.idleSubscription.unsubscribe();
1308
+ this.idleSubscription = this.idle$.subscribe((res) => {
1309
+ this.resetTimer();
1310
+ });
1311
+ this.startTimer();
772
1312
  }
773
1313
  }
774
- BaseGoService.decorators = [
775
- { type: Injectable }
776
- ];
777
- BaseGoService.ctorParameters = () => [
778
- { type: ActivatedRoute },
779
- { type: Router }
1314
+ IdleService.ɵprov = ɵɵdefineInjectable({ factory: function IdleService_Factory() { return new IdleService(); }, token: IdleService, providedIn: "root" });
1315
+ IdleService.decorators = [
1316
+ { type: Injectable, args: [{
1317
+ providedIn: "root",
1318
+ },] }
780
1319
  ];
781
1320
 
782
1321
  /*
@@ -797,122 +1336,48 @@ BaseGoService.ctorParameters = () => [
797
1336
  Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
798
1337
  </file>
799
1338
  */
800
- class GlobalErrorHandler {
801
- constructor(injector) {
802
- this.injector = injector;
1339
+ class WebStorageService {
1340
+ constructor(storage) {
1341
+ this.currentClientKey = AppCoreSettings.SERVICES_CONF.selectedClientID;
1342
+ this.storage =
1343
+ storage === 'local' || storage === 'localStorage'
1344
+ ? localStorage
1345
+ : sessionStorage;
803
1346
  }
804
- handleError(error) {
805
- const loggingService = this.injector.get(LoggingService);
806
- loggingService.logError(error);
807
- // IMPORTANT: Rethrow the error otherwise it gets swallowed
808
- throw error;
1347
+ setItem(key, value) {
1348
+ this.storage.setItem(this.currentClientKey + key, value);
809
1349
  }
810
- }
811
- GlobalErrorHandler.decorators = [
812
- { type: Injectable }
813
- ];
814
- GlobalErrorHandler.ctorParameters = () => [
815
- { type: Injector }
816
- ];
817
-
818
- /*
819
- <file>
820
- Project:
821
- @osovitny/anatoly
822
-
823
- Authors:
824
- Vadim Osovitny
825
- Anatoly Osovitny
826
-
827
- Created:
828
- 25 March 2020
829
-
830
- Version:
831
- 1.0
832
-
833
- Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
834
- </file>
835
- */
836
- class AnatolyHttpInterceptor {
837
- constructor(loadingService, loggingService) {
838
- this.loadingService = loadingService;
839
- this.loggingService = loggingService;
840
- this.longRunningExceptionsList = [];
841
- this.autoCDNSASTokenUrls = ['chunks', 'resources'];
842
- this.externalSiteUrls = ['azurewebsites.net'];
1350
+ setObject(key, value) {
1351
+ this.storage.setItem(this.currentClientKey + key, JSON.stringify(value));
843
1352
  }
844
- intercept(req, next) {
845
- const isCDNEnabled = AppCoreSettings.IsCDNEnabled;
846
- const cdnSasToken = AppCoreSettings.CDNSASToken;
847
- const isLoadingFreezed = this.loadingService.isFreezed;
848
- let loadingRequired = !isLoadingFreezed;
849
- const authorizationTokenRequired = true;
850
- const url = req.url.toLowerCase();
851
- const originalUrl = req.url;
852
- let isExternalSite = false;
853
- if (!isLoadingFreezed) {
854
- for (const i of this.longRunningExceptionsList) {
855
- if (url.indexOf(this.longRunningExceptionsList[i]) >= 0) {
856
- loadingRequired = false;
857
- break;
858
- }
859
- }
860
- }
861
- if (isCDNEnabled) {
862
- for (const i of this.autoCDNSASTokenUrls) {
863
- if (url.indexOf(this.autoCDNSASTokenUrls[i]) >= 0) {
864
- req = req.clone({ url: originalUrl + cdnSasToken });
865
- break;
866
- }
867
- }
868
- }
869
- for (const i of this.externalSiteUrls) {
870
- if (url.indexOf(this.externalSiteUrls[i]) >= 0) {
871
- isExternalSite = true;
872
- break;
873
- }
874
- }
875
- // VadimOS: IE11-fix
876
- if (url.indexOf('/api/') > -1) {
877
- let newUrl = '';
878
- const t = new Date().getTime().toString();
879
- if (url.indexOf('?') > -1) {
880
- newUrl = originalUrl + '&t=' + t;
881
- }
882
- else {
883
- newUrl = originalUrl + '?t=' + t;
884
- }
885
- req = req.clone({ url: newUrl });
886
- }
887
- req = req.clone({ headers: req.headers.set('Accept', 'application/json') });
888
- this.onRequestStart(loadingRequired);
889
- return next.handle(req).pipe(tap((event) => {
890
- if (event instanceof HttpResponse) {
891
- this.onRequestEnd(loadingRequired);
892
- }
893
- }, (err) => {
894
- this.onRequestEnd(loadingRequired);
895
- this.loggingService.logError(err);
896
- }));
1353
+ getItem(key) {
1354
+ return this.storage.getItem(this.currentClientKey + key);
897
1355
  }
898
- onRequestStart(loadingRequired) {
899
- if (loadingRequired) {
900
- this.loadingService.show();
901
- }
1356
+ getObject(key) {
1357
+ return JSON.parse(this.storage.getItem(this.currentClientKey + key) || '{}');
902
1358
  }
903
- onRequestEnd(loadingRequired) {
904
- if (loadingRequired) {
905
- this.loadingService.hide();
906
- }
1359
+ remove(key) {
1360
+ this.storage.removeItem(this.currentClientKey + key);
907
1361
  }
908
1362
  }
909
- AnatolyHttpInterceptor.decorators = [
1363
+ class LocalStorageService extends WebStorageService {
1364
+ constructor() {
1365
+ super('localStorage');
1366
+ }
1367
+ }
1368
+ LocalStorageService.decorators = [
910
1369
  { type: Injectable }
911
1370
  ];
912
- AnatolyHttpInterceptor.ctorParameters = () => [
913
- { type: LoadingService },
914
- { type: LoggingService }
915
- ];
1371
+ LocalStorageService.ctorParameters = () => [];
1372
+ class SessionStorageService extends WebStorageService {
1373
+ constructor() {
1374
+ super('sessionStorage');
1375
+ }
1376
+ }
1377
+ SessionStorageService.decorators = [
1378
+ { type: Injectable }
1379
+ ];
1380
+ SessionStorageService.ctorParameters = () => [];
916
1381
 
917
1382
  /*
918
1383
  <file>
@@ -931,7 +1396,22 @@ AnatolyHttpInterceptor.ctorParameters = () => [
931
1396
 
932
1397
  Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
933
1398
  </file>
934
- */
1399
+ */
1400
+ class Subs {
1401
+ constructor() {
1402
+ this.subs = [];
1403
+ }
1404
+ add(...subscriptions) {
1405
+ this.subs = this.subs.concat(subscriptions);
1406
+ }
1407
+ set sink(subscription) {
1408
+ this.subs.push(subscription);
1409
+ }
1410
+ unsubscribe() {
1411
+ this.subs.forEach((sub) => sub && sub.unsubscribe());
1412
+ this.subs = [];
1413
+ }
1414
+ }
935
1415
 
936
1416
  /*
937
1417
  <file>
@@ -1063,6 +1543,68 @@ BaseGridEditService.ctorParameters = () => [
1063
1543
  { type: HttpClient }
1064
1544
  ];
1065
1545
 
1546
+ /*
1547
+ <file>
1548
+ Project:
1549
+ @osovitny/anatoly
1550
+
1551
+ Authors:
1552
+ Vadim Osovitny
1553
+ Anatoly Osovitny
1554
+
1555
+ Created:
1556
+ 30 April 2020
1557
+
1558
+ Version:
1559
+ 1.0
1560
+
1561
+ Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
1562
+ </file>
1563
+ */
1564
+ const consts = {
1565
+ billingApiPath: 'api/billing',
1566
+ // Notifications API
1567
+ notificationsApiPath: 'api/notifications',
1568
+ };
1569
+
1570
+ /*
1571
+ <file>
1572
+ Project:
1573
+ @osovitny/anatoly
1574
+
1575
+ Authors:
1576
+ Vadim Osovitny
1577
+ Anatoly Osovitny
1578
+
1579
+ Created:
1580
+ 30 April 2020
1581
+
1582
+ Version:
1583
+ 1.0
1584
+
1585
+ Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
1586
+ </file>
1587
+ */
1588
+ class NotificationsApiService extends BaseApiService {
1589
+ constructor(http) {
1590
+ super(http);
1591
+ this.http = http;
1592
+ this.baseUrl = consts.notificationsApiPath;
1593
+ }
1594
+ retrieveNotifications() {
1595
+ return this.get('retrieveNotifications');
1596
+ }
1597
+ }
1598
+ NotificationsApiService.ɵprov = ɵɵdefineInjectable({ factory: function NotificationsApiService_Factory() { return new NotificationsApiService(ɵɵinject(HttpClient)); }, token: NotificationsApiService, providedIn: "root" });
1599
+ NotificationsApiService.decorators = [
1600
+ { type: Injectable, args: [{
1601
+ providedIn: 'root'
1602
+ },] }
1603
+ ];
1604
+ NotificationsApiService.ctorParameters = () => [
1605
+ { type: HttpClient }
1606
+ ];
1607
+
1066
1608
  /*
1067
1609
  <file>
1068
1610
  Project:
@@ -1085,12 +1627,10 @@ class BillingApiService extends BaseApiService {
1085
1627
  constructor(http) {
1086
1628
  super(http);
1087
1629
  this.http = http;
1088
- this.baseUrl += "billing/";
1630
+ this.baseUrl = consts.billingApiPath;
1089
1631
  }
1090
1632
  requestNewSubscription(requestedPlan, success, error) {
1091
- this.postQS("requestNewSubscription", {
1092
- requestedPlan: requestedPlan,
1093
- }).subscribe((data) => { }, (e) => {
1633
+ this.postQS("requestNewSubscription", { requestedPlan: requestedPlan }).subscribe((data) => { }, (e) => {
1094
1634
  if (error)
1095
1635
  error();
1096
1636
  }, () => {
@@ -1143,33 +1683,24 @@ BillingApiService.ctorParameters = () => [
1143
1683
  </file>
1144
1684
  */
1145
1685
  class AnatolyDataModule {
1686
+ constructor(parentModule) {
1687
+ throwIfAlreadyLoaded(parentModule, 'AnatolyDataModule');
1688
+ }
1146
1689
  }
1147
1690
  AnatolyDataModule.decorators = [
1148
1691
  { type: NgModule, args: [{
1149
- imports: [CommonModule],
1150
- providers: [BillingApiService],
1692
+ imports: [
1693
+ CommonModule
1694
+ ],
1695
+ providers: [
1696
+ BillingApiService
1697
+ ],
1151
1698
  },] }
1699
+ ];
1700
+ AnatolyDataModule.ctorParameters = () => [
1701
+ { type: AnatolyDataModule, decorators: [{ type: Optional }, { type: SkipSelf }] }
1152
1702
  ];
1153
1703
 
1154
- /*
1155
- <file>
1156
- Project:
1157
- @osovitny/anatoly
1158
-
1159
- Authors:
1160
- Vadim Osovitny
1161
- Anatoly Osovitny
1162
-
1163
- Created:
1164
- 4 Mar 2020
1165
-
1166
- Version:
1167
- 1.0
1168
-
1169
- Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
1170
- </file>
1171
- */
1172
-
1173
1704
  /*
1174
1705
  <file>
1175
1706
  Project:
@@ -1195,7 +1726,7 @@ class BuyAccessButtonComponent {
1195
1726
  this.contextUpdated = false;
1196
1727
  this.isUserSignedIn = false;
1197
1728
  this.currentPlan = 0;
1198
- this.currentPlanTitle = "";
1729
+ this.currentPlanTitle = '';
1199
1730
  }
1200
1731
  ngOnInit() {
1201
1732
  if (!this.appcontext.isUserSignedIn()) {
@@ -1214,9 +1745,9 @@ class BuyAccessButtonComponent {
1214
1745
  onBuyPlan() {
1215
1746
  const text = `Requested plan: ${this.plantitle} `;
1216
1747
  const that = this;
1217
- Alerts.AreYouSure(text, "Buying access", "Confirm change", "Cancel", () => {
1748
+ Alerts.areYouSure(text, 'Buying access', 'Confirm change', 'Cancel', () => {
1218
1749
  that.api.buyAccess(that.plan, () => {
1219
- Alerts.Success("Access Granted", null, () => {
1750
+ Alerts.success('Access Granted', null, null, () => {
1220
1751
  window.location.reload();
1221
1752
  });
1222
1753
  });
@@ -1225,7 +1756,7 @@ class BuyAccessButtonComponent {
1225
1756
  }
1226
1757
  BuyAccessButtonComponent.decorators = [
1227
1758
  { type: Component, args: [{
1228
- selector: "anatoly-buyaccess-button",
1759
+ selector: 'anatoly-buyaccess-button',
1229
1760
  template: "<div *ngIf=\"contextUpdated\">\r\n <div *ngIf=\"!isUserSignedIn\">\r\n <anatoly-signup-button classbtn=\"btn btn-block btn-primary\"></anatoly-signup-button>\r\n </div>\r\n\r\n <div *ngIf=\"isUserSignedIn\">\r\n <button class=\"btn btn-block btn-success selectPlan\" *ngIf=\"plan == currentPlan\">\r\n Your Plan\r\n </button>\r\n\r\n <button class=\"btn btn-block btn-warning selectPlan\" *ngIf=\"plan != currentPlan && currentPlan == 1\" (click)=\"onBuyPlan()\">\r\n Buy Now\r\n </button>\r\n </div>\r\n</div>\r\n"
1230
1761
  },] }
1231
1762
  ];
@@ -1323,9 +1854,9 @@ class UpgradePlanButtonComponent {
1323
1854
  onUpgradePlan() {
1324
1855
  const text = `Current plan: ${this.currentplantitle} New plan: ${this.requestedplantitle}`;
1325
1856
  const that = this;
1326
- Alerts.AreYouSure(text, "Change billing plan", "Confirm change", "Cancel", () => {
1857
+ Alerts.areYouSure(text, 'Change billing plan', 'Confirm change', 'Cancel', () => {
1327
1858
  that.api.requestNewSubscription(that.requestedplan, () => {
1328
- Alerts.Success("Your request for changing plan has been sent.", null, () => {
1859
+ Alerts.success('Your request for changing plan has been sent.', null, null, () => {
1329
1860
  window.location.reload();
1330
1861
  });
1331
1862
  });
@@ -1334,7 +1865,7 @@ class UpgradePlanButtonComponent {
1334
1865
  }
1335
1866
  UpgradePlanButtonComponent.decorators = [
1336
1867
  { type: Component, args: [{
1337
- selector: "anatoly-upgrade-plan-button",
1868
+ selector: 'anatoly-upgrade-plan-button',
1338
1869
  template: "<button class=\"btn btn-block btn-primary\" (click)=\"onUpgradePlan()\">\r\n Upgrade\r\n</button>\r\n"
1339
1870
  },] }
1340
1871
  ];
@@ -1357,7 +1888,7 @@ UpgradePlanButtonComponent.propDecorators = {
1357
1888
  Anatoly Osovitny
1358
1889
 
1359
1890
  Created:
1360
- 4 Jul 2018
1891
+ 23 Apr 2018
1361
1892
 
1362
1893
  Version:
1363
1894
  1.0
@@ -1365,18 +1896,21 @@ UpgradePlanButtonComponent.propDecorators = {
1365
1896
  Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
1366
1897
  </file>
1367
1898
  */
1368
- class SignInButtonComponent {
1369
- constructor() { }
1899
+ class ContentHeaderComponent {
1900
+ ngOnInit() {
1901
+ if (this.title == null) {
1902
+ this.title = "";
1903
+ }
1904
+ }
1370
1905
  }
1371
- SignInButtonComponent.decorators = [
1906
+ ContentHeaderComponent.decorators = [
1372
1907
  { type: Component, args: [{
1373
- selector: "anatoly-signin-button",
1374
- template: "<a href=\"identity/signIn\" class=\"{{classbtn}}\">Sign In</a>\r\n"
1908
+ selector: "anatoly-content-header",
1909
+ template: "<h2 class=\"page-header\">\r\n {{title}}\r\n <!--<small>Optional {{title}}</small>-->\r\n</h2>\r\n"
1375
1910
  },] }
1376
1911
  ];
1377
- SignInButtonComponent.ctorParameters = () => [];
1378
- SignInButtonComponent.propDecorators = {
1379
- classbtn: [{ type: Input }]
1912
+ ContentHeaderComponent.propDecorators = {
1913
+ title: [{ type: Input }]
1380
1914
  };
1381
1915
 
1382
1916
  /*
@@ -1389,7 +1923,7 @@ SignInButtonComponent.propDecorators = {
1389
1923
  Anatoly Osovitny
1390
1924
 
1391
1925
  Created:
1392
- 4 Jul 2018
1926
+ 12 Dec 2017
1393
1927
 
1394
1928
  Version:
1395
1929
  1.0
@@ -1397,83 +1931,75 @@ SignInButtonComponent.propDecorators = {
1397
1931
  Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
1398
1932
  </file>
1399
1933
  */
1400
- class SignOutButtonComponent {
1401
- constructor() { }
1402
- }
1403
- SignOutButtonComponent.decorators = [
1404
- { type: Component, args: [{
1405
- selector: "anatoly-signout-button",
1406
- template: "<a href=\"identity/signOut\" class=\"{{classbtn}}\">Sign Out</a>\r\n"
1407
- },] }
1408
- ];
1409
- SignOutButtonComponent.ctorParameters = () => [];
1410
- SignOutButtonComponent.propDecorators = {
1411
- classbtn: [{ type: Input }]
1412
- };
1413
-
1414
- /*
1415
- <file>
1416
- Project:
1417
- @osovitny/anatoly
1418
-
1419
- Authors:
1420
- Vadim Osovitny
1421
- Anatoly Osovitny
1422
-
1423
- Created:
1424
- 4 Jul 2018
1425
-
1426
- Version:
1427
- 1.0
1428
-
1429
- Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
1430
- </file>
1431
- */
1432
- class SignUpButtonComponent {
1433
- }
1434
- SignUpButtonComponent.decorators = [
1435
- { type: Component, args: [{
1436
- selector: "anatoly-signup-button",
1437
- template: "<a href=\"identity/signup\" class=\"{{classbtn}}\">Sign Up</a>\r\n"
1438
- },] }
1439
- ];
1440
- SignUpButtonComponent.propDecorators = {
1441
- classbtn: [{ type: Input }]
1442
- };
1443
-
1444
- /*
1445
- <file>
1446
- Project:
1447
- @osovitny/anatoly
1448
-
1449
- Authors:
1450
- Vadim Osovitny
1451
- Anatoly Osovitny
1452
-
1453
- Created:
1454
- 23 Apr 2018
1455
-
1456
- Version:
1457
- 1.0
1458
-
1459
- Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
1460
- </file>
1461
- */
1462
- class ContentHeaderComponent {
1463
- ngOnInit() {
1464
- if (this.title == null) {
1465
- this.title = "";
1466
- }
1467
- }
1468
- }
1469
- ContentHeaderComponent.decorators = [
1470
- { type: Component, args: [{
1471
- selector: "anatoly-content-header",
1472
- template: "<h2 class=\"page-header\">\r\n {{title}}\r\n <!--<small>Optional {{title}}</small>-->\r\n</h2>\r\n"
1473
- },] }
1474
- ];
1475
- ContentHeaderComponent.propDecorators = {
1476
- title: [{ type: Input }]
1934
+ const DefaultEditorOptions = {
1935
+ placeholderText: "Edit Your Content Here",
1936
+ charCounterCount: true,
1937
+ heightMin: 100,
1938
+ toolbarInline: false,
1939
+ toolbarButtons: {
1940
+ moreText: {
1941
+ buttons: [
1942
+ "bold",
1943
+ "italic",
1944
+ "underline",
1945
+ "strikeThrough",
1946
+ "subscript",
1947
+ "superscript",
1948
+ "fontFamily",
1949
+ "fontSize",
1950
+ "textColor",
1951
+ "backgroundColor",
1952
+ "inlineClass",
1953
+ "inlineStyle",
1954
+ ],
1955
+ },
1956
+ moreParagraph: {
1957
+ buttons: [
1958
+ "alignLeft",
1959
+ "alignCenter",
1960
+ "formatOLSimple",
1961
+ "alignRight",
1962
+ "alignJustify",
1963
+ "formatOL",
1964
+ "formatUL",
1965
+ "paragraphFormat",
1966
+ "paragraphStyle",
1967
+ "lineHeight",
1968
+ "outdent",
1969
+ "indent",
1970
+ "quote",
1971
+ ],
1972
+ },
1973
+ moreRich: {
1974
+ buttons: [
1975
+ "insertLink",
1976
+ "insertImage",
1977
+ "insertTable",
1978
+ "emoticons",
1979
+ "fontAwesome",
1980
+ "specialCharacters",
1981
+ "embedly",
1982
+ ],
1983
+ },
1984
+ moreMisc: {
1985
+ buttons: [
1986
+ "selectAll",
1987
+ "clearFormatting",
1988
+ "html",
1989
+ "undo",
1990
+ "redo",
1991
+ "fullscreen",
1992
+ ],
1993
+ align: "right",
1994
+ },
1995
+ },
1996
+ /*
1997
+ Upload:
1998
+ https://www.froala.com/wysiwyg-editor/docs/concepts/image/upload
1999
+ */
2000
+ imageUploadURL: "/api/HtmlEditor/UploadImage",
2001
+ imageAllowedTypes: ["jpeg", "jpg", "png"],
2002
+ imageUploadParams: { uploadType: "", uploadParentId: "" },
1477
2003
  };
1478
2004
 
1479
2005
  /*
@@ -1593,75 +2119,263 @@ BaseEditComponent.propDecorators = {
1593
2119
  Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
1594
2120
  </file>
1595
2121
  */
1596
- const DefaultEditorOptions = {
1597
- placeholderText: "Edit Your Content Here",
1598
- charCounterCount: true,
1599
- heightMin: 100,
1600
- toolbarInline: false,
1601
- toolbarButtons: {
1602
- moreText: {
1603
- buttons: [
1604
- "bold",
1605
- "italic",
1606
- "underline",
1607
- "strikeThrough",
1608
- "subscript",
1609
- "superscript",
1610
- "fontFamily",
1611
- "fontSize",
1612
- "textColor",
1613
- "backgroundColor",
1614
- "inlineClass",
1615
- "inlineStyle",
1616
- ],
1617
- },
1618
- moreParagraph: {
1619
- buttons: [
1620
- "alignLeft",
1621
- "alignCenter",
1622
- "formatOLSimple",
1623
- "alignRight",
1624
- "alignJustify",
1625
- "formatOL",
1626
- "formatUL",
1627
- "paragraphFormat",
1628
- "paragraphStyle",
1629
- "lineHeight",
1630
- "outdent",
1631
- "indent",
1632
- "quote",
1633
- ],
1634
- },
1635
- moreRich: {
1636
- buttons: [
1637
- "insertLink",
1638
- "insertImage",
1639
- "insertTable",
1640
- "emoticons",
1641
- "fontAwesome",
1642
- "specialCharacters",
1643
- "embedly",
1644
- ],
1645
- },
1646
- moreMisc: {
1647
- buttons: [
1648
- "selectAll",
1649
- "clearFormatting",
1650
- "html",
1651
- "undo",
1652
- "redo",
1653
- "fullscreen",
1654
- ],
1655
- align: "right",
1656
- },
1657
- },
1658
- /*
1659
- Upload:
1660
- https://www.froala.com/wysiwyg-editor/docs/concepts/image/upload
1661
- */
1662
- imageUploadURL: "/api/HtmlEditor/UploadImage",
1663
- imageAllowedTypes: ["jpeg", "jpg", "png"],
1664
- imageUploadParams: { uploadType: "", uploadParentId: "" },
2122
+ class BaseHtmlEditorComponent extends BaseEditComponent {
2123
+ constructor() {
2124
+ super();
2125
+ this.froalaEditorInitialized = false;
2126
+ this.afterInitializedActions = [];
2127
+ // Inputs
2128
+ this.editorLabelText = 'Html';
2129
+ this.editorOptions = {};
2130
+ }
2131
+ ngOnInit() {
2132
+ let opt = this.editorOptions;
2133
+ if (typeof this.editorOptions == 'string') {
2134
+ opt = JSON.parse(this.editorOptions);
2135
+ }
2136
+ let newOptions = $.extend({}, DefaultEditorOptions, opt);
2137
+ const key = AppCoreSettings.froalaEditorKey;
2138
+ if (key) {
2139
+ newOptions = $.extend({}, newOptions, JSON.parse('{ "key": "' + key + '" }'));
2140
+ }
2141
+ if (newOptions.events && newOptions.events.initialized) {
2142
+ newOptions.events.initialized.overridden = false;
2143
+ }
2144
+ this.options = newOptions;
2145
+ }
2146
+ ngAfterViewInit() {
2147
+ const that = this;
2148
+ setTimeout(function () {
2149
+ that.froalaEditorInitialized = true;
2150
+ that.onInitialized();
2151
+ }, 300);
2152
+ }
2153
+ onInitialized() {
2154
+ const actions = this.afterInitializedActions;
2155
+ // Clear actions
2156
+ this.afterInitializedActions = [];
2157
+ if (actions) {
2158
+ for (let i = 0; i < actions.length; i++) {
2159
+ actions[i]();
2160
+ }
2161
+ }
2162
+ }
2163
+ getEditor() {
2164
+ if (this.froalaEditor)
2165
+ return this.froalaEditor.getEditor();
2166
+ return null;
2167
+ }
2168
+ // Public Funcs
2169
+ doAfterInitialized(action) {
2170
+ const that = this;
2171
+ if (!this.froalaEditorInitialized) {
2172
+ this.afterInitializedActions.push(() => {
2173
+ action(that);
2174
+ });
2175
+ }
2176
+ else {
2177
+ action(that);
2178
+ }
2179
+ }
2180
+ initializeControl(control) {
2181
+ this.froalaEditor = control;
2182
+ this.froalaEditor.initialize();
2183
+ }
2184
+ setUploadParams(uploadType, uploadParentId) {
2185
+ this.doAfterInitialized(function (that) {
2186
+ const editor = that.getEditor();
2187
+ if (typeof editor == 'undefined' || editor == null) {
2188
+ return;
2189
+ }
2190
+ editor.opts.imageUploadParams.uploadType = uploadType;
2191
+ editor.opts.imageUploadParams.uploadParentId = uploadParentId;
2192
+ });
2193
+ }
2194
+ }
2195
+ BaseHtmlEditorComponent.propDecorators = {
2196
+ editorLabelText: [{ type: Input }],
2197
+ editorOptions: [{ type: Input }]
2198
+ };
2199
+
2200
+ /*
2201
+ <file>
2202
+ Project:
2203
+ @osovitny/anatoly
2204
+
2205
+ Authors:
2206
+ Vadim Osovitny
2207
+ Anatoly Osovitny
2208
+
2209
+ Created:
2210
+ 12 Dec 2017
2211
+
2212
+ Version:
2213
+ 1.0
2214
+
2215
+ Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
2216
+ </file>
2217
+ */
2218
+ class FormsHtmlEditorComponent extends BaseHtmlEditorComponent {
2219
+ constructor() {
2220
+ super();
2221
+ this.editorFormKey = "html";
2222
+ }
2223
+ setFormValueAfterInitialized(name, value) {
2224
+ this.doAfterInitialized(function (that) {
2225
+ that.setFormValue(name, value);
2226
+ });
2227
+ }
2228
+ }
2229
+ FormsHtmlEditorComponent.decorators = [
2230
+ { type: Component, args: [{
2231
+ selector: "anatoly-forms-html-editor",
2232
+ template: "<div [formGroup]=\"formGroup\">\r\n <div class=\"form-group\" [ngClass]=\"{'has-error': isControlInvalid(editorFormKey) }\">\r\n <label class=\"control-label\">{{ editorLabelText }}</label>\r\n <textarea [formControlName]=\"editorFormKey\"\r\n [froalaEditor]=\"options\" (froalaInit)=\"initializeControl($event)\">\r\n </textarea>\r\n <anatoly-item-validation-summary [formGroup]=\"formGroup\"\r\n [formSubmitted]=\"formSubmitted\"\r\n [controlName]=\"editorFormKey\"\r\n [controlTitle]=\"editorLabelText\">\r\n </anatoly-item-validation-summary>\r\n </div>\r\n</div>\r\n"
2233
+ },] }
2234
+ ];
2235
+ FormsHtmlEditorComponent.ctorParameters = () => [];
2236
+ FormsHtmlEditorComponent.propDecorators = {
2237
+ editorFormKey: [{ type: Input }]
2238
+ };
2239
+
2240
+ /*
2241
+ <file>
2242
+ Project:
2243
+ @osovitny/anatoly
2244
+
2245
+ Authors:
2246
+ Vadim Osovitny
2247
+ Anatoly Osovitny
2248
+
2249
+ Created:
2250
+ 12 Dec 2017
2251
+
2252
+ Version:
2253
+ 1.0
2254
+
2255
+ Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
2256
+ </file>
2257
+ */
2258
+ class HtmlEditorComponent extends BaseHtmlEditorComponent {
2259
+ constructor() {
2260
+ super();
2261
+ }
2262
+ setHtml(content) {
2263
+ this.doAfterInitialized(function (that) {
2264
+ var editor = that.getEditor();
2265
+ if (typeof editor == "undefined" || editor == null) {
2266
+ return;
2267
+ }
2268
+ editor.html.set(content);
2269
+ });
2270
+ }
2271
+ getHtml() {
2272
+ var editor = this.getEditor();
2273
+ if (typeof editor == "undefined" || editor == null) {
2274
+ return;
2275
+ }
2276
+ return editor.html.get(false);
2277
+ }
2278
+ }
2279
+ HtmlEditorComponent.decorators = [
2280
+ { type: Component, args: [{
2281
+ selector: "anatoly-html-editor",
2282
+ template: "<div>\r\n <label>{{ editorLabelText }}</label>\r\n <textarea [froalaEditor]=\"options\" (froalaInit)=\"initializeControl($event)\">\r\n </textarea>\r\n</div>"
2283
+ },] }
2284
+ ];
2285
+ HtmlEditorComponent.ctorParameters = () => [];
2286
+
2287
+ /*
2288
+ <file>
2289
+ Project:
2290
+ @osovitny/anatoly
2291
+
2292
+ Authors:
2293
+ Vadim Osovitny
2294
+ Anatoly Osovitny
2295
+
2296
+ Created:
2297
+ 4 Jul 2018
2298
+
2299
+ Version:
2300
+ 1.0
2301
+
2302
+ Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
2303
+ </file>
2304
+ */
2305
+ class SignInButtonComponent {
2306
+ constructor() { }
2307
+ }
2308
+ SignInButtonComponent.decorators = [
2309
+ { type: Component, args: [{
2310
+ selector: "anatoly-signin-button",
2311
+ template: "<a href=\"identity/signIn\" class=\"{{classbtn}}\">Sign In</a>\r\n"
2312
+ },] }
2313
+ ];
2314
+ SignInButtonComponent.ctorParameters = () => [];
2315
+ SignInButtonComponent.propDecorators = {
2316
+ classbtn: [{ type: Input }]
2317
+ };
2318
+
2319
+ /*
2320
+ <file>
2321
+ Project:
2322
+ @osovitny/anatoly
2323
+
2324
+ Authors:
2325
+ Vadim Osovitny
2326
+ Anatoly Osovitny
2327
+
2328
+ Created:
2329
+ 4 Jul 2018
2330
+
2331
+ Version:
2332
+ 1.0
2333
+
2334
+ Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
2335
+ </file>
2336
+ */
2337
+ class SignOutButtonComponent {
2338
+ constructor() { }
2339
+ }
2340
+ SignOutButtonComponent.decorators = [
2341
+ { type: Component, args: [{
2342
+ selector: "anatoly-signout-button",
2343
+ template: "<a href=\"identity/signOut\" class=\"{{classbtn}}\">Sign Out</a>\r\n"
2344
+ },] }
2345
+ ];
2346
+ SignOutButtonComponent.ctorParameters = () => [];
2347
+ SignOutButtonComponent.propDecorators = {
2348
+ classbtn: [{ type: Input }]
2349
+ };
2350
+
2351
+ /*
2352
+ <file>
2353
+ Project:
2354
+ @osovitny/anatoly
2355
+
2356
+ Authors:
2357
+ Vadim Osovitny
2358
+ Anatoly Osovitny
2359
+
2360
+ Created:
2361
+ 4 Jul 2018
2362
+
2363
+ Version:
2364
+ 1.0
2365
+
2366
+ Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
2367
+ </file>
2368
+ */
2369
+ class SignUpButtonComponent {
2370
+ }
2371
+ SignUpButtonComponent.decorators = [
2372
+ { type: Component, args: [{
2373
+ selector: "anatoly-signup-button",
2374
+ template: "<a href=\"identity/signup\" class=\"{{classbtn}}\">Sign Up</a>\r\n"
2375
+ },] }
2376
+ ];
2377
+ SignUpButtonComponent.propDecorators = {
2378
+ classbtn: [{ type: Input }]
1665
2379
  };
1666
2380
 
1667
2381
  /*
@@ -1674,7 +2388,7 @@ const DefaultEditorOptions = {
1674
2388
  Anatoly Osovitny
1675
2389
 
1676
2390
  Created:
1677
- 12 Dec 2017
2391
+ 9 May 2020
1678
2392
 
1679
2393
  Version:
1680
2394
  1.0
@@ -1682,82 +2396,100 @@ const DefaultEditorOptions = {
1682
2396
  Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
1683
2397
  </file>
1684
2398
  */
1685
- class BaseHtmlEditorComponent extends BaseEditComponent {
1686
- constructor() {
1687
- super();
1688
- this.froalaEditorInitialized = false;
1689
- this.afterInitializedActions = [];
1690
- //Inputs
1691
- this.editorLabelText = "Html";
1692
- this.editorOptions = {};
2399
+ class LoadingComponent {
2400
+ constructor(loadingService) {
2401
+ this.loadingService = loadingService;
2402
+ // Private
2403
+ this.subs = new Subs();
2404
+ // Public
2405
+ this.show = false;
1693
2406
  }
1694
2407
  ngOnInit() {
1695
- let opt = this.editorOptions;
1696
- if (typeof this.editorOptions == "string") {
1697
- opt = JSON.parse(this.editorOptions);
1698
- }
1699
- let newOptions = $.extend({}, DefaultEditorOptions, opt);
1700
- let key = AppCoreSettings.froalaEditorKey;
1701
- if (key) {
1702
- newOptions = $.extend({}, newOptions, JSON.parse('{ "key": "' + key + '" }'));
1703
- }
1704
- if (newOptions.events && newOptions.events.initialized) {
1705
- newOptions.events.initialized.overridden = false;
1706
- }
1707
- this.options = newOptions;
2408
+ this.subs.sink = this.loadingService.subscribe((state) => {
2409
+ this.show = state;
2410
+ });
1708
2411
  }
1709
- ngAfterViewInit() {
1710
- let that = this;
1711
- setTimeout(function () {
1712
- that.froalaEditorInitialized = true;
1713
- that.onInitialized();
1714
- }, 300);
2412
+ ngOnDestroy() {
2413
+ this.subs.unsubscribe();
1715
2414
  }
1716
- onInitialized() {
1717
- let actions = this.afterInitializedActions;
1718
- //Clear actions
1719
- this.afterInitializedActions = [];
1720
- if (actions) {
1721
- for (var i = 0; i < actions.length; i++) {
1722
- actions[i]();
2415
+ }
2416
+ LoadingComponent.decorators = [
2417
+ { type: Component, args: [{
2418
+ selector: 'anatoly-loading',
2419
+ template: "<div *ngIf=\"show\">\r\n <span id=\"pnlLoading\" class=\"k-icon k-i-loading\"></span>\r\n</div>\r\n"
2420
+ },] }
2421
+ ];
2422
+ LoadingComponent.ctorParameters = () => [
2423
+ { type: LoadingService }
2424
+ ];
2425
+
2426
+ /*
2427
+ <file>
2428
+ Project:
2429
+ @osovitny/anatoly
2430
+
2431
+ Authors:
2432
+ Vadim Osovitny
2433
+ Anatoly Osovitny
2434
+
2435
+ Created:
2436
+ 16 May 2020
2437
+
2438
+ Version:
2439
+ 1.0
2440
+
2441
+ Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
2442
+ </file>
2443
+ */
2444
+ const SpinnerSpinKit = {
2445
+ spinnerLine: 'spinner-line-material',
2446
+ // ToDo
2447
+ ChasingDots: 'spinner-chasing-dots',
2448
+ CubeGrid: 'spinner-cube-grid',
2449
+ DoubleBounce: 'spinner-double-bounce',
2450
+ RotatingPlane: 'spinner-rotationg-plane',
2451
+ SpinnerPulse: 'spinner-spinner-pulse',
2452
+ ThreeBounce: 'spinner-three-bounce',
2453
+ WanderingCubes: 'spinner-wandering-cubes',
2454
+ Wave: 'spinner-wave'
2455
+ };
2456
+ class SpinnerComponent {
2457
+ constructor(router, document) {
2458
+ this.router = router;
2459
+ this.document = document;
2460
+ this.isSpinnerVisible = true;
2461
+ this.spinnerSpinKit = SpinnerSpinKit;
2462
+ this.backgroundColor = '#007CB0';
2463
+ this.spinner = SpinnerSpinKit.spinnerLine;
2464
+ this.router.events.subscribe(event => {
2465
+ if (event instanceof NavigationStart) {
2466
+ this.isSpinnerVisible = true;
1723
2467
  }
1724
- }
1725
- }
1726
- getEditor() {
1727
- if (this.froalaEditor)
1728
- return this.froalaEditor.getEditor();
1729
- return null;
1730
- }
1731
- //Public Funcs
1732
- doAfterInitialized(action) {
1733
- let that = this;
1734
- if (!this.froalaEditorInitialized) {
1735
- this.afterInitializedActions.push(() => {
1736
- action(that);
1737
- });
1738
- }
1739
- else {
1740
- action(that);
1741
- }
1742
- }
1743
- initializeControl(control) {
1744
- this.froalaEditor = control;
1745
- this.froalaEditor.initialize();
1746
- }
1747
- setUploadParams(uploadType, uploadParentId) {
1748
- this.doAfterInitialized(function (that) {
1749
- var editor = that.getEditor();
1750
- if (typeof editor == "undefined" || editor == null) {
1751
- return;
2468
+ else if (event instanceof NavigationEnd || event instanceof NavigationCancel || event instanceof NavigationError) {
2469
+ this.isSpinnerVisible = false;
1752
2470
  }
1753
- editor.opts.imageUploadParams.uploadType = uploadType;
1754
- editor.opts.imageUploadParams.uploadParentId = uploadParentId;
2471
+ }, () => {
2472
+ this.isSpinnerVisible = false;
1755
2473
  });
1756
2474
  }
2475
+ ngOnDestroy() {
2476
+ this.isSpinnerVisible = false;
2477
+ }
1757
2478
  }
1758
- BaseHtmlEditorComponent.propDecorators = {
1759
- editorLabelText: [{ type: Input }],
1760
- editorOptions: [{ type: Input }]
2479
+ SpinnerComponent.decorators = [
2480
+ { type: Component, args: [{
2481
+ selector: 'spinner',
2482
+ template: "<div id=\"spinner-loader\" *ngIf=\"isSpinnerVisible\">\r\n <div class=\"loader-bg\">\r\n <div class=\"spinner-line-material\" [class.colored]=\"!backgroundColor\" *ngIf=\"spinner === spinnerSpinKit.spinnerLine\">\r\n <div class=\"spinner-child spinner-bounce1\" [style.background-color]='backgroundColor'></div>\r\n </div>\r\n </div>\r\n</div>\r\n",
2483
+ encapsulation: ViewEncapsulation.None
2484
+ },] }
2485
+ ];
2486
+ SpinnerComponent.ctorParameters = () => [
2487
+ { type: Router },
2488
+ { type: Document, decorators: [{ type: Inject, args: [DOCUMENT,] }] }
2489
+ ];
2490
+ SpinnerComponent.propDecorators = {
2491
+ backgroundColor: [{ type: Input }],
2492
+ spinner: [{ type: Input }]
1761
2493
  };
1762
2494
 
1763
2495
  /*
@@ -1770,7 +2502,7 @@ BaseHtmlEditorComponent.propDecorators = {
1770
2502
  Anatoly Osovitny
1771
2503
 
1772
2504
  Created:
1773
- 12 Dec 2017
2505
+ 28 Jun 2020
1774
2506
 
1775
2507
  Version:
1776
2508
  1.0
@@ -1778,34 +2510,59 @@ BaseHtmlEditorComponent.propDecorators = {
1778
2510
  Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
1779
2511
  </file>
1780
2512
  */
1781
- class HtmlEditorComponent extends BaseHtmlEditorComponent {
1782
- constructor() {
1783
- super();
2513
+ class NativeElementDirective {
2514
+ constructor(el, control) {
2515
+ this.el = el;
2516
+ this.control = control;
1784
2517
  }
1785
- setHtml(content) {
1786
- this.doAfterInitialized(function (that) {
1787
- var editor = that.getEditor();
1788
- if (typeof editor == "undefined" || editor == null) {
1789
- return;
1790
- }
1791
- editor.html.set(content);
1792
- });
2518
+ ngOnInit() {
2519
+ // sets the localization key to the control
2520
+ this.control.control.nativeElement = this.el.nativeElement;
1793
2521
  }
1794
- getHtml() {
1795
- var editor = this.getEditor();
1796
- if (typeof editor == "undefined" || editor == null) {
1797
- return;
2522
+ }
2523
+ NativeElementDirective.decorators = [
2524
+ { type: Directive, args: [{
2525
+ selector: '[formControl], [formControlName]'
2526
+ },] }
2527
+ ];
2528
+ NativeElementDirective.ctorParameters = () => [
2529
+ { type: ElementRef },
2530
+ { type: NgControl }
2531
+ ];
2532
+
2533
+ /*
2534
+ <file>
2535
+ Project:
2536
+ @osovitny/anatoly
2537
+
2538
+ Authors:
2539
+ Vadim Osovitny
2540
+ Anatoly Osovitny
2541
+
2542
+ Created:
2543
+ 26 Jun 2020
2544
+
2545
+ Version:
2546
+ 1.0
2547
+
2548
+ Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
2549
+ </file>
2550
+ */
2551
+ class ReplaceTextPipe {
2552
+ transform(inputData, search, replacement) {
2553
+ if (inputData) {
2554
+ return inputData.replace(new RegExp(search, "g"), replacement);
2555
+ }
2556
+ else {
2557
+ return inputData;
1798
2558
  }
1799
- return editor.html.get(false);
1800
2559
  }
1801
2560
  }
1802
- HtmlEditorComponent.decorators = [
1803
- { type: Component, args: [{
1804
- selector: "anatoly-html-editor",
1805
- template: "<div>\r\n <label>{{ editorLabelText }}</label>\r\n <textarea [froalaEditor]=\"options\" (froalaInit)=\"initializeControl($event)\">\r\n </textarea>\r\n</div>"
2561
+ ReplaceTextPipe.decorators = [
2562
+ { type: Pipe, args: [{
2563
+ name: "replaceText",
1806
2564
  },] }
1807
- ];
1808
- HtmlEditorComponent.ctorParameters = () => [];
2565
+ ];
1809
2566
 
1810
2567
  /*
1811
2568
  <file>
@@ -1817,7 +2574,7 @@ HtmlEditorComponent.ctorParameters = () => [];
1817
2574
  Anatoly Osovitny
1818
2575
 
1819
2576
  Created:
1820
- 12 Dec 2017
2577
+ 26 Jun 2020
1821
2578
 
1822
2579
  Version:
1823
2580
  1.0
@@ -1825,27 +2582,59 @@ HtmlEditorComponent.ctorParameters = () => [];
1825
2582
  Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
1826
2583
  </file>
1827
2584
  */
1828
- class FormsHtmlEditorComponent extends BaseHtmlEditorComponent {
2585
+ class FileSizePipe {
1829
2586
  constructor() {
1830
- super();
1831
- this.editorFormKey = "html";
1832
- }
1833
- setFormValueAfterInitialized(name, value) {
1834
- this.doAfterInitialized(function (that) {
1835
- that.setFormValue(name, value);
1836
- });
2587
+ this.units = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB'];
2588
+ }
2589
+ transform(bytes = 0, precision = 0) {
2590
+ if (isNaN(parseFloat(String(bytes))) || !isFinite(bytes))
2591
+ return '';
2592
+ let unit = 0;
2593
+ while (bytes >= 1024) {
2594
+ bytes /= 1024;
2595
+ unit++;
2596
+ }
2597
+ return bytes.toFixed(+precision) + ' ' + this.units[unit];
1837
2598
  }
1838
2599
  }
1839
- FormsHtmlEditorComponent.decorators = [
1840
- { type: Component, args: [{
1841
- selector: "anatoly-forms-html-editor",
1842
- template: "<div [formGroup]=\"formGroup\">\r\n <div class=\"form-group\" [ngClass]=\"{'has-error': isControlInvalid(editorFormKey) }\">\r\n <label class=\"control-label\">{{ editorLabelText }}</label>\r\n <textarea [formControlName]=\"editorFormKey\"\r\n [froalaEditor]=\"options\" (froalaInit)=\"initializeControl($event)\">\r\n </textarea>\r\n <anatoly-item-validation-summary [formGroup]=\"formGroup\"\r\n [formSubmitted]=\"formSubmitted\"\r\n [controlName]=\"editorFormKey\"\r\n [controlTitle]=\"editorLabelText\">\r\n </anatoly-item-validation-summary>\r\n </div>\r\n</div>\r\n"
2600
+ FileSizePipe.decorators = [
2601
+ { type: Pipe, args: [{
2602
+ name: 'filesize',
1843
2603
  },] }
2604
+ ];
2605
+
2606
+ /*
2607
+ <file>
2608
+ Project:
2609
+ @osovitny/anatoly
2610
+
2611
+ Authors:
2612
+ Vadim Osovitny
2613
+ Anatoly Osovitny
2614
+
2615
+ Created:
2616
+ 27 Oct 2019
2617
+
2618
+ Version:
2619
+ 1.0
2620
+
2621
+ Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
2622
+ </file>
2623
+ */
2624
+ class SafeHtmlPipe {
2625
+ constructor(sanitized) {
2626
+ this.sanitized = sanitized;
2627
+ }
2628
+ transform(value) {
2629
+ return this.sanitized.bypassSecurityTrustHtml(value);
2630
+ }
2631
+ }
2632
+ SafeHtmlPipe.decorators = [
2633
+ { type: Pipe, args: [{ name: 'safeHtml' },] }
1844
2634
  ];
1845
- FormsHtmlEditorComponent.ctorParameters = () => [];
1846
- FormsHtmlEditorComponent.propDecorators = {
1847
- editorFormKey: [{ type: Input }]
1848
- };
2635
+ SafeHtmlPipe.ctorParameters = () => [
2636
+ { type: DomSanitizer }
2637
+ ];
1849
2638
 
1850
2639
  /*
1851
2640
  <file>
@@ -2058,44 +2847,6 @@ ItemValidationSummaryComponent.propDecorators = {
2058
2847
  controlTitle: [{ type: Input }]
2059
2848
  };
2060
2849
 
2061
- /*
2062
- <file>
2063
- Project:
2064
- @osovitny/anatoly
2065
-
2066
- Authors:
2067
- Vadim Osovitny
2068
- Anatoly Osovitny
2069
-
2070
- Created:
2071
- 28 Jun 2020
2072
-
2073
- Version:
2074
- 1.0
2075
-
2076
- Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
2077
- </file>
2078
- */
2079
- class NativeElementDirective {
2080
- constructor(el, control) {
2081
- this.el = el;
2082
- this.control = control;
2083
- }
2084
- ngOnInit() {
2085
- // sets the localization key to the control
2086
- this.control.control.nativeElement = this.el.nativeElement;
2087
- }
2088
- }
2089
- NativeElementDirective.decorators = [
2090
- { type: Directive, args: [{
2091
- selector: '[formControl], [formControlName]'
2092
- },] }
2093
- ];
2094
- NativeElementDirective.ctorParameters = () => [
2095
- { type: ElementRef },
2096
- { type: NgControl }
2097
- ];
2098
-
2099
2850
  /*
2100
2851
  <file>
2101
2852
  Project:
@@ -2139,8 +2890,12 @@ AnatolyUIModule.decorators = [
2139
2890
  HtmlEditorComponent,
2140
2891
  FormsHtmlEditorComponent,
2141
2892
  ContentHeaderComponent,
2142
- // Directives
2143
- NativeElementDirective
2893
+ SpinnerComponent,
2894
+ LoadingComponent,
2895
+ NativeElementDirective,
2896
+ SafeHtmlPipe,
2897
+ ReplaceTextPipe,
2898
+ FileSizePipe
2144
2899
  ],
2145
2900
  declarations: [
2146
2901
  SubscribePlanButtonComponent,
@@ -2154,31 +2909,16 @@ AnatolyUIModule.decorators = [
2154
2909
  HtmlEditorComponent,
2155
2910
  FormsHtmlEditorComponent,
2156
2911
  ContentHeaderComponent,
2157
- // Directives
2158
- NativeElementDirective
2912
+ SpinnerComponent,
2913
+ LoadingComponent,
2914
+ NativeElementDirective,
2915
+ SafeHtmlPipe,
2916
+ ReplaceTextPipe,
2917
+ FileSizePipe
2159
2918
  ]
2160
2919
  },] }
2161
2920
  ];
2162
2921
 
2163
- /*
2164
- <file>
2165
- Project:
2166
- @osovitny/anatoly
2167
-
2168
- Authors:
2169
- Vadim Osovitny
2170
- Anatoly Osovitny
2171
-
2172
- Created:
2173
- 26 Jun 2020
2174
-
2175
- Version:
2176
- 1.0
2177
-
2178
- Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
2179
- </file>
2180
- */
2181
-
2182
2922
  /*
2183
2923
  * Public API Surface of anatoly
2184
2924
  */
@@ -2187,5 +2927,5 @@ AnatolyUIModule.decorators = [
2187
2927
  * Generated bundle index. Do not edit.
2188
2928
  */
2189
2929
 
2190
- export { Alerts, AnatolyCoreModule, AnatolyDataModule, AnatolyHttpInterceptor, AnatolyUIModule, AppContextService, AppCoreSettings, BaseApiService, BaseComponent, BaseEditComponent, BaseGoService, BaseGridEditService, BaseGridReadService, BillingApiService, BuyAccessButtonComponent, ContentHeaderComponent, ContextInitState, FormValidationSummaryComponent, FormsHtmlEditorComponent, GlobalErrorHandler, Guid, HtmlEditorComponent, ItemValidationSummaryComponent, LoadingService, LoggingService, NativeElementDirective, SignInButtonComponent, SignOutButtonComponent, SignUpButtonComponent, Subs, SubscribePlanButtonComponent, UpgradePlanButtonComponent, Utils, ValidationSummaryComponent, throwIfAlreadyLoaded };
2930
+ 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 };
2191
2931
  //# sourceMappingURL=osovitny-anatoly.js.map