@acorex/core 3.0.31 → 3.0.35
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.
- package/acorex-core.metadata.json +1 -1
- package/bundles/acorex-core.umd.js +59 -42
- package/bundles/acorex-core.umd.js.map +1 -1
- package/bundles/acorex-core.umd.min.js +1 -1
- package/bundles/acorex-core.umd.min.js.map +1 -1
- package/esm2015/lib/utils/render/render.service.js +38 -31
- package/esm5/lib/utils/render/render.service.js +62 -45
- package/fesm2015/acorex-core.js +37 -30
- package/fesm2015/acorex-core.js.map +1 -1
- package/fesm5/acorex-core.js +61 -44
- package/fesm5/acorex-core.js.map +1 -1
- package/lib/utils/render/render.service.d.ts +3 -2
- package/package.json +1 -1
package/fesm5/acorex-core.js
CHANGED
|
@@ -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';
|
|
@@ -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
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
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
|
-
|
|
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
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
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
|
-
|
|
2079
|
-
|
|
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
|
-
|
|
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);
|