@osovitny/anatoly 1.2.5 → 1.2.6

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.
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/router'), require('@angular/common/http'), require('rxjs/operators'), require('sweetalert2'), require('@angular/common'), require('@angular/forms'), require('angular-froala-wysiwyg'), require('@progress/kendo-angular-grid'), require('@progress/kendo-angular-popup'), require('@progress/kendo-angular-buttons'), require('@progress/kendo-angular-dropdowns'), require('rxjs')) :
3
- typeof define === 'function' && define.amd ? define('@osovitny/anatoly', ['exports', '@angular/core', '@angular/router', '@angular/common/http', 'rxjs/operators', 'sweetalert2', '@angular/common', '@angular/forms', 'angular-froala-wysiwyg', '@progress/kendo-angular-grid', '@progress/kendo-angular-popup', '@progress/kendo-angular-buttons', '@progress/kendo-angular-dropdowns', 'rxjs'], factory) :
4
- (global = global || self, factory((global.osovitny = global.osovitny || {}, global.osovitny.anatoly = {}), global.ng.core, global.ng.router, global.ng.common.http, global.rxjs.operators, global.Swal, global.ng.common, global.ng.forms, global.angularFroalaWysiwyg, global.kendoAngularGrid, global.kendoAngularPopup, global.kendoAngularButtons, global.kendoAngularDropdowns, global.rxjs));
5
- }(this, (function (exports, core, router, http, operators, Swal, common, forms, angularFroalaWysiwyg, kendoAngularGrid, kendoAngularPopup, kendoAngularButtons, kendoAngularDropdowns, rxjs) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('sweetalert2'), require('@angular/core'), require('@angular/router'), require('@angular/common/http'), require('rxjs/operators'), require('@angular/common'), require('@angular/forms'), require('angular-froala-wysiwyg'), require('@progress/kendo-angular-grid'), require('@progress/kendo-angular-popup'), require('@progress/kendo-angular-buttons'), require('@progress/kendo-angular-dropdowns'), require('rxjs')) :
3
+ typeof define === 'function' && define.amd ? define('@osovitny/anatoly', ['exports', 'sweetalert2', '@angular/core', '@angular/router', '@angular/common/http', 'rxjs/operators', '@angular/common', '@angular/forms', 'angular-froala-wysiwyg', '@progress/kendo-angular-grid', '@progress/kendo-angular-popup', '@progress/kendo-angular-buttons', '@progress/kendo-angular-dropdowns', 'rxjs'], factory) :
4
+ (global = global || self, factory((global.osovitny = global.osovitny || {}, global.osovitny.anatoly = {}), global.Swal, global.ng.core, global.ng.router, global.ng.common.http, global.rxjs.operators, global.ng.common, global.ng.forms, global.angularFroalaWysiwyg, global.kendoAngularGrid, global.kendoAngularPopup, global.kendoAngularButtons, global.kendoAngularDropdowns, global.rxjs));
5
+ }(this, (function (exports, Swal, core, router, http, operators, common, forms, angularFroalaWysiwyg, kendoAngularGrid, kendoAngularPopup, kendoAngularButtons, kendoAngularDropdowns, rxjs) { 'use strict';
6
6
 
7
7
  Swal = Swal && Swal.hasOwnProperty('default') ? Swal['default'] : Swal;
8
8
 
@@ -203,6 +203,132 @@
203
203
  return (mod && mod.__esModule) ? mod : { default: mod };
204
204
  }
205
205
 
206
+ /*
207
+ <file>
208
+ Authors:
209
+ Vadim Osovitny
210
+
211
+ Created:
212
+ 4 Mar 2020
213
+
214
+ Version:
215
+ 1.0
216
+
217
+ Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
218
+ </file>
219
+ */
220
+ var Alerts = /** @class */ (function () {
221
+ function Alerts() {
222
+ }
223
+ Alerts.Info = function (text) {
224
+ Swal.fire({
225
+ title: "Info!",
226
+ text: text,
227
+ icon: "info",
228
+ confirmButtonText: "OK"
229
+ });
230
+ };
231
+ Alerts.Warning = function (text) {
232
+ Swal.fire({
233
+ title: "warning!",
234
+ text: text,
235
+ icon: "warning",
236
+ confirmButtonText: "OK"
237
+ });
238
+ };
239
+ Alerts.Error = function (text) {
240
+ Swal.fire({
241
+ title: "error!",
242
+ text: text,
243
+ icon: "error",
244
+ confirmButtonText: "OK"
245
+ });
246
+ };
247
+ Alerts.NotImplemented = function () {
248
+ this.Warning("Not Implemented Yet");
249
+ };
250
+ ;
251
+ Alerts.ErrorOccurred = function () {
252
+ this.Error("Sorry, an unexpected error occurred");
253
+ };
254
+ ;
255
+ Alerts.AreYouSure = function (text, title, confirmButtonText, cancelButtonText, successAction, cancelAction) {
256
+ if (typeof title == "undefined" || title == null)
257
+ title = "Are you sure?";
258
+ Swal.fire({
259
+ title: title,
260
+ text: text,
261
+ icon: 'warning',
262
+ confirmButtonText: confirmButtonText,
263
+ cancelButtonText: cancelButtonText,
264
+ showCancelButton: true
265
+ })
266
+ .then(function (result) {
267
+ if (result.value) {
268
+ if (successAction) {
269
+ successAction();
270
+ }
271
+ }
272
+ // result.dismiss can be 'cancel', 'overlay', 'close', and 'timer'
273
+ else if (result.dismiss == Swal.DismissReason.cancel || result.dismiss == Swal.DismissReason.close) {
274
+ if (cancelAction) {
275
+ cancelAction();
276
+ }
277
+ }
278
+ });
279
+ };
280
+ ;
281
+ Alerts.Success = function (text, title, successAction) {
282
+ if (typeof title == "undefined" || title == null)
283
+ title = "Success!";
284
+ Swal.fire({
285
+ title: title,
286
+ text: text,
287
+ icon: "success",
288
+ confirmButtonText: "OK"
289
+ })
290
+ .then(function () {
291
+ if (successAction) {
292
+ successAction();
293
+ }
294
+ });
295
+ };
296
+ ;
297
+ Alerts.Cancel = function (text) {
298
+ Swal.fire('Cancelled', text, 'error');
299
+ };
300
+ ;
301
+ return Alerts;
302
+ }());
303
+
304
+ /*
305
+ <file>
306
+ Authors:
307
+ Vadim Osovitny
308
+
309
+ Created:
310
+ 4 Mar 2020
311
+
312
+ Version:
313
+ 1.0
314
+
315
+ Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
316
+ </file>
317
+ */
318
+ var Utils = /** @class */ (function () {
319
+ function Utils() {
320
+ }
321
+ Utils.GetValueByNameInQS = function (name) {
322
+ return Utils.GetValueByName(location.search, name);
323
+ };
324
+ Utils.GetValueByName = function (url, name) {
325
+ name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
326
+ var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"), results = regex.exec(url);
327
+ return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
328
+ };
329
+ return Utils;
330
+ }());
331
+
206
332
  /*
207
333
  <file>
208
334
  Authors:
@@ -394,132 +520,6 @@
394
520
  return AppContextService;
395
521
  }(BaseApiService));
396
522
 
397
- /*
398
- <file>
399
- Authors:
400
- Vadim Osovitny
401
-
402
- Created:
403
- 4 Mar 2020
404
-
405
- Version:
406
- 1.0
407
-
408
- Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
409
- </file>
410
- */
411
- var Alerts = /** @class */ (function () {
412
- function Alerts() {
413
- }
414
- Alerts.Info = function (text) {
415
- Swal.fire({
416
- title: "Info!",
417
- text: text,
418
- icon: "info",
419
- confirmButtonText: "OK"
420
- });
421
- };
422
- Alerts.Warning = function (text) {
423
- Swal.fire({
424
- title: "warning!",
425
- text: text,
426
- icon: "warning",
427
- confirmButtonText: "OK"
428
- });
429
- };
430
- Alerts.Error = function (text) {
431
- Swal.fire({
432
- title: "error!",
433
- text: text,
434
- icon: "error",
435
- confirmButtonText: "OK"
436
- });
437
- };
438
- Alerts.NotImplemented = function () {
439
- this.Warning("Not Implemented Yet");
440
- };
441
- ;
442
- Alerts.ErrorOccurred = function () {
443
- this.Error("Sorry, an unexpected error occurred");
444
- };
445
- ;
446
- Alerts.AreYouSure = function (text, title, confirmButtonText, cancelButtonText, successAction, cancelAction) {
447
- if (typeof title == "undefined" || title == null)
448
- title = "Are you sure?";
449
- Swal.fire({
450
- title: title,
451
- text: text,
452
- icon: 'warning',
453
- confirmButtonText: confirmButtonText,
454
- cancelButtonText: cancelButtonText,
455
- showCancelButton: true
456
- })
457
- .then(function (result) {
458
- if (result.value) {
459
- if (successAction) {
460
- successAction();
461
- }
462
- }
463
- // result.dismiss can be 'cancel', 'overlay', 'close', and 'timer'
464
- else if (result.dismiss == Swal.DismissReason.cancel || result.dismiss == Swal.DismissReason.close) {
465
- if (cancelAction) {
466
- cancelAction();
467
- }
468
- }
469
- });
470
- };
471
- ;
472
- Alerts.AlertSuccess = function (text, title, successAction) {
473
- if (typeof title == "undefined" || title == null)
474
- title = "Success!";
475
- Swal.fire({
476
- title: title,
477
- text: text,
478
- icon: "success",
479
- confirmButtonText: "OK"
480
- })
481
- .then(function () {
482
- if (successAction) {
483
- successAction();
484
- }
485
- });
486
- };
487
- ;
488
- Alerts.AlertCancel = function (text) {
489
- Swal.fire('Cancelled', text, 'error');
490
- };
491
- ;
492
- return Alerts;
493
- }());
494
-
495
- /*
496
- <file>
497
- Authors:
498
- Vadim Osovitny
499
-
500
- Created:
501
- 4 Mar 2020
502
-
503
- Version:
504
- 1.0
505
-
506
- Copyright (c) 2016-2020 Osovitny Inc. All rights reserved.
507
- </file>
508
- */
509
- var Utils = /** @class */ (function () {
510
- function Utils() {
511
- }
512
- Utils.GetValueByNameInQS = function (name) {
513
- return Utils.GetValueByName(location.search, name);
514
- };
515
- Utils.GetValueByName = function (url, name) {
516
- name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
517
- var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"), results = regex.exec(url);
518
- return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
519
- };
520
- return Utils;
521
- }());
522
-
523
523
  /*
524
524
  <file>
525
525
  Authors:
@@ -1049,8 +1049,6 @@
1049
1049
  return AnatolyCoreModule;
1050
1050
  }());
1051
1051
 
1052
- // Services
1053
-
1054
1052
  /*
1055
1053
  <file>
1056
1054
  Authors:
@@ -1143,7 +1141,7 @@
1143
1141
  var that = this;
1144
1142
  Alerts.AreYouSure(text, 'Buying access', 'Confirm change', 'Cancel', function () {
1145
1143
  that.api.buyAccess(that.plan, function () {
1146
- Alerts.AlertSuccess('Access Granted', null, function () {
1144
+ Alerts.Success('Access Granted', null, function () {
1147
1145
  window.location.reload();
1148
1146
  });
1149
1147
  });
@@ -1250,7 +1248,7 @@
1250
1248
  var that = this;
1251
1249
  Alerts.AreYouSure(text, 'Change billing plan', 'Confirm change', 'Cancel', function () {
1252
1250
  that.api.requestNewSubscription(that.requestedplan, function () {
1253
- Alerts.AlertSuccess('Your request for changing plan has been sent.', null, function () {
1251
+ Alerts.Success('Your request for changing plan has been sent.', null, function () {
1254
1252
  window.location.reload();
1255
1253
  });
1256
1254
  });
@@ -1587,6 +1585,7 @@
1587
1585
  return AnatolyDataModule;
1588
1586
  }());
1589
1587
 
1588
+ exports.Alerts = Alerts;
1590
1589
  exports.AnatolyBillingModule = AnatolyBillingModule;
1591
1590
  exports.AnatolyCoreModule = AnatolyCoreModule;
1592
1591
  exports.AnatolyDataModule = AnatolyDataModule;
@@ -1610,6 +1609,7 @@
1610
1609
  exports.SignUpButtonComponent = SignUpButtonComponent;
1611
1610
  exports.SubscribePlanButtonComponent = SubscribePlanButtonComponent;
1612
1611
  exports.UpgradePlanButtonComponent = UpgradePlanButtonComponent;
1612
+ exports.Utils = Utils;
1613
1613
  exports.ValidationSummaryComponent = ValidationSummaryComponent;
1614
1614
 
1615
1615
  Object.defineProperty(exports, '__esModule', { value: true });