@stemy/ngx-utils 13.0.1 → 13.0.4

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 (105) hide show
  1. package/esm2020/ngx-utils/common-types.mjs +1 -1
  2. package/esm2020/ngx-utils/ngx-utils.imports.mjs +163 -0
  3. package/esm2020/ngx-utils/ngx-utils.module.mjs +75 -234
  4. package/esm2020/ngx-utils/services/config.service.mjs +10 -14
  5. package/fesm2015/stemy-ngx-utils.mjs +39 -90
  6. package/fesm2015/stemy-ngx-utils.mjs.map +1 -1
  7. package/fesm2020/stemy-ngx-utils.mjs +39 -90
  8. package/fesm2020/stemy-ngx-utils.mjs.map +1 -1
  9. package/ngx-utils/common-types.d.ts +1 -0
  10. package/ngx-utils/ngx-utils.module.d.ts +50 -73
  11. package/ngx-utils/services/config.service.d.ts +3 -2
  12. package/package.json +1 -1
  13. package/bundles/stemy-ngx-utils.umd.js +0 -6121
  14. package/bundles/stemy-ngx-utils.umd.js.map +0 -1
  15. package/bundles/stemy-ngx-utils.umd.min.js +0 -16
  16. package/bundles/stemy-ngx-utils.umd.min.js.map +0 -1
  17. package/esm2015/ngx-utils/common-types.js +0 -116
  18. package/esm2015/ngx-utils/components/dynamic-table/dynamic-table.component.js +0 -139
  19. package/esm2015/ngx-utils/components/pagination-menu/pagination-menu.component.js +0 -96
  20. package/esm2015/ngx-utils/components/unordered-list/unordered-list.component.js +0 -51
  21. package/esm2015/ngx-utils/directives/async-method.base.js +0 -54
  22. package/esm2015/ngx-utils/directives/async-method.directive.js +0 -24
  23. package/esm2015/ngx-utils/directives/background.directive.js +0 -51
  24. package/esm2015/ngx-utils/directives/dynamic-table-template.directive.js +0 -19
  25. package/esm2015/ngx-utils/directives/global-template.directive.js +0 -27
  26. package/esm2015/ngx-utils/directives/icon.directive.js +0 -59
  27. package/esm2015/ngx-utils/directives/ngx-template-outlet.directive.js +0 -88
  28. package/esm2015/ngx-utils/directives/pagination-item.directive.js +0 -33
  29. package/esm2015/ngx-utils/directives/pagination.directive.js +0 -76
  30. package/esm2015/ngx-utils/directives/resource-if.directive.js +0 -51
  31. package/esm2015/ngx-utils/directives/sticky-class.directive.js +0 -35
  32. package/esm2015/ngx-utils/directives/sticky.directive.js +0 -48
  33. package/esm2015/ngx-utils/directives/unordered-list-item.directive.js +0 -70
  34. package/esm2015/ngx-utils/directives/unordered-list-template.directive.js +0 -26
  35. package/esm2015/ngx-utils/ngx-utils.module.js +0 -238
  36. package/esm2015/ngx-utils/pipes/chunk.pipe.js +0 -21
  37. package/esm2015/ngx-utils/pipes/entries.pipe.js +0 -24
  38. package/esm2015/ngx-utils/pipes/extra-item-properties.pipe.js +0 -27
  39. package/esm2015/ngx-utils/pipes/filter.pipe.js +0 -38
  40. package/esm2015/ngx-utils/pipes/find.pipe.js +0 -25
  41. package/esm2015/ngx-utils/pipes/format-number.pipe.js +0 -19
  42. package/esm2015/ngx-utils/pipes/get-offset.pipe.js +0 -13
  43. package/esm2015/ngx-utils/pipes/get-type.pipe.js +0 -12
  44. package/esm2015/ngx-utils/pipes/global-template.pipe.js +0 -37
  45. package/esm2015/ngx-utils/pipes/group-by.pipe.js +0 -23
  46. package/esm2015/ngx-utils/pipes/is-type.pipe.js +0 -12
  47. package/esm2015/ngx-utils/pipes/join.pipe.js +0 -15
  48. package/esm2015/ngx-utils/pipes/keys.pipe.js +0 -18
  49. package/esm2015/ngx-utils/pipes/map.pipe.js +0 -25
  50. package/esm2015/ngx-utils/pipes/max.pipe.js +0 -22
  51. package/esm2015/ngx-utils/pipes/min.pipe.js +0 -22
  52. package/esm2015/ngx-utils/pipes/reduce.pipe.js +0 -26
  53. package/esm2015/ngx-utils/pipes/remap.pipe.js +0 -28
  54. package/esm2015/ngx-utils/pipes/replace.pipe.js +0 -12
  55. package/esm2015/ngx-utils/pipes/reverse.pipe.js +0 -20
  56. package/esm2015/ngx-utils/pipes/round.pipe.js +0 -19
  57. package/esm2015/ngx-utils/pipes/safe-html.pipe.js +0 -32
  58. package/esm2015/ngx-utils/pipes/translate.pipe.js +0 -81
  59. package/esm2015/ngx-utils/pipes/values.pipe.js +0 -18
  60. package/esm2015/ngx-utils/plugins/resize-event.plugin.js +0 -56
  61. package/esm2015/ngx-utils/plugins/scroll-event.plugin.js +0 -36
  62. package/esm2015/ngx-utils/services/acl.service.js +0 -79
  63. package/esm2015/ngx-utils/services/api.service.js +0 -35
  64. package/esm2015/ngx-utils/services/auth.service.js +0 -14
  65. package/esm2015/ngx-utils/services/base-http.client.js +0 -46
  66. package/esm2015/ngx-utils/services/base-http.service.js +0 -285
  67. package/esm2015/ngx-utils/services/config.service.js +0 -122
  68. package/esm2015/ngx-utils/services/error-handler.service.js +0 -49
  69. package/esm2015/ngx-utils/services/events.service.js +0 -24
  70. package/esm2015/ngx-utils/services/formatter.service.js +0 -44
  71. package/esm2015/ngx-utils/services/global-template.service.js +0 -35
  72. package/esm2015/ngx-utils/services/icon.service.js +0 -24
  73. package/esm2015/ngx-utils/services/language.service.js +0 -117
  74. package/esm2015/ngx-utils/services/open-api.service.js +0 -41
  75. package/esm2015/ngx-utils/services/promise.service.js +0 -52
  76. package/esm2015/ngx-utils/services/state.service.js +0 -181
  77. package/esm2015/ngx-utils/services/static-language.service.js +0 -152
  78. package/esm2015/ngx-utils/services/storage.service.js +0 -48
  79. package/esm2015/ngx-utils/services/toaster.service.js +0 -29
  80. package/esm2015/ngx-utils/services/translated-url.serializer.js +0 -70
  81. package/esm2015/ngx-utils/services/universal.service.js +0 -75
  82. package/esm2015/ngx-utils/utils/ajax-request-handler.js +0 -40
  83. package/esm2015/ngx-utils/utils/array.utils.js +0 -100
  84. package/esm2015/ngx-utils/utils/auth.guard.js +0 -156
  85. package/esm2015/ngx-utils/utils/canvas.utils.js +0 -388
  86. package/esm2015/ngx-utils/utils/date.utils.js +0 -28
  87. package/esm2015/ngx-utils/utils/file.utils.js +0 -90
  88. package/esm2015/ngx-utils/utils/generic-value.js +0 -20
  89. package/esm2015/ngx-utils/utils/geometry.js +0 -132
  90. package/esm2015/ngx-utils/utils/initializer.js +0 -20
  91. package/esm2015/ngx-utils/utils/loader.utils.js +0 -55
  92. package/esm2015/ngx-utils/utils/math.utils.js +0 -15
  93. package/esm2015/ngx-utils/utils/object.utils.js +0 -263
  94. package/esm2015/ngx-utils/utils/observable.utils.js +0 -63
  95. package/esm2015/ngx-utils/utils/reflect.utils.js +0 -33
  96. package/esm2015/ngx-utils/utils/set.utils.js +0 -20
  97. package/esm2015/ngx-utils/utils/string.utils.js +0 -28
  98. package/esm2015/ngx-utils/utils/timer.utils.js +0 -52
  99. package/esm2015/ngx-utils/utils/unique.utils.js +0 -24
  100. package/esm2015/ngx-utils/utils/vector.js +0 -77
  101. package/esm2015/public_api.js +0 -84
  102. package/esm2015/stemy-ngx-utils.js +0 -7
  103. package/fesm2015/stemy-ngx-utils.js +0 -4860
  104. package/fesm2015/stemy-ngx-utils.js.map +0 -1
  105. package/stemy-ngx-utils.metadata.json +0 -1
