@acorex/core 3.0.33 → 3.0.42

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,7 +1,7 @@
1
1
  import * as moment_ from 'jalali-moment';
2
2
  import { Subject } from 'rxjs';
3
- import { __extends, __decorate, __metadata, __spread } from 'tslib';
4
- import { EventEmitter, InjectionToken, Injector, ɵɵdefineInjectable, ɵɵinject, INJECTOR, Injectable, NgModule, Pipe, ApplicationRef, ComponentFactoryResolver, ElementRef, Input, HostListener, Directive } from '@angular/core';
3
+ import { __extends, __decorate, __metadata, __spread, __awaiter, __generator } from 'tslib';
4
+ import { EventEmitter, InjectionToken, Injector, ɵɵdefineInjectable, ɵɵinject, INJECTOR, Injectable, NgModule, Pipe, ApplicationRef, ComponentFactoryResolver, Compiler, ElementRef, Input, HostListener, Directive } from '@angular/core';
5
5
  import { CommonModule } from '@angular/common';
6
6
  import { HttpHeaders, HttpParams, HttpClient, HttpClientModule } from '@angular/common/http';
7
7
  import merge from 'lodash-es/merge';
@@ -321,7 +321,7 @@ var AXDateTime = /** @class */ (function () {
321
321
  return moment(date).locale('fa').format('YYYY/M/D');
322
322
  };
323
323
  AXDateTime.prototype.convertStringToGregorian = function (date, format) {
324
- return new Date((moment.from(date, 'fa', 'YYYY/MM/DD').format('YYYY/MM/DD')));
324
+ return new Date(moment.from(date, 'fa', 'YYYY/MM/DD').format('YYYY/MM/DD'));
325
325
  };
326
326
  AXDateTime.prototype.add = function (unit, amount) {
327
327
  if (unit === void 0) { unit = 'day'; }
@@ -2005,10 +2005,11 @@ var AXOnDemandPreloadService = /** @class */ (function () {
2005
2005
  }());
2006
2006
 
2007
2007
  var AXRenderService = /** @class */ (function () {
2008
- function AXRenderService(appRef, router, componentFactoryResolver, modulePreloadService, injector) {
2008
+ function AXRenderService(appRef, router, componentFactoryResolver, compiler, modulePreloadService, injector) {
2009
2009
  this.appRef = appRef;
2010
2010
  this.router = router;
2011
2011
  this.componentFactoryResolver = componentFactoryResolver;
2012
+ this.compiler = compiler;
2012
2013
  this.modulePreloadService = modulePreloadService;
2013
2014
  this.injector = injector;
2014
2015
  }
@@ -2044,69 +2045,85 @@ var AXRenderService = /** @class */ (function () {
2044
2045
  var found = null;
2045
2046
  var preload = false;
2046
2047
  var theLoop = function (i) {
2047
- setTimeout(function () {
2048
- found = _this._findLoadedComponentByRoute(path);
2049
- if (--i && found == null) {
2050
- if (!preload) {
2051
- _this.modulePreloadService.startPreload(path);
2052
- preload = true;
2048
+ setTimeout(function () { return __awaiter(_this, void 0, void 0, function () {
2049
+ return __generator(this, function (_a) {
2050
+ switch (_a.label) {
2051
+ case 0: return [4 /*yield*/, this._findLoadedComponentByRoute(path)];
2052
+ case 1:
2053
+ found = _a.sent();
2054
+ if (--i && found == null) {
2055
+ if (!preload) {
2056
+ this.modulePreloadService.startPreload(path);
2057
+ preload = true;
2058
+ }
2059
+ theLoop(i);
2060
+ }
2061
+ else if (found) {
2062
+ resolve(found);
2063
+ }
2064
+ else {
2065
+ reject();
2066
+ }
2067
+ return [2 /*return*/];
2053
2068
  }
2054
- theLoop(i);
2055
- }
2056
- else if (found) {
2057
- resolve(found);
2058
- }
2059
- else {
2060
- reject();
2061
- }
2062
- }, delay);
2069
+ });
2070
+ }); }, delay);
2063
2071
  };
2064
2072
  theLoop(loop);
2065
2073
  });
2066
2074
  };
2067
2075
  AXRenderService.prototype._findLoadedComponentByRoute = function (search) {
2068
- var found = null;
2069
- var f = function (list, path) {
2070
- for (var p in list) {
2071
- if (list.hasOwnProperty(p)) {
2072
- var route = list[p];
2073
- var pp = (route.path != '' && route.path != null) ? path + '/' + route.path : path;
2074
- if (pp == search && !route._loadedConfig && route.component) {
2075
- found = route;
2076
- break;
2076
+ return __awaiter(this, void 0, void 0, function () {
2077
+ var found, f, p, route;
2078
+ return __generator(this, function (_a) {
2079
+ found = null;
2080
+ f = function (children, parentPath) {
2081
+ for (var p in children) {
2082
+ if (children.hasOwnProperty(p)) {
2083
+ var route = children[p];
2084
+ var pp = (route.path != '' && route.path != null) ? parentPath + '/' + route.path : parentPath;
2085
+ if (pp == search && !route._loadedConfig && route.component) {
2086
+ found = route;
2087
+ return;
2088
+ }
2089
+ else if (route._loadedConfig || route.children) {
2090
+ f(route.children || route._loadedConfig.routes, pp);
2091
+ }
2092
+ }
2077
2093
  }
2078
- else if (route._loadedConfig) {
2079
- f(route._loadedConfig.routes, pp);
2094
+ };
2095
+ for (p in this.router.config) {
2096
+ if (this.router.config.hasOwnProperty(p)) {
2097
+ route = this.router.config[p];
2098
+ if (route.path === search && route.component) {
2099
+ found = route;
2100
+ }
2101
+ else if (route['_loadedConfig'] || route.children) {
2102
+ f(route.children || route['_loadedConfig'].routes, route.path);
2103
+ }
2104
+ if (found)
2105
+ break;
2080
2106
  }
2081
2107
  }
2082
- }
2083
- };
2084
- for (var p in this.router.config) {
2085
- if (this.router.config.hasOwnProperty(p)) {
2086
- var route = this.router.config[p];
2087
- if (route.path === search && route.component) {
2088
- found = route;
2089
- }
2090
- else if (route['_loadedConfig']) {
2091
- f(route['_loadedConfig'].routes, route.path);
2092
- }
2093
- }
2094
- }
2095
- return found;
2108
+ return [2 /*return*/, found];
2109
+ });
2110
+ });
2096
2111
  };
2097
2112
  AXRenderService.ctorParameters = function () { return [
2098
2113
  { type: ApplicationRef },
2099
2114
  { type: Router },
2100
2115
  { type: ComponentFactoryResolver },
2116
+ { type: Compiler },
2101
2117
  { type: AXOnDemandPreloadService },
2102
2118
  { type: Injector }
2103
2119
  ]; };
2104
- AXRenderService.ɵprov = ɵɵdefineInjectable({ factory: function AXRenderService_Factory() { return new AXRenderService(ɵɵinject(ApplicationRef), ɵɵinject(Router), ɵɵinject(ComponentFactoryResolver), ɵɵinject(AXOnDemandPreloadService), ɵɵinject(INJECTOR)); }, token: AXRenderService, providedIn: "root" });
2120
+ AXRenderService.ɵprov = ɵɵdefineInjectable({ factory: function AXRenderService_Factory() { return new AXRenderService(ɵɵinject(ApplicationRef), ɵɵinject(Router), ɵɵinject(ComponentFactoryResolver), ɵɵinject(Compiler), ɵɵinject(AXOnDemandPreloadService), ɵɵinject(INJECTOR)); }, token: AXRenderService, providedIn: "root" });
2105
2121
  AXRenderService = __decorate([
2106
2122
  Injectable({ providedIn: 'root' }),
2107
2123
  __metadata("design:paramtypes", [ApplicationRef,
2108
2124
  Router,
2109
2125
  ComponentFactoryResolver,
2126
+ Compiler,
2110
2127
  AXOnDemandPreloadService,
2111
2128
  Injector])
2112
2129
  ], AXRenderService);