ngssm-navigation 18.1.1 → 18.2.1
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.
|
@@ -11,10 +11,10 @@ export class NavigationLockedGuard {
|
|
|
11
11
|
canDeactivate() {
|
|
12
12
|
return this.store.state$.pipe(take(1), map((s) => !selectNavigationState(s).navigationLocked));
|
|
13
13
|
}
|
|
14
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.
|
|
15
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.
|
|
14
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: NavigationLockedGuard, deps: [{ token: i1.Store }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
15
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: NavigationLockedGuard, providedIn: 'root' }); }
|
|
16
16
|
}
|
|
17
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.
|
|
17
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: NavigationLockedGuard, decorators: [{
|
|
18
18
|
type: Injectable,
|
|
19
19
|
args: [{
|
|
20
20
|
providedIn: 'root'
|
|
@@ -27,10 +27,10 @@ export class NavigationReducer {
|
|
|
27
27
|
}
|
|
28
28
|
return state;
|
|
29
29
|
}
|
|
30
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.
|
|
31
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.
|
|
30
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: NavigationReducer, deps: [{ token: NGSSM_NAVIGATION_LOCKING_CONFIG, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
31
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: NavigationReducer }); }
|
|
32
32
|
}
|
|
33
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.
|
|
33
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: NavigationReducer, decorators: [{
|
|
34
34
|
type: Injectable
|
|
35
35
|
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
36
36
|
type: Inject,
|
|
@@ -31,10 +31,10 @@ class NavigationLockedGuard {
|
|
|
31
31
|
canDeactivate() {
|
|
32
32
|
return this.store.state$.pipe(take(1), map((s) => !selectNavigationState(s).navigationLocked));
|
|
33
33
|
}
|
|
34
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.
|
|
35
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.
|
|
34
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: NavigationLockedGuard, deps: [{ token: i1.Store }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
35
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: NavigationLockedGuard, providedIn: 'root' }); }
|
|
36
36
|
}
|
|
37
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.
|
|
37
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: NavigationLockedGuard, decorators: [{
|
|
38
38
|
type: Injectable,
|
|
39
39
|
args: [{
|
|
40
40
|
providedIn: 'root'
|
|
@@ -75,10 +75,10 @@ class NavigationReducer {
|
|
|
75
75
|
}
|
|
76
76
|
return state;
|
|
77
77
|
}
|
|
78
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.
|
|
79
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.
|
|
78
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: NavigationReducer, deps: [{ token: NGSSM_NAVIGATION_LOCKING_CONFIG, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
79
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: NavigationReducer }); }
|
|
80
80
|
}
|
|
81
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.
|
|
81
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: NavigationReducer, decorators: [{
|
|
82
82
|
type: Injectable
|
|
83
83
|
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
84
84
|
type: Inject,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngssm-navigation.mjs","sources":["../../../projects/ngssm-navigation/src/lib/state/navigation.state.ts","../../../projects/ngssm-navigation/src/lib/guards/navigation-locked.guard.ts","../../../projects/ngssm-navigation/src/lib/actions/navigation-action-type.ts","../../../projects/ngssm-navigation/src/lib/model/navigation-locking-config.ts","../../../projects/ngssm-navigation/src/lib/reducers/navigation.reducer.ts","../../../projects/ngssm-navigation/src/lib/provide-ngssm-navigation.ts","../../../projects/ngssm-navigation/src/public-api.ts","../../../projects/ngssm-navigation/src/ngssm-navigation.ts"],"sourcesContent":["import update, { Spec } from 'immutability-helper';\n\nimport { NgSsmFeatureState, State } from 'ngssm-store';\n\nexport const selectNavigationState = (state: State): NavigationState =>\n state[NavigationStateSpecification.featureStateKey] as NavigationState;\n\nexport const updateNavigationState = (state: State, command: Spec<NavigationState, never>): State =>\n update(state, {\n [NavigationStateSpecification.featureStateKey]: command\n });\n\nexport interface NavigationState {\n navigationLocked: boolean;\n}\n\n@NgSsmFeatureState({\n featureStateKey: NavigationStateSpecification.featureStateKey,\n initialState: NavigationStateSpecification.initialState\n})\nexport class NavigationStateSpecification {\n public static readonly featureStateKey = 'navigation-state';\n public static readonly initialState: NavigationState = {\n navigationLocked: false\n };\n}\n","import { inject, Injectable } from '@angular/core';\nimport { map, Observable, take } from 'rxjs';\n\nimport { Store } from 'ngssm-store';\n\nimport { selectNavigationState } from '../state';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class NavigationLockedGuard {\n constructor(private store: Store) {}\n\n public canDeactivate(): Observable<boolean> {\n return this.store.state$.pipe(\n take(1),\n map((s) => !selectNavigationState(s).navigationLocked)\n );\n }\n}\n\nexport const isNavigationLocked = (store = inject(Store)): Observable<boolean> =>\n store.state$.pipe(\n take(1),\n map((s) => selectNavigationState(s).navigationLocked)\n );\n\nexport const isNavigationUnLocked = (store = inject(Store)): Observable<boolean> =>\n store.state$.pipe(\n take(1),\n map((s) => !selectNavigationState(s).navigationLocked)\n );\n","export enum NavigationActionType {\n lockNavigation = '[NavigationActionType] lockNavigation',\n unLockNavigation = '[NavigationActionType] unLockNavigation'\n}\n","import { InjectionToken } from '@angular/core';\n\nexport interface NavigationLockingConfig {\n actionsLockingNavigation?: string[];\n actionsUnLockingNavigation?: string[];\n}\n\nexport const NGSSM_NAVIGATION_LOCKING_CONFIG = new InjectionToken<NavigationLockingConfig>('NGSSM_NAVIGATION_LOCKING_CONFIG');\n","import { Inject, Injectable, Optional } from '@angular/core';\n\nimport { Reducer, State, Action } from 'ngssm-store';\n\nimport { NavigationActionType } from '../actions';\nimport { NavigationLockingConfig, NGSSM_NAVIGATION_LOCKING_CONFIG } from '../model';\nimport { updateNavigationState } from '../state';\n\n@Injectable()\nexport class NavigationReducer implements Reducer {\n private readonly lockingActions: Set<string>;\n private readonly unlockingActions: Set<string>;\n\n public readonly processedActions: string[] = [];\n\n constructor(\n @Inject(NGSSM_NAVIGATION_LOCKING_CONFIG)\n @Optional()\n configs: NavigationLockingConfig[]\n ) {\n this.lockingActions = new Set<string>([NavigationActionType.lockNavigation]);\n this.unlockingActions = new Set<string>([NavigationActionType.unLockNavigation]);\n\n (configs ?? []).forEach((config) => {\n (config.actionsLockingNavigation ?? []).forEach((command) => this.lockingActions.add(command));\n (config.actionsUnLockingNavigation ?? []).forEach((command) => this.unlockingActions.add(command));\n });\n\n this.processedActions = [...this.lockingActions, ...this.unlockingActions];\n }\n\n public updateState(state: State, action: Action): State {\n if (this.lockingActions.has(action.type)) {\n return updateNavigationState(state, {\n navigationLocked: { $set: true }\n });\n }\n\n if (this.unlockingActions.has(action.type)) {\n return updateNavigationState(state, {\n navigationLocked: { $set: false }\n });\n }\n\n return state;\n }\n}\n","import { APP_INITIALIZER, EnvironmentProviders, makeEnvironmentProviders } from '@angular/core';\nimport { Router } from '@angular/router';\n\nimport { provideReducer } from 'ngssm-store';\n\nimport { isNavigationUnLocked } from './guards';\nimport { NavigationReducer } from './reducers/navigation.reducer';\n\nfunction initializeNavigation(router: Router): () => void {\n return () => {\n router.config.forEach((route) => {\n route.canDeactivate = [() => isNavigationUnLocked(), ...(route.canDeactivate ?? [])];\n });\n };\n}\n\nexport const provideNgssmNavigation = (): EnvironmentProviders => {\n return makeEnvironmentProviders([\n provideReducer(NavigationReducer),\n {\n provide: APP_INITIALIZER,\n useFactory: initializeNavigation,\n deps: [Router],\n multi: true\n }\n ]);\n};\n","/*\n * Public API Surface of ngssm-navigation\n */\n\nexport * from './lib/provide-ngssm-navigation';\nexport * from './lib/state';\nexport * from './lib/guards';\nexport * from './lib/actions';\nexport * from './lib/model';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;AAIO,MAAM,qBAAqB,GAAG,CAAC,KAAY,KAChD,KAAK,CAAC,4BAA4B,CAAC,eAAe,EAAqB;AAElE,MAAM,qBAAqB,GAA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B,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAD7B,UAAU;;0BAQN,MAAM;2BAAC,+BAA+B,CAAA;;0BACtC,QAAQ;;;ACTb,SAAS,oBAAoB,CAAC,MAAc,EAAA;AAC1C,IAAA,OAAO,MAAK;QACV,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,KAAK,KAAI;AAC9B,YAAA,KAAK,CAAC,aAAa,GAAG,CAAC,MAAM,oBAAoB,EAAE,EAAE,IAAI,KAAK,CAAC,aAAa,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"ngssm-navigation.mjs","sources":["../../../projects/ngssm-navigation/src/lib/state/navigation.state.ts","../../../projects/ngssm-navigation/src/lib/guards/navigation-locked.guard.ts","../../../projects/ngssm-navigation/src/lib/actions/navigation-action-type.ts","../../../projects/ngssm-navigation/src/lib/model/navigation-locking-config.ts","../../../projects/ngssm-navigation/src/lib/reducers/navigation.reducer.ts","../../../projects/ngssm-navigation/src/lib/provide-ngssm-navigation.ts","../../../projects/ngssm-navigation/src/public-api.ts","../../../projects/ngssm-navigation/src/ngssm-navigation.ts"],"sourcesContent":["import update, { Spec } from 'immutability-helper';\n\nimport { NgSsmFeatureState, State } from 'ngssm-store';\n\nexport const selectNavigationState = (state: State): NavigationState =>\n state[NavigationStateSpecification.featureStateKey] as NavigationState;\n\nexport const updateNavigationState = (state: State, command: Spec<NavigationState, never>): State =>\n update(state, {\n [NavigationStateSpecification.featureStateKey]: command\n });\n\nexport interface NavigationState {\n navigationLocked: boolean;\n}\n\n@NgSsmFeatureState({\n featureStateKey: NavigationStateSpecification.featureStateKey,\n initialState: NavigationStateSpecification.initialState\n})\nexport class NavigationStateSpecification {\n public static readonly featureStateKey = 'navigation-state';\n public static readonly initialState: NavigationState = {\n navigationLocked: false\n };\n}\n","import { inject, Injectable } from '@angular/core';\nimport { map, Observable, take } from 'rxjs';\n\nimport { Store } from 'ngssm-store';\n\nimport { selectNavigationState } from '../state';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class NavigationLockedGuard {\n constructor(private store: Store) {}\n\n public canDeactivate(): Observable<boolean> {\n return this.store.state$.pipe(\n take(1),\n map((s) => !selectNavigationState(s).navigationLocked)\n );\n }\n}\n\nexport const isNavigationLocked = (store = inject(Store)): Observable<boolean> =>\n store.state$.pipe(\n take(1),\n map((s) => selectNavigationState(s).navigationLocked)\n );\n\nexport const isNavigationUnLocked = (store = inject(Store)): Observable<boolean> =>\n store.state$.pipe(\n take(1),\n map((s) => !selectNavigationState(s).navigationLocked)\n );\n","export enum NavigationActionType {\n lockNavigation = '[NavigationActionType] lockNavigation',\n unLockNavigation = '[NavigationActionType] unLockNavigation'\n}\n","import { InjectionToken } from '@angular/core';\n\nexport interface NavigationLockingConfig {\n actionsLockingNavigation?: string[];\n actionsUnLockingNavigation?: string[];\n}\n\nexport const NGSSM_NAVIGATION_LOCKING_CONFIG = new InjectionToken<NavigationLockingConfig>('NGSSM_NAVIGATION_LOCKING_CONFIG');\n","import { Inject, Injectable, Optional } from '@angular/core';\n\nimport { Reducer, State, Action } from 'ngssm-store';\n\nimport { NavigationActionType } from '../actions';\nimport { NavigationLockingConfig, NGSSM_NAVIGATION_LOCKING_CONFIG } from '../model';\nimport { updateNavigationState } from '../state';\n\n@Injectable()\nexport class NavigationReducer implements Reducer {\n private readonly lockingActions: Set<string>;\n private readonly unlockingActions: Set<string>;\n\n public readonly processedActions: string[] = [];\n\n constructor(\n @Inject(NGSSM_NAVIGATION_LOCKING_CONFIG)\n @Optional()\n configs: NavigationLockingConfig[]\n ) {\n this.lockingActions = new Set<string>([NavigationActionType.lockNavigation]);\n this.unlockingActions = new Set<string>([NavigationActionType.unLockNavigation]);\n\n (configs ?? []).forEach((config) => {\n (config.actionsLockingNavigation ?? []).forEach((command) => this.lockingActions.add(command));\n (config.actionsUnLockingNavigation ?? []).forEach((command) => this.unlockingActions.add(command));\n });\n\n this.processedActions = [...this.lockingActions, ...this.unlockingActions];\n }\n\n public updateState(state: State, action: Action): State {\n if (this.lockingActions.has(action.type)) {\n return updateNavigationState(state, {\n navigationLocked: { $set: true }\n });\n }\n\n if (this.unlockingActions.has(action.type)) {\n return updateNavigationState(state, {\n navigationLocked: { $set: false }\n });\n }\n\n return state;\n }\n}\n","import { APP_INITIALIZER, EnvironmentProviders, makeEnvironmentProviders } from '@angular/core';\nimport { Router } from '@angular/router';\n\nimport { provideReducer } from 'ngssm-store';\n\nimport { isNavigationUnLocked } from './guards';\nimport { NavigationReducer } from './reducers/navigation.reducer';\n\nfunction initializeNavigation(router: Router): () => void {\n return () => {\n router.config.forEach((route) => {\n route.canDeactivate = [() => isNavigationUnLocked(), ...(route.canDeactivate ?? [])];\n });\n };\n}\n\nexport const provideNgssmNavigation = (): EnvironmentProviders => {\n return makeEnvironmentProviders([\n provideReducer(NavigationReducer),\n {\n provide: APP_INITIALIZER,\n useFactory: initializeNavigation,\n deps: [Router],\n multi: true\n }\n ]);\n};\n","/*\n * Public API Surface of ngssm-navigation\n */\n\nexport * from './lib/provide-ngssm-navigation';\nexport * from './lib/state';\nexport * from './lib/guards';\nexport * from './lib/actions';\nexport * from './lib/model';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;AAIO,MAAM,qBAAqB,GAAG,CAAC,KAAY,KAChD,KAAK,CAAC,4BAA4B,CAAC,eAAe,EAAqB;AAElE,MAAM,qBAAqB,GAAG,CAAC,KAAY,EAAE,OAAqC,KACvF,MAAM,CAAC,KAAK,EAAE;AACZ,IAAA,CAAC,4BAA4B,CAAC,eAAe,GAAG,OAAO;AACxD,CAAA,EAAE;AAUQ,IAAA,4BAA4B,GAAlC,MAAM,4BAA4B,CAAA;aAChB,IAAe,CAAA,eAAA,GAAG,kBAAH,CAAsB,EAAA;AACrC,IAAA,SAAA,IAAA,CAAA,YAAY,GAAoB;AACrD,QAAA,gBAAgB,EAAE,KAAK;AACxB,KAFkC,CAEjC,EAAA;;AAJS,4BAA4B,GAAA,UA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vF,SAAC,CAAC,CAAC;AACL,KAAC,CAAC;AACJ,CAAC;AAEM,MAAM,sBAAsB,GAAG,MAA2B;AAC/D,IAAA,OAAO,wBAAwB,CAAC;QAC9B,cAAc,CAAC,iBAAiB,CAAC;AACjC,QAAA;AACE,YAAA,OAAO,EAAE,eAAe;AACxB,YAAA,UAAU,EAAE,oBAAoB;YAChC,IAAI,EAAE,CAAC,MAAM,CAAC;AACd,YAAA,KAAK,EAAE,IAAI;AACZ,SAAA;AACF,KAAA,CAAC,CAAC;AACL;;AC1BA;;AAEG;;ACFH;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ngssm-navigation",
|
|
3
|
-
"version": "18.
|
|
3
|
+
"version": "18.2.1",
|
|
4
4
|
"description": "NgSsm - Helpers to control angular navigation.",
|
|
5
5
|
"author": "Lion Marc",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"peerDependencies": {
|
|
8
8
|
"@angular/common": ">=18.0.0",
|
|
9
9
|
"@angular/core": ">=18.0.0",
|
|
10
|
-
"ngssm-store": "18.
|
|
10
|
+
"ngssm-store": "18.2.1"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"tslib": "^2.3.0"
|