@osovitny/anatoly 2.1.14 → 2.14.1

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 (161) hide show
  1. package/assets/styles/alerts.less +182 -0
  2. package/assets/styles/spinner.less +64 -0
  3. package/assets/styles/toastr.less +192 -0
  4. package/esm2020/lib/core/core.module.mjs +72 -0
  5. package/esm2020/lib/core/go/base-go.service.mjs +41 -0
  6. package/esm2020/lib/core/interceptors/httpInterceptor.mjs +108 -0
  7. package/esm2020/lib/core/localization/localization.module.mjs +47 -0
  8. package/esm2020/lib/core/localization/localization.service.mjs +185 -0
  9. package/esm2020/lib/core/localization/localizationSettings.module.mjs +88 -0
  10. package/esm2020/lib/core/localization/localize.pipe.mjs +78 -0
  11. package/esm2020/lib/core/logging/globalErrorHandler.mjs +44 -0
  12. package/esm2020/lib/core/logging/logging.service.mjs +39 -0
  13. package/esm2020/lib/core/notifications/services/notification-service.mjs +228 -0
  14. package/esm2020/lib/core/services/appcontext.service.mjs +118 -0
  15. package/esm2020/lib/core/services/dm.service.mjs +72 -0
  16. package/esm2020/lib/core/services/google-analytics.service.mjs +54 -0
  17. package/{esm2015/lib/core/services/idle.service.js → esm2020/lib/core/services/idle.service.mjs} +9 -7
  18. package/{esm2015/lib/core/services/loading.service.js → esm2020/lib/core/services/loading.service.mjs} +9 -8
  19. package/esm2020/lib/core/services/web-storage.service.mjs +69 -0
  20. package/esm2020/lib/core/utils.mjs +82 -0
  21. package/esm2020/lib/data/base/base-api.service.mjs +89 -0
  22. package/esm2020/lib/data/base/grid/base-grid-edit.service.mjs +77 -0
  23. package/esm2020/lib/data/base/grid/base-grid-read.service.mjs +62 -0
  24. package/esm2020/lib/data/data.module.mjs +51 -0
  25. package/esm2020/lib/data/services/billing-api.service.mjs +65 -0
  26. package/esm2020/lib/data/services/notifications/notifications-api-service.mjs +43 -0
  27. package/esm2020/lib/ui/components/base-edit.component.mjs +143 -0
  28. package/esm2020/lib/ui/components/base.component.mjs +47 -0
  29. package/esm2020/lib/ui/components/base.dialog.mjs +49 -0
  30. package/esm2020/lib/ui/components/billing/buyaccess-button.component.mjs +69 -0
  31. package/esm2020/lib/ui/components/billing/subscribe-plan-button.component.mjs +63 -0
  32. package/esm2020/lib/ui/components/billing/upgrade-plan-button.component.mjs +53 -0
  33. package/esm2020/lib/ui/components/content-header/content-header.component.mjs +37 -0
  34. package/esm2020/lib/ui/components/html-editor/base-html-editor.component.mjs +111 -0
  35. package/esm2020/lib/ui/components/html-editor/forms-html-editor.component.mjs +48 -0
  36. package/esm2020/lib/ui/components/html-editor/html-editor.component.mjs +52 -0
  37. package/esm2020/lib/ui/components/identity/signin-button.component.mjs +32 -0
  38. package/esm2020/lib/ui/components/identity/signout-button.component.mjs +32 -0
  39. package/esm2020/lib/ui/components/identity/signup-button.component.mjs +31 -0
  40. package/esm2020/lib/ui/components/loading/loading.component.mjs +48 -0
  41. package/esm2020/lib/ui/components/spinner/spinner.component.mjs +74 -0
  42. package/esm2020/lib/ui/directives/native-element.directive.mjs +41 -0
  43. package/esm2020/lib/ui/pipes/filesize.pipe.mjs +45 -0
  44. package/esm2020/lib/ui/pipes/replace-text.pipe.mjs +40 -0
  45. package/esm2020/lib/ui/pipes/safeHtml.pipe.mjs +37 -0
  46. package/esm2020/lib/ui/ui.module.mjs +155 -0
  47. package/esm2020/lib/ui/validation/form-validation-summary.component.mjs +66 -0
  48. package/esm2020/lib/ui/validation/item-validation-summary.component.mjs +39 -0
  49. package/esm2020/lib/ui/validation/validation-summary.component.mjs +128 -0
  50. package/fesm2015/{osovitny-anatoly.js → osovitny-anatoly.mjs} +771 -717
  51. package/fesm2015/osovitny-anatoly.mjs.map +1 -0
  52. package/fesm2020/osovitny-anatoly.mjs +3496 -0
  53. package/fesm2020/osovitny-anatoly.mjs.map +1 -0
  54. package/{osovitny-anatoly.d.ts → index.d.ts} +1 -0
  55. package/lib/core/core.module.d.ts +5 -0
  56. package/lib/core/go/base-go.service.d.ts +3 -0
  57. package/lib/core/interceptors/httpInterceptor.d.ts +3 -0
  58. package/lib/core/localization/localization.module.d.ts +6 -0
  59. package/lib/core/localization/localization.service.d.ts +3 -0
  60. package/lib/core/localization/localizationSettings.module.d.ts +5 -0
  61. package/lib/core/localization/localize.pipe.d.ts +3 -0
  62. package/lib/core/logging/globalErrorHandler.d.ts +3 -0
  63. package/lib/core/logging/logging.service.d.ts +3 -0
  64. package/lib/core/notifications/services/notification-service.d.ts +3 -0
  65. package/lib/core/services/appcontext.service.d.ts +3 -0
  66. package/lib/core/services/dm.service.d.ts +3 -0
  67. package/lib/core/services/google-analytics.service.d.ts +3 -0
  68. package/lib/core/services/idle.service.d.ts +3 -0
  69. package/lib/core/services/loading.service.d.ts +3 -0
  70. package/lib/core/services/web-storage.service.d.ts +5 -0
  71. package/lib/data/base/base-api.service.d.ts +3 -0
  72. package/lib/data/base/grid/base-grid-edit.service.d.ts +3 -0
  73. package/lib/data/base/grid/base-grid-read.service.d.ts +3 -0
  74. package/lib/data/data.module.d.ts +5 -0
  75. package/lib/data/services/billing-api.service.d.ts +3 -0
  76. package/lib/data/services/notifications/notifications-api-service.d.ts +3 -0
  77. package/lib/ui/components/base-edit.component.d.ts +5 -2
  78. package/lib/ui/components/base.component.d.ts +3 -0
  79. package/lib/ui/components/base.dialog.d.ts +3 -0
  80. package/lib/ui/components/billing/buyaccess-button.component.d.ts +3 -0
  81. package/lib/ui/components/billing/subscribe-plan-button.component.d.ts +3 -0
  82. package/lib/ui/components/billing/upgrade-plan-button.component.d.ts +3 -0
  83. package/lib/ui/components/content-header/content-header.component.d.ts +3 -0
  84. package/lib/ui/components/html-editor/base-html-editor.component.d.ts +3 -0
  85. package/lib/ui/components/html-editor/forms-html-editor.component.d.ts +3 -0
  86. package/lib/ui/components/html-editor/html-editor.component.d.ts +3 -0
  87. package/lib/ui/components/identity/signin-button.component.d.ts +3 -0
  88. package/lib/ui/components/identity/signout-button.component.d.ts +3 -0
  89. package/lib/ui/components/identity/signup-button.component.d.ts +3 -0
  90. package/lib/ui/components/loading/loading.component.d.ts +3 -0
  91. package/lib/ui/components/spinner/spinner.component.d.ts +3 -0
  92. package/lib/ui/directives/native-element.directive.d.ts +3 -0
  93. package/lib/ui/pipes/filesize.pipe.d.ts +3 -0
  94. package/lib/ui/pipes/replace-text.pipe.d.ts +3 -0
  95. package/lib/ui/pipes/safeHtml.pipe.d.ts +3 -0
  96. package/lib/ui/ui.module.d.ts +24 -0
  97. package/lib/ui/validation/form-validation-summary.component.d.ts +3 -0
  98. package/lib/ui/validation/item-validation-summary.component.d.ts +3 -0
  99. package/lib/ui/validation/validation-summary.component.d.ts +3 -0
  100. package/package.json +23 -11
  101. package/bundles/osovitny-anatoly.umd.js +0 -3700
  102. package/bundles/osovitny-anatoly.umd.js.map +0 -1
  103. package/esm2015/lib/core/core.module.js +0 -58
  104. package/esm2015/lib/core/go/base-go.service.js +0 -42
  105. package/esm2015/lib/core/interceptors/httpInterceptor.js +0 -109
  106. package/esm2015/lib/core/localization/localization.module.js +0 -41
  107. package/esm2015/lib/core/localization/localization.service.js +0 -187
  108. package/esm2015/lib/core/localization/localizationSettings.module.js +0 -78
  109. package/esm2015/lib/core/localization/localize.pipe.js +0 -78
  110. package/esm2015/lib/core/logging/globalErrorHandler.js +0 -44
  111. package/esm2015/lib/core/logging/logging.service.js +0 -38
  112. package/esm2015/lib/core/notifications/services/notification-service.js +0 -230
  113. package/esm2015/lib/core/services/appcontext.service.js +0 -119
  114. package/esm2015/lib/core/services/dm.service.js +0 -74
  115. package/esm2015/lib/core/services/google-analytics.service.js +0 -53
  116. package/esm2015/lib/core/services/web-storage.service.js +0 -66
  117. package/esm2015/lib/core/utils.js +0 -81
  118. package/esm2015/lib/data/base/base-api.service.js +0 -89
  119. package/esm2015/lib/data/base/grid/base-grid-edit.service.js +0 -77
  120. package/esm2015/lib/data/base/grid/base-grid-read.service.js +0 -62
  121. package/esm2015/lib/data/data.module.js +0 -43
  122. package/esm2015/lib/data/services/billing-api.service.js +0 -65
  123. package/esm2015/lib/data/services/notifications/notifications-api-service.js +0 -45
  124. package/esm2015/lib/ui/components/base-edit.component.js +0 -142
  125. package/esm2015/lib/ui/components/base.component.js +0 -43
  126. package/esm2015/lib/ui/components/base.dialog.js +0 -47
  127. package/esm2015/lib/ui/components/billing/buyaccess-button.component.js +0 -71
  128. package/esm2015/lib/ui/components/billing/subscribe-plan-button.component.js +0 -63
  129. package/esm2015/lib/ui/components/billing/upgrade-plan-button.component.js +0 -54
  130. package/esm2015/lib/ui/components/content-header/content-header.component.js +0 -37
  131. package/esm2015/lib/ui/components/html-editor/base-html-editor.component.js +0 -108
  132. package/esm2015/lib/ui/components/html-editor/forms-html-editor.component.js +0 -44
  133. package/esm2015/lib/ui/components/html-editor/html-editor.component.js +0 -51
  134. package/esm2015/lib/ui/components/identity/signin-button.component.js +0 -33
  135. package/esm2015/lib/ui/components/identity/signout-button.component.js +0 -33
  136. package/esm2015/lib/ui/components/identity/signup-button.component.js +0 -31
  137. package/esm2015/lib/ui/components/loading/loading.component.js +0 -49
  138. package/esm2015/lib/ui/components/spinner/spinner.component.js +0 -73
  139. package/esm2015/lib/ui/directives/native-element.directive.js +0 -41
  140. package/esm2015/lib/ui/pipes/filesize.pipe.js +0 -41
  141. package/esm2015/lib/ui/pipes/replace-text.pipe.js +0 -36
  142. package/esm2015/lib/ui/pipes/safeHtml.pipe.js +0 -36
  143. package/esm2015/lib/ui/ui.module.js +0 -105
  144. package/esm2015/lib/ui/validation/form-validation-summary.component.js +0 -64
  145. package/esm2015/lib/ui/validation/item-validation-summary.component.js +0 -38
  146. package/esm2015/lib/ui/validation/validation-summary.component.js +0 -126
  147. package/fesm2015/osovitny-anatoly.js.map +0 -1
  148. package/osovitny-anatoly.metadata.json +0 -1
  149. /package/{esm2015/lib/core/consts/settings.js → esm2020/lib/core/consts/settings.mjs} +0 -0
  150. /package/{esm2015/lib/core/consts/urls.js → esm2020/lib/core/consts/urls.mjs} +0 -0
  151. /package/{esm2015/lib/core/convert.js → esm2020/lib/core/convert.mjs} +0 -0
  152. /package/{esm2015/lib/core/guards/once-import.guard.js → esm2020/lib/core/guards/once-import.guard.mjs} +0 -0
  153. /package/{esm2015/lib/core/guid.js → esm2020/lib/core/guid.mjs} +0 -0
  154. /package/{esm2015/lib/core/localization/utils.js → esm2020/lib/core/localization/utils.mjs} +0 -0
  155. /package/{esm2015/lib/core/notifications/alerts.js → esm2020/lib/core/notifications/alerts.mjs} +0 -0
  156. /package/{esm2015/lib/core/notifications/interfaces/notification.js → esm2020/lib/core/notifications/interfaces/notification.mjs} +0 -0
  157. /package/{esm2015/lib/core/subs.js → esm2020/lib/core/subs.mjs} +0 -0
  158. /package/{esm2015/lib/data/consts.js → esm2020/lib/data/consts.mjs} +0 -0
  159. /package/{esm2015/lib/ui/components/html-editor/html-editor.defaultoptions.js → esm2020/lib/ui/components/html-editor/html-editor.defaultoptions.mjs} +0 -0
  160. /package/{esm2015/osovitny-anatoly.js → esm2020/osovitny-anatoly.mjs} +0 -0
  161. /package/{esm2015/public-api.js → esm2020/public-api.mjs} +0 -0
