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