@osovitny/anatoly 2.0.4 → 2.0.7

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 (124) hide show
  1. package/README.md +1 -3
  2. package/bundles/osovitny-anatoly.umd.js +1528 -1683
  3. package/bundles/osovitny-anatoly.umd.js.map +1 -1
  4. package/bundles/osovitny-anatoly.umd.min.js +13 -13
  5. package/bundles/osovitny-anatoly.umd.min.js.map +1 -1
  6. package/esm2015/lib/core/alerts.js +19 -23
  7. package/esm2015/lib/core/core.module.js +14 -79
  8. package/esm2015/lib/core/index.js +7 -17
  9. package/esm2015/lib/core/services/appcontext.service.js +12 -14
  10. package/esm2015/lib/core/services/base-go.service.js +8 -10
  11. package/esm2015/lib/core/utils.js +4 -2
  12. package/esm2015/lib/data/base/base-api.service.js +6 -8
  13. package/esm2015/lib/data/base/grid/base-grid-edit.service.js +6 -8
  14. package/esm2015/lib/data/base/grid/base-grid-read.service.js +6 -8
  15. package/esm2015/lib/data/data.module.js +21 -23
  16. package/esm2015/lib/data/index.js +1 -1
  17. package/esm2015/lib/data/services/billing-api.service.js +6 -8
  18. package/esm2015/lib/ui/components/base-edit.component.js +64 -0
  19. package/esm2015/lib/ui/components/base.component.js +38 -0
  20. package/esm2015/lib/ui/components/billing/buyaccess-button.component.js +71 -0
  21. package/esm2015/lib/ui/components/billing/subscribe-plan-button.component.js +59 -0
  22. package/esm2015/lib/ui/components/billing/upgrade-plan-button.component.js +50 -0
  23. package/esm2015/lib/ui/components/content-header/content-header.component.js +33 -0
  24. package/esm2015/lib/ui/components/html-editor/base-html-editor.component.js +96 -0
  25. package/esm2015/lib/ui/components/html-editor/forms-html-editor.component.js +41 -0
  26. package/esm2015/lib/ui/components/html-editor/html-editor.component.js +48 -0
  27. package/esm2015/lib/ui/components/html-editor/html-editor.defaultoptions.js +32 -0
  28. package/esm2015/lib/ui/components/identity/signin-button.component.js +29 -0
  29. package/esm2015/lib/ui/components/identity/signout-button.component.js +29 -0
  30. package/esm2015/lib/ui/components/identity/signup-button.component.js +27 -0
  31. package/esm2015/lib/ui/components/validation/form-validation-summary.component.js +38 -0
  32. package/esm2015/lib/ui/components/validation/item-validation-summary.component.js +34 -0
  33. package/esm2015/lib/ui/components/validation/validation-summary.component.js +60 -0
  34. package/esm2015/lib/ui/index.js +22 -0
  35. package/esm2015/lib/ui/ui.module.js +54 -0
  36. package/esm2015/osovitny-anatoly.js +1 -1
  37. package/esm2015/public-api.js +7 -5
  38. package/fesm2015/osovitny-anatoly.js +688 -797
  39. package/fesm2015/osovitny-anatoly.js.map +1 -1
  40. package/lib/core/core.module.d.ts +0 -3
  41. package/lib/core/index.d.ts +5 -13
  42. package/lib/core/services/appcontext.service.d.ts +2 -2
  43. package/lib/core/services/base-go.service.d.ts +1 -1
  44. package/lib/{core → ui}/components/base.component.d.ts +0 -1
  45. package/lib/{billing/components/buyaccess → ui/components/billing}/buyaccess-button.component.d.ts +3 -3
  46. package/lib/{billing/components/subscriptions → ui/components/billing}/upgrade-plan-button.component.d.ts +1 -1
  47. package/lib/{core → ui}/components/html-editor/forms-html-editor.component.d.ts +1 -1
  48. package/lib/{identity/components → ui/components/identity}/signup-button.component.d.ts +0 -1
  49. package/lib/{core → ui}/components/validation/form-validation-summary.component.d.ts +1 -1
  50. package/lib/{core → ui}/components/validation/validation-summary.component.d.ts +1 -1
  51. package/lib/ui/index.d.ts +15 -0
  52. package/lib/ui/ui.module.d.ts +2 -0
  53. package/osovitny-anatoly.metadata.json +1 -1
  54. package/package.json +8 -7
  55. package/public-api.d.ts +3 -4
  56. package/esm2015/lib/billing/billing.module.js +0 -60
  57. package/esm2015/lib/billing/components/buyaccess/buyaccess-button.component.js +0 -75
  58. package/esm2015/lib/billing/components/subscriptions/subscribe-plan-button.component.js +0 -63
  59. package/esm2015/lib/billing/components/subscriptions/upgrade-plan-button.component.js +0 -56
  60. package/esm2015/lib/billing/index.js +0 -7
  61. package/esm2015/lib/core/components/base-edit.component.js +0 -67
  62. package/esm2015/lib/core/components/base.component.js +0 -39
  63. package/esm2015/lib/core/components/content-header/content-header.component.js +0 -35
  64. package/esm2015/lib/core/components/html-editor/base-html-editor.component.js +0 -99
  65. package/esm2015/lib/core/components/html-editor/forms-html-editor.component.js +0 -42
  66. package/esm2015/lib/core/components/html-editor/html-editor.component.js +0 -49
  67. package/esm2015/lib/core/components/html-editor/html-editor.defaultoptions.js +0 -32
  68. package/esm2015/lib/core/components/validation/form-validation-summary.component.js +0 -39
  69. package/esm2015/lib/core/components/validation/item-validation-summary.component.js +0 -37
  70. package/esm2015/lib/core/components/validation/validation-summary.component.js +0 -60
  71. package/esm2015/lib/identity/components/signin-button.component.js +0 -30
  72. package/esm2015/lib/identity/components/signout-button.component.js +0 -30
  73. package/esm2015/lib/identity/components/signup-button.component.js +0 -31
  74. package/esm2015/lib/identity/identity.module.js +0 -41
  75. package/esm2015/lib/identity/index.js +0 -7
  76. package/esm5/lib/billing/billing.module.js +0 -63
  77. package/esm5/lib/billing/components/buyaccess/buyaccess-button.component.js +0 -77
  78. package/esm5/lib/billing/components/subscriptions/subscribe-plan-button.component.js +0 -65
  79. package/esm5/lib/billing/components/subscriptions/upgrade-plan-button.component.js +0 -57
  80. package/esm5/lib/billing/index.js +0 -7
  81. package/esm5/lib/core/alerts.js +0 -149
  82. package/esm5/lib/core/components/base-edit.component.js +0 -71
  83. package/esm5/lib/core/components/base.component.js +0 -41
  84. package/esm5/lib/core/components/content-header/content-header.component.js +0 -38
  85. package/esm5/lib/core/components/html-editor/base-html-editor.component.js +0 -103
  86. package/esm5/lib/core/components/html-editor/forms-html-editor.component.js +0 -45
  87. package/esm5/lib/core/components/html-editor/html-editor.component.js +0 -51
  88. package/esm5/lib/core/components/html-editor/html-editor.defaultoptions.js +0 -32
  89. package/esm5/lib/core/components/validation/form-validation-summary.component.js +0 -42
  90. package/esm5/lib/core/components/validation/item-validation-summary.component.js +0 -39
  91. package/esm5/lib/core/components/validation/validation-summary.component.js +0 -65
  92. package/esm5/lib/core/core.module.js +0 -82
  93. package/esm5/lib/core/index.js +0 -18
  94. package/esm5/lib/core/services/appcontext.service.js +0 -75
  95. package/esm5/lib/core/services/base-go.service.js +0 -37
  96. package/esm5/lib/core/utils.js +0 -29
  97. package/esm5/lib/data/base/base-api.service.js +0 -87
  98. package/esm5/lib/data/base/grid/base-grid-edit.service.js +0 -81
  99. package/esm5/lib/data/base/grid/base-grid-read.service.js +0 -65
  100. package/esm5/lib/data/data.module.js +0 -44
  101. package/esm5/lib/data/index.js +0 -8
  102. package/esm5/lib/data/services/billing-api.service.js +0 -56
  103. package/esm5/lib/identity/components/signin-button.component.js +0 -32
  104. package/esm5/lib/identity/components/signout-button.component.js +0 -32
  105. package/esm5/lib/identity/components/signup-button.component.js +0 -32
  106. package/esm5/lib/identity/identity.module.js +0 -44
  107. package/esm5/lib/identity/index.js +0 -7
  108. package/esm5/osovitny-anatoly.js +0 -5
  109. package/esm5/public-api.js +0 -5
  110. package/fesm5/osovitny-anatoly.js +0 -1491
  111. package/fesm5/osovitny-anatoly.js.map +0 -1
  112. package/lib/billing/billing.module.d.ts +0 -2
  113. package/lib/billing/index.d.ts +0 -4
  114. package/lib/identity/identity.module.d.ts +0 -2
  115. package/lib/identity/index.d.ts +0 -4
  116. /package/lib/{core → ui}/components/base-edit.component.d.ts +0 -0
  117. /package/lib/{billing/components/subscriptions → ui/components/billing}/subscribe-plan-button.component.d.ts +0 -0
  118. /package/lib/{core → ui}/components/content-header/content-header.component.d.ts +0 -0
  119. /package/lib/{core → ui}/components/html-editor/base-html-editor.component.d.ts +0 -0
  120. /package/lib/{core → ui}/components/html-editor/html-editor.component.d.ts +0 -0
  121. /package/lib/{core → ui}/components/html-editor/html-editor.defaultoptions.d.ts +0 -0
  122. /package/lib/{identity/components → ui/components/identity}/signin-button.component.d.ts +0 -0
  123. /package/lib/{identity/components → ui/components/identity}/signout-button.component.d.ts +0 -0
  124. /package/lib/{core → ui}/components/validation/item-validation-summary.component.d.ts +0 -0
