ngssm-store 21.1.9 → 21.1.11
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/fesm2022/ngssm-store-caching-testing.mjs +3 -3
- package/fesm2022/ngssm-store-caching.mjs +31 -6
- package/fesm2022/ngssm-store-caching.mjs.map +1 -1
- package/fesm2022/ngssm-store-visibility-testing.mjs +3 -3
- package/fesm2022/ngssm-store-visibility.mjs +18 -18
- package/fesm2022/ngssm-store.mjs +18 -18
- package/package.json +1 -1
- package/types/ngssm-store-caching.d.ts +14 -3
|
@@ -93,10 +93,10 @@ class NgssmCachedItemSetter {
|
|
|
93
93
|
}
|
|
94
94
|
return this;
|
|
95
95
|
}
|
|
96
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
97
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.
|
|
96
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: NgssmCachedItemSetter, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
97
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: NgssmCachedItemSetter });
|
|
98
98
|
}
|
|
99
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
99
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: NgssmCachedItemSetter, decorators: [{
|
|
100
100
|
type: Injectable
|
|
101
101
|
}] });
|
|
102
102
|
const ngssmCachedItemSetter = () => TestBed.inject(NgssmCachedItemSetter);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Injectable, makeEnvironmentProviders } from '@angular/core';
|
|
3
|
-
import { NgSsmFeatureState, provideReducers } from 'ngssm-store';
|
|
2
|
+
import { Injectable, makeEnvironmentProviders, inject, computed } from '@angular/core';
|
|
3
|
+
import { NgSsmFeatureState, provideReducers, Store } from 'ngssm-store';
|
|
4
4
|
import { __decorate } from 'tslib';
|
|
5
5
|
import update from 'immutability-helper';
|
|
6
6
|
|
|
@@ -103,10 +103,10 @@ class CachedItemReducer {
|
|
|
103
103
|
}
|
|
104
104
|
return state;
|
|
105
105
|
}
|
|
106
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
107
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.
|
|
106
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: CachedItemReducer, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
107
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: CachedItemReducer });
|
|
108
108
|
}
|
|
109
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
109
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: CachedItemReducer, decorators: [{
|
|
110
110
|
type: Injectable
|
|
111
111
|
}] });
|
|
112
112
|
|
|
@@ -114,9 +114,34 @@ const provideNgssmCaching = () => {
|
|
|
114
114
|
return makeEnvironmentProviders([provideReducers(CachedItemReducer)]);
|
|
115
115
|
};
|
|
116
116
|
|
|
117
|
+
const cachedItemToSignal = (key, options) => {
|
|
118
|
+
const store = inject(Store);
|
|
119
|
+
const usedOptions = options ?? { type: 'item' };
|
|
120
|
+
if (!usedOptions.type) {
|
|
121
|
+
usedOptions.type = 'item';
|
|
122
|
+
}
|
|
123
|
+
switch (usedOptions.type) {
|
|
124
|
+
case 'status':
|
|
125
|
+
return {
|
|
126
|
+
key,
|
|
127
|
+
value: computed(() => selectNgssmCachedItem(store.state(), key)?.status ?? options?.defaultValue ?? CachedItemStatus.notSet)
|
|
128
|
+
};
|
|
129
|
+
case 'error':
|
|
130
|
+
return {
|
|
131
|
+
key,
|
|
132
|
+
value: computed(() => selectNgssmCachedItem(store.state(), key)?.error ?? options?.defaultValue)
|
|
133
|
+
};
|
|
134
|
+
case 'item':
|
|
135
|
+
return {
|
|
136
|
+
key,
|
|
137
|
+
value: computed(() => selectNgssmCachedItem(store.state(), key)?.item ?? options?.defaultValue)
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
|
|
117
142
|
/**
|
|
118
143
|
* Generated bundle index. Do not edit.
|
|
119
144
|
*/
|
|
120
145
|
|
|
121
|
-
export { CachedItemStatus, NgssmCachingActionType, NgssmCachingStateSpecification, SetCachedItemAction, UnsetCachedItemAction, provideNgssmCaching, selectNgssmCachedItem, selectNgssmCachingState, updateNgssmCachingState };
|
|
146
|
+
export { CachedItemStatus, NgssmCachingActionType, NgssmCachingStateSpecification, SetCachedItemAction, UnsetCachedItemAction, cachedItemToSignal, provideNgssmCaching, selectNgssmCachedItem, selectNgssmCachingState, updateNgssmCachingState };
|
|
122
147
|
//# sourceMappingURL=ngssm-store-caching.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngssm-store-caching.mjs","sources":["../../../projects/ngssm-store/caching/src/actions/ngssm-caching-action-type.ts","../../../projects/ngssm-store/caching/src/model/cached-item-status.ts","../../../projects/ngssm-store/caching/src/actions/set-cached-item.action.ts","../../../projects/ngssm-store/caching/src/actions/unset-cached-item.action.ts","../../../projects/ngssm-store/caching/src/state/ngssm-caching.state.ts","../../../projects/ngssm-store/caching/src/state/selectors.ts","../../../projects/ngssm-store/caching/src/reducers/cached-item.reducer.ts","../../../projects/ngssm-store/caching/src/provide-ngssm-caching.ts","../../../projects/ngssm-store/caching/ngssm-store-caching.ts"],"sourcesContent":["export enum NgssmCachingActionType {\n setCachedItem = '[NgssmCachingActionType] setCachedItem',\n unsetCachedItem = '[NgssmCachingActionType] unsetCachedItem'\n}\n","export enum CachedItemStatus {\n notSet = 'Not Set',\n loading = 'Loading',\n set = 'Set',\n error = 'Error'\n}\n","import { Action } from 'ngssm-store';\n\nimport { NgssmCachingActionType } from './ngssm-caching-action-type';\nimport { CachedItemStatus } from '../model';\n\n/**\n * Represents an action to set a cached item in the state. If key is already set in the state, the value is replaced by the new one.\n *\n * @template TData The type of the cached item's data.\n * @implements {Action}\n *\n * @property {string} cachedItemKey - The unique key identifying the cached item.\n * @property {TData} cachedItem - The data to be cached.\n * @property {CachedItemStatus} [status=CachedItemStatus.set] - The status of the cached item operation.\n * @property {string} [error] - An optional error message if the caching operation failed.\n *\n * @remarks\n * This action is dispatched to update the cache with a new or modified item, along with its status and any error information.\n */\nexport class SetCachedItemAction<TData = unknown> implements Action {\n public readonly type: string = NgssmCachingActionType.setCachedItem;\n\n constructor(\n public readonly cachedItemKey: string,\n public readonly cachedItem: TData,\n public readonly status = CachedItemStatus.set,\n public readonly error?: string\n ) {}\n}\n","import { Action } from 'ngssm-store';\nimport { NgssmCachingActionType } from './ngssm-caching-action-type';\n\nexport class UnsetCachedItemAction implements Action {\n public readonly type: string = NgssmCachingActionType.unsetCachedItem;\n\n constructor(public readonly cachedItemKey: string) {}\n}\n","import update, { CustomCommands, Spec } from 'immutability-helper';\n\nimport { NgSsmFeatureState, State } from 'ngssm-store';\nimport { CachedItem } from '../model';\n\nexport const selectNgssmCachingState = (state: State): NgssmCachingState =>\n state[NgssmCachingStateSpecification.featureStateKey] as NgssmCachingState;\n\nexport const updateNgssmCachingState = <T extends CustomCommands<object> = never>(\n state: State,\n command: Spec<NgssmCachingState, T>\n): State =>\n update(state, {\n [NgssmCachingStateSpecification.featureStateKey]: command\n });\n\nexport interface NgssmCachingState {\n caches: Record<string, CachedItem>;\n}\n\n@NgSsmFeatureState({\n featureStateKey: NgssmCachingStateSpecification.featureStateKey,\n initialState: NgssmCachingStateSpecification.initialState\n})\nexport class NgssmCachingStateSpecification {\n public static readonly featureStateKey = 'ngssm-caching-state';\n public static readonly initialState: NgssmCachingState = {\n caches: {}\n };\n}\n","import { State } from 'ngssm-store';\nimport { CachedItem } from '../model';\nimport { selectNgssmCachingState } from './ngssm-caching.state';\n\nexport const selectNgssmCachedItem = <T = unknown>(state: State, key: string): CachedItem<T> | undefined =>\n selectNgssmCachingState(state).caches[key] as CachedItem<T>;\n","import { Injectable } from '@angular/core';\n\nimport { Reducer, State, Action } from 'ngssm-store';\n\nimport { NgssmCachingActionType, SetCachedItemAction, UnsetCachedItemAction } from '../actions';\nimport { selectNgssmCachedItem, updateNgssmCachingState } from '../state';\n\n@Injectable()\nexport class CachedItemReducer implements Reducer {\n public readonly processedActions: string[] = [NgssmCachingActionType.setCachedItem, NgssmCachingActionType.unsetCachedItem];\n\n public updateState(state: State, action: Action): State {\n switch (action.type) {\n case NgssmCachingActionType.setCachedItem: {\n const setCachedItemAction = action as SetCachedItemAction;\n\n return updateNgssmCachingState(state, {\n caches: {\n [setCachedItemAction.cachedItemKey]: {\n $set: {\n status: setCachedItemAction.status,\n error: setCachedItemAction.error,\n item: setCachedItemAction.cachedItem\n }\n }\n }\n });\n }\n\n case NgssmCachingActionType.unsetCachedItem: {\n const unsetCachedItemAction = action as UnsetCachedItemAction;\n if (selectNgssmCachedItem(state, unsetCachedItemAction.cachedItemKey) === undefined) {\n return state;\n }\n\n return updateNgssmCachingState(state, {\n caches: { $unset: [unsetCachedItemAction.cachedItemKey] }\n });\n }\n }\n\n return state;\n }\n}\n","import { EnvironmentProviders, makeEnvironmentProviders } from '@angular/core';\nimport { provideReducers } from 'ngssm-store';\nimport { CachedItemReducer } from './reducers';\n\nexport const provideNgssmCaching = (): EnvironmentProviders => {\n return makeEnvironmentProviders([provideReducers(CachedItemReducer)]);\n};\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;IAAY;AAAZ,CAAA,UAAY,sBAAsB,EAAA;AACh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uB,CAAC,KAAK,EAAE;oBACpC,MAAM,EAAE,EAAE,MAAM,EAAE,CAAC,qBAAqB,CAAC,aAAa,CAAC;AACxD,iBAAA,CAAC;YACJ;;AAGF,QAAA,OAAO,KAAK;IACd;wGAlCW,iBAAiB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA;4GAAjB,iBAAiB,EAAA,CAAA;;4FAAjB,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAD7B;;;ACHM,MAAM,mBAAmB,GAAG,MAA2B;IAC5D,OAAO,wBAAwB,CAAC,CAAC,eAAe,CAAC,iBAAiB,CAAC,CAAC,CAAC;AACvE;;ACNA;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ngssm-store-caching.mjs","sources":["../../../projects/ngssm-store/caching/src/actions/ngssm-caching-action-type.ts","../../../projects/ngssm-store/caching/src/model/cached-item-status.ts","../../../projects/ngssm-store/caching/src/actions/set-cached-item.action.ts","../../../projects/ngssm-store/caching/src/actions/unset-cached-item.action.ts","../../../projects/ngssm-store/caching/src/state/ngssm-caching.state.ts","../../../projects/ngssm-store/caching/src/state/selectors.ts","../../../projects/ngssm-store/caching/src/reducers/cached-item.reducer.ts","../../../projects/ngssm-store/caching/src/provide-ngssm-caching.ts","../../../projects/ngssm-store/caching/src/cached-item-signal.ts","../../../projects/ngssm-store/caching/ngssm-store-caching.ts"],"sourcesContent":["export enum NgssmCachingActionType {\n setCachedItem = '[NgssmCachingActionType] setCachedItem',\n unsetCachedItem = '[NgssmCachingActionType] unsetCachedItem'\n}\n","export enum CachedItemStatus {\n notSet = 'Not Set',\n loading = 'Loading',\n set = 'Set',\n error = 'Error'\n}\n","import { Action } from 'ngssm-store';\n\nimport { NgssmCachingActionType } from './ngssm-caching-action-type';\nimport { CachedItemStatus } from '../model';\n\n/**\n * Represents an action to set a cached item in the state. If key is already set in the state, the value is replaced by the new one.\n *\n * @template TData The type of the cached item's data.\n * @implements {Action}\n *\n * @property {string} cachedItemKey - The unique key identifying the cached item.\n * @property {TData} cachedItem - The data to be cached.\n * @property {CachedItemStatus} [status=CachedItemStatus.set] - The status of the cached item operation.\n * @property {string} [error] - An optional error message if the caching operation failed.\n *\n * @remarks\n * This action is dispatched to update the cache with a new or modified item, along with its status and any error information.\n */\nexport class SetCachedItemAction<TData = unknown> implements Action {\n public readonly type: string = NgssmCachingActionType.setCachedItem;\n\n constructor(\n public readonly cachedItemKey: string,\n public readonly cachedItem: TData,\n public readonly status = CachedItemStatus.set,\n public readonly error?: string\n ) {}\n}\n","import { Action } from 'ngssm-store';\nimport { NgssmCachingActionType } from './ngssm-caching-action-type';\n\nexport class UnsetCachedItemAction implements Action {\n public readonly type: string = NgssmCachingActionType.unsetCachedItem;\n\n constructor(public readonly cachedItemKey: string) {}\n}\n","import update, { CustomCommands, Spec } from 'immutability-helper';\n\nimport { NgSsmFeatureState, State } from 'ngssm-store';\nimport { CachedItem } from '../model';\n\nexport const selectNgssmCachingState = (state: State): NgssmCachingState =>\n state[NgssmCachingStateSpecification.featureStateKey] as NgssmCachingState;\n\nexport const updateNgssmCachingState = <T extends CustomCommands<object> = never>(\n state: State,\n command: Spec<NgssmCachingState, T>\n): State =>\n update(state, {\n [NgssmCachingStateSpecification.featureStateKey]: command\n });\n\nexport interface NgssmCachingState {\n caches: Record<string, CachedItem>;\n}\n\n@NgSsmFeatureState({\n featureStateKey: NgssmCachingStateSpecification.featureStateKey,\n initialState: NgssmCachingStateSpecification.initialState\n})\nexport class NgssmCachingStateSpecification {\n public static readonly featureStateKey = 'ngssm-caching-state';\n public static readonly initialState: NgssmCachingState = {\n caches: {}\n };\n}\n","import { State } from 'ngssm-store';\nimport { CachedItem } from '../model';\nimport { selectNgssmCachingState } from './ngssm-caching.state';\n\nexport const selectNgssmCachedItem = <T = unknown>(state: State, key: string): CachedItem<T> | undefined =>\n selectNgssmCachingState(state).caches[key] as CachedItem<T>;\n","import { Injectable } from '@angular/core';\n\nimport { Reducer, State, Action } from 'ngssm-store';\n\nimport { NgssmCachingActionType, SetCachedItemAction, UnsetCachedItemAction } from '../actions';\nimport { selectNgssmCachedItem, updateNgssmCachingState } from '../state';\n\n@Injectable()\nexport class CachedItemReducer implements Reducer {\n public readonly processedActions: string[] = [NgssmCachingActionType.setCachedItem, NgssmCachingActionType.unsetCachedItem];\n\n public updateState(state: State, action: Action): State {\n switch (action.type) {\n case NgssmCachingActionType.setCachedItem: {\n const setCachedItemAction = action as SetCachedItemAction;\n\n return updateNgssmCachingState(state, {\n caches: {\n [setCachedItemAction.cachedItemKey]: {\n $set: {\n status: setCachedItemAction.status,\n error: setCachedItemAction.error,\n item: setCachedItemAction.cachedItem\n }\n }\n }\n });\n }\n\n case NgssmCachingActionType.unsetCachedItem: {\n const unsetCachedItemAction = action as UnsetCachedItemAction;\n if (selectNgssmCachedItem(state, unsetCachedItemAction.cachedItemKey) === undefined) {\n return state;\n }\n\n return updateNgssmCachingState(state, {\n caches: { $unset: [unsetCachedItemAction.cachedItemKey] }\n });\n }\n }\n\n return state;\n }\n}\n","import { EnvironmentProviders, makeEnvironmentProviders } from '@angular/core';\nimport { provideReducers } from 'ngssm-store';\nimport { CachedItemReducer } from './reducers';\n\nexport const provideNgssmCaching = (): EnvironmentProviders => {\n return makeEnvironmentProviders([provideReducers(CachedItemReducer)]);\n};\n","import { computed, inject, Signal } from '@angular/core';\nimport { Store } from 'ngssm-store';\n\nimport { CachedItemStatus } from './model';\nimport { selectNgssmCachedItem } from './state';\n\nexport interface NgssmCachedItemSignal<T = unknown> {\n key: string;\n value: Signal<T>;\n}\n\nexport type NgssmCachedItemSignalType = 'item' | 'status' | 'error';\n\nexport interface NgssmCachedItemSignalOptions<T = unknown> {\n type?: NgssmCachedItemSignalType;\n defaultValue?: T;\n}\n\nexport const cachedItemToSignal = <T = unknown>(key: string, options?: NgssmCachedItemSignalOptions<T>): NgssmCachedItemSignal<T> => {\n const store = inject(Store);\n\n const usedOptions = options ?? { type: 'item' };\n if (!usedOptions.type) {\n usedOptions.type = 'item';\n }\n\n switch (usedOptions.type) {\n case 'status':\n return {\n key,\n value: computed(\n () => selectNgssmCachedItem(store.state(), key)?.status ?? options?.defaultValue ?? CachedItemStatus.notSet\n ) as Signal<T>\n };\n\n case 'error':\n return {\n key,\n value: computed(() => selectNgssmCachedItem(store.state(), key)?.error ?? options?.defaultValue) as Signal<T>\n };\n\n case 'item':\n return {\n key,\n value: computed(() => selectNgssmCachedItem<T>(store.state(), key)?.item ?? options?.defaultValue) as Signal<T>\n };\n }\n};\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;IAAY;AAAZ,CAAA,UAAY,sBAAsB,EAAA;AAChC,IAAA,sBAAA,CAAA,eAAA,CAAA,GAAA,wCAAwD;AACxD,IAAA,sBAAA,CAAA,iBAAA,CAAA,GAAA,0CAA4D;AAC9D,CAAC,EAHW,sBAAsB,KAAtB,sBAAsB,GAAA,EAAA,CAAA,CAAA;;ICAtB;AAAZ,CAAA,UAAY,gBAAgB,EAAA;AAC1B,IAAA,gBAAA,CAAA,QAAA,CAAA,GAAA,SAAkB;AAClB,IAAA,gBAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;AACnB,IAAA,gBAAA,CAAA,KAAA,CAAA,GAAA,KAAW;AACX,IAAA,gBAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACjB,CAAC,EALW,gBAAgB,KAAhB,gBAAgB,GAAA,EAAA,CAAA,CAAA;;ACK5B;;;;;;;;;;;;;AAaG;MACU,mBAAmB,CAAA;AAIZ,IAAA,aAAA;AACA,IAAA,UAAA;AACA,IAAA,MAAA;AACA,IAAA,KAAA;AANF,IAAA,IAAI,GAAW,sBAAsB,CAAC,aAAa;IAEnE,WAAA,CACkB,aAAqB,EACrB,UAAiB,EACjB,SAAS,gBAAgB,CAAC,GAAG,EAC7B,KAAc,EAAA;QAHd,IAAA,CAAA,aAAa,GAAb,aAAa;QACb,IA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QAAQ;YACX,OAAO;gBACL,GAAG;gBACH,KAAK,EAAE,QAAQ,CACb,MAAM,qBAAqB,CAAC,KAAK,CAAC,KAAK,EAAE,EAAE,GAAG,CAAC,EAAE,MAAM,IAAI,OAAO,EAAE,YAAY,IAAI,gBAAgB,CAAC,MAAM;aAE9G;AAEH,QAAA,KAAK,OAAO;YACV,OAAO;gBACL,GAAG;gBACH,KAAK,EAAE,QAAQ,CAAC,MAAM,qBAAqB,CAAC,KAAK,CAAC,KAAK,EAAE,EAAE,GAAG,CAAC,EAAE,KAAK,IAAI,OAAO,EAAE,YAAY;aAChG;AAEH,QAAA,KAAK,MAAM;YACT,OAAO;gBACL,GAAG;gBACH,KAAK,EAAE,QAAQ,CAAC,MAAM,qBAAqB,CAAI,KAAK,CAAC,KAAK,EAAE,EAAE,GAAG,CAAC,EAAE,IAAI,IAAI,OAAO,EAAE,YAAY;aAClG;;AAEP;;AC/CA;;AAEG;;;;"}
|
|
@@ -39,10 +39,10 @@ class NgssmVisibilitySetter {
|
|
|
39
39
|
this.store.stateValue = this.reducer.updateState(this.store.stateValue, new ToggleElementVisibilityAction(elementKey));
|
|
40
40
|
return this;
|
|
41
41
|
}
|
|
42
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
43
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.
|
|
42
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: NgssmVisibilitySetter, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
43
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: NgssmVisibilitySetter });
|
|
44
44
|
}
|
|
45
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
45
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: NgssmVisibilitySetter, decorators: [{
|
|
46
46
|
type: Injectable
|
|
47
47
|
}] });
|
|
48
48
|
/**
|
|
@@ -133,10 +133,10 @@ class VisibilityReducer {
|
|
|
133
133
|
elements: elementsCommand
|
|
134
134
|
});
|
|
135
135
|
}
|
|
136
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
137
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.
|
|
136
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: VisibilityReducer, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
137
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: VisibilityReducer });
|
|
138
138
|
}
|
|
139
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
139
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: VisibilityReducer, decorators: [{
|
|
140
140
|
type: Injectable
|
|
141
141
|
}] });
|
|
142
142
|
|
|
@@ -148,10 +148,10 @@ class NgssmIsElementVisiblePipe {
|
|
|
148
148
|
transform(value, ...args) {
|
|
149
149
|
return selectNgssmVisibilityState(value).elements[args[0]] === true;
|
|
150
150
|
}
|
|
151
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
152
|
-
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.2.
|
|
151
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: NgssmIsElementVisiblePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
152
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.2.15", ngImport: i0, type: NgssmIsElementVisiblePipe, isStandalone: true, name: "ngssmIsElementVisible" });
|
|
153
153
|
}
|
|
154
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
154
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: NgssmIsElementVisiblePipe, decorators: [{
|
|
155
155
|
type: Pipe,
|
|
156
156
|
args: [{
|
|
157
157
|
name: 'ngssmIsElementVisible'
|
|
@@ -167,10 +167,10 @@ class NgssmShowElement {
|
|
|
167
167
|
this.store.dispatchAction(new ShowElementAction(elementKey));
|
|
168
168
|
}
|
|
169
169
|
}
|
|
170
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
171
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.
|
|
170
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: NgssmShowElement, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
171
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.15", type: NgssmShowElement, isStandalone: true, selector: "[ngssmShowElement]", inputs: { ngssmShowElement: { classPropertyName: "ngssmShowElement", publicName: "ngssmShowElement", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "click": "showElement()" } }, ngImport: i0 });
|
|
172
172
|
}
|
|
173
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
173
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: NgssmShowElement, decorators: [{
|
|
174
174
|
type: Directive,
|
|
175
175
|
args: [{
|
|
176
176
|
selector: '[ngssmShowElement]',
|
|
@@ -189,10 +189,10 @@ class NgssmHideElement {
|
|
|
189
189
|
this.store.dispatchAction(new HideElementAction(elementKey));
|
|
190
190
|
}
|
|
191
191
|
}
|
|
192
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
193
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.
|
|
192
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: NgssmHideElement, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
193
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.15", type: NgssmHideElement, isStandalone: true, selector: "[ngssmHideElement]", inputs: { ngssmHideElement: { classPropertyName: "ngssmHideElement", publicName: "ngssmHideElement", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "click": "hideElement()" } }, ngImport: i0 });
|
|
194
194
|
}
|
|
195
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
195
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: NgssmHideElement, decorators: [{
|
|
196
196
|
type: Directive,
|
|
197
197
|
args: [{
|
|
198
198
|
selector: '[ngssmHideElement]',
|
|
@@ -211,10 +211,10 @@ class NgssmToggleElementVisibility {
|
|
|
211
211
|
this.store.dispatchAction(new ToggleElementVisibilityAction(elementKey));
|
|
212
212
|
}
|
|
213
213
|
}
|
|
214
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
215
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.
|
|
214
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: NgssmToggleElementVisibility, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
215
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.2.15", type: NgssmToggleElementVisibility, isStandalone: true, selector: "[ngssmToggleElementVisibility]", inputs: { ngssmToggleElementVisibility: { classPropertyName: "ngssmToggleElementVisibility", publicName: "ngssmToggleElementVisibility", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "click": "toggleElementVisibility()" } }, ngImport: i0 });
|
|
216
216
|
}
|
|
217
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
217
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: NgssmToggleElementVisibility, decorators: [{
|
|
218
218
|
type: Directive,
|
|
219
219
|
args: [{
|
|
220
220
|
selector: '[ngssmToggleElementVisibility]',
|
|
@@ -228,10 +228,10 @@ class NgssmVisibilityToggleGroup {
|
|
|
228
228
|
items = input([], ...(ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []));
|
|
229
229
|
hideMultipleSelectionIndicator = input(false, { ...(ngDevMode ? { debugName: "hideMultipleSelectionIndicator" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
230
230
|
store = inject(Store);
|
|
231
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
232
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.
|
|
231
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: NgssmVisibilityToggleGroup, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
232
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.15", type: NgssmVisibilityToggleGroup, isStandalone: true, selector: "ngssm-visibility-toggle-group", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, hideMultipleSelectionIndicator: { classPropertyName: "hideMultipleSelectionIndicator", publicName: "hideMultipleSelectionIndicator", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<mat-button-toggle-group [multiple]=\"true\" [hideMultipleSelectionIndicator]=\"hideMultipleSelectionIndicator()\">\n @for (item of items(); track item.key) {\n <mat-button-toggle\n [ngssmToggleElementVisibility]=\"item.key\"\n [checked]=\"store.state() | ngssmIsElementVisible: item.key\"\n [id]=\"item.key\">\n {{ item.label }}\n </mat-button-toggle>\n }\n</mat-button-toggle-group>\n", dependencies: [{ kind: "directive", type: MatButtonToggleGroup, selector: "mat-button-toggle-group", inputs: ["appearance", "name", "vertical", "value", "multiple", "disabled", "disabledInteractive", "hideSingleSelectionIndicator", "hideMultipleSelectionIndicator"], outputs: ["valueChange", "change"], exportAs: ["matButtonToggleGroup"] }, { kind: "component", type: MatButtonToggle, selector: "mat-button-toggle", inputs: ["aria-label", "aria-labelledby", "id", "name", "value", "tabIndex", "disableRipple", "appearance", "checked", "disabled", "disabledInteractive"], outputs: ["change"], exportAs: ["matButtonToggle"] }, { kind: "directive", type: NgssmToggleElementVisibility, selector: "[ngssmToggleElementVisibility]", inputs: ["ngssmToggleElementVisibility"] }, { kind: "pipe", type: NgssmIsElementVisiblePipe, name: "ngssmIsElementVisible" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
233
233
|
}
|
|
234
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
234
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: NgssmVisibilityToggleGroup, decorators: [{
|
|
235
235
|
type: Component,
|
|
236
236
|
args: [{ selector: 'ngssm-visibility-toggle-group', imports: [MatButtonToggleGroup, MatButtonToggle, NgssmToggleElementVisibility, NgssmIsElementVisiblePipe], changeDetection: ChangeDetectionStrategy.OnPush, template: "<mat-button-toggle-group [multiple]=\"true\" [hideMultipleSelectionIndicator]=\"hideMultipleSelectionIndicator()\">\n @for (item of items(); track item.key) {\n <mat-button-toggle\n [ngssmToggleElementVisibility]=\"item.key\"\n [checked]=\"store.state() | ngssmIsElementVisible: item.key\"\n [id]=\"item.key\">\n {{ item.label }}\n </mat-button-toggle>\n }\n</mat-button-toggle-group>\n" }]
|
|
237
237
|
}], propDecorators: { items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: false }] }], hideMultipleSelectionIndicator: [{ type: i0.Input, args: [{ isSignal: true, alias: "hideMultipleSelectionIndicator", required: false }] }] } });
|
package/fesm2022/ngssm-store.mjs
CHANGED
|
@@ -65,10 +65,10 @@ class Logger {
|
|
|
65
65
|
payload
|
|
66
66
|
});
|
|
67
67
|
}
|
|
68
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
69
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.
|
|
68
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: Logger, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
69
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: Logger, providedIn: 'root' });
|
|
70
70
|
}
|
|
71
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
71
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: Logger, decorators: [{
|
|
72
72
|
type: Injectable,
|
|
73
73
|
args: [{
|
|
74
74
|
providedIn: 'root'
|
|
@@ -102,10 +102,10 @@ class ConsoleAppender {
|
|
|
102
102
|
stop() {
|
|
103
103
|
this.stopEvent$.next(true);
|
|
104
104
|
}
|
|
105
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
106
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.
|
|
105
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: ConsoleAppender, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
106
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: ConsoleAppender, providedIn: 'root' });
|
|
107
107
|
}
|
|
108
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
108
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: ConsoleAppender, decorators: [{
|
|
109
109
|
type: Injectable,
|
|
110
110
|
args: [{
|
|
111
111
|
providedIn: 'root'
|
|
@@ -371,10 +371,10 @@ class Store {
|
|
|
371
371
|
Promise.resolve().then(() => this.processNextAction());
|
|
372
372
|
}
|
|
373
373
|
}
|
|
374
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
375
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.
|
|
374
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: Store, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
375
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: Store, providedIn: 'root' });
|
|
376
376
|
}
|
|
377
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
377
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: Store, decorators: [{
|
|
378
378
|
type: Injectable,
|
|
379
379
|
args: [{
|
|
380
380
|
providedIn: 'root'
|
|
@@ -430,10 +430,10 @@ class ProvideNgssmFeatureStateDirective {
|
|
|
430
430
|
ngOnDestroy() {
|
|
431
431
|
this.store.dispatchAction(new NgssmUnregisterFeatureStateAction(this.component.featureStateKey));
|
|
432
432
|
}
|
|
433
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
434
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.
|
|
433
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: ProvideNgssmFeatureStateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
434
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.15", type: ProvideNgssmFeatureStateDirective, isStandalone: true, selector: "[provideNgssmFeatureState]", ngImport: i0 });
|
|
435
435
|
}
|
|
436
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
436
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: ProvideNgssmFeatureStateDirective, decorators: [{
|
|
437
437
|
type: Directive,
|
|
438
438
|
args: [{
|
|
439
439
|
// eslint-disable-next-line @angular-eslint/directive-selector
|
|
@@ -460,10 +460,10 @@ class FeatureStateReducer {
|
|
|
460
460
|
}
|
|
461
461
|
return state;
|
|
462
462
|
}
|
|
463
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
464
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.
|
|
463
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: FeatureStateReducer, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
464
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: FeatureStateReducer });
|
|
465
465
|
}
|
|
466
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
466
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: FeatureStateReducer, decorators: [{
|
|
467
467
|
type: Injectable
|
|
468
468
|
}] });
|
|
469
469
|
|
|
@@ -486,10 +486,10 @@ class NgSsmComponent {
|
|
|
486
486
|
dispatchActionType(actionType) {
|
|
487
487
|
this.store.dispatchActionType(actionType);
|
|
488
488
|
}
|
|
489
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.
|
|
490
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.
|
|
489
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: NgSsmComponent, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
490
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.15", type: NgSsmComponent, isStandalone: true, ngImport: i0 });
|
|
491
491
|
}
|
|
492
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.
|
|
492
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImport: i0, type: NgSsmComponent, decorators: [{
|
|
493
493
|
type: Directive,
|
|
494
494
|
args: [{}]
|
|
495
495
|
}] });
|
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EnvironmentProviders } from '@angular/core';
|
|
1
|
+
import { EnvironmentProviders, Signal } from '@angular/core';
|
|
2
2
|
import { Action, State } from 'ngssm-store';
|
|
3
3
|
import { CustomCommands, Spec } from 'immutability-helper';
|
|
4
4
|
|
|
@@ -63,5 +63,16 @@ declare class NgssmCachingStateSpecification {
|
|
|
63
63
|
|
|
64
64
|
declare const selectNgssmCachedItem: <T = unknown>(state: State, key: string) => CachedItem<T> | undefined;
|
|
65
65
|
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
interface NgssmCachedItemSignal<T = unknown> {
|
|
67
|
+
key: string;
|
|
68
|
+
value: Signal<T>;
|
|
69
|
+
}
|
|
70
|
+
type NgssmCachedItemSignalType = 'item' | 'status' | 'error';
|
|
71
|
+
interface NgssmCachedItemSignalOptions<T = unknown> {
|
|
72
|
+
type?: NgssmCachedItemSignalType;
|
|
73
|
+
defaultValue?: T;
|
|
74
|
+
}
|
|
75
|
+
declare const cachedItemToSignal: <T = unknown>(key: string, options?: NgssmCachedItemSignalOptions<T>) => NgssmCachedItemSignal<T>;
|
|
76
|
+
|
|
77
|
+
export { CachedItemStatus, NgssmCachingActionType, NgssmCachingStateSpecification, SetCachedItemAction, UnsetCachedItemAction, cachedItemToSignal, provideNgssmCaching, selectNgssmCachedItem, selectNgssmCachingState, updateNgssmCachingState };
|
|
78
|
+
export type { CachedItem, NgssmCachedItemSignal, NgssmCachedItemSignalOptions, NgssmCachedItemSignalType, NgssmCachingState };
|