@stemy/ngx-utils 11.0.8 → 11.1.0

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 (94) hide show
  1. package/README.md +27 -27
  2. package/bundles/stemy-ngx-utils.umd.js +22 -7
  3. package/bundles/stemy-ngx-utils.umd.js.map +1 -1
  4. package/bundles/stemy-ngx-utils.umd.min.js +1 -1
  5. package/bundles/stemy-ngx-utils.umd.min.js.map +1 -1
  6. package/esm2015/ngx-utils/common-types.js +2 -1
  7. package/esm2015/ngx-utils/ngx-utils.module.js +6 -2
  8. package/esm2015/ngx-utils/services/config.service.js +8 -4
  9. package/esm2015/ngx-utils/services/promise.service.js +4 -1
  10. package/esm2015/ngx-utils/services/static-language.service.js +9 -7
  11. package/esm2015/ngx-utils/utils/unique.utils.js +1 -1
  12. package/esm2015/public_api.js +2 -2
  13. package/fesm2015/stemy-ngx-utils.js +22 -8
  14. package/fesm2015/stemy-ngx-utils.js.map +1 -1
  15. package/ngx-utils/common-types.d.ts +2 -0
  16. package/ngx-utils/services/config.service.d.ts +3 -1
  17. package/ngx-utils/services/promise.service.d.ts +5 -4
  18. package/ngx-utils/services/static-language.service.d.ts +3 -2
  19. package/package.json +1 -1
  20. package/public_api.d.ts +1 -1
  21. package/stemy-ngx-utils.metadata.json +1 -1
  22. package/esm5/ngx-utils/common-types.js +0 -553
  23. package/esm5/ngx-utils/components/dynamic-table/dynamic-table.component.js +0 -285
  24. package/esm5/ngx-utils/components/pagination-menu/pagination-menu.component.js +0 -198
  25. package/esm5/ngx-utils/components/unordered-list/unordered-list.component.js +0 -110
  26. package/esm5/ngx-utils/directives/async-method.directive.js +0 -105
  27. package/esm5/ngx-utils/directives/background.directive.js +0 -91
  28. package/esm5/ngx-utils/directives/dynamic-table-template.directive.js +0 -34
  29. package/esm5/ngx-utils/directives/icon.directive.js +0 -101
  30. package/esm5/ngx-utils/directives/ngx-template-outlet.directive.js +0 -182
  31. package/esm5/ngx-utils/directives/pagination-item.directive.js +0 -70
  32. package/esm5/ngx-utils/directives/pagination.directive.js +0 -148
  33. package/esm5/ngx-utils/directives/resource-if.directive.js +0 -97
  34. package/esm5/ngx-utils/directives/sticky.directive.js +0 -93
  35. package/esm5/ngx-utils/directives/unordered-list-item.directive.js +0 -143
  36. package/esm5/ngx-utils/directives/unordered-list-template.directive.js +0 -54
  37. package/esm5/ngx-utils/ngx-utils.module.js +0 -205
  38. package/esm5/ngx-utils/pipes/chunk.pipe.js +0 -41
  39. package/esm5/ngx-utils/pipes/entries.pipe.js +0 -54
  40. package/esm5/ngx-utils/pipes/extra-item-properties.pipe.js +0 -51
  41. package/esm5/ngx-utils/pipes/filter.pipe.js +0 -65
  42. package/esm5/ngx-utils/pipes/find.pipe.js +0 -51
  43. package/esm5/ngx-utils/pipes/format-number.pipe.js +0 -44
  44. package/esm5/ngx-utils/pipes/get-offset.pipe.js +0 -31
  45. package/esm5/ngx-utils/pipes/get-type.pipe.js +0 -28
  46. package/esm5/ngx-utils/pipes/group-by.pipe.js +0 -48
  47. package/esm5/ngx-utils/pipes/is-type.pipe.js +0 -30
  48. package/esm5/ngx-utils/pipes/join.pipe.js +0 -34
  49. package/esm5/ngx-utils/pipes/keys.pipe.js +0 -35
  50. package/esm5/ngx-utils/pipes/map.pipe.js +0 -52
  51. package/esm5/ngx-utils/pipes/max.pipe.js +0 -45
  52. package/esm5/ngx-utils/pipes/min.pipe.js +0 -45
  53. package/esm5/ngx-utils/pipes/reduce.pipe.js +0 -55
  54. package/esm5/ngx-utils/pipes/remap.pipe.js +0 -51
  55. package/esm5/ngx-utils/pipes/replace.pipe.js +0 -32
  56. package/esm5/ngx-utils/pipes/reverse.pipe.js +0 -38
  57. package/esm5/ngx-utils/pipes/round.pipe.js +0 -44
  58. package/esm5/ngx-utils/pipes/safe-html.pipe.js +0 -54
  59. package/esm5/ngx-utils/pipes/translate.pipe.js +0 -111
  60. package/esm5/ngx-utils/pipes/values.pipe.js +0 -35
  61. package/esm5/ngx-utils/plugins/resize-event.plugin.js +0 -122
  62. package/esm5/ngx-utils/plugins/scroll-event.plugin.js +0 -110
  63. package/esm5/ngx-utils/services/acl.service.js +0 -119
  64. package/esm5/ngx-utils/services/auth.service.js +0 -40
  65. package/esm5/ngx-utils/services/events.service.js +0 -33
  66. package/esm5/ngx-utils/services/formatter.service.js +0 -124
  67. package/esm5/ngx-utils/services/icon.service.js +0 -32
  68. package/esm5/ngx-utils/services/language.service.js +0 -199
  69. package/esm5/ngx-utils/services/promise.service.js +0 -123
  70. package/esm5/ngx-utils/services/state.service.js +0 -271
  71. package/esm5/ngx-utils/services/storage.service.js +0 -100
  72. package/esm5/ngx-utils/services/toaster.service.js +0 -100
  73. package/esm5/ngx-utils/services/universal.service.js +0 -153
  74. package/esm5/ngx-utils/utils/ajax-request-handler.js +0 -73
  75. package/esm5/ngx-utils/utils/array.utils.js +0 -182
  76. package/esm5/ngx-utils/utils/auth.guard.js +0 -205
  77. package/esm5/ngx-utils/utils/canvas.utils.js +0 -668
  78. package/esm5/ngx-utils/utils/date.utils.js +0 -91
  79. package/esm5/ngx-utils/utils/file.utils.js +0 -201
  80. package/esm5/ngx-utils/utils/loader.utils.js +0 -90
  81. package/esm5/ngx-utils/utils/math.utils.js +0 -62
  82. package/esm5/ngx-utils/utils/object.utils.js +0 -513
  83. package/esm5/ngx-utils/utils/observable.utils.js +0 -30
  84. package/esm5/ngx-utils/utils/reflect.utils.js +0 -95
  85. package/esm5/ngx-utils/utils/set.utils.js +0 -48
  86. package/esm5/ngx-utils/utils/string.utils.js +0 -94
  87. package/esm5/ngx-utils/utils/timer.utils.js +0 -100
  88. package/esm5/ngx-utils/utils/unique.utils.js +0 -54
  89. package/esm5/ngx-utils/utils/vector.js +0 -223
  90. package/esm5/public_api.js +0 -73
  91. package/esm5/stemy-ngx-utils.js +0 -11
  92. package/fesm5/stemy-ngx-utils.js +0 -6709
  93. package/fesm5/stemy-ngx-utils.js.map +0 -1
  94. package/typings.d.ts +0 -5