@@ -1,1721 +1,1566 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('sweetalert2'), require('@angular/core'), require('@angular/router'), require('@angular/common/http'), require('rxjs/operators'), require('@angular/common'), require('@angular/forms'), require('angular-froala-wysiwyg'), require('@progress/kendo-angular-grid'), require('@progress/kendo-angular-popup'), require('@progress/kendo-angular-buttons'), require('@progress/kendo-angular-dropdowns'), require('rxjs')) :
3
- typeof define === 'function' && define.amd ? define('@osovitny/anatoly', ['exports', 'sweetalert2', '@angular/core', '@angular/router', '@angular/common/http', 'rxjs/operators', '@angular/common', '@angular/forms', 'angular-froala-wysiwyg', '@progress/kendo-angular-grid', '@progress/kendo-angular-popup', '@progress/kendo-angular-buttons', '@progress/kendo-angular-dropdowns', 'rxjs'], factory) :
4
- (global = global || self, factory((global.osovitny = global.osovitny || {}, global.osovitny.anatoly = {}), global.Swal, global.ng.core, global.ng.router, global.ng.common.http, global.rxjs.operators, global.ng.common, global.ng.forms, global.angularFroalaWysiwyg, global.kendoAngularGrid, global.kendoAngularPopup, global.kendoAngularButtons, global.kendoAngularDropdowns, global.rxjs));
5
- }(this, (function (exports, Swal, core, router, http, operators, common, forms, angularFroalaWysiwyg, kendoAngularGrid, kendoAngularPopup, kendoAngularButtons, kendoAngularDropdowns, rxjs) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('sweetalert2'), require('@angular/core'), require('@angular/router'), require('@angular/common/http'), require('rxjs/operators'), require('@angular/common'), require('rxjs'), require('@angular/forms')) :
3
+ typeof define === 'function' && define.amd ? define('@osovitny/anatoly', ['exports', 'sweetalert2', '@angular/core', '@angular/router', '@angular/common/http', 'rxjs/operators', '@angular/common', 'rxjs', '@angular/forms'], factory) :
4
+ (global = global || self, factory((global.osovitny = global.osovitny || {}, global.osovitny.anatoly = {}), global.Swal, global.ng.core, global.ng.router, global.ng.common.http, global.rxjs.operators, global.ng.common, global.rxjs, global.ng.forms));
5
+ }(this, (function (exports, Swal, core, router, http, operators, common, rxjs, forms) { 'use strict';
6
6
 
7
- Swal = Swal && Object.prototype.hasOwnProperty.call(Swal, 'default') ? Swal['default'] : Swal;
7
+ Swal = Swal && Object.prototype.hasOwnProperty.call(Swal, 'default') ? Swal['default'] : Swal;
8
8
 
9
- /*! *****************************************************************************
10
- Copyright (c) Microsoft Corporation. All rights reserved.
11
- Licensed under the Apache License, Version 2.0 (the "License"); you may not use
12
- this file except in compliance with the License. You may obtain a copy of the
13
- License at http://www.apache.org/licenses/LICENSE-2.0
14
-
15
- THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16
- KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
17
- WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
18
- MERCHANTABLITY OR NON-INFRINGEMENT.
19
-
20
- See the Apache Version 2.0 License for specific language governing permissions
21
- and limitations under the License.
22
- ***************************************************************************** */
23
- /* global Reflect, Promise */
24
-
25
- var extendStatics = function(d, b) {
26
- extendStatics = Object.setPrototypeOf ||
27
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
28
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
29
- return extendStatics(d, b);
30
- };
31
-
32
- function __extends(d, b) {
33
- extendStatics(d, b);
34
- function __() { this.constructor = d; }
35
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
36
- }
37
-
38
- var __assign = function() {
39
- __assign = Object.assign || function __assign(t) {
40
- for (var s, i = 1, n = arguments.length; i < n; i++) {
41
- s = arguments[i];
42
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
43
- }
44
- return t;
45
- };
46
- return __assign.apply(this, arguments);
47
- };
48
-
49
- function __rest(s, e) {
50
- var t = {};
51
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
52
- t[p] = s[p];
53
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
54
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
55
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
56
- t[p[i]] = s[p[i]];
57
- }
58
- return t;
59
- }
60
-
61
- function __decorate(decorators, target, key, desc) {
62
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
63
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
64
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
65
- return c > 3 && r && Object.defineProperty(target, key, r), r;
66
- }
67
-
68
- function __param(paramIndex, decorator) {
69
- return function (target, key) { decorator(target, key, paramIndex); }
70
- }
71
-
72
- function __metadata(metadataKey, metadataValue) {
73
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
74
- }
75
-
76
- function __awaiter(thisArg, _arguments, P, generator) {
77
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
78
- return new (P || (P = Promise))(function (resolve, reject) {
79
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
80
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
81
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
82
- step((generator = generator.apply(thisArg, _arguments || [])).next());
83
- });
84
- }
85
-
86
- function __generator(thisArg, body) {
87
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
88
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
89
- function verb(n) { return function (v) { return step([n, v]); }; }
90
- function step(op) {
91
- if (f) throw new TypeError("Generator is already executing.");
92
- while (_) try {
93
- 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) return t;
94
- if (y = 0, t) op = [op[0] & 2, t.value];
95
- switch (op[0]) {
96
- case 0: case 1: t = op; break;
97
- case 4: _.label++; return { value: op[1], done: false };
98
- case 5: _.label++; y = op[1]; op = [0]; continue;
99
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
100
- default:
101
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
102
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
103
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
104
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
105
- if (t[2]) _.ops.pop();
106
- _.trys.pop(); continue;
107
- }
108
- op = body.call(thisArg, _);
109
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
110
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
111
- }
112
- }
113
-
114
- function __exportStar(m, exports) {
115
- for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
116
- }
117
-
118
- function __values(o) {
119
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
120
- if (m) return m.call(o);
121
- if (o && typeof o.length === "number") return {
122
- next: function () {
123
- if (o && i >= o.length) o = void 0;
124
- return { value: o && o[i++], done: !o };
125
- }
126
- };
127
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
128
- }
129
-
130
- function __read(o, n) {
131
- var m = typeof Symbol === "function" && o[Symbol.iterator];
132
- if (!m) return o;
133
- var i = m.call(o), r, ar = [], e;
134
- try {
135
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
136
- }
137
- catch (error) { e = { error: error }; }
138
- finally {
139
- try {
140
- if (r && !r.done && (m = i["return"])) m.call(i);
141
- }
142
- finally { if (e) throw e.error; }
143
- }
144
- return ar;
145
- }
146
-
147
- function __spread() {
148
- for (var ar = [], i = 0; i < arguments.length; i++)
149
- ar = ar.concat(__read(arguments[i]));
150
- return ar;
151
- }
152
-
153
- function __spreadArrays() {
154
- for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
155
- for (var r = Array(s), k = 0, i = 0; i < il; i++)
156
- for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
157
- r[k] = a[j];
158
- return r;
159
- };
160
-
161
- function __await(v) {
162
- return this instanceof __await ? (this.v = v, this) : new __await(v);
163
- }
164
-
165
- function __asyncGenerator(thisArg, _arguments, generator) {
166
- if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
167
- var g = generator.apply(thisArg, _arguments || []), i, q = [];
168
- return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
169
- function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
170
- function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
171
- function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
172
- function fulfill(value) { resume("next", value); }
173
- function reject(value) { resume("throw", value); }
174
- function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
175
- }
176
-
177
- function __asyncDelegator(o) {
178
- var i, p;
179
- return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
180
- 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; }
181
- }
182
-
183
- function __asyncValues(o) {
184
- if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
185
- var m = o[Symbol.asyncIterator], i;
186
- 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);
187
- 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); }); }; }
188
- function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
189
- }
190
-
191
- function __makeTemplateObject(cooked, raw) {
192
- if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
193
- return cooked;
194
- };
195
-
196
- function __importStar(mod) {
197
- if (mod && mod.__esModule) return mod;
198
- var result = {};
199
- if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
200
- result.default = mod;
201
- return result;
202
- }
203
-
204
- function __importDefault(mod) {
205
- return (mod && mod.__esModule) ? mod : { default: mod };
206
- }
207
-
208
- function __classPrivateFieldGet(receiver, privateMap) {
209
- if (!privateMap.has(receiver)) {
210
- throw new TypeError("attempted to get private field on non-instance");
211
- }
212
- return privateMap.get(receiver);
213
- }
214
-
215
- function __classPrivateFieldSet(receiver, privateMap, value) {
216
- if (!privateMap.has(receiver)) {
217
- throw new TypeError("attempted to set private field on non-instance");
218
- }
219
- privateMap.set(receiver, value);
220
- return value;
221
- }
9
+ /*
10
+ <file>
11
+ Authors:
12
+ Vadim Osovitny
13
+
14
+ Created:
15
+ 4 Mar 2020
16
+
17
+ Version:
18
+ 1.0
19
+
20
+ Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
21
+ </file>
22
+ */
23
+ var Alerts = /** @class */ (function () {
24
+ function Alerts() {
25
+ }
26
+ Alerts.Info = function (text) {
27
+ Swal.fire({
28
+ title: "Information",
29
+ text: text,
30
+ icon: "info",
31
+ confirmButtonText: "OK",
32
+ });
33
+ };
34
+ Alerts.Warning = function (text) {
35
+ Swal.fire({
36
+ title: "Warning",
37
+ text: text,
38
+ icon: "warning",
39
+ confirmButtonText: "OK",
40
+ });
41
+ };
42
+ Alerts.Error = function (text) {
43
+ Swal.fire({
44
+ title: "Error",
45
+ text: text,
46
+ icon: "error",
47
+ confirmButtonText: "OK",
48
+ });
49
+ };
50
+ Alerts.NotImplemented = function () {
51
+ this.Warning("Not Implemented Yet");
52
+ };
53
+ Alerts.ErrorOccurred = function () {
54
+ this.Error("Sorry, an unexpected error occurred");
55
+ };
56
+ Alerts.AreYouSure = function (text, title, confirmButtonText, cancelButtonText, successAction, cancelAction) {
57
+ if (typeof title == "undefined" || title == null)
58
+ title = "Are you sure?";
59
+ Swal.fire({
60
+ title: title,
61
+ text: text,
62
+ icon: "warning",
63
+ confirmButtonText: confirmButtonText,
64
+ cancelButtonText: cancelButtonText,
65
+ showCancelButton: true,
66
+ }).then(function (result) {
67
+ if (result.value) {
68
+ if (successAction) {
69
+ successAction();
70
+ }
71
+ }
72
+ // result.dismiss can be 'cancel', 'overlay', 'close', and 'timer'
73
+ else if (result.dismiss == Swal.DismissReason.cancel ||
74
+ result.dismiss == Swal.DismissReason.close) {
75
+ if (cancelAction) {
76
+ cancelAction();
77
+ }
78
+ }
79
+ });
80
+ };
81
+ Alerts.Success = function (text, title, successAction) {
82
+ if (typeof title == "undefined" || title == null)
83
+ title = "Success";
84
+ if (!text) {
85
+ text = "Operation was successful";
86
+ }
87
+ Swal.fire({
88
+ title: title,
89
+ text: text,
90
+ icon: "success",
91
+ confirmButtonText: "OK",
92
+ }).then(function () {
93
+ if (successAction) {
94
+ successAction();
95
+ }
96
+ });
97
+ };
98
+ Alerts.Cancel = function (text) {
99
+ if (!text) {
100
+ text = "Operation has been cancled";
101
+ }
102
+ Swal.fire({
103
+ title: "Cancelled",
104
+ text: text,
105
+ icon: "info",
106
+ });
107
+ };
108
+ //Notifications
109
+ Alerts.NotificationCancel = function (text, title) {
110
+ if (typeof title == "undefined" || title == null) {
111
+ title = "Canceled";
112
+ }
113
+ if (!text) {
114
+ text = "Operation has been canceled";
115
+ }
116
+ var toast = Swal.mixin({
117
+ toast: true,
118
+ position: "top-end",
119
+ showConfirmButton: false,
120
+ timer: 3000,
121
+ timerProgressBar: true,
122
+ });
123
+ toast.fire({
124
+ title: title,
125
+ text: text,
126
+ icon: "info",
127
+ });
128
+ };
129
+ Alerts.NotificationSuccess = function (text, title) {
130
+ if (typeof title == "undefined" || title == null) {
131
+ title = "Success";
132
+ }
133
+ if (!text) {
134
+ text = "Operation was successful";
135
+ }
136
+ var toast = Swal.mixin({
137
+ toast: true,
138
+ position: "top-end",
139
+ showConfirmButton: false,
140
+ timer: 3000,
141
+ timerProgressBar: true,
142
+ });
143
+ toast.fire({
144
+ title: title,
145
+ text: text,
146
+ icon: "success",
147
+ });
148
+ };
149
+ return Alerts;
150
+ }());
222
151
 
223
- /*
224
- <file>
225
- Authors:
226
- Vadim Osovitny
227
-
228
- Created:
229
- 4 Mar 2020
230
-
231
- Version:
232
- 1.0
233
-
234
- Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
235
- </file>
236
- */
237
- var Alerts = /** @class */ (function () {
238
- function Alerts() {
239
- }
240
- Alerts.Info = function (text) {
241
- Swal.fire({
242
- title: "Information",
243
- text: text,
244
- icon: "info",
245
- confirmButtonText: "OK"
246
- });
247
- };
248
- Alerts.Warning = function (text) {
249
- Swal.fire({
250
- title: "Warning",
251
- text: text,
252
- icon: "warning",
253
- confirmButtonText: "OK"
254
- });
255
- };
256
- Alerts.Error = function (text) {
257
- Swal.fire({
258
- title: "Error",
259
- text: text,
260
- icon: "error",
261
- confirmButtonText: "OK"
262
- });
263
- };
264
- Alerts.NotImplemented = function () {
265
- this.Warning("Not Implemented Yet");
266
- };
267
- ;
268
- Alerts.ErrorOccurred = function () {
269
- this.Error("Sorry, an unexpected error occurred");
270
- };
271
- ;
272
- Alerts.AreYouSure = function (text, title, confirmButtonText, cancelButtonText, successAction, cancelAction) {
273
- if (typeof title == "undefined" || title == null)
274
- title = "Are you sure?";
275
- Swal.fire({
276
- title: title,
277
- text: text,
278
- icon: 'warning',
279
- confirmButtonText: confirmButtonText,
280
- cancelButtonText: cancelButtonText,
281
- showCancelButton: true
282
- })
283
- .then(function (result) {
284
- if (result.value) {
285
- if (successAction) {
286
- successAction();
287
- }
288
- }
289
- // result.dismiss can be 'cancel', 'overlay', 'close', and 'timer'
290
- else if (result.dismiss == Swal.DismissReason.cancel || result.dismiss == Swal.DismissReason.close) {
291
- if (cancelAction) {
292
- cancelAction();
293
- }
294
- }
295
- });
296
- };
297
- ;
298
- Alerts.Success = function (text, title, successAction) {
299
- if (typeof title == "undefined" || title == null)
300
- title = "Success";
301
- if (!text) {
302
- text = "Operation was successful";
303
- }
304
- Swal.fire({
305
- title: title,
306
- text: text,
307
- icon: "success",
308
- confirmButtonText: "OK"
309
- })
310
- .then(function () {
311
- if (successAction) {
312
- successAction();
313
- }
314
- });
315
- };
316
- Alerts.Cancel = function (text) {
317
- if (!text) {
318
- text = "Operation has been cancled";
319
- }
320
- Swal.fire({
321
- title: 'Cancelled',
322
- text: text,
323
- icon: "info"
324
- });
325
- };
326
- //Notifications
327
- Alerts.NotificationCancel = function (text, title) {
328
- if (typeof title == "undefined" || title == null) {
329
- title = "Canceled";
330
- }
331
- if (!text) {
332
- text = "Operation has been canceled";
333
- }
334
- var toast = Swal.mixin({
335
- toast: true,
336
- position: 'top-end',
337
- showConfirmButton: false,
338
- timer: 3000,
339
- timerProgressBar: true
340
- });
341
- toast.fire({
342
- title: title,
343
- text: text,
344
- icon: "info"
345
- });
346
- };
347
- Alerts.NotificationSuccess = function (text, title) {
348
- if (typeof title == "undefined" || title == null) {
349
- title = "Success";
350
- }
351
- if (!text) {
352
- text = "Operation was successful";
353
- }
354
- var toast = Swal.mixin({
355
- toast: true,
356
- position: 'top-end',
357
- showConfirmButton: false,
358
- timer: 3000,
359
- timerProgressBar: true
360
- });
361
- toast.fire({
362
- title: title,
363
- text: text,
364
- icon: "success",
365
- });
366
- };
367
- return Alerts;
368
- }());
152
+ /*
153
+ <file>
154
+ Authors:
155
+ Vadim Osovitny
156
+
157
+ Created:
158
+ 4 Mar 2020
159
+
160
+ Version:
161
+ 1.0
162
+
163
+ Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
164
+ </file>
165
+ */
166
+ var Utils = /** @class */ (function () {
167
+ function Utils() {
168
+ }
169
+ Utils.GetValueByNameInQS = function (name) {
170
+ return Utils.GetValueByName(location.search, name);
171
+ };
172
+ Utils.GetValueByName = function (url, name) {
173
+ name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
174
+ var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"), results = regex.exec(url);
175
+ return results === null
176
+ ? ""
177
+ : decodeURIComponent(results[1].replace(/\+/g, " "));
178
+ };
179
+ return Utils;
180
+ }());
369
181
 
370
- /*
371
- <file>
372
- Authors:
373
- Vadim Osovitny
374
-
375
- Created:
376
- 4 Mar 2020
377
-
378
- Version:
379
- 1.0
380
-
381
- Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
382
- </file>
383
- */
384
- var Utils = /** @class */ (function () {
385
- function Utils() {
386
- }
387
- Utils.GetValueByNameInQS = function (name) {
388
- return Utils.GetValueByName(location.search, name);
389
- };
390
- Utils.GetValueByName = function (url, name) {
391
- name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
392
- var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"), results = regex.exec(url);
393
- return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
394
- };
395
- return Utils;
396
- }());
182
+ /*
183
+ <file>
184
+ Authors:
185
+ Vadim Osovitny
186
+
187
+ Created:
188
+ 17 Jun 2018
189
+
190
+ Version:
191
+ 1.0
192
+
193
+ Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
194
+ </file>
195
+ */
196
+ var BaseGoService = /** @class */ (function () {
197
+ function BaseGoService(route, router) {
198
+ this.route = route;
199
+ this.router = router;
200
+ }
201
+ BaseGoService.prototype.locationReload = function () {
202
+ //this.router.navigate([this.route.url]);
203
+ window.location.reload();
204
+ };
205
+ return BaseGoService;
206
+ }());
207
+ BaseGoService.decorators = [
208
+ { type: core.Injectable }
209
+ ];
210
+ BaseGoService.ctorParameters = function () { return [
211
+ { type: router.ActivatedRoute },
212
+ { type: router.Router }
213
+ ]; };
397
214
 
