@osovitny/anatoly 1.2.1 → 1.2.2

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 (150) hide show
  1. package/bundles/osovitny-anatoly.umd.js +1476 -0
  2. package/bundles/osovitny-anatoly.umd.js.map +1 -0
  3. package/bundles/osovitny-anatoly.umd.min.js +16 -0
  4. package/bundles/osovitny-anatoly.umd.min.js.map +1 -0
  5. package/esm2015/lib/billing/billing.module.js +60 -0
  6. package/esm2015/lib/billing/components/buyaccess/buyaccess-button.component.js +73 -0
  7. package/esm2015/lib/billing/components/subscriptions/subscribe-plan-button.component.js +63 -0
  8. package/esm2015/lib/billing/components/subscriptions/upgrade-plan-button.component.js +55 -0
  9. package/esm2015/lib/billing/index.js +9 -0
  10. package/esm2015/lib/billing/services/base-billing-api.service.js +53 -0
  11. package/esm2015/lib/core/consts.js +11 -0
  12. package/esm2015/lib/core/core.module.js +45 -0
  13. package/esm2015/lib/core/index.js +9 -0
  14. package/esm2015/lib/core/services/appcontext.service.js +72 -0
  15. package/esm2015/lib/core/services/base-api.service.js +71 -0
  16. package/esm2015/lib/core/services/base-go.service.js +36 -0
  17. package/esm2015/lib/core/services/base-gridedit.service.js +98 -0
  18. package/esm2015/lib/identity/components/signin-button.component.js +30 -0
  19. package/esm2015/lib/identity/components/signout-button.component.js +30 -0
  20. package/esm2015/lib/identity/components/signup-button.component.js +31 -0
  21. package/esm2015/lib/identity/identity.module.js +41 -0
  22. package/esm2015/lib/identity/index.js +7 -0
  23. package/esm2015/lib/ui/components/base-edit.component.js +66 -0
  24. package/esm2015/lib/ui/components/base.component.js +37 -0
  25. package/esm2015/lib/ui/components/content-header/content-header.component.js +35 -0
  26. package/esm2015/lib/ui/components/html-editor/base-html-editor.component.js +86 -0
  27. package/esm2015/lib/ui/components/html-editor/forms-html-editor.component.js +37 -0
  28. package/esm2015/lib/ui/components/html-editor/html-editor.component.js +49 -0
  29. package/esm2015/lib/ui/components/html-editor/html-editor.defaultoptions.js +38 -0
  30. package/esm2015/lib/ui/components/validation/form-validation-summary.component.js +39 -0
  31. package/esm2015/lib/ui/components/validation/item-validation-summary.component.js +37 -0
  32. package/esm2015/lib/ui/components/validation/validation-summary.component.js +60 -0
  33. package/esm2015/lib/ui/index.js +13 -0
  34. package/esm2015/lib/ui/ui.module.js +77 -0
  35. package/esm2015/osovitny-anatoly.js +5 -0
  36. package/esm2015/public-api.js +5 -0
  37. package/esm5/lib/billing/billing.module.js +63 -0
  38. package/esm5/lib/billing/components/buyaccess/buyaccess-button.component.js +75 -0
  39. package/esm5/lib/billing/components/subscriptions/subscribe-plan-button.component.js +65 -0
  40. package/esm5/lib/billing/components/subscriptions/upgrade-plan-button.component.js +56 -0
  41. package/esm5/lib/billing/index.js +9 -0
  42. package/esm5/lib/billing/services/base-billing-api.service.js +56 -0
  43. package/esm5/lib/core/consts.js +11 -0
  44. package/esm5/lib/core/core.module.js +48 -0
  45. package/esm5/lib/core/index.js +9 -0
  46. package/esm5/lib/core/services/appcontext.service.js +76 -0
  47. package/esm5/lib/core/services/base-api.service.js +72 -0
  48. package/esm5/lib/core/services/base-go.service.js +37 -0
  49. package/esm5/lib/core/services/base-gridedit.service.js +104 -0
  50. package/esm5/lib/identity/components/signin-button.component.js +32 -0
  51. package/esm5/lib/identity/components/signout-button.component.js +32 -0
  52. package/esm5/lib/identity/components/signup-button.component.js +32 -0
  53. package/esm5/lib/identity/identity.module.js +44 -0
  54. package/esm5/lib/identity/index.js +7 -0
  55. package/esm5/lib/ui/components/base-edit.component.js +70 -0
  56. package/esm5/lib/ui/components/base.component.js +39 -0
  57. package/esm5/lib/ui/components/content-header/content-header.component.js +38 -0
  58. package/esm5/lib/ui/components/html-editor/base-html-editor.component.js +90 -0
  59. package/esm5/lib/ui/components/html-editor/forms-html-editor.component.js +40 -0
  60. package/esm5/lib/ui/components/html-editor/html-editor.component.js +51 -0
  61. package/esm5/lib/ui/components/html-editor/html-editor.defaultoptions.js +38 -0
  62. package/esm5/lib/ui/components/validation/form-validation-summary.component.js +42 -0
  63. package/esm5/lib/ui/components/validation/item-validation-summary.component.js +39 -0
  64. package/esm5/lib/ui/components/validation/validation-summary.component.js +65 -0
  65. package/esm5/lib/ui/index.js +13 -0
  66. package/esm5/lib/ui/ui.module.js +80 -0
  67. package/esm5/osovitny-anatoly.js +5 -0
  68. package/esm5/public-api.js +5 -0
  69. package/fesm2015/osovitny-anatoly.js +1207 -0
  70. package/fesm2015/osovitny-anatoly.js.map +1 -0
  71. package/fesm5/osovitny-anatoly.js +1267 -0
  72. package/fesm5/osovitny-anatoly.js.map +1 -0
  73. package/lib/billing/billing.module.d.ts +2 -0
  74. package/lib/billing/components/buyaccess/buyaccess-button.component.d.ts +16 -0
  75. package/lib/billing/components/subscriptions/subscribe-plan-button.component.d.ts +15 -0
  76. package/lib/billing/components/subscriptions/upgrade-plan-button.component.d.ts +9 -0
  77. package/{src/lib/billing/index.ts → lib/billing/index.d.ts} +1 -6
  78. package/lib/billing/services/base-billing-api.service.d.ts +9 -0
  79. package/lib/core/consts.d.ts +5 -0
  80. package/lib/core/core.module.d.ts +2 -0
  81. package/{src/lib/core/index.ts → lib/core/index.d.ts} +1 -6
  82. package/lib/core/services/appcontext.service.d.ts +14 -0
  83. package/lib/core/services/base-api.service.d.ts +18 -0
  84. package/lib/core/services/base-go.service.d.ts +7 -0
  85. package/lib/core/services/base-gridedit.service.d.ts +19 -0
  86. package/lib/identity/components/signin-button.component.d.ts +4 -0
  87. package/lib/identity/components/signout-button.component.d.ts +4 -0
  88. package/lib/identity/components/signup-button.component.d.ts +4 -0
  89. package/lib/identity/identity.module.d.ts +2 -0
  90. package/{src/lib/identity/index.ts → lib/identity/index.d.ts} +1 -4
  91. package/lib/ui/components/base-edit.component.d.ts +14 -0
  92. package/lib/ui/components/base.component.d.ts +7 -0
  93. package/lib/ui/components/content-header/content-header.component.d.ts +5 -0
  94. package/lib/ui/components/html-editor/base-html-editor.component.d.ts +16 -0
  95. package/lib/ui/components/html-editor/forms-html-editor.component.d.ts +6 -0
  96. package/lib/ui/components/html-editor/html-editor.component.d.ts +6 -0
  97. package/lib/ui/components/html-editor/html-editor.defaultoptions.d.ts +1 -0
  98. package/lib/ui/components/validation/form-validation-summary.component.d.ts +6 -0
  99. package/lib/ui/components/validation/item-validation-summary.component.d.ts +6 -0
  100. package/lib/ui/components/validation/validation-summary.component.d.ts +6 -0
  101. package/{src/lib/ui/index.ts → lib/ui/index.d.ts} +1 -6
  102. package/lib/ui/ui.module.d.ts +2 -0
  103. package/osovitny-anatoly.d.ts +4 -0
  104. package/osovitny-anatoly.metadata.json +1 -0
  105. package/package.json +13 -2
  106. package/{src/public-api.ts → public-api.d.ts} +4 -4
  107. package/ng-package.json +0 -7
  108. package/src/lib/billing/billing.module.ts +0 -62
  109. package/src/lib/billing/components/buyaccess/buyaccess-button.component.html +0 -15
  110. package/src/lib/billing/components/buyaccess/buyaccess-button.component.ts +0 -70
  111. package/src/lib/billing/components/subscriptions/subscribe-plan-button.component.html +0 -21
  112. package/src/lib/billing/components/subscriptions/subscribe-plan-button.component.ts +0 -60
  113. package/src/lib/billing/components/subscriptions/upgrade-plan-button.component.html +0 -3
  114. package/src/lib/billing/components/subscriptions/upgrade-plan-button.component.ts +0 -47
  115. package/src/lib/billing/services/base-billing-api.service.ts +0 -56
  116. package/src/lib/core/consts.ts +0 -7
  117. package/src/lib/core/core.module.ts +0 -45
  118. package/src/lib/core/services/appcontext.service.ts +0 -81
  119. package/src/lib/core/services/base-api.service.ts +0 -87
  120. package/src/lib/core/services/base-go.service.ts +0 -33
  121. package/src/lib/core/services/base-gridedit.service.ts +0 -124
  122. package/src/lib/identity/components/signin-button.component.html +0 -1
  123. package/src/lib/identity/components/signin-button.component.ts +0 -27
  124. package/src/lib/identity/components/signout-button.component.html +0 -1
  125. package/src/lib/identity/components/signout-button.component.ts +0 -27
  126. package/src/lib/identity/components/signup-button.component.html +0 -1
  127. package/src/lib/identity/components/signup-button.component.ts +0 -28
  128. package/src/lib/identity/identity.module.ts +0 -41
  129. package/src/lib/ui/components/base-edit.component.ts +0 -77
  130. package/src/lib/ui/components/base.component.ts +0 -45
  131. package/src/lib/ui/components/content-header/content-header.component.html +0 -4
  132. package/src/lib/ui/components/content-header/content-header.component.ts +0 -32
  133. package/src/lib/ui/components/html-editor/base-html-editor.component.ts +0 -97
  134. package/src/lib/ui/components/html-editor/forms-html-editor.component.html +0 -14
  135. package/src/lib/ui/components/html-editor/forms-html-editor.component.ts +0 -35
  136. package/src/lib/ui/components/html-editor/html-editor.component.html +0 -6
  137. package/src/lib/ui/components/html-editor/html-editor.component.ts +0 -51
  138. package/src/lib/ui/components/html-editor/html-editor.defaultoptions.ts +0 -38
  139. package/src/lib/ui/components/validation/form-validation-summary.component.html +0 -4
  140. package/src/lib/ui/components/validation/form-validation-summary.component.ts +0 -36
  141. package/src/lib/ui/components/validation/item-validation-summary.component.html +0 -5
  142. package/src/lib/ui/components/validation/item-validation-summary.component.ts +0 -32
  143. package/src/lib/ui/components/validation/validation-summary.component.ts +0 -74
  144. package/src/lib/ui/index.js +0 -13
  145. package/src/lib/ui/index.js.map +0 -1
  146. package/src/lib/ui/ui.module.ts +0 -83
  147. package/tsconfig.lib.json +0 -32
  148. package/tsconfig.lib.prod.json +0 -6
  149. package/tslint.json +0 -17
  150. package/typings/osovitny-ui/index.d.ts +0 -24