package/README.md CHANGED
@@ -1,27 +1,27 @@
1
- # NgxUtils
2
-
3
- This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 1.7.3.
4
-
5
- ## Development server
6
-
7
- Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
8
-
9
- ## Code scaffolding
10
-
11
- Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
12
-
13
- ## Build
14
-
15
- Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `-prod` flag for a production build.
16
-
17
- ## Running unit tests
18
-
19
- Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
20
-
21
- ## Running end-to-end tests
22
-
23
- Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
24
-
25
- ## Further help
26
-
27
- To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
1
+ # NgxUtils
2
+
3
+ This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 1.7.3.
4
+
5
+ ## Development server
6
+
7
+ Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
8
+
9
+ ## Code scaffolding
10
+
11
+ Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
12
+
13
+ ## Build
14
+
15
+ Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `-prod` flag for a production build.
16
+
17
+ ## Running unit tests
18
+
19
+ Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
20
+
21
+ ## Running end-to-end tests
22
+
23
+ Run `ng e2e` to execute the end-to-end tests via [Protractor](http://www.protractortest.org/).
24
+
25
+ ## Further help
26
+
27
+ To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).
@@ -780,6 +780,7 @@
780
780
  var CONFIG_SERVICE = new core.InjectionToken("config-service");
781
781
  var BASE_CONFIG = new core.InjectionToken("base-config");