398
- /*
399
- <file>
400
- Authors:
401
- Vadim Osovitny
402
-
403
- Created:
404
- 17 Jun 2018
405
-
406
- Version:
407
- 1.0
408
-
409
- Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
410
- </file>
411
- */
412
- var BaseGoService = /** @class */ (function () {
413
- function BaseGoService(route, router) {
414
- this.route = route;
415
- this.router = router;
416
- }
417
- BaseGoService.prototype.locationReload = function () {
418
- //this.router.navigate([this.route.url]);
419
- window.location.reload();
420
- };
421
- BaseGoService.ctorParameters = function () { return [
422
- { type: router.ActivatedRoute },
423
- { type: router.Router }
424
- ]; };
425
- BaseGoService = __decorate([
426
- core.Injectable()
427
- ], BaseGoService);
428
- return BaseGoService;
429
- }());
215
+ /*! *****************************************************************************
216
+ Copyright (c) Microsoft Corporation.
217
+
218
+ Permission to use, copy, modify, and/or distribute this software for any
219
+ purpose with or without fee is hereby granted.
220
+
221
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
222
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
223
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
224
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
225
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
226
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
227
+ PERFORMANCE OF THIS SOFTWARE.
228
+ ***************************************************************************** */
229
+ /* global Reflect, Promise */
230
+ var extendStatics = function (d, b) {
231
+ extendStatics = Object.setPrototypeOf ||
232
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
233
+ function (d, b) { for (var p in b)
234
+ if (b.hasOwnProperty(p))
235
+ d[p] = b[p]; };
236
+ return extendStatics(d, b);
237
+ };
238
+ function __extends(d, b) {
239
+ extendStatics(d, b);
240
+ function __() { this.constructor = d; }
241
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
242
+ }
243
+ var __assign = function () {
244
+ __assign = Object.assign || function __assign(t) {
245
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
246
+ s = arguments[i];
247
+ for (var p in s)
248
+ if (Object.prototype.hasOwnProperty.call(s, p))
249
+ t[p] = s[p];
250
+ }
251
+ return t;
252
+ };
253
+ return __assign.apply(this, arguments);
254
+ };
255
+ function __rest(s, e) {
256
+ var t = {};
257
+ for (var p in s)
258
+ if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
259
+ t[p] = s[p];
260
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
261
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
262
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
263
+ t[p[i]] = s[p[i]];
264
+ }
265
+ return t;
266
+ }
267
+ function __decorate(decorators, target, key, desc) {
268
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
269
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
270
+ r = Reflect.decorate(decorators, target, key, desc);
271
+ else
272
+ for (var i = decorators.length - 1; i >= 0; i--)
273
+ if (d = decorators[i])
274
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
275
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
276
+ }
277
+ function __param(paramIndex, decorator) {
278
+ return function (target, key) { decorator(target, key, paramIndex); };
279
+ }
280
+ function __metadata(metadataKey, metadataValue) {
281
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
282
+ return Reflect.metadata(metadataKey, metadataValue);
283
+ }
284
+ function __awaiter(thisArg, _arguments, P, generator) {
285
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
286
+ return new (P || (P = Promise))(function (resolve, reject) {
287
+ function fulfilled(value) { try {
288
+ step(generator.next(value));
289
+ }
290
+ catch (e) {
291
+ reject(e);
292
+ } }
293
+ function rejected(value) { try {
294
+ step(generator["throw"](value));
295
+ }
296
+ catch (e) {
297
+ reject(e);
298
+ } }
299
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
300
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
301
+ });
302
+ }
303
+ function __generator(thisArg, body) {
304
+ var _ = { label: 0, sent: function () { if (t[0] & 1)
305
+ throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
306
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
307
+ function verb(n) { return function (v) { return step([n, v]); }; }
308
+ function step(op) {
309
+ if (f)
310
+ throw new TypeError("Generator is already executing.");
311
+ while (_)
312
+ try {
313
+ 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)
314
+ return t;
315
+ if (y = 0, t)
316
+ op = [op[0] & 2, t.value];
317
+ switch (op[0]) {
318
+ case 0:
319
+ case 1:
320
+ t = op;
321
+ break;
322
+ case 4:
323
+ _.label++;
324
+ return { value: op[1], done: false };
325
+ case 5:
326
+ _.label++;
327
+ y = op[1];
328
+ op = [0];
329
+ continue;
330
+ case 7:
331
+ op = _.ops.pop();
332
+ _.trys.pop();
333
+ continue;
334
+ default:
335
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
336
+ _ = 0;
337
+ continue;
338
+ }
339
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
340
+ _.label = op[1];
341
+ break;
342
+ }
343
+ if (op[0] === 6 && _.label < t[1]) {
344
+ _.label = t[1];
345
+ t = op;
346
+ break;
347
+ }
348
+ if (t && _.label < t[2]) {
349
+ _.label = t[2];
350
+ _.ops.push(op);
351
+ break;
352
+ }
353
+ if (t[2])
354
+ _.ops.pop();
355
+ _.trys.pop();
356
+ continue;
357
+ }
358
+ op = body.call(thisArg, _);
359
+ }
360
+ catch (e) {
361
+ op = [6, e];
362
+ y = 0;
363
+ }
364
+ finally {
365
+ f = t = 0;
366
+ }
367
+ if (op[0] & 5)
368
+ throw op[1];
369
+ return { value: op[0] ? op[1] : void 0, done: true };
370
+ }
371
+ }
372
+ var __createBinding = Object.create ? (function (o, m, k, k2) {
373
+ if (k2 === undefined)
374
+ k2 = k;
375
+ Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
376
+ }) : (function (o, m, k, k2) {
377
+ if (k2 === undefined)
378
+ k2 = k;
379
+ o[k2] = m[k];
380
+ });
381
+ function __exportStar(m, exports) {
382
+ for (var p in m)
383
+ if (p !== "default" && !exports.hasOwnProperty(p))
384
+ __createBinding(exports, m, p);
385
+ }
386
+ function __values(o) {
387
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
388
+ if (m)
389
+ return m.call(o);
390
+ if (o && typeof o.length === "number")
391
+ return {
392
+ next: function () {
393
+ if (o && i >= o.length)
394
+ o = void 0;
395
+ return { value: o && o[i++], done: !o };
396
+ }
397
+ };
398
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
399
+ }
400
+ function __read(o, n) {
401
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
402
+ if (!m)
403
+ return o;
404
+ var i = m.call(o), r, ar = [], e;
405
+ try {
406
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
407
+ ar.push(r.value);
408
+ }
409
+ catch (error) {
410
+ e = { error: error };
411
+ }
412
+ finally {
413
+ try {
414
+ if (r && !r.done && (m = i["return"]))
415
+ m.call(i);
416
+ }
417
+ finally {
418
+ if (e)
419
+ throw e.error;
420
+ }
421
+ }
422
+ return ar;
423
+ }
424
+ function __spread() {
425
+ for (var ar = [], i = 0; i < arguments.length; i++)
426
+ ar = ar.concat(__read(arguments[i]));
427
+ return ar;
428
+ }
429
+ function __spreadArrays() {
430
+ for (var s = 0, i = 0, il = arguments.length; i < il; i++)
431
+ s += arguments[i].length;
432
+ for (var r = Array(s), k = 0, i = 0; i < il; i++)
433
+ for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
434
+ r[k] = a[j];
435
+ return r;
436
+ }
437
+ ;
438
+ function __await(v) {
439
+ return this instanceof __await ? (this.v = v, this) : new __await(v);
440
+ }
441
+ function __asyncGenerator(thisArg, _arguments, generator) {
442
+ if (!Symbol.asyncIterator)
443
+ throw new TypeError("Symbol.asyncIterator is not defined.");
444
+ var g = generator.apply(thisArg, _arguments || []), i, q = [];
445
+ return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
446
+ function verb(n) { if (g[n])
447
+ i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
448
+ function resume(n, v) { try {
449
+ step(g[n](v));
450
+ }
451
+ catch (e) {
452
+ settle(q[0][3], e);
453
+ } }
454
+ function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
455
+ function fulfill(value) { resume("next", value); }
456
+ function reject(value) { resume("throw", value); }
457
+ function settle(f, v) { if (f(v), q.shift(), q.length)
458
+ resume(q[0][0], q[0][1]); }
459
+ }
460
+ function __asyncDelegator(o) {
461
+ var i, p;
462
+ return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
463
+ 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; }
464
+ }
465
+ function __asyncValues(o) {
466
+ if (!Symbol.asyncIterator)
467
+ throw new TypeError("Symbol.asyncIterator is not defined.");
468
+ var m = o[Symbol.asyncIterator], i;
469
+ 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);
470
+ 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); }); }; }
471
+ function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
472
+ }
473
+ function __makeTemplateObject(cooked, raw) {
474
+ if (Object.defineProperty) {
475
+ Object.defineProperty(cooked, "raw", { value: raw });
476
+ }
477
+ else {
478
+ cooked.raw = raw;
479
+ }
480
+ return cooked;
481
+ }
482
+ ;
483
+ var __setModuleDefault = Object.create ? (function (o, v) {
484
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
485
+ }) : function (o, v) {
486
+ o["default"] = v;
487
+ };
488
+ function __importStar(mod) {
489
+ if (mod && mod.__esModule)
490
+ return mod;
491
+ var result = {};
492
+ if (mod != null)
493
+ for (var k in mod)
494
+ if (Object.hasOwnProperty.call(mod, k))
495
+ __createBinding(result, mod, k);
496
+ __setModuleDefault(result, mod);
497
+ return result;
498
+ }
499
+ function __importDefault(mod) {
500
+ return (mod && mod.__esModule) ? mod : { default: mod };
501
+ }
502
+ function __classPrivateFieldGet(receiver, privateMap) {
503
+ if (!privateMap.has(receiver)) {
504
+ throw new TypeError("attempted to get private field on non-instance");
505
+ }
506
+ return privateMap.get(receiver);
507
+ }
508
+ function __classPrivateFieldSet(receiver, privateMap, value) {
509
+ if (!privateMap.has(receiver)) {
510
+ throw new TypeError("attempted to set private field on non-instance");
511
+ }
512
+ privateMap.set(receiver, value);
513
+ return value;
514
+ }
430
515
 
431
- /*
432
- <file>
433
- Authors:
434
- Vadim Osovitny
435
-
436
- Created:
437
- 13 Nov 2017
438
-
439
- Version:
440
- 1.0
441
-
442
- Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
443
- </file>
444
- */
445
- var BaseApiService = /** @class */ (function () {
446
- function BaseApiService(http) {
447
- this.http = http;
448
- this.baseUrl = "";
449
- }
450
- BaseApiService.prototype.serializeParams = function (data) {
451
- return data ? ('?' + $.param(data)) : '';
452
- };
453
- //api
454
- BaseApiService.prototype.get = function (action, data, responseType) {
455
- if (!responseType) {
456
- responseType = 'json';
457
- }
458
- var url = this.baseUrl + "/" + action + this.serializeParams(data);
459
- return this.http.get(url, { responseType: responseType }).pipe(operators.map(function (res) { return res; }));
460
- };
461
- BaseApiService.prototype.post = function (action, data, responseType) {
462
- if (!responseType) {
463
- responseType = 'text';
464
- }
465
- var url = this.baseUrl + "/" + action;
466
- return this.http.post(url, data, { responseType: responseType });
467
- };
468
- BaseApiService.prototype.postQS = function (action, data, responseType) {
469
- if (!responseType) {
470
- responseType = 'text';
471
- }
472
- var url = this.baseUrl + "/" + action + this.serializeParams(data);
473
- return this.http.post(url, null, { responseType: responseType });
474
- };
475
- BaseApiService.prototype.delete = function (action, data, responseType) {
476
- if (!responseType) {
477
- responseType = 'text';
478
- }
479
- var url = this.baseUrl + "/" + action + this.serializeParams(data);
480
- return this.http.delete(url, { responseType: responseType });
481
- };
482
- //gets
483
- BaseApiService.prototype.getById = function (id) {
484
- return this.get('getById', { id: id });
485
- };
486
- BaseApiService.prototype.getAll = function (data) {
487
- return this.get('getall', data).pipe(operators.map(function (res) { return res; }));
488
- };
489
- BaseApiService.prototype.getJsonFile = function (fileName, jsonUrl, jsonVersion) {
490
- if (!jsonUrl) {
491
- jsonUrl = "/dist/jsons";
492
- }
493
- if (!jsonVersion) {
494
- jsonVersion = "1.0";
495
- }
496
- var url = jsonUrl + "/" + fileName + '?' + jsonVersion;
497
- return this.http.get(url).pipe(operators.map(function (res) { return res; }));
498
- };
499
- BaseApiService.prototype.getNewGuid = function () {
500
- var url = this.baseUrl + "/getNewGuid";
501
- return this.http.get(url, { responseType: 'text' });
502
- };
503
- BaseApiService.ctorParameters = function () { return [
504
- { type: http.HttpClient }
505
- ]; };
506
- BaseApiService = __decorate([
507
- core.Injectable()
508
- ], BaseApiService);
509
- return BaseApiService;
510
- }());
516
+ /*
517
+ <file>
518
+ Authors:
519
+ Vadim Osovitny
520
+
521
+ Created:
522
+ 13 Nov 2017
523
+
524
+ Version:
525
+ 1.0
526
+
527
+ Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
528
+ </file>
529
+ */
530
+ var BaseApiService = /** @class */ (function () {
531
+ function BaseApiService(http) {
532
+ this.http = http;
533
+ this.baseUrl = "";
534
+ }
535
+ BaseApiService.prototype.serializeParams = function (data) {
536
+ return data ? ('?' + $.param(data)) : '';
537
+ };
538
+ //api
539
+ BaseApiService.prototype.get = function (action, data, responseType) {
540
+ if (!responseType) {
541
+ responseType = 'json';
542
+ }
543
+ var url = this.baseUrl + "/" + action + this.serializeParams(data);
544
+ return this.http.get(url, { responseType: responseType }).pipe(operators.map(function (res) { return res; }));
545
+ };
546
+ BaseApiService.prototype.post = function (action, data, responseType) {
547
+ if (!responseType) {
548
+ responseType = 'text';
549
+ }
550
+ var url = this.baseUrl + "/" + action;
551
+ return this.http.post(url, data, { responseType: responseType });
552
+ };
553
+ BaseApiService.prototype.postQS = function (action, data, responseType) {
554
+ if (!responseType) {
555
+ responseType = 'text';
556
+ }
557
+ var url = this.baseUrl + "/" + action + this.serializeParams(data);
558
+ return this.http.post(url, null, { responseType: responseType });
559
+ };
560
+ BaseApiService.prototype.delete = function (action, data, responseType) {
561
+ if (!responseType) {
562
+ responseType = 'text';
563
+ }
564
+ var url = this.baseUrl + "/" + action + this.serializeParams(data);
565
+ return this.http.delete(url, { responseType: responseType });
566
+ };
567
+ //gets
568
+ BaseApiService.prototype.getById = function (id) {
569
+ return this.get('getById', { id: id });
570
+ };
571
+ BaseApiService.prototype.getAll = function (data) {
572
+ return this.get('getall', data).pipe(operators.map(function (res) { return res; }));
573
+ };
574
+ BaseApiService.prototype.getJsonFile = function (fileName, jsonUrl, jsonVersion) {
575
+ if (!jsonUrl) {
576
+ jsonUrl = "/dist/jsons";
577
+ }
578
+ if (!jsonVersion) {
579
+ jsonVersion = "1.0";
580
+ }
581
+ var url = jsonUrl + "/" + fileName + '?' + jsonVersion;
582
+ return this.http.get(url).pipe(operators.map(function (res) { return res; }));
583
+ };
584
+ BaseApiService.prototype.getNewGuid = function () {
585
+ var url = this.baseUrl + "/getNewGuid";
586
+ return this.http.get(url, { responseType: 'text' });
587
+ };
588
+ return BaseApiService;
589
+ }());
590
+ BaseApiService.decorators = [
591
+ { type: core.Injectable }
592
+ ];
593
+ BaseApiService.ctorParameters = function () { return [
594
+ { type: http.HttpClient }
595
+ ]; };
511
596
 
512
- /*
513
- <file>
514
- Authors:
515
- Vadim Osovitny
516
-
517
- Created:
518
- 13 Nov 2017
519
-
520
- Version:
521
- 1.0
522
-
523
- Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
524
- </file>
525
- */
526
- var AppContextService = /** @class */ (function (_super) {
527
- __extends(AppContextService, _super);
528
- function AppContextService(http) {
529
- var _this = _super.call(this, http) || this;
530
- _this.http = http;
531
- _this.current = null;
532
- _this.successes = [];
533
- _this.subscription = null;
534
- _this.baseUrl = '/api/appContext';
535
- return _this;
536
- }
537
- AppContextService.prototype.getCurrent = function (success) {
538
- var _this = this;
539
- if (typeof success == "undefined") {
540
- return;
541
- }
542
- if (this.current != null) {
543
- success(this.current);
544
- return;
545
- }
546
- this.successes.push(success);
547
- if (this.subscription != null) {
548
- return;
549
- }
550
- this.subscription = this.get('GetCurrentContext', null).subscribe(function (data) {
551
- _this.dataReceived(data);
552
- }, function (e) { });
553
- };
554
- AppContextService.prototype.dataReceived = function (data) {
555
- this.current = data;
556
- for (var i = 0; i < this.successes.length; i++) {
557
- var success = this.successes[i];
558
- success(data);
559
- }
560
- this.successes = [];
561
- this.subscription.unsubscribe();
562
- this.subscription = null;
563
- this.current = null;
564
- };
565
- AppContextService.prototype.isUserSignedIn = function () {
566
- return window.__context_isUserSignedIn;
567
- };
568
- AppContextService.prototype.isUserAdmin = function () {
569
- return window.__context_isUserAdmin;
570
- };
571
- AppContextService.ctorParameters = function () { return [
572
- { type: http.HttpClient }
573
- ]; };
574
- AppContextService = __decorate([
575
- core.Injectable()
576
- ], AppContextService);
577
- return AppContextService;
578
- }(BaseApiService));
597
+ var AppContextService = /** @class */ (function (_super) {
598
+ __extends(AppContextService, _super);
599
+ function AppContextService(http) {
600
+ var _this = _super.call(this, http) || this;
601
+ _this.http = http;
602
+ _this.current = null;
603
+ _this.successes = [];
604
+ _this.subscription = null;
605
+ _this.baseUrl = "/api/appContext";
606
+ return _this;
607
+ }
608
+ AppContextService.prototype.getCurrent = function (success) {
609
+ var _this = this;
610
+ if (typeof success == "undefined") {
611
+ return;
612
+ }
613
+ if (this.current != null) {
614
+ success(this.current);
615
+ return;
616
+ }
617
+ this.successes.push(success);
618
+ if (this.subscription != null) {
619
+ return;
620
+ }
621
+ this.subscription = this.get("GetCurrentContext", null).subscribe(function (data) {
622
+ _this.dataReceived(data);
623
+ }, function (e) { });
624
+ };
625
+ AppContextService.prototype.dataReceived = function (data) {
626
+ this.current = data;
627
+ for (var i = 0; i < this.successes.length; i++) {
628
+ var success = this.successes[i];
629
+ success(data);
630
+ }
631
+ this.successes = [];
632
+ this.subscription.unsubscribe();
633
+ this.subscription = null;
634
+ this.current = null;
635
+ };
636
+ AppContextService.prototype.isUserSignedIn = function () {
637
+ return window.__context_isUserSignedIn;
638
+ };
639
+ AppContextService.prototype.isUserAdmin = function () {
640
+ return window.__context_isUserAdmin;
641
+ };
642
+ return AppContextService;
643
+ }(BaseApiService));
644
+ AppContextService.decorators = [
645
+ { type: core.Injectable }
646
+ ];
647
+ AppContextService.ctorParameters = function () { return [
648
+ { type: http.HttpClient }
649
+ ]; };
579
650
 
