@osovitny/anatoly 3.16.15 → 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 (26) 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/utils.mjs +2 -2
  4. package/esm2022/lib/core/logging/globalErrorHandler.mjs +3 -3
  5. package/esm2022/lib/core/logging/logging.service.mjs +2 -2
  6. package/esm2022/lib/core/services/dm.service.mjs +3 -3
  7. package/esm2022/lib/core/services/google-analytics.service.mjs +2 -2
  8. package/esm2022/lib/ui/components/base/base.component.mjs +8 -4
  9. package/esm2022/lib/ui/components/billing/buyaccess-button.component.mjs +2 -2
  10. package/esm2022/lib/ui/components/billing/subscribe-plan-button.component.mjs +3 -3
  11. package/esm2022/lib/ui/components/html-editor/base-html-editor.component.mjs +3 -3
  12. package/esm2022/lib/ui/components/spinners/loading/loading.component.mjs +7 -12
  13. package/esm2022/lib/ui/components/spinners/pagespinner/pagespinner.component.mjs +2 -2
  14. package/esm2022/lib/ui/forms/components/urlslug/urlslug.component.mjs +1 -1
  15. package/esm2022/lib/ui/pipes/filesize.pipe.mjs +2 -2
  16. package/esm2022/lib/ui/pipes/replace-text.pipe.mjs +2 -2
  17. package/esm2022/lib/ui/pipes/safeHtml.pipe.mjs +2 -2
  18. package/esm2022/lib/ui/validation/form-validation-summary.component.mjs +3 -3
  19. package/esm2022/lib/ui/validation/item-validation-summary.component.mjs +4 -4
  20. package/esm2022/lib/ui/validation/validation-summary.component.mjs +3 -3
  21. package/fesm2022/osovitny-anatoly.mjs +128 -123
  22. package/fesm2022/osovitny-anatoly.mjs.map +1 -1
  23. package/lib/core/localization/localization.service.d.ts +8 -5
  24. package/lib/ui/components/base/base.component.d.ts +2 -1
  25. package/lib/ui/components/spinners/loading/loading.component.d.ts +3 -4
  26. 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>
