@stemy/ngx-utils 13.6.12 → 13.6.14

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 (116) hide show
  1. package/assets/ng.mjs +5 -0
  2. package/esm2020/ngx-utils/common-types.mjs +2 -1
  3. package/esm2020/ngx-utils/services/base-http.service.mjs +2 -2
  4. package/esm2020/ngx-utils/utils/cached-factory.mjs +16 -7
  5. package/esm2020/ngx-utils/utils/with-options-provider.mjs +24 -0
  6. package/esm2020/public_api.mjs +3 -2
  7. package/fesm2015/stemy-ngx-utils.mjs +35 -7
  8. package/fesm2015/stemy-ngx-utils.mjs.map +1 -1
  9. package/fesm2020/stemy-ngx-utils.mjs +39 -7
  10. package/fesm2020/stemy-ngx-utils.mjs.map +1 -1
  11. package/ngx-utils/common-types.d.ts +10 -0
  12. package/ngx-utils/utils/cached-factory.d.ts +2 -3
  13. package/ngx-utils/utils/with-options-provider.d.ts +3 -0
  14. package/package.json +1 -1
  15. package/public_api.d.ts +3 -2
  16. package/bundles/stemy-ngx-utils.umd.js +0 -6380
  17. package/bundles/stemy-ngx-utils.umd.js.map +0 -1
  18. package/esm2015/ngx-utils/common-types.js +0 -121
  19. package/esm2015/ngx-utils/components/dynamic-table/dynamic-table.component.js +0 -139
  20. package/esm2015/ngx-utils/components/pagination-menu/pagination-menu.component.js +0 -96
  21. package/esm2015/ngx-utils/components/unordered-list/unordered-list.component.js +0 -51
  22. package/esm2015/ngx-utils/directives/async-method.base.js +0 -66
  23. package/esm2015/ngx-utils/directives/async-method.directive.js +0 -17
  24. package/esm2015/ngx-utils/directives/background.directive.js +0 -51
  25. package/esm2015/ngx-utils/directives/dynamic-table-template.directive.js +0 -19
  26. package/esm2015/ngx-utils/directives/global-template.directive.js +0 -27
  27. package/esm2015/ngx-utils/directives/icon.directive.js +0 -59
  28. package/esm2015/ngx-utils/directives/ngx-template-outlet.directive.js +0 -88
  29. package/esm2015/ngx-utils/directives/pagination-item.directive.js +0 -33
  30. package/esm2015/ngx-utils/directives/pagination.directive.js +0 -76
  31. package/esm2015/ngx-utils/directives/resource-if.directive.js +0 -51
  32. package/esm2015/ngx-utils/directives/sticky-class.directive.js +0 -35
  33. package/esm2015/ngx-utils/directives/sticky.directive.js +0 -48
  34. package/esm2015/ngx-utils/directives/unordered-list-item.directive.js +0 -70
  35. package/esm2015/ngx-utils/directives/unordered-list-template.directive.js +0 -26
  36. package/esm2015/ngx-utils/ngx-utils.module.js +0 -246
  37. package/esm2015/ngx-utils/pipes/chunk.pipe.js +0 -21
  38. package/esm2015/ngx-utils/pipes/entries.pipe.js +0 -24
  39. package/esm2015/ngx-utils/pipes/extra-item-properties.pipe.js +0 -27
  40. package/esm2015/ngx-utils/pipes/filter.pipe.js +0 -33
  41. package/esm2015/ngx-utils/pipes/find.pipe.js +0 -25
  42. package/esm2015/ngx-utils/pipes/format-number.pipe.js +0 -19
  43. package/esm2015/ngx-utils/pipes/get-offset.pipe.js +0 -13
  44. package/esm2015/ngx-utils/pipes/get-type.pipe.js +0 -12
  45. package/esm2015/ngx-utils/pipes/global-template.pipe.js +0 -37
  46. package/esm2015/ngx-utils/pipes/group-by.pipe.js +0 -23
  47. package/esm2015/ngx-utils/pipes/is-type.pipe.js +0 -12
  48. package/esm2015/ngx-utils/pipes/join.pipe.js +0 -15
  49. package/esm2015/ngx-utils/pipes/keys.pipe.js +0 -18
  50. package/esm2015/ngx-utils/pipes/map.pipe.js +0 -25
  51. package/esm2015/ngx-utils/pipes/max.pipe.js +0 -22
  52. package/esm2015/ngx-utils/pipes/min.pipe.js +0 -22
  53. package/esm2015/ngx-utils/pipes/pop.pipe.js +0 -12
  54. package/esm2015/ngx-utils/pipes/reduce.pipe.js +0 -26
  55. package/esm2015/ngx-utils/pipes/remap.pipe.js +0 -28
  56. package/esm2015/ngx-utils/pipes/replace.pipe.js +0 -13
  57. package/esm2015/ngx-utils/pipes/reverse.pipe.js +0 -20
  58. package/esm2015/ngx-utils/pipes/round.pipe.js +0 -19
  59. package/esm2015/ngx-utils/pipes/safe-html.pipe.js +0 -32
  60. package/esm2015/ngx-utils/pipes/shift.pipe.js +0 -12
  61. package/esm2015/ngx-utils/pipes/split.pipe.js +0 -12
  62. package/esm2015/ngx-utils/pipes/translate.pipe.js +0 -81
  63. package/esm2015/ngx-utils/pipes/values.pipe.js +0 -18
  64. package/esm2015/ngx-utils/plugins/resize-event.plugin.js +0 -56
  65. package/esm2015/ngx-utils/plugins/scroll-event.plugin.js +0 -36
  66. package/esm2015/ngx-utils/services/acl.service.js +0 -81
  67. package/esm2015/ngx-utils/services/api.service.js +0 -39
  68. package/esm2015/ngx-utils/services/auth.service.js +0 -14
  69. package/esm2015/ngx-utils/services/base-http.client.js +0 -46
  70. package/esm2015/ngx-utils/services/base-http.service.js +0 -284
  71. package/esm2015/ngx-utils/services/config.service.js +0 -137
  72. package/esm2015/ngx-utils/services/error-handler.service.js +0 -49
  73. package/esm2015/ngx-utils/services/events.service.js +0 -24
  74. package/esm2015/ngx-utils/services/formatter.service.js +0 -46
  75. package/esm2015/ngx-utils/services/global-template.service.js +0 -35
  76. package/esm2015/ngx-utils/services/icon.service.js +0 -24
  77. package/esm2015/ngx-utils/services/language.service.js +0 -129
  78. package/esm2015/ngx-utils/services/open-api.service.js +0 -41
  79. package/esm2015/ngx-utils/services/promise.service.js +0 -52
  80. package/esm2015/ngx-utils/services/state.service.js +0 -181
  81. package/esm2015/ngx-utils/services/static-language.service.js +0 -152
  82. package/esm2015/ngx-utils/services/storage.service.js +0 -48
  83. package/esm2015/ngx-utils/services/toaster.service.js +0 -29
  84. package/esm2015/ngx-utils/services/translated-url.serializer.js +0 -70
  85. package/esm2015/ngx-utils/services/universal.service.js +0 -78
  86. package/esm2015/ngx-utils/utils/ajax-request-handler.js +0 -40
  87. package/esm2015/ngx-utils/utils/array.utils.js +0 -107
  88. package/esm2015/ngx-utils/utils/auth.guard.js +0 -156
  89. package/esm2015/ngx-utils/utils/canvas.utils.js +0 -388
  90. package/esm2015/ngx-utils/utils/date.utils.js +0 -29
  91. package/esm2015/ngx-utils/utils/file-system.js +0 -25
  92. package/esm2015/ngx-utils/utils/file.utils.js +0 -90
  93. package/esm2015/ngx-utils/utils/generic-value.js +0 -20
  94. package/esm2015/ngx-utils/utils/geometry.js +0 -132
  95. package/esm2015/ngx-utils/utils/initializer.js +0 -20
  96. package/esm2015/ngx-utils/utils/loader.utils.js +0 -55
  97. package/esm2015/ngx-utils/utils/math.utils.js +0 -45
  98. package/esm2015/ngx-utils/utils/object.utils.js +0 -320
  99. package/esm2015/ngx-utils/utils/observable.utils.js +0 -63
  100. package/esm2015/ngx-utils/utils/reflect.utils.js +0 -33
  101. package/esm2015/ngx-utils/utils/set.utils.js +0 -20
  102. package/esm2015/ngx-utils/utils/string.utils.js +0 -28
  103. package/esm2015/ngx-utils/utils/timer.utils.js +0 -52
  104. package/esm2015/ngx-utils/utils/unique.utils.js +0 -24
  105. package/esm2015/ngx-utils/utils/vector.js +0 -77
  106. package/esm2015/public_api.js +0 -89
  107. package/esm2015/stemy-ngx-utils.js +0 -7
  108. package/fesm2015/stemy-ngx-utils.js +0 -5060
  109. package/fesm2015/stemy-ngx-utils.js.map +0 -1
  110. package/stemy-ngx-utils.metadata.json +0 -1
  111. package/tools/circular.js +0 -117
  112. package/tools/circular.js.map +0 -1
  113. package/tools/config.js +0 -79
  114. package/tools/config.js.map +0 -1
  115. package/tools/icons.js +0 -14
  116. package/tools/icons.js.map +0 -1