580
- /*
581
- <file>
582
- Authors:
583
- Vadim Osovitny
584
-
585
- Created:
586
- 28 Aug 2018
587
-
588
- Version:
589
- 1.0
590
-
591
- Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
592
- </file>
593
- */
594
- var BaseComponent = /** @class */ (function () {
595
- function BaseComponent() {
596
- }
597
- BaseComponent.prototype.getQSId = function () {
598
- var id = Utils.GetValueByNameInQS("id");
599
- if (typeof id === 'undefined' || id == '')
600
- return null;
601
- return id;
602
- };
603
- BaseComponent.prototype.showLoading = function () {
604
- var panelLoading = $('#pnlLoading');
605
- panelLoading.show();
606
- };
607
- BaseComponent.prototype.hideLoading = function () {
608
- var panelLoading = $('#pnlLoading');
609
- panelLoading.hide();
610
- };
611
- BaseComponent.prototype.handleError = function (e) {
612
- this.hideLoading();
613
- Alerts.ErrorOccurred();
614
- };
615
- return BaseComponent;
616
- }());
651
+ var AnatolyCoreModule = /** @class */ (function () {
652
+ function AnatolyCoreModule() {
653
+ }
654
+ return AnatolyCoreModule;
655
+ }());
656
+ AnatolyCoreModule.decorators = [
657
+ { type: core.NgModule, args: [{
658
+ declarations: [],
659
+ imports: [common.CommonModule],
660
+ providers: [AppContextService],
661
+ },] }
662
+ ];
617
663
 
618
- /*
619
- <file>
620
- Authors:
621
- Vadim Osovitny
622
-
623
- Created:
624
- 20 Nov 2017
625
-
626
- Version:
627
- 1.0
628
-
629
- Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
630
- </file>
631
- */
632
- var BaseEditComponent = /** @class */ (function (_super) {
633
- __extends(BaseEditComponent, _super);
634
- function BaseEditComponent() {
635
- var _this = _super.call(this) || this;
636
- _this.formSubmitted = false;
637
- return _this;
638
- }
639
- BaseEditComponent.prototype.isActionAdding = function () {
640
- var id = Utils.GetValueByNameInQS("id");
641
- if (typeof id === 'undefined' || id == '')
642
- return true;
643
- return false;
644
- };
645
- BaseEditComponent.prototype.getEntityId = function () {
646
- return this.getQSId();
647
- };
648
- BaseEditComponent.prototype.isItemInvalid = function (name) {
649
- if (typeof name === 'undefined' || name == '') {
650
- return false;
651
- }
652
- if (!this.formGroup) {
653
- return false;
654
- }
655
- if (this.formGroup.get(name)) {
656
- return (this.formSubmitted && this.formGroup.get(name).invalid) ||
657
- (this.formGroup.get(name).touched && this.formGroup.get(name).invalid);
658
- }
659
- return false;
660
- };
661
- BaseEditComponent.prototype.getFormValue = function (name) {
662
- return this.formGroup.controls[name].value;
663
- };
664
- BaseEditComponent.prototype.setFormValue = function (name, value) {
665
- this.formGroup.controls[name].setValue(value);
666
- };
667
- BaseEditComponent.prototype.getFormGroupValue = function (groupName, name) {
668
- return this.formGroup.controls[groupName].get(name).value;
669
- };
670
- BaseEditComponent.prototype.setFormGroupValue = function (groupName, name, value) {
671
- this.formGroup.controls[groupName].get(name).setValue(value);
672
- };
673
- __decorate([
674
- core.Input()
675
- ], BaseEditComponent.prototype, "formGroup", void 0);
676
- __decorate([
677
- core.Input()
678
- ], BaseEditComponent.prototype, "formSubmitted", void 0);
679
- return BaseEditComponent;
680
- }(BaseComponent));
664
+ var BaseGridReadService = /** @class */ (function (_super) {
665
+ __extends(BaseGridReadService, _super);
666
+ function BaseGridReadService(http) {
667
+ var _this = _super.call(this, []) || this;
668
+ _this.http = http;
669
+ _this.baseReadUrl = "";
670
+ _this.data = [];
671
+ return _this;
672
+ }
673
+ BaseGridReadService.prototype.serializeParams = function (data) {
674
+ return data ? ('?' + $.param(data)) : '';
675
+ };
676
+ BaseGridReadService.prototype.read = function (params, success, error) {
677
+ var _this = this;
678
+ if (this.data.length) {
679
+ return _super.prototype.next.call(this, this.data);
680
+ }
681
+ var url = this.baseReadUrl;
682
+ if (typeof params === 'undefined') {
683
+ params = this.savedReadParams;
684
+ }
685
+ if (params) {
686
+ url = this.baseReadUrl + ("" + this.serializeParams(params));
687
+ this.savedReadParams = params;
688
+ }
689
+ this.http.get(url).pipe(operators.map(function (res) { return res; })).subscribe(function (data) {
690
+ _super.prototype.next.call(_this, data);
691
+ if (success)
692
+ success();
693
+ }, function (e) {
694
+ if (error)
695
+ error(e);
696
+ });
697
+ };
698
+ return BaseGridReadService;
699
+ }(rxjs.BehaviorSubject));
700
+ BaseGridReadService.decorators = [
701
+ { type: core.Injectable }
702
+ ];
703
+ BaseGridReadService.ctorParameters = function () { return [
704
+ { type: http.HttpClient }
705
+ ]; };
681
706
 
682
- /*
683
- <file>
684
- Authors:
685
- Anatoly Osovitny
686
-
687
- Created:
688
- 23 Apr 2018
689
-
690
- Version:
691
- 1.0
692
-
693
- Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
694
- </file>
695
- */
696
- var ContentHeaderComponent = /** @class */ (function () {
697
- function ContentHeaderComponent() {
698
- }
699
- ContentHeaderComponent.prototype.ngOnInit = function () {
700
- if (this.title == null) {
701
- this.title = '';
702
- }
703
- };
704
- __decorate([
705
- core.Input()
706
- ], ContentHeaderComponent.prototype, "title", void 0);
707
- ContentHeaderComponent = __decorate([
708
- core.Component({
709
- selector: 'anatoly-content-header',
710
- template: "<h2 class=\"page-header\">\r\n {{title}}\r\n <!--<small>Optional {{title}}</small>-->\r\n</h2>\r\n"
711
- })
712
- ], ContentHeaderComponent);
713
- return ContentHeaderComponent;
714
- }());
707
+ var BaseGridEditService = /** @class */ (function (_super) {
708
+ __extends(BaseGridEditService, _super);
709
+ function BaseGridEditService(http) {
710
+ var _this = _super.call(this, http) || this;
711
+ _this.http = http;
712
+ _this.baseUrl = "";
713
+ return _this;
714
+ }
715
+ BaseGridEditService.prototype.reset = function () {
716
+ this.data = [];
717
+ };
718
+ BaseGridEditService.prototype.resetItem = function (dataItem) {
719
+ if (!dataItem) {
720
+ return;
721
+ }
722
+ //find orignal data item
723
+ var originalDataItem = this.data.find(function (item) { return item.Id === dataItem.Id; });
724
+ //revert changes
725
+ Object.assign(originalDataItem, dataItem);
726
+ _super.prototype.next.call(this, this.data);
727
+ };
728
+ BaseGridEditService.prototype.save = function (data, isNew, sucess) {
729
+ var _this = this;
730
+ var action = isNew ? 'add' : 'update';
731
+ this.reset();
732
+ this.post(action, data).subscribe(function () {
733
+ }, function () {
734
+ _this.read();
735
+ }, function () {
736
+ _this.read();
737
+ if (sucess)
738
+ sucess();
739
+ });
740
+ };
741
+ BaseGridEditService.prototype.remove = function (data, sucess) {
742
+ var _this = this;
743
+ this.reset();
744
+ this.post('remove', data).subscribe(function () {
745
+ }, function () {
746
+ _this.read();
747
+ }, function () {
748
+ _this.read();
749
+ if (sucess)
750
+ sucess();
751
+ });
752
+ };
753
+ BaseGridEditService.prototype.post = function (action, data) {
754
+ var url = this.baseUrl + ("" + action + this.serializeParams(data));
755
+ return this.http.post(url, data).pipe(operators.map(function (res) { return res; }));
756
+ };
757
+ return BaseGridEditService;
758
+ }(BaseGridReadService));
759
+ BaseGridEditService.decorators = [
760
+ { type: core.Injectable }
761
+ ];
762
+ BaseGridEditService.ctorParameters = function () { return [
763
+ { type: http.HttpClient }
764
+ ]; };
715
765
 
716
- /*
717
- <file>
718
- Authors:
719
- Vadim Osovitny
720
-
721
- Created:
722
- 8 Dec 2017
723
-
724
- Version:
725
- 1.0
726
-
727
- Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
728
- </file>
729
- */
730
- var ValidationSummaryComponent = /** @class */ (function (_super) {
731
- __extends(ValidationSummaryComponent, _super);
732
- function ValidationSummaryComponent() {
733
- return _super.call(this) || this;
734
- }
735
- ValidationSummaryComponent.prototype.getFormValidationMessages = function () {
736
- var _this = this;
737
- var messages = [];
738
- Object.keys(this.formGroup.controls).forEach(function (k) {
739
- var control = _this.formGroup.controls[k];
740
- if (control.controls != null) {
741
- Object.keys(control.controls).forEach(function (k) {
742
- var child = control.controls[k];
743
- _this.getValidationMessages(child, k).forEach(function (m) { return messages.push(m); });
744
- });
745
- }
746
- else {
747
- _this.getValidationMessages(control, k).forEach(function (m) { return messages.push(m); });
748
- }
749
- });
750
- return messages;
751
- };
752
- ValidationSummaryComponent.prototype.getValidationMessages = function (state, thingName) {
753
- var thing = state.path || thingName;
754
- var messages = [];
755
- if (state.errors) {
756
- for (var errorName in state.errors) {
757
- if (state.errors.hasOwnProperty(errorName)) {
758
- switch (errorName) {
759
- case 'required':
760
- messages.push(thing + " is required");
761
- break;
762
- case 'minlength':
763
- messages.push(thing + " must be at least " + state.errors['minlength'].requiredLength + " characters");
764
- break;
765
- case 'pattern':
766
- messages.push(thing + " contains illegal characters");
767
- break;
768
- }
769
- }
770
- }
771
- }
772
- return messages;
773
- };
774
- return ValidationSummaryComponent;
775
- }(BaseEditComponent));
766
+ var BillingApiService = /** @class */ (function (_super) {
767
+ __extends(BillingApiService, _super);
768
+ function BillingApiService(http) {
769
+ var _this = _super.call(this, http) || this;
770
+ _this.http = http;
771
+ _this.baseUrl += 'billing/';
772
+ return _this;
773
+ }
774
+ BillingApiService.prototype.requestNewSubscription = function (requestedPlan, success, error) {
775
+ this.postQS('requestNewSubscription', { requestedPlan: requestedPlan })
776
+ .subscribe(function (data) { }, function (e) {
777
+ if (error)
778
+ error();
779
+ }, function () {
780
+ if (success)
781
+ success();
782
+ });
783
+ };
784
+ BillingApiService.prototype.cancelRequestedSubscription = function (success, error) {
785
+ this.postQS('cancelRequestedSubscription', null)
786
+ .subscribe(function (data) { }, function (e) {
787
+ if (error)
788
+ error();
789
+ }, function () {
790
+ if (success)
791
+ success();
792
+ });
793
+ };
794
+ BillingApiService.prototype.buyAccess = function (requestedPlan, success, error) {
795
+ this.postQS('buyAccess', { requestedPlan: requestedPlan })
796
+ .subscribe(function (data) { }, function (e) {
797
+ if (error)
798
+ error();
799
+ }, function () {
800
+ if (success)
801
+ success();
802
+ });
803
+ };
804
+ return BillingApiService;
805
+ }(BaseApiService));
806
+ BillingApiService.decorators = [
807
+ { type: core.Injectable }
808
+ ];
809
+ BillingApiService.ctorParameters = function () { return [
810
+ { type: http.HttpClient }
811
+ ]; };
776
812
 
777
- /*
778
- <file>
779
- Authors:
780
- Vadim Osovitny
781
-
782
- Created:
783
- 7 Dec 2017
784
-
785
- Version:
786
- 1.0
787
-
788
- Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
789
- </file>
790
- */
791
- var FormValidationSummaryComponent = /** @class */ (function (_super) {
792
- __extends(FormValidationSummaryComponent, _super);
793
- function FormValidationSummaryComponent() {
794
- var _this = _super.call(this) || this;
795
- _this.visible = false;
796
- return _this;
797
- }
798
- FormValidationSummaryComponent.prototype.getErrors = function () {
799
- var messages = this.getFormValidationMessages();
800
- return messages;
801
- };
802
- __decorate([
803
- core.Input()
804
- ], FormValidationSummaryComponent.prototype, "visible", void 0);
805
- FormValidationSummaryComponent = __decorate([
806
- core.Component({
807
- selector: 'anatoly-form-validation-summary',
808
- template: "<div class=\"callout callout-danger\" *ngIf=\"visible\">\r\n <h4 class=\"box-title\">There are problems with the form</h4>\r\n <p *ngFor=\"let error of getErrors()\"><span class=\"help-block \" style=\"color:white\">{{error}}</span></p>\r\n</div>\r\n"
809
- })
810
- ], FormValidationSummaryComponent);
811
- return FormValidationSummaryComponent;
812
- }(ValidationSummaryComponent));
813
+ /*
814
+ <file>
815
+ Authors:
816
+ Vadim Osovitny
817
+
818
+ Created:
819
+ 4 Mar 2020
820
+
821
+ Version:
822
+ 1.0
823
+
824
+ Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
825
+ </file>
826
+ */
827
+ var AnatolyDataModule = /** @class */ (function () {
828
+ function AnatolyDataModule() {
829
+ }
830
+ return AnatolyDataModule;
831
+ }());
832
+ AnatolyDataModule.decorators = [
833
+ { type: core.NgModule, args: [{
834
+ imports: [
835
+ common.CommonModule,
836
+ http.HttpClientModule,
837
+ http.HttpClientXsrfModule,
838
+ http.HttpClientJsonpModule
839
+ ],
840
+ exports: [
841
+ common.CommonModule,
842
+ http.HttpClientModule,
843
+ http.HttpClientXsrfModule,
844
+ http.HttpClientJsonpModule
845
+ ],
846
+ declarations: [],
847
+ providers: []
848
+ },] }
849
+ ];
813
850
 
