@osovitny/anatoly 3.16.14 → 3.16.16

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 (27) hide show
  1. package/esm2022/lib/core/interceptors/httpInterceptor.mjs +4 -4
  2. package/esm2022/lib/core/localization/localization.service.mjs +15 -8
  3. package/esm2022/lib/core/localization/localize.pipe.mjs +4 -3
  4. package/esm2022/lib/core/localization/utils.mjs +2 -2
  5. package/esm2022/lib/core/logging/globalErrorHandler.mjs +3 -3
  6. package/esm2022/lib/core/logging/logging.service.mjs +2 -2
  7. package/esm2022/lib/core/services/dm.service.mjs +3 -3
  8. package/esm2022/lib/core/services/google-analytics.service.mjs +2 -2
  9. package/esm2022/lib/ui/components/base/base.component.mjs +8 -4
  10. package/esm2022/lib/ui/components/billing/buyaccess-button.component.mjs +2 -2
  11. package/esm2022/lib/ui/components/billing/subscribe-plan-button.component.mjs +3 -3
  12. package/esm2022/lib/ui/components/html-editor/base-html-editor.component.mjs +3 -3
  13. package/esm2022/lib/ui/components/spinners/loading/loading.component.mjs +7 -12
  14. package/esm2022/lib/ui/components/spinners/pagespinner/pagespinner.component.mjs +2 -2
  15. package/esm2022/lib/ui/forms/components/urlslug/urlslug.component.mjs +1 -1
  16. package/esm2022/lib/ui/pipes/filesize.pipe.mjs +2 -2
  17. package/esm2022/lib/ui/pipes/replace-text.pipe.mjs +2 -2
  18. package/esm2022/lib/ui/pipes/safeHtml.pipe.mjs +2 -2
  19. package/esm2022/lib/ui/validation/form-validation-summary.component.mjs +3 -3
  20. package/esm2022/lib/ui/validation/item-validation-summary.component.mjs +4 -4
  21. package/esm2022/lib/ui/validation/validation-summary.component.mjs +3 -3
  22. package/fesm2022/osovitny-anatoly.mjs +131 -125
  23. package/fesm2022/osovitny-anatoly.mjs.map +1 -1
  24. package/lib/core/localization/localization.service.d.ts +8 -5
  25. package/lib/ui/components/base/base.component.d.ts +2 -1
  26. package/lib/ui/components/spinners/loading/loading.component.d.ts +3 -4
  27. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
1
  import js_beautify from 'js-beautify';
2
2
  import * as i0 from '@angular/core';
3
- import { Injectable, Pipe, APP_INITIALIZER, Injector, NgModule, Inject, Component, Input, EventEmitter, Output, ViewEncapsulation, Directive, ViewChild, HostBinding, HostListener, Optional, SkipSelf } from '@angular/core';
3
+ import { Injectable, EventEmitter, Output, Pipe, APP_INITIALIZER, Injector, NgModule, Inject, Component, Input, ViewEncapsulation, Directive, ViewChild, HostBinding, HostListener, Optional, SkipSelf } from '@angular/core';
4
4
  import * as i1 from '@angular/router';
5
5
  import { NavigationEnd, NavigationStart, NavigationCancel, NavigationError, RouterModule } from '@angular/router';
6
6
  import * as i1$3 from '@angular/common/http';