782
782
  var SCRIPT_PARAMS = new core.InjectionToken("script-params");
783
+ var ROOT_ELEMENT = new core.InjectionToken("app-root-element");
783
784
  var ERROR_HANDLER = new core.InjectionToken("error-handler-callback");
784
785
  // --- Valued promise ---
785
786
  var ValuedPromise = /** @class */ (function (_super) {
@@ -3130,12 +3131,13 @@
3130
3131
  }());
3131
3132
 
3132
3133
  var ConfigService = /** @class */ (function () {
3133
- function ConfigService(http, universal, baseConfig, scriptParams) {
3134
+ function ConfigService(http, universal, rootElement, baseConfig, scriptParams) {
3134
3135
  var _this = this;
3135
3136
  if (baseConfig === void 0) { baseConfig = null; }
3136
3137
  if (scriptParams === void 0) { scriptParams = null; }
3137
3138
  this.http = http;
3138
3139
  this.universal = universal;
3140
+ this.rootElement = rootElement;
3139
3141
  for (var key in []) {
3140
3142
  Object.defineProperty(Array.prototype, key, {
3141
3143
  enumerable: false
@@ -3150,13 +3152,15 @@
3150
3152
  baseUrl = scriptSrc.substr(0, srcParts[0].lastIndexOf("/") + 1);
3151
3153
  }
3152
3154
  }
3153
- this.loadedConfig = Object.assign(!baseUrl ? {} : { baseUrl: baseUrl }, baseConfig || {});
3155
+ this.baseConfig = baseConfig || {};
3156
+ this.loadedConfig = Object.assign(!baseUrl ? {} : { baseUrl: baseUrl }, this.baseConfig);
3154
3157
  this.scriptParameters = scriptParams || {};
3155
3158
  this.loaderFunc = function () {
3156
3159
  _this.loader = _this.loader || new Promise(function (resolve, reject) {
3157
3160
  _this.loadJson().then(function (config) {
3158
3161
  _this.loadedConfig = config = Object.assign(_this.loadedConfig, config);
3159
3162
  _this.prepareConfig(config).then(function (c) {
3163
+ _this.loadedConfig = c;
3160
3164
  c.baseUrl = c.baseUrl || "/";
3161
3165
  resolve(c);
3162
3166
  });
@@ -3234,6 +3238,7 @@
3234
3238
  ConfigService.ctorParameters = function () { return [
3235
3239
  { type: http.HttpClient },
3236
3240
  { type: UniversalService },
3241
+ { type: undefined, decorators: [{ type: core.Inject, args: [ROOT_ELEMENT,] }] },
3237
3242
  { type: IConfiguration, decorators: [{ type: core.Optional }, { type: core.Inject, args: [BASE_CONFIG,] }] },
3238
3243
  { type: undefined, decorators: [{ type: core.Optional }, { type: core.Inject, args: [SCRIPT_PARAMS,] }] }
3239
3244
  ]; };
@@ -3431,10 +3436,11 @@
3431
3436
  IconService.ctorParameters = function () { return []; };
3432
3437
 
3433
3438
  var StaticLanguageService = /** @class */ (function () {
3434
- function StaticLanguageService(events, storage, configs, client) {
3439
+ function StaticLanguageService(events, storage, configs, promises, client) {
3435
3440
  this.events = events;
3436
3441
  this.storage = storage;
3437
3442
  this.configs = configs;
3443
+ this.promises = promises;
3438
3444
  this.client = client;
3439
3445
  this.editLang = null;
3440
3446
  this.currentLang = null;
@@ -3567,7 +3573,7 @@
3567
3573
  throw new Error("Parameter \"key\" required");
3568
3574
  }
3569
3575
  var translation = ObjectUtils.getValue(this.dictionary, key, key) || key;
3570
- return Promise.resolve(this.interpolate(translation, params));
3576
+ return this.promises.resolve(this.interpolate(translation, params));
3571
3577
  };
3572
3578
  StaticLanguageService.prototype.getTranslations = function () {
3573
3579
  var _this = this;
@@ -3575,8 +3581,8 @@
3575
3581
  for (var _i = 0; _i < arguments.length; _i++) {
3576
3582
  keys[_i] = arguments[_i];
3577
3583
  }
3578
- return new Promise(function (resolve) {
3579
- Promise.all(keys.map(function (key) { return _this.getTranslation(key); })).then(function (translations) {
3584
+ return this.promises.create(function (resolve) {
3585
+ _this.promises.all(keys.map(function (key) { return _this.getTranslation(key); })).then(function (translations) {
3580
3586
  resolve(keys.reduce(function (result, key, i) {
3581
3587
  result[key] = translations[i];
3582
3588
  return result;
@@ -3619,7 +3625,8 @@
3619
3625
  { type: EventsService, decorators: [{ type: core.Inject, args: [EventsService,] }] },
3620
3626
  { type: StorageService, decorators: [{ type: core.Inject, args: [StorageService,] }] },
3621
3627
  { type: undefined, decorators: [{ type: core.Inject, args: [CONFIG_SERVICE,] }] },
3622
- { type: BaseHttpClient }
3628
+ { type: undefined, decorators: [{ type: core.Inject, args: [PROMISE_SERVICE,] }] },
3629
+ { type: BaseHttpClient, decorators: [{ type: core.Inject, args: [BaseHttpClient,] }] }
3623
3630
  ]; };
3624
3631
 
3625
3632
  var LanguageService = /** @class */ (function (_super) {
@@ -3961,6 +3968,9 @@
3961
3968
  PromiseService.prototype.resolve = function (value) {
3962
3969
  return this.add(this.zone.runOutsideAngular(function () { return Promise.resolve(value); }));
3963
3970
  };
3971
+ PromiseService.prototype.reject = function (value) {
3972
+ return this.add(this.zone.runOutsideAngular(function () { return Promise.reject(value); }));
3973
+ };
3964
3974
  PromiseService.prototype.promiseFinished = function () {
3965
3975
  if (this.promiseCount == 0)
3966
3976
  return;
@@ -5854,6 +5864,10 @@
5854
5864
  provide: CONFIG_SERVICE,
5855
5865
  useExisting: (!config ? null : config.configService) || ConfigService
5856
5866
  },
5867
+ {
5868
+ provide: ROOT_ELEMENT,
5869
+ useValue: null
5870
+ },
5857
5871
  {
5858
5872
  provide: core.APP_INITIALIZER,
5859
5873
  useFactory: (!config ? null : config.initializeApp) || loadConfig,
@@ -5952,6 +5966,7 @@
5952
5966
  exports.PaginationMenuComponent = PaginationMenuComponent;
5953
5967
  exports.Point = Point;
5954
5968
  exports.PromiseService = PromiseService;
5969
+ exports.ROOT_ELEMENT = ROOT_ELEMENT;
5955
5970
  exports.Rect = Rect;
5956
5971
  exports.ReducePipe = ReducePipe;
5957
5972
  exports.ReflectUtils = ReflectUtils;