814
- /*
815
- <file>
816
- Authors:
817
- Vadim Osovitny
818
-
819
- Created:
820
- 6 Dec 2017
821
-
822
- Version:
823
- 1.0
824
-
825
- Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
826
- </file>
827
- */
828
- var ItemValidationSummaryComponent = /** @class */ (function (_super) {
829
- __extends(ItemValidationSummaryComponent, _super);
830
- function ItemValidationSummaryComponent() {
831
- return _super.call(this) || this;
832
- }
833
- __decorate([
834
- core.Input()
835
- ], ItemValidationSummaryComponent.prototype, "controlName", void 0);
836
- __decorate([
837
- core.Input()
838
- ], ItemValidationSummaryComponent.prototype, "controlTitle", void 0);
839
- ItemValidationSummaryComponent = __decorate([
840
- core.Component({
841
- selector: 'anatoly-item-validation-summary',
842
- template: "<ul class=\"list-unstyled\" *ngIf=\"isItemInvalid(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"
843
- })
844
- ], ItemValidationSummaryComponent);
845
- return ItemValidationSummaryComponent;
846
- }(ValidationSummaryComponent));
851
+ // Services
847
852
 
848
- var DefaultEditorOptions = {
849
- placeholderText: 'Edit Your Content Here',
850
- charCounterCount: true,
851
- heightMin: 100,
852
- toolbarInline: false,
853
- toolbarButtons: {
854
- 'moreText': {
855
- 'buttons': ['bold', 'italic', 'underline', 'strikeThrough', 'subscript', 'superscript',
856
- 'fontFamily', 'fontSize', 'textColor', 'backgroundColor', 'inlineClass', 'inlineStyle']
857
- },
858
- 'moreParagraph': {
859
- 'buttons': ['alignLeft', 'alignCenter', 'formatOLSimple', 'alignRight', 'alignJustify',
860
- 'formatOL', 'formatUL', 'paragraphFormat', 'paragraphStyle', 'lineHeight', 'outdent', 'indent', 'quote']
861
- },
862
- 'moreRich': {
863
- 'buttons': ['insertLink', 'insertImage', 'insertTable', 'emoticons', 'fontAwesome',
864
- 'specialCharacters', 'embedly']
865
- },
866
- 'moreMisc': {
867
- 'buttons': ['selectAll', 'clearFormatting', 'html', 'undo', 'redo', 'fullscreen'],
868
- 'align': 'right',
869
- }
870
- },
871
- /*
872
- Upload:
873
- https://www.froala.com/wysiwyg-editor/docs/concepts/image/upload
874
- */
875
- imageUploadURL: '/api/HtmlEditor/UploadImage',
876
- imageAllowedTypes: ['jpeg', 'jpg', 'png'],
877
- imageUploadParams: { uploadType: '', uploadParentId: '' }
878
- };
853
+ /*
854
+ <file>
855
+ Authors:
856
+ Vadim Osovitny
857
+
858
+ Created:
859
+ 1 Jun 2018
860
+
861
+ Version:
862
+ 1.0
863
+
864
+ Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
865
+ </file>
866
+ */
867
+ var SubscribePlanButtonComponent = /** @class */ (function () {
868
+ function SubscribePlanButtonComponent(appcontext) {
869
+ this.appcontext = appcontext;
870
+ this.contextUpdated = false;
871
+ this.isUserSignedIn = false;
872
+ this.currentPlan = 0;
873
+ this.currentPlanTitle = '';
874
+ this.requestedPlan = 0;
875
+ this.requestedPlanTitle = '';
876
+ }
877
+ SubscribePlanButtonComponent.prototype.ngOnInit = function () {
878
+ var _this = this;
879
+ if (!this.appcontext.isUserSignedIn()) {
880
+ this.contextUpdated = true;
881
+ return;
882
+ }
883
+ this.appcontext.getCurrent(function (current) {
884
+ _this.isUserSignedIn = current.isUserSignedIn;
885
+ if (_this.isUserSignedIn) {
886
+ _this.currentPlan = current.account.billingPlan;
887
+ _this.currentPlanTitle = current.account.billingPlanAsString;
888
+ _this.requestedPlan = current.account.requestedBillingPlan;
889
+ _this.requestedPlanTitle = current.account.requestedBillingPlanAsString;
890
+ }
891
+ _this.contextUpdated = true;
892
+ });
893
+ };
894
+ return SubscribePlanButtonComponent;
895
+ }());
896
+ SubscribePlanButtonComponent.decorators = [
897
+ { type: core.Component, args: [{
898
+ selector: 'anatoly-subscribe-plan-button',
899
+ 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"
900
+ },] }
901
+ ];
902
+ SubscribePlanButtonComponent.ctorParameters = function () { return [
903
+ { type: AppContextService }
904
+ ]; };
905
+ SubscribePlanButtonComponent.propDecorators = {
906
+ plan: [{ type: core.Input }],
907
+ plantitle: [{ type: core.Input }]
908
+ };
879
909
 
880
- /*
881
- <file>
882
- Authors:
883
- Anatoly Osovitny
884
- Vadim Osovitny
885
-
886
- Created:
887
- 12 Dec 2017
888
-
889
- Version:
890
- 1.0
891
-
892
- Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
893
- </file>
894
- */
895
- var BaseHtmlEditorComponent = /** @class */ (function (_super) {
896
- __extends(BaseHtmlEditorComponent, _super);
897
- function BaseHtmlEditorComponent() {
898
- var _this = _super.call(this) || this;
899
- _this.froalaEditorInitialized = false;
900
- _this.afterInitializedActions = [];
901
- //Inputs
902
- _this.editorLabelText = 'Html';
903
- _this.editorOptions = {};
904
- return _this;
905
- }
906
- BaseHtmlEditorComponent.prototype.ngOnInit = function () {
907
- var opt = this.editorOptions;
908
- if (typeof this.editorOptions == "string") {
909
- opt = JSON.parse(this.editorOptions);
910
- }
911
- var newOptions = $.extend({}, DefaultEditorOptions, opt);
912
- var key = window.__froalaEditor_Key;
913
- if (key) {
914
- newOptions = $.extend({}, newOptions, JSON.parse('{ "key": "' + key + '" }'));
915
- }
916
- if (newOptions.events && newOptions.events.initialized) {
917
- newOptions.events.initialized.overridden = false;
918
- }
919
- this.options = newOptions;
920
- };
921
- BaseHtmlEditorComponent.prototype.ngAfterViewInit = function () {
922
- var that = this;
923
- setTimeout(function () {
924
- that.froalaEditorInitialized = true;
925
- that.onInitialized();
926
- }, 300);
927
- };
928
- BaseHtmlEditorComponent.prototype.onInitialized = function () {
929
- var actions = this.afterInitializedActions;
930
- //Clear actions
931
- this.afterInitializedActions = [];
932
- if (actions) {
933
- for (var i = 0; i < actions.length; i++) {
934
- actions[i]();
935
- }
936
- }
937
- };
938
- BaseHtmlEditorComponent.prototype.getEditor = function () {
939
- if (this.froalaEditor)
940
- return this.froalaEditor.getEditor();
941
- return null;
942
- };
943
- //Public Funcs
944
- BaseHtmlEditorComponent.prototype.doAfterInitialized = function (action) {
945
- var that = this;
946
- if (!this.froalaEditorInitialized) {
947
- this.afterInitializedActions.push(function () { action(that); });
948
- }
949
- else {
950
- action(that);
951
- }
952
- };
953
- BaseHtmlEditorComponent.prototype.initializeControl = function (control) {
954
- this.froalaEditor = control;
955
- this.froalaEditor.initialize();
956
- };
957
- BaseHtmlEditorComponent.prototype.setUploadParams = function (uploadType, uploadParentId) {
958
- this.doAfterInitialized(function (that) {
959
- var editor = that.getEditor();
960
- if (typeof (editor) == "undefined" || editor == null) {
961
- return;
962
- }
963
- editor.opts.imageUploadParams.uploadType = uploadType;
964
- editor.opts.imageUploadParams.uploadParentId = uploadParentId;
965
- });
966
- };
967
- __decorate([
968
- core.Input()
969
- ], BaseHtmlEditorComponent.prototype, "editorLabelText", void 0);
970
- __decorate([
971
- core.Input()
972
- ], BaseHtmlEditorComponent.prototype, "editorOptions", void 0);
973
- return BaseHtmlEditorComponent;
974
- }(BaseEditComponent));
910
+ /*
911
+ <file>
912
+ Authors:
913
+ Vadim Osovitny
914
+
915
+ Created:
916
+ 12 Nov 2017
917
+
918
+ Version:
919
+ 1.0
920
+
921
+ Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
922
+ </file>
923
+ */
924
+ // Services
925
+ var UpgradePlanButtonComponent = /** @class */ (function () {
926
+ function UpgradePlanButtonComponent(api) {
927
+ this.api = api;
928
+ }
929
+ UpgradePlanButtonComponent.prototype.onUpgradePlan = function () {
930
+ var text = "Current plan: " + this.currentplantitle + " New plan: " + this.requestedplantitle;
931
+ var that = this;
932
+ Alerts.AreYouSure(text, 'Change billing plan', 'Confirm change', 'Cancel', function () {
933
+ that.api.requestNewSubscription(that.requestedplan, function () {
934
+ Alerts.Success('Your request for changing plan has been sent.', null, function () {
935
+ window.location.reload();
936
+ });
937
+ });
938
+ });
939
+ };
940
+ return UpgradePlanButtonComponent;
941
+ }());
942
+ UpgradePlanButtonComponent.decorators = [
943
+ { type: core.Component, args: [{
944
+ selector: 'anatoly-upgrade-plan-button',
945
+ template: "<button class=\"btn btn-block btn-primary\" (click)=\"onUpgradePlan()\">\r\n Upgrade\r\n</button>\r\n"
946
+ },] }
947
+ ];
948
+ UpgradePlanButtonComponent.ctorParameters = function () { return [
949
+ { type: BillingApiService }
950
+ ]; };
951
+ UpgradePlanButtonComponent.propDecorators = {
952
+ currentplantitle: [{ type: core.Input }],
953
+ requestedplan: [{ type: core.Input }],
954
+ requestedplantitle: [{ type: core.Input }]
955
+ };
975
956
 
976
- /*
977
- <file>
978
- Authors:
979
- Anatoly Osovitny
980
- Vadim Osovitny
981
-
982
- Created:
983
- 12 Dec 2017
984
-
985
- Version:
986
- 1.0
987
-
988
- Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
989
- </file>
990
- */
991
- var HtmlEditorComponent = /** @class */ (function (_super) {
992
- __extends(HtmlEditorComponent, _super);
993
- function HtmlEditorComponent() {
994
- return _super.call(this) || this;
995
- }
996
- HtmlEditorComponent.prototype.setHtml = function (content) {
997
- this.doAfterInitialized(function (that) {
998
- var editor = that.getEditor();
999
- if (typeof (editor) == "undefined" || editor == null) {
1000
- return;
1001
- }
1002
- editor.html.set(content);
1003
- });
1004
- };
1005
- HtmlEditorComponent.prototype.getHtml = function () {
1006
- var editor = this.getEditor();
1007
- if (typeof (editor) == "undefined" || editor == null) {
1008
- return;
1009
- }
1010
- return editor.html.get(false);
1011
- };
1012
- HtmlEditorComponent = __decorate([
1013
- core.Component({
1014
- selector: 'anatoly-html-editor',
1015
- template: "<div>\r\n <label>{{ editorLabelText }}</label>\r\n <textarea [froalaEditor]=\"options\" (froalaInit)=\"initializeControl($event)\">\r\n </textarea>\r\n</div>"
1016
- })
1017
- ], HtmlEditorComponent);
1018
- return HtmlEditorComponent;
1019
- }(BaseHtmlEditorComponent));
957
+ /*
958
+ <file>
959
+ Authors:
960
+ Vadim Osovitny
961
+ Anatoly Osovitny
962
+
963
+ Created:
964
+ 14 Aug 2018
965
+
966
+ Version:
967
+ 1.0
968
+
969
+ Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
970
+ </file>
971
+ */
972
+ var BuyAccessButtonComponent = /** @class */ (function () {
973
+ function BuyAccessButtonComponent(appcontext, api) {
974
+ this.appcontext = appcontext;
975
+ this.api = api;
976
+ this.contextUpdated = false;
977
+ this.isUserSignedIn = false;
978
+ this.currentPlan = 0;
979
+ this.currentPlanTitle = '';
980
+ }
981
+ BuyAccessButtonComponent.prototype.ngOnInit = function () {
982
+ var _this = this;
983
+ if (!this.appcontext.isUserSignedIn()) {
984
+ this.contextUpdated = true;
985
+ return;
986
+ }
987
+ this.appcontext.getCurrent(function (current) {
988
+ _this.isUserSignedIn = current.isUserSignedIn;
989
+ if (_this.isUserSignedIn) {
990
+ _this.currentPlan = current.account.billingPlan;
991
+ _this.currentPlanTitle = current.account.billingPlanAsString;
992
+ }
993
+ _this.contextUpdated = true;
994
+ });
995
+ };
996
+ BuyAccessButtonComponent.prototype.onBuyPlan = function () {
997
+ var text = "Requested plan: " + this.plantitle + " ";
998
+ var that = this;
999
+ Alerts.AreYouSure(text, 'Buying access', 'Confirm change', 'Cancel', function () {
1000
+ that.api.buyAccess(that.plan, function () {
1001
+ Alerts.Success('Access Granted', null, function () {
1002
+ window.location.reload();
1003
+ });
1004
+ });
1005
+ });
1006
+ };
1007
+ return BuyAccessButtonComponent;
1008
+ }());
1009
+ BuyAccessButtonComponent.decorators = [
1010
+ { type: core.Component, args: [{
1011
+ selector: 'anatoly-buyaccess-button',
1012
+ 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"
1013
+ },] }
1014
+ ];
1015
+ BuyAccessButtonComponent.ctorParameters = function () { return [
1016
+ { type: AppContextService },
1017
+ { type: BillingApiService }
1018
+ ]; };
1019
+ BuyAccessButtonComponent.propDecorators = {
1020
+ plan: [{ type: core.Input }],
1021
+ plantitle: [{ type: core.Input }]
1022
+ };
1020
1023
 