@@ -350,7 +350,7 @@ class LoadingService extends BehaviorSubject {
350
350
  Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
351
351
  </file>
352
352
  */
353
- // Node
353
+ //Node
354
354
  class LoggingService {
355
355
  constructor() { }
356
356
  logError(error) {
@@ -380,11 +380,11 @@ class LoggingService {
380
380
 
381
381
  Created:
382
382
  25 March 2020
383
-
383
+
384
384
  Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
385
385
  </file>
386
386
  */
387
- // Node
387
+ //Node
388
388
  class AnatolyHttpInterceptor {
389
389
  loadingService;
390
390
  loggingService;
@@ -467,6 +467,36 @@ class AnatolyHttpInterceptor {
467
467
  type: Injectable
468
468
  }], function () { return [{ type: LoadingService }, { type: LoggingService }]; }, null); })();
469
469
 
470
+ /*
471
+ <file>
472
+ Project:
473
+ @osovitny/anatoly
474
+
475
+ Authors:
476
+ Vadim Osovitny vadim@osovitny.com
477
+ Anatoly Osovitny anatoly@osovitny.com
478
+
479
+ Created:
480
+ 26 Jun 2020
481
+
482
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
483
+ </file>
484
+ */
485
+ class Subs {
486
+ subs = [];
487
+ constructor() { }
488
+ add(...subscriptions) {
489
+ this.subs = this.subs.concat(subscriptions);
490
+ }
491
+ set sink(subscription) {
492
+ this.subs.push(subscription);
493
+ }
494
+ unsubscribe() {
495
+ this.subs.forEach((sub) => sub && sub.unsubscribe());
496
+ this.subs = [];
497
+ }
498
+ }
499
+
470
500
  /*
471
501
  <file>
472
502
  Project:
@@ -485,17 +515,21 @@ class AnatolyHttpInterceptor {
485
515
  //Node
486
516
  class LocalizationService {
487
517
  translate;
518
+ subs = new Subs();
488
519
  dateFnsLocale;
489
520
  //i10n
490
521
  supportedLanguages = ['en', 'ru', 'es'];
491
522
  defaultLanguage = 'en';
492
- //Events
493
- onLangChange = null;
523
+ //Outputs
524
+ langchange = new EventEmitter();
494
525
  constructor(translate) {
495
526
  this.translate = translate;
496
527
  this.setSupportedLanguages(this.supportedLanguages);
497
528
  this.setDefaultLanguage(this.defaultLanguage);
498
529
  }
530
+ ngOnDestroy() {
531
+ this.subs.unsubscribe();
532
+ }
499
533
  format(str, args) {
500
534
  return str.replace(/{(\d+)}/g, function (match, number) {
501
535
  return typeof args[number] != 'undefined'
@@ -510,9 +544,9 @@ class LocalizationService {
510
544
  const lang = browserLang.match(/en|ru|es/) ? browserLang : this.defaultLanguage;
511
545
  //dates
512
546
  this.dateFnsLocale = { locale: enUS };
513
- //Events
514
- this.onLangChange = this.translate.onLangChange.subscribe((event) => {
515
- console.log('Lang Changed');
547
+ this.subs.sink = this.translate.onLangChange.subscribe((event) => {
548
+ console.log('Language Changed');
549
+ this.langchange.emit(event.lang);
516
550
  });
517
551
  return lang;
518
552
  }
@@ -654,7 +688,9 @@ class LocalizationService {
654
688
  args: [{
655
689
  providedIn: 'root'
656
690
  }]
657
- }], function () { return [{ type: i1$1.TranslateService }]; }, null); })();
691
+ }], function () { return [{ type: i1$1.TranslateService }]; }, { langchange: [{
692
+ type: Output
693
+ }] }); })();
658
694
 
659
695
  /*
660
696
  <file>
@@ -720,12 +756,13 @@ class LocalizePipe {
720
756
  return inputData;
721
757
  }
722
758
  static ɵfac = function LocalizePipe_Factory(t) { return new (t || LocalizePipe)(i0.ɵɵdirectiveInject(LocalizationService, 16)); };
723
- static ɵpipe = /*@__PURE__*/ i0.ɵɵdefinePipe({ name: "localize", type: LocalizePipe, pure: true });
759
+ static ɵpipe = /*@__PURE__*/ i0.ɵɵdefinePipe({ name: "localize", type: LocalizePipe, pure: false });
724
760
  }
725
761
  (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(LocalizePipe, [{
726
762
  type: Pipe,
727
763
  args: [{
728
- name: 'localize'
764
+ name: 'localize',
765
+ pure: false
729
766
  }]
730
767
  }], function () { return [{ type: LocalizationService }]; }, null); })();
731
768
 