@@ -371,6 +371,7 @@ class ReflectUtils {
371
371
  }
372
372
  }
373
373
 
374
+ const OPTIONS_TOKEN = new InjectionToken("custom-options-token");
374
375
  class CanvasColor {
375
376
  constructor(r, g, b, a = 255) {
376
377
  this.r = r;
@@ -1050,22 +1051,31 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImpor
1050
1051
  args: [AUTH_SERVICE]
1051
1052
  }] }]; } });
1052
1053
 
1053
- function cachedFactory(types) {
1054
+ const CACHED_TOKEN = new InjectionToken("cached-factory-token");
1055
+ function cachedFactory(providers) {
1054
1056
  let cached = null;
1055
1057
  return (injector) => {
1056
1058
  if (cached !== null) {
1057
1059
  return cached;
1058
1060
  }
1059
1061
  const subInjector = Injector.create({
1060
- providers: types.map(type => {
1062
+ providers: providers.map(p => {
1063
+ if (("useFactory" in p && "deps" in p) || "useValue" in p) {
1064
+ return {
1065
+ provide: CACHED_TOKEN,
1066
+ multi: true,
1067
+ ...p
1068
+ };
1069
+ }
1061
1070
  return {
1062
- provide: type,
1063
- useClass: type,
1071
+ provide: CACHED_TOKEN,
1072
+ multi: true,
1073
+ useClass: p
1064
1074
  };
1065
1075
  }),
1066
1076
  parent: injector
1067
1077
  });
1068
- cached = types.map(type => subInjector.get(type));
1078
+ cached = subInjector.get(CACHED_TOKEN);
1069
1079
  return cached;
1070
1080
  };
1071
1081
  }
@@ -2182,6 +2192,28 @@ class Vector {
2182
2192
  }
2183
2193
  }
2184
2194
 
2195
+ function provideWithOptions(type, options) {
2196
+ return {
2197
+ useFactory: function (injector) {
2198
+ const subInjector = Injector.create({
2199
+ providers: [
2200
+ {
2201
+ provide: OPTIONS_TOKEN,
2202
+ useValue: options
2203
+ },
2204
+ {
2205
+ provide: type,
2206
+ useClass: type
2207
+ }
2208
+ ],
2209
+ parent: injector
2210
+ });
2211
+ return subInjector.get(type);
2212
+ },
2213
+ deps: [Injector]
2214
+ };
2215
+ }
2216
+
2185
2217
  function workerFunction(JSONfn, logTimes) {
2186
2218
  let wasmResolve = null;
2187
2219
  const wasmInstance = new Promise(resolve => {
@@ -2528,7 +2560,7 @@ class BaseHttpService {
2528
2560
  const finalRequest = ObjectUtils.isNumber(options.timeout) && options.timeout > 0
2529
2561
  ? request.pipe(timeout(options.timeout)) : request;
2530
2562
  finalRequest.subscribe((event) => {
2531
- if (options.reportProgress && event.type === HttpEventType.UploadProgress) {
2563
+ if (options.reportProgress && event?.type === HttpEventType.UploadProgress) {
2532
2564
  const progress = {
2533
2565
  percentage: MathUtils.round(event.loaded / event.total, 2, 0.01),
2534
2566
  loaded: event.loaded,
@@ -5775,5 +5807,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImpor
5775
5807
  * Generated bundle index. Do not edit.
5776
5808
  */
5777
5809
 
5778
- export { API_SERVICE, APP_BASE_URL, AUTH_SERVICE, AclService, AjaxRequestHandler, ApiService, ArrayUtils, AsyncMethodBase, AsyncMethodDirective, AuthGuard, BASE_CONFIG, BackgroundDirective, BaseHttpClient, BaseHttpService, CONFIG_SERVICE, CanvasColor, CanvasUtils, ChunkPipe, Circle, ConfigService, ConsoleToasterService, DateUtils, DynamicTableComponent, DynamicTableTemplateDirective, ERROR_HANDLER, EXPRESS_REQUEST, EntriesPipe, ErrorHandlerService, EventsService, ExtraItemPropertiesPipe, FactoryDependencies, FileSystemEntry, FileUtils, FilterPipe, FindPipe, FormatNumberPipe, FormatterService, GLOBAL_TEMPLATES, GenericValue, GetOffsetPipe, GetTypePipe, GlobalTemplateDirective, GlobalTemplatePipe, GlobalTemplateService, GroupByPipe, HttpPromise, ICON_SERVICE, IConfiguration, IconDirective, IconService, Initializer, IsTypePipe, JSONfn, JoinPipe, KeysPipe, LANGUAGE_SERVICE, LanguageService, LoaderUtils, LocalHttpService, MapPipe, MathUtils, MaxPipe, MinPipe, NgxTemplateOutletDirective, NgxUtilsModule, ObjectType, ObjectUtils, ObservableUtils, OpenApiService, PROMISE_SERVICE, PaginationDirective, PaginationItemContext, PaginationItemDirective, PaginationMenuComponent, Point, PopPipe, PromiseService, RESIZE_DELAY, RESIZE_STRATEGY, ROOT_ELEMENT, Rect, ReducePipe, ReflectUtils, RemapPipe, ReplacePipe, ResizeEventPlugin, ResourceIfContext, ResourceIfDirective, ReversePipe, RoundPipe, SCRIPT_PARAMS, SafeHtmlPipe, ScrollEventPlugin, SetUtils, ShiftPipe, SplitPipe, StateService, StaticAuthService, StaticLanguageService, StickyClassDirective, StickyDirective, StorageMode, StorageService, StringUtils, TOASTER_SERVICE, TimerUtils, TranslatePipe, TranslatedUrlSerializer, UniqueUtils, UniversalService, UnorderedListComponent, UnorderedListItemDirective, UnorderedListTemplateDirective, ValuedPromise, ValuesPipe, Vector, WASI_IMPLEMENTATION, WasmService, cachedFactory };
5810
+ export { API_SERVICE, APP_BASE_URL, AUTH_SERVICE, AclService, AjaxRequestHandler, ApiService, ArrayUtils, AsyncMethodBase, AsyncMethodDirective, AuthGuard, BASE_CONFIG, BackgroundDirective, BaseHttpClient, BaseHttpService, CONFIG_SERVICE, CanvasColor, CanvasUtils, ChunkPipe, Circle, ConfigService, ConsoleToasterService, DateUtils, DynamicTableComponent, DynamicTableTemplateDirective, ERROR_HANDLER, EXPRESS_REQUEST, EntriesPipe, ErrorHandlerService, EventsService, ExtraItemPropertiesPipe, FactoryDependencies, FileSystemEntry, FileUtils, FilterPipe, FindPipe, FormatNumberPipe, FormatterService, GLOBAL_TEMPLATES, GenericValue, GetOffsetPipe, GetTypePipe, GlobalTemplateDirective, GlobalTemplatePipe, GlobalTemplateService, GroupByPipe, HttpPromise, ICON_SERVICE, IConfiguration, IconDirective, IconService, Initializer, IsTypePipe, JSONfn, JoinPipe, KeysPipe, LANGUAGE_SERVICE, LanguageService, LoaderUtils, LocalHttpService, MapPipe, MathUtils, MaxPipe, MinPipe, NgxTemplateOutletDirective, NgxUtilsModule, OPTIONS_TOKEN, ObjectType, ObjectUtils, ObservableUtils, OpenApiService, PROMISE_SERVICE, PaginationDirective, PaginationItemContext, PaginationItemDirective, PaginationMenuComponent, Point, PopPipe, PromiseService, RESIZE_DELAY, RESIZE_STRATEGY, ROOT_ELEMENT, Rect, ReducePipe, ReflectUtils, RemapPipe, ReplacePipe, ResizeEventPlugin, ResourceIfContext, ResourceIfDirective, ReversePipe, RoundPipe, SCRIPT_PARAMS, SafeHtmlPipe, ScrollEventPlugin, SetUtils, ShiftPipe, SplitPipe, StateService, StaticAuthService, StaticLanguageService, StickyClassDirective, StickyDirective, StorageMode, StorageService, StringUtils, TOASTER_SERVICE, TimerUtils, TranslatePipe, TranslatedUrlSerializer, UniqueUtils, UniversalService, UnorderedListComponent, UnorderedListItemDirective, UnorderedListTemplateDirective, ValuedPromise, ValuesPipe, Vector, WASI_IMPLEMENTATION, WasmService, cachedFactory, provideWithOptions };
5779
5811
  //# sourceMappingURL=stemy-ngx-utils.mjs.map