1021
- /*
1022
- <file>
1023
- Authors:
1024
- Anatoly Osovitny
1025
- Vadim Osovitny
1026
-
1027
- Created:
1028
- 12 Dec 2017
1029
-
1030
- Version:
1031
- 1.0
1032
-
1033
- Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
1034
- </file>
1035
- */
1036
- var FormsHtmlEditorComponent = /** @class */ (function (_super) {
1037
- __extends(FormsHtmlEditorComponent, _super);
1038
- function FormsHtmlEditorComponent() {
1039
- var _this = _super.call(this) || this;
1040
- _this.editorFormKey = 'html';
1041
- return _this;
1042
- }
1043
- FormsHtmlEditorComponent.prototype.setFormValue = function (key, value) {
1044
- this.doAfterInitialized(function (that) {
1045
- that.setFormValue(key, value);
1046
- });
1047
- };
1048
- __decorate([
1049
- core.Input()
1050
- ], FormsHtmlEditorComponent.prototype, "editorFormKey", void 0);
1051
- FormsHtmlEditorComponent = __decorate([
1052
- core.Component({
1053
- selector: 'anatoly-forms-html-editor',
1054
- template: "<div [formGroup]=\"formGroup\">\r\n <div class=\"form-group\" [ngClass]=\"{'has-error': isItemInvalid(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"
1055
- })
1056
- ], FormsHtmlEditorComponent);
1057
- return FormsHtmlEditorComponent;
1058
- }(BaseHtmlEditorComponent));
1024
+ /*
1025
+ <file>
1026
+ Authors:
1027
+ Vadim Osovitny
1028
+
1029
+ Created:
1030
+ 4 Jul 2018
1031
+
1032
+ Version:
1033
+ 1.0
1034
+
1035
+ Copyright (c) 2018 Osovitny Inc. All rights reserved.
1036
+ </file>
1037
+ */
1038
+ var SignInButtonComponent = /** @class */ (function () {
1039
+ function SignInButtonComponent() {
1040
+ }
1041
+ return SignInButtonComponent;
1042
+ }());
1043
+ SignInButtonComponent.decorators = [
1044
+ { type: core.Component, args: [{
1045
+ selector: 'anatoly-signin-button',
1046
+ template: "<a href=\"identity/signIn\" class=\"{{classbtn}}\">Sign In</a>\r\n"
1047
+ },] }
1048
+ ];
1049
+ SignInButtonComponent.ctorParameters = function () { return []; };
1050
+ SignInButtonComponent.propDecorators = {
1051
+ classbtn: [{ type: core.Input }]
1052
+ };
1059
1053
 
1060
- /*
1061
- <file>
1062
- Authors:
1063
- Vadim Osovitny
1064
-
1065
- Created:
1066
- 10 Nov 2017
1067
-
1068
- Version:
1069
- 1.0
1070
-
1071
- Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
1072
- </file>
1073
- */
1074
- //Froala
1075
- var FroalaEditorModuleWithProviders = angularFroalaWysiwyg.FroalaEditorModule.forRoot();
1076
- var FroalaViewModuleWithProviders = angularFroalaWysiwyg.FroalaViewModule.forRoot();
1077
- var AnatolyCoreModule = /** @class */ (function () {
1078
- function AnatolyCoreModule() {
1079
- }
1080
- AnatolyCoreModule = __decorate([
1081
- core.NgModule({
1082
- imports: [
1083
- common.CommonModule,
1084
- forms.ReactiveFormsModule,
1085
- forms.FormsModule,
1086
- http.HttpClientModule,
1087
- http.HttpClientXsrfModule,
1088
- http.HttpClientJsonpModule,
1089
- //FroalaEditorModule.forRoot(),
1090
- //FroalaViewModule.forRoot(),
1091
- FroalaEditorModuleWithProviders,
1092
- FroalaViewModuleWithProviders,
1093
- kendoAngularGrid.GridModule,
1094
- kendoAngularPopup.PopupModule,
1095
- kendoAngularButtons.ButtonsModule,
1096
- kendoAngularDropdowns.DropDownsModule
1097
- ],
1098
- exports: [
1099
- ItemValidationSummaryComponent,
1100
- FormValidationSummaryComponent,
1101
- ContentHeaderComponent,
1102
- HtmlEditorComponent,
1103
- FormsHtmlEditorComponent
1104
- ],
1105
- declarations: [
1106
- ItemValidationSummaryComponent,
1107
- FormValidationSummaryComponent,
1108
- ContentHeaderComponent,
1109
- HtmlEditorComponent,
1110
- FormsHtmlEditorComponent
1111
- ],
1112
- providers: [
1113
- AppContextService
1114
- ],
1115
- schemas: []
1116
- })
1117
- ], AnatolyCoreModule);
1118
- return AnatolyCoreModule;
1119
- }());
1054
+ /*
1055
+ <file>
1056
+ Authors:
1057
+ Vadim Osovitny
1058
+
1059
+ Created:
1060
+ 4 Jul 2018
1061
+
1062
+ Version:
1063
+ 1.0
1064
+
1065
+ Copyright (c) 2018 Osovitny Inc. All rights reserved.
1066
+ </file>
1067
+ */
1068
+ var SignUpButtonComponent = /** @class */ (function () {
1069
+ function SignUpButtonComponent() {
1070
+ }
1071
+ return SignUpButtonComponent;
1072
+ }());
1073
+ SignUpButtonComponent.decorators = [
1074
+ { type: core.Component, args: [{
1075
+ selector: "anatoly-signup-button",
1076
+ template: "<a href=\"identity/signup\" class=\"{{classbtn}}\">Sign Up</a>\r\n"
1077
+ },] }
1078
+ ];
1079
+ SignUpButtonComponent.propDecorators = {
1080
+ classbtn: [{ type: core.Input }]
1081
+ };
1120
1082
 
1121
- /*
1122
- <file>
1123
- Authors:
1124
- Vadim Osovitny
1125
-
1126
- Created:
1127
- 12 Nov 2017
1128
-
1129
- Version:
1130
- 1.0
1131
-
1132
- Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
1133
- </file>
1134
- */
1135
- var BillingApiService = /** @class */ (function (_super) {
1136
- __extends(BillingApiService, _super);
1137
- function BillingApiService(http) {
1138
- var _this = _super.call(this, http) || this;
1139
- _this.http = http;
1140
- _this.baseUrl += 'billing/';
1141
- return _this;
1142
- }
1143
- BillingApiService.prototype.requestNewSubscription = function (requestedPlan, success, error) {
1144
- this.postQS('requestNewSubscription', { requestedPlan: requestedPlan })
1145
- .subscribe(function (data) { }, function (e) { if (error)
1146
- error(); }, function () { if (success)
1147
- success(); });
1148
- };
1149
- BillingApiService.prototype.cancelRequestedSubscription = function (success, error) {
1150
- this.postQS('cancelRequestedSubscription', null)
1151
- .subscribe(function (data) { }, function (e) { if (error)
1152
- error(); }, function () { if (success)
1153
- success(); });
1154
- };
1155
- BillingApiService.prototype.buyAccess = function (requestedPlan, success, error) {
1156
- this.postQS('buyAccess', { requestedPlan: requestedPlan })
1157
- .subscribe(function (data) { }, function (e) { if (error)
1158
- error(); }, function () { if (success)
1159
- success(); });
1160
- };
1161
- BillingApiService.ctorParameters = function () { return [
1162
- { type: http.HttpClient }
1163
- ]; };
1164
- BillingApiService = __decorate([
1165
- core.Injectable()
1166
- ], BillingApiService);
1167
- return BillingApiService;
1168
- }(BaseApiService));
1083
+ /*
1084
+ <file>
1085
+ Authors:
1086
+ Vadim Osovitny
1087
+
1088
+ Created:
1089
+ 4 Jul 2018
1090
+
1091
+ Version:
1092
+ 1.0
1093
+
1094
+ Copyright (c) 2018 Osovitny Inc. All rights reserved.
1095
+ </file>
1096
+ */
1097
+ var SignOutButtonComponent = /** @class */ (function () {
1098
+ function SignOutButtonComponent() {
1099
+ }
1100
+ return SignOutButtonComponent;
1101
+ }());
1102
+ SignOutButtonComponent.decorators = [
1103
+ { type: core.Component, args: [{
1104
+ selector: 'anatoly-signout-button',
1105
+ template: "<a href=\"identity/signOut\" class=\"{{classbtn}}\">Sign Out</a>\r\n"
1106
+ },] }
1107
+ ];
1108
+ SignOutButtonComponent.ctorParameters = function () { return []; };
1109
+ SignOutButtonComponent.propDecorators = {
1110
+ classbtn: [{ type: core.Input }]
1111
+ };
1169
1112
 
1170
- /*
1171
- <file>
1172
- Authors:
1173
- Vadim Osovitny
1174
- Anatoly Osovitny
1175
-
1176
- Created:
1177
- 14 Aug 2018
1178
-
1179
- Version:
1180
- 1.0
1181
-
1182
- Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
1183
- </file>
1184
- */
1185
- var BuyAccessButtonComponent = /** @class */ (function () {
1186
- function BuyAccessButtonComponent(appcontext, api) {
1187
- this.appcontext = appcontext;
1188
- this.api = api;
1189
- this.contextUpdated = false;
1190
- this.isUserSignedIn = false;
1191
- this.currentPlan = 0;
1192
- this.currentPlanTitle = "";
1193
- }
1194
- BuyAccessButtonComponent.prototype.ngOnInit = function () {
1195
- var _this = this;
1196
- if (!this.appcontext.isUserSignedIn()) {
1197
- this.contextUpdated = true;
1198
- return;
1199
- }
1200
- this.appcontext.getCurrent(function (current) {
1201
- _this.isUserSignedIn = current.isUserSignedIn;
1202
- if (_this.isUserSignedIn) {
1203
- _this.currentPlan = current.account.billingPlan;
1204
- _this.currentPlanTitle = current.account.billingPlanAsString;
1205
- }
1206
- _this.contextUpdated = true;
1207
- });
1208
- };
1209
- BuyAccessButtonComponent.prototype.onBuyPlan = function () {
1210
- var text = "Requested plan: " + this.plantitle + " ";
1211
- var that = this;
1212
- Alerts.AreYouSure(text, "Buying access", "Confirm change", "Cancel", function () {
1213
- that.api.buyAccess(that.plan, function () {
1214
- Alerts.Success("Access Granted", null, function () {
1215
- window.location.reload();
1216
- });
1217
- });
1218
- });
1219
- };
1220
- BuyAccessButtonComponent.ctorParameters = function () { return [
1221
- { type: AppContextService },
1222
- { type: BillingApiService }
1223
- ]; };
1224
- __decorate([
1225
- core.Input()
1226
- ], BuyAccessButtonComponent.prototype, "plan", void 0);
1227
- __decorate([
1228
- core.Input()
1229
- ], BuyAccessButtonComponent.prototype, "plantitle", void 0);
1230
- BuyAccessButtonComponent = __decorate([
1231
- core.Component({
1232
- selector: "anatoly-buyaccess-button",
1233
- 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"
1234
- })
1235
- ], BuyAccessButtonComponent);
1236
- return BuyAccessButtonComponent;
1237
- }());
1113
+ /*
1114
+ <file>
1115
+ Authors:
1116
+ Vadim Osovitny
1117
+
1118
+ Created:
1119
+ 28 Aug 2018
1120
+
1121
+ Version:
1122
+ 1.0
1123
+
1124
+ Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
1125
+ </file>
1126
+ */
1127
+ var BaseComponent = /** @class */ (function () {
1128
+ function BaseComponent() {
1129
+ }
1130
+ BaseComponent.prototype.getQSId = function () {
1131
+ var id = Utils.GetValueByNameInQS('id');
1132
+ if (typeof id === 'undefined' || id === '')
1133
+ return null;
1134
+ return id;
1135
+ };
1136
+ BaseComponent.prototype.showLoading = function () {
1137
+ var panelLoading = $('#pnlLoading');
1138
+ panelLoading.show();
1139
+ };
1140
+ BaseComponent.prototype.hideLoading = function () {
1141
+ var panelLoading = $('#pnlLoading');
1142
+ panelLoading.hide();
1143
+ };
1144
+ BaseComponent.prototype.handleError = function (e) {
1145
+ this.hideLoading();
1146
+ Alerts.ErrorOccurred();
1147
+ };
1148
+ return BaseComponent;
1149
+ }());
1238
1150
 
1239
- /*
1240
- <file>
1241
- Authors:
1242
- Vadim Osovitny
1243
-
1244
- Created:
1245
- 1 Jun 2018
1246
-
1247
- Version:
1248
- 1.0
1249
-
1250
- Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
1251
- </file>
1252
- */
1253
- var SubscribePlanButtonComponent = /** @class */ (function () {
1254
- function SubscribePlanButtonComponent(appcontext) {
1255
- this.appcontext = appcontext;
1256
- this.contextUpdated = false;
1257
- this.isUserSignedIn = false;
1258
- this.currentPlan = 0;
1259
- this.currentPlanTitle = "";
1260
- this.requestedPlan = 0;
1261
- this.requestedPlanTitle = "";
1262
- }
1263
- SubscribePlanButtonComponent.prototype.ngOnInit = function () {
1264
- var _this = this;
1265
- if (!this.appcontext.isUserSignedIn()) {
1266
- this.contextUpdated = true;
1267
- return;
1268
- }
1269
- this.appcontext.getCurrent(function (current) {
1270
- _this.isUserSignedIn = current.isUserSignedIn;
1271
- if (_this.isUserSignedIn) {
1272
- _this.currentPlan = current.account.billingPlan;
1273
- _this.currentPlanTitle = current.account.billingPlanAsString;
1274
- _this.requestedPlan = current.account.requestedBillingPlan;
1275
- _this.requestedPlanTitle = current.account.requestedBillingPlanAsString;
1276
- }
1277
- _this.contextUpdated = true;
1278
- });
1279
- };
1280
- SubscribePlanButtonComponent.ctorParameters = function () { return [
1281
- { type: AppContextService }
1282
- ]; };
1283
- __decorate([
1284
- core.Input()
1285
- ], SubscribePlanButtonComponent.prototype, "plan", void 0);
1286
- __decorate([
1287
- core.Input()
1288
- ], SubscribePlanButtonComponent.prototype, "plantitle", void 0);
1289
- SubscribePlanButtonComponent = __decorate([
1290
- core.Component({
1291
- selector: 'anatoly-subscribe-plan-button',
1292
- 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"
1293
- })
1294
- ], SubscribePlanButtonComponent);
1295
- return SubscribePlanButtonComponent;
1296
- }());
1151
+ var BaseEditComponent = /** @class */ (function (_super) {
1152
+ __extends(BaseEditComponent, _super);
1153
+ function BaseEditComponent() {
1154
+ var _this = _super.call(this) || this;
1155
+ _this.formSubmitted = false;
1156
+ return _this;
1157
+ }
1158
+ BaseEditComponent.prototype.isActionAdding = function () {
1159
+ var id = Utils.GetValueByNameInQS('id');
1160
+ if (typeof id === 'undefined' || id === '')
1161
+ return true;
1162
+ return false;
1163
+ };
1164
+ BaseEditComponent.prototype.getEntityId = function () {
1165
+ return this.getQSId();
1166
+ };
1167
+ BaseEditComponent.prototype.isItemInvalid = function (name) {
1168
+ if (typeof name === 'undefined' || name === '') {
1169
+ return false;
1170
+ }
1171
+ if (!this.formGroup) {
1172
+ return false;
1173
+ }
1174
+ if (this.formGroup.get(name)) {
1175
+ return ((this.formSubmitted && this.formGroup.get(name).invalid) ||
1176
+ (this.formGroup.get(name).touched && this.formGroup.get(name).invalid));
1177
+ }
1178
+ return false;
1179
+ };
1180
+ BaseEditComponent.prototype.getFormValue = function (name) {
1181
+ return this.formGroup.controls[name].value;
1182
+ };
1183
+ BaseEditComponent.prototype.setFormValue = function (name, value) {
1184
+ this.formGroup.controls[name].setValue(value);
1185
+ };
1186
+ BaseEditComponent.prototype.getFormGroupValue = function (groupName, name) {
1187
+ return this.formGroup.controls[groupName].get(name).value;
1188
+ };
1189
+ BaseEditComponent.prototype.setFormGroupValue = function (groupName, name, value) {
1190
+ this.formGroup.controls[groupName].get(name).setValue(value);
1191
+ };
1192
+ return BaseEditComponent;
1193
+ }(BaseComponent));
1194
+ BaseEditComponent.propDecorators = {
1195
+ formGroup: [{ type: core.Input }],
1196
+ formSubmitted: [{ type: core.Input }]
1197
+ };
1297
1198
 