@@ -8,7 +8,7 @@ import { Invokable } from 'invokable';
8
8
  import * as i2 from '@angular/router';
9
9
  import { ActivatedRouteSnapshot, NavigationEnd, DefaultUrlSerializer, UrlTree, UrlSegmentGroup, UrlSegment, UrlSerializer } from '@angular/router';
10
10
  import * as i1$3 from '@angular/common';
11
- import { isPlatformBrowser, isPlatformServer, DOCUMENT, CommonModule } from '@angular/common';
11
+ import { isPlatformBrowser, isPlatformServer, APP_BASE_HREF, DOCUMENT, CommonModule } from '@angular/common';
12
12
  import * as i1 from 'ngx-device-detector';
13
13
  import { DeviceDetectorService } from 'ngx-device-detector';
14
14
  import * as i1$1 from '@angular/common/http';
@@ -2468,26 +2468,18 @@ class StaticAuthService {
2468
2468
  }
2469
2469
 
2470
2470
  class ConfigService {
2471
- constructor(http, universal, rootElement, baseConfig = null, scriptParams = null) {
2471
+ constructor(http, universal, rootElement, baseHref, baseConfig = null, scriptParams = null) {
2472
2472
  this.http = http;
2473
2473
  this.universal = universal;
2474
2474
  this.rootElement = rootElement;
2475
+ this.baseHref = baseHref;
2475
2476
  for (const key in []) {
2476
2477
  Object.defineProperty(Array.prototype, key, {
2477
2478
  enumerable: false
2478
2479
  });
2479
2480
  }
2480
- let baseUrl = "";
2481
- if (this.universal.isBrowser) {
2482
- const currentScript = document.currentScript;
2483
- if (!!currentScript) {
2484
- const scriptSrc = currentScript.src;
2485
- const srcParts = scriptSrc.split(".js");
2486
- baseUrl = scriptSrc.substr(0, srcParts[0].lastIndexOf("/") + 1);
2487
- }
2488
- }
2489
2481
  this.baseConfig = baseConfig || {};
2490
- this.loadedConfig = Object.assign(!baseUrl ? {} : { baseUrl, baseDomain: this.parseDomain(baseUrl) }, this.baseConfig);
2482
+ this.loadedConfig = Object.assign(!this.baseHref ? {} : { baseUrl: this.baseHref, baseDomain: this.parseDomain(this.baseHref) }, this.baseConfig);
2491
2483
  this.scriptParameters = scriptParams || {};
2492
2484
  this.loaderFunc = () => {
2493
2485
  this.loader = this.loader || new Promise((resolve, reject) => {
@@ -2569,13 +2561,16 @@ class ConfigService {
2569
2561
  return decodeURIComponent(results[2].replace(/\+/g, " "));
2570
2562
  }
2571
2563
  }
2572
- ConfigService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: ConfigService, deps: [{ token: i1$1.HttpClient }, { token: UniversalService }, { token: ROOT_ELEMENT }, { token: BASE_CONFIG, optional: true }, { token: SCRIPT_PARAMS, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
2564
+ ConfigService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: ConfigService, deps: [{ token: i1$1.HttpClient }, { token: UniversalService }, { token: ROOT_ELEMENT }, { token: APP_BASE_HREF }, { token: BASE_CONFIG, optional: true }, { token: SCRIPT_PARAMS, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
2573
2565
  ConfigService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: ConfigService });
2574
2566
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: ConfigService, decorators: [{
2575
2567
  type: Injectable
2576
2568
  }], ctorParameters: function () { return [{ type: i1$1.HttpClient }, { type: UniversalService }, { type: undefined, decorators: [{
2577
2569
  type: Inject,
2578
2570
  args: [ROOT_ELEMENT]
2571
+ }] }, { type: undefined, decorators: [{
2572
+ type: Inject,
2573
+ args: [APP_BASE_HREF]
2579
2574
  }] }, { type: IConfiguration, decorators: [{
2580
2575
  type: Optional
2581
2576
  }, {
@@ -4962,8 +4957,31 @@ const providers = [
4962
4957
  ];
4963
4958
  function loadConfig(config) {
4964
4959
  return config.load;
4960
+ }
4961
+
4962
+ function loadBaseHref() {
4963
+ if (typeof (document) === "undefined" || typeof (location) === "undefined")
4964
+ return "/";
4965
+ const currentScript = document.currentScript;
4966
+ if (!currentScript) {
4967
+ try {
4968
+ // noinspection ExceptionCaughtLocallyJS
4969
+ throw new Error();
4970
+ }
4971
+ catch (e) {
4972
+ const qualifiedUrl = location.protocol + "//" + location.host;
4973
+ const srcUrl = (e.stack || "").match(new RegExp(qualifiedUrl + ".*?\\.js", "g")) || e.stack.match(/http([A-Z:\/\-\.]+)\.js/gi).shift();
4974
+ const lastIndex = srcUrl.lastIndexOf("/");
4975
+ return lastIndex < 0 ? "/" : srcUrl.substring(0, lastIndex + 1);
4976
+ }
4977
+ }
4978
+ const scriptSrc = currentScript.src;
4979
+ const lastIndex = scriptSrc.lastIndexOf("/");
4980
+ return lastIndex < 0 ? "/" : scriptSrc.substring(0, lastIndex + 1);
4965
4981
  }
4966
4982
  class NgxUtilsModule {
4983
+ constructor() {
4984
+ }
4967
4985
  static forRoot(config) {
4968
4986
  return {
4969
4987
  ngModule: NgxUtilsModule,
@@ -5010,88 +5028,19 @@ class NgxUtilsModule {
5010
5028
  useFactory: (!config ? null : config.initializeApp) || loadConfig,
5011
5029
  multi: true,
5012
5030
  deps: [(!config ? null : config.initializeApp) ? Injector : CONFIG_SERVICE]
5031
+ },
5032
+ {
5033
+ provide: APP_BASE_HREF,
5034
+ useFactory: (!config ? null : config.baseHref) || loadBaseHref,
5035
+ deps: [Injector]
5013
5036
  }
5014
5037
  ]
5015
5038
  };
5016
5039
  }
5017
5040
  }
5018
5041
  NgxUtilsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: NgxUtilsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
5019
- NgxUtilsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: NgxUtilsModule, declarations: [ChunkPipe,
5020
- EntriesPipe,
5021
- ExtraItemPropertiesPipe,
5022
- FilterPipe,
5023
- FindPipe,
5024
- FormatNumberPipe,
5025
- GetOffsetPipe,
5026
- GetTypePipe,
5027
- GlobalTemplatePipe,
5028
- GroupByPipe,
5029
- IsTypePipe,
5030
- JoinPipe,
5031
- KeysPipe,
5032
- MapPipe,
5033
- MaxPipe,
5034
- MinPipe,
5035
- ReducePipe,
5036
- RemapPipe,
5037
- ReplacePipe,
5038
- ReversePipe,
5039
- RoundPipe,
5040
- SafeHtmlPipe,
5041
- TranslatePipe,
5042
- ValuesPipe, AsyncMethodDirective,
5043
- BackgroundDirective,
5044
- DynamicTableTemplateDirective,
5045
- GlobalTemplateDirective,
5046
- IconDirective,
5047
- NgxTemplateOutletDirective,
5048
- PaginationDirective,
5049
- PaginationItemDirective,
5050
- ResourceIfDirective,
5051
- StickyDirective,
5052
- StickyClassDirective,
5053
- UnorderedListItemDirective,
5054
- UnorderedListTemplateDirective, DynamicTableComponent,
5055
- PaginationMenuComponent,
5056
- UnorderedListComponent], imports: [CommonModule,
5057
- FormsModule], exports: [ChunkPipe,
5058
- EntriesPipe,
5059
- ExtraItemPropertiesPipe,
5060
- FilterPipe,
5061
- FindPipe,
5062
- FormatNumberPipe,
5063
- GetOffsetPipe,
5064
- GetTypePipe,
5065
- GlobalTemplatePipe,
5066
- GroupByPipe,
5067
- IsTypePipe,
5068
- JoinPipe,
5069
- KeysPipe,
5070
- MapPipe,
5071
- MaxPipe,
5072
- MinPipe,
5073
- ReducePipe,
5074
- RemapPipe,
5075
- ReplacePipe,
5076
- ReversePipe,
5077
- RoundPipe,
5078
- SafeHtmlPipe,
5079
- TranslatePipe,
5080
- ValuesPipe, AsyncMethodDirective,
5081
- BackgroundDirective,
5082
- DynamicTableTemplateDirective,
5083
- GlobalTemplateDirective,
5084
- IconDirective,
5085
- NgxTemplateOutletDirective,
5086
- PaginationDirective,
5087
- PaginationItemDirective,
5088
- ResourceIfDirective,
5089
- StickyDirective,
5090
- StickyClassDirective,
5091
- UnorderedListItemDirective,
5092
- UnorderedListTemplateDirective, DynamicTableComponent,
5093
- PaginationMenuComponent,
5094
- UnorderedListComponent, FormsModule] });
5042
+ NgxUtilsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: NgxUtilsModule, declarations: [ChunkPipe, EntriesPipe, ExtraItemPropertiesPipe, FilterPipe, FindPipe, FormatNumberPipe, GetOffsetPipe, GetTypePipe, GlobalTemplatePipe, GroupByPipe, IsTypePipe, JoinPipe, KeysPipe, MapPipe, MaxPipe, MinPipe, ReducePipe, RemapPipe, ReplacePipe, ReversePipe, RoundPipe, SafeHtmlPipe, TranslatePipe, ValuesPipe, AsyncMethodDirective, BackgroundDirective, DynamicTableTemplateDirective, GlobalTemplateDirective, IconDirective, NgxTemplateOutletDirective, PaginationDirective, PaginationItemDirective, ResourceIfDirective, StickyDirective, StickyClassDirective, UnorderedListItemDirective, UnorderedListTemplateDirective, DynamicTableComponent, PaginationMenuComponent, UnorderedListComponent], imports: [CommonModule,
5043
+ FormsModule], exports: [ChunkPipe, EntriesPipe, ExtraItemPropertiesPipe, FilterPipe, FindPipe, FormatNumberPipe, GetOffsetPipe, GetTypePipe, GlobalTemplatePipe, GroupByPipe, IsTypePipe, JoinPipe, KeysPipe, MapPipe, MaxPipe, MinPipe, ReducePipe, RemapPipe, ReplacePipe, ReversePipe, RoundPipe, SafeHtmlPipe, TranslatePipe, ValuesPipe, AsyncMethodDirective, BackgroundDirective, DynamicTableTemplateDirective, GlobalTemplateDirective, IconDirective, NgxTemplateOutletDirective, PaginationDirective, PaginationItemDirective, ResourceIfDirective, StickyDirective, StickyClassDirective, UnorderedListItemDirective, UnorderedListTemplateDirective, DynamicTableComponent, PaginationMenuComponent, UnorderedListComponent, FormsModule] });
5095
5044
  NgxUtilsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: NgxUtilsModule, providers: pipes, imports: [[
5096
5045
  CommonModule,
5097
5046
  FormsModule
@@ -5116,7 +5065,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImpor
5116
5065
  ],
5117
5066
  providers: pipes
5118
5067
  }]
5119
- }] });
5068
+ }], ctorParameters: function () { return []; } });
5120
5069
 
5121
5070
  /**
5122
5071
  * Generated bundle index. Do not edit.