@o3r/routing 10.0.0-next.9 → 11.0.0-next.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.
- package/README.md +1 -1
- package/esm2022/public_api.mjs +1 -2
- package/esm2022/stores/routing-guard/extra-effects/ngrx-store-router.effect.mjs +4 -4
- package/esm2022/stores/routing-guard/routing-guard.module.mjs +4 -4
- package/esm2022/tools/app-server-routing.module.mjs +9 -11
- package/esm2022/tools/on-navigation-strategy.preloader.mjs +5 -8
- package/fesm2022/o3r-routing.mjs +25 -311
- package/fesm2022/o3r-routing.mjs.map +1 -1
- package/package.json +15 -27
- package/public_api.d.ts +0 -1
- package/public_api.d.ts.map +1 -1
- package/schematics/ng-add/schema.json +2 -2
- package/tools/app-server-routing.module.d.ts +4 -6
- package/tools/app-server-routing.module.d.ts.map +1 -1
- package/tools/on-navigation-strategy.preloader.d.ts +1 -4
- package/tools/on-navigation-strategy.preloader.d.ts.map +1 -1
- package/esm2022/fixtures/jasmine/index.mjs +0 -2
- package/esm2022/fixtures/jasmine/o3r-routing-fixtures-jasmine.mjs +0 -5
- package/esm2022/fixtures/jasmine/request-parameters.fixture.jasmine.mjs +0 -27
- package/esm2022/fixtures/jest/index.mjs +0 -2
- package/esm2022/fixtures/jest/o3r-routing-fixtures-jest.mjs +0 -5
- package/esm2022/fixtures/jest/request-parameters.fixture.jest.mjs +0 -27
- package/esm2022/services/index.mjs +0 -2
- package/esm2022/services/request-parameters/index.mjs +0 -4
- package/esm2022/services/request-parameters/request-parameters.config.mjs +0 -31
- package/esm2022/services/request-parameters/request-parameters.module.mjs +0 -54
- package/esm2022/services/request-parameters/request-parameters.service.mjs +0 -197
- package/esm2022/services/request-parameters/request-parameters.token.mjs +0 -8
- package/fesm2022/o3r-routing-fixtures-jasmine.mjs +0 -34
- package/fesm2022/o3r-routing-fixtures-jasmine.mjs.map +0 -1
- package/fesm2022/o3r-routing-fixtures-jest.mjs +0 -34
- package/fesm2022/o3r-routing-fixtures-jest.mjs.map +0 -1
- package/fixtures/jasmine/index.d.ts +0 -2
- package/fixtures/jasmine/index.d.ts.map +0 -1
- package/fixtures/jasmine/o3r-routing-fixtures-jasmine.d.ts.map +0 -1
- package/fixtures/jasmine/request-parameters.fixture.jasmine.d.ts +0 -27
- package/fixtures/jasmine/request-parameters.fixture.jasmine.d.ts.map +0 -1
- package/fixtures/jest/index.d.ts +0 -2
- package/fixtures/jest/index.d.ts.map +0 -1
- package/fixtures/jest/o3r-routing-fixtures-jest.d.ts.map +0 -1
- package/fixtures/jest/request-parameters.fixture.jest.d.ts +0 -27
- package/fixtures/jest/request-parameters.fixture.jest.d.ts.map +0 -1
- package/schematics/package.json +0 -3
- package/services/index.d.ts +0 -2
- package/services/index.d.ts.map +0 -1
- package/services/request-parameters/index.d.ts +0 -4
- package/services/request-parameters/index.d.ts.map +0 -1
- package/services/request-parameters/request-parameters.config.d.ts +0 -43
- package/services/request-parameters/request-parameters.config.d.ts.map +0 -1
- package/services/request-parameters/request-parameters.module.d.ts +0 -21
- package/services/request-parameters/request-parameters.module.d.ts.map +0 -1
- package/services/request-parameters/request-parameters.service.d.ts +0 -121
- package/services/request-parameters/request-parameters.service.d.ts.map +0 -1
- package/services/request-parameters/request-parameters.token.d.ts +0 -9
- package/services/request-parameters/request-parameters.token.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<h1 align="center">Otter routing</h1>
|
|
2
2
|
<p align="center">
|
|
3
|
-
<img src="https://raw.githubusercontent.com/AmadeusITGroup/otter/main
|
|
3
|
+
<img src="https://raw.githubusercontent.com/AmadeusITGroup/otter/main/assets/logo/otter.png" alt="Super cute Otter!" width="40%"/>
|
|
4
4
|
</p>
|
|
5
5
|
|
|
6
6
|
This package is an [Otter Framework Module](https://github.com/AmadeusITGroup/otter/tree/main/docs/core/MODULE.md).
|
package/esm2022/public_api.mjs
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export * from './services/index';
|
|
2
1
|
export * from './stores/index';
|
|
3
2
|
export * from './tools/index';
|
|
4
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
3
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljX2FwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9wdWJsaWNfYXBpLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGNBQWMsZ0JBQWdCLENBQUM7QUFDL0IsY0FBYyxlQUFlLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgKiBmcm9tICcuL3N0b3Jlcy9pbmRleCc7XG5leHBvcnQgKiBmcm9tICcuL3Rvb2xzL2luZGV4JztcblxuIl19
|
|
@@ -20,10 +20,10 @@ export class NgrxStoreRouterEffect {
|
|
|
20
20
|
*/
|
|
21
21
|
this.resetRouterRegistrationOnNavigated$ = createEffect(() => this.actions$.pipe(ofType(ROUTER_NAVIGATED), map(() => clearRoutingGuardEntities())));
|
|
22
22
|
}
|
|
23
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
24
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
23
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: NgrxStoreRouterEffect, deps: [{ token: i1.Actions }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
24
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: NgrxStoreRouterEffect }); }
|
|
25
25
|
}
|
|
26
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
26
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: NgrxStoreRouterEffect, decorators: [{
|
|
27
27
|
type: Injectable
|
|
28
|
-
}], ctorParameters:
|
|
28
|
+
}], ctorParameters: () => [{ type: i1.Actions }] });
|
|
29
29
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmdyeC1zdG9yZS1yb3V0ZXIuZWZmZWN0LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vc3JjL3N0b3Jlcy9yb3V0aW5nLWd1YXJkL2V4dHJhLWVmZmVjdHMvbmdyeC1zdG9yZS1yb3V0ZXIuZWZmZWN0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBQyxVQUFVLEVBQUMsTUFBTSxlQUFlLENBQUM7QUFDekMsT0FBTyxFQUFDLE9BQU8sRUFBRSxZQUFZLEVBQUUsTUFBTSxFQUFDLE1BQU0sZUFBZSxDQUFDO0FBQzVELE9BQU8sRUFBdUIsZ0JBQWdCLEVBQUUsY0FBYyxFQUFzQixNQUFNLG9CQUFvQixDQUFDO0FBQy9HLE9BQU8sRUFBQyx5QkFBeUIsRUFBQyxNQUFNLDBCQUEwQixDQUFDO0FBQ25FLE9BQU8sRUFBQyxNQUFNLEVBQUUsR0FBRyxFQUFDLE1BQU0sZ0JBQWdCLENBQUM7OztBQUUzQzs7R0FFRztBQUVILE1BQU0sT0FBTyxxQkFBcUI7SUF1QmhDLFlBQXNCLFFBQWlCO1FBQWpCLGFBQVEsR0FBUixRQUFRLENBQVM7UUFyQnZDOztXQUVHO1FBQ0ksc0NBQWlDLEdBQUcsWUFBWSxDQUFDLEdBQUcsRUFBRSxDQUMzRCxJQUFJLENBQUMsUUFBUSxDQUFDLElBQUksQ0FDaEIsTUFBTSxDQUFDLGNBQWMsQ0FBQyxFQUN0QixNQUFNLENBQUMsQ0FBQyxNQUFpRCxFQUFFL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oreModule {
|
|
|
19
19
|
]
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
23
|
-
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
24
|
-
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
22
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: RoutingGuardStoreModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
23
|
+
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.0.8", ngImport: i0, type: RoutingGuardStoreModule, imports: [i1.StoreFeatureModule] }); }
|
|
24
|
+
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: RoutingGuardStoreModule, providers: [
|
|
25
25
|
{ provide: ROUTING_GUARD_REDUCER_TOKEN, useFactory: getDefaultRoutingGuardReducer }
|
|
26
26
|
], imports: [StoreModule.forFeature(ROUTING_GUARD_STORE_NAME, ROUTING_GUARD_REDUCER_TOKEN)] }); }
|
|
27
27
|
}
|
|
28
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
28
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: RoutingGuardStoreModule, decorators: [{
|
|
29
29
|
type: NgModule,
|
|
30
30
|
args: [{
|
|
31
31
|
imports: [
|
|
@@ -4,11 +4,10 @@ import * as i0 from "@angular/core";
|
|
|
4
4
|
/**
|
|
5
5
|
* AppBaseHref factory function
|
|
6
6
|
* The APP_BASE_HREF will assume one of the following values (ordered by priority):
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
7
|
+
* 1- undefined (or disabled) if it's not a PROD environment
|
|
8
|
+
* 2- the content of the data tag data-appbasehref in the body if it exists
|
|
9
|
+
* 3- the content of config.APP_BASE_HREF if defined
|
|
10
|
+
* 4- otherwise, undefined
|
|
12
11
|
* @param config The application environment configuration
|
|
13
12
|
*/
|
|
14
13
|
export function appBaseHrefFactory(config) {
|
|
@@ -25,7 +24,6 @@ export const ENVIRONMENT_CONFIG_TOKEN = new InjectionToken('Environment config')
|
|
|
25
24
|
export class AppServerRoutingModule {
|
|
26
25
|
/**
|
|
27
26
|
* Injects the APP_BASE_HREF with a custom factory
|
|
28
|
-
*
|
|
29
27
|
* @param config The application environment configuration
|
|
30
28
|
*/
|
|
31
29
|
static forRoot(config) {
|
|
@@ -41,11 +39,11 @@ export class AppServerRoutingModule {
|
|
|
41
39
|
]
|
|
42
40
|
};
|
|
43
41
|
}
|
|
44
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
45
|
-
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
46
|
-
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
42
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: AppServerRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
43
|
+
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.0.8", ngImport: i0, type: AppServerRoutingModule }); }
|
|
44
|
+
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: AppServerRoutingModule }); }
|
|
47
45
|
}
|
|
48
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
46
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: AppServerRoutingModule, decorators: [{
|
|
49
47
|
type: NgModule
|
|
50
48
|
}] });
|
|
51
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
49
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXBwLXNlcnZlci1yb3V0aW5nLm1vZHVsZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy90b29scy9hcHAtc2VydmVyLXJvdXRpbmcubW9kdWxlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxhQUFhLEVBQUUsTUFBTSxpQkFBaUIsQ0FBQztBQUNoRCxPQUFPLEVBQUUsY0FBYyxFQUF1QixRQUFRLEVBQUUsTUFBTSxlQUFlLENBQUM7O0FBRzlFOzs7Ozs7OztHQVFHO0FBQ0gsTUFBTSxVQUFVLGtCQUFrQixDQUFDLE1BQTJCO0lBQzVELElBQUksTUFBTSxDQUFDLFdBQVcsS0FBSyxNQUFNLEVBQUU7UUFDakMsT0FBTztLQUNSO0lBQ0QsTUFBTSxlQUFlLEdBQXVCLFFBQVEsQ0FBQyxJQUFJLENBQUMsT0FBTyxDQUFDLFdBQVcsQ0FBQztJQUM5RSxJQUFJLE9BQU8sZUFBZSxLQUFLLFdBQVcsRUFBRTtRQUMxQyxPQUFPLGVBQWUsQ0FBQztLQUN4QjtJQUNELE9BQU8sT0FBTyxNQUFNLENBQUMsYUFBYSxLQUFLLFFBQVEsQ0FBQyxDQUFDLENBQUMsTUFBTSxDQUFDLGFBQWEsQ0FBQyxDQUFDLENBQUMsU0FBUyxDQUFDO0FBQ3JGLENBQUM7QUFFRCxNQUFNLENBQUMsTUFBTSx3QkFBd0IsR0FBRyxJQUFJLGNBQWMs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uZmlnIFRoZSBhcHBsaWNhdGlvbiBlbnZpcm9ubWVudCBjb25maWd1cmF0aW9uXG4gICAqL1xuICBwdWJsaWMgc3RhdGljIGZvclJvb3QoY29uZmlnOiBCdWlsZFRpbWVQcm9wZXJ0aWVzKTogTW9kdWxlV2l0aFByb3ZpZGVyczxBcHBTZXJ2ZXJSb3V0aW5nTW9kdWxlPiB7XG4gICAgcmV0dXJuIHtcbiAgICAgIG5nTW9kdWxlOiBBcHBTZXJ2ZXJSb3V0aW5nTW9kdWxlLFxuICAgICAgcHJvdmlkZXJzOiBbXG4gICAgICAgIHtwcm92aWRlOiBFTlZJUk9OTUVOVF9DT05GSUdfVE9LRU4sIHVzZVZhbHVlOiBjb25maWd9LFxuICAgICAgICB7XG4gICAgICAgICAgcHJvdmlkZTogQVBQX0JBU0VfSFJFRixcbiAgICAgICAgICB1c2VGYWN0b3J5OiBhcHBCYXNlSHJlZkZhY3RvcnksXG4gICAgICAgICAgZGVwczogW0VOVklST05NRU5UX0NPTkZJR19UT0tFTl1cbiAgICAgICAgfVxuICAgICAgXVxuICAgIH07XG4gIH1cbn1cbiJdfQ==
|
|
@@ -6,7 +6,6 @@ import * as i0 from "@angular/core";
|
|
|
6
6
|
import * as i1 from "@angular/router";
|
|
7
7
|
/**
|
|
8
8
|
* Check if the route has preload instructions
|
|
9
|
-
*
|
|
10
9
|
* @param data Route data
|
|
11
10
|
*/
|
|
12
11
|
export function hasPreloadingOnDemand(data) {
|
|
@@ -19,7 +18,6 @@ export function hasPreloadingOnDemand(data) {
|
|
|
19
18
|
}
|
|
20
19
|
/**
|
|
21
20
|
* Otter Preloading strategy base on previous route
|
|
22
|
-
*
|
|
23
21
|
* @inheritDoc
|
|
24
22
|
*/
|
|
25
23
|
export class O3rOnNavigationPreloadingStrategy {
|
|
@@ -28,7 +26,6 @@ export class O3rOnNavigationPreloadingStrategy {
|
|
|
28
26
|
}
|
|
29
27
|
/**
|
|
30
28
|
* Check if the module should be preloaded based on the data preload array of routes or regex value
|
|
31
|
-
*
|
|
32
29
|
* @param data Route data
|
|
33
30
|
* @param url
|
|
34
31
|
* @url url URL of current page
|
|
@@ -50,10 +47,10 @@ export class O3rOnNavigationPreloadingStrategy {
|
|
|
50
47
|
}
|
|
51
48
|
return of(null);
|
|
52
49
|
}
|
|
53
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
54
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
50
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: O3rOnNavigationPreloadingStrategy, deps: [{ token: i1.Router }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
51
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: O3rOnNavigationPreloadingStrategy }); }
|
|
55
52
|
}
|
|
56
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
53
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: O3rOnNavigationPreloadingStrategy, decorators: [{
|
|
57
54
|
type: Injectable
|
|
58
|
-
}], ctorParameters:
|
|
59
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
55
|
+
}], ctorParameters: () => [{ type: i1.Router }] });
|
|
56
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib24tbmF2aWdhdGlvbi1zdHJhdGVneS5wcmVsb2FkZXIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvdG9vbHMvb24tbmF2aWdhdGlvbi1zdHJhdGVneS5wcmVsb2FkZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBT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WFuZChyb3V0ZS5kYXRhKSkge1xuXG4gICAgICAvLyBPbiBhcHBsaWNhdGlvbiBsYW5kaW5nIHBhZ2UsIGNoZWNrIHRoZSByb3V0ZSB0byBwcmVsb2FkLlxuICAgICAgaWYgKHJvdXRlLmRhdGEucHJlbG9hZE9uID09PSAnKicgfHwgdGhpcy5pc1VybE1hdGNoaW5nUHJlbG9hZENvbmZpZyhyb3V0ZS5kYXRhLCB0aGlzLnJvdXRlci5yb3V0ZXJTdGF0ZS5zbmFwc2hvdC51cmwpKSB7XG4gICAgICAgIHJldHVybiBwcmVsb2FkKCk7XG4gICAgICB9XG5cbiAgICAgIC8vIE9uIHJvdXRlIG5hdmlnYXRpb24gZW5kLCBsb2FkIHRoZSByb3V0ZXMgdG8gcHJlbG9hZCBmb3IgdGhlIGN1cnJlbnQgcm91dGUuXG4gICAgICByZXR1cm4gdGhpcy5yb3V0ZXIuZXZlbnRzXG4gICAgICAgIC5waXBlKFxuICAgICAgICAgIGZpbHRlcigocikgPT4gciBpbnN0YW5jZW9mIE5hdmlnYXRpb25FbmQgJiYgdGhpcy5pc1VybE1hdGNoaW5nUHJlbG9hZENvbmZpZyhyb3V0ZS5kYXRhLCByLnVybCkpLFxuICAgICAgICAgIHN3aXRjaE1hcCgoKSA9PiBwcmVsb2FkKCkpXG4gICAgICAgICk7XG4gICAgfVxuICAgIHJldHVybiBvZihudWxsKTtcbiAgfVxufVxuIl19
|
package/fesm2022/o3r-routing.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, Injectable, Inject, NgModule } from '@angular/core';
|
|
3
1
|
import * as i1 from '@ngrx/store';
|
|
4
|
-
import {
|
|
2
|
+
import { props, createAction, on, createReducer, StoreModule, createFeatureSelector, createSelector } from '@ngrx/store';
|
|
3
|
+
import * as i0 from '@angular/core';
|
|
4
|
+
import { InjectionToken, NgModule, Injectable } from '@angular/core';
|
|
5
5
|
import { createEntityAdapter } from '@ngrx/entity';
|
|
6
6
|
import * as i1$1 from '@ngrx/effects';
|
|
7
|
-
import {
|
|
7
|
+
import { ofType, createEffect } from '@ngrx/effects';
|
|
8
8
|
import { ROUTER_REQUEST, ROUTER_NAVIGATED } from '@ngrx/router-store';
|
|
9
9
|
import { filter, map, switchMap } from 'rxjs/operators';
|
|
10
10
|
import { APP_BASE_HREF } from '@angular/common';
|
|
@@ -12,287 +12,6 @@ import * as i1$2 from '@angular/router';
|
|
|
12
12
|
import { NavigationEnd } from '@angular/router';
|
|
13
13
|
import { of } from 'rxjs';
|
|
14
14
|
|
|
15
|
-
/**
|
|
16
|
-
* Strategies available to read / write data in the RequestParameters service.
|
|
17
|
-
* Rehydrate: if the storage already have data, those will be used by the service, ignoring new data. Otherwise set the storage
|
|
18
|
-
* Merge: storage data will be merged with the ones provided. (provided data has priority)
|
|
19
|
-
* Replace: storage data will be completely replaced by the ones provided
|
|
20
|
-
* ReplaceIfNotEmpty: If no parameters are provided, use the content from storage. Otherwise use the ones provided and update the storage with them.
|
|
21
|
-
*
|
|
22
|
-
* @deprecated use StorageStrategy from @o3r/dynamic-content instead, will be removed in v10
|
|
23
|
-
*/
|
|
24
|
-
// eslint-disable-next-line no-shadow
|
|
25
|
-
var StorageStrategy;
|
|
26
|
-
(function (StorageStrategy) {
|
|
27
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
28
|
-
StorageStrategy[StorageStrategy["Rehydrate"] = 0] = "Rehydrate";
|
|
29
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
30
|
-
StorageStrategy[StorageStrategy["Merge"] = 1] = "Merge";
|
|
31
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
32
|
-
StorageStrategy[StorageStrategy["Replace"] = 2] = "Replace";
|
|
33
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
34
|
-
StorageStrategy[StorageStrategy["ReplaceIfNotEmpty"] = 3] = "ReplaceIfNotEmpty";
|
|
35
|
-
})(StorageStrategy || (StorageStrategy = {}));
|
|
36
|
-
/**
|
|
37
|
-
* @deprecated use defaultRequestParametersConfig from @o3r/dynamic-content instead, will be removed in v10
|
|
38
|
-
*/
|
|
39
|
-
const defaultRequestParametersConfig = {
|
|
40
|
-
storage: (typeof window !== 'undefined') ? window.sessionStorage : undefined,
|
|
41
|
-
strategy: StorageStrategy.Rehydrate,
|
|
42
|
-
queryParamsValue: typeof document !== 'undefined' && document.body && document.body.dataset && document.body.dataset.query || '{}',
|
|
43
|
-
postParamsValue: typeof document !== 'undefined' && document.body && document.body.dataset && document.body.dataset.post || '{}'
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* Token to be provided in case of service customization needs.
|
|
48
|
-
*
|
|
49
|
-
* @deprecated use REQUEST_PARAMETERS_CONFIG_TOKEN from @o3r/dynamic-content instead, will be removed in v10
|
|
50
|
-
*/
|
|
51
|
-
const REQUEST_PARAMETERS_CONFIG_TOKEN = new InjectionToken('RequestParametersConfig injection token', { factory: () => ({}) });
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* Service used to store the request parameters of your requests so that subsequent calls or refresh the page will preserve
|
|
55
|
-
* them.
|
|
56
|
-
*
|
|
57
|
-
* @deprecated use RequestParametersService from @o3r/dynamic-content instead, will be removed in v10
|
|
58
|
-
*/
|
|
59
|
-
class RequestParametersService {
|
|
60
|
-
constructor(config) {
|
|
61
|
-
this._query = {};
|
|
62
|
-
this._post = {};
|
|
63
|
-
this.config = defaultRequestParametersConfig;
|
|
64
|
-
Object.keys(config)
|
|
65
|
-
.filter((key) => config[key] !== undefined)
|
|
66
|
-
.forEach((key) => this.config[key] = config[key]);
|
|
67
|
-
this.setParameters('query', JSON.parse(this.config.queryParamsValue));
|
|
68
|
-
this.setParameters('post', JSON.parse(this.config.postParamsValue));
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* Depending on the strategy, set the internal values for the parameters.
|
|
72
|
-
* See StorageStrategy for more info.
|
|
73
|
-
*
|
|
74
|
-
* @param key
|
|
75
|
-
* @param value
|
|
76
|
-
*/
|
|
77
|
-
setParameters(key, value) {
|
|
78
|
-
const privateKey = `_${key}`;
|
|
79
|
-
if (!this.config.storage) {
|
|
80
|
-
// No storage is available , cannot set items
|
|
81
|
-
return;
|
|
82
|
-
}
|
|
83
|
-
switch (this.config.strategy) {
|
|
84
|
-
case StorageStrategy.Rehydrate: {
|
|
85
|
-
if (!this.config.storage.getItem(privateKey)) {
|
|
86
|
-
this[privateKey] = value;
|
|
87
|
-
this.config.storage.setItem(privateKey, JSON.stringify(value));
|
|
88
|
-
break;
|
|
89
|
-
}
|
|
90
|
-
this[privateKey] = JSON.parse(this.config.storage.getItem(privateKey) || '{}');
|
|
91
|
-
break;
|
|
92
|
-
}
|
|
93
|
-
case StorageStrategy.Replace: {
|
|
94
|
-
this[privateKey] = value;
|
|
95
|
-
this.config.storage.setItem(privateKey, JSON.stringify(value));
|
|
96
|
-
break;
|
|
97
|
-
}
|
|
98
|
-
case StorageStrategy.Merge: {
|
|
99
|
-
const storageData = Object.assign(JSON.parse(this.config.storage.getItem(privateKey) || '{}'), value);
|
|
100
|
-
this[privateKey] = storageData;
|
|
101
|
-
this.config.storage.setItem(privateKey, JSON.stringify(storageData));
|
|
102
|
-
break;
|
|
103
|
-
}
|
|
104
|
-
case StorageStrategy.ReplaceIfNotEmpty: {
|
|
105
|
-
if (Object.keys(value).length > 0) {
|
|
106
|
-
this[privateKey] = value;
|
|
107
|
-
this.config.storage.setItem(privateKey, JSON.stringify(value));
|
|
108
|
-
break;
|
|
109
|
-
}
|
|
110
|
-
this[privateKey] = JSON.parse(this.config.storage.getItem(privateKey) || '{}');
|
|
111
|
-
break;
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
/**
|
|
116
|
-
* Get all the query parameters in a map.
|
|
117
|
-
*/
|
|
118
|
-
get query() {
|
|
119
|
-
return this._query;
|
|
120
|
-
}
|
|
121
|
-
/**
|
|
122
|
-
* Get all the post parameters in a map.
|
|
123
|
-
*/
|
|
124
|
-
get post() {
|
|
125
|
-
return this._post;
|
|
126
|
-
}
|
|
127
|
-
/**
|
|
128
|
-
* Get a specific query parameter value, given the key.
|
|
129
|
-
*
|
|
130
|
-
* @param key
|
|
131
|
-
*/
|
|
132
|
-
getQueryParameter(key) {
|
|
133
|
-
return this._query[key];
|
|
134
|
-
}
|
|
135
|
-
/**
|
|
136
|
-
* Get a specific query parameter value as boolean, given the key.
|
|
137
|
-
*
|
|
138
|
-
* @param key
|
|
139
|
-
*/
|
|
140
|
-
getQueryParameterAsBoolean(key) {
|
|
141
|
-
const queryParameter = this.getQueryParameter(key);
|
|
142
|
-
return queryParameter ? queryParameter.toLowerCase() === 'true' : undefined;
|
|
143
|
-
}
|
|
144
|
-
/**
|
|
145
|
-
* Get a specific post parameter value, given the key.
|
|
146
|
-
*
|
|
147
|
-
* @param key
|
|
148
|
-
*/
|
|
149
|
-
getPostParameter(key) {
|
|
150
|
-
return this._post[key];
|
|
151
|
-
}
|
|
152
|
-
/**
|
|
153
|
-
* Get a specific post parameter value as boolean, given the key.
|
|
154
|
-
*
|
|
155
|
-
* @param key
|
|
156
|
-
*/
|
|
157
|
-
getPostParameterAsBoolean(key) {
|
|
158
|
-
const postParameter = this.getPostParameter(key);
|
|
159
|
-
return postParameter ? postParameter.toLowerCase() === 'true' : undefined;
|
|
160
|
-
}
|
|
161
|
-
/**
|
|
162
|
-
* Get a specific parameter value, given the key.
|
|
163
|
-
*
|
|
164
|
-
* @param key
|
|
165
|
-
*/
|
|
166
|
-
getParameter(key) {
|
|
167
|
-
return this._query[key] || this._post[key];
|
|
168
|
-
}
|
|
169
|
-
/**
|
|
170
|
-
* Get a specific parameter value as boolean, given the key.
|
|
171
|
-
*
|
|
172
|
-
* @param key
|
|
173
|
-
*/
|
|
174
|
-
getParameterAsBoolean(key) {
|
|
175
|
-
const parameter = this.getParameter(key);
|
|
176
|
-
return parameter ? parameter.toLowerCase() === 'true' : undefined;
|
|
177
|
-
}
|
|
178
|
-
/**
|
|
179
|
-
* Clear GET parameters from the storage
|
|
180
|
-
*
|
|
181
|
-
* @param paramsToClear the list on key that you want to clear in get parameters
|
|
182
|
-
*/
|
|
183
|
-
clearQueryParameters(paramsToClear) {
|
|
184
|
-
const newQuery = (paramsToClear ? Object.keys(this._query).filter((key) => paramsToClear.indexOf(key) === -1) : [])
|
|
185
|
-
.reduce((acc, key) => {
|
|
186
|
-
acc[key] = this._query[key];
|
|
187
|
-
return acc;
|
|
188
|
-
}, {});
|
|
189
|
-
if (this.config.storage) {
|
|
190
|
-
this.config.storage.setItem('_query', JSON.stringify(newQuery));
|
|
191
|
-
}
|
|
192
|
-
this._query = newQuery;
|
|
193
|
-
}
|
|
194
|
-
/**
|
|
195
|
-
* Clear POST parameters from the storage
|
|
196
|
-
*
|
|
197
|
-
* @param paramsToClear the list on key that you want to clean in post parameters
|
|
198
|
-
*/
|
|
199
|
-
clearPostParameters(paramsToClear) {
|
|
200
|
-
const newPost = (paramsToClear ? Object.keys(this._post).filter((key) => paramsToClear.indexOf(key) === -1) : [])
|
|
201
|
-
.reduce((acc, key) => {
|
|
202
|
-
acc[key] = this._post[key];
|
|
203
|
-
return acc;
|
|
204
|
-
}, {});
|
|
205
|
-
if (this.config.storage) {
|
|
206
|
-
this.config.storage.setItem('_post', JSON.stringify(newPost));
|
|
207
|
-
}
|
|
208
|
-
this._post = newPost;
|
|
209
|
-
}
|
|
210
|
-
/**
|
|
211
|
-
* Get all the parameters in a map.
|
|
212
|
-
*
|
|
213
|
-
* @param priority the parameter to be given priority in case same key is in get and post params.
|
|
214
|
-
*/
|
|
215
|
-
getParams(priority = 'query') {
|
|
216
|
-
return priority === 'query' ? { ...this._post, ...this._query } : { ...this._query, ...this._post };
|
|
217
|
-
}
|
|
218
|
-
/**
|
|
219
|
-
* Filter Parameters(both Query/POST) from the storage
|
|
220
|
-
*
|
|
221
|
-
* @param paramstoFilter the list on key that you want to filter from parameters
|
|
222
|
-
* @param priority the priorty of the parameter type(POST/Query)
|
|
223
|
-
*/
|
|
224
|
-
getFilteredParameters(paramstoFilter, priority = 'query') {
|
|
225
|
-
const params = this.getParams(priority);
|
|
226
|
-
if (!paramstoFilter) {
|
|
227
|
-
return params;
|
|
228
|
-
}
|
|
229
|
-
return Object.keys(params)
|
|
230
|
-
.filter((key) => paramstoFilter.indexOf(key) === -1)
|
|
231
|
-
.reduce((acc, key) => {
|
|
232
|
-
acc[key] = params[key];
|
|
233
|
-
return acc;
|
|
234
|
-
}, {});
|
|
235
|
-
}
|
|
236
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.0", ngImport: i0, type: RequestParametersService, deps: [{ token: REQUEST_PARAMETERS_CONFIG_TOKEN }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
237
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.0", ngImport: i0, type: RequestParametersService }); }
|
|
238
|
-
}
|
|
239
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.0", ngImport: i0, type: RequestParametersService, decorators: [{
|
|
240
|
-
type: Injectable
|
|
241
|
-
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
242
|
-
type: Inject,
|
|
243
|
-
args: [REQUEST_PARAMETERS_CONFIG_TOKEN]
|
|
244
|
-
}] }]; } });
|
|
245
|
-
|
|
246
|
-
/**
|
|
247
|
-
* Empty configuration factory, used when config is not provided. It needs a separate function for AOT.
|
|
248
|
-
*
|
|
249
|
-
* @deprecated use defaultConfigFactory from @o3r/dynamic-content instead, will be removed in v10
|
|
250
|
-
*/
|
|
251
|
-
function defaultConfigFactory() {
|
|
252
|
-
return {};
|
|
253
|
-
}
|
|
254
|
-
/**
|
|
255
|
-
* RequestParametersService Module
|
|
256
|
-
*
|
|
257
|
-
* @deprecated use RequestParametersModule from @o3r/dynamic-content instead, will be removed in v10
|
|
258
|
-
*/
|
|
259
|
-
class RequestParametersModule {
|
|
260
|
-
static forRoot(config = defaultConfigFactory) {
|
|
261
|
-
return {
|
|
262
|
-
ngModule: RequestParametersModule,
|
|
263
|
-
providers: [
|
|
264
|
-
{
|
|
265
|
-
provide: REQUEST_PARAMETERS_CONFIG_TOKEN,
|
|
266
|
-
useFactory: config
|
|
267
|
-
},
|
|
268
|
-
RequestParametersService
|
|
269
|
-
]
|
|
270
|
-
};
|
|
271
|
-
}
|
|
272
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.0", ngImport: i0, type: RequestParametersModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
273
|
-
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.0", ngImport: i0, type: RequestParametersModule }); }
|
|
274
|
-
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.0", ngImport: i0, type: RequestParametersModule, providers: [
|
|
275
|
-
{
|
|
276
|
-
provide: REQUEST_PARAMETERS_CONFIG_TOKEN,
|
|
277
|
-
useValue: {}
|
|
278
|
-
},
|
|
279
|
-
RequestParametersService
|
|
280
|
-
] }); }
|
|
281
|
-
}
|
|
282
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.0", ngImport: i0, type: RequestParametersModule, decorators: [{
|
|
283
|
-
type: NgModule,
|
|
284
|
-
args: [{
|
|
285
|
-
imports: [],
|
|
286
|
-
providers: [
|
|
287
|
-
{
|
|
288
|
-
provide: REQUEST_PARAMETERS_CONFIG_TOKEN,
|
|
289
|
-
useValue: {}
|
|
290
|
-
},
|
|
291
|
-
RequestParametersService
|
|
292
|
-
]
|
|
293
|
-
}]
|
|
294
|
-
}] });
|
|
295
|
-
|
|
296
15
|
/** Entity Actions */
|
|
297
16
|
const ACTION_REGISTER_ENTITY = '[RoutingGuard] register an entity';
|
|
298
17
|
const ACTION_SET_ENTITY_AS_FAILURE = '[RoutingGuard] set an entity state as FAILURE';
|
|
@@ -397,13 +116,13 @@ class RoutingGuardStoreModule {
|
|
|
397
116
|
]
|
|
398
117
|
};
|
|
399
118
|
}
|
|
400
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
401
|
-
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
402
|
-
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
119
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: RoutingGuardStoreModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
120
|
+
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.0.8", ngImport: i0, type: RoutingGuardStoreModule, imports: [i1.StoreFeatureModule] }); }
|
|
121
|
+
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: RoutingGuardStoreModule, providers: [
|
|
403
122
|
{ provide: ROUTING_GUARD_REDUCER_TOKEN, useFactory: getDefaultRoutingGuardReducer }
|
|
404
123
|
], imports: [StoreModule.forFeature(ROUTING_GUARD_STORE_NAME, ROUTING_GUARD_REDUCER_TOKEN)] }); }
|
|
405
124
|
}
|
|
406
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
125
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: RoutingGuardStoreModule, decorators: [{
|
|
407
126
|
type: NgModule,
|
|
408
127
|
args: [{
|
|
409
128
|
imports: [
|
|
@@ -486,21 +205,20 @@ class NgrxStoreRouterEffect {
|
|
|
486
205
|
*/
|
|
487
206
|
this.resetRouterRegistrationOnNavigated$ = createEffect(() => this.actions$.pipe(ofType(ROUTER_NAVIGATED), map(() => clearRoutingGuardEntities())));
|
|
488
207
|
}
|
|
489
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
490
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
208
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: NgrxStoreRouterEffect, deps: [{ token: i1$1.Actions }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
209
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: NgrxStoreRouterEffect }); }
|
|
491
210
|
}
|
|
492
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
211
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: NgrxStoreRouterEffect, decorators: [{
|
|
493
212
|
type: Injectable
|
|
494
|
-
}], ctorParameters:
|
|
213
|
+
}], ctorParameters: () => [{ type: i1$1.Actions }] });
|
|
495
214
|
|
|
496
215
|
/**
|
|
497
216
|
* AppBaseHref factory function
|
|
498
217
|
* The APP_BASE_HREF will assume one of the following values (ordered by priority):
|
|
499
|
-
*
|
|
500
|
-
*
|
|
501
|
-
*
|
|
502
|
-
*
|
|
503
|
-
*
|
|
218
|
+
* 1- undefined (or disabled) if it's not a PROD environment
|
|
219
|
+
* 2- the content of the data tag data-appbasehref in the body if it exists
|
|
220
|
+
* 3- the content of config.APP_BASE_HREF if defined
|
|
221
|
+
* 4- otherwise, undefined
|
|
504
222
|
* @param config The application environment configuration
|
|
505
223
|
*/
|
|
506
224
|
function appBaseHrefFactory(config) {
|
|
@@ -517,7 +235,6 @@ const ENVIRONMENT_CONFIG_TOKEN = new InjectionToken('Environment config');
|
|
|
517
235
|
class AppServerRoutingModule {
|
|
518
236
|
/**
|
|
519
237
|
* Injects the APP_BASE_HREF with a custom factory
|
|
520
|
-
*
|
|
521
238
|
* @param config The application environment configuration
|
|
522
239
|
*/
|
|
523
240
|
static forRoot(config) {
|
|
@@ -533,17 +250,16 @@ class AppServerRoutingModule {
|
|
|
533
250
|
]
|
|
534
251
|
};
|
|
535
252
|
}
|
|
536
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
537
|
-
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
538
|
-
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
253
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: AppServerRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
254
|
+
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.0.8", ngImport: i0, type: AppServerRoutingModule }); }
|
|
255
|
+
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: AppServerRoutingModule }); }
|
|
539
256
|
}
|
|
540
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
257
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: AppServerRoutingModule, decorators: [{
|
|
541
258
|
type: NgModule
|
|
542
259
|
}] });
|
|
543
260
|
|
|
544
261
|
/**
|
|
545
262
|
* Check if the route has preload instructions
|
|
546
|
-
*
|
|
547
263
|
* @param data Route data
|
|
548
264
|
*/
|
|
549
265
|
function hasPreloadingOnDemand(data) {
|
|
@@ -556,7 +272,6 @@ function hasPreloadingOnDemand(data) {
|
|
|
556
272
|
}
|
|
557
273
|
/**
|
|
558
274
|
* Otter Preloading strategy base on previous route
|
|
559
|
-
*
|
|
560
275
|
* @inheritDoc
|
|
561
276
|
*/
|
|
562
277
|
class O3rOnNavigationPreloadingStrategy {
|
|
@@ -565,7 +280,6 @@ class O3rOnNavigationPreloadingStrategy {
|
|
|
565
280
|
}
|
|
566
281
|
/**
|
|
567
282
|
* Check if the module should be preloaded based on the data preload array of routes or regex value
|
|
568
|
-
*
|
|
569
283
|
* @param data Route data
|
|
570
284
|
* @param url
|
|
571
285
|
* @url url URL of current page
|
|
@@ -587,16 +301,16 @@ class O3rOnNavigationPreloadingStrategy {
|
|
|
587
301
|
}
|
|
588
302
|
return of(null);
|
|
589
303
|
}
|
|
590
|
-
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
591
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "
|
|
304
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: O3rOnNavigationPreloadingStrategy, deps: [{ token: i1$2.Router }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
305
|
+
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: O3rOnNavigationPreloadingStrategy }); }
|
|
592
306
|
}
|
|
593
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
307
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.0.8", ngImport: i0, type: O3rOnNavigationPreloadingStrategy, decorators: [{
|
|
594
308
|
type: Injectable
|
|
595
|
-
}], ctorParameters:
|
|
309
|
+
}], ctorParameters: () => [{ type: i1$2.Router }] });
|
|
596
310
|
|
|
597
311
|
/**
|
|
598
312
|
* Generated bundle index. Do not edit.
|
|
599
313
|
*/
|
|
600
314
|
|
|
601
|
-
export { AppServerRoutingModule, ENVIRONMENT_CONFIG_TOKEN, NgrxStoreRouterEffect, O3rOnNavigationPreloadingStrategy, ROUTING_GUARD_REDUCER_TOKEN, ROUTING_GUARD_STORE_NAME, RegisteredItemFailureReason, RegisteredItemStatus,
|
|
315
|
+
export { AppServerRoutingModule, ENVIRONMENT_CONFIG_TOKEN, NgrxStoreRouterEffect, O3rOnNavigationPreloadingStrategy, ROUTING_GUARD_REDUCER_TOKEN, ROUTING_GUARD_STORE_NAME, RegisteredItemFailureReason, RegisteredItemStatus, RoutingGuardStoreModule, appBaseHrefFactory, clearRoutingGuardEntities, clearRoutingGuardEntitiesFailureReason, getDefaultRoutingGuardReducer, hasNoEntitiesInFailureState, hasNoEntitiesInPendingState, hasNoEntityFailureStateWithReasons, hasNoEntityInReadyOrFailureState, hasPreloadingOnDemand, registerRoutingGuardEntity, routingGuardAdapter, routingGuardInitialState, routingGuardReducer, routingGuardReducerFeatures, selectAllRoutingGuard, selectRoutingGuardEntities, selectRoutingGuardEntitiesBlockingReasons, selectRoutingGuardEntitiesStatusList, selectRoutingGuardIds, selectRoutingGuardState, selectRoutingGuardTotal, setRoutingGuardEntityAsFailure, setRoutingGuardEntityAsPending, setRoutingGuardEntityAsSuccessAndClearReason, setRoutingGuardEntityFailureWithReason };
|
|
602
316
|
//# sourceMappingURL=o3r-routing.mjs.map
|