@osovitny/anatoly 1.0.1 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (146) hide show
  1. package/README.md +5 -0
  2. package/ng-package.json +7 -0
  3. package/package.json +1 -16
  4. package/src/lib/billing/billing.module.ts +62 -0
  5. package/src/lib/billing/components/buyaccess/buyaccess-button.component.html +15 -0
  6. package/src/lib/billing/components/buyaccess/buyaccess-button.component.ts +70 -0
  7. package/src/lib/billing/components/subscriptions/subscribe-plan-button.component.html +21 -0
  8. package/src/lib/billing/components/subscriptions/subscribe-plan-button.component.ts +60 -0
  9. package/src/lib/billing/components/subscriptions/upgrade-plan-button.component.html +3 -0
  10. package/src/lib/billing/components/subscriptions/upgrade-plan-button.component.ts +47 -0
  11. package/src/lib/billing/index.ts +10 -0
  12. package/src/lib/billing/services/base-billing-api.service.ts +56 -0
  13. package/src/lib/core/consts.ts +7 -0
  14. package/src/lib/core/core.module.ts +45 -0
  15. package/src/lib/core/index.ts +10 -0
  16. package/src/lib/core/services/appcontext.service.ts +81 -0
  17. package/src/lib/core/services/base-api.service.ts +87 -0
  18. package/src/lib/core/services/base-go.service.ts +33 -0
  19. package/src/lib/core/services/base-gridedit.service.ts +124 -0
  20. package/src/lib/identity/components/signin-button.component.html +1 -0
  21. package/src/lib/identity/components/signin-button.component.ts +27 -0
  22. package/src/lib/identity/components/signout-button.component.html +1 -0
  23. package/src/lib/identity/components/signout-button.component.ts +27 -0
  24. package/src/lib/identity/components/signup-button.component.html +1 -0
  25. package/src/lib/identity/components/signup-button.component.ts +28 -0
  26. package/src/lib/identity/identity.module.ts +41 -0
  27. package/src/lib/identity/index.ts +7 -0
  28. package/src/lib/ui/components/base-edit.component.ts +77 -0
  29. package/src/lib/ui/components/base.component.ts +45 -0
  30. package/src/lib/ui/components/content-header/content-header.component.html +4 -0
  31. package/src/lib/ui/components/content-header/content-header.component.ts +32 -0
  32. package/src/lib/ui/components/html-editor/base-html-editor.component.ts +97 -0
  33. package/src/lib/ui/components/html-editor/forms-html-editor.component.html +14 -0
  34. package/src/lib/ui/components/html-editor/forms-html-editor.component.ts +35 -0
  35. package/src/lib/ui/components/html-editor/html-editor.component.html +6 -0
  36. package/src/lib/ui/components/html-editor/html-editor.component.ts +51 -0
  37. package/src/lib/ui/components/html-editor/html-editor.defaultoptions.ts +38 -0
  38. package/src/lib/ui/components/validation/form-validation-summary.component.html +4 -0
  39. package/src/lib/ui/components/validation/form-validation-summary.component.ts +36 -0
  40. package/src/lib/ui/components/validation/item-validation-summary.component.html +5 -0
  41. package/src/lib/ui/components/validation/item-validation-summary.component.ts +32 -0
  42. package/src/lib/ui/components/validation/validation-summary.component.ts +74 -0
  43. package/src/lib/ui/index.js +13 -0
  44. package/src/lib/ui/index.js.map +1 -0
  45. package/src/lib/ui/index.ts +14 -0
  46. package/src/lib/ui/ui.module.ts +83 -0
  47. package/{public-api.d.ts → src/public-api.ts} +4 -4
  48. package/tsconfig.lib.json +32 -0
  49. package/tsconfig.lib.prod.json +6 -0
  50. package/tslint.json +17 -0
  51. package/typings/osovitny-ui/index.d.ts +24 -0
  52. package/bundles/osovitny-anatoly.umd.js +0 -2065
  53. package/bundles/osovitny-anatoly.umd.js.map +0 -1
  54. package/bundles/osovitny-anatoly.umd.min.js +0 -16
  55. package/bundles/osovitny-anatoly.umd.min.js.map +0 -1
  56. package/esm2015/lib/billing/billing.module.js +0 -62
  57. package/esm2015/lib/billing/components/buyaccess/buyaccess-button.component.js +0 -123
  58. package/esm2015/lib/billing/components/subscriptions/subscribe-plan-button.component.js +0 -97
  59. package/esm2015/lib/billing/components/subscriptions/upgrade-plan-button.component.js +0 -84
  60. package/esm2015/lib/billing/index.js +0 -6
  61. package/esm2015/lib/billing/services/base-billing-api.service.js +0 -116
  62. package/esm2015/lib/core/consts.js +0 -15
  63. package/esm2015/lib/core/core.module.js +0 -47
  64. package/esm2015/lib/core/index.js +0 -12
  65. package/esm2015/lib/core/services/appcontext.service.js +0 -123
  66. package/esm2015/lib/core/services/base-api.service.js +0 -154
  67. package/esm2015/lib/core/services/base-go.service.js +0 -58
  68. package/esm2015/lib/core/services/base-gridedit.service.js +0 -202
  69. package/esm2015/lib/identity/components/signin-button.component.js +0 -38
  70. package/esm2015/lib/identity/components/signout-button.component.js +0 -38
  71. package/esm2015/lib/identity/components/signup-button.component.js +0 -39
  72. package/esm2015/lib/identity/identity.module.js +0 -43
  73. package/esm2015/lib/identity/index.js +0 -6
  74. package/esm2015/lib/ui/components/base-edit.component.js +0 -102
  75. package/esm2015/lib/ui/components/base.component.js +0 -57
  76. package/esm2015/lib/ui/components/content-header/content-header.component.js +0 -44
  77. package/esm2015/lib/ui/components/html-editor/html-editor.component.js +0 -267
  78. package/esm2015/lib/ui/components/validation/form-validation-summary.component.js +0 -51
  79. package/esm2015/lib/ui/components/validation/item-validation-summary.component.js +0 -45
  80. package/esm2015/lib/ui/components/validation/validation-summary.component.js +0 -93
  81. package/esm2015/lib/ui/index.js +0 -11
  82. package/esm2015/lib/ui/ui.module.js +0 -72
  83. package/esm2015/osovitny-anatoly.js +0 -9
  84. package/esm2015/public-api.js +0 -9
  85. package/esm5/lib/billing/billing.module.js +0 -66
  86. package/esm5/lib/billing/components/buyaccess/buyaccess-button.component.js +0 -128
  87. package/esm5/lib/billing/components/subscriptions/subscribe-plan-button.component.js +0 -100
  88. package/esm5/lib/billing/components/subscriptions/upgrade-plan-button.component.js +0 -86
  89. package/esm5/lib/billing/index.js +0 -6
  90. package/esm5/lib/billing/services/base-billing-api.service.js +0 -135
  91. package/esm5/lib/core/consts.js +0 -15
  92. package/esm5/lib/core/core.module.js +0 -51
  93. package/esm5/lib/core/index.js +0 -12
  94. package/esm5/lib/core/services/appcontext.service.js +0 -140
  95. package/esm5/lib/core/services/base-api.service.js +0 -205
  96. package/esm5/lib/core/services/base-go.service.js +0 -59
  97. package/esm5/lib/core/services/base-gridedit.service.js +0 -240
  98. package/esm5/lib/identity/components/signin-button.component.js +0 -41
  99. package/esm5/lib/identity/components/signout-button.component.js +0 -41
  100. package/esm5/lib/identity/components/signup-button.component.js +0 -41
  101. package/esm5/lib/identity/identity.module.js +0 -47
  102. package/esm5/lib/identity/index.js +0 -6
  103. package/esm5/lib/ui/components/base-edit.component.js +0 -137
  104. package/esm5/lib/ui/components/base.component.js +0 -72
  105. package/esm5/lib/ui/components/content-header/content-header.component.js +0 -51
  106. package/esm5/lib/ui/components/html-editor/html-editor.component.js +0 -309
  107. package/esm5/lib/ui/components/validation/form-validation-summary.component.js +0 -59
  108. package/esm5/lib/ui/components/validation/item-validation-summary.component.js +0 -49
  109. package/esm5/lib/ui/components/validation/validation-summary.component.js +0 -106
  110. package/esm5/lib/ui/index.js +0 -11
  111. package/esm5/lib/ui/ui.module.js +0 -76
  112. package/esm5/osovitny-anatoly.js +0 -9
  113. package/esm5/public-api.js +0 -9
  114. package/fesm2015/osovitny-anatoly.js +0 -1622
  115. package/fesm2015/osovitny-anatoly.js.map +0 -1
  116. package/fesm5/osovitny-anatoly.js +0 -1877
  117. package/fesm5/osovitny-anatoly.js.map +0 -1
  118. package/lib/billing/billing.module.d.ts +0 -2
  119. package/lib/billing/components/buyaccess/buyaccess-button.component.d.ts +0 -16
  120. package/lib/billing/components/subscriptions/subscribe-plan-button.component.d.ts +0 -15
  121. package/lib/billing/components/subscriptions/upgrade-plan-button.component.d.ts +0 -9
  122. package/lib/billing/index.d.ts +0 -1
  123. package/lib/billing/services/base-billing-api.service.d.ts +0 -9
  124. package/lib/core/consts.d.ts +0 -5
  125. package/lib/core/core.module.d.ts +0 -2
  126. package/lib/core/index.d.ts +0 -5
  127. package/lib/core/services/appcontext.service.d.ts +0 -14
  128. package/lib/core/services/base-api.service.d.ts +0 -18
  129. package/lib/core/services/base-go.service.d.ts +0 -7
  130. package/lib/core/services/base-gridedit.service.d.ts +0 -19
  131. package/lib/identity/components/signin-button.component.d.ts +0 -4
  132. package/lib/identity/components/signout-button.component.d.ts +0 -4
  133. package/lib/identity/components/signup-button.component.d.ts +0 -4
  134. package/lib/identity/identity.module.d.ts +0 -2
  135. package/lib/identity/index.d.ts +0 -1
  136. package/lib/ui/components/base-edit.component.d.ts +0 -14
  137. package/lib/ui/components/base.component.d.ts +0 -7
  138. package/lib/ui/components/content-header/content-header.component.d.ts +0 -5
  139. package/lib/ui/components/html-editor/html-editor.component.d.ts +0 -22
  140. package/lib/ui/components/validation/form-validation-summary.component.d.ts +0 -6
  141. package/lib/ui/components/validation/item-validation-summary.component.d.ts +0 -6
  142. package/lib/ui/components/validation/validation-summary.component.d.ts +0 -6
  143. package/lib/ui/index.d.ts +0 -4
  144. package/lib/ui/ui.module.d.ts +0 -2
  145. package/osovitny-anatoly.d.ts +0 -4
  146. package/osovitny-anatoly.metadata.json +0 -1