1298
- /*
1299
- <file>
1300
- Authors:
1301
- Vadim Osovitny
1302
-
1303
- Created:
1304
- 12 Nov 2017
1305
-
1306
- Version:
1307
- 1.0
1308
-
1309
- Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
1310
- </file>
1311
- */
1312
- var UpgradePlanButtonComponent = /** @class */ (function () {
1313
- function UpgradePlanButtonComponent(api) {
1314
- this.api = api;
1315
- }
1316
- UpgradePlanButtonComponent.prototype.onUpgradePlan = function () {
1317
- var text = "Current plan: " + this.currentplantitle + " New plan: " + this.requestedplantitle;
1318
- var that = this;
1319
- Alerts.AreYouSure(text, 'Change billing plan', 'Confirm change', 'Cancel', function () {
1320
- that.api.requestNewSubscription(that.requestedplan, function () {
1321
- Alerts.Success('Your request for changing plan has been sent.', null, function () {
1322
- window.location.reload();
1323
- });
1324
- });
1325
- });
1326
- };
1327
- UpgradePlanButtonComponent.ctorParameters = function () { return [
1328
- { type: BillingApiService }
1329
- ]; };
1330
- __decorate([
1331
- core.Input()
1332
- ], UpgradePlanButtonComponent.prototype, "currentplantitle", void 0);
1333
- __decorate([
1334
- core.Input()
1335
- ], UpgradePlanButtonComponent.prototype, "requestedplan", void 0);
1336
- __decorate([
1337
- core.Input()
1338
- ], UpgradePlanButtonComponent.prototype, "requestedplantitle", void 0);
1339
- UpgradePlanButtonComponent = __decorate([
1340
- core.Component({
1341
- selector: 'anatoly-upgrade-plan-button',
1342
- template: "<button class=\"btn btn-block btn-primary\" (click)=\"onUpgradePlan()\">\r\n Upgrade\r\n</button>\r\n"
1343
- })
1344
- ], UpgradePlanButtonComponent);
1345
- return UpgradePlanButtonComponent;
1346
- }());
1199
+ var ValidationSummaryComponent = /** @class */ (function (_super) {
1200
+ __extends(ValidationSummaryComponent, _super);
1201
+ function ValidationSummaryComponent() {
1202
+ return _super.call(this) || this;
1203
+ }
1204
+ ValidationSummaryComponent.prototype.getFormValidationMessages = function () {
1205
+ var _this = this;
1206
+ var messages = [];
1207
+ Object.keys(this.formGroup.controls).forEach(function (k) {
1208
+ var control = _this.formGroup.controls[k];
1209
+ if (control.controls != null) {
1210
+ Object.keys(control.controls).forEach(function (k) {
1211
+ var child = control.controls[k];
1212
+ _this.getValidationMessages(child, k).forEach(function (m) { return messages.push(m); });
1213
+ });
1214
+ }
1215
+ else {
1216
+ _this.getValidationMessages(control, k).forEach(function (m) { return messages.push(m); });
1217
+ }
1218
+ });
1219
+ return messages;
1220
+ };
1221
+ ValidationSummaryComponent.prototype.getValidationMessages = function (state, thingName) {
1222
+ var thing = state.path || thingName;
1223
+ var messages = [];
1224
+ if (state.errors) {
1225
+ for (var errorName in state.errors) {
1226
+ if (state.errors.hasOwnProperty(errorName)) {
1227
+ switch (errorName) {
1228
+ case "required":
1229
+ messages.push(thing + " is required");
1230
+ break;
1231
+ case "minlength":
1232
+ messages.push(thing + " must be at least " + state.errors["minlength"].requiredLength + " characters");
1233
+ break;
1234
+ case "pattern":
1235
+ messages.push(thing + " contains illegal characters");
1236
+ break;
1237
+ }
1238
+ }
1239
+ }
1240
+ }
1241
+ return messages;
1242
+ };
1243
+ return ValidationSummaryComponent;
1244
+ }(BaseEditComponent));
1347
1245
 
1348
- /*
1349
- <file>
1350
- Authors:
1351
- Vadim Osovitny
1352
-
1353
- Created:
1354
- 4 Jul 2018
1355
-
1356
- Version:
1357
- 1.0
1358
-
1359
- Copyright (c) 2018 Osovitny Inc. All rights reserved.
1360
- </file>
1361
- */
1362
- var SignInButtonComponent = /** @class */ (function () {
1363
- function SignInButtonComponent() {
1364
- }
1365
- __decorate([
1366
- core.Input()
1367
- ], SignInButtonComponent.prototype, "classbtn", void 0);
1368
- SignInButtonComponent = __decorate([
1369
- core.Component({
1370
- selector: 'anatoly-signin-button',
1371
- template: "<a href=\"identity/signIn\" class=\"{{classbtn}}\">Sign In</a>\r\n"
1372
- })
1373
- ], SignInButtonComponent);
1374
- return SignInButtonComponent;
1375
- }());
1246
+ var FormValidationSummaryComponent = /** @class */ (function (_super) {
1247
+ __extends(FormValidationSummaryComponent, _super);
1248
+ function FormValidationSummaryComponent() {
1249
+ var _this = _super.call(this) || this;
1250
+ _this.isVisible = false;
1251
+ return _this;
1252
+ }
1253
+ FormValidationSummaryComponent.prototype.getErrors = function () {
1254
+ var messages = this.getFormValidationMessages();
1255
+ return messages;
1256
+ };
1257
+ return FormValidationSummaryComponent;
1258
+ }(ValidationSummaryComponent));
1259
+ FormValidationSummaryComponent.decorators = [
1260
+ { type: core.Component, args: [{
1261
+ selector: "anatoly-form-validation-summary",
1262
+ template: "<div class=\"callout callout-danger\" *ngIf=\"isVisible\">\r\n <h4 class=\"box-title\">There are problems with the form</h4>\r\n <p *ngFor=\"let error of getErrors()\">\r\n <span class=\"help-block\" style=\"color: white;\">{{ error }}</span>\r\n </p>\r\n</div>\r\n"
1263
+ },] }
1264
+ ];
1265
+ FormValidationSummaryComponent.ctorParameters = function () { return []; };
1266
+ FormValidationSummaryComponent.propDecorators = {
1267
+ isVisible: [{ type: core.Input }]
1268
+ };
1376
1269
 
1377
- /*
1378
- <file>
1379
- Authors:
1380
- Vadim Osovitny
1381
-
1382
- Created:
1383
- 4 Jul 2018
1384
-
1385
- Version:
1386
- 1.0
1387
-
1388
- Copyright (c) 2018 Osovitny Inc. All rights reserved.
1389
- </file>
1390
- */
1391
- var SignOutButtonComponent = /** @class */ (function () {
1392
- function SignOutButtonComponent() {
1393
- }
1394
- __decorate([
1395
- core.Input()
1396
- ], SignOutButtonComponent.prototype, "classbtn", void 0);
1397
- SignOutButtonComponent = __decorate([
1398
- core.Component({
1399
- selector: 'anatoly-signout-button',
1400
- template: "<a href=\"identity/signOut\" class=\"{{classbtn}}\">Sign Out</a>\r\n"
1401
- })
1402
- ], SignOutButtonComponent);
1403
- return SignOutButtonComponent;
1404
- }());
1270
+ var ItemValidationSummaryComponent = /** @class */ (function (_super) {
1271
+ __extends(ItemValidationSummaryComponent, _super);
1272
+ function ItemValidationSummaryComponent() {
1273
+ return _super.call(this) || this;
1274
+ }
1275
+ return ItemValidationSummaryComponent;
1276
+ }(ValidationSummaryComponent));
1277
+ ItemValidationSummaryComponent.decorators = [
1278
+ { type: core.Component, args: [{
1279
+ selector: "anatoly-item-validation-summary",
1280
+ template: "<ul class=\"list-unstyled\" *ngIf=\"isItemInvalid(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"
1281
+ },] }
1282
+ ];
1283
+ ItemValidationSummaryComponent.ctorParameters = function () { return []; };
1284
+ ItemValidationSummaryComponent.propDecorators = {
1285
+ controlName: [{ type: core.Input }],
1286
+ controlTitle: [{ type: core.Input }]
1287
+ };
1405
1288
 
1406
- /*
1407
- <file>
1408
- Authors:
1409
- Vadim Osovitny
1410
-
1411
- Created:
1412
- 4 Jul 2018
1413
-
1414
- Version:
1415
- 1.0
1416
-
1417
- Copyright (c) 2018 Osovitny Inc. All rights reserved.
1418
- </file>
1419
- */
1420
- var SignUpButtonComponent = /** @class */ (function () {
1421
- function SignUpButtonComponent() {
1422
- }
1423
- __decorate([
1424
- core.Input()
1425
- ], SignUpButtonComponent.prototype, "classbtn", void 0);
1426
- SignUpButtonComponent = __decorate([
1427
- core.Component({
1428
- selector: 'anatoly-signup-button',
1429
- template: "<a href=\"identity/signup\" class=\"{{classbtn}}\">Sign Up</a>\r\n"
1430
- })
1431
- ], SignUpButtonComponent);
1432
- return SignUpButtonComponent;
1433
- }());
1289
+ var DefaultEditorOptions = {
1290
+ placeholderText: 'Edit Your Content Here',
1291
+ charCounterCount: true,
1292
+ heightMin: 100,
1293
+ toolbarInline: false,
1294
+ toolbarButtons: {
1295
+ 'moreText': {
1296
+ 'buttons': ['bold', 'italic', 'underline', 'strikeThrough', 'subscript', 'superscript',
1297
+ 'fontFamily', 'fontSize', 'textColor', 'backgroundColor', 'inlineClass', 'inlineStyle']
1298
+ },
1299
+ 'moreParagraph': {
1300
+ 'buttons': ['alignLeft', 'alignCenter', 'formatOLSimple', 'alignRight', 'alignJustify',
1301
+ 'formatOL', 'formatUL', 'paragraphFormat', 'paragraphStyle', 'lineHeight', 'outdent', 'indent', 'quote']
1302
+ },
1303
+ 'moreRich': {
1304
+ 'buttons': ['insertLink', 'insertImage', 'insertTable', 'emoticons', 'fontAwesome',
1305
+ 'specialCharacters', 'embedly']
1306
+ },
1307
+ 'moreMisc': {
1308
+ 'buttons': ['selectAll', 'clearFormatting', 'html', 'undo', 'redo', 'fullscreen'],
1309
+ 'align': 'right',
1310
+ }
1311
+ },
1312
+ /*
1313
+ Upload:
1314
+ https://www.froala.com/wysiwyg-editor/docs/concepts/image/upload
1315
+ */
1316
+ imageUploadURL: '/api/HtmlEditor/UploadImage',
1317
+ imageAllowedTypes: ['jpeg', 'jpg', 'png'],
1318
+ imageUploadParams: { uploadType: '', uploadParentId: '' }
1319
+ };
1434
1320
 
1435
- /*
1436
- <file>
1437
- Authors:
1438
- Vadim Osovitny
1439
-
1440
- Created:
1441
- 4 Jul 2018
1442
-
1443
- Version:
1444
- 1.0
1445
-
1446
- Copyright (c) 2018 Osovitny Inc. All rights reserved.
1447
- </file>
1448
- */
1449
- var AnatolyIdentityModule = /** @class */ (function () {
1450
- function AnatolyIdentityModule() {
1451
- }
1452
- AnatolyIdentityModule = __decorate([
1453
- core.NgModule({
1454
- imports: [],
1455
- exports: [
1456
- SignInButtonComponent,
1457
- SignUpButtonComponent,
1458
- SignOutButtonComponent
1459
- ],
1460
- declarations: [
1461
- SignInButtonComponent,
1462
- SignUpButtonComponent,
1463
- SignOutButtonComponent
1464
- ],
1465
- providers: []
1466
- })
1467
- ], AnatolyIdentityModule);
1468
- return AnatolyIdentityModule;
1469
- }());
1321
+ var BaseHtmlEditorComponent = /** @class */ (function (_super) {
1322
+ __extends(BaseHtmlEditorComponent, _super);
1323
+ function BaseHtmlEditorComponent() {
1324
+ var _this = _super.call(this) || this;
1325
+ _this.froalaEditorInitialized = false;
1326
+ _this.afterInitializedActions = [];
1327
+ //Inputs
1328
+ _this.editorLabelText = 'Html';
1329
+ _this.editorOptions = {};
1330
+ return _this;
1331
+ }
1332
+ BaseHtmlEditorComponent.prototype.ngOnInit = function () {
1333
+ var opt = this.editorOptions;
1334
+ if (typeof this.editorOptions == "string") {
1335
+ opt = JSON.parse(this.editorOptions);
1336
+ }
1337
+ var newOptions = $.extend({}, DefaultEditorOptions, opt);
1338
+ var key = window.__froalaEditor_Key;
1339
+ if (key) {
1340
+ newOptions = $.extend({}, newOptions, JSON.parse('{ "key": "' + key + '" }'));
1341
+ }
1342
+ if (newOptions.events && newOptions.events.initialized) {
1343
+ newOptions.events.initialized.overridden = false;
1344
+ }
1345
+ this.options = newOptions;
1346
+ };
1347
+ BaseHtmlEditorComponent.prototype.ngAfterViewInit = function () {
1348
+ var that = this;
1349
+ setTimeout(function () {
1350
+ that.froalaEditorInitialized = true;
1351
+ that.onInitialized();
1352
+ }, 300);
1353
+ };
1354
+ BaseHtmlEditorComponent.prototype.onInitialized = function () {
1355
+ var actions = this.afterInitializedActions;
1356
+ //Clear actions
1357
+ this.afterInitializedActions = [];
1358
+ if (actions) {
1359
+ for (var i = 0; i < actions.length; i++) {
1360
+ actions[i]();
1361
+ }
1362
+ }
1363
+ };
1364
+ BaseHtmlEditorComponent.prototype.getEditor = function () {
1365
+ if (this.froalaEditor)
1366
+ return this.froalaEditor.getEditor();
1367
+ return null;
1368
+ };
1369
+ //Public Funcs
1370
+ BaseHtmlEditorComponent.prototype.doAfterInitialized = function (action) {
1371
+ var that = this;
1372
+ if (!this.froalaEditorInitialized) {
1373
+ this.afterInitializedActions.push(function () { action(that); });
1374
+ }
1375
+ else {
1376
+ action(that);
1377
+ }
1378
+ };
1379
+ BaseHtmlEditorComponent.prototype.initializeControl = function (control) {
1380
+ this.froalaEditor = control;
1381
+ this.froalaEditor.initialize();
1382
+ };
1383
+ BaseHtmlEditorComponent.prototype.setUploadParams = function (uploadType, uploadParentId) {
1384
+ this.doAfterInitialized(function (that) {
1385
+ var editor = that.getEditor();
1386
+ if (typeof (editor) == "undefined" || editor == null) {
1387
+ return;
1388
+ }
1389
+ editor.opts.imageUploadParams.uploadType = uploadType;
1390
+ editor.opts.imageUploadParams.uploadParentId = uploadParentId;
1391
+ });
1392
+ };
1393
+ return BaseHtmlEditorComponent;
1394
+ }(BaseEditComponent));
1395
+ BaseHtmlEditorComponent.propDecorators = {
1396
+ editorLabelText: [{ type: core.Input }],
1397
+ editorOptions: [{ type: core.Input }]
1398
+ };
1470
1399
 