@@ -1,3700 +0,0 @@
1
- (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/router'), require('@angular/common/http'), require('rxjs/operators'), require('rxjs'), require('@ngx-translate/core'), require('date-fns'), require('date-fns-tz'), require('date-fns/locale/en-US'), require('@angular/common'), require('@ngx-translate/http-loader'), require('sweetalert2'), require('ngx-toastr'), require('uuid'), require('@angular/platform-browser'), require('@angular/forms'), require('angular-froala-wysiwyg')) :
3
- typeof define === 'function' && define.amd ? define('@osovitny/anatoly', ['exports', '@angular/core', '@angular/router', '@angular/common/http', 'rxjs/operators', 'rxjs', '@ngx-translate/core', 'date-fns', 'date-fns-tz', 'date-fns/locale/en-US', '@angular/common', '@ngx-translate/http-loader', 'sweetalert2', 'ngx-toastr', 'uuid', '@angular/platform-browser', '@angular/forms', 'angular-froala-wysiwyg'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.osovitny = global.osovitny || {}, global.osovitny.anatoly = {}), global.ng.core, global.ng.router, global.ng.common.http, global.rxjs.operators, global.rxjs, global.i1$1, global.dateFns, global.dateFnsTz, global.enUS, global.ng.common, global.httpLoader, global.Swal, global.i1$2, global.uuid, global.ng.platformBrowser, global.ng.forms, global.angularFroalaWysiwyg));
5
- })(this, (function (exports, i0, router, i1, operators, rxjs, i1$1, dateFns, dateFnsTz, enUS, i2, httpLoader, Swal, i1$2, uuid, i1$3, forms, angularFroalaWysiwyg) { 'use strict';
6
-
7
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
-
9
- function _interopNamespace(e) {
10
- if (e && e.__esModule) return e;
11
- var n = Object.create(null);
12
- if (e) {
13
- Object.keys(e).forEach(function (k) {
14
- if (k !== 'default') {
15
- var d = Object.getOwnPropertyDescriptor(e, k);
16
- Object.defineProperty(n, k, d.get ? d : {
17
- enumerable: true,
18
- get: function () { return e[k]; }
19
- });
20
- }
21
- });
22
- }
23
- n["default"] = e;
24
- return Object.freeze(n);
25
- }
26
-
27
- var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
28
- var i1__namespace$3 = /*#__PURE__*/_interopNamespace(i1);
29
- var i1__namespace = /*#__PURE__*/_interopNamespace(i1$1);
30
- var enUS__default = /*#__PURE__*/_interopDefaultLegacy(enUS);
31
- var i2__namespace = /*#__PURE__*/_interopNamespace(i2);
32
- var Swal__default = /*#__PURE__*/_interopDefaultLegacy(Swal);
33
- var i1__namespace$1 = /*#__PURE__*/_interopNamespace(i1$2);
34
- var i1__namespace$2 = /*#__PURE__*/_interopNamespace(i1$3);
35
-
36
- /*
37
- <file>
38
- Project:
39
- @osovitny/anatoly
40
-
41
- Authors:
42
- Vadim Osovitny
43
- Anatoly Osovitny
44
-
45
- Created:
46
- 26 Jun 2020
47
-
48
- Copyright (c) 2016-2021 Osovitny Inc. All rights reserved.
49
- </file>
50
- */
51
- var ContextInitState = JSON.parse((document.getElementById('contextInitState')).getAttribute('data-contextinitstate'));
52
- var AppCoreSettings = JSON.parse((document.getElementById('appCoreSettings')).getAttribute('data-appcoresettings'));
53
-
54
- /*
55
- <file>
56
- Project:
57
- MICE
58
-
59
- Authors:
60
- Vadim Osovitny vaosovitny@deloitte.com
61
-
62
- Created:
63
- 5 May 2020
64
-
65
- Copyright (c) 2020 Deloitte Tax. All rights reserved.
66
- </file>
67
- */
68
- var Urls = {
69
- // SignalR Notifications
70
- notificationsSocketUrl: '/hubs/notifications'
71
- };
72
-
73
- /*
74
- <file>
75
- Project:
76
- @osovitny/anatoly
77
-
78
- Authors:
79
- Vadim Osovitny
80
- Anatoly Osovitny
81
-
82
- Created:
83
- 17 Jun 2018
84
-
85
- Version:
86
- 1.0
87
-
88
- Copyright (c) 2016-2021 Osovitny Inc. All rights reserved.
89
- </file>
90
- */
91
- var BaseGoService = /** @class */ (function () {
92
- function BaseGoService(route, router) {
93
- this.route = route;
94
- this.router = router;
95
- this.route = route;
96
- this.router = router;
97
- }
98
- BaseGoService.prototype.locationReload = function () {
99
- window.location.reload();
100
- };
101
- BaseGoService.prototype.homeReload = function () {
102
- window.location.href = "/";
103
- };
104
- return BaseGoService;
105
- }());
106
- BaseGoService.decorators = [
107
- { type: i0.Injectable }
108
- ];
109
- BaseGoService.ctorParameters = function () { return [
110
- { type: router.ActivatedRoute },
111
- { type: router.Router }
112
- ]; };
113
-
114
- /*
115
- <file>
116
- Project:
117
- @osovitny/anatoly
118
-
119
- Authors:
120
- Vadim Osovitny
121
- Anatoly Osovitny
122
-
123
- Created:
124
- 26 Jun 2020
125
-
126
- Version:
127
- 1.0
128
-
129
- Copyright (c) 2016-2021 Osovitny Inc. All rights reserved.
130
- </file>
131
- */
132
- function throwIfAlreadyLoaded(parentModule, moduleName) {
133
- if (parentModule) {
134
- throw new Error(moduleName + " has already been loaded. Import " + moduleName + " modules in the AppModule only.");
135
- }
136
- }
137
-
138
- /*! *****************************************************************************
139
- Copyright (c) Microsoft Corporation.
140
-
141
- Permission to use, copy, modify, and/or distribute this software for any
142
- purpose with or without fee is hereby granted.
143
-
144
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
145
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
146
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
147
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
148
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
149
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
150
- PERFORMANCE OF THIS SOFTWARE.
151
- ***************************************************************************** */
152
- /* global Reflect, Promise */
153
- var extendStatics = function (d, b) {
154
- extendStatics = Object.setPrototypeOf ||
155
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
156
- function (d, b) { for (var p in b)
157
- if (Object.prototype.hasOwnProperty.call(b, p))
158
- d[p] = b[p]; };
159
- return extendStatics(d, b);
160
- };
161
- function __extends(d, b) {
162
- if (typeof b !== "function" && b !== null)
163
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
164
- extendStatics(d, b);
165
- function __() { this.constructor = d; }
166
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
167
- }
168
- var __assign = function () {
169
- __assign = Object.assign || function __assign(t) {
170
- for (var s, i = 1, n = arguments.length; i < n; i++) {
171
- s = arguments[i];
172
- for (var p in s)
173
- if (Object.prototype.hasOwnProperty.call(s, p))
174
- t[p] = s[p];
175
- }
176
- return t;
177
- };
178
- return __assign.apply(this, arguments);
179
- };
180
- function __rest(s, e) {
181
- var t = {};
182
- for (var p in s)
183
- if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
184
- t[p] = s[p];
185
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
186
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
187
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
188
- t[p[i]] = s[p[i]];
189
- }
190
- return t;
191
- }
192
- function __decorate(decorators, target, key, desc) {
193
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
194
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
195
- r = Reflect.decorate(decorators, target, key, desc);
196
- else
197
- for (var i = decorators.length - 1; i >= 0; i--)
198
- if (d = decorators[i])
199
- r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
200
- return c > 3 && r && Object.defineProperty(target, key, r), r;
201
- }
202
- function __param(paramIndex, decorator) {
203
- return function (target, key) { decorator(target, key, paramIndex); };
204
- }
205
- function __metadata(metadataKey, metadataValue) {
206
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
207
- return Reflect.metadata(metadataKey, metadataValue);
208
- }
209
- function __awaiter(thisArg, _arguments, P, generator) {
210
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
211
- return new (P || (P = Promise))(function (resolve, reject) {
212
- function fulfilled(value) { try {
213
- step(generator.next(value));
214
- }
215
- catch (e) {
216
- reject(e);
217
- } }
218
- function rejected(value) { try {
219
- step(generator["throw"](value));
220
- }
221
- catch (e) {
222
- reject(e);
223
- } }
224
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
225
- step((generator = generator.apply(thisArg, _arguments || [])).next());
226
- });
227
- }
228
- function __generator(thisArg, body) {
229
- var _ = { label: 0, sent: function () { if (t[0] & 1)
230
- throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
231
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
232
- function verb(n) { return function (v) { return step([n, v]); }; }
233
- function step(op) {
234
- if (f)
235
- throw new TypeError("Generator is already executing.");
236
- while (_)
237
- try {
238
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
239
- return t;
240
- if (y = 0, t)
241
- op = [op[0] & 2, t.value];
242
- switch (op[0]) {
243
- case 0:
244
- case 1:
245
- t = op;
246
- break;
247
- case 4:
248
- _.label++;
249
- return { value: op[1], done: false };
250
- case 5:
251
- _.label++;
252
- y = op[1];
253
- op = [0];
254
- continue;
255
- case 7:
256
- op = _.ops.pop();
257
- _.trys.pop();
258
- continue;
259
- default:
260
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
261
- _ = 0;
262
- continue;
263
- }
264
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
265
- _.label = op[1];
266
- break;
267
- }
268
- if (op[0] === 6 && _.label < t[1]) {
269
- _.label = t[1];
270
- t = op;
271
- break;
272
- }
273
- if (t && _.label < t[2]) {
274
- _.label = t[2];
275
- _.ops.push(op);
276
- break;
277
- }
278
- if (t[2])
279
- _.ops.pop();
280
- _.trys.pop();
281
- continue;
282
- }
283
- op = body.call(thisArg, _);
284
- }
285
- catch (e) {
286
- op = [6, e];
287
- y = 0;
288
- }
289
- finally {
290
- f = t = 0;
291
- }
292
- if (op[0] & 5)
293
- throw op[1];
294
- return { value: op[0] ? op[1] : void 0, done: true };
295
- }
296
- }
297
- var __createBinding = Object.create ? (function (o, m, k, k2) {
298
- if (k2 === undefined)
299
- k2 = k;
300
- Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
301
- }) : (function (o, m, k, k2) {
302
- if (k2 === undefined)
303
- k2 = k;
304
- o[k2] = m[k];
305
- });
306
- function __exportStar(m, o) {
307
- for (var p in m)
308
- if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
309
- __createBinding(o, m, p);
310
- }
311
- function __values(o) {
312
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
313
- if (m)
314
- return m.call(o);
315
- if (o && typeof o.length === "number")
316
- return {
317
- next: function () {
318
- if (o && i >= o.length)
319
- o = void 0;
320
- return { value: o && o[i++], done: !o };
321
- }
322
- };
323
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
324
- }
325
- function __read(o, n) {
326
- var m = typeof Symbol === "function" && o[Symbol.iterator];
327
- if (!m)
328
- return o;
329
- var i = m.call(o), r, ar = [], e;
330
- try {
331
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
332
- ar.push(r.value);
333
- }
334
- catch (error) {
335
- e = { error: error };
336
- }
337
- finally {
338
- try {
339
- if (r && !r.done && (m = i["return"]))
340
- m.call(i);
341
- }
342
- finally {
343
- if (e)
344
- throw e.error;
345
- }
346
- }
347
- return ar;
348
- }
349
- /** @deprecated */
350
- function __spread() {
351
- for (var ar = [], i = 0; i < arguments.length; i++)
352
- ar = ar.concat(__read(arguments[i]));
353
- return ar;
354
- }
355
- /** @deprecated */
356
- function __spreadArrays() {
357
- for (var s = 0, i = 0, il = arguments.length; i < il; i++)
358
- s += arguments[i].length;
359
- for (var r = Array(s), k = 0, i = 0; i < il; i++)
360
- for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
361
- r[k] = a[j];
362
- return r;
363
- }
364
- function __spreadArray(to, from) {
365
- for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
366
- to[j] = from[i];
367
- return to;
368
- }
369
- function __await(v) {
370
- return this instanceof __await ? (this.v = v, this) : new __await(v);
371
- }
372
- function __asyncGenerator(thisArg, _arguments, generator) {
373
- if (!Symbol.asyncIterator)
374
- throw new TypeError("Symbol.asyncIterator is not defined.");
375
- var g = generator.apply(thisArg, _arguments || []), i, q = [];
376
- return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
377
- function verb(n) { if (g[n])
378
- i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
379
- function resume(n, v) { try {
380
- step(g[n](v));
381
- }
382
- catch (e) {
383
- settle(q[0][3], e);
384
- } }
385
- function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
386
- function fulfill(value) { resume("next", value); }
387
- function reject(value) { resume("throw", value); }
388
- function settle(f, v) { if (f(v), q.shift(), q.length)
389
- resume(q[0][0], q[0][1]); }
390
- }
391
- function __asyncDelegator(o) {
392
- var i, p;
393
- return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
394
- function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
395
- }
396
- function __asyncValues(o) {
397
- if (!Symbol.asyncIterator)
398
- throw new TypeError("Symbol.asyncIterator is not defined.");
399
- var m = o[Symbol.asyncIterator], i;
400
- return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
401
- function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
402
- function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
403
- }
404
- function __makeTemplateObject(cooked, raw) {
405
- if (Object.defineProperty) {
406
- Object.defineProperty(cooked, "raw", { value: raw });
407
- }
408
- else {
409
- cooked.raw = raw;
410
- }
411
- return cooked;
412
- }
413
- ;
414
- var __setModuleDefault = Object.create ? (function (o, v) {
415
- Object.defineProperty(o, "default", { enumerable: true, value: v });
416
- }) : function (o, v) {
417
- o["default"] = v;
418
- };
419
- function __importStar(mod) {
420
- if (mod && mod.__esModule)
421
- return mod;
422
- var result = {};
423
- if (mod != null)
424
- for (var k in mod)
425
- if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
426
- __createBinding(result, mod, k);
427
- __setModuleDefault(result, mod);
428
- return result;
429
- }
430
- function __importDefault(mod) {
431
- return (mod && mod.__esModule) ? mod : { default: mod };
432
- }
433
- function __classPrivateFieldGet(receiver, state, kind, f) {
434
- if (kind === "a" && !f)
435
- throw new TypeError("Private accessor was defined without a getter");
436
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
437
- throw new TypeError("Cannot read private member from an object whose class did not declare it");
438
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
439
- }
440
- function __classPrivateFieldSet(receiver, state, value, kind, f) {
441
- if (kind === "m")
442
- throw new TypeError("Private method is not writable");
443
- if (kind === "a" && !f)
444
- throw new TypeError("Private accessor was defined without a setter");
445
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver))
446
- throw new TypeError("Cannot write private member to an object whose class did not declare it");
447
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
448
- }
449
-
450
- var LoadingService = /** @class */ (function (_super) {
451
- __extends(LoadingService, _super);
452
- function LoadingService() {
453
- var _this = _super.call(this, false) || this;
454
- _this.counter = 0;
455
- //Public
456
- _this.isFreezed = false;
457
- return _this;
458
- }
459
- LoadingService.prototype.show = function () {
460
- this.counter++;
461
- var that = this;
462
- setTimeout(function () {
463
- if (that.counter > 0) {
464
- that.next(true);
465
- }
466
- }, 500);
467
- };
468
- LoadingService.prototype.hide = function () {
469
- if (this.counter <= 0) {
470
- return;
471
- }
472
- this.counter--;
473
- if (this.counter == 0) {
474
- this.next(false);
475
- }
476
- };
477
- LoadingService.prototype.freeze = function (timeout) {
478
- var _this = this;
479
- if (timeout === void 0) { timeout = 1000; }
480
- this.isFreezed = true;
481
- var that = this;
482
- setTimeout(function () {
483
- _this.isFreezed = false;
484
- }, timeout);
485
- };
486
- LoadingService.prototype.reset = function () {
487
- if (this.counter > 0) {
488
- this.next(false);
489
- }
490
- this.counter = 0;
491
- };
492
- return LoadingService;
493
- }(rxjs.BehaviorSubject));
494
- LoadingService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function LoadingService_Factory() { return new LoadingService(); }, token: LoadingService, providedIn: "root" });
495
- LoadingService.decorators = [
496
- { type: i0.Injectable, args: [{
497
- providedIn: "root",
498
- },] }
499
- ];
500
- LoadingService.ctorParameters = function () { return []; };
501
-
502
- /*
503
- <file>
504
- Project:
505
- @osovitny/anatoly
506
-
507
- Authors:
508
- Vadim Osovitny
509
- Anatoly Osovitny
510
-
511
- Created:
512
- 26 Jun 2020
513
-
514
- Version:
515
- 1.0
516
-
517
- Copyright (c) 2016-2021 Osovitny Inc. All rights reserved.
518
- </file>
519
- */
520
- var LoggingService = /** @class */ (function () {
521
- function LoggingService() {
522
- }
523
- LoggingService.prototype.logError = function (error) {
524
- console.error(error);
525
- };
526
- LoggingService.prototype.logInformation = function (info) {
527
- console.info(info);
528
- };
529
- return LoggingService;
530
- }());
531
- LoggingService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function LoggingService_Factory() { return new LoggingService(); }, token: LoggingService, providedIn: "root" });
532
- LoggingService.decorators = [
533
- { type: i0.Injectable, args: [{
534
- providedIn: "root",
535
- },] }
536
- ];
537
- LoggingService.ctorParameters = function () { return []; };
538
-
539
- var AnatolyHttpInterceptor = /** @class */ (function () {
540
- function AnatolyHttpInterceptor(loadingService, loggingService) {
541
- this.loadingService = loadingService;
542
- this.loggingService = loggingService;
543
- this.longRunningExceptionsList = [];
544
- this.autoCDNSASTokenUrls = ['chunks', 'resources'];
545
- this.externalSiteUrls = ['azurewebsites.net'];
546
- }
547
- AnatolyHttpInterceptor.prototype.intercept = function (req, next) {
548
- var e_1, _a, e_2, _b, e_3, _c;
549
- var _this = this;
550
- var isCDNEnabled = AppCoreSettings.IsCDNEnabled;
551
- var cdnSasToken = AppCoreSettings.CDNSASToken;
552
- var isLoadingFreezed = this.loadingService.isFreezed;
553
- var authorizationTokenRequired = true;
554
- var url = req.url.toLowerCase();
555
- var originalUrl = req.url;
556
- var isExternalSite = false;
557
- var loadingRequired = !isLoadingFreezed;
558
- if (!isLoadingFreezed) {
559
- try {
560
- for (var _d = __values(this.longRunningExceptionsList), _e = _d.next(); !_e.done; _e = _d.next()) {
561
- var i = _e.value;
562
- if (url.indexOf(this.longRunningExceptionsList[i]) >= 0) {
563
- loadingRequired = false;
564
- break;
565
- }
566
- }
567
- }
568
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
569
- finally {
570
- try {
571
- if (_e && !_e.done && (_a = _d.return)) _a.call(_d);
572
- }
573
- finally { if (e_1) throw e_1.error; }
574
- }
575
- }
576
- if (isCDNEnabled) {
577
- try {
578
- for (var _f = __values(this.autoCDNSASTokenUrls), _g = _f.next(); !_g.done; _g = _f.next()) {
579
- var i = _g.value;
580
- if (url.indexOf(this.autoCDNSASTokenUrls[i]) >= 0) {
581
- req = req.clone({ url: originalUrl + cdnSasToken });
582
- break;
583
- }
584
- }
585
- }
586
- catch (e_2_1) { e_2 = { error: e_2_1 }; }
587
- finally {
588
- try {
589
- if (_g && !_g.done && (_b = _f.return)) _b.call(_f);
590
- }
591
- finally { if (e_2) throw e_2.error; }
592
- }
593
- }
594
- try {
595
- for (var _h = __values(this.externalSiteUrls), _j = _h.next(); !_j.done; _j = _h.next()) {
596
- var i = _j.value;
597
- if (url.indexOf(this.externalSiteUrls[i]) >= 0) {
598
- isExternalSite = true;
599
- break;
600
- }
601
- }
602
- }
603
- catch (e_3_1) { e_3 = { error: e_3_1 }; }
604
- finally {
605
- try {
606
- if (_j && !_j.done && (_c = _h.return)) _c.call(_h);
607
- }
608
- finally { if (e_3) throw e_3.error; }
609
- }
610
- // VadimOS: IE11-fix
611
- if (url.indexOf('/api/') > -1) {
612
- var newUrl = '';
613
- var t = new Date().getTime().toString();
614
- if (url.indexOf('?') > -1) {
615
- newUrl = originalUrl + '&t=' + t;
616
- }
617
- else {
618
- newUrl = originalUrl + '?t=' + t;
619
- }
620
- req = req.clone({ url: newUrl });
621
- }
622
- req = req.clone({ headers: req.headers.set('Accept', 'application/json') });
623
- req = req.clone({ headers: req.headers.set('Accept', 'application/text') });
624
- this.onRequestStart(loadingRequired);
625
- return next.handle(req).pipe(operators.tap(function (event) {
626
- if (event instanceof i1.HttpResponse) {
627
- _this.onRequestEnd(loadingRequired);
628
- }
629
- }, function (err) {
630
- _this.onRequestEnd(loadingRequired);
631
- _this.loggingService.logError(err);
632
- }));
633
- };
634
- AnatolyHttpInterceptor.prototype.onRequestStart = function (loadingRequired) {
635
- if (loadingRequired) {
636
- this.loadingService.show();
637
- }
638
- };
639
- AnatolyHttpInterceptor.prototype.onRequestEnd = function (loadingRequired) {
640
- if (loadingRequired) {
641
- this.loadingService.hide();
642
- }
643
- };
644
- return AnatolyHttpInterceptor;
645
- }());
646
- AnatolyHttpInterceptor.decorators = [
647
- { type: i0.Injectable }
648
- ];
649
- AnatolyHttpInterceptor.ctorParameters = function () { return [
650
- { type: LoadingService },
651
- { type: LoggingService }
652
- ]; };
653
-
654
- /*
655
- <file>
656
- Project:
657
- @osovitny/anatoly
658
-
659
- Authors:
660
- Vadim Osovitny
661
- Anatoly Osovitny
662
-
663
- Created:
664
- 29 June 2020
665
-
666
- Copyright (c) 2016-2021 Osovitny Inc. All rights reserved.
667
- </file>
668
- */
669
- var Convert = /** @class */ (function () {
670
- function Convert() {
671
- }
672
- Convert.toLocalizedDateTime = function (value) {
673
- if (value) {
674
- return new Date(Date.UTC(value.getFullYear(), value.getMonth(), value.getDate(), value.getHours(), value.getMinutes(), value.getSeconds(), value.getMilliseconds()));
675
- }
676
- return null;
677
- };
678
- Convert.enumToString = function (enumeration, value) {
679
- for (var k in enumeration)
680
- if (enumeration[k] == value)
681
- return k;
682
- return null;
683
- };
684
- Convert.enumToArray = function (enumeration, notIncludes) {
685
- var notIncludeFiler = function (value) {
686
- if (isNaN(Number(value))) {
687
- return false;
688
- }
689
- if (notIncludes) {
690
- for (var i in notIncludes) {
691
- if (notIncludes[i] == value)
692
- return false;
693
- }
694
- }
695
- return true;
696
- };
697
- return Object.keys(enumeration)
698
- .filter(notIncludeFiler)
699
- .map(function (key) { return ({
700
- value: key,
701
- text: enumeration[key]
702
- }); });
703
- };
704
- Convert.stringToArray = function (str, separator) {
705
- if (separator === void 0) { separator = ','; }
706
- if (str) {
707
- return str.split(separator).filter(function (element) { return element; });
708
- }
709
- return [];
710
- };
711
- Convert.stringToIntArray = function (str, separator) {
712
- if (separator === void 0) { separator = ','; }
713
- if (str) {
714
- return str.split(separator).filter(function (element) { return element; }).map(function (value) { return parseInt(value); });
715
- }
716
- return [];
717
- };
718
- return Convert;
719
- }());
720
-
721
- /*
722
- <file>
723
- Project:
724
- @osovitny/anatoly
725
-
726
- Authors:
727
- Vadim Osovitny
728
- Anatoly Osovitny
729
-
730
- Created:
731
- 05 May 2020
732
-
733
- Version:
734
- 1.0
735
-
736
- Copyright (c) 2016-2021 Osovitny Inc. All rights reserved.
737
- </file>
738
- */
739
- var LocalizationService = /** @class */ (function () {
740
- function LocalizationService(translate) {
741
- this.translate = translate;
742
- this.setSupportedLanguages(['en']);
743
- }
744
- LocalizationService.prototype.format = function (str, args) {
745
- return str.replace(/{(\d+)}/g, function (match, number) {
746
- return typeof args[number] != 'undefined'
747
- ? args[number]
748
- : match;
749
- });
750
- };
751
- ;
752
- LocalizationService.prototype.configureTranslationSettings = function (translate) {
753
- var languageToSet = 'en';
754
- this.dateFnsLocale = { locale: enUS__default["default"] };
755
- translate.setDefaultLang(languageToSet);
756
- return languageToSet;
757
- };
758
- LocalizationService.prototype.getBrowserLanguage = function () {
759
- return this.translate.getBrowserLang();
760
- };
761
- LocalizationService.prototype.getDatefnsLocale = function () {
762
- var dfnLocale;
763
- switch (this.getBrowserLanguage()) {
764
- case 'en':
765
- dfnLocale = { locale: enUS__default["default"] };
766
- break;
767
- default:
768
- dfnLocale = { locale: enUS__default["default"] };
769
- }
770
- return dfnLocale;
771
- };
772
- LocalizationService.prototype.setDefaultLanguage = function (lang) {
773
- this.translate.setDefaultLang(lang);
774
- };
775
- LocalizationService.prototype.setSupportedLanguages = function (languages) {
776
- this.translate.addLangs(languages);
777
- };
778
- LocalizationService.prototype.updateLanguage = function (language) {
779
- this.translate.use(language);
780
- };
781
- LocalizationService.prototype.getLocalizedValue = function (key, params) {
782
- var value = this.translate.instant(key);
783
- if (!params || params.length === 0) {
784
- return value;
785
- }
786
- return this.format(value, params);
787
- };
788
- LocalizationService.prototype.getLocalizedDate = function (key) {
789
- if (dateFns.isValid(new Date(key))) {
790
- return dateFns.format(new Date(key), 'dd.MM.yyyy', this.dateFnsLocale);
791
- }
792
- return "Invalid Date";
793
- };
794
- LocalizationService.prototype.getLocalizedDateTime = function (key) {
795
- var dateValue = new Date(key);
796
- if (dateFns.isValid(dateValue)) {
797
- var localDate = Convert.toLocalizedDateTime(dateValue);
798
- return dateFns.format(localDate, 'dd.MM.yyyy HH:mm', this.dateFnsLocale);
799
- }
800
- return "Invalid Date";
801
- };
802
- LocalizationService.prototype.getLocalizedDistanceInWords = function (endedDate, startedDate) {
803
- if (dateFns.isValid(new Date(endedDate)) && dateFns.isValid(new Date(startedDate))) {
804
- return dateFns.formatDistance(new Date(endedDate), new Date(startedDate), this.dateFnsLocale);
805
- }
806
- return "Invalid Date";
807
- };
808
- LocalizationService.prototype.getLocalizedDistanceToNowInWords = function (date) {
809
- if (dateFns.isValid(new Date(date))) {
810
- return dateFns.formatDistanceToNow(new Date(date), this.dateFnsLocale);
811
- }
812
- return "Invalid Date";
813
- };
814
- //UTC Operations --------------------------------------------------------------
815
- LocalizationService.prototype.getUTCToLocalizedDate = function (key) {
816
- var browserTimeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;
817
- if (key) {
818
- if (key.indexOf("T") == -1) {
819
- key = key.replace(" ", "T");
820
- }
821
- if (key.indexOf("Z") == -1) {
822
- key = key + "Z";
823
- }
824
- }
825
- if (browserTimeZone) {
826
- var localDateTime = dateFnsTz.utcToZonedTime(key, browserTimeZone);
827
- return dateFns.format(localDateTime, 'dd.MM.yyyy', this.dateFnsLocale);
828
- }
829
- else {
830
- return dateFns.format(new Date(key), 'dd.MM.yyyy', this.dateFnsLocale);
831
- }
832
- };
833
- LocalizationService.prototype.getUTCToLocalizedDateTime = function (key) {
834
- var browserTimeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;
835
- if (key) {
836
- if (key.indexOf("T") == -1) {
837
- key = key.replace(" ", "T");
838
- }
839
- if (key.indexOf("Z") == -1) {
840
- key = key + "Z";
841
- }
842
- }
843
- if (browserTimeZone) {
844
- var localDateTime = dateFnsTz.utcToZonedTime(key, browserTimeZone);
845
- return dateFns.format(localDateTime, 'dd.MM.yyyy HH:mm', this.dateFnsLocale);
846
- }
847
- else {
848
- return dateFns.format(new Date(key), 'dd.MM.yyyy HH:mm', this.dateFnsLocale);
849
- }
850
- };
851
- //https://date-fns.org/v1.30.1/docs/distanceInWords
852
- LocalizationService.prototype.getUTCToLocalizedDistanceToNowInWords = function (date) {
853
- date = this.safeUtcToZonedTime(date);
854
- if (dateFns.isValid(new Date(date))) {
855
- return dateFns.formatDistanceToNow(new Date(date), this.dateFnsLocale);
856
- }
857
- return "Invalid Date";
858
- };
859
- LocalizationService.prototype.safeUtcToZonedTime = function (date) {
860
- var result = date;
861
- try {
862
- if (date) {
863
- if (date.indexOf("T") == -1) {
864
- date = date.replace(" ", "T");
865
- }
866
- if (date.indexOf("Z") == -1) {
867
- date = date + "Z";
868
- }
869
- }
870
- var browserTimeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;
871
- if (browserTimeZone) {
872
- result = dateFnsTz.utcToZonedTime(date, browserTimeZone).toString();
873
- }
874
- else {
875
- result = new Date(date).toString();
876
- }
877
- }
878
- catch (_a) {
879
- if (date) {
880
- console.log("UTC to Local conversion failed for :" + date.toString());
881
- }
882
- }
883
- return result;
884
- };
885
- return LocalizationService;
886
- }());
887
- LocalizationService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function LocalizationService_Factory() { return new LocalizationService(i0__namespace.ɵɵinject(i1__namespace.TranslateService)); }, token: LocalizationService, providedIn: "root" });
888
- LocalizationService.decorators = [
889
- { type: i0.Injectable, args: [{
890
- providedIn: 'root'
891
- },] }
892
- ];
893
- LocalizationService.ctorParameters = function () { return [
894
- { type: i1$1.TranslateService }
895
- ]; };
896
-
897
- /*
898
- <file>
899
- Project:
900
- @osovitny/anatoly
901
-
902
- Authors:
903
- Vadim Osovitny
904
- Anatoly Osovitny
905
-
906
- Created:
907
- 10 May 2020
908
-
909
- Version:
910
- 1.0
911
-
912
- Copyright (c) 2016-2021 Osovitny Inc. All rights reserved.
913
- </file>
914
- */
915
- var LocalizePipe = /** @class */ (function () {
916
- function LocalizePipe(localizeService) {
917
- this.localizeService = localizeService;
918
- }
919
- LocalizePipe.prototype.transform = function (inputData, type, param2) {
920
- if (!inputData) {
921
- return;
922
- }
923
- if (!type) {
924
- type = 'tr';
925
- }
926
- //Translate
927
- if (type === 'tr') {
928
- return this.localizeService.getLocalizedValue(inputData);
929
- }
930
- //Date
931
- if (type === 'd') {
932
- return this.localizeService.getLocalizedDate(inputData);
933
- }
934
- //DateTime
935
- if (type === 'dt') {
936
- return this.localizeService.getLocalizedDateTime(inputData);
937
- }
938
- //DistanceInWords
939
- if (type === 'dis') {
940
- return this.localizeService.getLocalizedDistanceInWords(inputData, param2);
941
- }
942
- //DistanceToNowInWords
943
- if (type === 'dis2now') {
944
- return this.localizeService.getLocalizedDistanceToNowInWords(inputData);
945
- }
946
- //UTC Operations --------------------------------------------------------------
947
- //UTC Date
948
- if (type === 'u2d') {
949
- return this.localizeService.getUTCToLocalizedDate(inputData);
950
- }
951
- //UTC DateTime
952
- if (type === 'u2dt') {
953
- return this.localizeService.getUTCToLocalizedDateTime(inputData);
954
- }
955
- //UTC DistanceToNowInWords
956
- if (type === 'u2dis2now') {
957
- return this.localizeService.getUTCToLocalizedDistanceToNowInWords(inputData);
958
- }
959
- return inputData;
960
- };
961
- return LocalizePipe;
962
- }());
963
- LocalizePipe.decorators = [
964
- { type: i0.Pipe, args: [{
965
- name: 'localize'
966
- },] }
967
- ];
968
- LocalizePipe.ctorParameters = function () { return [
969
- { type: LocalizationService }
970
- ]; };
971
-
972
- /*
973
- <file>
974
- Project:
975
- @osovitny/anatoly
976
-
977
- Authors:
978
- Vadim Osovitny
979
- Anatoly Osovitny
980
-
981
- Created:
982
- 05 May 2020
983
-
984
- Version:
985
- 1.0
986
-
987
- Copyright (c) 2016-2021 Osovitny Inc. All rights reserved.
988
- </file>
989
- */
990
- function customTranslateLoaderFactory(http) {
991
- return new httpLoader.TranslateHttpLoader(http, AppCoreSettings.resourcesUrl + "/", '.json');
992
- }
993
- function localizationInitializerFactory(translate, localizationService, injector) {
994
- return function () { return new Promise(function (resolve) {
995
- var locationInitialized = injector.get(i2.LOCATION_INITIALIZED, Promise.resolve(null));
996
- locationInitialized.then(function () {
997
- var languageToSet = localizationService.configureTranslationSettings(translate);
998
- translate.use(languageToSet).subscribe(function () {
999
- }, function () {
1000
- resolve(null);
1001
- }, function () {
1002
- resolve(null);
1003
- });
1004
- });
1005
- }); };
1006
- }
1007
- var TranslateModuleAtRoot = i1$1.TranslateModule.forRoot({
1008
- loader: {
1009
- provide: i1$1.TranslateLoader,
1010
- useFactory: customTranslateLoaderFactory,
1011
- deps: [i1.HttpClient]
1012
- }
1013
- });
1014
- exports.LocalizationInjectorInstance = void 0;
1015
- var LocalizationSettingsModule = /** @class */ (function () {
1016
- function LocalizationSettingsModule(injector) {
1017
- this.injector = injector;
1018
- exports.LocalizationInjectorInstance = this.injector;
1019
- }
1020
- return LocalizationSettingsModule;
1021
- }());
1022
- LocalizationSettingsModule.decorators = [
1023
- { type: i0.NgModule, args: [{
1024
- imports: [
1025
- TranslateModuleAtRoot
1026
- ],
1027
- providers: [
1028
- {
1029
- provide: i0.APP_INITIALIZER,
1030
- useFactory: localizationInitializerFactory,
1031
- deps: [i1$1.TranslateService, LocalizationService, i0.Injector],
1032
- multi: true
1033
- }
1034
- ],
1035
- exports: []
1036
- },] }
1037
- ];
1038
- LocalizationSettingsModule.ctorParameters = function () { return [
1039
- { type: i0.Injector }
1040
- ]; };
1041
-
1042
- /*
1043
- <file>
1044
- Project:
1045
- @osovitny/anatoly
1046
-
1047
- Authors:
1048
- Vadim Osovitny
1049
- Anatoly Osovitny
1050
-
1051
- Created:
1052
- 12 May 2020
1053
-
1054
- Version:
1055
- 1.0
1056
-
1057
- Copyright (c) 2016-2021 Osovitny Inc. All rights reserved.
1058
- </file>
1059
- */
1060
- var LocalizationModule = /** @class */ (function () {
1061
- function LocalizationModule() {
1062
- }
1063
- return LocalizationModule;
1064
- }());
1065
- LocalizationModule.decorators = [
1066
- { type: i0.NgModule, args: [{
1067
- imports: [
1068
- i1$1.TranslateModule
1069
- ],
1070
- exports: [
1071
- i1$1.TranslateModule,
1072
- LocalizePipe
1073
- ],
1074
- declarations: [
1075
- LocalizePipe
1076
- ],
1077
- providers: []
1078
- },] }
1079
- ];
1080
-
1081
- /*
1082
- <file>
1083
- Project:
1084
- @osovitny/anatoly
1085
-
1086
- Authors:
1087
- Vadim Osovitny
1088
- Anatoly Osovitny
1089
-
1090
- Created:
1091
- 26 Jun 2020
1092
-
1093
- Version:
1094
- 1.0
1095
-
1096
- Copyright (c) 2016-2021 Osovitny Inc. All rights reserved.
1097
- </file>
1098
- */
1099
- var GlobalErrorHandler = /** @class */ (function () {
1100
- function GlobalErrorHandler(injector) {
1101
- this.injector = injector;
1102
- }
1103
- GlobalErrorHandler.prototype.handleError = function (error) {
1104
- var loggingService = this.injector.get(LoggingService);
1105
- loggingService.logError(error);
1106
- // IMPORTANT: Rethrow the error otherwise it gets swallowed
1107
- throw error;
1108
- };
1109
- return GlobalErrorHandler;
1110
- }());
1111
- GlobalErrorHandler.decorators = [
1112
- { type: i0.Injectable }
1113
- ];
1114
- GlobalErrorHandler.ctorParameters = function () { return [
1115
- { type: i0.Injector }
1116
- ]; };
1117
-
1118
- /*
1119
- <file>
1120
- Project:
1121
- @osovitny/anatoly
1122
-
1123
- Authors:
1124
- Vadim Osovitny
1125
- Anatoly Osovitny
1126
-
1127
- Created:
1128
- 2 July 2020
1129
-
1130
- Version:
1131
- 1.0
1132
-
1133
- Copyright (c) 2016-2021 Osovitny Inc. All rights reserved.
1134
- </file>
1135
- */
1136
- var L10nUtils = /** @class */ (function () {
1137
- function L10nUtils() {
1138
- }
1139
- Object.defineProperty(L10nUtils, "localizationService", {
1140
- // @dynamic
1141
- get: function () {
1142
- var ns = exports.LocalizationInjectorInstance.get(LocalizationService);
1143
- return ns;
1144
- },
1145
- enumerable: false,
1146
- configurable: true
1147
- });
1148
- L10nUtils.getLocalizedValue = function (key, params, defaultKey) {
1149
- // VadimOS: DON'T CHANGE THIS CODE. NEED TO BE REVIEWED AND APPROVED BY VADIMOS
1150
- // defaultKey definition:
1151
- // if key is empty and defaultKey is defined => get localization for defaultKey
1152
- // Example: cancel()
1153
- if (!key && defaultKey) {
1154
- return this.localizationService.getLocalizedValue(defaultKey);
1155
- }
1156
- // VadimOS:
1157
- // if key is not empty value MUST be in localization table, othewise we will return key
1158
- if (key) {
1159
- var value = this.localizationService.getLocalizedValue(key, params);
1160
- return value;
1161
- }
1162
- return key;
1163
- };
1164
- return L10nUtils;
1165
- }());
1166
-
1167
- /*
1168
- <file>
1169
- Project:
1170
- @osovitny/anatoly
1171
-
1172
- Authors:
1173
- Vadim Osovitny
1174
- Anatoly Osovitny
1175
-
1176
- Created:
1177
- 3 March 2020
1178
-
1179
- Version:
1180
- 1.0
1181
-
1182
- Copyright (c) 2016-2021 Osovitny Inc. All rights reserved.
1183
- </file>
1184
- */
1185
- var Alerts = /** @class */ (function () {
1186
- function Alerts() {
1187
- }
1188
- Alerts.success = function (text, params, title, successAction) {
1189
- text = L10nUtils.getLocalizedValue(text, params, 'OperationSuccessFull');
1190
- title = L10nUtils.getLocalizedValue(title, null, 'Success');
1191
- Swal__default["default"].fire({
1192
- text: text,
1193
- title: title,
1194
- icon: 'success',
1195
- confirmButtonText: L10nUtils.getLocalizedValue('Ok')
1196
- })
1197
- .then(function () {
1198
- if (successAction) {
1199
- successAction();
1200
- }
1201
- });
1202
- };
1203
- Alerts.info = function (text, params, title) {
1204
- text = L10nUtils.getLocalizedValue(text, params);
1205
- title = L10nUtils.getLocalizedValue(title, null, 'Info');
1206
- Swal__default["default"].fire({
1207
- text: text,
1208
- title: title,
1209
- icon: 'info',
1210
- confirmButtonText: L10nUtils.getLocalizedValue('Ok')
1211
- });
1212
- };
1213
- Alerts.warning = function (text, params, title) {
1214
- text = L10nUtils.getLocalizedValue(text, params);
1215
- title = L10nUtils.getLocalizedValue(title, null, 'Warning');
1216
- Swal__default["default"].fire({
1217
- text: text,
1218
- title: title,
1219
- icon: 'warning',
1220
- confirmButtonText: L10nUtils.getLocalizedValue('Ok')
1221
- });
1222
- };
1223
- Alerts.error = function (text, params, title) {
1224
- text = L10nUtils.getLocalizedValue(text, params, 'ErrorOccured');
1225
- title = L10nUtils.getLocalizedValue(title, null, 'Error');
1226
- Swal__default["default"].fire({
1227
- text: text,
1228
- title: title,
1229
- icon: 'error',
1230
- confirmButtonText: L10nUtils.getLocalizedValue('Ok')
1231
- });
1232
- };
1233
- Alerts.cancel = function (text, params, title) {
1234
- text = L10nUtils.getLocalizedValue(text, params, 'OperationCancelled');
1235
- title = L10nUtils.getLocalizedValue(title, null, 'Cancelled');
1236
- Swal__default["default"].fire({
1237
- text: text,
1238
- title: title,
1239
- icon: 'info'
1240
- });
1241
- };
1242
- Alerts.notImplemented = function () {
1243
- this.warning('Not Implemented Yet');
1244
- };
1245
- ;
1246
- Alerts.areYouSure = function (text, title, confirmButtonText, cancelButtonText, successAction, cancelAction) {
1247
- text = L10nUtils.getLocalizedValue(text);
1248
- title = L10nUtils.getLocalizedValue(title, null, 'AreYouSure');
1249
- confirmButtonText = L10nUtils.getLocalizedValue(confirmButtonText, null, 'AreYouSure-ConfirmButtonText');
1250
- cancelButtonText = L10nUtils.getLocalizedValue(cancelButtonText, null, 'AreYouSure-CancelButtonText');
1251
- Swal__default["default"].fire({
1252
- text: text,
1253
- title: title,
1254
- icon: 'warning',
1255
- confirmButtonText: confirmButtonText,
1256
- cancelButtonText: cancelButtonText,
1257
- showCancelButton: true
1258
- })
1259
- .then(function (result) {
1260
- if (result.value) {
1261
- if (successAction) {
1262
- successAction();
1263
- }
1264
- }
1265
- // result.dismiss can be 'cancel', 'overlay', 'close', and 'timer'
1266
- else if (result.dismiss == Swal__default["default"].DismissReason.cancel || result.dismiss == Swal__default["default"].DismissReason.close) {
1267
- if (cancelAction) {
1268
- cancelAction();
1269
- }
1270
- }
1271
- });
1272
- };
1273
- ;
1274
- return Alerts;
1275
- }());
1276
-
1277
- /*
1278
- <file>
1279
- Project:
1280
- @osovitny/anatoly
1281
-
1282
- Authors:
1283
- Vadim Osovitny
1284
- Anatoly Osovitny
1285
-
1286
- Created:
1287
- 26 Jun 2020
1288
-
1289
- Copyright (c) 2016-2021 Osovitny Inc. All rights reserved.
1290
- </file>
1291
- */
1292
- var Guid = /** @class */ (function () {
1293
- function Guid() {
1294
- }
1295
- Guid.newGuid = function () {
1296
- return uuid.v4();
1297
- };
1298
- return Guid;
1299
- }());
1300
-
1301
- // SignalR
1302
- // import * as signalR from '@microsoft/signalr';
1303
- // import { NotificationsApiService } from '../../../data/services/notifications/notifications-api-service';
1304
- var NotificationService = /** @class */ (function () {
1305
- function NotificationService(toastrService) {
1306
- this.toastrService = toastrService;
1307
- // SignalR
1308
- // private hubConnection: signalR.HubConnection;
1309
- // private socketUrl: string;
1310
- // Notifications
1311
- this._sessionNotifications = new rxjs.BehaviorSubject([]);
1312
- this._serverNotifications = new rxjs.BehaviorSubject([]);
1313
- // Public
1314
- this.sessionNotifications$ = this._sessionNotifications.asObservable();
1315
- this.serverNotifications$ = this._serverNotifications.asObservable();
1316
- // this.onInit();
1317
- }
1318
- /*
1319
- onInit() {
1320
- if (AppCoreSettings.AzureAD) {
1321
- this.authService.getAuthToken().subscribe((token: string) => {
1322
- this.startSignalRConnection(token);
1323
- });
1324
-
1325
- return;
1326
- }
1327
-
1328
- this.startSignalRConnection();
1329
- }
1330
-
1331
- ngOnDestroy() {
1332
- this.stopSignalRConnection();
1333
- }
1334
-
1335
- // SignalR
1336
- private startSignalRConnection(accessToken?) {
1337
- const cskii = AppCoreSettings.selectedClientID;
1338
- // tslint:disable-next-line:variable-name
1339
- const cskii_upn = AppCoreSettings.CSKII_UPN;
1340
- // tslint:disable-next-line:variable-name
1341
- const cli_sessionguid = AppCoreSettings.CLI_SessionGUID;
1342
-
1343
- const url = this.socketUrl + '?cskii=' + cskii + '&cskii_upn=' + cskii_upn + '&cli_sessionguid=' + cli_sessionguid;
1344
-
1345
- if (accessToken) {
1346
- this.hubConnection = new signalR.HubConnectionBuilder()
1347
- .withUrl(url, {
1348
- skipNegotiation: false,
1349
- transport: signalR.HttpTransportType.WebSockets,
1350
- accessTokenFactory: () => accessToken
1351
- })
1352
- .withAutomaticReconnect()
1353
- .configureLogging(signalR.LogLevel.Debug)
1354
- .build();
1355
- }
1356
- else {
1357
- this.hubConnection = new signalR.HubConnectionBuilder()
1358
- .withUrl(this.socketUrl, {
1359
- skipNegotiation: true,
1360
- transport: signalR.HttpTransportType.WebSockets
1361
- })
1362
- .withAutomaticReconnect()
1363
- .configureLogging(signalR.LogLevel.Debug)
1364
- .build();
1365
- }
1366
-
1367
- this.hubConnection
1368
- .start()
1369
- .then(() => this.signalRConnection_onSuccess())
1370
- .catch(err => {
1371
- console.error('Connection failed to SignalR Notification Hub')
1372
- })
1373
- }
1374
-
1375
- private signalRConnection_onSuccess() {
1376
- this.addReceiveMessageDataListener();
1377
-
1378
- this.notificationsApiService.retrieveNotifications().subscribe(data => {
1379
- this.serverNotifications = data;
1380
- });
1381
- }
1382
-
1383
- stopSignalRConnection() {
1384
- if (this.hubConnection) {
1385
- this.hubConnection.stop();
1386
- this.hubConnection = null;
1387
- }
1388
- }
1389
-
1390
- private addReceiveMessageDataListener = () => {
1391
- this.hubConnection.on('ReceiveMessage', (message) => {
1392
- if (message) {
1393
- if (message.type === 'error') {
1394
- this.error(message.text, null, null, false);
1395
- }
1396
- else {
1397
- this.success(message.text, null, null, false);
1398
- }
1399
-
1400
- const notification = {
1401
- id: message.id,
1402
- isNew: message.isNew,
1403
- isSession: true,
1404
- text: message.text,
1405
- type: message.type,
1406
- createdDate: message.createdDate
1407
- };
1408
-
1409
- this.addSessionNotificationToList(notification);
1410
- }
1411
- });
1412
- }
1413
- */
1414
- NotificationService.prototype.addSessionNotification = function (text, type) {
1415
- var id = Guid.newGuid();
1416
- var notification = { id: id, isNew: true, isSession: true, text: text, type: type, createdDate: new Date(Date.now()).toISOString() };
1417
- this.addSessionNotificationToList(notification);
1418
- };
1419
- NotificationService.prototype.addSessionNotificationToList = function (notification) {
1420
- this.sessionNotifications = __spreadArray([
1421
- notification
1422
- ], __read(this.sessionNotifications));
1423
- };
1424
- // Public API
1425
- NotificationService.prototype.removeNotification = function (id, isSession) {
1426
- if (isSession) {
1427
- this.sessionNotifications = this.sessionNotifications.filter(function (notifications) { return notifications.id !== id; });
1428
- }
1429
- else {
1430
- this.serverNotifications = this.serverNotifications.filter(function (notifications) { return notifications.id !== id; });
1431
- }
1432
- };
1433
- NotificationService.prototype.success = function (text, params, title, createSessionNotification) {
1434
- if (createSessionNotification === void 0) { createSessionNotification = true; }
1435
- text = L10nUtils.getLocalizedValue(text, params, 'OperationSuccessFull');
1436
- title = L10nUtils.getLocalizedValue(title);
1437
- this.toastrService.success(text, title, {
1438
- timeOut: 3000,
1439
- progressBar: true
1440
- });
1441
- if (createSessionNotification) {
1442
- this.addSessionNotification(text, 'success');
1443
- }
1444
- };
1445
- NotificationService.prototype.info = function (text, params, title) {
1446
- text = L10nUtils.getLocalizedValue(text, params);
1447
- title = L10nUtils.getLocalizedValue(title);
1448
- this.toastrService.info(text, title, {
1449
- timeOut: 3000,
1450
- progressBar: true
1451
- });
1452
- };
1453
- NotificationService.prototype.warning = function (text, params, title) {
1454
- text = L10nUtils.getLocalizedValue(text, params);
1455
- title = L10nUtils.getLocalizedValue(title);
1456
- this.toastrService.warning(text, title, {
1457
- timeOut: 3000,
1458
- progressBar: true
1459
- });
1460
- };
1461
- NotificationService.prototype.error = function (text, params, title, createSessionNotification) {
1462
- if (createSessionNotification === void 0) { createSessionNotification = true; }
1463
- text = L10nUtils.getLocalizedValue(text, params, 'ErrorOccured');
1464
- title = L10nUtils.getLocalizedValue(title);
1465
- this.toastrService.error(text, title, {
1466
- timeOut: 3000,
1467
- progressBar: true
1468
- });
1469
- if (createSessionNotification) {
1470
- this.addSessionNotification(text, 'error');
1471
- }
1472
- };
1473
- NotificationService.prototype.cancel = function (text, params, title) {
1474
- text = L10nUtils.getLocalizedValue(text, params, 'OperationCancelled');
1475
- title = L10nUtils.getLocalizedValue(title);
1476
- this.toastrService.info(text, title, {
1477
- timeOut: 3000,
1478
- progressBar: true
1479
- });
1480
- };
1481
- Object.defineProperty(NotificationService.prototype, "sessionNotifications", {
1482
- // SessionNotifications
1483
- get: function () {
1484
- return this._sessionNotifications.getValue();
1485
- },
1486
- set: function (val) {
1487
- this._sessionNotifications.next(val);
1488
- },
1489
- enumerable: false,
1490
- configurable: true
1491
- });
1492
- Object.defineProperty(NotificationService.prototype, "serverNotifications", {
1493
- // ServerNotifications
1494
- get: function () {
1495
- return this._serverNotifications.getValue();
1496
- },
1497
- set: function (val) {
1498
- this._serverNotifications.next(val);
1499
- },
1500
- enumerable: false,
1501
- configurable: true
1502
- });
1503
- return NotificationService;
1504
- }());
1505
- NotificationService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function NotificationService_Factory() { return new NotificationService(i0__namespace.ɵɵinject(i1__namespace$1.ToastrService)); }, token: NotificationService, providedIn: "root" });
1506
- NotificationService.decorators = [
1507
- { type: i0.Injectable, args: [{ providedIn: 'root' },] }
1508
- ];
1509
- NotificationService.ctorParameters = function () { return [
1510
- { type: i1$2.ToastrService }
1511
- ]; };
1512
-
1513
- /*
1514
- <file>
1515
- Project:
1516
- @osovitny/anatoly
1517
-
1518
- Authors:
1519
- Vadim Osovitny
1520
- Anatoly Osovitny
1521
-
1522
- Created:
1523
- 13 Nov 2017
1524
-
1525
- Version:
1526
- 1.0
1527
-
1528
- Copyright (c) 2016-2021 Osovitny Inc. All rights reserved.
1529
- </file>
1530
- */
1531
- var BaseApiService = /** @class */ (function () {
1532
- function BaseApiService(http) {
1533
- this.http = http;
1534
- }
1535
- BaseApiService.prototype.serializeParams = function (data) {
1536
- return data ? ('?' + $.param(data)) : '';
1537
- };
1538
- //api
1539
- BaseApiService.prototype.get = function (action, data, responseType) {
1540
- if (!responseType) {
1541
- responseType = 'json';
1542
- }
1543
- var url = this.baseUrl + "/" + action + this.serializeParams(data);
1544
- return this.http.get(url, { responseType: responseType }).pipe(operators.map(function (res) { return res; }));
1545
- };
1546
- BaseApiService.prototype.post = function (action, data, responseType) {
1547
- if (!responseType) {
1548
- responseType = 'text';
1549
- }
1550
- var url = this.baseUrl + "/" + action;
1551
- return this.http.post(url, data, { responseType: responseType });
1552
- };
1553
- BaseApiService.prototype.postQS = function (action, data, responseType) {
1554
- if (!responseType) {
1555
- responseType = 'text';
1556
- }
1557
- var url = this.baseUrl + "/" + action + this.serializeParams(data);
1558
- return this.http.post(url, null, { responseType: responseType });
1559
- };
1560
- BaseApiService.prototype.delete = function (action, data, responseType) {
1561
- if (!responseType) {
1562
- responseType = 'text';
1563
- }
1564
- var url = this.baseUrl + "/" + action + this.serializeParams(data);
1565
- return this.http.delete(url, { responseType: responseType });
1566
- };
1567
- //gets
1568
- BaseApiService.prototype.getExternalTextFile = function (url) {
1569
- return this.http.get(url);
1570
- };
1571
- BaseApiService.prototype.getExternalJsonFile = function (url) {
1572
- return this.http.get(url);
1573
- };
1574
- BaseApiService.prototype.getJsonFile = function (fileName) {
1575
- var jsonsUrl = AppCoreSettings.jsonsUrl;
1576
- var jsonVersion = AppCoreSettings.jsonVersion;
1577
- var isCDNEnabled = AppCoreSettings.isCDNEnabled;
1578
- var cdnSasToken = AppCoreSettings.cdnSasToken;
1579
- var url = "";
1580
- if (isCDNEnabled) {
1581
- url = jsonsUrl + "/" + fileName + cdnSasToken;
1582
- }
1583
- else {
1584
- url = jsonsUrl + "/" + fileName + '?' + jsonVersion;
1585
- }
1586
- return this.http.get(url).pipe(operators.map(function (res) { return res; }));
1587
- };
1588
- return BaseApiService;
1589
- }());
1590
- BaseApiService.decorators = [
1591
- { type: i0.Injectable }
1592
- ];
1593
- BaseApiService.ctorParameters = function () { return [
1594
- { type: i1.HttpClient }
1595
- ]; };
1596
-
1597
- var WebStorageService = /** @class */ (function () {
1598
- function WebStorageService(storage) {
1599
- this.storage =
1600
- storage === 'local' || storage === 'localStorage'
1601
- ? localStorage
1602
- : sessionStorage;
1603
- }
1604
- WebStorageService.prototype.setItem = function (key, value) {
1605
- this.storage.setItem(key, value);
1606
- };
1607
- WebStorageService.prototype.setObject = function (key, value) {
1608
- this.storage.setItem(key, JSON.stringify(value));
1609
- };
1610
- WebStorageService.prototype.getItem = function (key) {
1611
- return this.storage.getItem(key);
1612
- };
1613
- WebStorageService.prototype.getObject = function (key) {
1614
- var value = this.storage.getItem(key);
1615
- if (!value) {
1616
- return null;
1617
- }
1618
- return JSON.parse(value);
1619
- };
1620
- WebStorageService.prototype.remove = function (key) {
1621
- this.storage.removeItem(key);
1622
- };
1623
- return WebStorageService;
1624
- }());
1625
- var LocalStorageService = /** @class */ (function (_super) {
1626
- __extends(LocalStorageService, _super);
1627
- function LocalStorageService() {
1628
- return _super.call(this, 'localStorage') || this;
1629
- }
1630
- return LocalStorageService;
1631
- }(WebStorageService));
1632
- LocalStorageService.decorators = [
1633
- { type: i0.Injectable }
1634
- ];
1635
- LocalStorageService.ctorParameters = function () { return []; };
1636
- var SessionStorageService = /** @class */ (function (_super) {
1637
- __extends(SessionStorageService, _super);
1638
- function SessionStorageService() {
1639
- return _super.call(this, 'sessionStorage') || this;
1640
- }
1641
- return SessionStorageService;
1642
- }(WebStorageService));
1643
- SessionStorageService.decorators = [
1644
- { type: i0.Injectable }
1645
- ];
1646
- SessionStorageService.ctorParameters = function () { return []; };
1647
-
1648
- var AppContextService = /** @class */ (function (_super) {
1649
- __extends(AppContextService, _super);
1650
- function AppContextService(http, sessionStorage) {
1651
- var _this = _super.call(this, http) || this;
1652
- _this.http = http;
1653
- _this.sessionStorage = sessionStorage;
1654
- //Consts
1655
- _this.storageKeyName = 'appContext';
1656
- _this.subscription = null;
1657
- _this.successes = [];
1658
- _this.baseUrl = '/api/appContext';
1659
- return _this;
1660
- }
1661
- //Session
1662
- AppContextService.prototype.getCurrentFromSession = function () {
1663
- return this.sessionStorage.getObject(this.storageKeyName);
1664
- };
1665
- AppContextService.prototype.setCurrentFromSession = function (value) {
1666
- this.sessionStorage.setObject(this.storageKeyName, value);
1667
- };
1668
- AppContextService.prototype.updateCurrentIfExpired = function () {
1669
- var context = this.getCurrentFromSession();
1670
- if (!context) {
1671
- return;
1672
- }
1673
- var lu = context.lastRequested;
1674
- if (lu) {
1675
- var now = new Date();
1676
- var lastRequested = new Date(context.lastRequested);
1677
- var in2Mins = new Date(lastRequested.getFullYear(), lastRequested.getMonth(), lastRequested.getDate(), lastRequested.getHours(), lastRequested.getMinutes() + 2, 0, 0);
1678
- if (in2Mins.getTime() < now.getTime()) {
1679
- this.updateCurrent();
1680
- }
1681
- }
1682
- };
1683
- AppContextService.prototype.dataReceived = function (data) {
1684
- this.current = data;
1685
- for (var i = 0; i < this.successes.length; i++) {
1686
- var success = this.successes[i];
1687
- if (success) {
1688
- success(data);
1689
- }
1690
- }
1691
- this.successes = [];
1692
- this.subscription.unsubscribe();
1693
- this.subscription = null;
1694
- };
1695
- //Public
1696
- AppContextService.prototype.getCurrent = function (success, getCachedIfExist) {
1697
- var _this = this;
1698
- if (success === void 0) { success = null; }
1699
- if (getCachedIfExist === void 0) { getCachedIfExist = true; }
1700
- var context = this.getCurrentFromSession();
1701
- if (getCachedIfExist && context != null) {
1702
- if (success) {
1703
- success(context);
1704
- }
1705
- return;
1706
- }
1707
- if (success) {
1708
- this.successes.push(success);
1709
- }
1710
- if (this.subscription != null) {
1711
- return;
1712
- }
1713
- var now = new Date();
1714
- console.log('Requesting a new AppContext at ' + now);
1715
- this.subscription = this.get('getCurrentContext', null).subscribe(function (data) {
1716
- _this.dataReceived(data);
1717
- }, function (e) {
1718
- });
1719
- };
1720
- AppContextService.prototype.updateCurrent = function (success) {
1721
- if (success === void 0) { success = null; }
1722
- this.getCurrent(success, false);
1723
- };
1724
- AppContextService.prototype.clearCurrent = function () {
1725
- this.sessionStorage.remove(this.storageKeyName);
1726
- };
1727
- AppContextService.prototype.isUserSignedIn = function () {
1728
- return ContextInitState.isUserSignedIn;
1729
- };
1730
- AppContextService.prototype.isUserAdmin = function () {
1731
- return ContextInitState.isUserAdmin;
1732
- };
1733
- Object.defineProperty(AppContextService.prototype, "current", {
1734
- //Properties
1735
- //current
1736
- get: function () {
1737
- this.updateCurrentIfExpired();
1738
- return this.getCurrentFromSession();
1739
- },
1740
- set: function (value) {
1741
- this.setCurrentFromSession(value);
1742
- },
1743
- enumerable: false,
1744
- configurable: true
1745
- });
1746
- return AppContextService;
1747
- }(BaseApiService));
1748
- AppContextService.decorators = [
1749
- { type: i0.Injectable }
1750
- ];
1751
- AppContextService.ctorParameters = function () { return [
1752
- { type: i1.HttpClient },
1753
- { type: SessionStorageService }
1754
- ]; };
1755
-
1756
- /*
1757
- <file>
1758
- Project:
1759
- @osovitny/anatoly
1760
-
1761
- Authors:
1762
- Vadim Osovitny
1763
- Anatoly Osovitny
1764
-
1765
- Created:
1766
- 26 Jun 2020
1767
-
1768
- Version:
1769
- 1.0
1770
-
1771
- Copyright (c) 2016-2021 Osovitny Inc. All rights reserved.
1772
- </file>
1773
- */
1774
- var IdleService = /** @class */ (function () {
1775
- function IdleService() {
1776
- this.expired$ = new rxjs.Subject();
1777
- }
1778
- //Private
1779
- IdleService.prototype.resetTimeCounters = function (timeOutSeconds) {
1780
- this.timeOutSeconds = timeOutSeconds;
1781
- this.timeOutMilliSeconds = timeOutSeconds * 1000;
1782
- this.startDate = new Date();
1783
- };
1784
- IdleService.prototype.startTimer = function () {
1785
- var _this = this;
1786
- this.timer$ = rxjs.timer(this.timeOutMilliSeconds, 1 * 1000).subscribe(function (res) {
1787
- var nowDate = new Date();
1788
- var exiredDate = new Date(_this.startDate.getTime() + _this.timeOutMilliSeconds);
1789
- if (nowDate.getTime() >= exiredDate.getTime()) {
1790
- //console.log("nowDate: " + nowDate);
1791
- //console.log("exiredDate: " + exiredDate);
1792
- _this.expired$.next(true);
1793
- }
1794
- });
1795
- };
1796
- IdleService.prototype.resetTimer = function () {
1797
- this.startDate = new Date();
1798
- };
1799
- //Public
1800
- IdleService.prototype.startWatching = function (timeOutSeconds) {
1801
- var _this = this;
1802
- this.idle$ = rxjs.merge(rxjs.fromEvent(document, 'mousemove'), rxjs.fromEvent(document, 'click'), rxjs.fromEvent(document, 'mousedown'), rxjs.fromEvent(document, 'keypress'), rxjs.fromEvent(document, 'DOMMouseScroll'), rxjs.fromEvent(document, 'mousewheel'), rxjs.fromEvent(document, 'touchmove'), rxjs.fromEvent(document, 'MSPointerMove'), rxjs.fromEvent(window, 'mousemove'), rxjs.fromEvent(window, 'resize'));
1803
- this.resetTimeCounters(timeOutSeconds);
1804
- this.idleSubscription = this.idle$.subscribe(function (res) {
1805
- _this.resetTimer();
1806
- });
1807
- this.startTimer();
1808
- return this.expired$;
1809
- };
1810
- IdleService.prototype.stopWatching = function () {
1811
- this.timer$.unsubscribe();
1812
- this.idleSubscription.unsubscribe();
1813
- };
1814
- IdleService.prototype.restartIdleTimer = function (timeOutSeconds) {
1815
- this.timer$.unsubscribe();
1816
- this.resetTimeCounters(timeOutSeconds);
1817
- this.startTimer();
1818
- };
1819
- return IdleService;
1820
- }());
1821
- IdleService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function IdleService_Factory() { return new IdleService(); }, token: IdleService, providedIn: "root" });
1822
- IdleService.decorators = [
1823
- { type: i0.Injectable, args: [{
1824
- providedIn: 'root'
1825
- },] }
1826
- ];
1827
-
1828
- /*
1829
- <file>
1830
- Project:
1831
- @osovitny/anatoly
1832
-
1833
- Authors:
1834
- Vadim Osovitny
1835
- Anatoly Osovitny
1836
-
1837
- Created:
1838
- 29 Щсе 2020
1839
-
1840
- Version:
1841
- 1.0
1842
-
1843
- Copyright (c) 2016-2021 Osovitny Inc. All rights reserved.
1844
- </file>
1845
- */
1846
- var DigitalMarketingService = /** @class */ (function () {
1847
- function DigitalMarketingService(title, meta, dom) {
1848
- this.title = title;
1849
- this.meta = meta;
1850
- this.dom = dom;
1851
- }
1852
- DigitalMarketingService.prototype.updateTitle = function (title) {
1853
- this.title.setTitle(title);
1854
- };
1855
- DigitalMarketingService.prototype.updateDescription = function (desc) {
1856
- this.meta.updateTag({ name: 'description', content: desc });
1857
- };
1858
- DigitalMarketingService.prototype.updateKeywords = function (keywords) {
1859
- this.meta.updateTag({ name: 'keywords', content: keywords });
1860
- };
1861
- DigitalMarketingService.prototype.updateMetaTags = function (meta) {
1862
- var _this = this;
1863
- meta.forEach(function (m) { return _this.meta.updateTag(m); });
1864
- };
1865
- DigitalMarketingService.prototype.setCanonicalUrl = function (url) {
1866
- var canUrl = url === undefined ? this.dom.URL : url;
1867
- var link = this.dom.createElement('link');
1868
- link.setAttribute('rel', 'canonical');
1869
- this.dom.head.appendChild(link);
1870
- link.setAttribute('href', canUrl);
1871
- };
1872
- DigitalMarketingService.prototype.updateCanonicalUrl = function (url) {
1873
- var canUrl = url === undefined ? this.dom.URL : url;
1874
- var head = this.dom.getElementsByTagName('head')[0];
1875
- var link = this.dom.querySelector("link[rel='canonical']") || null;
1876
- if (link == null) {
1877
- link = this.dom.createElement('link');
1878
- head.appendChild(link);
1879
- }
1880
- link.setAttribute('rel', 'canonical');
1881
- link.setAttribute('href', canUrl);
1882
- };
1883
- return DigitalMarketingService;
1884
- }());
1885
- DigitalMarketingService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function DigitalMarketingService_Factory() { return new DigitalMarketingService(i0__namespace.ɵɵinject(i1__namespace$2.Title), i0__namespace.ɵɵinject(i1__namespace$2.Meta), i0__namespace.ɵɵinject(i2__namespace.DOCUMENT)); }, token: DigitalMarketingService, providedIn: "root" });
1886
- DigitalMarketingService.decorators = [
1887
- { type: i0.Injectable, args: [{
1888
- providedIn: 'root'
1889
- },] }
1890
- ];
1891
- DigitalMarketingService.ctorParameters = function () { return [
1892
- { type: i1$3.Title },
1893
- { type: i1$3.Meta },
1894
- { type: undefined, decorators: [{ type: i0.Inject, args: [i2.DOCUMENT,] }] }
1895
- ]; };
1896
-
1897
- /*
1898
- <file>
1899
- Project:
1900
- @osovitny/anatoly
1901
-
1902
- Authors:
1903
- Vadim Osovitny
1904
- Anatoly Osovitny
1905
-
1906
- Created:
1907
- 29 Nov 2020
1908
-
1909
- Version:
1910
- 1.0
1911
-
1912
- Copyright (c) 2016-2021 Osovitny Inc. All rights reserved.
1913
- </file>
1914
- */
1915
- var GoogleAnalyticsService = /** @class */ (function () {
1916
- function GoogleAnalyticsService(router) {
1917
- this.router = router;
1918
- /*
1919
- https://yashints.dev/blog/2019/02/12/angular-ga-tagmanager
1920
- https://developers.google.com/analytics/devguides/collection/gtagjs/pages
1921
- https://developers.google.com/analytics/devguides/collection/upgrade/analyticsjs
1922
- */
1923
- }
1924
- GoogleAnalyticsService.prototype.subscribe = function () {
1925
- this.subscription = this.router.events.subscribe(function (event) {
1926
- if (event instanceof router.NavigationEnd) {
1927
- if (window.ga) {
1928
- window.ga('set', 'page', event.urlAfterRedirects);
1929
- window.ga('send', 'pageview');
1930
- }
1931
- }
1932
- });
1933
- };
1934
- GoogleAnalyticsService.prototype.unsubscribe = function () {
1935
- if (this.subscription) {
1936
- this.subscription.unsubscribe();
1937
- }
1938
- };
1939
- return GoogleAnalyticsService;
1940
- }());
1941
- GoogleAnalyticsService.decorators = [
1942
- { type: i0.Injectable }
1943
- ];
1944
- GoogleAnalyticsService.ctorParameters = function () { return [
1945
- { type: router.Router }
1946
- ]; };
1947
-
1948
- /*
1949
- <file>
1950
- Project:
1951
- @osovitny/anatoly
1952
-
1953
- Authors:
1954
- Vadim Osovitny
1955
- Anatoly Osovitny
1956
-
1957
- Created:
1958
- 29 June 2020
1959
-
1960
- Copyright (c) 2016-2021 Osovitny Inc. All rights reserved.
1961
- </file>
1962
- */
1963
- exports.InjectorInstance = void 0;
1964
- var AnatolyCoreModule = /** @class */ (function () {
1965
- function AnatolyCoreModule(injector, parentModule) {
1966
- this.injector = injector;
1967
- throwIfAlreadyLoaded(parentModule, 'AnatolyCoreModule');
1968
- exports.InjectorInstance = this.injector;
1969
- }
1970
- return AnatolyCoreModule;
1971
- }());
1972
- AnatolyCoreModule.decorators = [
1973
- { type: i0.NgModule, args: [{
1974
- imports: [i2.CommonModule],
1975
- exports: [],
1976
- providers: [
1977
- LoggingService,
1978
- NotificationService,
1979
- AppContextService,
1980
- LoadingService,
1981
- DigitalMarketingService,
1982
- GoogleAnalyticsService,
1983
- LocalStorageService,
1984
- SessionStorageService
1985
- ],
1986
- },] }
1987
- ];
1988
- AnatolyCoreModule.ctorParameters = function () { return [
1989
- { type: i0.Injector },
1990
- { type: AnatolyCoreModule, decorators: [{ type: i0.Optional }, { type: i0.SkipSelf }] }
1991
- ]; };
1992
-
1993
- /*
1994
- <file>
1995
- Project:
1996
- @osovitny/anatoly
1997
-
1998
- Authors:
1999
- Vadim Osovitny
2000
- Anatoly Osovitny
2001
-
2002
- Created:
2003
- 26 Jun 2020
2004
-
2005
- Copyright (c) 2016-2021 Osovitny Inc. All rights reserved.
2006
- </file>
2007
- */
2008
- var Subs = /** @class */ (function () {
2009
- function Subs() {
2010
- this.subs = [];
2011
- }
2012
- Subs.prototype.add = function () {
2013
- var subscriptions = [];
2014
- for (var _i = 0; _i < arguments.length; _i++) {
2015
- subscriptions[_i] = arguments[_i];
2016
- }
2017
- this.subs = this.subs.concat(subscriptions);
2018
- };
2019
- Object.defineProperty(Subs.prototype, "sink", {
2020
- set: function (subscription) {
2021
- this.subs.push(subscription);
2022
- },
2023
- enumerable: false,
2024
- configurable: true
2025
- });
2026
- Subs.prototype.unsubscribe = function () {
2027
- this.subs.forEach(function (sub) { return sub && sub.unsubscribe(); });
2028
- this.subs = [];
2029
- };
2030
- return Subs;
2031
- }());
2032
-
2033
- /*
2034
- <file>
2035
- Project:
2036
- @osovitny/anatoly
2037
-
2038
- Authors:
2039
- Vadim Osovitny
2040
- Anatoly Osovitny
2041
-
2042
- Created:
2043
- 19 March 2020
2044
-
2045
- Copyright (c) 2016-2021 Osovitny Inc. All rights reserved.
2046
- </file>
2047
- */
2048
- var Utils = /** @class */ (function () {
2049
- function Utils() {
2050
- }
2051
- Utils.getValueByNameInQS = function (name) {
2052
- return Utils.getValueByName(location.search, name);
2053
- };
2054
- Utils.getValueByName = function (url, name) {
2055
- name = name.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]');
2056
- // tslint:disable-next-line:one-variable-per-declaration
2057
- var regex = new RegExp('[\\?&]' + name + '=([^&#]*)'), results = regex.exec(url);
2058
- return results === null ? '' : decodeURIComponent(results[1].replace(/\+/g, ' '));
2059
- };
2060
- Utils.copyToClipBoard = function (event, val) {
2061
- event.preventDefault();
2062
- var selBox = document.createElement('textarea');
2063
- selBox.style.position = 'fixed';
2064
- selBox.style.left = '0';
2065
- selBox.style.top = '0';
2066
- selBox.style.opacity = '0';
2067
- selBox.value = val;
2068
- document.body.appendChild(selBox);
2069
- selBox.focus();
2070
- selBox.select();
2071
- document.execCommand('copy');
2072
- document.body.removeChild(selBox);
2073
- };
2074
- Utils.downloadFile = function (name, url) {
2075
- var link = document.createElement('a');
2076
- link.download = name;
2077
- link.href = url;
2078
- link.click();
2079
- };
2080
- Utils.downloadBlobFile = function (value, fileName) {
2081
- if (window.navigator.msSaveOrOpenBlob) {
2082
- window.navigator.msSaveOrOpenBlob(value, fileName);
2083
- }
2084
- else {
2085
- var downloadURL = window.URL.createObjectURL(value);
2086
- Utils.downloadFile(fileName, downloadURL);
2087
- }
2088
- };
2089
- /*
2090
- Author:
2091
- https://medium.com/@mhagemann/the-ultimate-way-to-slugify-a-url-string-in-javascript-b8e4a0d849e1
2092
- */
2093
- Utils.slugify = function (text, prefix, postfix) {
2094
- if (prefix === void 0) { prefix = ''; }
2095
- if (postfix === void 0) { postfix = ''; }
2096
- var a = 'àáâäæãåāăąçćčđďèéêëēėęěğǵḧîïíīįìłḿñńǹňôöòóœøōõőṕŕřßśšşșťțûüùúūǘůűųẃẍÿýžźż·/_,:;';
2097
- var b = 'aaaaaaaaaacccddeeeeeeeegghiiiiiilmnnnnoooooooooprrsssssttuuuuuuuuuwxyyzzz------';
2098
- var p = new RegExp(a.split('').join('|'), 'g');
2099
- /*
2100
- https://css-tricks.com/snippets/javascript/strip-html-tags-in-javascript/
2101
- https://stackoverflow.com/questions/822452/strip-html-from-text-javascript
2102
- */
2103
- text = text.replace(/(<([^>]+)>)/gi, '');
2104
- var result = text
2105
- .toString()
2106
- .toLowerCase()
2107
- .replace(/\s+/g, '-') // Replace spaces with -
2108
- .replace(p, function (c) { return b.charAt(a.indexOf(c)); }) // Replace special characters
2109
- .replace(/&/g, '-and-') // Replace & with 'and'
2110
- .replace(/[^\w\-]+/g, '') // Remove all non-word characters
2111
- .replace(/\-\-+/g, '-') // Replace multiple - with single -
2112
- .replace(/^-+/, '') // Trim - from start of text
2113
- .replace(/-+$/, ''); // Trim - from end of text
2114
- return prefix + result + postfix;
2115
- };
2116
- return Utils;
2117
- }());
2118
-
2119
- var BaseGridReadService = /** @class */ (function (_super) {
2120
- __extends(BaseGridReadService, _super);
2121
- function BaseGridReadService(http) {
2122
- var _this = _super.call(this, []) || this;
2123
- _this.http = http;
2124
- _this.data = [];
2125
- return _this;
2126
- }
2127
- BaseGridReadService.prototype.serializeParams = function (data) {
2128
- return data ? ('?' + $.param(data)) : '';
2129
- };
2130
- BaseGridReadService.prototype.read = function (params, success, error) {
2131
- var _this = this;
2132
- if (this.data.length) {
2133
- return _super.prototype.next.call(this, this.data);
2134
- }
2135
- var url = this.baseReadUrl;
2136
- if (typeof params === 'undefined') {
2137
- params = this.savedReadParams;
2138
- }
2139
- if (params) {
2140
- url = this.baseReadUrl + ("" + this.serializeParams(params));
2141
- this.savedReadParams = params;
2142
- }
2143
- this.http.get(url).pipe(operators.map(function (res) { return res; })).subscribe(function (data) {
2144
- _super.prototype.next.call(_this, data);
2145
- if (success)
2146
- success();
2147
- }, function (e) {
2148
- if (error)
2149
- error(e);
2150
- });
2151
- };
2152
- return BaseGridReadService;
2153
- }(rxjs.BehaviorSubject));
2154
- BaseGridReadService.decorators = [
2155
- { type: i0.Injectable }
2156
- ];
2157
- BaseGridReadService.ctorParameters = function () { return [
2158
- { type: i1.HttpClient }
2159
- ]; };
2160
-
2161
- var BaseGridEditService = /** @class */ (function (_super) {
2162
- __extends(BaseGridEditService, _super);
2163
- function BaseGridEditService(http) {
2164
- var _this = _super.call(this, http) || this;
2165
- _this.http = http;
2166
- return _this;
2167
- }
2168
- BaseGridEditService.prototype.reset = function () {
2169
- this.data = [];
2170
- };
2171
- BaseGridEditService.prototype.resetItem = function (dataItem) {
2172
- if (!dataItem) {
2173
- return;
2174
- }
2175
- //find orignal data item
2176
- var originalDataItem = this.data.find(function (item) { return item.Id === dataItem.Id; });
2177
- //revert changes
2178
- Object.assign(originalDataItem, dataItem);
2179
- _super.prototype.next.call(this, this.data);
2180
- };
2181
- BaseGridEditService.prototype.save = function (data, isNew, sucess) {
2182
- var _this = this;
2183
- var action = isNew ? 'add' : 'update';
2184
- this.reset();
2185
- this.post(action, data).subscribe(function () {
2186
- }, function () {
2187
- _this.read();
2188
- }, function () {
2189
- _this.read();
2190
- if (sucess)
2191
- sucess();
2192
- });
2193
- };
2194
- BaseGridEditService.prototype.delete = function (data, sucess) {
2195
- var _this = this;
2196
- this.reset();
2197
- var url = this.baseUrl + "/delete" + this.serializeParams(data);
2198
- return this.http.delete(url).subscribe(function () {
2199
- _this.read();
2200
- if (sucess)
2201
- sucess();
2202
- }, function () {
2203
- _this.read();
2204
- });
2205
- };
2206
- BaseGridEditService.prototype.post = function (action, data) {
2207
- var url = this.baseUrl + "/" + action + this.serializeParams(data);
2208
- return this.http.post(url, data).pipe(operators.map(function (res) { return res; }));
2209
- };
2210
- return BaseGridEditService;
2211
- }(BaseGridReadService));
2212
- BaseGridEditService.decorators = [
2213
- { type: i0.Injectable }
2214
- ];
2215
- BaseGridEditService.ctorParameters = function () { return [
2216
- { type: i1.HttpClient }
2217
- ]; };
2218
-
2219
- /*
2220
- <file>
2221
- Project:
2222
- @osovitny/anatoly
2223
-
2224
- Authors:
2225
- Vadim Osovitny
2226
- Anatoly Osovitny
2227
-
2228
- Created:
2229
- 30 April 2020
2230
-
2231
- Version:
2232
- 1.0
2233
-
2234
- Copyright (c) 2016-2021 Osovitny Inc. All rights reserved.
2235
- </file>
2236
- */
2237
- var consts = {
2238
- billingApiPath: 'api/billing',
2239
- // Notifications API
2240
- notificationsApiPath: 'api/notifications',
2241
- };
2242
-
2243
- var NotificationsApiService = /** @class */ (function (_super) {
2244
- __extends(NotificationsApiService, _super);
2245
- function NotificationsApiService(http) {
2246
- var _this = _super.call(this, http) || this;
2247
- _this.http = http;
2248
- _this.baseUrl = consts.notificationsApiPath;
2249
- return _this;
2250
- }
2251
- NotificationsApiService.prototype.retrieveNotifications = function () {
2252
- return this.get('retrieveNotifications');
2253
- };
2254
- return NotificationsApiService;
2255
- }(BaseApiService));
2256
- NotificationsApiService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function NotificationsApiService_Factory() { return new NotificationsApiService(i0__namespace.ɵɵinject(i1__namespace$3.HttpClient)); }, token: NotificationsApiService, providedIn: "root" });
2257
- NotificationsApiService.decorators = [
2258
- { type: i0.Injectable, args: [{
2259
- providedIn: 'root'
2260
- },] }
2261
- ];
2262
- NotificationsApiService.ctorParameters = function () { return [
2263
- { type: i1.HttpClient }
2264
- ]; };
2265
-
2266
- var BillingApiService = /** @class */ (function (_super) {
2267
- __extends(BillingApiService, _super);
2268
- function BillingApiService(http) {
2269
- var _this = _super.call(this, http) || this;
2270
- _this.http = http;
2271
- _this.baseUrl = consts.billingApiPath;
2272
- return _this;
2273
- }
2274
- BillingApiService.prototype.requestNewSubscription = function (requestedPlan, success, error) {
2275
- this.postQS("requestNewSubscription", { requestedPlan: requestedPlan }).subscribe(function (data) {
2276
- if (success)
2277
- success();
2278
- }, function (e) {
2279
- if (error)
2280
- error();
2281
- });
2282
- };
2283
- BillingApiService.prototype.cancelRequestedSubscription = function (success, error) {
2284
- this.postQS("cancelRequestedSubscription", null).subscribe(function (data) {
2285
- if (success)
2286
- success();
2287
- }, function (e) {
2288
- if (error)
2289
- error();
2290
- });
2291
- };
2292
- BillingApiService.prototype.buyAccess = function (requestedPlan, success, error) {
2293
- this.postQS("buyAccess", { requestedPlan: requestedPlan }).subscribe(function (data) {
2294
- if (success)
2295
- success();
2296
- }, function (e) {
2297
- if (error)
2298
- error();
2299
- });
2300
- };
2301
- return BillingApiService;
2302
- }(BaseApiService));
2303
- BillingApiService.decorators = [
2304
- { type: i0.Injectable }
2305
- ];
2306
- BillingApiService.ctorParameters = function () { return [
2307
- { type: i1.HttpClient }
2308
- ]; };
2309
-
2310
- /*
2311
- <file>
2312
- Project:
2313
- @osovitny/anatoly
2314
-
2315
- Authors:
2316
- Vadim Osovitny
2317
- Anatoly Osovitny
2318
-
2319
- Created:
2320
- 4 Mar 2020
2321
-
2322
- Version:
2323
- 1.0
2324
-
2325
- Copyright (c) 2016-2021 Osovitny Inc. All rights reserved.
2326
- </file>
2327
- */
2328
- var AnatolyDataModule = /** @class */ (function () {
2329
- function AnatolyDataModule(parentModule) {
2330
- throwIfAlreadyLoaded(parentModule, 'AnatolyDataModule');
2331
- }
2332
- return AnatolyDataModule;
2333
- }());
2334
- AnatolyDataModule.decorators = [
2335
- { type: i0.NgModule, args: [{
2336
- imports: [
2337
- i2.CommonModule
2338
- ],
2339
- providers: [
2340
- BillingApiService
2341
- ],
2342
- },] }
2343
- ];
2344
- AnatolyDataModule.ctorParameters = function () { return [
2345
- { type: AnatolyDataModule, decorators: [{ type: i0.Optional }, { type: i0.SkipSelf }] }
2346
- ]; };
2347
-
2348
- /*
2349
- <file>
2350
- Project:
2351
- @osovitny/anatoly
2352
-
2353
- Authors:
2354
- Vadim Osovitny
2355
- Anatoly Osovitny
2356
-
2357
- Created:
2358
- 28 Aug 2018
2359
-
2360
- Version:
2361
- 1.0
2362
-
2363
- Copyright (c) 2016-2021 Osovitny Inc. All rights reserved.
2364
- </file>
2365
- */
2366
- var BaseComponent = /** @class */ (function () {
2367
- function BaseComponent() {
2368
- this.subs = new Subs();
2369
- }
2370
- BaseComponent.prototype.getQSId = function () {
2371
- var id = Utils.getValueByNameInQS("id");
2372
- if (typeof id === "undefined" || id == "")
2373
- return null;
2374
- return id;
2375
- };
2376
- BaseComponent.prototype.ngOnDestroy = function () {
2377
- this.subs.unsubscribe();
2378
- };
2379
- return BaseComponent;
2380
- }());
2381
- BaseComponent.decorators = [
2382
- { type: i0.Component, args: [{
2383
- template: ''
2384
- },] }
2385
- ];
2386
-
2387
- var BaseEditComponent = /** @class */ (function (_super) {
2388
- __extends(BaseEditComponent, _super);
2389
- function BaseEditComponent() {
2390
- var _this = _super.call(this) || this;
2391
- _this.formSubmitted = false;
2392
- return _this;
2393
- }
2394
- BaseEditComponent.prototype.isActionAdding = function () {
2395
- var id = Utils.getValueByNameInQS("id");
2396
- if (typeof id === "undefined" || id == "")
2397
- return true;
2398
- return false;
2399
- };
2400
- BaseEditComponent.prototype.getEntityId = function () {
2401
- return this.getQSId();
2402
- };
2403
- BaseEditComponent.prototype.isControlValid = function (name, frmGroup) {
2404
- if (frmGroup === void 0) { frmGroup = null; }
2405
- return !this.isControlInvalid(name, frmGroup);
2406
- };
2407
- BaseEditComponent.prototype.isControlInvalid = function (name, frmGroup) {
2408
- if (frmGroup === void 0) { frmGroup = null; }
2409
- if (typeof name === "undefined" || name == "") {
2410
- return false;
2411
- }
2412
- var fg = frmGroup ? frmGroup : this.formGroup;
2413
- if (!fg) {
2414
- return false;
2415
- }
2416
- if (fg.get(name)) {
2417
- return ((this.formSubmitted && fg.get(name).invalid) ||
2418
- (fg.get(name).touched && fg.get(name).invalid));
2419
- }
2420
- return false;
2421
- };
2422
- //FormGroup functions
2423
- BaseEditComponent.prototype.getFormValue = function (name, frmGroup) {
2424
- if (frmGroup === void 0) { frmGroup = null; }
2425
- var fg = frmGroup ? frmGroup : this.formGroup;
2426
- return fg.controls[name].value;
2427
- };
2428
- BaseEditComponent.prototype.setFormValue = function (name, value, frmGroup) {
2429
- if (frmGroup === void 0) { frmGroup = null; }
2430
- var fg = frmGroup ? frmGroup : this.formGroup;
2431
- fg.controls[name].setValue(value);
2432
- };
2433
- BaseEditComponent.prototype.getFormGroupValue = function (groupName, name, frmGroup) {
2434
- if (frmGroup === void 0) { frmGroup = null; }
2435
- var fg = frmGroup ? frmGroup : this.formGroup;
2436
- return fg.controls[groupName].get(name).value;
2437
- };
2438
- BaseEditComponent.prototype.setFormGroupValue = function (groupName, name, value, frmGroup) {
2439
- if (frmGroup === void 0) { frmGroup = null; }
2440
- var fg = frmGroup ? frmGroup : this.formGroup;
2441
- fg.controls[groupName].get(name).setValue(value);
2442
- };
2443
- /**
2444
- * Add control to form group
2445
- * @param name
2446
- * @param formControl
2447
- * @param formGroup
2448
- */
2449
- BaseEditComponent.prototype.addControl = function (name, formControl, frmGroup) {
2450
- if (frmGroup === void 0) { frmGroup = null; }
2451
- var fg = frmGroup ? frmGroup : this.formGroup;
2452
- fg.addControl(name, formControl);
2453
- };
2454
- /**
2455
- * Removes control from form group
2456
- * @param name
2457
- * @param formGroup
2458
- */
2459
- BaseEditComponent.prototype.removeControl = function (name, frmGroup) {
2460
- if (frmGroup === void 0) { frmGroup = null; }
2461
- var fg = frmGroup ? frmGroup : this.formGroup;
2462
- if (fg.get(name)) {
2463
- fg.removeControl(name);
2464
- }
2465
- };
2466
- /**
2467
- * return new form control
2468
- * @param formState
2469
- * @param validatorOrOpts
2470
- * @param asyncValidator
2471
- */
2472
- BaseEditComponent.prototype.createFormControl = function (formState, validatorOrOpts, asyncValidator) {
2473
- return new forms.FormControl(formState, validatorOrOpts, asyncValidator);
2474
- };
2475
- /**
2476
- * Set error to control
2477
- * @param controlName formControl name
2478
- * @param err error expect {erroname: boolean} format
2479
- * @param formGroup Specific form group. default it will apply on this.formGroup property
2480
- */
2481
- BaseEditComponent.prototype.setControlError = function (controlName, err, frmGroup) {
2482
- if (frmGroup === void 0) { frmGroup = null; }
2483
- var _a;
2484
- var fg = frmGroup ? frmGroup : this.formGroup;
2485
- (_a = fg.get(controlName)) === null || _a === void 0 ? void 0 : _a.setErrors(err);
2486
- };
2487
- /**
2488
- * Set {invalid: true} for the specified form
2489
- * @param controlName form control name
2490
- * @param formGroup
2491
- */
2492
- BaseEditComponent.prototype.setInValidError = function (controlName, frmGroup) {
2493
- if (frmGroup === void 0) { frmGroup = null; }
2494
- var _a;
2495
- var fg = frmGroup ? frmGroup : this.formGroup;
2496
- (_a = fg.get(controlName)) === null || _a === void 0 ? void 0 : _a.setErrors({ invalid: true });
2497
- };
2498
- Object.defineProperty(BaseEditComponent.prototype, "fc", {
2499
- /**
2500
- * returns formgroup controls.
2501
- * main use case is used in html pages
2502
- */
2503
- get: function () {
2504
- return this.formGroup.controls;
2505
- },
2506
- enumerable: false,
2507
- configurable: true
2508
- });
2509
- return BaseEditComponent;
2510
- }(BaseComponent));
2511
- BaseEditComponent.decorators = [
2512
- { type: i0.Component, args: [{
2513
- template: ''
2514
- },] }
2515
- ];
2516
- BaseEditComponent.ctorParameters = function () { return []; };
2517
- BaseEditComponent.propDecorators = {
2518
- formGroup: [{ type: i0.Input }],
2519
- formSubmitted: [{ type: i0.Input }]
2520
- };
2521
-
2522
- var BaseDialog = /** @class */ (function (_super) {
2523
- __extends(BaseDialog, _super);
2524
- function BaseDialog() {
2525
- var _this = _super.call(this) || this;
2526
- _this._opened = false;
2527
- return _this;
2528
- }
2529
- Object.defineProperty(BaseDialog.prototype, "opened", {
2530
- get: function () {
2531
- return this._opened;
2532
- },
2533
- enumerable: false,
2534
- configurable: true
2535
- });
2536
- BaseDialog.prototype.open = function () {
2537
- this._opened = true;
2538
- };
2539
- BaseDialog.prototype.close = function () {
2540
- this._opened = false;
2541
- };
2542
- return BaseDialog;
2543
- }(BaseEditComponent));
2544
- BaseDialog.decorators = [
2545
- { type: i0.Component, args: [{
2546
- template: ''
2547
- },] }
2548
- ];
2549
- BaseDialog.ctorParameters = function () { return []; };
2550
- BaseDialog.propDecorators = {
2551
- opened: [{ type: i0.Input }]
2552
- };
2553
-
2554
- /*
2555
- <file>
2556
- Project:
2557
- @osovitny/anatoly
2558
-
2559
- Authors:
2560
- Vadim Osovitny
2561
- Anatoly Osovitny
2562
-
2563
- Created:
2564
- 14 Aug 2018
2565
-
2566
- Copyright (c) 2016-2021 Osovitny Inc. All rights reserved.
2567
- </file>
2568
- */
2569
- var BuyAccessButtonComponent = /** @class */ (function () {
2570
- function BuyAccessButtonComponent(appContext, api) {
2571
- this.appContext = appContext;
2572
- this.api = api;
2573
- this.contextUpdated = false;
2574
- this.isUserSignedIn = false;
2575
- this.currentPlan = 0;
2576
- this.currentPlanTitle = '';
2577
- }
2578
- BuyAccessButtonComponent.prototype.ngOnInit = function () {
2579
- var _this = this;
2580
- if (!this.appContext.isUserSignedIn()) {
2581
- this.contextUpdated = true;
2582
- return;
2583
- }
2584
- this.appContext.getCurrent(function (current) {
2585
- _this.isUserSignedIn = current.isUserSignedIn;
2586
- if (_this.isUserSignedIn) {
2587
- _this.currentPlan = current.account.billingPlan;
2588
- _this.currentPlanTitle = current.account.billingPlanAsString;
2589
- }
2590
- _this.contextUpdated = true;
2591
- });
2592
- };
2593
- BuyAccessButtonComponent.prototype.onBuyPlan = function () {
2594
- var text = "Requested plan: " + this.plantitle + " ";
2595
- var that = this;
2596
- Alerts.areYouSure(text, 'Buying access', 'Confirm change', 'Cancel', function () {
2597
- that.api.buyAccess(that.plan, function () {
2598
- Alerts.success('Access Granted', null, null, function () {
2599
- window.location.reload();
2600
- });
2601
- });
2602
- });
2603
- };
2604
- return BuyAccessButtonComponent;
2605
- }());
2606
- BuyAccessButtonComponent.decorators = [
2607
- { type: i0.Component, args: [{
2608
- selector: 'anatoly-buyaccess-button',
2609
- 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"
2610
- },] }
2611
- ];
2612
- BuyAccessButtonComponent.ctorParameters = function () { return [
2613
- { type: AppContextService },
2614
- { type: BillingApiService }
2615
- ]; };
2616
- BuyAccessButtonComponent.propDecorators = {
2617
- plan: [{ type: i0.Input }],
2618
- plantitle: [{ type: i0.Input }]
2619
- };
2620
-
2621
- /*
2622
- <file>
2623
- Project:
2624
- @osovitny/anatoly
2625
-
2626
- Authors:
2627
- Vadim Osovitny
2628
- Anatoly Osovitny
2629
-
2630
- Created:
2631
- 1 Jun 2018
2632
-
2633
- Version:
2634
- 1.0
2635
-
2636
- Copyright (c) 2016-2021 Osovitny Inc. All rights reserved.
2637
- </file>
2638
- */
2639
- var SubscribePlanButtonComponent = /** @class */ (function () {
2640
- function SubscribePlanButtonComponent(appcontext) {
2641
- this.appcontext = appcontext;
2642
- this.contextUpdated = false;
2643
- this.isUserSignedIn = false;
2644
- this.currentPlan = 0;
2645
- this.currentPlanTitle = "";
2646
- this.requestedPlan = 0;
2647
- this.requestedPlanTitle = "";
2648
- }
2649
- SubscribePlanButtonComponent.prototype.ngOnInit = function () {
2650
- var _this = this;
2651
- if (!this.appcontext.isUserSignedIn()) {
2652
- this.contextUpdated = true;
2653
- return;
2654
- }
2655
- this.appcontext.getCurrent(function (current) {
2656
- _this.isUserSignedIn = current.isUserSignedIn;
2657
- if (_this.isUserSignedIn) {
2658
- _this.currentPlan = current.account.billingPlan;
2659
- _this.currentPlanTitle = current.account.billingPlanAsString;
2660
- _this.requestedPlan = current.account.requestedBillingPlan;
2661
- _this.requestedPlanTitle = current.account.requestedBillingPlanAsString;
2662
- }
2663
- _this.contextUpdated = true;
2664
- });
2665
- };
2666
- return SubscribePlanButtonComponent;
2667
- }());
2668
- SubscribePlanButtonComponent.decorators = [
2669
- { type: i0.Component, args: [{
2670
- selector: "anatoly-subscribe-plan-button",
2671
- 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=\"requestedPlan != null && requestedPlan != 0 && plan == requestedPlan\">\r\n Requested\r\n </button>\r\n\r\n <anatoly-upgrade-plan-button *ngIf=\"plan != currentPlan && plan != requestedPlan\"\r\n [currentplantitle]=\"currentPlanTitle\"\r\n [requestedplan]=plan\r\n [requestedplantitle]=\"plantitle\">\r\n </anatoly-upgrade-plan-button>\r\n </div>\r\n</div>\r\n"
2672
- },] }
2673
- ];
2674
- SubscribePlanButtonComponent.ctorParameters = function () { return [
2675
- { type: AppContextService }
2676
- ]; };
2677
- SubscribePlanButtonComponent.propDecorators = {
2678
- plan: [{ type: i0.Input }],
2679
- plantitle: [{ type: i0.Input }]
2680
- };
2681
-
2682
- /*
2683
- <file>
2684
- Project:
2685
- @osovitny/anatoly
2686
-
2687
- Authors:
2688
- Vadim Osovitny
2689
- Anatoly Osovitny
2690
-
2691
- Created:
2692
- 12 Nov 2017
2693
-
2694
- Version:
2695
- 1.0
2696
-
2697
- Copyright (c) 2016-2021 Osovitny Inc. All rights reserved.
2698
- </file>
2699
- */
2700
- // Services
2701
- var UpgradePlanButtonComponent = /** @class */ (function () {
2702
- function UpgradePlanButtonComponent(api) {
2703
- this.api = api;
2704
- }
2705
- UpgradePlanButtonComponent.prototype.onUpgradePlan = function () {
2706
- var text = "Current plan: " + this.currentplantitle + " New plan: " + this.requestedplantitle;
2707
- var that = this;
2708
- Alerts.areYouSure(text, 'Change billing plan', 'Confirm change', 'Cancel', function () {
2709
- that.api.requestNewSubscription(that.requestedplan, function () {
2710
- Alerts.success('Your request for changing plan has been sent.', null, null, function () {
2711
- window.location.reload();
2712
- });
2713
- });
2714
- });
2715
- };
2716
- return UpgradePlanButtonComponent;
2717
- }());
2718
- UpgradePlanButtonComponent.decorators = [
2719
- { type: i0.Component, args: [{
2720
- selector: 'anatoly-upgrade-plan-button',
2721
- template: "<button class=\"btn btn-block btn-primary\" (click)=\"onUpgradePlan()\">\r\n Upgrade\r\n</button>\r\n"
2722
- },] }
2723
- ];
2724
- UpgradePlanButtonComponent.ctorParameters = function () { return [
2725
- { type: BillingApiService }
2726
- ]; };
2727
- UpgradePlanButtonComponent.propDecorators = {
2728
- currentplantitle: [{ type: i0.Input }],
2729
- requestedplan: [{ type: i0.Input }],
2730
- requestedplantitle: [{ type: i0.Input }]
2731
- };
2732
-
2733
- /*
2734
- <file>
2735
- Project:
2736
- @osovitny/anatoly
2737
-
2738
- Authors:
2739
- Vadim Osovitny
2740
- Anatoly Osovitny
2741
-
2742
- Created:
2743
- 23 Apr 2018
2744
-
2745
- Version:
2746
- 1.0
2747
-
2748
- Copyright (c) 2016-2021 Osovitny Inc. All rights reserved.
2749
- </file>
2750
- */
2751
- var ContentHeaderComponent = /** @class */ (function () {
2752
- function ContentHeaderComponent() {
2753
- }
2754
- ContentHeaderComponent.prototype.ngOnInit = function () {
2755
- if (this.title == null) {
2756
- this.title = "";
2757
- }
2758
- };
2759
- return ContentHeaderComponent;
2760
- }());
2761
- ContentHeaderComponent.decorators = [
2762
- { type: i0.Component, args: [{
2763
- selector: "anatoly-content-header",
2764
- template: "<h2 class=\"page-header\">\r\n {{title}}\r\n <!--<small>Optional {{title}}</small>-->\r\n</h2>\r\n"
2765
- },] }
2766
- ];
2767
- ContentHeaderComponent.propDecorators = {
2768
- title: [{ type: i0.Input }]
2769
- };
2770
-
2771
- /*
2772
- <file>
2773
- Project:
2774
- @osovitny/anatoly
2775
-
2776
- Authors:
2777
- Vadim Osovitny
2778
- Anatoly Osovitny
2779
-
2780
- Created:
2781
- 12 Dec 2017
2782
-
2783
- Version:
2784
- 1.0
2785
-
2786
- Copyright (c) 2016-2021 Osovitny Inc. All rights reserved.
2787
- </file>
2788
- */
2789
- var DefaultEditorOptions = {
2790
- placeholderText: "Edit Your Content Here",
2791
- charCounterCount: true,
2792
- heightMin: 100,
2793
- toolbarInline: false,
2794
- toolbarButtons: {
2795
- moreText: {
2796
- buttons: [
2797
- "bold",
2798
- "italic",
2799
- "underline",
2800
- "strikeThrough",
2801
- "subscript",
2802
- "superscript",
2803
- "fontFamily",
2804
- "fontSize",
2805
- "textColor",
2806
- "backgroundColor",
2807
- "inlineClass",
2808
- "inlineStyle",
2809
- ],
2810
- },
2811
- moreParagraph: {
2812
- buttons: [
2813
- "alignLeft",
2814
- "alignCenter",
2815
- "formatOLSimple",
2816
- "alignRight",
2817
- "alignJustify",
2818
- "formatOL",
2819
- "formatUL",
2820
- "paragraphFormat",
2821
- "paragraphStyle",
2822
- "lineHeight",
2823
- "outdent",
2824
- "indent",
2825
- "quote",
2826
- ],
2827
- },
2828
- moreRich: {
2829
- buttons: [
2830
- "insertLink",
2831
- "insertImage",
2832
- "insertTable",
2833
- "emoticons",
2834
- "fontAwesome",
2835
- "specialCharacters",
2836
- "embedly",
2837
- ],
2838
- },
2839
- moreMisc: {
2840
- buttons: [
2841
- "selectAll",
2842
- "clearFormatting",
2843
- "html",
2844
- "undo",
2845
- "redo",
2846
- "fullscreen",
2847
- ],
2848
- align: "right",
2849
- },
2850
- },
2851
- /*
2852
- Upload:
2853
- https://www.froala.com/wysiwyg-editor/docs/concepts/image/upload
2854
- */
2855
- imageUploadURL: "/api/htmlEditor/uploadImage",
2856
- imageAllowedTypes: ["jpeg", "jpg", "png"],
2857
- imageUploadParams: { uploadType: "", uploadParentId: "" },
2858
- };
2859
-
2860
- var BaseHtmlEditorComponent = /** @class */ (function (_super) {
2861
- __extends(BaseHtmlEditorComponent, _super);
2862
- function BaseHtmlEditorComponent() {
2863
- var _this = _super.call(this) || this;
2864
- _this.froalaEditorInitialized = false;
2865
- _this.afterInitializedActions = [];
2866
- // Inputs
2867
- _this.editorLabelText = "Html";
2868
- _this.editorOptions = {};
2869
- return _this;
2870
- }
2871
- BaseHtmlEditorComponent.prototype.ngOnInit = function () {
2872
- var opt = this.editorOptions;
2873
- if (typeof this.editorOptions == "string") {
2874
- opt = JSON.parse(this.editorOptions);
2875
- }
2876
- var newOptions = $.extend({}, DefaultEditorOptions, opt);
2877
- var key = AppCoreSettings.froalaEditorKey;
2878
- if (key) {
2879
- newOptions = $.extend({}, newOptions, JSON.parse('{ "key": "' + key + '" }'));
2880
- }
2881
- if (newOptions.events && newOptions.events.initialized) {
2882
- newOptions.events.initialized.overridden = false;
2883
- }
2884
- this.options = newOptions;
2885
- };
2886
- BaseHtmlEditorComponent.prototype.ngAfterViewInit = function () {
2887
- var that = this;
2888
- setTimeout(function () {
2889
- that.froalaEditorInitialized = true;
2890
- that.onInitialized();
2891
- }, 300);
2892
- };
2893
- BaseHtmlEditorComponent.prototype.onInitialized = function () {
2894
- var actions = this.afterInitializedActions;
2895
- // Clear actions
2896
- this.afterInitializedActions = [];
2897
- if (actions) {
2898
- for (var i = 0; i < actions.length; i++) {
2899
- actions[i]();
2900
- }
2901
- }
2902
- };
2903
- BaseHtmlEditorComponent.prototype.getEditor = function () {
2904
- if (this.froalaEditor)
2905
- return this.froalaEditor.getEditor();
2906
- return null;
2907
- };
2908
- // Public Funcs
2909
- BaseHtmlEditorComponent.prototype.doAfterInitialized = function (action) {
2910
- var that = this;
2911
- if (!this.froalaEditorInitialized) {
2912
- this.afterInitializedActions.push(function () {
2913
- action(that);
2914
- });
2915
- }
2916
- else {
2917
- action(that);
2918
- }
2919
- };
2920
- BaseHtmlEditorComponent.prototype.initializeControl = function (control) {
2921
- this.froalaEditor = control;
2922
- this.froalaEditor.initialize();
2923
- };
2924
- BaseHtmlEditorComponent.prototype.setUploadParams = function (uploadType, uploadParentId) {
2925
- this.doAfterInitialized(function (that) {
2926
- var editor = that.getEditor();
2927
- if (typeof editor == "undefined" || editor == null) {
2928
- return;
2929
- }
2930
- editor.opts.imageUploadParams.uploadType = uploadType;
2931
- editor.opts.imageUploadParams.uploadParentId = uploadParentId;
2932
- });
2933
- };
2934
- return BaseHtmlEditorComponent;
2935
- }(BaseEditComponent));
2936
- BaseHtmlEditorComponent.decorators = [
2937
- { type: i0.Component, args: [{
2938
- template: ""
2939
- },] }
2940
- ];
2941
- BaseHtmlEditorComponent.ctorParameters = function () { return []; };
2942
- BaseHtmlEditorComponent.propDecorators = {
2943
- editorLabelText: [{ type: i0.Input }],
2944
- editorOptions: [{ type: i0.Input }]
2945
- };
2946
-
2947
- var FormsHtmlEditorComponent = /** @class */ (function (_super) {
2948
- __extends(FormsHtmlEditorComponent, _super);
2949
- function FormsHtmlEditorComponent() {
2950
- var _this = _super.call(this) || this;
2951
- _this.editorFormKey = "html";
2952
- return _this;
2953
- }
2954
- FormsHtmlEditorComponent.prototype.setFormValueAfterInitialized = function (name, value) {
2955
- this.doAfterInitialized(function (that) {
2956
- that.setFormValue(name, value);
2957
- });
2958
- };
2959
- return FormsHtmlEditorComponent;
2960
- }(BaseHtmlEditorComponent));
2961
- FormsHtmlEditorComponent.decorators = [
2962
- { type: i0.Component, args: [{
2963
- selector: "anatoly-forms-html-editor",
2964
- 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"
2965
- },] }
2966
- ];
2967
- FormsHtmlEditorComponent.ctorParameters = function () { return []; };
2968
- FormsHtmlEditorComponent.propDecorators = {
2969
- editorFormKey: [{ type: i0.Input }]
2970
- };
2971
-
2972
- var HtmlEditorComponent = /** @class */ (function (_super) {
2973
- __extends(HtmlEditorComponent, _super);
2974
- function HtmlEditorComponent() {
2975
- return _super.call(this) || this;
2976
- }
2977
- HtmlEditorComponent.prototype.setHtml = function (content) {
2978
- this.doAfterInitialized(function (that) {
2979
- var editor = that.getEditor();
2980
- if (typeof editor == "undefined" || editor == null) {
2981
- return;
2982
- }
2983
- editor.html.set(content);
2984
- });
2985
- };
2986
- HtmlEditorComponent.prototype.getHtml = function () {
2987
- var editor = this.getEditor();
2988
- if (typeof editor == "undefined" || editor == null) {
2989
- return;
2990
- }
2991
- return editor.html.get(false);
2992
- };
2993
- return HtmlEditorComponent;
2994
- }(BaseHtmlEditorComponent));
2995
- HtmlEditorComponent.decorators = [
2996
- { type: i0.Component, args: [{
2997
- selector: "anatoly-html-editor",
2998
- template: "<div>\r\n <label>{{ editorLabelText }}</label>\r\n <textarea [froalaEditor]=\"options\" (froalaInit)=\"initializeControl($event)\">\r\n </textarea>\r\n</div>"
2999
- },] }
3000
- ];
3001
- HtmlEditorComponent.ctorParameters = function () { return []; };
3002
-
3003
- /*
3004
- <file>
3005
- Project:
3006
- @osovitny/anatoly
3007
-
3008
- Authors:
3009
- Vadim Osovitny
3010
- Anatoly Osovitny
3011
-
3012
- Created:
3013
- 4 Jul 2018
3014
-
3015
- Version:
3016
- 1.0
3017
-
3018
- Copyright (c) 2016-2021 Osovitny Inc. All rights reserved.
3019
- </file>
3020
- */
3021
- var SignInButtonComponent = /** @class */ (function () {
3022
- function SignInButtonComponent() {
3023
- }
3024
- return SignInButtonComponent;
3025
- }());
3026
- SignInButtonComponent.decorators = [
3027
- { type: i0.Component, args: [{
3028
- selector: "anatoly-signin-button",
3029
- template: "<a href=\"identity/signIn\" class=\"{{classbtn}}\">Sign In</a>\r\n"
3030
- },] }
3031
- ];
3032
- SignInButtonComponent.ctorParameters = function () { return []; };
3033
- SignInButtonComponent.propDecorators = {
3034
- classbtn: [{ type: i0.Input }]
3035
- };
3036
-
3037
- /*
3038
- <file>
3039
- Project:
3040
- @osovitny/anatoly
3041
-
3042
- Authors:
3043
- Vadim Osovitny
3044
- Anatoly Osovitny
3045
-
3046
- Created:
3047
- 4 Jul 2018
3048
-
3049
- Version:
3050
- 1.0
3051
-
3052
- Copyright (c) 2016-2021 Osovitny Inc. All rights reserved.
3053
- </file>
3054
- */
3055
- var SignOutButtonComponent = /** @class */ (function () {
3056
- function SignOutButtonComponent() {
3057
- }
3058
- return SignOutButtonComponent;
3059
- }());
3060
- SignOutButtonComponent.decorators = [
3061
- { type: i0.Component, args: [{
3062
- selector: "anatoly-signout-button",
3063
- template: "<a href=\"identity/signOut\" class=\"{{classbtn}}\">Sign Out</a>\r\n"
3064
- },] }
3065
- ];
3066
- SignOutButtonComponent.ctorParameters = function () { return []; };
3067
- SignOutButtonComponent.propDecorators = {
3068
- classbtn: [{ type: i0.Input }]
3069
- };
3070
-
3071
- /*
3072
- <file>
3073
- Project:
3074
- @osovitny/anatoly
3075
-
3076
- Authors:
3077
- Vadim Osovitny
3078
- Anatoly Osovitny
3079
-
3080
- Created:
3081
- 4 Jul 2018
3082
-
3083
- Version:
3084
- 1.0
3085
-
3086
- Copyright (c) 2016-2021 Osovitny Inc. All rights reserved.
3087
- </file>
3088
- */
3089
- var SignUpButtonComponent = /** @class */ (function () {
3090
- function SignUpButtonComponent() {
3091
- }
3092
- return SignUpButtonComponent;
3093
- }());
3094
- SignUpButtonComponent.decorators = [
3095
- { type: i0.Component, args: [{
3096
- selector: "anatoly-signup-button",
3097
- template: "<a href=\"identity/signup\" class=\"{{classbtn}}\">Sign Up</a>\r\n"
3098
- },] }
3099
- ];
3100
- SignUpButtonComponent.propDecorators = {
3101
- classbtn: [{ type: i0.Input }]
3102
- };
3103
-
3104
- /*
3105
- <file>
3106
- Project:
3107
- @osovitny/anatoly
3108
-
3109
- Authors:
3110
- Vadim Osovitny
3111
- Anatoly Osovitny
3112
-
3113
- Created:
3114
- 9 May 2020
3115
-
3116
- Version:
3117
- 1.0
3118
-
3119
- Copyright (c) 2016-2021 Osovitny Inc. All rights reserved.
3120
- </file>
3121
- */
3122
- var LoadingComponent = /** @class */ (function () {
3123
- function LoadingComponent(loadingService) {
3124
- this.loadingService = loadingService;
3125
- // Private
3126
- this.subs = new Subs();
3127
- // Public
3128
- this.show = false;
3129
- }
3130
- LoadingComponent.prototype.ngOnInit = function () {
3131
- var _this = this;
3132
- this.subs.sink = this.loadingService.subscribe(function (state) {
3133
- _this.show = state;
3134
- });
3135
- };
3136
- LoadingComponent.prototype.ngOnDestroy = function () {
3137
- this.subs.unsubscribe();
3138
- };
3139
- return LoadingComponent;
3140
- }());
3141
- LoadingComponent.decorators = [
3142
- { type: i0.Component, args: [{
3143
- selector: 'anatoly-loading',
3144
- template: "<div *ngIf=\"show\">\r\n <span id=\"pnlLoading\" class=\"k-icon k-i-loading\"></span>\r\n</div>\r\n"
3145
- },] }
3146
- ];
3147
- LoadingComponent.ctorParameters = function () { return [
3148
- { type: LoadingService }
3149
- ]; };
3150
-
3151
- /*
3152
- <file>
3153
- Project:
3154
- @osovitny/anatoly
3155
-
3156
- Authors:
3157
- Vadim Osovitny
3158
- Anatoly Osovitny
3159
-
3160
- Created:
3161
- 16 May 2020
3162
-
3163
- Version:
3164
- 1.0
3165
-
3166
- Copyright (c) 2016-2021 Osovitny Inc. All rights reserved.
3167
- </file>
3168
- */
3169
- var SpinnerSpinKit = {
3170
- spinnerLine: 'spinner-line-material',
3171
- // ToDo
3172
- ChasingDots: 'spinner-chasing-dots',
3173
- CubeGrid: 'spinner-cube-grid',
3174
- DoubleBounce: 'spinner-double-bounce',
3175
- RotatingPlane: 'spinner-rotationg-plane',
3176
- SpinnerPulse: 'spinner-spinner-pulse',
3177
- ThreeBounce: 'spinner-three-bounce',
3178
- WanderingCubes: 'spinner-wandering-cubes',
3179
- Wave: 'spinner-wave'
3180
- };
3181
- var SpinnerComponent = /** @class */ (function () {
3182
- function SpinnerComponent(router$1, document) {
3183
- var _this = this;
3184
- this.router = router$1;
3185
- this.document = document;
3186
- this.isSpinnerVisible = true;
3187
- this.spinnerSpinKit = SpinnerSpinKit;
3188
- this.backgroundColor = '#007CB0';
3189
- this.spinner = SpinnerSpinKit.spinnerLine;
3190
- this.router.events.subscribe(function (event) {
3191
- if (event instanceof router.NavigationStart) {
3192
- _this.isSpinnerVisible = true;
3193
- }
3194
- else if (event instanceof router.NavigationEnd || event instanceof router.NavigationCancel || event instanceof router.NavigationError) {
3195
- _this.isSpinnerVisible = false;
3196
- }
3197
- }, function () {
3198
- _this.isSpinnerVisible = false;
3199
- });
3200
- }
3201
- SpinnerComponent.prototype.ngOnDestroy = function () {
3202
- this.isSpinnerVisible = false;
3203
- };
3204
- return SpinnerComponent;
3205
- }());
3206
- SpinnerComponent.decorators = [
3207
- { type: i0.Component, args: [{
3208
- selector: 'spinner',
3209
- 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",
3210
- encapsulation: i0.ViewEncapsulation.None
3211
- },] }
3212
- ];
3213
- SpinnerComponent.ctorParameters = function () { return [
3214
- { type: router.Router },
3215
- { type: Document, decorators: [{ type: i0.Inject, args: [i2.DOCUMENT,] }] }
3216
- ]; };
3217
- SpinnerComponent.propDecorators = {
3218
- backgroundColor: [{ type: i0.Input }],
3219
- spinner: [{ type: i0.Input }]
3220
- };
3221
-
3222
- /*
3223
- <file>
3224
- Project:
3225
- @osovitny/anatoly
3226
-
3227
- Authors:
3228
- Vadim Osovitny
3229
- Anatoly Osovitny
3230
-
3231
- Created:
3232
- 28 Jun 2020
3233
-
3234
- Version:
3235
- 1.0
3236
-
3237
- Copyright (c) 2016-2021 Osovitny Inc. All rights reserved.
3238
- </file>
3239
- */
3240
- var NativeElementDirective = /** @class */ (function () {
3241
- function NativeElementDirective(el, control) {
3242
- this.el = el;
3243
- this.control = control;
3244
- }
3245
- NativeElementDirective.prototype.ngOnInit = function () {
3246
- // sets the localization key to the control
3247
- this.control.control.nativeElement = this.el.nativeElement;
3248
- };
3249
- return NativeElementDirective;
3250
- }());
3251
- NativeElementDirective.decorators = [
3252
- { type: i0.Directive, args: [{
3253
- selector: '[formControl], [formControlName]'
3254
- },] }
3255
- ];
3256
- NativeElementDirective.ctorParameters = function () { return [
3257
- { type: i0.ElementRef },
3258
- { type: forms.NgControl }
3259
- ]; };
3260
-
3261
- /*
3262
- <file>
3263
- Project:
3264
- @osovitny/anatoly
3265
-
3266
- Authors:
3267
- Vadim Osovitny
3268
- Anatoly Osovitny
3269
-
3270
- Created:
3271
- 26 Jun 2020
3272
-
3273
- Version:
3274
- 1.0
3275
-
3276
- Copyright (c) 2016-2021 Osovitny Inc. All rights reserved.
3277
- </file>
3278
- */
3279
- var ReplaceTextPipe = /** @class */ (function () {
3280
- function ReplaceTextPipe() {
3281
- }
3282
- ReplaceTextPipe.prototype.transform = function (inputData, search, replacement) {
3283
- if (inputData) {
3284
- return inputData.replace(new RegExp(search, "g"), replacement);
3285
- }
3286
- else {
3287
- return inputData;
3288
- }
3289
- };
3290
- return ReplaceTextPipe;
3291
- }());
3292
- ReplaceTextPipe.decorators = [
3293
- { type: i0.Pipe, args: [{
3294
- name: "replaceText",
3295
- },] }
3296
- ];
3297
-
3298
- /*
3299
- <file>
3300
- Project:
3301
- @osovitny/anatoly
3302
-
3303
- Authors:
3304
- Vadim Osovitny
3305
- Anatoly Osovitny
3306
-
3307
- Created:
3308
- 26 Jun 2020
3309
-
3310
- Version:
3311
- 1.0
3312
-
3313
- Copyright (c) 2016-2021 Osovitny Inc. All rights reserved.
3314
- </file>
3315
- */
3316
- var FileSizePipe = /** @class */ (function () {
3317
- function FileSizePipe() {
3318
- this.units = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB'];
3319
- }
3320
- FileSizePipe.prototype.transform = function (bytes, precision) {
3321
- if (bytes === void 0) { bytes = 0; }
3322
- if (precision === void 0) { precision = 0; }
3323
- if (isNaN(parseFloat(String(bytes))) || !isFinite(bytes))
3324
- return '';
3325
- var unit = 0;
3326
- while (bytes >= 1024) {
3327
- bytes /= 1024;
3328
- unit++;
3329
- }
3330
- return bytes.toFixed(+precision) + ' ' + this.units[unit];
3331
- };
3332
- return FileSizePipe;
3333
- }());
3334
- FileSizePipe.decorators = [
3335
- { type: i0.Pipe, args: [{
3336
- name: 'filesize',
3337
- },] }
3338
- ];
3339
-
3340
- /*
3341
- <file>
3342
- Project:
3343
- @osovitny/anatoly
3344
-
3345
- Authors:
3346
- Vadim Osovitny
3347
- Anatoly Osovitny
3348
-
3349
- Created:
3350
- 27 Oct 2019
3351
-
3352
- Version:
3353
- 1.0
3354
-
3355
- Copyright (c) 2016-2021 Osovitny Inc. All rights reserved.
3356
- </file>
3357
- */
3358
- var SafeHtmlPipe = /** @class */ (function () {
3359
- function SafeHtmlPipe(sanitized) {
3360
- this.sanitized = sanitized;
3361
- }
3362
- SafeHtmlPipe.prototype.transform = function (value) {
3363
- return this.sanitized.bypassSecurityTrustHtml(value);
3364
- };
3365
- return SafeHtmlPipe;
3366
- }());
3367
- SafeHtmlPipe.decorators = [
3368
- { type: i0.Pipe, args: [{ name: 'safeHtml' },] }
3369
- ];
3370
- SafeHtmlPipe.ctorParameters = function () { return [
3371
- { type: i1$3.DomSanitizer }
3372
- ]; };
3373
-
3374
- var ValidationSummaryComponent = /** @class */ (function (_super) {
3375
- __extends(ValidationSummaryComponent, _super);
3376
- function ValidationSummaryComponent() {
3377
- return _super.call(this) || this;
3378
- }
3379
- ValidationSummaryComponent.prototype.getFormValidationMessages = function () {
3380
- var _this = this;
3381
- var messages = [];
3382
- Object.keys(this.formGroup.controls).forEach(function (k) {
3383
- var control = _this.formGroup.controls[k];
3384
- if (control.controls != null) {
3385
- Object.keys(control.controls).forEach(function (k) {
3386
- var child = control.controls[k];
3387
- _this.getValidationMessages(child, _this.getControlName(child, k)).forEach(function (m) { return messages.push(m); });
3388
- });
3389
- }
3390
- else {
3391
- _this.getValidationMessages(control, _this.getControlName(control, k)).forEach(function (m) { return messages.push(m); });
3392
- }
3393
- });
3394
- return messages;
3395
- };
3396
- ValidationSummaryComponent.prototype.getValidationMessages = function (state, thingName) {
3397
- var thing = state.path || thingName;
3398
- var messages = [];
3399
- if (state.errors) {
3400
- for (var errorName in state.errors) {
3401
- if (state.errors.hasOwnProperty(errorName)) {
3402
- switch (errorName) {
3403
- case "required":
3404
- messages.push(thing + " is required");
3405
- break;
3406
- case "minlength":
3407
- messages.push(thing + " must be at least " + state.errors["minlength"].requiredLength + " characters");
3408
- break;
3409
- case "pattern":
3410
- messages.push(thing + " contains illegal characters");
3411
- break;
3412
- case "format":
3413
- messages.push(thing + " format mismatch");
3414
- break;
3415
- case "maxlength":
3416
- messages.push(thing + " must have maximum " + state.errors["maxlength"].requiredLength + " characters");
3417
- break;
3418
- case "specialcharacters":
3419
- messages.push(thing + " contains special characters");
3420
- break;
3421
- }
3422
- }
3423
- }
3424
- }
3425
- return messages;
3426
- };
3427
- /**
3428
- * Get Control Name
3429
- * @param control
3430
- * @param thingName
3431
- */
3432
- ValidationSummaryComponent.prototype.getControlName = function (control, thingName) {
3433
- var value = this.getControlTitle(control);
3434
- return value ? value : thingName;
3435
- };
3436
- /**
3437
- * Retrieve tilte of control
3438
- * @param control
3439
- */
3440
- ValidationSummaryComponent.prototype.getControlTitle = function (control) {
3441
- if (control === null || control === void 0 ? void 0 : control.nativeElement) {
3442
- var controlTitle = this.getTitleAttribute(control.nativeElement);
3443
- if (controlTitle) {
3444
- return controlTitle;
3445
- }
3446
- }
3447
- return undefined;
3448
- };
3449
- /**
3450
- * Return title attribute of form control
3451
- */
3452
- ValidationSummaryComponent.prototype.getTitleAttribute = function (nativeElement) {
3453
- var _a, _b, _c, _d, _e, _f;
3454
- var title;
3455
- switch (nativeElement.tagName) {
3456
- // For Kendo time and date picker element title is assigned to the 4th child control.
3457
- case "KENDO-TIMEPICKER":
3458
- case "KENDO-DATEPICKER":
3459
- title =
3460
- (_d = (_c = (_b = (_a = nativeElement.children[0]) === null || _a === void 0 ? void 0 : _a.children[0]) === null || _b === void 0 ? void 0 : _b.children[0]) === null || _c === void 0 ? void 0 : _c.children[0]) === null || _d === void 0 ? void 0 : _d.getAttribute("title");
3461
- break;
3462
- // For Kendo numaric element title is assigned to the 2nd child control.
3463
- case "KENDO-NUMERICTEXTBOX":
3464
- title = (_f = (_e = nativeElement.children[0]) === null || _e === void 0 ? void 0 : _e.children[0]) === null || _f === void 0 ? void 0 : _f.getAttribute("title");
3465
- break;
3466
- default:
3467
- title = nativeElement.getAttribute("title");
3468
- break;
3469
- }
3470
- return title;
3471
- };
3472
- return ValidationSummaryComponent;
3473
- }(BaseEditComponent));
3474
- ValidationSummaryComponent.decorators = [
3475
- { type: i0.Component, args: [{
3476
- template: ""
3477
- },] }
3478
- ];
3479
- ValidationSummaryComponent.ctorParameters = function () { return []; };
3480
-
3481
- var FormValidationSummaryComponent = /** @class */ (function (_super) {
3482
- __extends(FormValidationSummaryComponent, _super);
3483
- function FormValidationSummaryComponent() {
3484
- var _this = _super.call(this) || this;
3485
- _this.visible = false;
3486
- _this.customerrors = [];
3487
- /*
3488
- 0 - only FormValidation messages
3489
- 1 - only Custom messages
3490
- 2 - all
3491
- */
3492
- _this.viewtype = 0;
3493
- return _this;
3494
- }
3495
- FormValidationSummaryComponent.prototype.getErrors = function () {
3496
- if (this.viewtype == 1) {
3497
- return this.customerrors;
3498
- }
3499
- var formValidationMessages = this.getFormValidationMessages();
3500
- if (this.viewtype == 0) {
3501
- return formValidationMessages;
3502
- }
3503
- var messages = [];
3504
- if (formValidationMessages.length > 0) {
3505
- messages.push.apply(messages, __spreadArray([], __read(formValidationMessages)));
3506
- }
3507
- if (this.customerrors.length > 0) {
3508
- messages.push.apply(messages, __spreadArray([], __read(this.customerrors)));
3509
- }
3510
- return messages;
3511
- };
3512
- return FormValidationSummaryComponent;
3513
- }(ValidationSummaryComponent));
3514
- FormValidationSummaryComponent.decorators = [
3515
- { type: i0.Component, args: [{
3516
- selector: "anatoly-form-validation-summary",
3517
- template: "<div class=\"callout callout-danger\" *ngIf=\"visible\">\r\n <h6 class=\"box-title\">There are problems with the form</h6>\r\n <ul>\r\n <li *ngFor=\"let error of getErrors()\"><span>{{error}}</span></li>\r\n </ul>\r\n</div>\r\n\r\n"
3518
- },] }
3519
- ];
3520
- FormValidationSummaryComponent.ctorParameters = function () { return []; };
3521
- FormValidationSummaryComponent.propDecorators = {
3522
- visible: [{ type: i0.Input }],
3523
- customerrors: [{ type: i0.Input }],
3524
- viewtype: [{ type: i0.Input }]
3525
- };
3526
-
3527
- var ItemValidationSummaryComponent = /** @class */ (function (_super) {
3528
- __extends(ItemValidationSummaryComponent, _super);
3529
- function ItemValidationSummaryComponent() {
3530
- return _super.call(this) || this;
3531
- }
3532
- return ItemValidationSummaryComponent;
3533
- }(ValidationSummaryComponent));
3534
- ItemValidationSummaryComponent.decorators = [
3535
- { type: i0.Component, args: [{
3536
- selector: "anatoly-item-validation-summary",
3537
- template: "<ul class=\"list-unstyled\" *ngIf=\"isControlInvalid(controlName)\">\r\n <li *ngFor=\"let error of getValidationMessages(formGroup.get(controlName), controlTitle)\">\r\n <span class=\"help-block\">{{ error }}</span>\r\n </li>\r\n</ul>\r\n\r\n"
3538
- },] }
3539
- ];
3540
- ItemValidationSummaryComponent.ctorParameters = function () { return []; };
3541
- ItemValidationSummaryComponent.propDecorators = {
3542
- controlName: [{ type: i0.Input }],
3543
- controlTitle: [{ type: i0.Input }]
3544
- };
3545
-
3546
- /*
3547
- <file>
3548
- Project:
3549
- @osovitny/anatoly
3550
-
3551
- Authors:
3552
- Vadim Osovitny
3553
- Anatoly Osovitny
3554
-
3555
- Created:
3556
- 26 Jun 2020
3557
-
3558
- Version:
3559
- 1.0
3560
-
3561
- Copyright (c) 2016-2021 Osovitny Inc. All rights reserved.
3562
- </file>
3563
- */
3564
- var FroalaEditorModuleWithProviders = angularFroalaWysiwyg.FroalaEditorModule.forRoot();
3565
- var FroalaViewModuleWithProviders = angularFroalaWysiwyg.FroalaViewModule.forRoot();
3566
- var AnatolyUIModule = /** @class */ (function () {
3567
- function AnatolyUIModule() {
3568
- }
3569
- return AnatolyUIModule;
3570
- }());
3571
- AnatolyUIModule.decorators = [
3572
- { type: i0.NgModule, args: [{
3573
- imports: [
3574
- i2.CommonModule,
3575
- forms.ReactiveFormsModule,
3576
- forms.FormsModule,
3577
- FroalaEditorModuleWithProviders,
3578
- FroalaViewModuleWithProviders,
3579
- ],
3580
- exports: [
3581
- SubscribePlanButtonComponent,
3582
- UpgradePlanButtonComponent,
3583
- BuyAccessButtonComponent,
3584
- SignInButtonComponent,
3585
- SignUpButtonComponent,
3586
- SignOutButtonComponent,
3587
- ContentHeaderComponent,
3588
- SpinnerComponent,
3589
- LoadingComponent,
3590
- NativeElementDirective,
3591
- //Editor
3592
- HtmlEditorComponent,
3593
- FormsHtmlEditorComponent,
3594
- //Validation
3595
- FormValidationSummaryComponent,
3596
- ItemValidationSummaryComponent,
3597
- //Pipe
3598
- SafeHtmlPipe,
3599
- ReplaceTextPipe,
3600
- FileSizePipe,
3601
- ],
3602
- declarations: [
3603
- SubscribePlanButtonComponent,
3604
- UpgradePlanButtonComponent,
3605
- BuyAccessButtonComponent,
3606
- SignInButtonComponent,
3607
- SignUpButtonComponent,
3608
- SignOutButtonComponent,
3609
- ContentHeaderComponent,
3610
- SpinnerComponent,
3611
- LoadingComponent,
3612
- NativeElementDirective,
3613
- //Editor
3614
- HtmlEditorComponent,
3615
- FormsHtmlEditorComponent,
3616
- //Validation
3617
- FormValidationSummaryComponent,
3618
- ItemValidationSummaryComponent,
3619
- //Pipe
3620
- SafeHtmlPipe,
3621
- ReplaceTextPipe,
3622
- FileSizePipe,
3623
- ]
3624
- },] }
3625
- ];
3626
-
3627
- /*
3628
- * Public API Surface of anatoly-lib
3629
- */
3630
-
3631
- /**
3632
- * Generated bundle index. Do not edit.
3633
- */
3634
-
3635
- exports.Alerts = Alerts;
3636
- exports.AnatolyCoreModule = AnatolyCoreModule;
3637
- exports.AnatolyDataModule = AnatolyDataModule;
3638
- exports.AnatolyHttpInterceptor = AnatolyHttpInterceptor;
3639
- exports.AnatolyUIModule = AnatolyUIModule;
3640
- exports.AppContextService = AppContextService;
3641
- exports.AppCoreSettings = AppCoreSettings;
3642
- exports.BaseApiService = BaseApiService;
3643
- exports.BaseComponent = BaseComponent;
3644
- exports.BaseDialog = BaseDialog;
3645
- exports.BaseEditComponent = BaseEditComponent;
3646
- exports.BaseGoService = BaseGoService;
3647
- exports.BaseGridEditService = BaseGridEditService;
3648
- exports.BaseGridReadService = BaseGridReadService;
3649
- exports.BaseHtmlEditorComponent = BaseHtmlEditorComponent;
3650
- exports.BillingApiService = BillingApiService;
3651
- exports.BuyAccessButtonComponent = BuyAccessButtonComponent;
3652
- exports.ContentHeaderComponent = ContentHeaderComponent;
3653
- exports.ContextInitState = ContextInitState;
3654
- exports.Convert = Convert;
3655
- exports.DefaultEditorOptions = DefaultEditorOptions;
3656
- exports.DigitalMarketingService = DigitalMarketingService;
3657
- exports.FileSizePipe = FileSizePipe;
3658
- exports.FormValidationSummaryComponent = FormValidationSummaryComponent;
3659
- exports.FormsHtmlEditorComponent = FormsHtmlEditorComponent;
3660
- exports.FroalaEditorModuleWithProviders = FroalaEditorModuleWithProviders;
3661
- exports.FroalaViewModuleWithProviders = FroalaViewModuleWithProviders;
3662
- exports.GlobalErrorHandler = GlobalErrorHandler;
3663
- exports.GoogleAnalyticsService = GoogleAnalyticsService;
3664
- exports.Guid = Guid;
3665
- exports.HtmlEditorComponent = HtmlEditorComponent;
3666
- exports.IdleService = IdleService;
3667
- exports.ItemValidationSummaryComponent = ItemValidationSummaryComponent;
3668
- exports.LoadingComponent = LoadingComponent;
3669
- exports.LoadingService = LoadingService;
3670
- exports.LocalStorageService = LocalStorageService;
3671
- exports.LocalizationModule = LocalizationModule;
3672
- exports.LocalizationService = LocalizationService;
3673
- exports.LocalizationSettingsModule = LocalizationSettingsModule;
3674
- exports.LocalizePipe = LocalizePipe;
3675
- exports.LoggingService = LoggingService;
3676
- exports.NativeElementDirective = NativeElementDirective;
3677
- exports.NotificationService = NotificationService;
3678
- exports.NotificationsApiService = NotificationsApiService;
3679
- exports.ReplaceTextPipe = ReplaceTextPipe;
3680
- exports.SafeHtmlPipe = SafeHtmlPipe;
3681
- exports.SessionStorageService = SessionStorageService;
3682
- exports.SignInButtonComponent = SignInButtonComponent;
3683
- exports.SignOutButtonComponent = SignOutButtonComponent;
3684
- exports.SignUpButtonComponent = SignUpButtonComponent;
3685
- exports.SpinnerComponent = SpinnerComponent;
3686
- exports.Subs = Subs;
3687
- exports.SubscribePlanButtonComponent = SubscribePlanButtonComponent;
3688
- exports.TranslateModuleAtRoot = TranslateModuleAtRoot;
3689
- exports.UpgradePlanButtonComponent = UpgradePlanButtonComponent;
3690
- exports.Urls = Urls;
3691
- exports.Utils = Utils;
3692
- exports.ValidationSummaryComponent = ValidationSummaryComponent;
3693
- exports.customTranslateLoaderFactory = customTranslateLoaderFactory;
3694
- exports.localizationInitializerFactory = localizationInitializerFactory;
3695
- exports.throwIfAlreadyLoaded = throwIfAlreadyLoaded;
3696
-
3697
- Object.defineProperty(exports, '__esModule', { value: true });
3698
-
3699
- }));
3700
- //# sourceMappingURL=osovitny-anatoly.umd.js.map