@osovitny/anatoly 1.2.13 → 2.0.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.
@@ -4,7 +4,7 @@
4
4
  (global = global || self, factory((global.osovitny = global.osovitny || {}, global.osovitny.anatoly = {}), global.Swal, global.ng.core, global.ng.router, global.ng.common.http, global.rxjs.operators, global.ng.common, global.ng.forms, global.angularFroalaWysiwyg, global.kendoAngularGrid, global.kendoAngularPopup, global.kendoAngularButtons, global.kendoAngularDropdowns, global.rxjs));
5
5
  }(this, (function (exports, Swal, core, router, http, operators, common, forms, angularFroalaWysiwyg, kendoAngularGrid, kendoAngularPopup, kendoAngularButtons, kendoAngularDropdowns, rxjs) { 'use strict';
6
6
 
7
- Swal = Swal && Swal.hasOwnProperty('default') ? Swal['default'] : Swal;
7
+ Swal = Swal && Object.prototype.hasOwnProperty.call(Swal, 'default') ? Swal['default'] : Swal;
8
8
 
9
9
  /*! *****************************************************************************
10
10
  Copyright (c) Microsoft Corporation. All rights reserved.
@@ -74,10 +74,11 @@
74
74
  }
75
75
 
76
76
  function __awaiter(thisArg, _arguments, P, generator) {
77
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
77
78
  return new (P || (P = Promise))(function (resolve, reject) {
78
79
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
79
80
  function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
80
- function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
81
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
81
82
  step((generator = generator.apply(thisArg, _arguments || [])).next());
82
83
  });
83
84
  }
@@ -115,14 +116,15 @@
115
116
  }
116
117
 
117
118
  function __values(o) {
118
- var m = typeof Symbol === "function" && o[Symbol.iterator], i = 0;
119
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
119
120
  if (m) return m.call(o);
120
- return {
121
+ if (o && typeof o.length === "number") return {
121
122
  next: function () {
122
123
  if (o && i >= o.length) o = void 0;
123
124
  return { value: o && o[i++], done: !o };
124
125
  }
125
126
  };
127
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
126
128
  }
127
129
 
128
130
  function __read(o, n) {
@@ -201,6 +203,21 @@
201
203
 
202
204
  function __importDefault(mod) {
203
205
  return (mod && mod.__esModule) ? mod : { default: mod };
206
+ }
207
+
208
+ function __classPrivateFieldGet(receiver, privateMap) {
209
+ if (!privateMap.has(receiver)) {
210
+ throw new TypeError("attempted to get private field on non-instance");
211
+ }
212
+ return privateMap.get(receiver);
213
+ }
214
+
215
+ function __classPrivateFieldSet(receiver, privateMap, value) {
216
+ if (!privateMap.has(receiver)) {
217
+ throw new TypeError("attempted to set private field on non-instance");
218
+ }
219
+ privateMap.set(receiver, value);
220
+ return value;
204
221
  }
205
222
 
206
223
  /*
@@ -307,9 +324,12 @@
307
324
  });
308
325
  };
309
326
  //Notifications
310
- Alerts.NotificationCancel = function (text) {
327
+ Alerts.NotificationCancel = function (text, title) {
328
+ if (typeof title == "undefined" || title == null) {
329
+ title = "Canceled";
330
+ }
311
331
  if (!text) {
312
- text = "Operation has been cancled";
332
+ text = "Operation has been canceled";
313
333
  }
314
334
  var toast = Swal.mixin({
315
335
  toast: true,
@@ -319,14 +339,15 @@
319
339
  timerProgressBar: true
320
340
  });
321
341
  toast.fire({
322
- title: 'Cancelled',
342
+ title: title,
323
343
  text: text,
324
344
  icon: "info"
325
345
  });
326
346
  };
327
347
  Alerts.NotificationSuccess = function (text, title) {
328
- if (typeof title == "undefined" || title == null)
348
+ if (typeof title == "undefined" || title == null) {
329
349
  title = "Success";
350
+ }
330
351
  if (!text) {
331
352
  text = "Operation was successful";
332
353
  }
@@ -430,9 +451,12 @@
430
451
  return data ? ('?' + $.param(data)) : '';
431
452
  };
432
453
  //api
433
- BaseApiService.prototype.get = function (action, data) {
454
+ BaseApiService.prototype.get = function (action, data, responseType) {
455
+ if (!responseType) {
456
+ responseType = 'json';
457
+ }
434
458
  var url = this.baseUrl + "/" + action + this.serializeParams(data);
435
- return this.http.get(url).pipe(operators.map(function (res) { return res; }));
459
+ return this.http.get(url, { responseType: responseType }).pipe(operators.map(function (res) { return res; }));
436
460
  };
437
461
  BaseApiService.prototype.post = function (action, data, responseType) {
438
462
  if (!responseType) {
@@ -1060,6 +1084,9 @@
1060
1084
  Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
1061
1085
  </file>
1062
1086
  */
1087
+ //Froala
1088
+ var FroalaEditorModuleWithProviders = angularFroalaWysiwyg.FroalaEditorModule.forRoot();
1089
+ var FroalaViewModuleWithProviders = angularFroalaWysiwyg.FroalaViewModule.forRoot();
1063
1090
  var AnatolyCoreModule = /** @class */ (function () {
1064
1091
  function AnatolyCoreModule() {
1065
1092
  }
@@ -1072,18 +1099,16 @@
1072
1099
  http.HttpClientModule,
1073
1100
  http.HttpClientXsrfModule,
1074
1101
  http.HttpClientJsonpModule,
1075
- angularFroalaWysiwyg.FroalaEditorModule.forRoot(),
1076
- angularFroalaWysiwyg.FroalaViewModule.forRoot(),
1102
+ //FroalaEditorModule.forRoot(),
1103
+ //FroalaViewModule.forRoot(),
1104
+ FroalaEditorModuleWithProviders,
1105
+ FroalaViewModuleWithProviders,
1077
1106
  kendoAngularGrid.GridModule,
1078
1107
  kendoAngularPopup.PopupModule,
1079
1108
  kendoAngularButtons.ButtonsModule,
1080
1109
  kendoAngularDropdowns.DropDownsModule
1081
1110
  ],
1082
1111
  exports: [
1083
- common.CommonModule,
1084
- http.HttpClientModule,
1085
- http.HttpClientXsrfModule,
1086
- http.HttpClientJsonpModule,
1087
1112
  ItemValidationSummaryComponent,
1088
1113
  FormValidationSummaryComponent,
1089
1114
  ContentHeaderComponent,
@@ -1100,10 +1125,7 @@
1100
1125
  providers: [
1101
1126
  AppContextService
1102
1127
  ],
1103
- schemas: [
1104
- core.CUSTOM_ELEMENTS_SCHEMA,
1105
- core.NO_ERRORS_SCHEMA
1106
- ]
1128
+ schemas: []
1107
1129
  })
1108
1130
  ], AnatolyCoreModule);
1109
1131
  return AnatolyCoreModule;
@@ -1162,6 +1184,7 @@
1162
1184
  <file>
1163
1185
  Authors:
1164
1186
  Vadim Osovitny
1187
+ Anatoly Osovitny
1165
1188
 
1166
1189
  Created:
1167
1190
  14 Aug 2018
@@ -1199,9 +1222,9 @@
1199
1222
  BuyAccessButtonComponent.prototype.onBuyPlan = function () {
1200
1223
  var text = "Requested plan: " + this.plantitle + " ";
1201
1224
  var that = this;
1202
- Alerts.AreYouSure(text, 'Buying access', 'Confirm change', 'Cancel', function () {
1225
+ Alerts.AreYouSure(text, "Buying access", "Confirm change", "Cancel", function () {
1203
1226
  that.api.buyAccess(that.plan, function () {
1204
- Alerts.Success('Access Granted', null, function () {
1227
+ Alerts.Success("Access Granted", null, function () {
1205
1228
  window.location.reload();
1206
1229
  });
1207
1230
  });
@@ -1219,7 +1242,7 @@
1219
1242
  ], BuyAccessButtonComponent.prototype, "plantitle", void 0);
1220
1243
  BuyAccessButtonComponent = __decorate([
1221
1244
  core.Component({
1222
- selector: 'anatoly-buyaccess-button',
1245
+ selector: "anatoly-buyaccess-button",
1223
1246
  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"
1224
1247
  })
1225
1248
  ], BuyAccessButtonComponent);