@@ -877,7 +913,7 @@ class LocalizationModule {
877
913
  https://medium.com/@amcdnl/global-error-handling-with-angular2-6b992bdfb59c
878
914
  https://medium.com/angular-in-depth/expecting-the-unexpected-best-practices-for-error-handling-in-angular-21c3662ef9e4
879
915
  */
880
- // Node
916
+ //Node
881
917
  class GlobalErrorHandler {
882
918
  injector;
883
919
  constructor(injector) {
@@ -927,7 +963,7 @@ class GlobalErrorHandler {
927
963
  Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
928
964
  </file>
929
965
  */
930
- // App
966
+ //App
931
967
  class L10nUtils {
932
968
  // @dynamic
933
969
  static get localizationService() {
@@ -1516,11 +1552,11 @@ class AppContextService extends ApiServiceBase {
1516
1552
 
1517
1553
  Created:
1518
1554
  29 Nov 2020
1519
-
1555
+
1520
1556
  Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
1521
1557
  </file>
1522
1558
  */
1523
- // Node
1559
+ //Node
1524
1560
  class DigitalMarketingService {
1525
1561
  title;
1526
1562
  meta;
@@ -1588,7 +1624,7 @@ class DigitalMarketingService {
1588
1624
  Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
1589
1625
  </file>
1590
1626
  */
1591
- // Node
1627
+ //Node
1592
1628
  class GoogleAnalyticsService {
1593
1629
  router;
1594
1630
  subscription;
@@ -2064,36 +2100,6 @@ class Guid {
2064
2100
  }
2065
2101
  }
2066
2102
 
2067
- /*
2068
- <file>
2069
- Project:
2070
- @osovitny/anatoly
2071
-
2072
- Authors:
2073
- Vadim Osovitny vadim@osovitny.com
2074
- Anatoly Osovitny anatoly@osovitny.com
2075
-
2076
- Created:
2077
- 26 Jun 2020
2078
-
2079
- Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
2080
- </file>
2081
- */
2082
- class Subs {
2083
- subs = [];
2084
- constructor() { }
2085
- add(...subscriptions) {
2086
- this.subs = this.subs.concat(subscriptions);
2087
- }
2088
- set sink(subscription) {
2089
- this.subs.push(subscription);
2090
- }
2091
- unsubscribe() {
2092
- this.subs.forEach((sub) => sub && sub.unsubscribe());
2093
- this.subs = [];
2094
- }
2095
- }
2096
-
2097
2103
  /*
2098
2104
  <file>
2099
2105
  Project:
@@ -2429,7 +2435,7 @@ class SignUpButtonComponent {
2429
2435
  Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
2430
2436
  </file>
2431
2437
  */
2432
- // Node
2438
+ //Node
2433
2439
  function BuyAccessButtonComponent_div_0_div_1_Template(rf, ctx) { if (rf & 1) {
2434
2440
  i0.ɵɵelementStart(0, "div");
2435
2441
  i0.ɵɵelement(1, "anatoly-signup-button", 1);
@@ -2529,11 +2535,11 @@ class BuyAccessButtonComponent {
2529
2535
 
2530
2536
  Created:
2531
2537
  1 Jun 2018
2532
-
2538
+
2533
2539
  Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
2534
2540
  </file>
2535
2541
  */
2536
- // Node
2542
+ //Node
2537
2543
  function SubscribePlanButtonComponent_div_0_div_1_Template(rf, ctx) { if (rf & 1) {
2538
2544
  i0.ɵɵelementStart(0, "div");
2539
2545
  i0.ɵɵelement(1, "anatoly-signup-button", 1);
@@ -2890,6 +2896,67 @@ class NodataComponent {
2890
2896
  type: Input
2891
2897
  }] }); })();
2892
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
+
2893
2960
  /*
2894
2961
  <file>
2895
2962
  Project:
@@ -2905,19 +2972,17 @@ class NodataComponent {
2905
2972
  Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
2906
2973
  </file>
2907
2974
  */
2908
- // Node
2975
+ //Node
2909
2976
  function LoadingComponent_div_0_Template(rf, ctx) { if (rf & 1) {
2910
2977
  i0.ɵɵelementStart(0, "div", 1);
2911
2978
  i0.ɵɵelement(1, "span", 2);
2912
2979
  i0.ɵɵelementEnd();
2913
2980
  } }
2914
- class LoadingComponent {
2981
+ class LoadingComponent extends BaseComponent {
2915
2982
  loadingService;
2916
- // Private
2917
- subs = new Subs();
2918
- // Public
2919
2983
  show = false;
2920
2984
  constructor(loadingService) {
2985
+ super();
2921
2986
  this.loadingService = loadingService;
2922
2987
  }
2923
2988
  ngOnInit() {
@@ -2927,11 +2992,8 @@ class LoadingComponent {
2927
2992
  }
2928
2993
  });
2929
2994
  }
2930
- ngOnDestroy() {
2931
- this.subs.unsubscribe();
2932
- }
2933
2995
  static ɵfac = function LoadingComponent_Factory(t) { return new (t || LoadingComponent)(i0.ɵɵdirectiveInject(LoadingService)); };
2934
- 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) {
2935
2997
  i0.ɵɵtemplate(0, LoadingComponent_div_0_Template, 2, 0, "div", 0);
2936
2998
  } if (rf & 2) {
2937
2999
  i0.ɵɵproperty("ngIf", ctx.show);
@@ -2969,7 +3031,7 @@ const Spinkit = {
2969
3031
  Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
2970
3032
  </file>
2971
3033
  */
2972
- // Node
3034
+ //Node
2973
3035
  function PageSpinnerComponent_div_0_div_2_Template(rf, ctx) { if (rf & 1) {
2974
3036
  i0.ɵɵelementStart(0, "div", 4);
2975
3037
  i0.ɵɵelement(1, "div", 5);
@@ -3325,63 +3387,6 @@ const DefaultEditorOptions = {
3325
3387
  imageUploadParams: { uploadType: "", uploadParentId: "" },
3326
3388
  };
3327
3389
 
3328
- /*
3329
- <file>
3330
- Project:
3331
- @osovitny/anatoly
3332
-
3333
- Authors:
3334
- Vadim Osovitny vadim@osovitny.com
3335
- Anatoly Osovitny anatoly@osovitny.com
3336
-
3337
- Created:
3338
- 28 Aug 2018
3339
-
3340
- Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
3341
- </file>
3342
- */
3343
- //Node
3344
- class BaseComponent {
3345
- subs = new Subs();
3346
- //Component Data => usually loading from API
3347
- dataLoading = true;
3348
- dataLoaded = false;
3349
- dataFound = false;
3350
- ngOnDestroy() {
3351
- this.subs.unsubscribe();
3352
- }
3353
- getEntityId() {
3354
- return this.getValueByNameInQS("id");
3355
- }
3356
- getValueByNameInQS(name) {
3357
- let value = Utils.getValueByNameInQS(name);
3358
- if (typeof value === "undefined" || value == "")
3359
- return null;
3360
- return value;
3361
- }
3362
- dataStartedLoading() {
3363
- this.dataLoading = true;
3364
- this.dataLoaded = false;
3365
- this.dataFound = false;
3366
- }
3367
- dataLoadedAndNothingFound() {
3368
- this.dataLoadedAndFound(false);
3369
- }
3370
- dataLoadedAndFound(found = true) {
3371
- this.dataLoading = false;
3372
- this.dataLoaded = true;
3373
- this.dataFound = found;
3374
- }
3375
- static ɵfac = function BaseComponent_Factory(t) { return new (t || BaseComponent)(); };
3376
- static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: BaseComponent, selectors: [["ng-component"]], decls: 0, vars: 0, template: function BaseComponent_Template(rf, ctx) { }, encapsulation: 2 });
3377
- }
3378
- (function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(BaseComponent, [{
3379
- type: Component,
3380
- args: [{
3381
- template: ''
3382
- }]
3383
- }], null, null); })();
3384
-
3385
3390
  /*
3386
3391
  <file>
3387
3392
  Project:
@@ -3511,7 +3516,7 @@ class BaseEditComponent extends BaseComponent {
3511
3516
  type: Input
3512
3517
  }] }); })();
3513
3518
 
3514
- // Node
3519
+ //Node
3515
3520
  class BaseHtmlEditorComponent extends BaseEditComponent {
3516
3521
  froalaEditor;
3517
3522
  // Public members
@@ -3653,7 +3658,7 @@ class NativeElementDirective {
3653
3658
  Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
3654
3659
  </file>
3655
3660
  */
3656
- // Node
3661
+ //Node
3657
3662
  class ValidationSummaryComponent extends BaseEditComponent {
3658
3663
  constructor() {
3659
3664
  super();
@@ -3770,11 +3775,11 @@ class ValidationSummaryComponent extends BaseEditComponent {
3770
3775
 
3771
3776
  Created:
3772
3777
  6 Dec 2017
3773
-
3778
+
3774
3779
  Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
3775
3780
  </file>
3776
3781
  */
3777
- // Node
3782
+ //Node
3778
3783
  function ItemValidationSummaryComponent_ul_0_li_1_Template(rf, ctx) { if (rf & 1) {
3779
3784
  i0.ɵɵelementStart(0, "li")(1, "span", 3);
3780
3785
  i0.ɵɵtext(2);
@@ -4173,7 +4178,7 @@ class BasePagedPage extends BasePage {
4173
4178
  Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
4174
4179
  </file>
4175
4180
  */
4176
- // Node
4181
+ //Node
4177
4182
  function FormValidationSummaryComponent_div_0_li_4_Template(rf, ctx) { if (rf & 1) {
4178
4183
  i0.ɵɵelementStart(0, "li")(1, "span");
4179
4184
  i0.ɵɵtext(2);
@@ -5226,7 +5231,7 @@ class TimezoneDropdownlist extends BaseEditComponent {
5226
5231
  Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
5227
5232
  </file>
5228
5233
  */
5229
- // Node
5234
+ //Node
5230
5235
  class FileSizePipe {
5231
5236
  units = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB'];
5232
5237
  transform(bytes = 0, precision = 0) {
@@ -5264,7 +5269,7 @@ class FileSizePipe {
5264
5269
  Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
5265
5270
  </file>
5266
5271
  */
5267
- // Node
5272
+ //Node
5268
5273
  class ReplaceTextPipe {
5269
5274
  transform(inputData, search, replacement) {
5270
5275
  if (inputData) {
@@ -5299,7 +5304,7 @@ class ReplaceTextPipe {
5299
5304
  Copyright (c) 2016-2022 Osovitny Inc. All rights reserved.
5300
5305
  </file>
5301
5306
  */
5302
- // Node
5307
+ //Node
5303
5308
  class SafeHtmlPipe {
5304
5309
  sanitized;
5305
5310
  constructor(sanitized) {