@stemy/ngx-utils 11.2.8 → 12.0.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.
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
2
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('reflect-metadata'), require('moment'), require('rxjs/operators'), require('rxjs'), require('invokable'), require('@angular/router'), require('@angular/common'), require('ngx-device-detector'), require('@angular/common/http'), require('@angular/platform-browser'), require('resize-detector'), require('@angular/forms')) :
3
3
  typeof define === 'function' && define.amd ? define('@stemy/ngx-utils', ['exports', '@angular/core', 'reflect-metadata', 'moment', 'rxjs/operators', 'rxjs', 'invokable', '@angular/router', '@angular/common', 'ngx-device-detector', '@angular/common/http', '@angular/platform-browser', 'resize-detector', '@angular/forms'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.stemy = global.stemy || {}, global.stemy['ngx-utils'] = {}), global.ng.core, null, global.moment, global.rxjs.operators, global.rxjs, global.invokable, global.ng.router, global.ng.common, global['ngx-device-detector'], global.ng.common.http, global.ng.platformBrowser, global['resize-detector'], global.ng.forms));
5
- }(this, (function (exports, core, reflectMetadata, moment, operators, rxjs, invokable, router, common, ngxDeviceDetector, http, platformBrowser, resizeDetector, forms) { 'use strict';
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.stemy = global.stemy || {}, global.stemy["ngx-utils"] = {}), global.ng.core, null, global.moment, global.rxjs.operators, global.rxjs, global.invokable, global.ng.router, global.ng.common, global["ngx-device-detector"], global.ng.common.http, global.ng.platformBrowser, global["resize-detector"], global.ng.forms));
5
+ })(this, (function (exports, core, reflectMetadata, moment, operators, rxjs, invokable, router, common, ngxDeviceDetector, http, platformBrowser, resizeDetector, forms) { 'use strict';
6
6
 
7
7
  /*! *****************************************************************************
8
8
  Copyright (c) Microsoft Corporation.
@@ -28,6 +28,8 @@
28
28
  return extendStatics(d, b);
29
29
  };
30
30
  function __extends(d, b) {
31
+ if (typeof b !== "function" && b !== null)
32
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
31
33
  extendStatics(d, b);
32
34
  function __() { this.constructor = d; }
33
35
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
@@ -213,11 +215,13 @@
213
215
  }
214
216
  return ar;
215
217
  }
218
+ /** @deprecated */
216
219
  function __spread() {
217
220
  for (var ar = [], i = 0; i < arguments.length; i++)
218
221
  ar = ar.concat(__read(arguments[i]));
219
222
  return ar;
220
223
  }
224
+ /** @deprecated */
221
225
  function __spreadArrays() {
222
226
  for (var s = 0, i = 0, il = arguments.length; i < il; i++)
223
227
  s += arguments[i].length;
@@ -226,7 +230,11 @@
226
230
  r[k] = a[j];
227
231
  return r;
228
232
  }
229
- ;
233
+ function __spreadArray(to, from) {
234
+ for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
235
+ to[j] = from[i];
236
+ return to;
237
+ }
230
238
  function __await(v) {
231
239
  return this instanceof __await ? (this.v = v, this) : new __await(v);
232
240
  }
@@ -632,6 +640,8 @@
632
640
  var ICON_SERVICE = new core.InjectionToken("icon-service");
633
641
  var LANGUAGE_SERVICE = new core.InjectionToken("language-service");
634
642
  var AUTH_SERVICE = new core.InjectionToken("auth-service");
643
+ // --- Storage Service ---
644
+ exports.StorageMode = void 0;
635
645
  (function (StorageMode) {
636
646
  StorageMode[StorageMode["Local"] = 0] = "Local";
637
647
  StorageMode[StorageMode["Session"] = 1] = "Session";
@@ -2057,6 +2067,60 @@
2057
2067
  FactoryDependencies(AUTH_SERVICE, StateService)
2058
2068
  ], AuthGuard, "guardAuthStateField", null);
2059
2069
 
2070
+ var TimerUtils = /** @class */ (function () {
2071
+ function TimerUtils() {
2072
+ }
2073
+ TimerUtils.createTimeout = function (func, time) {
2074
+ // @dynamic
2075
+ var run = function (timer) {
2076
+ timer.clear();
2077
+ timer.id = setTimeout(function () {
2078
+ timer.id = null;
2079
+ timer.func();
2080
+ }, timer.time);
2081
+ };
2082
+ // @dynamic
2083
+ var clear = function (timer) {
2084
+ if (!timer.id)
2085
+ return;
2086
+ clearTimeout(timer.id);
2087
+ timer.id = null;
2088
+ };
2089
+ return TimerUtils.createTimer(run, clear, func, time);
2090
+ };
2091
+ TimerUtils.createInterval = function (func, time) {
2092
+ // @dynamic
2093
+ var run = function (timer) {
2094
+ timer.clear();
2095
+ timer.id = setInterval(timer.func, timer.time);
2096
+ };
2097
+ // @dynamic
2098
+ var clear = function (timer) {
2099
+ if (!timer.id)
2100
+ return;
2101
+ clearInterval(timer.id);
2102
+ timer.id = null;
2103
+ };
2104
+ return TimerUtils.createTimer(run, clear, func, time);
2105
+ };
2106
+ TimerUtils.createTimer = function (run, clear, func, time) {
2107
+ var timer = {};
2108
+ var setParams = function (func, time) {
2109
+ timer.func = !ObjectUtils.isFunction(func) ? (function () { }) : func;
2110
+ timer.time = !ObjectUtils.isNumber(time) ? 100 : time;
2111
+ };
2112
+ timer.run = function () { return run(timer); };
2113
+ timer.clear = function () { return clear(timer); };
2114
+ timer.set = function (func, time) {
2115
+ setParams(func, time);
2116
+ timer.run();
2117
+ };
2118
+ setParams(func, time);
2119
+ return timer;
2120
+ };
2121
+ return TimerUtils;
2122
+ }());
2123
+
2060
2124
  var ObservableUtils = /** @class */ (function () {
2061
2125
  function ObservableUtils() {
2062
2126
  }
@@ -2090,20 +2154,25 @@
2090
2154
  var subscriptions = [];
2091
2155
  subscribers.forEach(function (info) {
2092
2156
  var alreadyCalled = false;
2157
+ var timer = info.timeout > 0 ? TimerUtils.createTimeout() : 0;
2158
+ var cb = timer ? function () {
2159
+ var args = Array.from(arguments);
2160
+ timer.set(function () {
2161
+ info.cb.apply(null, args);
2162
+ }, info.timeout);
2163
+ } : info.cb;
2093
2164
  info.subjects.forEach(function (subject) {
2094
- var ss = subject.subscribe(function () {
2095
- var args = Array.from(arguments);
2096
- args.unshift(subject);
2165
+ var ss = subject.subscribe(function (value) {
2097
2166
  alreadyCalled = true;
2098
- info.cb.apply(null, args);
2167
+ cb.call(null, subject, value);
2099
2168
  });
2100
2169
  subscriptions.push(ss);
2101
2170
  });
2102
2171
  if (alreadyCalled)
2103
2172
  return;
2104
- info.cb();
2173
+ cb();
2105
2174
  });
2106
- return ObservableUtils.multiSubscription.apply(ObservableUtils, __spread(subscriptions));
2175
+ return ObservableUtils.multiSubscription.apply(ObservableUtils, __spreadArray([], __read(subscriptions)));
2107
2176
  };
2108
2177
  ObservableUtils.fromFunction = function (callbackFunc) {
2109
2178
  var subject;
@@ -2294,60 +2363,6 @@
2294
2363
  return SetUtils;
2295
2364
  }());
2296
2365
 
2297
- var TimerUtils = /** @class */ (function () {
2298
- function TimerUtils() {
2299
- }
2300
- TimerUtils.createTimeout = function (func, time) {
2301
- // @dynamic
2302
- var run = function (timer) {
2303
- timer.clear();
2304
- timer.id = setTimeout(function () {
2305
- timer.id = null;
2306
- timer.func();
2307
- }, timer.time);
2308
- };
2309
- // @dynamic
2310
- var clear = function (timer) {
2311
- if (!timer.id)
2312
- return;
2313
- clearTimeout(timer.id);
2314
- timer.id = null;
2315
- };
2316
- return TimerUtils.createTimer(run, clear, func, time);
2317
- };
2318
- TimerUtils.createInterval = function (func, time) {
2319
- // @dynamic
2320
- var run = function (timer) {
2321
- timer.clear();
2322
- timer.id = setInterval(timer.func, timer.time);
2323
- };
2324
- // @dynamic
2325
- var clear = function (timer) {
2326
- if (!timer.id)
2327
- return;
2328
- clearInterval(timer.id);
2329
- timer.id = null;
2330
- };
2331
- return TimerUtils.createTimer(run, clear, func, time);
2332
- };
2333
- TimerUtils.createTimer = function (run, clear, func, time) {
2334
- var timer = {};
2335
- var setParams = function (func, time) {
2336
- timer.func = !ObjectUtils.isFunction(func) ? (function () { }) : func;
2337
- timer.time = !ObjectUtils.isNumber(time) ? 100 : time;
2338
- };
2339
- timer.run = function () { return run(timer); };
2340
- timer.clear = function () { return clear(timer); };
2341
- timer.set = function (func, time) {
2342
- setParams(func, time);
2343
- timer.run();
2344
- };
2345
- setParams(func, time);
2346
- return timer;
2347
- };
2348
- return TimerUtils;
2349
- }());
2350
-
2351
2366
  var UniqueUtils = /** @class */ (function () {
2352
2367
  function UniqueUtils() {
2353
2368
  }
@@ -3157,7 +3172,7 @@
3157
3172
  }
3158
3173
  }
3159
3174
  this.baseConfig = baseConfig || {};
3160
- this.loadedConfig = Object.assign(this.baseConfig, !baseUrl ? {} : { baseUrl: baseUrl, baseDomain: this.parseDomain(baseUrl) });
3175
+ this.loadedConfig = Object.assign(!baseUrl ? {} : { baseUrl: baseUrl, baseDomain: this.parseDomain(baseUrl) }, this.baseConfig);
3161
3176
  this.scriptParameters = scriptParams || {};
3162
3177
  this.loaderFunc = function () {
3163
3178
  _this.loader = _this.loader || new Promise(function (resolve, reject) {
@@ -4015,7 +4030,7 @@
4015
4030
  { type: core.NgZone, decorators: [{ type: core.Inject, args: [core.NgZone,] }] }
4016
4031
  ]; };
4017
4032
 
4018
- function emptyRemove() {
4033
+ function emptyRemove$1() {
4019
4034
  }
4020
4035
  var ResizeEventPlugin = /** @class */ (function (_super) {
4021
4036
  __extends(ResizeEventPlugin, _super);
@@ -4032,7 +4047,7 @@
4032
4047
  var zone = this.manager.getZone();
4033
4048
  return zone.runOutsideAngular(function () {
4034
4049
  if (_this.universal.isServer)
4035
- return emptyRemove;
4050
+ return emptyRemove$1;
4036
4051
  var cb = function (el) {
4037
4052
  zone.run(function () { return handler(el); });
4038
4053
  };
@@ -4051,10 +4066,10 @@
4051
4066
  var zone = this.manager.getZone();
4052
4067
  return zone.runOutsideAngular(function () {
4053
4068
  if (_this.universal.isServer)
4054
- return emptyRemove;
4069
+ return emptyRemove$1;
4055
4070
  if (!StringUtils.has(element, "document", "window")) {
4056
4071
  console.error("Global resize event other than window or document?", element);
4057
- return emptyRemove;
4072
+ return emptyRemove$1;
4058
4073
  }
4059
4074
  var target = "window" == element ? window : document;
4060
4075
  var listener = handler;
@@ -4063,7 +4078,7 @@
4063
4078
  });
4064
4079
  };
4065
4080
  return ResizeEventPlugin;
4066
- }(platformBrowserangular_packages_platform_browser_platform_browser_g));
4081
+ }(platformBrowser["ɵangular_packages_platform_browser_platform_browser_g"]));
4067
4082
  ResizeEventPlugin.EVENT_NAME = "resize";
4068
4083
  ResizeEventPlugin.decorators = [
4069
4084
  { type: core.Injectable }
@@ -4073,7 +4088,7 @@
4073
4088
  { type: UniversalService }
4074
4089
  ]; };
4075
4090
 
4076
- function emptyRemove$1() {
4091
+ function emptyRemove() {
4077
4092
  }
4078
4093
  var ScrollEventPlugin = /** @class */ (function (_super) {
4079
4094
  __extends(ScrollEventPlugin, _super);
@@ -4090,7 +4105,7 @@
4090
4105
  var zone = this.manager.getZone();
4091
4106
  return zone.runOutsideAngular(function () {
4092
4107
  if (_this.universal.isServer)
4093
- return emptyRemove$1;
4108
+ return emptyRemove;
4094
4109
  var callback = function (e) {
4095
4110
  zone.run(function () { return handler(e); });
4096
4111
  };
@@ -4103,10 +4118,10 @@
4103
4118
  var zone = this.manager.getZone();
4104
4119
  return zone.runOutsideAngular(function () {
4105
4120
  if (_this.universal.isServer)
4106
- return emptyRemove$1;
4121
+ return emptyRemove;
4107
4122
  if (!StringUtils.has(element, "document", "window")) {
4108
4123
  console.error("Global resize event other than window or document?", element);
4109
- return emptyRemove$1;
4124
+ return emptyRemove;
4110
4125
  }
4111
4126
  var target = "window" == element ? window : document;
4112
4127
  var listener = handler;
@@ -4115,7 +4130,7 @@
4115
4130
  });
4116
4131
  };
4117
4132
  return ScrollEventPlugin;
4118
- }(platformBrowserangular_packages_platform_browser_platform_browser_g));
4133
+ }(platformBrowser["ɵangular_packages_platform_browser_platform_browser_g"]));
4119
4134
  ScrollEventPlugin.EVENT_NAME = "scroll";
4120
4135
  ScrollEventPlugin.decorators = [
4121
4136
  { type: core.Injectable }
@@ -4202,14 +4217,14 @@
4202
4217
  },] }
4203
4218
  ];
4204
4219
 
4205
- function defaultFilter() {
4220
+ function defaultFilter$1() {
4206
4221
  return true;
4207
4222
  }
4208
4223
  var FilterPipe = /** @class */ (function () {
4209
4224
  function FilterPipe() {
4210
4225
  }
4211
4226
  FilterPipe.prototype.transform = function (values, filter, params) {
4212
- if (filter === void 0) { filter = defaultFilter; }
4227
+ if (filter === void 0) { filter = defaultFilter$1; }
4213
4228
  if (params === void 0) { params = {}; }
4214
4229
  var isObject = ObjectUtils.isObject(values);
4215
4230
  if (!isObject && !ObjectUtils.isArray(values))
@@ -4243,14 +4258,14 @@
4243
4258
  },] }
4244
4259
  ];
4245
4260
 
4246
- function defaultFilter$1() {
4261
+ function defaultFilter() {
4247
4262
  return true;
4248
4263
  }
4249
4264
  var FindPipe = /** @class */ (function () {
4250
4265
  function FindPipe() {
4251
4266
  }
4252
4267
  FindPipe.prototype.transform = function (values, filter, params) {
4253
- if (filter === void 0) { filter = defaultFilter$1; }
4268
+ if (filter === void 0) { filter = defaultFilter; }
4254
4269
  if (params === void 0) { params = {}; }
4255
4270
  if (!ObjectUtils.isArray(values))
4256
4271
  return [];
@@ -5799,7 +5814,7 @@
5799
5814
  PaginationMenuComponent,
5800
5815
  UnorderedListComponent
5801
5816
  ];
5802
- var providers = __spread(pipes, [
5817
+ var providers = __spreadArray(__spreadArray([], __read(pipes)), [
5803
5818
  BaseHttpClient,
5804
5819
  BaseHttpService,
5805
5820
  AuthGuard,
@@ -5850,7 +5865,7 @@
5850
5865
  NgxUtilsModule.forRoot = function (config) {
5851
5866
  return {
5852
5867
  ngModule: NgxUtilsModule,
5853
- providers: __spread(providers, [
5868
+ providers: __spreadArray(__spreadArray([], __read(providers)), [
5854
5869
  {
5855
5870
  provide: API_SERVICE,
5856
5871
  useExisting: (!config ? null : config.apiService) || ApiService
@@ -5896,12 +5911,12 @@
5896
5911
  }());
5897
5912
  NgxUtilsModule.decorators = [
5898
5913
  { type: core.NgModule, args: [{
5899
- declarations: __spread(pipes, directives, components),
5914
+ declarations: __spreadArray(__spreadArray(__spreadArray([], __read(pipes)), __read(directives)), __read(components)),
5900
5915
  imports: [
5901
5916
  common.CommonModule,
5902
5917
  forms.FormsModule
5903
5918
  ],
5904
- exports: __spread(pipes, directives, components, [
5919
+ exports: __spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read(pipes)), __read(directives)), __read(components)), [
5905
5920
  forms.FormsModule
5906
5921
  ]),
5907
5922
  providers: pipes
@@ -6015,14 +6030,14 @@
6015
6030
  exports.ValuedPromise = ValuedPromise;
6016
6031
  exports.ValuesPipe = ValuesPipe;
6017
6032
  exports.Vector = Vector;
6018
- exports.ɵa = pipes;
6019
- exports.ɵb = directives;
6020
- exports.ɵc = components;
6021
- exports.ɵd = providers;
6022
- exports.ɵe = loadConfig;
6023
- exports.ɵf = StickyClassDirective;
6033
+ exports["ɵa"] = pipes;
6034
+ exports["ɵb"] = directives;
6035
+ exports["ɵc"] = components;
6036
+ exports["ɵd"] = providers;
6037
+ exports["ɵe"] = loadConfig;
6038
+ exports["ɵf"] = StickyClassDirective;
6024
6039
 
6025
6040
  Object.defineProperty(exports, '__esModule', { value: true });
6026
6041
 
6027
- })));
6042
+ }));
6028
6043
  //# sourceMappingURL=stemy-ngx-utils.umd.js.map