@@ -0,0 +1,1267 @@
1
+ import { __decorate, __extends } from 'tslib';
2
+ import { Injectable, NgModule, Input, Component, CUSTOM_ELEMENTS_SCHEMA, NO_ERRORS_SCHEMA } from '@angular/core';
3
+ import { HttpClient, HttpClientModule, HttpClientXsrfModule, HttpClientJsonpModule } from '@angular/common/http';
4
+ import { map } from 'rxjs/operators';
5
+ import { BehaviorSubject } from 'rxjs';
6
+ import { ActivatedRoute, Router } from '@angular/router';
7
+ import { CommonModule } from '@angular/common';
8
+ import { ReactiveFormsModule, FormsModule } from '@angular/forms';
9
+ import { FroalaEditorModule, FroalaViewModule } from 'angular-froala-wysiwyg';
10
+ import { GridModule } from '@progress/kendo-angular-grid';
11
+ import { PopupModule } from '@progress/kendo-angular-popup';
12
+ import { ButtonsModule } from '@progress/kendo-angular-buttons';
13
+ import { DropDownsModule } from '@progress/kendo-angular-dropdowns';
14
+
15
+ var anatoly$1;
16
+ (function (anatoly) {
17
+ var consts;
18
+ (function (consts) {
19
+ consts.jsonUrl = "/dist/json/";
20
+ consts.appUrl = "/";
21
+ consts.apiUrl = "/api/";
22
+ })(consts = anatoly.consts || (anatoly.consts = {}));
23
+ })(anatoly$1 || (anatoly$1 = {}));
24
+ window.anatoly = anatoly$1;
25
+
26
+ /*
27
+ <file>
28
+ Authors:
29
+ Vadim Osovitny
30
+
31
+ Created:
32
+ 13 Nov 2017
33
+
34
+ Version:
35
+ 1.0
36
+
37
+ Copyright (c) 2016-2019 Osovitny Inc. All rights reserved.
38
+ </file>
39
+ */
40
+ var BaseApiService = /** @class */ (function () {
41
+ function BaseApiService(http) {
42
+ this.http = http;
43
+ this.baseUrl = anatoly.consts.apiUrl;
44
+ }
45
+ BaseApiService.prototype.serializeParams = function (data) {
46
+ return data ? ('?' + $.param(data)) : '';
47
+ };
48
+ //webApi
49
+ BaseApiService.prototype.get = function (action, data) {
50
+ var url = this.baseUrl + ("" + action + this.serializeParams(data));
51
+ return this.http.get(url).pipe(map(function (res) { return res; }));
52
+ };
53
+ BaseApiService.prototype.post = function (action, data) {
54
+ var url = this.baseUrl + ("" + action);
55
+ return this.http.post(url, data, { responseType: 'text' });
56
+ };
57
+ BaseApiService.prototype.postQS = function (action, data) {
58
+ var url = this.baseUrl + ("" + action + this.serializeParams(data));
59
+ return this.http.post(url, null, { responseType: 'text' });
60
+ };
61
+ //gets
62
+ BaseApiService.prototype.getAll = function (data) {
63
+ return this.get('getall', data).pipe(map(function (res) { return res; }));
64
+ };
65
+ BaseApiService.prototype.getJsonFile = function (fileName, jsonVersion) {
66
+ if (!jsonVersion) {
67
+ jsonVersion = "1.0";
68
+ }
69
+ var url = anatoly.consts.jsonUrl + fileName + '?' + jsonVersion;
70
+ return this.http.get(url).pipe(map(function (res) { return res; }));
71
+ };
72
+ BaseApiService.prototype.getNewGuid = function () {
73
+ var url = this.baseUrl + 'getNewGuid';
74
+ return this.http.get(url, { responseType: 'text' });
75
+ };
76
+ //CRUD function
77
+ BaseApiService.prototype.getById = function (id) {
78
+ return this.get('getById', { id: id });
79
+ };
80
+ BaseApiService.prototype.remove = function (id) {
81
+ return this.postQS('remove', { id: id });
82
+ };
83
+ BaseApiService.ctorParameters = function () { return [
84
+ { type: HttpClient }
85
+ ]; };
86
+ BaseApiService = __decorate([
87
+ Injectable()
88
+ ], BaseApiService);
89
+ return BaseApiService;
90
+ }());
91
+
92
+ /*
93
+ <file>
94
+ Authors:
95
+ Vadim Osovitny
96
+
97
+ Created:
98
+ 29 Apr 2018
99
+
100
+ Version:
101
+ 1.0
102
+
103
+ Copyright (c) 2016-2019 Osovitny Inc. All rights reserved.
104
+ </file>
105
+ */
106
+ var BaseGridEditService = /** @class */ (function (_super) {
107
+ __extends(BaseGridEditService, _super);
108
+ function BaseGridEditService(http) {
109
+ var _this = _super.call(this, []) || this;
110
+ _this.http = http;
111
+ _this.data = [];
112
+ _this.baseUrl = anatoly.consts.apiUrl;
113
+ _this.baseReadUrl = _this.baseUrl + "getAll";
114
+ return _this;
115
+ }
116
+ BaseGridEditService.prototype.serializeParams = function (data) {
117
+ return data ? ('?' + $.param(data)) : '';
118
+ };
119
+ BaseGridEditService.prototype.reset = function () {
120
+ this.data = [];
121
+ };
122
+ BaseGridEditService.prototype.resetItem = function (dataItem) {
123
+ if (!dataItem) {
124
+ return;
125
+ }
126
+ //find orignal data item
127
+ var originalDataItem = this.data.find(function (item) { return item.Id === dataItem.Id; });
128
+ //revert changes
129
+ Object.assign(originalDataItem, dataItem);
130
+ _super.prototype.next.call(this, this.data);
131
+ };
132
+ BaseGridEditService.prototype.read = function (params) {
133
+ var _this = this;
134
+ if (this.data.length) {
135
+ return _super.prototype.next.call(this, this.data);
136
+ }
137
+ var url = this.baseReadUrl;
138
+ if (typeof params === 'undefined') {
139
+ params = this.savedReadParams;
140
+ }
141
+ if (typeof params !== 'undefined') {
142
+ url = this.baseReadUrl + ("" + this.serializeParams(params));
143
+ this.savedReadParams = params;
144
+ }
145
+ // this.http.get(url)
146
+ // .map(res => <any[]>res)
147
+ // .do(data => { this.data = data; }).subscribe(data => { super.next(data); });
148
+ //}
149
+ this.http.get(url).pipe(map(function (res) { return res; })).subscribe(function (data) { _super.prototype.next.call(_this, data); });
150
+ };
151
+ BaseGridEditService.prototype.save = function (data, isNew, sucess) {
152
+ var _this = this;
153
+ var action = isNew ? 'add' : 'update';
154
+ this.reset();
155
+ this.post(action, data).subscribe(function () {
156
+ }, function () {
157
+ _this.read();
158
+ }, function () {
159
+ _this.read();
160
+ if (sucess)
161
+ sucess();
162
+ });
163
+ };
164
+ BaseGridEditService.prototype.remove = function (data, sucess) {
165
+ var _this = this;
166
+ this.reset();
167
+ this.post('remove', data).subscribe(function () {
168
+ }, function () {
169
+ _this.read();
170
+ }, function () {
171
+ _this.read();
172
+ if (sucess)
173
+ sucess();
174
+ });
175
+ };
176
+ BaseGridEditService.prototype.post = function (action, data) {
177
+ var url = this.baseUrl + ("" + action + this.serializeParams(data));
178
+ return this.http.post(url, data).pipe(map(function (res) { return res; }));
179
+ };
180
+ BaseGridEditService.ctorParameters = function () { return [
181
+ { type: HttpClient }
182
+ ]; };
183
+ BaseGridEditService = __decorate([
184
+ Injectable()
185
+ ], BaseGridEditService);
186
+ return BaseGridEditService;
187
+ }(BehaviorSubject));
188
+
189
+ /*
190
+ <file>
191
+ Authors:
192
+ Vadim Osovitny
193
+
194
+ Created:
195
+ 17 Jun 2018
196
+
197
+ Version:
198
+ 1.0
199
+
200
+ Copyright (c) 2016-2019 Osovitny Inc. All rights reserved.
201
+ </file>
202
+ */
203
+ var BaseGoService = /** @class */ (function () {
204
+ function BaseGoService(route, router) {
205
+ this.route = route;
206
+ this.router = router;
207
+ }
208
+ BaseGoService.prototype.locationReload = function () {
209
+ //this.router.navigate([this.route.url]);
210
+ window.location.reload();
211
+ };
212
+ BaseGoService.ctorParameters = function () { return [
213
+ { type: ActivatedRoute },
214
+ { type: Router }
215
+ ]; };
216
+ BaseGoService = __decorate([
217
+ Injectable()
218
+ ], BaseGoService);
219
+ return BaseGoService;
220
+ }());
221
+
222
+ /*
223
+ <file>
224
+ Authors:
225
+ Vadim Osovitny
226
+
227
+ Created:
228
+ 13 Nov 2017
229
+
230
+ Version:
231
+ 1.0
232
+
233
+ Copyright (c) 2016-2019 Osovitny Inc. All rights reserved.
234
+ </file>
235
+ */
236
+ var AppContextService = /** @class */ (function (_super) {
237
+ __extends(AppContextService, _super);
238
+ function AppContextService(http) {
239
+ var _this = _super.call(this, http) || this;
240
+ _this.http = http;
241
+ _this.current = null;
242
+ _this.successes = [];
243
+ _this.subscription = null;
244
+ _this.baseUrl = anatoly.consts.apiUrl + 'appcontext/';
245
+ return _this;
246
+ }
247
+ AppContextService.prototype.getCurrent = function (success) {
248
+ var _this = this;
249
+ if (typeof success == "undefined") {
250
+ return;
251
+ }
252
+ if (this.current != null) {
253
+ success(this.current);
254
+ return;
255
+ }
256
+ this.successes.push(success);
257
+ if (this.subscription != null) {
258
+ return;
259
+ }
260
+ this.subscription = this.get('GetCurrentContext', null).subscribe(function (data) {
261
+ _this.dataReceived(data);
262
+ }, function (e) { });
263
+ };
264
+ AppContextService.prototype.dataReceived = function (data) {
265
+ this.current = data;
266
+ for (var i = 0; i < this.successes.length; i++) {
267
+ var success = this.successes[i];
268
+ success(data);
269
+ }
270
+ this.successes = [];
271
+ this.subscription.unsubscribe();
272
+ this.subscription = null;
273
+ this.current = null;
274
+ };
275
+ AppContextService.prototype.isUserSignedIn = function () {
276
+ return window.__context_isUserSignedIn;
277
+ };
278
+ AppContextService.prototype.isUserAdmin = function () {
279
+ return window.__context_isUserAdmin;
280
+ };
281
+ AppContextService.ctorParameters = function () { return [
282
+ { type: HttpClient }
283
+ ]; };
284
+ AppContextService = __decorate([
285
+ Injectable()
286
+ ], AppContextService);
287
+ return AppContextService;
288
+ }(BaseApiService));
289
+
290
+ /*
291
+ <file>
292
+ Authors:
293
+ Vadim Osovitny
294
+
295
+ Created:
296
+ 10 Nov 2017
297
+
298
+ Version:
299
+ 1.0
300
+
301
+ Copyright (c) 2016-2019 Osovitny Inc. All rights reserved.
302
+ </file>
303
+ */
304
+ var AnatolyCoreModule = /** @class */ (function () {
305
+ function AnatolyCoreModule() {
306
+ }
307
+ AnatolyCoreModule = __decorate([
308
+ NgModule({
309
+ imports: [
310
+ CommonModule,
311
+ HttpClientModule,
312
+ HttpClientXsrfModule,
313
+ HttpClientJsonpModule
314
+ ],
315
+ exports: [
316
+ CommonModule,
317
+ HttpClientModule,
318
+ HttpClientXsrfModule,
319
+ HttpClientJsonpModule
320
+ ],
321
+ declarations: [],
322
+ providers: [
323
+ AppContextService
324
+ ]
325
+ })
326
+ ], AnatolyCoreModule);
327
+ return AnatolyCoreModule;
328
+ }());
329
+
330
+ // Base
331
+
332
+ /*
333
+ <file>
334
+ Authors:
335
+ Vadim Osovitny
336
+
337
+ Created:
338
+ 12 Nov 2017
339
+
340
+ Version:
341
+ 1.0
342
+
343
+ Copyright (c) 2016-2019 Osovitny Inc. All rights reserved.
344
+ </file>
345
+ */
346
+ var BaseBillingApiService = /** @class */ (function (_super) {
347
+ __extends(BaseBillingApiService, _super);
348
+ function BaseBillingApiService(http) {
349
+ var _this = _super.call(this, http) || this;
350
+ _this.http = http;
351
+ _this.baseUrl += 'billing/';
352
+ return _this;
353
+ }
354
+ BaseBillingApiService.prototype.requestNewSubscription = function (requestedPlan, success, error) {
355
+ this.postQS('requestNewSubscription', { requestedPlan: requestedPlan })
356
+ .subscribe(function (data) { }, function (e) { if (error)
357
+ error(); }, function () { if (success)
358
+ success(); });
359
+ };
360
+ BaseBillingApiService.prototype.cancelRequestedSubscription = function (success, error) {
361
+ this.postQS('cancelRequestedSubscription', null)
362
+ .subscribe(function (data) { }, function (e) { if (error)
363
+ error(); }, function () { if (success)
364
+ success(); });
365
+ };
366
+ BaseBillingApiService.prototype.buyAccess = function (requestedPlan, success, error) {
367
+ this.postQS('buyAccess', { requestedPlan: requestedPlan })
368
+ .subscribe(function (data) { }, function (e) { if (error)
369
+ error(); }, function () { if (success)
370
+ success(); });
371
+ };
372
+ BaseBillingApiService.ctorParameters = function () { return [
373
+ { type: HttpClient }
374
+ ]; };
375
+ BaseBillingApiService = __decorate([
376
+ Injectable()
377
+ ], BaseBillingApiService);
378
+ return BaseBillingApiService;
379
+ }(BaseApiService));
380
+
381
+ /*
382
+ <file>
383
+ Authors:
384
+ Vadim Osovitny
385
+
386
+ Created:
387
+ 14 Aug 2018
388
+
389
+ Version:
390
+ 1.0
391
+
392
+ Copyright (c) 2016-2019 Osovitny Inc. All rights reserved.
393
+ </file>
394
+ */
395
+ var BuyAccessButtonComponent = /** @class */ (function () {
396
+ function BuyAccessButtonComponent(appcontext, api) {
397
+ this.appcontext = appcontext;
398
+ this.api = api;
399
+ this.contextUpdated = false;
400
+ this.isUserSignedIn = false;
401
+ this.currentPlan = 0;
402
+ this.currentPlanTitle = "";
403
+ }
404
+ BuyAccessButtonComponent.prototype.ngOnInit = function () {
405
+ var _this = this;
406
+ if (!this.appcontext.isUserSignedIn()) {
407
+ this.contextUpdated = true;
408
+ return;
409
+ }
410
+ this.appcontext.getCurrent(function (current) {
411
+ _this.isUserSignedIn = current.isUserSignedIn;
412
+ if (_this.isUserSignedIn) {
413
+ _this.currentPlan = current.account.billingPlan;
414
+ _this.currentPlanTitle = current.account.billingPlanAsString;
415
+ }
416
+ _this.contextUpdated = true;
417
+ });
418
+ };
419
+ BuyAccessButtonComponent.prototype.onBuyPlan = function () {
420
+ var text = "Requested plan: " + this.plantitle + " ";
421
+ var that = this;
422
+ osovitny.ui.areYouSure(text, 'Buying access', 'Confirm change', 'Cancel', function () {
423
+ that.api.buyAccess(that.plan, function () {
424
+ osovitny.ui.alertSuccess('Access Granted', null, function () {
425
+ window.location.reload();
426
+ });
427
+ });
428
+ });
429
+ };
430
+ BuyAccessButtonComponent.ctorParameters = function () { return [
431
+ { type: AppContextService },
432
+ { type: BaseBillingApiService }
433
+ ]; };
434
+ __decorate([
435
+ Input()
436
+ ], BuyAccessButtonComponent.prototype, "plan", void 0);
437
+ __decorate([
438
+ Input()
439
+ ], BuyAccessButtonComponent.prototype, "plantitle", void 0);
440
+ BuyAccessButtonComponent = __decorate([
441
+ Component({
442
+ selector: 'anatoly-buyaccess-button',
443
+ 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"
444
+ })
445
+ ], BuyAccessButtonComponent);
446
+ return BuyAccessButtonComponent;
447
+ }());
448
+
449
+ /*
450
+ <file>
451
+ Authors:
452
+ Vadim Osovitny
453
+
454
+ Created:
455
+ 1 Jun 2018
456
+
457
+ Version:
458
+ 1.0
459
+
460
+ Copyright (c) 2016-2019 Osovitny Inc. All rights reserved.
461
+ </file>
462
+ */
463
+ var SubscribePlanButtonComponent = /** @class */ (function () {
464
+ function SubscribePlanButtonComponent(appcontext) {
465
+ this.appcontext = appcontext;
466
+ this.contextUpdated = false;
467
+ this.isUserSignedIn = false;
468
+ this.currentPlan = 0;
469
+ this.currentPlanTitle = "";
470
+ this.requestedPlan = 0;
471
+ this.requestedPlanTitle = "";
472
+ }
473
+ SubscribePlanButtonComponent.prototype.ngOnInit = function () {
474
+ var _this = this;
475
+ if (!this.appcontext.isUserSignedIn()) {
476
+ this.contextUpdated = true;
477
+ return;
478
+ }
479
+ this.appcontext.getCurrent(function (current) {
480
+ _this.isUserSignedIn = current.isUserSignedIn;
481
+ if (_this.isUserSignedIn) {
482
+ _this.currentPlan = current.account.billingPlan;
483
+ _this.currentPlanTitle = current.account.billingPlanAsString;
484
+ _this.requestedPlan = current.account.requestedBillingPlan;
485
+ _this.requestedPlanTitle = current.account.requestedBillingPlanAsString;
486
+ }
487
+ _this.contextUpdated = true;
488
+ });
489
+ };
490
+ SubscribePlanButtonComponent.ctorParameters = function () { return [
491
+ { type: AppContextService }
492
+ ]; };
493
+ __decorate([
494
+ Input()
495
+ ], SubscribePlanButtonComponent.prototype, "plan", void 0);
496
+ __decorate([
497
+ Input()
498
+ ], SubscribePlanButtonComponent.prototype, "plantitle", void 0);
499
+ SubscribePlanButtonComponent = __decorate([
500
+ Component({
501
+ selector: 'anatoly-subscribe-plan-button',
502
+ 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"
503
+ })
504
+ ], SubscribePlanButtonComponent);
505
+ return SubscribePlanButtonComponent;
506
+ }());
507
+
508
+ /*
509
+ <file>
510
+ Authors:
511
+ Vadim Osovitny
512
+
513
+ Created:
514
+ 12 Nov 2017
515
+
516
+ Version:
517
+ 1.0
518
+
519
+ Copyright (c) 2016-2019 Osovitny Inc. All rights reserved.
520
+ </file>
521
+ */
522
+ var UpgradePlanButtonComponent = /** @class */ (function () {
523
+ function UpgradePlanButtonComponent(api) {
524
+ this.api = api;
525
+ }
526
+ UpgradePlanButtonComponent.prototype.onUpgradePlan = function () {
527
+ var text = "Current plan: " + this.currentplantitle + " New plan: " + this.requestedplantitle;
528
+ var that = this;
529
+ osovitny.ui.areYouSure(text, 'Change billing plan', 'Confirm change', 'Cancel', function () {
530
+ that.api.requestNewSubscription(that.requestedplan, function () {
531
+ osovitny.ui.alertSuccess('Your request for changing plan has been sent.', null, function () {
532
+ window.location.reload();
533
+ });
534
+ });
535
+ });
536
+ };
537
+ UpgradePlanButtonComponent.ctorParameters = function () { return [
538
+ { type: BaseBillingApiService }
539
+ ]; };
540
+ __decorate([
541
+ Input()
542
+ ], UpgradePlanButtonComponent.prototype, "currentplantitle", void 0);
543
+ __decorate([
544
+ Input()
545
+ ], UpgradePlanButtonComponent.prototype, "requestedplan", void 0);
546
+ __decorate([
547
+ Input()
548
+ ], UpgradePlanButtonComponent.prototype, "requestedplantitle", void 0);
549
+ UpgradePlanButtonComponent = __decorate([
550
+ Component({
551
+ selector: 'anatoly-upgrade-plan-button',
552
+ template: "<button class=\"btn btn-block btn-primary\" (click)=\"onUpgradePlan()\">\r\n Upgrade\r\n</button>\r\n"
553
+ })
554
+ ], UpgradePlanButtonComponent);
555
+ return UpgradePlanButtonComponent;
556
+ }());
557
+
558
+ /*
559
+ <file>
560
+ Authors:
561
+ Vadim Osovitny
562
+
563
+ Created:
564
+ 4 Jul 2018
565
+
566
+ Version:
567
+ 1.0
568
+
569
+ Copyright (c) 2018 Osovitny Inc. All rights reserved.
570
+ </file>
571
+ */
572
+ var SignInButtonComponent = /** @class */ (function () {
573
+ function SignInButtonComponent() {
574
+ }
575
+ __decorate([
576
+ Input()
577
+ ], SignInButtonComponent.prototype, "classbtn", void 0);
578
+ SignInButtonComponent = __decorate([
579
+ Component({
580
+ selector: 'anatoly-signin-button',
581
+ template: "<a href=\"identity/signIn\" class=\"{{classbtn}}\">Sign In</a>\r\n"
582
+ })
583
+ ], SignInButtonComponent);
584
+ return SignInButtonComponent;
585
+ }());
586
+
587
+ /*
588
+ <file>
589
+ Authors:
590
+ Vadim Osovitny
591
+
592
+ Created:
593
+ 4 Jul 2018
594
+
595
+ Version:
596
+ 1.0
597
+
598
+ Copyright (c) 2018 Osovitny Inc. All rights reserved.
599
+ </file>
600
+ */
601
+ var SignOutButtonComponent = /** @class */ (function () {
602
+ function SignOutButtonComponent() {
603
+ }
604
+ __decorate([
605
+ Input()
606
+ ], SignOutButtonComponent.prototype, "classbtn", void 0);
607
+ SignOutButtonComponent = __decorate([
608
+ Component({
609
+ selector: 'anatoly-signout-button',
610
+ template: "<a href=\"identity/signOut\" class=\"{{classbtn}}\">Sign Out</a>\r\n"
611
+ })
612
+ ], SignOutButtonComponent);
613
+ return SignOutButtonComponent;
614
+ }());
615
+
616
+ /*
617
+ <file>
618
+ Authors:
619
+ Vadim Osovitny
620
+
621
+ Created:
622
+ 4 Jul 2018
623
+
624
+ Version:
625
+ 1.0
626
+
627
+ Copyright (c) 2018 Osovitny Inc. All rights reserved.
628
+ </file>
629
+ */
630
+ var SignUpButtonComponent = /** @class */ (function () {
631
+ function SignUpButtonComponent() {
632
+ }
633
+ __decorate([
634
+ Input()
635
+ ], SignUpButtonComponent.prototype, "classbtn", void 0);
636
+ SignUpButtonComponent = __decorate([
637
+ Component({
638
+ selector: 'anatoly-signup-button',
639
+ template: "<a href=\"identity/signup\" class=\"{{classbtn}}\">Sign Up</a>\r\n"
640
+ })
641
+ ], SignUpButtonComponent);
642
+ return SignUpButtonComponent;
643
+ }());
644
+
645
+ /*
646
+ <file>
647
+ Authors:
648
+ Vadim Osovitny
649
+
650
+ Created:
651
+ 4 Jul 2018
652
+
653
+ Version:
654
+ 1.0
655
+
656
+ Copyright (c) 2018 Osovitny Inc. All rights reserved.
657
+ </file>
658
+ */
659
+ var AnatolyIdentityModule = /** @class */ (function () {
660
+ function AnatolyIdentityModule() {
661
+ }
662
+ AnatolyIdentityModule = __decorate([
663
+ NgModule({
664
+ imports: [],
665
+ exports: [
666
+ SignInButtonComponent,
667
+ SignUpButtonComponent,
668
+ SignOutButtonComponent
669
+ ],
670
+ declarations: [
671
+ SignInButtonComponent,
672
+ SignUpButtonComponent,
673
+ SignOutButtonComponent
674
+ ],
675
+ providers: []
676
+ })
677
+ ], AnatolyIdentityModule);
678
+ return AnatolyIdentityModule;
679
+ }());
680
+
681
+ // Components
682
+
683
+ /*
684
+ <file>
685
+ Authors:
686
+ Vadim Osovitny
687
+
688
+ Created:
689
+ 10 Nov 2017
690
+
691
+ Version:
692
+ 1.0
693
+
694
+ Copyright (c) 2016-2019 Osovitny Inc. All rights reserved.
695
+ </file>
696
+ */
697
+ var AnatolyBillingModule = /** @class */ (function () {
698
+ function AnatolyBillingModule() {
699
+ }
700
+ AnatolyBillingModule = __decorate([
701
+ NgModule({
702
+ imports: [
703
+ CommonModule,
704
+ HttpClientModule,
705
+ HttpClientXsrfModule,
706
+ HttpClientJsonpModule,
707
+ AnatolyIdentityModule
708
+ ],
709
+ exports: [
710
+ CommonModule,
711
+ HttpClientModule,
712
+ HttpClientXsrfModule,
713
+ HttpClientJsonpModule,
714
+ SubscribePlanButtonComponent,
715
+ UpgradePlanButtonComponent,
716
+ BuyAccessButtonComponent
717
+ ],
718
+ declarations: [
719
+ SubscribePlanButtonComponent,
720
+ UpgradePlanButtonComponent,
721
+ BuyAccessButtonComponent
722
+ ],
723
+ providers: [
724
+ BaseBillingApiService
725
+ ]
726
+ })
727
+ ], AnatolyBillingModule);
728
+ return AnatolyBillingModule;
729
+ }());
730
+
731
+ // Components
732
+
733
+ /*
734
+ <file>
735
+ Authors:
736
+ Vadim Osovitny
737
+
738
+ Created:
739
+ 28 Aug 2018
740
+
741
+ Version:
742
+ 1.0
743
+
744
+ Copyright (c) 2016-2019 Osovitny Inc. All rights reserved.
745
+ </file>
746
+ */
747
+ var BaseComponent = /** @class */ (function () {
748
+ function BaseComponent() {
749
+ }
750
+ BaseComponent.prototype.getQSId = function () {
751
+ var id = osovitny.utils.getValueByNameInQS("id");
752
+ if (typeof id === 'undefined' || id == '')
753
+ return null;
754
+ return id;
755
+ };
756
+ BaseComponent.prototype.showLoading = function () {
757
+ var panelLoading = $('#pnlLoading');
758
+ panelLoading.show();
759
+ };
760
+ BaseComponent.prototype.hideLoading = function () {
761
+ var panelLoading = $('#pnlLoading');
762
+ panelLoading.hide();
763
+ };
764
+ BaseComponent.prototype.handleError = function (e) {
765
+ this.hideLoading();
766
+ osovitny.ui.errorOccurred();
767
+ };
768
+ return BaseComponent;
769
+ }());
770
+
771
+ /*
772
+ <file>
773
+ Authors:
774
+ Vadim Osovitny
775
+
776
+ Created:
777
+ 20 Nov 2017
778
+
779
+ Version:
780
+ 1.0
781
+
782
+ Copyright (c) 2016-2019 Osovitny Inc. All rights reserved.
783
+ </file>
784
+ */
785
+ var BaseEditComponent = /** @class */ (function (_super) {
786
+ __extends(BaseEditComponent, _super);
787
+ function BaseEditComponent() {
788
+ var _this = _super.call(this) || this;
789
+ _this.formSubmitted = false;
790
+ return _this;
791
+ }
792
+ BaseEditComponent.prototype.isActionAdding = function () {
793
+ var id = osovitny.utils.getValueByNameInQS("id");
794
+ if (typeof id === 'undefined' || id == '')
795
+ return true;
796
+ return false;
797
+ };
798
+ BaseEditComponent.prototype.getEntityId = function () {
799
+ return this.getQSId();
800
+ };
801
+ BaseEditComponent.prototype.isItemInvalid = function (name) {
802
+ if (typeof name === 'undefined' || name == '') {
803
+ return false;
804
+ }
805
+ if (!this.formGroup) {
806
+ return false;
807
+ }
808
+ if (this.formGroup.get(name)) {
809
+ return (this.formSubmitted && this.formGroup.get(name).invalid) ||
810
+ (this.formGroup.get(name).touched && this.formGroup.get(name).invalid);
811
+ }
812
+ return false;
813
+ };
814
+ BaseEditComponent.prototype.getFormValue = function (name) {
815
+ return this.formGroup.controls[name].value;
816
+ };
817
+ BaseEditComponent.prototype.setFormValue = function (name, value) {
818
+ this.formGroup.controls[name].setValue(value);
819
+ };
820
+ BaseEditComponent.prototype.getFormGroupValue = function (groupName, name) {
821
+ return this.formGroup.controls[groupName].get(name).value;
822
+ };
823
+ BaseEditComponent.prototype.setFormGroupValue = function (groupName, name, value) {
824
+ this.formGroup.controls[groupName].get(name).setValue(value);
825
+ };
826
+ __decorate([
827
+ Input()
828
+ ], BaseEditComponent.prototype, "formGroup", void 0);
829
+ __decorate([
830
+ Input()
831
+ ], BaseEditComponent.prototype, "formSubmitted", void 0);
832
+ return BaseEditComponent;
833
+ }(BaseComponent));
834
+
835
+ /*
836
+ <file>
837
+ Authors:
838
+ Anatoly Osovitny
839
+
840
+ Created:
841
+ 23 Apr 2018
842
+
843
+ Version:
844
+ 1.0
845
+
846
+ Copyright (c) 2016-2019 Osovitny Inc. All rights reserved.
847
+ </file>
848
+ */
849
+ var ContentHeaderComponent = /** @class */ (function () {
850
+ function ContentHeaderComponent() {
851
+ }
852
+ ContentHeaderComponent.prototype.ngOnInit = function () {
853
+ if (this.title == null) {
854
+ this.title = '';
855
+ }
856
+ };
857
+ __decorate([
858
+ Input()
859
+ ], ContentHeaderComponent.prototype, "title", void 0);
860
+ ContentHeaderComponent = __decorate([
861
+ Component({
862
+ selector: 'anatoly-content-header',
863
+ template: "<h2 class=\"page-header\">\r\n {{title}}\r\n <!--<small>Optional {{title}}</small>-->\r\n</h2>\r\n"
864
+ })
865
+ ], ContentHeaderComponent);
866
+ return ContentHeaderComponent;
867
+ }());
868
+
869
+ /*
870
+ <file>
871
+ Authors:
872
+ Vadim Osovitny
873
+
874
+ Created:
875
+ 8 Dec 2017
876
+
877
+ Version:
878
+ 1.0
879
+
880
+ Copyright (c) 2016-2019 Osovitny Inc. All rights reserved.
881
+ </file>
882
+ */
883
+ var ValidationSummaryComponent = /** @class */ (function (_super) {
884
+ __extends(ValidationSummaryComponent, _super);
885
+ function ValidationSummaryComponent() {
886
+ return _super.call(this) || this;
887
+ }
888
+ ValidationSummaryComponent.prototype.getFormValidationMessages = function () {
889
+ var _this = this;
890
+ var messages = [];
891
+ Object.keys(this.formGroup.controls).forEach(function (k) {
892
+ var control = _this.formGroup.controls[k];
893
+ if (control.controls != null) {
894
+ Object.keys(control.controls).forEach(function (k) {
895
+ var child = control.controls[k];
896
+ _this.getValidationMessages(child, k).forEach(function (m) { return messages.push(m); });
897
+ });
898
+ }
899
+ else {
900
+ _this.getValidationMessages(control, k).forEach(function (m) { return messages.push(m); });
901
+ }
902
+ });
903
+ return messages;
904
+ };
905
+ ValidationSummaryComponent.prototype.getValidationMessages = function (state, thingName) {
906
+ var thing = state.path || thingName;
907
+ var messages = [];
908
+ if (state.errors) {
909
+ for (var errorName in state.errors) {
910
+ if (state.errors.hasOwnProperty(errorName)) {
911
+ switch (errorName) {
912
+ case 'required':
913
+ messages.push(thing + " is required");
914
+ break;
915
+ case 'minlength':
916
+ messages.push(thing + " must be at least " + state.errors['minlength'].requiredLength + " characters");
917
+ break;
918
+ case 'pattern':
919
+ messages.push(thing + " contains illegal characters");
920
+ break;
921
+ }
922
+ }
923
+ }
924
+ }
925
+ return messages;
926
+ };
927
+ return ValidationSummaryComponent;
928
+ }(BaseEditComponent));
929
+
930
+ /*
931
+ <file>
932
+ Authors:
933
+ Vadim Osovitny
934
+
935
+ Created:
936
+ 7 Dec 2017
937
+
938
+ Version:
939
+ 1.0
940
+
941
+ Copyright (c) 2016-2019 Osovitny Inc. All rights reserved.
942
+ </file>
943
+ */
944
+ var FormValidationSummaryComponent = /** @class */ (function (_super) {
945
+ __extends(FormValidationSummaryComponent, _super);
946
+ function FormValidationSummaryComponent() {
947
+ var _this = _super.call(this) || this;
948
+ _this.visible = false;
949
+ return _this;
950
+ }
951
+ FormValidationSummaryComponent.prototype.getErrors = function () {
952
+ var messages = this.getFormValidationMessages();
953
+ return messages;
954
+ };
955
+ __decorate([
956
+ Input()
957
+ ], FormValidationSummaryComponent.prototype, "visible", void 0);
958
+ FormValidationSummaryComponent = __decorate([
959
+ Component({
960
+ selector: 'anatoly-form-validation-summary',
961
+ 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"
962
+ })
963
+ ], FormValidationSummaryComponent);
964
+ return FormValidationSummaryComponent;
965
+ }(ValidationSummaryComponent));
966
+
967
+ /*
968
+ <file>
969
+ Authors:
970
+ Vadim Osovitny
971
+
972
+ Created:
973
+ 6 Dec 2017
974
+
975
+ Version:
976
+ 1.0
977
+
978
+ Copyright (c) 2016-2019 Osovitny Inc. All rights reserved.
979
+ </file>
980
+ */
981
+ var ItemValidationSummaryComponent = /** @class */ (function (_super) {
982
+ __extends(ItemValidationSummaryComponent, _super);
983
+ function ItemValidationSummaryComponent() {
984
+ return _super.call(this) || this;
985
+ }
986
+ __decorate([
987
+ Input()
988
+ ], ItemValidationSummaryComponent.prototype, "key", void 0);
989
+ __decorate([
990
+ Input()
991
+ ], ItemValidationSummaryComponent.prototype, "title", void 0);
992
+ ItemValidationSummaryComponent = __decorate([
993
+ Component({
994
+ selector: 'anatoly-item-validation-summary',
995
+ template: "<ul class=\"list-unstyled\" *ngIf=\"isItemInvalid(key)\">\r\n <li *ngFor=\"let error of getValidationMessages(formGroup.get(key), title)\">\r\n <span class=\"help-block\">{{ error }}</span>\r\n </li>\r\n</ul>"
996
+ })
997
+ ], ItemValidationSummaryComponent);
998
+ return ItemValidationSummaryComponent;
999
+ }(ValidationSummaryComponent));
1000
+
1001
+ var ɵ0 = function (images) {
1002
+ };
1003
+ var DefaultEditorOptions = {
1004
+ placeholderText: 'Edit Your Content Here',
1005
+ charCounterCount: true,
1006
+ heightMin: 100,
1007
+ toolbarInline: false,
1008
+ toolbarButtons: {
1009
+ 'moreText': {
1010
+ 'buttons': ['bold', 'italic', 'underline', 'strikeThrough', 'subscript', 'superscript',
1011
+ 'fontFamily', 'fontSize', 'textColor', 'backgroundColor', 'inlineClass', 'inlineStyle']
1012
+ },
1013
+ 'moreParagraph': {
1014
+ 'buttons': ['alignLeft', 'alignCenter', 'formatOLSimple', 'alignRight', 'alignJustify',
1015
+ 'formatOL', 'formatUL', 'paragraphFormat', 'paragraphStyle', 'lineHeight', 'outdent', 'indent', 'quote']
1016
+ },
1017
+ 'moreRich': {
1018
+ 'buttons': ['insertLink', 'insertImage', 'insertTable', 'emoticons', 'fontAwesome',
1019
+ 'specialCharacters', 'embedly']
1020
+ },
1021
+ 'moreMisc': {
1022
+ 'buttons': ['selectAll', 'clearFormatting', 'html', 'undo', 'redo', 'fullscreen'],
1023
+ 'align': 'right',
1024
+ }
1025
+ },
1026
+ /*
1027
+ Upload:
1028
+ https://www.froala.com/wysiwyg-editor/docs/concepts/image/upload
1029
+ */
1030
+ imageUploadURL: '/api/HtmlEditor/UploadImage',
1031
+ imageAllowedTypes: ['jpeg', 'jpg', 'png'],
1032
+ imageUploadParams: { uploadType: '', uploadParentId: '' },
1033
+ events: {
1034
+ 'image.beforeUpload': ɵ0
1035
+ }
1036
+ };
1037
+
1038
+ /*
1039
+ <file>
1040
+ Authors:
1041
+ Anatoly Osovitny
1042
+ Vadim Osovitny
1043
+
1044
+ Created:
1045
+ 12 Dec 2017
1046
+
1047
+ Version:
1048
+ 1.0
1049
+
1050
+ Copyright (c) 2016-2019 Osovitny Inc. All rights reserved.
1051
+ </file>
1052
+ */
1053
+ var BaseHtmlEditorComponent = /** @class */ (function (_super) {
1054
+ __extends(BaseHtmlEditorComponent, _super);
1055
+ function BaseHtmlEditorComponent() {
1056
+ var _this = _super.call(this) || this;
1057
+ _this.editorInitialized = false;
1058
+ //General params
1059
+ _this.editorId = '';
1060
+ _this.editorLabelText = 'Html';
1061
+ _this.editorOptions = {};
1062
+ return _this;
1063
+ }
1064
+ BaseHtmlEditorComponent.prototype.ngOnInit = function () {
1065
+ var opt = this.editorOptions;
1066
+ if (typeof this.editorOptions == "string") {
1067
+ opt = JSON.parse(this.editorOptions);
1068
+ }
1069
+ var newOptions = $.extend({}, DefaultEditorOptions, opt);
1070
+ var key = window.__froalaEditor_Key;
1071
+ if (key) {
1072
+ newOptions = $.extend({}, newOptions, JSON.parse('{ "key": "' + key + '" }'));
1073
+ }
1074
+ if (newOptions.events && newOptions.events.initialized) {
1075
+ newOptions.events.initialized.overridden = false;
1076
+ }
1077
+ this.options = newOptions;
1078
+ };
1079
+ BaseHtmlEditorComponent.prototype.doAfterEditorInitialized = function (action) {
1080
+ var that = this;
1081
+ var timeOut = 500;
1082
+ if (this.editorInitialized) {
1083
+ timeOut = 100;
1084
+ }
1085
+ setTimeout(function () { action(that); }, timeOut);
1086
+ };
1087
+ BaseHtmlEditorComponent.prototype.getEditor = function () {
1088
+ if (this._control)
1089
+ return this._control.getEditor();
1090
+ return null;
1091
+ };
1092
+ //Public Funcs
1093
+ BaseHtmlEditorComponent.prototype.initializeControl = function (control) {
1094
+ this._control = control;
1095
+ this._control.initialize();
1096
+ this.editorInitialized = true;
1097
+ };
1098
+ BaseHtmlEditorComponent.prototype.setUploadParams = function (uploadType, uploadParentId) {
1099
+ this.doAfterEditorInitialized(function (that) {
1100
+ var editor = that.getEditor();
1101
+ if (typeof (editor) == "undefined" || editor == null) {
1102
+ return;
1103
+ }
1104
+ editor.opts.imageUploadParams.uploadType = uploadType;
1105
+ editor.opts.imageUploadParams.uploadParentId = uploadParentId;
1106
+ });
1107
+ };
1108
+ __decorate([
1109
+ Input()
1110
+ ], BaseHtmlEditorComponent.prototype, "editorId", void 0);
1111
+ __decorate([
1112
+ Input()
1113
+ ], BaseHtmlEditorComponent.prototype, "editorLabelText", void 0);
1114
+ __decorate([
1115
+ Input()
1116
+ ], BaseHtmlEditorComponent.prototype, "editorOptions", void 0);
1117
+ return BaseHtmlEditorComponent;
1118
+ }(BaseEditComponent));
1119
+
1120
+ /*
1121
+ <file>
1122
+ Authors:
1123
+ Anatoly Osovitny
1124
+ Vadim Osovitny
1125
+
1126
+ Created:
1127
+ 12 Dec 2017
1128
+
1129
+ Version:
1130
+ 1.0
1131
+
1132
+ Copyright (c) 2016-2019 Osovitny Inc. All rights reserved.
1133
+ </file>
1134
+ */
1135
+ var HtmlEditorComponent = /** @class */ (function (_super) {
1136
+ __extends(HtmlEditorComponent, _super);
1137
+ function HtmlEditorComponent() {
1138
+ return _super.call(this) || this;
1139
+ }
1140
+ HtmlEditorComponent.prototype.setHtml = function (content) {
1141
+ this.doAfterEditorInitialized(function (that) {
1142
+ var editor = that.getEditor();
1143
+ if (typeof (editor) == "undefined" || editor == null) {
1144
+ return;
1145
+ }
1146
+ editor.html.set(content);
1147
+ });
1148
+ };
1149
+ HtmlEditorComponent.prototype.getHtml = function () {
1150
+ var editor = this.getEditor();
1151
+ if (typeof (editor) == "undefined" || editor == null) {
1152
+ return;
1153
+ }
1154
+ return editor.html.get(false);
1155
+ };
1156
+ HtmlEditorComponent = __decorate([
1157
+ Component({
1158
+ selector: 'anatoly-html-editor',
1159
+ template: "<div>\r\n <label>{{ editorLabelText }}</label>\r\n <textarea id=\"htmleditor-{{editorId}}\" class=\"htmleditor-{{editorId}}\" \r\n [froalaEditor]=\"options\" (froalaInit)=\"initializeControl($event)\">\r\n </textarea>\r\n</div>"
1160
+ })
1161
+ ], HtmlEditorComponent);
1162
+ return HtmlEditorComponent;
1163
+ }(BaseHtmlEditorComponent));
1164
+
1165
+ /*
1166
+ <file>
1167
+ Authors:
1168
+ Anatoly Osovitny
1169
+ Vadim Osovitny
1170
+
1171
+ Created:
1172
+ 12 Dec 2017
1173
+
1174
+ Version:
1175
+ 1.0
1176
+
1177
+ Copyright (c) 2016-2019 Osovitny Inc. All rights reserved.
1178
+ </file>
1179
+ */
1180
+ var FormsHtmlEditorComponent = /** @class */ (function (_super) {
1181
+ __extends(FormsHtmlEditorComponent, _super);
1182
+ function FormsHtmlEditorComponent() {
1183
+ var _this = _super.call(this) || this;
1184
+ _this.editorFormKey = 'html';
1185
+ return _this;
1186
+ }
1187
+ __decorate([
1188
+ Input()
1189
+ ], FormsHtmlEditorComponent.prototype, "editorFormKey", void 0);
1190
+ FormsHtmlEditorComponent = __decorate([
1191
+ Component({
1192
+ selector: 'anatoly-forms-html-editor',
1193
+ 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 id=\"htmleditor-{{editorId}}\" class=\"htmleditor-{{editorId}}\"\r\n [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 [key]=\"editorFormKey\"\r\n [title]=\"editorLabelText\">\r\n </anatoly-item-validation-summary>\r\n </div>\r\n</div>\r\n"
1194
+ })
1195
+ ], FormsHtmlEditorComponent);
1196
+ return FormsHtmlEditorComponent;
1197
+ }(BaseHtmlEditorComponent));
1198
+
1199
+ /*
1200
+ <file>
1201
+ Authors:
1202
+ Vadim Osovitny
1203
+
1204
+ Created:
1205
+ 3 Jun 2018
1206
+
1207
+ Version:
1208
+ 1.0
1209
+
1210
+ Copyright (c) 2016-2019 Osovitny Inc. All rights reserved.
1211
+ </file>
1212
+ */
1213
+ var AnatolyUIModule = /** @class */ (function () {
1214
+ function AnatolyUIModule() {
1215
+ }
1216
+ AnatolyUIModule = __decorate([
1217
+ NgModule({
1218
+ imports: [
1219
+ CommonModule,
1220
+ ReactiveFormsModule,
1221
+ FormsModule,
1222
+ HttpClientModule,
1223
+ HttpClientXsrfModule,
1224
+ HttpClientJsonpModule,
1225
+ FroalaEditorModule.forRoot(),
1226
+ FroalaViewModule.forRoot(),
1227
+ GridModule,
1228
+ PopupModule,
1229
+ ButtonsModule,
1230
+ DropDownsModule
1231
+ ],
1232
+ exports: [
1233
+ CommonModule,
1234
+ HttpClientModule,
1235
+ HttpClientXsrfModule,
1236
+ HttpClientJsonpModule,
1237
+ ItemValidationSummaryComponent,
1238
+ FormValidationSummaryComponent,
1239
+ ContentHeaderComponent,
1240
+ HtmlEditorComponent,
1241
+ FormsHtmlEditorComponent
1242
+ ],
1243
+ declarations: [
1244
+ ItemValidationSummaryComponent,
1245
+ FormValidationSummaryComponent,
1246
+ ContentHeaderComponent,
1247
+ HtmlEditorComponent,
1248
+ FormsHtmlEditorComponent
1249
+ ],
1250
+ providers: [],
1251
+ schemas: [
1252
+ CUSTOM_ELEMENTS_SCHEMA,
1253
+ NO_ERRORS_SCHEMA
1254
+ ]
1255
+ })
1256
+ ], AnatolyUIModule);
1257
+ return AnatolyUIModule;
1258
+ }());
1259
+
1260
+ // Base Components
1261
+
1262
+ /**
1263
+ * Generated bundle index. Do not edit.
1264
+ */
1265
+
1266
+ export { AnatolyBillingModule, AnatolyCoreModule, AnatolyIdentityModule, AnatolyUIModule, AppContextService, BaseApiService, BaseBillingApiService, BaseComponent, BaseEditComponent, BaseGoService, BaseGridEditService, BuyAccessButtonComponent, ContentHeaderComponent, FormValidationSummaryComponent, FormsHtmlEditorComponent, HtmlEditorComponent, ItemValidationSummaryComponent, SignInButtonComponent, SignOutButtonComponent, SignUpButtonComponent, SubscribePlanButtonComponent, UpgradePlanButtonComponent, ValidationSummaryComponent };
1267
+ //# sourceMappingURL=osovitny-anatoly.js.map