@@ -876,7 +913,7 @@ class LocalizationModule {
876
913
  https://medium.com/@amcdnl/global-error-handling-with-angular2-6b992bdfb59c
877
914
  https://medium.com/angular-in-depth/expecting-the-unexpected-best-practices-for-error-handling-in-angular-21c3662ef9e4
878
915
  */
879
- // Node
916
+ //Node
880
917
  class GlobalErrorHandler {
881
918
  injector;
882
919
  constructor(injector) {
@@ -926,7 +963,7 @@ class GlobalErrorHandler {
926
963
  Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
927
964
  </file>
928
965
  */
929
- // App
966
+ //App
930
967
  class L10nUtils {
931
968
  // @dynamic
932
969
  static get localizationService() {
@@ -1515,11 +1552,11 @@ class AppContextService extends ApiServiceBase {
1515
1552
 
1516
1553
  Created:
1517
1554
  29 Nov 2020
1518
-
1555
+
1519
1556
  Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
1520
1557
  </file>
1521
1558
  */
1522
- // Node
1559
+ //Node
1523
1560
  class DigitalMarketingService {
1524
1561
  title;
1525
1562
  meta;
@@ -1587,7 +1624,7 @@ class DigitalMarketingService {
1587
1624
  Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
1588
1625
  </file>
1589
1626
  */
1590
- // Node
1627
+ //Node
1591
1628
  class GoogleAnalyticsService {
1592
1629
  router;
1593
1630
  subscription;
@@ -2063,36 +2100,6 @@ class Guid {
2063
2100
  }
2064
2101
  }
2065
2102
 
2066
- /*
2067
- <file>
2068
- Project:
2069
- @osovitny/anatoly
2070
-
2071
- Authors:
2072
- Vadim Osovitny vadim@osovitny.com
2073
- Anatoly Osovitny anatoly@osovitny.com
2074
-
2075
- Created:
2076
- 26 Jun 2020
2077
-
2078
- Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
2079
- </file>
2080
- */
2081
- class Subs {
2082
- subs = [];
2083
- constructor() { }
2084
- add(...subscriptions) {
2085
- this.subs = this.subs.concat(subscriptions);
2086
- }
2087
- set sink(subscription) {
2088
- this.subs.push(subscription);
2089
- }
2090
- unsubscribe() {
2091
- this.subs.forEach((sub) => sub && sub.unsubscribe());
2092
- this.subs = [];
2093
- }
2094
- }
2095
-
2096
2103
  /*
2097
2104
  <file>
2098
2105
  Project:
@@ -2428,7 +2435,7 @@ class SignUpButtonComponent {
2428
2435
  Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
2429
2436
  </file>
2430
2437
  */
2431
- // Node
2438
+ //Node
2432
2439
  function BuyAccessButtonComponent_div_0_div_1_Template(rf, ctx) { if (rf & 1) {
2433
2440
  i0.ɵɵelementStart(0, "div");
2434
2441
  i0.ɵɵelement(1, "anatoly-signup-button", 1);
@@ -2528,11 +2535,11 @@ class BuyAccessButtonComponent {
2528
2535
 
2529
2536
  Created:
2530
2537
  1 Jun 2018
2531
-
2538
+
2532
2539
  Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
2533
2540
  </file>
2534
2541
  */
2535
- // Node
2542
+ //Node
2536
2543
  function SubscribePlanButtonComponent_div_0_div_1_Template(rf, ctx) { if (rf & 1) {
2537
2544
  i0.ɵɵelementStart(0, "div");
2538
2545
  i0.ɵɵelement(1, "anatoly-signup-button", 1);
@@ -2889,6 +2896,67 @@ class NodataComponent {
2889
2896
  type: Input
2890
2897
  }] }); })();
2891
2898
 
2899
+ /*
2900
+ <file>
2901
+ Project:
2902
+ @osovitny/anatoly
2903
+
2904
+ Authors:
2905
+ Vadim Osovitny vadim@osovitny.com
2906
+ Anatoly Osovitny anatoly@osovitny.com
2907
+
2908
+ Created:
2909
+ 28 Aug 2018
2910
+
2911
+ Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
2912
+ </file>
2913
+ */
2914
+ //Node
2915
+ class BaseComponent {
2916
+ subs = new Subs();
2917
+ //Component Data => usually loading from API
2918
+ dataLoading = true;
2919
+ dataLoaded = false;
2920
+ dataFound = false;
2921
+ //Inputs
2922
+ classes;
2923
+ ngOnDestroy() {
2924
+ this.subs.unsubscribe();
2925
+ }
2926
+ getEntityId() {
2927
+ return this.getValueByNameInQS("id");
2928
+ }
2929
+ getValueByNameInQS(name) {
2930
+ let value = Utils.getValueByNameInQS(name);
2931
+ if (typeof value === "undefined" || value == "")
2932
+ return null;
2933
+ return value;
2934
+ }
2935
+ dataStartedLoading() {
2936
+ this.dataLoading = true;
2937
+ this.dataLoaded = false;
2938
+ this.dataFound = false;
2939
+ }
2940
+ dataLoadedAndNothingFound() {
2941
+ this.dataLoadedAndFound(false);
2942
+ }
2943
+ dataLoadedAndFound(found = true) {
2944
+ this.dataLoading = false;
2945
+ this.dataLoaded = true;
2946
+ this.dataFound = found;
2947
+ }
2948
+ static ɵfac = function BaseComponent_Factory(t) { return new (t || BaseComponent)(); };
2949
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: BaseComponent, selectors: [["ng-component"]], inputs: { classes: "classes" }, decls: 0, vars: 0, template: function BaseComponent_Template(rf, ctx) { }, encapsulation: 2 });
2950
+ }
2951
+ (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(BaseComponent, [{
2952
+ type: Component,
2953
+ args: [{
2954
+ template: ''
2955
+ }]
2956
+ }], null, { classes: [{
2957
+ type: Input
2958
+ }] }); })();
2959
+
2892
2960
  /*
2893
2961
  <file>
2894
2962
  Project:
@@ -2904,19 +2972,17 @@ class NodataComponent {
2904
2972
  Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
2905
2973
  </file>
2906
2974
  */
2907
- // Node
2975
+ //Node
2908
2976
  function LoadingComponent_div_0_Template(rf, ctx) { if (rf & 1) {
2909
2977
  i0.ɵɵelementStart(0, "div", 1);
2910
2978
  i0.ɵɵelement(1, "span", 2);
2911
2979
  i0.ɵɵelementEnd();
2912
2980
  } }
2913
- class LoadingComponent {
2981
+ class LoadingComponent extends BaseComponent {
2914
2982
  loadingService;
2915
- // Private
2916
- subs = new Subs();
2917
- // Public
2918
2983
  show = false;
2919
2984
  constructor(loadingService) {
2985
+ super();
2920
2986
  this.loadingService = loadingService;
2921
2987
  }
2922
2988
  ngOnInit() {
@@ -2926,11 +2992,8 @@ class LoadingComponent {
2926
2992
  }
2927
2993
  });
2928
2994
  }
2929
- ngOnDestroy() {
2930
- this.subs.unsubscribe();
2931
- }
2932
2995
  static ɵfac = function LoadingComponent_Factory(t) { return new (t || LoadingComponent)(i0.ɵɵdirectiveInject(LoadingService)); };
2933
- static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: LoadingComponent, selectors: [["anatoly-loading"]], decls: 1, vars: 1, consts: [["id", "pnlLoading", 4, "ngIf"], ["id", "pnlLoading"], [1, "k-icon", "k-i-loading"]], template: function LoadingComponent_Template(rf, ctx) { if (rf & 1) {
2996
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: LoadingComponent, selectors: [["anatoly-loading"]], features: [i0.ɵɵInheritDefinitionFeature], decls: 1, vars: 1, consts: [["id", "pnlLoading", 4, "ngIf"], ["id", "pnlLoading"], [1, "k-icon", "k-i-loading"]], template: function LoadingComponent_Template(rf, ctx) { if (rf & 1) {
2934
2997
  i0.ɵɵtemplate(0, LoadingComponent_div_0_Template, 2, 0, "div", 0);
2935
2998
  } if (rf & 2) {
2936
2999
  i0.ɵɵproperty("ngIf", ctx.show);
@@ -2968,7 +3031,7 @@ const Spinkit = {
2968
3031
  Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
2969
3032
  </file>
2970
3033
  */
2971
- // Node
3034
+ //Node
2972
3035
  function PageSpinnerComponent_div_0_div_2_Template(rf, ctx) { if (rf & 1) {
2973
3036
  i0.ɵɵelementStart(0, "div", 4);
2974
3037
  i0.ɵɵelement(1, "div", 5);
@@ -3324,63 +3387,6 @@ const DefaultEditorOptions = {
3324
3387
  imageUploadParams: { uploadType: "", uploadParentId: "" },
3325
3388
  };
3326
3389
 
3327
- /*
3328
- <file>
3329
- Project:
3330
- @osovitny/anatoly
3331
-
3332
- Authors:
3333
- Vadim Osovitny vadim@osovitny.com
3334
- Anatoly Osovitny anatoly@osovitny.com
3335
-
3336
- Created:
3337
- 28 Aug 2018
3338
-
3339
- Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
3340
- </file>
3341
- */
3342
- //Node
3343
- class BaseComponent {
3344
- subs = new Subs();
3345
- //Component Data => usually loading from API
3346
- dataLoading = true;
3347
- dataLoaded = false;
3348
- dataFound = false;
3349
- ngOnDestroy() {
3350
- this.subs.unsubscribe();
3351
- }
3352
- getEntityId() {
3353
- return this.getValueByNameInQS("id");
3354
- }
3355
- getValueByNameInQS(name) {
3356
- let value = Utils.getValueByNameInQS(name);
3357
- if (typeof value === "undefined" || value == "")
3358
- return null;
3359
- return value;
3360
- }
3361
- dataStartedLoading() {
3362
- this.dataLoading = true;
3363
- this.dataLoaded = false;
3364
- this.dataFound = false;
3365
- }
3366
- dataLoadedAndNothingFound() {
3367
- this.dataLoadedAndFound(false);
3368
- }
3369
- dataLoadedAndFound(found = true) {
3370
- this.dataLoading = false;
3371
- this.dataLoaded = true;
3372
- this.dataFound = found;
3373
- }
3374
- static ɵfac = function BaseComponent_Factory(t) { return new (t || BaseComponent)(); };
3375
- static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: BaseComponent, selectors: [["ng-component"]], decls: 0, vars: 0, template: function BaseComponent_Template(rf, ctx) { }, encapsulation: 2 });
3376
- }
3377
- (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(BaseComponent, [{
3378
- type: Component,
3379
- args: [{
3380
- template: ''
3381
- }]
3382
- }], null, null); })();
3383
-
3384
3390
  /*
3385
3391
  <file>
3386
3392
  Project:
@@ -3510,7 +3516,7 @@ class BaseEditComponent extends BaseComponent {
3510
3516
  type: Input
3511
3517
  }] }); })();
3512
3518
 
3513
- // Node
3519
+ //Node
3514
3520
  class BaseHtmlEditorComponent extends BaseEditComponent {
3515
3521
  froalaEditor;
3516
3522
  // Public members
@@ -3652,7 +3658,7 @@ class NativeElementDirective {
3652
3658
  Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
3653
3659
  </file>
3654
3660
  */
3655
- // Node
3661
+ //Node
3656
3662
  class ValidationSummaryComponent extends BaseEditComponent {
3657
3663
  constructor() {
3658
3664
  super();
@@ -3769,11 +3775,11 @@ class ValidationSummaryComponent extends BaseEditComponent {
3769
3775
 
3770
3776
  Created:
3771
3777
  6 Dec 2017
3772
-
3778
+
3773
3779
  Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
3774
3780
  </file>
3775
3781
  */
3776
- // Node
3782
+ //Node
3777
3783
  function ItemValidationSummaryComponent_ul_0_li_1_Template(rf, ctx) { if (rf & 1) {
3778
3784
  i0.ɵɵelementStart(0, "li")(1, "span", 3);
3779
3785
  i0.ɵɵtext(2);
@@ -4172,7 +4178,7 @@ class BasePagedPage extends BasePage {
4172
4178
  Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
4173
4179
  </file>
4174
4180
  */
4175
- // Node
4181
+ //Node
4176
4182
  function FormValidationSummaryComponent_div_0_li_4_Template(rf, ctx) { if (rf & 1) {
4177
4183
  i0.ɵɵelementStart(0, "li")(1, "span");
4178
4184
  i0.ɵɵtext(2);
@@ -5225,7 +5231,7 @@ class TimezoneDropdownlist extends BaseEditComponent {
5225
5231
  Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
5226
5232
  </file>
5227
5233
  */
5228
- // Node
5234
+ //Node
5229
5235
  class FileSizePipe {
5230
5236
  units = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB'];
5231
5237
  transform(bytes = 0, precision = 0) {
@@ -5263,7 +5269,7 @@ class FileSizePipe {
5263
5269
  Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
5264
5270
  </file>
5265
5271
  */
5266
- // Node
5272
+ //Node
5267
5273
  class ReplaceTextPipe {
5268
5274
  transform(inputData, search, replacement) {
5269
5275
  if (inputData) {
@@ -5298,7 +5304,7 @@ class ReplaceTextPipe {
5298
5304
  Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
5299
5305
  </file>
5300
5306
  */
5301
- // Node
5307
+ //Node
5302
5308
  class SafeHtmlPipe {
5303
5309
  sanitized;
5304
5310
  constructor(sanitized) {