1471
- // Components
1400
+ var HtmlEditorComponent = /** @class */ (function (_super) {
1401
+ __extends(HtmlEditorComponent, _super);
1402
+ function HtmlEditorComponent() {
1403
+ return _super.call(this) || this;
1404
+ }
1405
+ HtmlEditorComponent.prototype.setHtml = function (content) {
1406
+ this.doAfterInitialized(function (that) {
1407
+ var editor = that.getEditor();
1408
+ if (typeof (editor) == "undefined" || editor == null) {
1409
+ return;
1410
+ }
1411
+ editor.html.set(content);
1412
+ });
1413
+ };
1414
+ HtmlEditorComponent.prototype.getHtml = function () {
1415
+ var editor = this.getEditor();
1416
+ if (typeof (editor) == "undefined" || editor == null) {
1417
+ return;
1418
+ }
1419
+ return editor.html.get(false);
1420
+ };
1421
+ return HtmlEditorComponent;
1422
+ }(BaseHtmlEditorComponent));
1423
+ HtmlEditorComponent.decorators = [
1424
+ { type: core.Component, args: [{
1425
+ selector: 'anatoly-html-editor',
1426
+ template: "<div>\r\n <label>{{ editorLabelText }}</label>\r\n <textarea [froalaEditor]=\"options\" (froalaInit)=\"initializeControl($event)\">\r\n </textarea>\r\n</div>"
1427
+ },] }
1428
+ ];
1429
+ HtmlEditorComponent.ctorParameters = function () { return []; };
1472
1430
 
1473
- /*
1474
- <file>
1475
- Authors:
1476
- Vadim Osovitny
1477
-
1478
- Created:
1479
- 10 Nov 2017
1480
-
1481
- Version:
1482
- 1.0
1483
-
1484
- Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
1485
- </file>
1486
- */
1487
- var AnatolyBillingModule = /** @class */ (function () {
1488
- function AnatolyBillingModule() {
1489
- }
1490
- AnatolyBillingModule = __decorate([
1491
- core.NgModule({
1492
- imports: [
1493
- common.CommonModule,
1494
- http.HttpClientModule,
1495
- http.HttpClientXsrfModule,
1496
- http.HttpClientJsonpModule,
1497
- AnatolyIdentityModule
1498
- ],
1499
- exports: [
1500
- common.CommonModule,
1501
- http.HttpClientModule,
1502
- http.HttpClientXsrfModule,
1503
- http.HttpClientJsonpModule,
1504
- SubscribePlanButtonComponent,
1505
- UpgradePlanButtonComponent,
1506
- BuyAccessButtonComponent
1507
- ],
1508
- declarations: [
1509
- SubscribePlanButtonComponent,
1510
- UpgradePlanButtonComponent,
1511
- BuyAccessButtonComponent
1512
- ],
1513
- providers: [
1514
- BillingApiService
1515
- ]
1516
- })
1517
- ], AnatolyBillingModule);
1518
- return AnatolyBillingModule;
1519
- }());
1431
+ var FormsHtmlEditorComponent = /** @class */ (function (_super) {
1432
+ __extends(FormsHtmlEditorComponent, _super);
1433
+ function FormsHtmlEditorComponent() {
1434
+ var _this = _super.call(this) || this;
1435
+ _this.editorFormKey = 'html';
1436
+ return _this;
1437
+ }
1438
+ FormsHtmlEditorComponent.prototype.setFormValueAfterInitialized = function (name, value) {
1439
+ this.doAfterInitialized(function (that) {
1440
+ that.setFormValue(name, value);
1441
+ });
1442
+ };
1443
+ return FormsHtmlEditorComponent;
1444
+ }(BaseHtmlEditorComponent));
1445
+ FormsHtmlEditorComponent.decorators = [
1446
+ { type: core.Component, args: [{
1447
+ selector: 'anatoly-forms-html-editor',
1448
+ template: "<div [formGroup]=\"formGroup\">\r\n <div class=\"form-group\" [ngClass]=\"{'has-error': isItemInvalid(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"
1449
+ },] }
1450
+ ];
1451
+ FormsHtmlEditorComponent.ctorParameters = function () { return []; };
1452
+ FormsHtmlEditorComponent.propDecorators = {
1453
+ editorFormKey: [{ type: core.Input }]
1454
+ };
1520
1455
 
1521
- // Components
1456
+ /*
1457
+ <file>
1458
+ Authors:
1459
+ Anatoly Osovitny
1460
+
1461
+ Created:
1462
+ 23 Apr 2018
1463
+
1464
+ Version:
1465
+ 1.0
1466
+
1467
+ Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
1468
+ </file>
1469
+ */
1470
+ var ContentHeaderComponent = /** @class */ (function () {
1471
+ function ContentHeaderComponent() {
1472
+ }
1473
+ ContentHeaderComponent.prototype.ngOnInit = function () {
1474
+ if (this.title == null) {
1475
+ this.title = '';
1476
+ }
1477
+ };
1478
+ return ContentHeaderComponent;
1479
+ }());
1480
+ ContentHeaderComponent.decorators = [
1481
+ { type: core.Component, args: [{
1482
+ selector: 'anatoly-content-header',
1483
+ template: "<h2 class=\"page-header\">\r\n {{title}}\r\n <!--<small>Optional {{title}}</small>-->\r\n</h2>\r\n"
1484
+ },] }
1485
+ ];
1486
+ ContentHeaderComponent.propDecorators = {
1487
+ title: [{ type: core.Input }]
1488
+ };
1522
1489
 
1523
- /*
1524
- <file>
1525
- Authors:
1526
- Vadim Osovitny
1527
-
1528
- Created:
1529
- 29 Apr 2018
1530
-
1531
- Version:
1532
- 1.0
1533
-
1534
- Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
1535
- </file>
1536
- */
1537
- var BaseGridReadService = /** @class */ (function (_super) {
1538
- __extends(BaseGridReadService, _super);
1539
- function BaseGridReadService(http) {
1540
- var _this = _super.call(this, []) || this;
1541
- _this.http = http;
1542
- _this.baseReadUrl = "";
1543
- _this.data = [];
1544
- return _this;
1545
- }
1546
- BaseGridReadService.prototype.serializeParams = function (data) {
1547
- return data ? ('?' + $.param(data)) : '';
1548
- };
1549
- BaseGridReadService.prototype.read = function (params, success, error) {
1550
- var _this = this;
1551
- if (this.data.length) {
1552
- return _super.prototype.next.call(this, this.data);
1553
- }
1554
- var url = this.baseReadUrl;
1555
- if (typeof params === 'undefined') {
1556
- params = this.savedReadParams;
1557
- }
1558
- if (params) {
1559
- url = this.baseReadUrl + ("" + this.serializeParams(params));
1560
- this.savedReadParams = params;
1561
- }
1562
- this.http.get(url).pipe(operators.map(function (res) { return res; })).subscribe(function (data) {
1563
- _super.prototype.next.call(_this, data);
1564
- if (success)
1565
- success();
1566
- }, function (e) {
1567
- if (error)
1568
- error(e);
1569
- });
1570
- };
1571
- BaseGridReadService.ctorParameters = function () { return [
1572
- { type: http.HttpClient }
1573
- ]; };
1574
- BaseGridReadService = __decorate([
1575
- core.Injectable()
1576
- ], BaseGridReadService);
1577
- return BaseGridReadService;
1578
- }(rxjs.BehaviorSubject));
1490
+ var AnatolyUIModule = /** @class */ (function () {
1491
+ function AnatolyUIModule() {
1492
+ }
1493
+ return AnatolyUIModule;
1494
+ }());
1495
+ AnatolyUIModule.decorators = [
1496
+ { type: core.NgModule, args: [{
1497
+ declarations: [
1498
+ SubscribePlanButtonComponent,
1499
+ UpgradePlanButtonComponent,
1500
+ BuyAccessButtonComponent,
1501
+ SignInButtonComponent,
1502
+ SignUpButtonComponent,
1503
+ SignOutButtonComponent,
1504
+ FormValidationSummaryComponent,
1505
+ ItemValidationSummaryComponent,
1506
+ HtmlEditorComponent,
1507
+ FormsHtmlEditorComponent,
1508
+ ContentHeaderComponent,
1509
+ ],
1510
+ exports: [
1511
+ SubscribePlanButtonComponent,
1512
+ UpgradePlanButtonComponent,
1513
+ BuyAccessButtonComponent,
1514
+ SignInButtonComponent,
1515
+ SignUpButtonComponent,
1516
+ SignOutButtonComponent,
1517
+ FormValidationSummaryComponent,
1518
+ ItemValidationSummaryComponent,
1519
+ HtmlEditorComponent,
1520
+ FormsHtmlEditorComponent,
1521
+ ContentHeaderComponent,
1522
+ ],
1523
+ imports: [common.CommonModule, forms.ReactiveFormsModule, forms.FormsModule],
1524
+ },] }
1525
+ ];
1579
1526
 
1580
- /*
1581
- <file>
1582
- Authors:
1583
- Vadim Osovitny
1584
-
1585
- Created:
1586
- 29 Apr 2018
1587
-
1588
- Version:
1589
- 1.0
1590
-
1591
- Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
1592
- </file>
1593
- */
1594
- var BaseGridEditService = /** @class */ (function (_super) {
1595
- __extends(BaseGridEditService, _super);
1596
- function BaseGridEditService(http) {
1597
- var _this = _super.call(this, http) || this;
1598
- _this.http = http;
1599
- _this.baseUrl = "";
1600
- return _this;
1601
- }
1602
- BaseGridEditService.prototype.reset = function () {
1603
- this.data = [];
1604
- };
1605
- BaseGridEditService.prototype.resetItem = function (dataItem) {
1606
- if (!dataItem) {
1607
- return;
1608
- }
1609
- //find orignal data item
1610
- var originalDataItem = this.data.find(function (item) { return item.Id === dataItem.Id; });
1611
- //revert changes
1612
- Object.assign(originalDataItem, dataItem);
1613
- _super.prototype.next.call(this, this.data);
1614
- };
1615
- BaseGridEditService.prototype.save = function (data, isNew, sucess) {
1616
- var _this = this;
1617
- var action = isNew ? 'add' : 'update';
1618
- this.reset();
1619
- this.post(action, data).subscribe(function () {
1620
- }, function () {
1621
- _this.read();
1622
- }, function () {
1623
- _this.read();
1624
- if (sucess)
1625
- sucess();
1626
- });
1627
- };
1628
- BaseGridEditService.prototype.remove = function (data, sucess) {
1629
- var _this = this;
1630
- this.reset();
1631
- this.post('remove', data).subscribe(function () {
1632
- }, function () {
1633
- _this.read();
1634
- }, function () {
1635
- _this.read();
1636
- if (sucess)
1637
- sucess();
1638
- });
1639
- };
1640
- BaseGridEditService.prototype.post = function (action, data) {
1641
- var url = this.baseUrl + ("" + action + this.serializeParams(data));
1642
- return this.http.post(url, data).pipe(operators.map(function (res) { return res; }));
1643
- };
1644
- BaseGridEditService.ctorParameters = function () { return [
1645
- { type: http.HttpClient }
1646
- ]; };
1647
- BaseGridEditService = __decorate([
1648
- core.Injectable()
1649
- ], BaseGridEditService);
1650
- return BaseGridEditService;
1651
- }(BaseGridReadService));
1527
+ // Module
1652
1528
 
1653
- /*
1654
- <file>
1655
- Authors:
1656
- Vadim Osovitny
1657
-
1658
- Created:
1659
- 4 Mar 2020
1660
-
1661
- Version:
1662
- 1.0
1663
-
1664
- Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
1665
- </file>
1666
- */
1667
- var AnatolyDataModule = /** @class */ (function () {
1668
- function AnatolyDataModule() {
1669
- }
1670
- AnatolyDataModule = __decorate([
1671
- core.NgModule({
1672
- imports: [
1673
- common.CommonModule,
1674
- http.HttpClientModule,
1675
- http.HttpClientXsrfModule,
1676
- http.HttpClientJsonpModule
1677
- ],
1678
- exports: [
1679
- common.CommonModule,
1680
- http.HttpClientModule,
1681
- http.HttpClientXsrfModule,
1682
- http.HttpClientJsonpModule
1683
- ],
1684
- declarations: [],
1685
- providers: []
1686
- })
1687
- ], AnatolyDataModule);
1688
- return AnatolyDataModule;
1689
- }());
1529
+ /*
1530
+ * Public API Surface of anatoly
1531
+ */
1532
+
1533
+ /**
1534
+ * Generated bundle index. Do not edit.
1535
+ */
1690
1536
 
1691
- exports.Alerts = Alerts;
1692
- exports.AnatolyBillingModule = AnatolyBillingModule;
1693
- exports.AnatolyCoreModule = AnatolyCoreModule;
1694
- exports.AnatolyDataModule = AnatolyDataModule;
1695
- exports.AnatolyIdentityModule = AnatolyIdentityModule;
1696
- exports.AppContextService = AppContextService;
1697
- exports.BaseApiService = BaseApiService;
1698
- exports.BaseComponent = BaseComponent;
1699
- exports.BaseEditComponent = BaseEditComponent;
1700
- exports.BaseGoService = BaseGoService;
1701
- exports.BaseGridEditService = BaseGridEditService;
1702
- exports.BaseGridReadService = BaseGridReadService;
1703
- exports.BillingApiService = BillingApiService;
1704
- exports.BuyAccessButtonComponent = BuyAccessButtonComponent;
1705
- exports.ContentHeaderComponent = ContentHeaderComponent;
1706
- exports.FormValidationSummaryComponent = FormValidationSummaryComponent;
1707
- exports.FormsHtmlEditorComponent = FormsHtmlEditorComponent;
1708
- exports.HtmlEditorComponent = HtmlEditorComponent;
1709
- exports.ItemValidationSummaryComponent = ItemValidationSummaryComponent;
1710
- exports.SignInButtonComponent = SignInButtonComponent;
1711
- exports.SignOutButtonComponent = SignOutButtonComponent;
1712
- exports.SignUpButtonComponent = SignUpButtonComponent;
1713
- exports.SubscribePlanButtonComponent = SubscribePlanButtonComponent;
1714
- exports.UpgradePlanButtonComponent = UpgradePlanButtonComponent;
1715
- exports.Utils = Utils;
1716
- exports.ValidationSummaryComponent = ValidationSummaryComponent;
1537
+ exports.Alerts = Alerts;
1538
+ exports.AnatolyCoreModule = AnatolyCoreModule;
1539
+ exports.AnatolyDataModule = AnatolyDataModule;
1540
+ exports.AnatolyUIModule = AnatolyUIModule;
1541
+ exports.AppContextService = AppContextService;
1542
+ exports.BaseApiService = BaseApiService;
1543
+ exports.BaseComponent = BaseComponent;
1544
+ exports.BaseEditComponent = BaseEditComponent;
1545
+ exports.BaseGoService = BaseGoService;
1546
+ exports.BaseGridEditService = BaseGridEditService;
1547
+ exports.BaseGridReadService = BaseGridReadService;
1548
+ exports.BillingApiService = BillingApiService;
1549
+ exports.BuyAccessButtonComponent = BuyAccessButtonComponent;
1550
+ exports.ContentHeaderComponent = ContentHeaderComponent;
1551
+ exports.FormValidationSummaryComponent = FormValidationSummaryComponent;
1552
+ exports.FormsHtmlEditorComponent = FormsHtmlEditorComponent;
1553
+ exports.HtmlEditorComponent = HtmlEditorComponent;
1554
+ exports.ItemValidationSummaryComponent = ItemValidationSummaryComponent;
1555
+ exports.SignInButtonComponent = SignInButtonComponent;
1556
+ exports.SignOutButtonComponent = SignOutButtonComponent;
1557
+ exports.SignUpButtonComponent = SignUpButtonComponent;
1558
+ exports.SubscribePlanButtonComponent = SubscribePlanButtonComponent;
1559
+ exports.UpgradePlanButtonComponent = UpgradePlanButtonComponent;
1560
+ exports.Utils = Utils;
1561
+ exports.ValidationSummaryComponent = ValidationSummaryComponent;
1717
1562
 
1718
- Object.defineProperty(exports, '__esModule', { value: true });
1563
+ Object.defineProperty(exports, '__esModule', { value: true });
1719
1564
 
1720
1565
  })));
1721
1566
  //# sourceMappingURL=osovitny-anatoly.umd.js.map