@@ -1,2065 +0,0 @@
1
- (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('@angular/common/http'), require('rxjs/operators'), require('rxjs'), require('@angular/router'), 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')) :
3
- typeof define === 'function' && define.amd ? define('@osovitny/anatoly', ['exports', '@angular/core', '@angular/common', '@angular/common/http', 'rxjs/operators', 'rxjs', '@angular/router', '@angular/forms', 'angular-froala-wysiwyg', '@progress/kendo-angular-grid', '@progress/kendo-angular-popup', '@progress/kendo-angular-buttons', '@progress/kendo-angular-dropdowns'], factory) :
4
- (global = global || self, factory((global.osovitny = global.osovitny || {}, global.osovitny.anatoly = {}), global.ng.core, global.ng.common, global.ng.common.http, global.rxjs.operators, global.rxjs, global.ng.router, global.ng.forms, global.angularFroalaWysiwyg, global.kendoAngularGrid, global.kendoAngularPopup, global.kendoAngularButtons, global.kendoAngularDropdowns));
5
- }(this, function (exports, core, common, http, operators, rxjs, router, forms, angularFroalaWysiwyg, kendoAngularGrid, kendoAngularPopup, kendoAngularButtons, kendoAngularDropdowns) { 'use strict';
6
-
7
- /*! *****************************************************************************
8
- Copyright (c) Microsoft Corporation. All rights reserved.
9
- Licensed under the Apache License, Version 2.0 (the "License"); you may not use
10
- this file except in compliance with the License. You may obtain a copy of the
11
- License at http://www.apache.org/licenses/LICENSE-2.0
12
-
13
- THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
- KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
15
- WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
16
- MERCHANTABLITY OR NON-INFRINGEMENT.
17
-
18
- See the Apache Version 2.0 License for specific language governing permissions
19
- and limitations under the License.
20
- ***************************************************************************** */
21
- /* global Reflect, Promise */
22
-
23
- var extendStatics = function(d, b) {
24
- extendStatics = Object.setPrototypeOf ||
25
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
26
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
27
- return extendStatics(d, b);
28
- };
29
-
30
- function __extends(d, b) {
31
- extendStatics(d, b);
32
- function __() { this.constructor = d; }
33
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
34
- }
35
-
36
- var __assign = function() {
37
- __assign = Object.assign || function __assign(t) {
38
- for (var s, i = 1, n = arguments.length; i < n; i++) {
39
- s = arguments[i];
40
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
41
- }
42
- return t;
43
- };
44
- return __assign.apply(this, arguments);
45
- };
46
-
47
- function __rest(s, e) {
48
- var t = {};
49
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
50
- t[p] = s[p];
51
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
52
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
53
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
54
- t[p[i]] = s[p[i]];
55
- }
56
- return t;
57
- }
58
-
59
- function __decorate(decorators, target, key, desc) {
60
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
61
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
62
- 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;
63
- return c > 3 && r && Object.defineProperty(target, key, r), r;
64
- }
65
-
66
- function __param(paramIndex, decorator) {
67
- return function (target, key) { decorator(target, key, paramIndex); }
68
- }
69
-
70
- function __metadata(metadataKey, metadataValue) {
71
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
72
- }
73
-
74
- function __awaiter(thisArg, _arguments, P, generator) {
75
- return new (P || (P = Promise))(function (resolve, reject) {
76
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
77
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
78
- function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
79
- step((generator = generator.apply(thisArg, _arguments || [])).next());
80
- });
81
- }
82
-
83
- function __generator(thisArg, body) {
84
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
85
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
86
- function verb(n) { return function (v) { return step([n, v]); }; }
87
- function step(op) {
88
- if (f) throw new TypeError("Generator is already executing.");
89
- while (_) try {
90
- 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;
91
- if (y = 0, t) op = [op[0] & 2, t.value];
92
- switch (op[0]) {
93
- case 0: case 1: t = op; break;
94
- case 4: _.label++; return { value: op[1], done: false };
95
- case 5: _.label++; y = op[1]; op = [0]; continue;
96
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
97
- default:
98
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
99
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
100
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
101
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
102
- if (t[2]) _.ops.pop();
103
- _.trys.pop(); continue;
104
- }
105
- op = body.call(thisArg, _);
106
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
107
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
108
- }
109
- }
110
-
111
- function __exportStar(m, exports) {
112
- for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
113
- }
114
-
115
- function __values(o) {
116
- var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
117
- if (m) return m.call(o);
118
- return {
119
- next: function () {
120
- if (o && i >= o.length) o = void 0;
121
- return { value: o && o[i++], done: !o };
122
- }
123
- };
124
- }
125
-
126
- function __read(o, n) {
127
- var m = typeof Symbol === "function" && o[Symbol.iterator];
128
- if (!m) return o;
129
- var i = m.call(o), r, ar = [], e;
130
- try {
131
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
132
- }
133
- catch (error) { e = { error: error }; }
134
- finally {
135
- try {
136
- if (r && !r.done && (m = i["return"])) m.call(i);
137
- }
138
- finally { if (e) throw e.error; }
139
- }
140
- return ar;
141
- }
142
-
143
- function __spread() {
144
- for (var ar = [], i = 0; i < arguments.length; i++)
145
- ar = ar.concat(__read(arguments[i]));
146
- return ar;
147
- }
148
-
149
- function __spreadArrays() {
150
- for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
151
- for (var r = Array(s), k = 0, i = 0; i < il; i++)
152
- for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
153
- r[k] = a[j];
154
- return r;
155
- };
156
-
157
- function __await(v) {
158
- return this instanceof __await ? (this.v = v, this) : new __await(v);
159
- }
160
-
161
- function __asyncGenerator(thisArg, _arguments, generator) {
162
- if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
163
- var g = generator.apply(thisArg, _arguments || []), i, q = [];
164
- return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
165
- 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); }); }; }
166
- function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
167
- function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
168
- function fulfill(value) { resume("next", value); }
169
- function reject(value) { resume("throw", value); }
170
- function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
171
- }
172
-
173
- function __asyncDelegator(o) {
174
- var i, p;
175
- return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
176
- 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; }
177
- }
178
-
179
- function __asyncValues(o) {
180
- if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
181
- var m = o[Symbol.asyncIterator], i;
182
- 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);
183
- 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); }); }; }
184
- function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
185
- }
186
-
187
- function __makeTemplateObject(cooked, raw) {
188
- if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
189
- return cooked;
190
- };
191
-
192
- function __importStar(mod) {
193
- if (mod && mod.__esModule) return mod;
194
- var result = {};
195
- if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
196
- result.default = mod;
197
- return result;
198
- }
199
-
200
- function __importDefault(mod) {
201
- return (mod && mod.__esModule) ? mod : { default: mod };
202
- }
203
-
204
- /**
205
- * @fileoverview added by tsickle
206
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
207
- */
208
- var anatoly$1;
209
- (function (anatoly) {
210
- var consts;
211
- (function (consts) {
212
- consts.jsonUrl = "/dist/json/";
213
- consts.appUrl = "/";
214
- consts.apiUrl = "/api/";
215
- })(consts = anatoly.consts || (anatoly.consts = {}));
216
- })(anatoly$1 || (anatoly$1 = {}));
217
- ((/** @type {?} */ (window))).anatoly = anatoly$1;
218
-
219
- /**
220
- * @fileoverview added by tsickle
221
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
222
- */
223
- var BaseApiService = /** @class */ (function () {
224
- function BaseApiService(http) {
225
- this.http = http;
226
- this.baseUrl = anatoly.consts.apiUrl;
227
- }
228
- /**
229
- * @private
230
- * @param {?=} data
231
- * @return {?}
232
- */
233
- BaseApiService.prototype.serializeParams = /**
234
- * @private
235
- * @param {?=} data
236
- * @return {?}
237
- */
238
- function (data) {
239
- return data ? ('?' + $.param(data)) : '';
240
- };
241
- //webApi
242
- //webApi
243
- /**
244
- * @template T
245
- * @param {?} action
246
- * @param {?=} data
247
- * @return {?}
248
- */
249
- BaseApiService.prototype.get =
250
- //webApi
251
- /**
252
- * @template T
253
- * @param {?} action
254
- * @param {?=} data
255
- * @return {?}
256
- */
257
- function (action, data) {
258
- /** @type {?} */
259
- var url = this.baseUrl + ("" + action + this.serializeParams(data));
260
- return this.http.get(url).pipe(operators.map((/**
261
- * @param {?} res
262
- * @return {?}
263
- */
264
- function (res) { return (/** @type {?} */ (res)); })));
265
- };
266
- /**
267
- * @param {?} action
268
- * @param {?=} data
269
- * @return {?}
270
- */
271
- BaseApiService.prototype.post = /**
272
- * @param {?} action
273
- * @param {?=} data
274
- * @return {?}
275
- */
276
- function (action, data) {
277
- /** @type {?} */
278
- var url = this.baseUrl + ("" + action);
279
- return this.http.post(url, data, { responseType: 'text' });
280
- };
281
- /**
282
- * @param {?} action
283
- * @param {?=} data
284
- * @return {?}
285
- */
286
- BaseApiService.prototype.postQS = /**
287
- * @param {?} action
288
- * @param {?=} data
289
- * @return {?}
290
- */
291
- function (action, data) {
292
- /** @type {?} */
293
- var url = this.baseUrl + ("" + action + this.serializeParams(data));
294
- return this.http.post(url, null, { responseType: 'text' });
295
- };
296
- //gets
297
- //gets
298
- /**
299
- * @template T
300
- * @param {?=} data
301
- * @return {?}
302
- */
303
- BaseApiService.prototype.getAll =
304
- //gets
305
- /**
306
- * @template T
307
- * @param {?=} data
308
- * @return {?}
309
- */
310
- function (data) {
311
- return this.get('getall', data).pipe(operators.map((/**
312
- * @param {?} res
313
- * @return {?}
314
- */
315
- function (res) { return (/** @type {?} */ (res)); })));
316
- };
317
- /**
318
- * @param {?} fileName
319
- * @param {?} jsonVersion
320
- * @return {?}
321
- */
322
- BaseApiService.prototype.getJsonFile = /**
323
- * @param {?} fileName
324
- * @param {?} jsonVersion
325
- * @return {?}
326
- */
327
- function (fileName, jsonVersion) {
328
- if (!jsonVersion) {
329
- jsonVersion = "1.0";
330
- }
331
- /** @type {?} */
332
- var url = anatoly.consts.jsonUrl + fileName + '?' + jsonVersion;
333
- return this.http.get(url).pipe(operators.map((/**
334
- * @param {?} res
335
- * @return {?}
336
- */
337
- function (res) { return (/** @type {?} */ (res)); })));
338
- };
339
- /**
340
- * @return {?}
341
- */
342
- BaseApiService.prototype.getNewGuid = /**
343
- * @return {?}
344
- */
345
- function () {
346
- /** @type {?} */
347
- var url = this.baseUrl + 'getNewGuid';
348
- return this.http.get(url, { responseType: 'text' });
349
- };
350
- //CRUD function
351
- //CRUD function
352
- /**
353
- * @template T
354
- * @param {?} id
355
- * @return {?}
356
- */
357
- BaseApiService.prototype.getById =
358
- //CRUD function
359
- /**
360
- * @template T
361
- * @param {?} id
362
- * @return {?}
363
- */
364
- function (id) {
365
- return this.get('getById', { id: id });
366
- };
367
- /**
368
- * @param {?} id
369
- * @return {?}
370
- */
371
- BaseApiService.prototype.remove = /**
372
- * @param {?} id
373
- * @return {?}
374
- */
375
- function (id) {
376
- return this.postQS('remove', { id: id });
377
- };
378
- BaseApiService.decorators = [
379
- { type: core.Injectable }
380
- ];
381
- /** @nocollapse */
382
- BaseApiService.ctorParameters = function () { return [
383
- { type: http.HttpClient }
384
- ]; };
385
- return BaseApiService;
386
- }());
387
- if (false) {
388
- /**
389
- * @type {?}
390
- * @protected
391
- */
392
- BaseApiService.prototype.baseUrl;
393
- /**
394
- * @type {?}
395
- * @protected
396
- */
397
- BaseApiService.prototype.jsonUrl;
398
- /**
399
- * @type {?}
400
- * @protected
401
- */
402
- BaseApiService.prototype.http;
403
- }
404
-
405
- /**
406
- * @fileoverview added by tsickle
407
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
408
- */
409
- var AppContextService = /** @class */ (function (_super) {
410
- __extends(AppContextService, _super);
411
- function AppContextService(http) {
412
- var _this = _super.call(this, http) || this;
413
- _this.http = http;
414
- _this.current = null;
415
- _this.successes = [];
416
- _this.subscription = null;
417
- _this.baseUrl = anatoly.consts.apiUrl + 'appcontext/';
418
- return _this;
419
- }
420
- /**
421
- * @param {?} success
422
- * @return {?}
423
- */
424
- AppContextService.prototype.getCurrent = /**
425
- * @param {?} success
426
- * @return {?}
427
- */
428
- function (success) {
429
- var _this = this;
430
- if (typeof success == "undefined") {
431
- return;
432
- }
433
- if (this.current != null) {
434
- success(this.current);
435
- return;
436
- }
437
- this.successes.push(success);
438
- if (this.subscription != null) {
439
- return;
440
- }
441
- this.subscription = this.get('GetCurrentContext', null).subscribe((/**
442
- * @param {?} data
443
- * @return {?}
444
- */
445
- function (data) {
446
- _this.dataReceived(data);
447
- }), (/**
448
- * @param {?} e
449
- * @return {?}
450
- */
451
- function (e) { }));
452
- };
453
- /**
454
- * @param {?} data
455
- * @return {?}
456
- */
457
- AppContextService.prototype.dataReceived = /**
458
- * @param {?} data
459
- * @return {?}
460
- */
461
- function (data) {
462
- this.current = data;
463
- for (var i = 0; i < this.successes.length; i++) {
464
- /** @type {?} */
465
- var success = this.successes[i];
466
- success(data);
467
- }
468
- this.successes = [];
469
- this.subscription.unsubscribe();
470
- this.subscription = null;
471
- this.current = null;
472
- };
473
- /**
474
- * @return {?}
475
- */
476
- AppContextService.prototype.isUserSignedIn = /**
477
- * @return {?}
478
- */
479
- function () {
480
- return ((/** @type {?} */ (window))).__context_isUserSignedIn;
481
- };
482
- /**
483
- * @return {?}
484
- */
485
- AppContextService.prototype.isUserAdmin = /**
486
- * @return {?}
487
- */
488
- function () {
489
- return ((/** @type {?} */ (window))).__context_isUserAdmin;
490
- };
491
- AppContextService.decorators = [
492
- { type: core.Injectable }
493
- ];
494
- /** @nocollapse */
495
- AppContextService.ctorParameters = function () { return [
496
- { type: http.HttpClient }
497
- ]; };
498
- return AppContextService;
499
- }(BaseApiService));
500
- if (false) {
501
- /**
502
- * @type {?}
503
- * @private
504
- */
505
- AppContextService.prototype.current;
506
- /**
507
- * @type {?}
508
- * @private
509
- */
510
- AppContextService.prototype.successes;
511
- /**
512
- * @type {?}
513
- * @private
514
- */
515
- AppContextService.prototype.subscription;
516
- /**
517
- * @type {?}
518
- * @protected
519
- */
520
- AppContextService.prototype.http;
521
- }
522
-
523
- /**
524
- * @fileoverview added by tsickle
525
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
526
- */
527
- var AnatolyCoreModule = /** @class */ (function () {
528
- function AnatolyCoreModule() {
529
- }
530
- AnatolyCoreModule.decorators = [
531
- { type: core.NgModule, args: [{
532
- imports: [
533
- common.CommonModule,
534
- http.HttpClientModule,
535
- http.HttpClientXsrfModule,
536
- http.HttpClientJsonpModule
537
- ],
538
- exports: [
539
- common.CommonModule,
540
- http.HttpClientModule,
541
- http.HttpClientXsrfModule,
542
- http.HttpClientJsonpModule
543
- ],
544
- declarations: [],
545
- providers: [
546
- AppContextService
547
- ]
548
- },] }
549
- ];
550
- return AnatolyCoreModule;
551
- }());
552
-
553
- /**
554
- * @fileoverview added by tsickle
555
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
556
- */
557
- var BaseGridEditService = /** @class */ (function (_super) {
558
- __extends(BaseGridEditService, _super);
559
- function BaseGridEditService(http) {
560
- var _this = _super.call(this, []) || this;
561
- _this.http = http;
562
- _this.data = [];
563
- _this.baseUrl = anatoly.consts.apiUrl;
564
- _this.baseReadUrl = _this.baseUrl + "getAll";
565
- return _this;
566
- }
567
- /**
568
- * @private
569
- * @param {?=} data
570
- * @return {?}
571
- */
572
- BaseGridEditService.prototype.serializeParams = /**
573
- * @private
574
- * @param {?=} data
575
- * @return {?}
576
- */
577
- function (data) {
578
- return data ? ('?' + $.param(data)) : '';
579
- };
580
- /**
581
- * @private
582
- * @return {?}
583
- */
584
- BaseGridEditService.prototype.reset = /**
585
- * @private
586
- * @return {?}
587
- */
588
- function () {
589
- this.data = [];
590
- };
591
- /**
592
- * @param {?} dataItem
593
- * @return {?}
594
- */
595
- BaseGridEditService.prototype.resetItem = /**
596
- * @param {?} dataItem
597
- * @return {?}
598
- */
599
- function (dataItem) {
600
- if (!dataItem) {
601
- return;
602
- }
603
- //find orignal data item
604
- /** @type {?} */
605
- var originalDataItem = this.data.find((/**
606
- * @param {?} item
607
- * @return {?}
608
- */
609
- function (item) { return item.Id === dataItem.Id; }));
610
- //revert changes
611
- Object.assign(originalDataItem, dataItem);
612
- _super.prototype.next.call(this, this.data);
613
- };
614
- /**
615
- * @param {?=} params
616
- * @return {?}
617
- */
618
- BaseGridEditService.prototype.read = /**
619
- * @param {?=} params
620
- * @return {?}
621
- */
622
- function (params) {
623
- var _this = this;
624
- if (this.data.length) {
625
- return _super.prototype.next.call(this, this.data);
626
- }
627
- /** @type {?} */
628
- var url = this.baseReadUrl;
629
- if (typeof params === 'undefined') {
630
- params = this.savedReadParams;
631
- }
632
- if (typeof params !== 'undefined') {
633
- url = this.baseReadUrl + ("" + this.serializeParams(params));
634
- this.savedReadParams = params;
635
- }
636
- // this.http.get(url)
637
- // .map(res => <any[]>res)
638
- // .do(data => { this.data = data; }).subscribe(data => { super.next(data); });
639
- //}
640
- this.http.get(url).pipe(operators.map((/**
641
- * @param {?} res
642
- * @return {?}
643
- */
644
- function (res) { return (/** @type {?} */ (res)); }))).subscribe((/**
645
- * @param {?} data
646
- * @return {?}
647
- */
648
- function (data) { _super.prototype.next.call(_this, data); }));
649
- };
650
- /**
651
- * @param {?} data
652
- * @param {?} isNew
653
- * @param {?=} sucess
654
- * @return {?}
655
- */
656
- BaseGridEditService.prototype.save = /**
657
- * @param {?} data
658
- * @param {?} isNew
659
- * @param {?=} sucess
660
- * @return {?}
661
- */
662
- function (data, isNew, sucess) {
663
- var _this = this;
664
- /** @type {?} */
665
- var action = isNew ? 'add' : 'update';
666
- this.reset();
667
- this.post(action, data).subscribe((/**
668
- * @return {?}
669
- */
670
- function () {
671
- }), (/**
672
- * @return {?}
673
- */
674
- function () {
675
- _this.read();
676
- }), (/**
677
- * @return {?}
678
- */
679
- function () {
680
- _this.read();
681
- if (sucess)
682
- sucess();
683
- }));
684
- };
685
- /**
686
- * @param {?} data
687
- * @param {?=} sucess
688
- * @return {?}
689
- */
690
- BaseGridEditService.prototype.remove = /**
691
- * @param {?} data
692
- * @param {?=} sucess
693
- * @return {?}
694
- */
695
- function (data, sucess) {
696
- var _this = this;
697
- this.reset();
698
- this.post('remove', data).subscribe((/**
699
- * @return {?}
700
- */
701
- function () {
702
- }), (/**
703
- * @return {?}
704
- */
705
- function () {
706
- _this.read();
707
- }), (/**
708
- * @return {?}
709
- */
710
- function () {
711
- _this.read();
712
- if (sucess)
713
- sucess();
714
- }));
715
- };
716
- /**
717
- * @param {?} action
718
- * @param {?=} data
719
- * @return {?}
720
- */
721
- BaseGridEditService.prototype.post = /**
722
- * @param {?} action
723
- * @param {?=} data
724
- * @return {?}
725
- */
726
- function (action, data) {
727
- /** @type {?} */
728
- var url = this.baseUrl + ("" + action + this.serializeParams(data));
729
- return this.http.post(url, data).pipe(operators.map((/**
730
- * @param {?} res
731
- * @return {?}
732
- */
733
- function (res) { return (/** @type {?} */ (res)); })));
734
- };
735
- BaseGridEditService.decorators = [
736
- { type: core.Injectable }
737
- ];
738
- /** @nocollapse */
739
- BaseGridEditService.ctorParameters = function () { return [
740
- { type: http.HttpClient }
741
- ]; };
742
- return BaseGridEditService;
743
- }(rxjs.BehaviorSubject));
744
- if (false) {
745
- /**
746
- * @type {?}
747
- * @protected
748
- */
749
- BaseGridEditService.prototype.baseUrl;
750
- /**
751
- * @type {?}
752
- * @protected
753
- */
754
- BaseGridEditService.prototype.baseReadUrl;
755
- /**
756
- * @type {?}
757
- * @protected
758
- */
759
- BaseGridEditService.prototype.savedReadParams;
760
- /**
761
- * @type {?}
762
- * @private
763
- */
764
- BaseGridEditService.prototype.data;
765
- /**
766
- * @type {?}
767
- * @protected
768
- */
769
- BaseGridEditService.prototype.http;
770
- }
771
-
772
- /**
773
- * @fileoverview added by tsickle
774
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
775
- */
776
- var BaseGoService = /** @class */ (function () {
777
- function BaseGoService(route, router) {
778
- this.route = route;
779
- this.router = router;
780
- }
781
- /**
782
- * @return {?}
783
- */
784
- BaseGoService.prototype.locationReload = /**
785
- * @return {?}
786
- */
787
- function () {
788
- //this.router.navigate([this.route.url]);
789
- ((/** @type {?} */ (window))).location.reload();
790
- };
791
- BaseGoService.decorators = [
792
- { type: core.Injectable }
793
- ];
794
- /** @nocollapse */
795
- BaseGoService.ctorParameters = function () { return [
796
- { type: router.ActivatedRoute },
797
- { type: router.Router }
798
- ]; };
799
- return BaseGoService;
800
- }());
801
- if (false) {
802
- /**
803
- * @type {?}
804
- * @protected
805
- */
806
- BaseGoService.prototype.route;
807
- /**
808
- * @type {?}
809
- * @protected
810
- */
811
- BaseGoService.prototype.router;
812
- }
813
-
814
- /**
815
- * @fileoverview added by tsickle
816
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
817
- */
818
-
819
- /**
820
- * @fileoverview added by tsickle
821
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
822
- */
823
- var SignInButtonComponent = /** @class */ (function () {
824
- function SignInButtonComponent() {
825
- }
826
- SignInButtonComponent.decorators = [
827
- { type: core.Component, args: [{
828
- selector: 'anatoly-signin-button',
829
- template: "<a href=\"identity/signIn\" class=\"{{classbtn}}\">Sign In</a>\r\n"
830
- }] }
831
- ];
832
- /** @nocollapse */
833
- SignInButtonComponent.ctorParameters = function () { return []; };
834
- SignInButtonComponent.propDecorators = {
835
- classbtn: [{ type: core.Input }]
836
- };
837
- return SignInButtonComponent;
838
- }());
839
- if (false) {
840
- /** @type {?} */
841
- SignInButtonComponent.prototype.classbtn;
842
- }
843
-
844
- /**
845
- * @fileoverview added by tsickle
846
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
847
- */
848
- var SignUpButtonComponent = /** @class */ (function () {
849
- function SignUpButtonComponent() {
850
- }
851
- SignUpButtonComponent.decorators = [
852
- { type: core.Component, args: [{
853
- selector: 'anatoly-signup-button',
854
- template: "<a href=\"identity/signup\" class=\"{{classbtn}}\">Sign Up</a>\r\n"
855
- }] }
856
- ];
857
- /** @nocollapse */
858
- SignUpButtonComponent.ctorParameters = function () { return []; };
859
- SignUpButtonComponent.propDecorators = {
860
- classbtn: [{ type: core.Input }]
861
- };
862
- return SignUpButtonComponent;
863
- }());
864
- if (false) {
865
- /** @type {?} */
866
- SignUpButtonComponent.prototype.classbtn;
867
- }
868
-
869
- /**
870
- * @fileoverview added by tsickle
871
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
872
- */
873
- var SignOutButtonComponent = /** @class */ (function () {
874
- function SignOutButtonComponent() {
875
- }
876
- SignOutButtonComponent.decorators = [
877
- { type: core.Component, args: [{
878
- selector: 'anatoly-signout-button',
879
- template: "<a href=\"identity/signOut\" class=\"{{classbtn}}\">Sign Out</a>\r\n"
880
- }] }
881
- ];
882
- /** @nocollapse */
883
- SignOutButtonComponent.ctorParameters = function () { return []; };
884
- SignOutButtonComponent.propDecorators = {
885
- classbtn: [{ type: core.Input }]
886
- };
887
- return SignOutButtonComponent;
888
- }());
889
- if (false) {
890
- /** @type {?} */
891
- SignOutButtonComponent.prototype.classbtn;
892
- }
893
-
894
- /**
895
- * @fileoverview added by tsickle
896
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
897
- */
898
- var AnatolyIdentityModule = /** @class */ (function () {
899
- function AnatolyIdentityModule() {
900
- }
901
- AnatolyIdentityModule.decorators = [
902
- { type: core.NgModule, args: [{
903
- imports: [],
904
- exports: [
905
- SignInButtonComponent,
906
- SignUpButtonComponent,
907
- SignOutButtonComponent
908
- ],
909
- declarations: [
910
- SignInButtonComponent,
911
- SignUpButtonComponent,
912
- SignOutButtonComponent
913
- ],
914
- providers: []
915
- },] }
916
- ];
917
- return AnatolyIdentityModule;
918
- }());
919
-
920
- /**
921
- * @fileoverview added by tsickle
922
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
923
- */
924
-
925
- /**
926
- * @fileoverview added by tsickle
927
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
928
- */
929
- var SubscribePlanButtonComponent = /** @class */ (function () {
930
- function SubscribePlanButtonComponent(appcontext) {
931
- this.appcontext = appcontext;
932
- this.contextUpdated = false;
933
- this.isUserSignedIn = false;
934
- this.currentPlan = 0;
935
- this.currentPlanTitle = "";
936
- this.requestedPlan = 0;
937
- this.requestedPlanTitle = "";
938
- }
939
- /**
940
- * @return {?}
941
- */
942
- SubscribePlanButtonComponent.prototype.ngOnInit = /**
943
- * @return {?}
944
- */
945
- function () {
946
- var _this = this;
947
- if (!this.appcontext.isUserSignedIn()) {
948
- this.contextUpdated = true;
949
- return;
950
- }
951
- this.appcontext.getCurrent((/**
952
- * @param {?} current
953
- * @return {?}
954
- */
955
- function (current) {
956
- _this.isUserSignedIn = current.isUserSignedIn;
957
- if (_this.isUserSignedIn) {
958
- _this.currentPlan = current.account.billingPlan;
959
- _this.currentPlanTitle = current.account.billingPlanAsString;
960
- _this.requestedPlan = current.account.requestedBillingPlan;
961
- _this.requestedPlanTitle = current.account.requestedBillingPlanAsString;
962
- }
963
- _this.contextUpdated = true;
964
- }));
965
- };
966
- SubscribePlanButtonComponent.decorators = [
967
- { type: core.Component, args: [{
968
- selector: 'anatoly-subscribe-plan-button',
969
- 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"
970
- }] }
971
- ];
972
- /** @nocollapse */
973
- SubscribePlanButtonComponent.ctorParameters = function () { return [
974
- { type: AppContextService }
975
- ]; };
976
- SubscribePlanButtonComponent.propDecorators = {
977
- plan: [{ type: core.Input }],
978
- plantitle: [{ type: core.Input }]
979
- };
980
- return SubscribePlanButtonComponent;
981
- }());
982
- if (false) {
983
- /** @type {?} */
984
- SubscribePlanButtonComponent.prototype.contextUpdated;
985
- /** @type {?} */
986
- SubscribePlanButtonComponent.prototype.isUserSignedIn;
987
- /** @type {?} */
988
- SubscribePlanButtonComponent.prototype.currentPlan;
989
- /** @type {?} */
990
- SubscribePlanButtonComponent.prototype.currentPlanTitle;
991
- /** @type {?} */
992
- SubscribePlanButtonComponent.prototype.requestedPlan;
993
- /** @type {?} */
994
- SubscribePlanButtonComponent.prototype.requestedPlanTitle;
995
- /** @type {?} */
996
- SubscribePlanButtonComponent.prototype.plan;
997
- /** @type {?} */
998
- SubscribePlanButtonComponent.prototype.plantitle;
999
- /**
1000
- * @type {?}
1001
- * @private
1002
- */
1003
- SubscribePlanButtonComponent.prototype.appcontext;
1004
- }
1005
-
1006
- /**
1007
- * @fileoverview added by tsickle
1008
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1009
- */
1010
- var BaseBillingApiService = /** @class */ (function (_super) {
1011
- __extends(BaseBillingApiService, _super);
1012
- function BaseBillingApiService(http) {
1013
- var _this = _super.call(this, http) || this;
1014
- _this.http = http;
1015
- _this.baseUrl += 'billing/';
1016
- return _this;
1017
- }
1018
- /**
1019
- * @param {?} requestedPlan
1020
- * @param {?=} success
1021
- * @param {?=} error
1022
- * @return {?}
1023
- */
1024
- BaseBillingApiService.prototype.requestNewSubscription = /**
1025
- * @param {?} requestedPlan
1026
- * @param {?=} success
1027
- * @param {?=} error
1028
- * @return {?}
1029
- */
1030
- function (requestedPlan, success, error) {
1031
- this.postQS('requestNewSubscription', { requestedPlan: requestedPlan })
1032
- .subscribe((/**
1033
- * @param {?} data
1034
- * @return {?}
1035
- */
1036
- function (data) { }), (/**
1037
- * @param {?} e
1038
- * @return {?}
1039
- */
1040
- function (e) { if (error)
1041
- error(); }), (/**
1042
- * @return {?}
1043
- */
1044
- function () { if (success)
1045
- success(); }));
1046
- };
1047
- /**
1048
- * @param {?=} success
1049
- * @param {?=} error
1050
- * @return {?}
1051
- */
1052
- BaseBillingApiService.prototype.cancelRequestedSubscription = /**
1053
- * @param {?=} success
1054
- * @param {?=} error
1055
- * @return {?}
1056
- */
1057
- function (success, error) {
1058
- this.postQS('cancelRequestedSubscription', null)
1059
- .subscribe((/**
1060
- * @param {?} data
1061
- * @return {?}
1062
- */
1063
- function (data) { }), (/**
1064
- * @param {?} e
1065
- * @return {?}
1066
- */
1067
- function (e) { if (error)
1068
- error(); }), (/**
1069
- * @return {?}
1070
- */
1071
- function () { if (success)
1072
- success(); }));
1073
- };
1074
- /**
1075
- * @param {?} requestedPlan
1076
- * @param {?=} success
1077
- * @param {?=} error
1078
- * @return {?}
1079
- */
1080
- BaseBillingApiService.prototype.buyAccess = /**
1081
- * @param {?} requestedPlan
1082
- * @param {?=} success
1083
- * @param {?=} error
1084
- * @return {?}
1085
- */
1086
- function (requestedPlan, success, error) {
1087
- this.postQS('buyAccess', { requestedPlan: requestedPlan })
1088
- .subscribe((/**
1089
- * @param {?} data
1090
- * @return {?}
1091
- */
1092
- function (data) { }), (/**
1093
- * @param {?} e
1094
- * @return {?}
1095
- */
1096
- function (e) { if (error)
1097
- error(); }), (/**
1098
- * @return {?}
1099
- */
1100
- function () { if (success)
1101
- success(); }));
1102
- };
1103
- BaseBillingApiService.decorators = [
1104
- { type: core.Injectable }
1105
- ];
1106
- /** @nocollapse */
1107
- BaseBillingApiService.ctorParameters = function () { return [
1108
- { type: http.HttpClient }
1109
- ]; };
1110
- return BaseBillingApiService;
1111
- }(BaseApiService));
1112
- if (false) {
1113
- /**
1114
- * @type {?}
1115
- * @protected
1116
- */
1117
- BaseBillingApiService.prototype.http;
1118
- }
1119
-
1120
- /**
1121
- * @fileoverview added by tsickle
1122
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1123
- */
1124
- var UpgradePlanButtonComponent = /** @class */ (function () {
1125
- function UpgradePlanButtonComponent(api) {
1126
- this.api = api;
1127
- }
1128
- /**
1129
- * @return {?}
1130
- */
1131
- UpgradePlanButtonComponent.prototype.onUpgradePlan = /**
1132
- * @return {?}
1133
- */
1134
- function () {
1135
- /** @type {?} */
1136
- var text = "Current plan: " + this.currentplantitle + " New plan: " + this.requestedplantitle;
1137
- /** @type {?} */
1138
- var that = this;
1139
- osovitny.ui.areYouSure(text, 'Change billing plan', 'Confirm change', 'Cancel', (/**
1140
- * @return {?}
1141
- */
1142
- function () {
1143
- that.api.requestNewSubscription(that.requestedplan, (/**
1144
- * @return {?}
1145
- */
1146
- function () {
1147
- osovitny.ui.alertSuccess('Your request for changing plan has been sent.', null, (/**
1148
- * @return {?}
1149
- */
1150
- function () {
1151
- ((/** @type {?} */ (window))).location.reload();
1152
- }));
1153
- }));
1154
- }));
1155
- };
1156
- UpgradePlanButtonComponent.decorators = [
1157
- { type: core.Component, args: [{
1158
- selector: 'anatoly-upgrade-plan-button',
1159
- template: "<button class=\"btn btn-block btn-primary\" (click)=\"onUpgradePlan()\">\r\n Upgrade\r\n</button>\r\n"
1160
- }] }
1161
- ];
1162
- /** @nocollapse */
1163
- UpgradePlanButtonComponent.ctorParameters = function () { return [
1164
- { type: BaseBillingApiService }
1165
- ]; };
1166
- UpgradePlanButtonComponent.propDecorators = {
1167
- currentplantitle: [{ type: core.Input }],
1168
- requestedplan: [{ type: core.Input }],
1169
- requestedplantitle: [{ type: core.Input }]
1170
- };
1171
- return UpgradePlanButtonComponent;
1172
- }());
1173
- if (false) {
1174
- /** @type {?} */
1175
- UpgradePlanButtonComponent.prototype.currentplantitle;
1176
- /** @type {?} */
1177
- UpgradePlanButtonComponent.prototype.requestedplan;
1178
- /** @type {?} */
1179
- UpgradePlanButtonComponent.prototype.requestedplantitle;
1180
- /**
1181
- * @type {?}
1182
- * @private
1183
- */
1184
- UpgradePlanButtonComponent.prototype.api;
1185
- }
1186
-
1187
- /**
1188
- * @fileoverview added by tsickle
1189
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1190
- */
1191
- var BuyAccessButtonComponent = /** @class */ (function () {
1192
- function BuyAccessButtonComponent(appcontext, api) {
1193
- this.appcontext = appcontext;
1194
- this.api = api;
1195
- this.contextUpdated = false;
1196
- this.isUserSignedIn = false;
1197
- this.currentPlan = 0;
1198
- this.currentPlanTitle = "";
1199
- }
1200
- /**
1201
- * @return {?}
1202
- */
1203
- BuyAccessButtonComponent.prototype.ngOnInit = /**
1204
- * @return {?}
1205
- */
1206
- function () {
1207
- var _this = this;
1208
- if (!this.appcontext.isUserSignedIn()) {
1209
- this.contextUpdated = true;
1210
- return;
1211
- }
1212
- this.appcontext.getCurrent((/**
1213
- * @param {?} current
1214
- * @return {?}
1215
- */
1216
- function (current) {
1217
- _this.isUserSignedIn = current.isUserSignedIn;
1218
- if (_this.isUserSignedIn) {
1219
- _this.currentPlan = current.account.billingPlan;
1220
- _this.currentPlanTitle = current.account.billingPlanAsString;
1221
- }
1222
- _this.contextUpdated = true;
1223
- }));
1224
- };
1225
- /**
1226
- * @return {?}
1227
- */
1228
- BuyAccessButtonComponent.prototype.onBuyPlan = /**
1229
- * @return {?}
1230
- */
1231
- function () {
1232
- /** @type {?} */
1233
- var text = "Requested plan: " + this.plantitle + " ";
1234
- /** @type {?} */
1235
- var that = this;
1236
- osovitny.ui.areYouSure(text, 'Buying access', 'Confirm change', 'Cancel', (/**
1237
- * @return {?}
1238
- */
1239
- function () {
1240
- that.api.buyAccess(that.plan, (/**
1241
- * @return {?}
1242
- */
1243
- function () {
1244
- osovitny.ui.alertSuccess('Access Granted', null, (/**
1245
- * @return {?}
1246
- */
1247
- function () {
1248
- ((/** @type {?} */ (window))).location.reload();
1249
- }));
1250
- }));
1251
- }));
1252
- };
1253
- BuyAccessButtonComponent.decorators = [
1254
- { type: core.Component, args: [{
1255
- selector: 'anatoly-buyaccess-button',
1256
- 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"
1257
- }] }
1258
- ];
1259
- /** @nocollapse */
1260
- BuyAccessButtonComponent.ctorParameters = function () { return [
1261
- { type: AppContextService },
1262
- { type: BaseBillingApiService }
1263
- ]; };
1264
- BuyAccessButtonComponent.propDecorators = {
1265
- plan: [{ type: core.Input }],
1266
- plantitle: [{ type: core.Input }]
1267
- };
1268
- return BuyAccessButtonComponent;
1269
- }());
1270
- if (false) {
1271
- /** @type {?} */
1272
- BuyAccessButtonComponent.prototype.contextUpdated;
1273
- /** @type {?} */
1274
- BuyAccessButtonComponent.prototype.isUserSignedIn;
1275
- /** @type {?} */
1276
- BuyAccessButtonComponent.prototype.currentPlan;
1277
- /** @type {?} */
1278
- BuyAccessButtonComponent.prototype.currentPlanTitle;
1279
- /** @type {?} */
1280
- BuyAccessButtonComponent.prototype.plan;
1281
- /** @type {?} */
1282
- BuyAccessButtonComponent.prototype.plantitle;
1283
- /**
1284
- * @type {?}
1285
- * @private
1286
- */
1287
- BuyAccessButtonComponent.prototype.appcontext;
1288
- /**
1289
- * @type {?}
1290
- * @private
1291
- */
1292
- BuyAccessButtonComponent.prototype.api;
1293
- }
1294
-
1295
- /**
1296
- * @fileoverview added by tsickle
1297
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1298
- */
1299
- var AnatolyBillingModule = /** @class */ (function () {
1300
- function AnatolyBillingModule() {
1301
- }
1302
- AnatolyBillingModule.decorators = [
1303
- { type: core.NgModule, args: [{
1304
- imports: [
1305
- common.CommonModule,
1306
- http.HttpClientModule,
1307
- http.HttpClientXsrfModule,
1308
- http.HttpClientJsonpModule,
1309
- AnatolyIdentityModule
1310
- ],
1311
- exports: [
1312
- common.CommonModule,
1313
- http.HttpClientModule,
1314
- http.HttpClientXsrfModule,
1315
- http.HttpClientJsonpModule,
1316
- SubscribePlanButtonComponent,
1317
- UpgradePlanButtonComponent,
1318
- BuyAccessButtonComponent
1319
- ],
1320
- declarations: [
1321
- SubscribePlanButtonComponent,
1322
- UpgradePlanButtonComponent,
1323
- BuyAccessButtonComponent
1324
- ],
1325
- providers: [
1326
- BaseBillingApiService
1327
- ]
1328
- },] }
1329
- ];
1330
- return AnatolyBillingModule;
1331
- }());
1332
-
1333
- /**
1334
- * @fileoverview added by tsickle
1335
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1336
- */
1337
-
1338
- /**
1339
- * @fileoverview added by tsickle
1340
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1341
- */
1342
- /*
1343
- <file>
1344
- Authors:
1345
- Vadim Osovitny
1346
-
1347
- Created:
1348
- 28 Aug 2018
1349
-
1350
- Version:
1351
- 1.0
1352
-
1353
- Copyright (c) 2016-2019 Osovitny Inc. All rights reserved.
1354
- </file>
1355
- */
1356
- var BaseComponent = /** @class */ (function () {
1357
- function BaseComponent() {
1358
- }
1359
- /**
1360
- * @return {?}
1361
- */
1362
- BaseComponent.prototype.getQSId = /**
1363
- * @return {?}
1364
- */
1365
- function () {
1366
- /** @type {?} */
1367
- var id = osovitny.utils.getValueByNameInQS("id");
1368
- if (typeof id === 'undefined' || id == '')
1369
- return null;
1370
- return id;
1371
- };
1372
- /**
1373
- * @return {?}
1374
- */
1375
- BaseComponent.prototype.showLoading = /**
1376
- * @return {?}
1377
- */
1378
- function () {
1379
- /** @type {?} */
1380
- var panelLoading = $('#pnlLoading');
1381
- panelLoading.show();
1382
- };
1383
- /**
1384
- * @return {?}
1385
- */
1386
- BaseComponent.prototype.hideLoading = /**
1387
- * @return {?}
1388
- */
1389
- function () {
1390
- /** @type {?} */
1391
- var panelLoading = $('#pnlLoading');
1392
- panelLoading.hide();
1393
- };
1394
- /**
1395
- * @param {?} e
1396
- * @return {?}
1397
- */
1398
- BaseComponent.prototype.handleError = /**
1399
- * @param {?} e
1400
- * @return {?}
1401
- */
1402
- function (e) {
1403
- this.hideLoading();
1404
- osovitny.ui.errorOccurred();
1405
- };
1406
- return BaseComponent;
1407
- }());
1408
-
1409
- /**
1410
- * @fileoverview added by tsickle
1411
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1412
- */
1413
- var BaseEditComponent = /** @class */ (function (_super) {
1414
- __extends(BaseEditComponent, _super);
1415
- function BaseEditComponent() {
1416
- var _this = _super.call(this) || this;
1417
- _this.formSubmitted = false;
1418
- return _this;
1419
- }
1420
- /**
1421
- * @return {?}
1422
- */
1423
- BaseEditComponent.prototype.isActionAdding = /**
1424
- * @return {?}
1425
- */
1426
- function () {
1427
- /** @type {?} */
1428
- var id = osovitny.utils.getValueByNameInQS("id");
1429
- if (typeof id === 'undefined' || id == '')
1430
- return true;
1431
- return false;
1432
- };
1433
- /**
1434
- * @return {?}
1435
- */
1436
- BaseEditComponent.prototype.getEntityId = /**
1437
- * @return {?}
1438
- */
1439
- function () {
1440
- return this.getQSId();
1441
- };
1442
- /**
1443
- * @param {?} name
1444
- * @return {?}
1445
- */
1446
- BaseEditComponent.prototype.isItemInvalid = /**
1447
- * @param {?} name
1448
- * @return {?}
1449
- */
1450
- function (name) {
1451
- if (typeof name === 'undefined' || name == '') {
1452
- return false;
1453
- }
1454
- if (this.formGroup.get(name)) {
1455
- return (this.formSubmitted && this.formGroup.get(name).invalid) ||
1456
- (this.formGroup.get(name).touched && this.formGroup.get(name).invalid);
1457
- }
1458
- return false;
1459
- };
1460
- /**
1461
- * @param {?} name
1462
- * @return {?}
1463
- */
1464
- BaseEditComponent.prototype.getFormValue = /**
1465
- * @param {?} name
1466
- * @return {?}
1467
- */
1468
- function (name) {
1469
- return this.formGroup.controls[name].value;
1470
- };
1471
- /**
1472
- * @param {?} name
1473
- * @param {?} value
1474
- * @return {?}
1475
- */
1476
- BaseEditComponent.prototype.setFormValue = /**
1477
- * @param {?} name
1478
- * @param {?} value
1479
- * @return {?}
1480
- */
1481
- function (name, value) {
1482
- this.formGroup.controls[name].setValue(value);
1483
- };
1484
- /**
1485
- * @param {?} groupName
1486
- * @param {?} name
1487
- * @return {?}
1488
- */
1489
- BaseEditComponent.prototype.getFormGroupValue = /**
1490
- * @param {?} groupName
1491
- * @param {?} name
1492
- * @return {?}
1493
- */
1494
- function (groupName, name) {
1495
- return this.formGroup.controls[groupName].get(name).value;
1496
- };
1497
- /**
1498
- * @param {?} groupName
1499
- * @param {?} name
1500
- * @param {?} value
1501
- * @return {?}
1502
- */
1503
- BaseEditComponent.prototype.setFormGroupValue = /**
1504
- * @param {?} groupName
1505
- * @param {?} name
1506
- * @param {?} value
1507
- * @return {?}
1508
- */
1509
- function (groupName, name, value) {
1510
- this.formGroup.controls[groupName].get(name).setValue(value);
1511
- };
1512
- BaseEditComponent.propDecorators = {
1513
- formGroup: [{ type: core.Input }],
1514
- formSubmitted: [{ type: core.Input }]
1515
- };
1516
- return BaseEditComponent;
1517
- }(BaseComponent));
1518
- if (false) {
1519
- /** @type {?} */
1520
- BaseEditComponent.prototype.formGroup;
1521
- /** @type {?} */
1522
- BaseEditComponent.prototype.formSubmitted;
1523
- }
1524
-
1525
- /**
1526
- * @fileoverview added by tsickle
1527
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1528
- */
1529
- var ValidationSummaryComponent = /** @class */ (function (_super) {
1530
- __extends(ValidationSummaryComponent, _super);
1531
- function ValidationSummaryComponent() {
1532
- return _super.call(this) || this;
1533
- }
1534
- /**
1535
- * @return {?}
1536
- */
1537
- ValidationSummaryComponent.prototype.getFormValidationMessages = /**
1538
- * @return {?}
1539
- */
1540
- function () {
1541
- var _this = this;
1542
- /** @type {?} */
1543
- var messages = [];
1544
- Object.keys(this.formGroup.controls).forEach((/**
1545
- * @param {?} k
1546
- * @return {?}
1547
- */
1548
- function (k) {
1549
- /** @type {?} */
1550
- var control = _this.formGroup.controls[k];
1551
- if (((/** @type {?} */ (control))).controls != null) {
1552
- Object.keys(((/** @type {?} */ (control))).controls).forEach((/**
1553
- * @param {?} k
1554
- * @return {?}
1555
- */
1556
- function (k) {
1557
- /** @type {?} */
1558
- var child = ((/** @type {?} */ (control))).controls[k];
1559
- _this.getValidationMessages(child, k).forEach((/**
1560
- * @param {?} m
1561
- * @return {?}
1562
- */
1563
- function (m) { return messages.push(m); }));
1564
- }));
1565
- }
1566
- else {
1567
- _this.getValidationMessages(control, k).forEach((/**
1568
- * @param {?} m
1569
- * @return {?}
1570
- */
1571
- function (m) { return messages.push(m); }));
1572
- }
1573
- }));
1574
- return messages;
1575
- };
1576
- /**
1577
- * @param {?} state
1578
- * @param {?=} thingName
1579
- * @return {?}
1580
- */
1581
- ValidationSummaryComponent.prototype.getValidationMessages = /**
1582
- * @param {?} state
1583
- * @param {?=} thingName
1584
- * @return {?}
1585
- */
1586
- function (state, thingName) {
1587
- /** @type {?} */
1588
- var thing = state.path || thingName;
1589
- /** @type {?} */
1590
- var messages = [];
1591
- if (state.errors) {
1592
- for (var errorName in state.errors) {
1593
- if (state.errors.hasOwnProperty(errorName)) {
1594
- switch (errorName) {
1595
- case 'required':
1596
- messages.push(thing + " is required");
1597
- break;
1598
- case 'minlength':
1599
- messages.push(thing + " must be at least " + state.errors['minlength'].requiredLength + " characters");
1600
- break;
1601
- case 'pattern':
1602
- messages.push(thing + " contains illegal characters");
1603
- break;
1604
- }
1605
- }
1606
- }
1607
- }
1608
- return messages;
1609
- };
1610
- return ValidationSummaryComponent;
1611
- }(BaseEditComponent));
1612
-
1613
- /**
1614
- * @fileoverview added by tsickle
1615
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1616
- */
1617
- var FormValidationSummaryComponent = /** @class */ (function (_super) {
1618
- __extends(FormValidationSummaryComponent, _super);
1619
- function FormValidationSummaryComponent() {
1620
- var _this = _super.call(this) || this;
1621
- _this.visible = false;
1622
- return _this;
1623
- }
1624
- /**
1625
- * @return {?}
1626
- */
1627
- FormValidationSummaryComponent.prototype.getErrors = /**
1628
- * @return {?}
1629
- */
1630
- function () {
1631
- /** @type {?} */
1632
- var messages = this.getFormValidationMessages();
1633
- return messages;
1634
- };
1635
- FormValidationSummaryComponent.decorators = [
1636
- { type: core.Component, args: [{
1637
- selector: 'anatoly-form-validation-summary',
1638
- 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"
1639
- }] }
1640
- ];
1641
- /** @nocollapse */
1642
- FormValidationSummaryComponent.ctorParameters = function () { return []; };
1643
- FormValidationSummaryComponent.propDecorators = {
1644
- visible: [{ type: core.Input }]
1645
- };
1646
- return FormValidationSummaryComponent;
1647
- }(ValidationSummaryComponent));
1648
- if (false) {
1649
- /** @type {?} */
1650
- FormValidationSummaryComponent.prototype.visible;
1651
- }
1652
-
1653
- /**
1654
- * @fileoverview added by tsickle
1655
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1656
- */
1657
- var ItemValidationSummaryComponent = /** @class */ (function (_super) {
1658
- __extends(ItemValidationSummaryComponent, _super);
1659
- function ItemValidationSummaryComponent() {
1660
- return _super.call(this) || this;
1661
- }
1662
- ItemValidationSummaryComponent.decorators = [
1663
- { type: core.Component, args: [{
1664
- selector: 'anatoly-item-validation-summary',
1665
- 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>"
1666
- }] }
1667
- ];
1668
- /** @nocollapse */
1669
- ItemValidationSummaryComponent.ctorParameters = function () { return []; };
1670
- ItemValidationSummaryComponent.propDecorators = {
1671
- key: [{ type: core.Input }],
1672
- title: [{ type: core.Input }]
1673
- };
1674
- return ItemValidationSummaryComponent;
1675
- }(ValidationSummaryComponent));
1676
- if (false) {
1677
- /** @type {?} */
1678
- ItemValidationSummaryComponent.prototype.key;
1679
- /** @type {?} */
1680
- ItemValidationSummaryComponent.prototype.title;
1681
- }
1682
-
1683
- /**
1684
- * @fileoverview added by tsickle
1685
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1686
- */
1687
- var HtmlEditorComponent = /** @class */ (function (_super) {
1688
- __extends(HtmlEditorComponent, _super);
1689
- function HtmlEditorComponent() {
1690
- var _this = _super !== null && _super.apply(this, arguments) || this;
1691
- _this._defaultEditorOptions = {
1692
- placeholderText: 'Edit Your Content Here',
1693
- charCounterCount: true,
1694
- heightMin: 100,
1695
- toolbarInline: false,
1696
- toolbarButtons: [
1697
- 'fullscreen', 'bold', 'italic', 'underline', 'strikeThrough', 'subscript', 'superscript', '|',
1698
- 'fontFamily', 'fontSize', 'color', 'inlineStyle', 'paragraphStyle', '|',
1699
- 'paragraphFormat', 'align', 'formatOL', 'formatUL', 'outdent', 'indent', 'quote', '-',
1700
- 'insertLink', 'insertImage', 'insertTable', '|',
1701
- 'emoticons', 'specialCharacters', 'insertHR', 'selectAll', 'clearFormatting', '|',
1702
- 'print', 'help', 'html', '|', 'undo', 'redo'
1703
- ],
1704
- /*
1705
- Upload:
1706
- https://www.froala.com/wysiwyg-editor/docs/concepts/image/upload
1707
- */
1708
- imageUploadURL: '/api/HtmlEditor/UploadImage',
1709
- imageAllowedTypes: ['jpeg', 'jpg', 'png'],
1710
- imageUploadParams: { uploadType: '', uploadParentId: '' },
1711
- //Events
1712
- events: {
1713
- 'image.beforeUpload': (/**
1714
- * @param {?} images
1715
- * @return {?}
1716
- */
1717
- function (images) {
1718
- /** @type {?} */
1719
- var editor = this;
1720
- alert("v3 image.beforeUpload editor.opts.imageUploadParams.uploadType" + editor.opts.imageUploadParams.uploadType);
1721
- })
1722
- }
1723
- };
1724
- _this._editorInitialized = false;
1725
- //General params
1726
- _this.editorId = '';
1727
- _this.editorLabelText = 'Html';
1728
- _this.editorOptions = {};
1729
- //Form based params
1730
- _this.isFormBased = '1';
1731
- _this.editorFormKey = 'html';
1732
- return _this;
1733
- }
1734
- /**
1735
- * @return {?}
1736
- */
1737
- HtmlEditorComponent.prototype.ngOnInit = /**
1738
- * @return {?}
1739
- */
1740
- function () {
1741
- /** @type {?} */
1742
- var opt = this.editorOptions;
1743
- if (typeof this.editorOptions == "string") {
1744
- opt = JSON.parse(this.editorOptions);
1745
- }
1746
- /** @type {?} */
1747
- var newOptions = $.extend({}, this._defaultEditorOptions, opt);
1748
- /** @type {?} */
1749
- var key = ((/** @type {?} */ (window))).__froalaEditor_Key;
1750
- if (key) {
1751
- newOptions = $.extend({}, JSON.parse('{ "key": "' + key + '" }'), newOptions);
1752
- }
1753
- this.options = newOptions;
1754
- };
1755
- /**
1756
- * @return {?}
1757
- */
1758
- HtmlEditorComponent.prototype.ngAfterViewInit = /**
1759
- * @return {?}
1760
- */
1761
- function () {
1762
- this.initializeEditor();
1763
- };
1764
- /**
1765
- * @param {?} control
1766
- * @return {?}
1767
- */
1768
- HtmlEditorComponent.prototype.initializeControl = /**
1769
- * @param {?} control
1770
- * @return {?}
1771
- */
1772
- function (control) {
1773
- this._control = control;
1774
- };
1775
- /**
1776
- * @private
1777
- * @return {?}
1778
- */
1779
- HtmlEditorComponent.prototype.initializeEditor = /**
1780
- * @private
1781
- * @return {?}
1782
- */
1783
- function () {
1784
- if (this._editorInitialized) {
1785
- return;
1786
- }
1787
- if (this._control) {
1788
- this._control.initialize();
1789
- //v2 BEGIN
1790
- /** @type {?} */
1791
- var jQueryEditor = this.getJQueryEditor();
1792
- /** @type {?} */
1793
- var that = this;
1794
- jQueryEditor.on('froalaEditor.image.beforeUpload', (/**
1795
- * @param {?} e
1796
- * @param {?} editor
1797
- * @param {?} images
1798
- * @return {?}
1799
- */
1800
- function (e, editor, images) {
1801
- /** @type {?} */
1802
- var options = that.options;
1803
- editor.opts.imageUploadParams.uploadType = options.imageUploadParams.uploadType;
1804
- editor.opts.imageUploadParams.uploadParentId = options.imageUploadParams.uploadParentId;
1805
- }));
1806
- //v2 END
1807
- this._editorInitialized = true;
1808
- }
1809
- };
1810
- /**
1811
- * @private
1812
- * @return {?}
1813
- */
1814
- HtmlEditorComponent.prototype.getJQueryEditor = /**
1815
- * @private
1816
- * @return {?}
1817
- */
1818
- function () {
1819
- /** @type {?} */
1820
- var jQueryEditor = $('.htmleditor-' + this.editorId);
1821
- return jQueryEditor;
1822
- };
1823
- /**
1824
- * @private
1825
- * @return {?}
1826
- */
1827
- HtmlEditorComponent.prototype.getEditor = /**
1828
- * @private
1829
- * @return {?}
1830
- */
1831
- function () {
1832
- if (this._control)
1833
- return this._control.getEditor();
1834
- return null;
1835
- };
1836
- //Public Funcs
1837
- //Public Funcs
1838
- /**
1839
- * @param {?} uploadType
1840
- * @param {?} uploadParentId
1841
- * @return {?}
1842
- */
1843
- HtmlEditorComponent.prototype.setUploadParams =
1844
- //Public Funcs
1845
- /**
1846
- * @param {?} uploadType
1847
- * @param {?} uploadParentId
1848
- * @return {?}
1849
- */
1850
- function (uploadType, uploadParentId) {
1851
- /** @type {?} */
1852
- var that = this;
1853
- /** @type {?} */
1854
- var timeOut = 1000;
1855
- if (this._editorInitialized) {
1856
- timeOut = 0;
1857
- }
1858
- setTimeout((/**
1859
- * @return {?}
1860
- */
1861
- function () {
1862
- /** @type {?} */
1863
- var newOptions = { imageUploadParams: { uploadType: '', uploadParentId: '' } };
1864
- newOptions.imageUploadParams.uploadType = uploadType;
1865
- newOptions.imageUploadParams.uploadParentId = uploadParentId;
1866
- that.options = $.extend({}, that.options, newOptions);
1867
- }), timeOut);
1868
- };
1869
- /**
1870
- * @param {?} content
1871
- * @return {?}
1872
- */
1873
- HtmlEditorComponent.prototype.setHtml = /**
1874
- * @param {?} content
1875
- * @return {?}
1876
- */
1877
- function (content) {
1878
- if (this.isFormBased == "1") {
1879
- return;
1880
- }
1881
- this.initializeEditor();
1882
- //v2
1883
- /** @type {?} */
1884
- var editor = this.getJQueryEditor();
1885
- if (typeof (editor) == "undefined" || editor == null) {
1886
- return;
1887
- }
1888
- editor.froalaEditor('html.set', content);
1889
- /*
1890
- //v3
1891
- var editor = this.getEditor();
1892
- if (typeof (editor) == "undefined" || editor == null) {
1893
- return;
1894
- }
1895
-
1896
- editor.html.set(content);
1897
- */
1898
- };
1899
- /**
1900
- * @return {?}
1901
- */
1902
- HtmlEditorComponent.prototype.getHtml = /**
1903
- * @return {?}
1904
- */
1905
- function () {
1906
- if (this.isFormBased == "1") {
1907
- return;
1908
- }
1909
- //v2
1910
- /** @type {?} */
1911
- var editor = this.getJQueryEditor();
1912
- if (typeof (editor) == "undefined" || editor == null) {
1913
- return "";
1914
- }
1915
- return editor.froalaEditor('html.get');
1916
- /*
1917
- //v3
1918
- var editor = this.getEditor();
1919
- if (typeof (editor) == "undefined" || editor == null) {
1920
- return "";
1921
- }
1922
-
1923
- return editor.html.get(false);
1924
- */
1925
- };
1926
- HtmlEditorComponent.decorators = [
1927
- { type: core.Component, args: [{
1928
- selector: 'anatoly-html-editor',
1929
- template: "<div [ngSwitch]=\"isFormBased\">\r\n <ng-template ngSwitchCase=\"0\">\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 </ng-template>\r\n\r\n <ng-template ngSwitchCase=\"1\">\r\n <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 </ng-template>\r\n</div>\r\n"
1930
- }] }
1931
- ];
1932
- HtmlEditorComponent.propDecorators = {
1933
- editorId: [{ type: core.Input }],
1934
- editorLabelText: [{ type: core.Input }],
1935
- editorOptions: [{ type: core.Input }],
1936
- isFormBased: [{ type: core.Input }],
1937
- editorFormKey: [{ type: core.Input }]
1938
- };
1939
- return HtmlEditorComponent;
1940
- }(BaseEditComponent));
1941
- if (false) {
1942
- /**
1943
- * @type {?}
1944
- * @private
1945
- */
1946
- HtmlEditorComponent.prototype._defaultEditorOptions;
1947
- /**
1948
- * @type {?}
1949
- * @private
1950
- */
1951
- HtmlEditorComponent.prototype._control;
1952
- /**
1953
- * @type {?}
1954
- * @private
1955
- */
1956
- HtmlEditorComponent.prototype._editorInitialized;
1957
- /** @type {?} */
1958
- HtmlEditorComponent.prototype.options;
1959
- /** @type {?} */
1960
- HtmlEditorComponent.prototype.editorId;
1961
- /** @type {?} */
1962
- HtmlEditorComponent.prototype.editorLabelText;
1963
- /** @type {?} */
1964
- HtmlEditorComponent.prototype.editorOptions;
1965
- /** @type {?} */
1966
- HtmlEditorComponent.prototype.isFormBased;
1967
- /** @type {?} */
1968
- HtmlEditorComponent.prototype.editorFormKey;
1969
- }
1970
-
1971
- /**
1972
- * @fileoverview added by tsickle
1973
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1974
- */
1975
- var ContentHeaderComponent = /** @class */ (function () {
1976
- function ContentHeaderComponent() {
1977
- }
1978
- /**
1979
- * @return {?}
1980
- */
1981
- ContentHeaderComponent.prototype.ngOnInit = /**
1982
- * @return {?}
1983
- */
1984
- function () {
1985
- if (this.title == null) {
1986
- this.title = '';
1987
- }
1988
- };
1989
- ContentHeaderComponent.decorators = [
1990
- { type: core.Component, args: [{
1991
- selector: 'anatoly-content-header',
1992
- template: "<h2 class=\"page-header\">\r\n {{title}}\r\n <!--<small>Optional {{title}}</small>-->\r\n</h2>\r\n"
1993
- }] }
1994
- ];
1995
- ContentHeaderComponent.propDecorators = {
1996
- title: [{ type: core.Input }]
1997
- };
1998
- return ContentHeaderComponent;
1999
- }());
2000
- if (false) {
2001
- /** @type {?} */
2002
- ContentHeaderComponent.prototype.title;
2003
- }
2004
-
2005
- /**
2006
- * @fileoverview added by tsickle
2007
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
2008
- */
2009
- var AnatolyUIModule = /** @class */ (function () {
2010
- function AnatolyUIModule() {
2011
- }
2012
- AnatolyUIModule.decorators = [
2013
- { type: core.NgModule, args: [{
2014
- imports: [
2015
- common.CommonModule,
2016
- forms.ReactiveFormsModule,
2017
- forms.FormsModule,
2018
- http.HttpClientModule,
2019
- http.HttpClientXsrfModule,
2020
- http.HttpClientJsonpModule,
2021
- angularFroalaWysiwyg.FroalaEditorModule.forRoot(),
2022
- angularFroalaWysiwyg.FroalaViewModule.forRoot(),
2023
- kendoAngularGrid.GridModule,
2024
- kendoAngularPopup.PopupModule,
2025
- kendoAngularButtons.ButtonsModule,
2026
- kendoAngularDropdowns.DropDownsModule
2027
- ],
2028
- exports: [
2029
- common.CommonModule,
2030
- http.HttpClientModule,
2031
- http.HttpClientXsrfModule,
2032
- http.HttpClientJsonpModule,
2033
- ItemValidationSummaryComponent,
2034
- FormValidationSummaryComponent,
2035
- HtmlEditorComponent,
2036
- ContentHeaderComponent
2037
- ],
2038
- declarations: [
2039
- ItemValidationSummaryComponent,
2040
- FormValidationSummaryComponent,
2041
- HtmlEditorComponent,
2042
- ContentHeaderComponent
2043
- ],
2044
- providers: []
2045
- },] }
2046
- ];
2047
- return AnatolyUIModule;
2048
- }());
2049
-
2050
- exports.AnatolyBillingModule = AnatolyBillingModule;
2051
- exports.AnatolyCoreModule = AnatolyCoreModule;
2052
- exports.AnatolyIdentityModule = AnatolyIdentityModule;
2053
- exports.AnatolyUIModule = AnatolyUIModule;
2054
- exports.AppContextService = AppContextService;
2055
- exports.BaseApiService = BaseApiService;
2056
- exports.BaseComponent = BaseComponent;
2057
- exports.BaseEditComponent = BaseEditComponent;
2058
- exports.BaseGoService = BaseGoService;
2059
- exports.BaseGridEditService = BaseGridEditService;
2060
- exports.HtmlEditorComponent = HtmlEditorComponent;
2061
-
2062
- Object.defineProperty(exports, '__esModule', { value: true });
2063
-
2064
- }));
2065
- //# sourceMappingURL=osovitny-anatoly.umd.js.map