ngssm-store 22.0.0 → 22.0.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.
- package/fesm2022/ngssm-store-caching-testing.mjs +3 -3
- package/fesm2022/ngssm-store-caching.mjs +3 -3
- package/fesm2022/ngssm-store-visibility-testing.mjs +3 -3
- package/fesm2022/ngssm-store-visibility.mjs +20 -20
- package/fesm2022/ngssm-store-visibility.mjs.map +1 -1
- package/fesm2022/ngssm-store.mjs +18 -18
- package/package.json +1 -1
|
@@ -93,10 +93,10 @@ class NgssmCachedItemSetter {
|
|
|
93
93
|
}
|
|
94
94
|
return this;
|
|
95
95
|
}
|
|
96
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
97
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.
|
|
96
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: NgssmCachedItemSetter, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
97
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: NgssmCachedItemSetter });
|
|
98
98
|
}
|
|
99
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
99
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: NgssmCachedItemSetter, decorators: [{
|
|
100
100
|
type: Injectable
|
|
101
101
|
}] });
|
|
102
102
|
const ngssmCachedItemSetter = () => TestBed.inject(NgssmCachedItemSetter);
|
|
@@ -103,10 +103,10 @@ class CachedItemReducer {
|
|
|
103
103
|
}
|
|
104
104
|
return state;
|
|
105
105
|
}
|
|
106
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
107
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.
|
|
106
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CachedItemReducer, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
107
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CachedItemReducer });
|
|
108
108
|
}
|
|
109
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
109
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: CachedItemReducer, decorators: [{
|
|
110
110
|
type: Injectable
|
|
111
111
|
}] });
|
|
112
112
|
|
|
@@ -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: "22.0.
|
|
43
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.
|
|
42
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: NgssmVisibilitySetter, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
43
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: NgssmVisibilitySetter });
|
|
44
44
|
}
|
|
45
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
45
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: NgssmVisibilitySetter, decorators: [{
|
|
46
46
|
type: Injectable
|
|
47
47
|
}] });
|
|
48
48
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { Injectable, makeEnvironmentProviders, Pipe, input, inject, Directive, booleanAttribute,
|
|
2
|
+
import { Injectable, makeEnvironmentProviders, Pipe, input, inject, Directive, booleanAttribute, Component } from '@angular/core';
|
|
3
3
|
import { NgSsmFeatureState, provideReducers, Store, createSignal } from 'ngssm-store';
|
|
4
4
|
import { __decorate } from 'tslib';
|
|
5
5
|
import update from 'immutability-helper';
|
|
@@ -133,10 +133,10 @@ class VisibilityReducer {
|
|
|
133
133
|
elements: elementsCommand
|
|
134
134
|
});
|
|
135
135
|
}
|
|
136
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
137
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.
|
|
136
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: VisibilityReducer, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
137
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: VisibilityReducer });
|
|
138
138
|
}
|
|
139
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
139
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", 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: "22.0.
|
|
152
|
-
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "22.0.
|
|
151
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: NgssmIsElementVisiblePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
152
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "22.0.5", ngImport: i0, type: NgssmIsElementVisiblePipe, isStandalone: true, name: "ngssmIsElementVisible" });
|
|
153
153
|
}
|
|
154
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
154
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: NgssmIsElementVisiblePipe, decorators: [{
|
|
155
155
|
type: Pipe,
|
|
156
156
|
args: [{
|
|
157
157
|
name: 'ngssmIsElementVisible'
|
|
@@ -168,10 +168,10 @@ class NgssmShowElement {
|
|
|
168
168
|
this.store.dispatchAction(new ShowElementAction(elementKey));
|
|
169
169
|
}
|
|
170
170
|
}
|
|
171
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
172
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.
|
|
171
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: NgssmShowElement, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
172
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.5", type: NgssmShowElement, isStandalone: true, selector: "[ngssmShowElement]", inputs: { ngssmShowElement: { classPropertyName: "ngssmShowElement", publicName: "ngssmShowElement", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "click": "showElement()" } }, ngImport: i0 });
|
|
173
173
|
}
|
|
174
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
174
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: NgssmShowElement, decorators: [{
|
|
175
175
|
type: Directive,
|
|
176
176
|
args: [{
|
|
177
177
|
selector: '[ngssmShowElement]',
|
|
@@ -191,10 +191,10 @@ class NgssmHideElement {
|
|
|
191
191
|
this.store.dispatchAction(new HideElementAction(elementKey));
|
|
192
192
|
}
|
|
193
193
|
}
|
|
194
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
195
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.
|
|
194
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: NgssmHideElement, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
195
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.5", type: NgssmHideElement, isStandalone: true, selector: "[ngssmHideElement]", inputs: { ngssmHideElement: { classPropertyName: "ngssmHideElement", publicName: "ngssmHideElement", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "click": "hideElement()" } }, ngImport: i0 });
|
|
196
196
|
}
|
|
197
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
197
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: NgssmHideElement, decorators: [{
|
|
198
198
|
type: Directive,
|
|
199
199
|
args: [{
|
|
200
200
|
selector: '[ngssmHideElement]',
|
|
@@ -214,10 +214,10 @@ class NgssmToggleElementVisibility {
|
|
|
214
214
|
this.store.dispatchAction(new ToggleElementVisibilityAction(elementKey));
|
|
215
215
|
}
|
|
216
216
|
}
|
|
217
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
218
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.
|
|
217
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: NgssmToggleElementVisibility, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
218
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.5", type: NgssmToggleElementVisibility, isStandalone: true, selector: "[ngssmToggleElementVisibility]", inputs: { ngssmToggleElementVisibility: { classPropertyName: "ngssmToggleElementVisibility", publicName: "ngssmToggleElementVisibility", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "click": "toggleElementVisibility()" } }, ngImport: i0 });
|
|
219
219
|
}
|
|
220
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
220
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: NgssmToggleElementVisibility, decorators: [{
|
|
221
221
|
type: Directive,
|
|
222
222
|
args: [{
|
|
223
223
|
selector: '[ngssmToggleElementVisibility]',
|
|
@@ -232,12 +232,12 @@ class NgssmVisibilityToggleGroup {
|
|
|
232
232
|
...(ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []));
|
|
233
233
|
hideMultipleSelectionIndicator = input(false, { ...(ngDevMode ? { debugName: "hideMultipleSelectionIndicator" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
|
|
234
234
|
store = inject(Store);
|
|
235
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
236
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.
|
|
235
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: NgssmVisibilityToggleGroup, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
236
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.5", 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" }] });
|
|
237
237
|
}
|
|
238
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
238
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: NgssmVisibilityToggleGroup, decorators: [{
|
|
239
239
|
type: Component,
|
|
240
|
-
args: [{ selector: 'ngssm-visibility-toggle-group', imports: [MatButtonToggleGroup, MatButtonToggle, NgssmToggleElementVisibility, NgssmIsElementVisiblePipe],
|
|
240
|
+
args: [{ selector: 'ngssm-visibility-toggle-group', imports: [MatButtonToggleGroup, MatButtonToggle, NgssmToggleElementVisibility, NgssmIsElementVisiblePipe], 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" }]
|
|
241
241
|
}], propDecorators: { items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: false }] }], hideMultipleSelectionIndicator: [{ type: i0.Input, args: [{ isSignal: true, alias: "hideMultipleSelectionIndicator", required: false }] }] } });
|
|
242
242
|
|
|
243
243
|
// Creates a signal allowing to listen to changes in element visibility.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngssm-store-visibility.mjs","sources":["../../../projects/ngssm-store/visibility/src/actions/ngssm-visibility-action-type.ts","../../../projects/ngssm-store/visibility/src/actions/toggle-element-visibility.action.ts","../../../projects/ngssm-store/visibility/src/actions/show-element.action.ts","../../../projects/ngssm-store/visibility/src/actions/hide-element.action.ts","../../../projects/ngssm-store/visibility/src/actions/define-elements-group.action.ts","../../../projects/ngssm-store/visibility/src/state/ngssm-visibility.state.ts","../../../projects/ngssm-store/visibility/src/reducers/visibility.reducer.ts","../../../projects/ngssm-store/visibility/src/provide-ngssm-visibility.ts","../../../projects/ngssm-store/visibility/src/components/ngssm-is-element-visible.pipe.ts","../../../projects/ngssm-store/visibility/src/components/ngssm-show-element.ts","../../../projects/ngssm-store/visibility/src/components/ngssm-hide-element.ts","../../../projects/ngssm-store/visibility/src/components/ngssm-toggle-element-visibility.ts","../../../projects/ngssm-store/visibility/src/components/ngssm-visibility-toggle-group/ngssm-visibility-toggle-group.ts","../../../projects/ngssm-store/visibility/src/components/ngssm-visibility-toggle-group/ngssm-visibility-toggle-group.html","../../../projects/ngssm-store/visibility/src/signal-helpers.ts","../../../projects/ngssm-store/visibility/ngssm-store-visibility.ts"],"sourcesContent":["export enum NgssmVisibilityActionType {\n defineElementsGroup = '[NgssmVisibilityActionType] defineElementsGroup',\n toggleElementVisibility = '[NgssmVisibilityActionType] toggleElementVisibility',\n hideElement = '[NgssmVisibilityActionType] hideElement',\n showElement = '[NgssmVisibilityActionType] showElement'\n}\n","import { Action } from 'ngssm-store';\nimport { NgssmVisibilityActionType } from './ngssm-visibility-action-type';\n\nexport class ToggleElementVisibilityAction implements Action {\n public readonly type: string = NgssmVisibilityActionType.toggleElementVisibility;\n\n constructor(public readonly elementKey: string) {}\n}\n","import { Action } from 'ngssm-store';\nimport { NgssmVisibilityActionType } from './ngssm-visibility-action-type';\n\nexport class ShowElementAction implements Action {\n public readonly type: string = NgssmVisibilityActionType.showElement;\n\n constructor(public readonly elementKey: string) {}\n}\n","import { Action } from 'ngssm-store';\nimport { NgssmVisibilityActionType } from './ngssm-visibility-action-type';\n\nexport class HideElementAction implements Action {\n public readonly type: string = NgssmVisibilityActionType.hideElement;\n\n constructor(public readonly elementKey: string) {}\n}\n","import { Action } from 'ngssm-store';\nimport { NgssmVisibilityActionType } from './ngssm-visibility-action-type';\n\nexport class DefineElementsGroupAction implements Action {\n public readonly type: string = NgssmVisibilityActionType.defineElementsGroup;\n\n constructor(public readonly elementKeys: string[]) {}\n}\n","import update, { Spec } from 'immutability-helper';\n\nimport { NgSsmFeatureState, State } from 'ngssm-store';\n\nexport const selectNgssmVisibilityState = (state: State): NgssmVisibilityState =>\n state[NgssmVisibilityStateSpecification.featureStateKey] as NgssmVisibilityState;\n\nexport const updateNgssmVisibilityState = (state: State, command: Spec<NgssmVisibilityState, never>): State =>\n update(state, {\n [NgssmVisibilityStateSpecification.featureStateKey]: command\n });\n\nexport interface NgssmVisibilityState {\n elements: Record<string, boolean>;\n elementsGroups: string[][];\n}\n\n@NgSsmFeatureState({\n featureStateKey: NgssmVisibilityStateSpecification.featureStateKey,\n initialState: NgssmVisibilityStateSpecification.initialState\n})\nexport class NgssmVisibilityStateSpecification {\n public static readonly featureStateKey = 'ngssm-visibility-state';\n public static readonly initialState: NgssmVisibilityState = {\n elements: {},\n elementsGroups: []\n };\n}\n","import { Injectable } from '@angular/core';\n\nimport { Spec } from 'immutability-helper';\n\nimport { Reducer, State, Action } from 'ngssm-store';\n\nimport {\n DefineElementsGroupAction,\n HideElementAction,\n NgssmVisibilityActionType,\n ShowElementAction,\n ToggleElementVisibilityAction\n} from '../actions';\nimport { selectNgssmVisibilityState, updateNgssmVisibilityState } from '../state';\n\n@Injectable()\nexport class VisibilityReducer implements Reducer {\n public readonly processedActions: string[] = [\n NgssmVisibilityActionType.toggleElementVisibility,\n NgssmVisibilityActionType.showElement,\n NgssmVisibilityActionType.hideElement,\n NgssmVisibilityActionType.defineElementsGroup\n ];\n\n public updateState(state: State, action: Action): State {\n switch (action.type) {\n case NgssmVisibilityActionType.toggleElementVisibility: {\n const toggleVisibilityAction = action as ToggleElementVisibilityAction;\n if (selectNgssmVisibilityState(state).elements[toggleVisibilityAction.elementKey] === true) {\n return updateNgssmVisibilityState(state, {\n elements: {\n [toggleVisibilityAction.elementKey]: { $set: false }\n }\n });\n }\n\n return this.setElementVisible(state, toggleVisibilityAction.elementKey);\n }\n\n case NgssmVisibilityActionType.showElement: {\n const showAction = action as ShowElementAction;\n return this.setElementVisible(state, showAction.elementKey);\n }\n\n case NgssmVisibilityActionType.hideElement: {\n const hideAction = action as HideElementAction;\n return updateNgssmVisibilityState(state, {\n elements: {\n [hideAction.elementKey]: { $set: false }\n }\n });\n }\n\n case NgssmVisibilityActionType.defineElementsGroup: {\n const defineElementsGroupAction = action as DefineElementsGroupAction;\n const keys = [...defineElementsGroupAction.elementKeys];\n keys.sort();\n if (this.groupExists(keys, selectNgssmVisibilityState(state).elementsGroups)) {\n break;\n }\n\n return updateNgssmVisibilityState(state, {\n elementsGroups: { $push: [keys] }\n });\n }\n }\n\n return state;\n }\n\n private groupExists(keys: string[], groups: string[][]): boolean {\n const index = groups.findIndex((group) => {\n return group.length === keys.length && group.findIndex((k, i) => k !== keys[i]) === -1;\n });\n return index !== -1;\n }\n\n private getElementsKeysGroupedWith(key: string, groups: string[][]): string[] {\n const keys = groups.filter((g) => g.includes(key)).flatMap((g) => g);\n const distinctKeys = new Set<string>(keys);\n distinctKeys.delete(key);\n return [...distinctKeys];\n }\n\n private setElementVisible(state: State, key: string): State {\n const elementsCommand: Spec<Record<string, boolean>, never> = {\n [key]: { $set: true }\n };\n\n const associatedElements = this.getElementsKeysGroupedWith(key, selectNgssmVisibilityState(state).elementsGroups);\n associatedElements.forEach((el) => {\n elementsCommand[el] = { $set: false };\n });\n\n return updateNgssmVisibilityState(state, {\n elements: elementsCommand\n });\n }\n}\n","import { EnvironmentProviders, makeEnvironmentProviders } from '@angular/core';\nimport { provideReducers } from 'ngssm-store';\nimport { VisibilityReducer } from './reducers';\n\nexport const provideNgssmVisibility = (): EnvironmentProviders => {\n return makeEnvironmentProviders([provideReducers(VisibilityReducer)]);\n};\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { State } from 'ngssm-store';\nimport { selectNgssmVisibilityState } from '../state';\n\n@Pipe({\n name: 'ngssmIsElementVisible'\n})\nexport class NgssmIsElementVisiblePipe implements PipeTransform {\n public transform(value: State, ...args: string[]): boolean {\n return selectNgssmVisibilityState(value).elements[args[0]] === true;\n }\n}\n","import { Directive, inject, input } from '@angular/core';\n\nimport { Store } from 'ngssm-store';\n\nimport { ShowElementAction } from '../actions';\n\n@Directive({\n selector: '[ngssmShowElement]',\n host: {\n '(click)': 'showElement()'\n }\n})\nexport class NgssmShowElement {\n public readonly ngssmShowElement = input<string | undefined | null>(undefined);\n\n private readonly store = inject(Store);\n\n public showElement(): void {\n const elementKey = this.ngssmShowElement();\n if (elementKey) {\n this.store.dispatchAction(new ShowElementAction(elementKey));\n }\n }\n}\n","import { Directive, inject, input } from '@angular/core';\n\nimport { Store } from 'ngssm-store';\n\nimport { HideElementAction } from '../actions';\n\n@Directive({\n selector: '[ngssmHideElement]',\n host: {\n '(click)': 'hideElement()'\n }\n})\nexport class NgssmHideElement {\n public readonly ngssmHideElement = input<string | undefined | null>(undefined);\n\n private readonly store = inject(Store);\n\n public hideElement(): void {\n const elementKey = this.ngssmHideElement();\n if (elementKey) {\n this.store.dispatchAction(new HideElementAction(elementKey));\n }\n }\n}\n","import { Directive, inject, input } from '@angular/core';\n\nimport { Store } from 'ngssm-store';\n\nimport { ToggleElementVisibilityAction } from '../actions';\n\n@Directive({\n selector: '[ngssmToggleElementVisibility]',\n host: {\n '(click)': 'toggleElementVisibility()'\n }\n})\nexport class NgssmToggleElementVisibility {\n public readonly ngssmToggleElementVisibility = input<string | undefined | null>(undefined);\n\n private readonly store = inject(Store);\n\n public toggleElementVisibility(): void {\n const elementKey = this.ngssmToggleElementVisibility();\n if (elementKey) {\n this.store.dispatchAction(new ToggleElementVisibilityAction(elementKey));\n }\n }\n}\n","import { Component, ChangeDetectionStrategy, booleanAttribute, input, inject } from '@angular/core';\nimport { MatButtonToggle, MatButtonToggleGroup } from '@angular/material/button-toggle';\n\nimport { Store } from 'ngssm-store';\n\nimport { NgssmIsElementVisiblePipe } from '../ngssm-is-element-visible.pipe';\nimport { NgssmToggleElementVisibility } from '../ngssm-toggle-element-visibility';\n\n@Component({\n selector: 'ngssm-visibility-toggle-group',\n imports: [MatButtonToggleGroup, MatButtonToggle, NgssmToggleElementVisibility, NgssmIsElementVisiblePipe],\n templateUrl: './ngssm-visibility-toggle-group.html',\n styleUrls: [],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class NgssmVisibilityToggleGroup {\n public readonly items = input<{ label: string; key: string }[]>([]);\n public readonly hideMultipleSelectionIndicator = input<boolean, boolean>(false, { transform: booleanAttribute });\n\n protected readonly store = inject(Store);\n}\n","<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","import { Signal } from '@angular/core';\n\nimport { createSignal } from 'ngssm-store';\n\nimport { selectNgssmVisibilityState } from './state';\n\n/**\n * Represents the visibility state of a specific element.\n * - key: The unique identifier for the element.\n * - visible: A signal that emits the visibility status (true if visible, false otherwise).\n */\nexport interface ElementVisibility {\n key: string;\n visible: Signal<boolean>;\n}\n\n// Creates a signal allowing to listen to changes in element visibility.\nexport const isElementVisible = (elementKey: string): ElementVisibility => ({\n key: elementKey,\n visible: createSignal((state) => selectNgssmVisibilityState(state).elements[elementKey] === true)\n});\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;IAAY;AAAZ,CAAA,UAAY,yBAAyB,EAAA;AACnC,IAAA,yBAAA,CAAA,qBAAA,CAAA,GAAA,iDAAuE;AACvE,IAAA,yBAAA,CAAA,yBAAA,CAAA,GAAA,qDAA+E;AAC/E,IAAA,yBAAA,CAAA,aAAA,CAAA,GAAA,yCAAuD;AACvD,IAAA,yBAAA,CAAA,aAAA,CAAA,GAAA,yCAAuD;AACzD,CAAC,EALW,yBAAyB,KAAzB,yBAAyB,GAAA,EAAA,CAAA,CAAA;;MCGxB,6BAA6B,CAAA;AAGZ,IAAA,UAAA;AAFZ,IAAA,IAAI,GAAW,yBAAyB,CAAC,uBAAuB;AAEhF,IAAA,WAAA,CAA4B,UAAkB,EAAA;QAAlB,IAAA,CAAA,UAAU,GAAV,UAAU;IAAW;AAClD;;MCJY,iBAAiB,CAAA;AAGA,IAAA,UAAA;AAFZ,IAAA,IAAI,GAAW,yBAAyB,CAAC,WAAW;AAEpE,IAAA,WAAA,CAA4B,UAAkB,EAAA;QAAlB,IAAA,CAAA,UAAU,GAAV,UAAU;IAAW;AAClD;;MCJY,iBAAiB,CAAA;AAG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AA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FAK7F,0BAA0B,EAAA,UAAA,EAAA,CAAA;kBAPtC,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,+BAA+B,EAAA,OAAA,EAChC,CAAC,oBAAoB,EAAE,eAAe,EAAE,4BAA4B,EAAE,yBAAyB,CAAC,EAAA,eAAA,EAGxF,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,gaAAA,EAAA;;;AEGjD;MACa,gBAAgB,GAAG,CAAC,UAAkB,MAAyB;AAC1E,IAAA,GAAG,EAAE,UAAU;AACf,IAAA,OAAO,EAAE,YAAY,CAAC,CAAC,KAAK,KAAK,0BAA0B,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,UAAU,CAAC,KAAK,IAAI;AACjG,CAAA;;ACpBD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"ngssm-store-visibility.mjs","sources":["../../../projects/ngssm-store/visibility/src/actions/ngssm-visibility-action-type.ts","../../../projects/ngssm-store/visibility/src/actions/toggle-element-visibility.action.ts","../../../projects/ngssm-store/visibility/src/actions/show-element.action.ts","../../../projects/ngssm-store/visibility/src/actions/hide-element.action.ts","../../../projects/ngssm-store/visibility/src/actions/define-elements-group.action.ts","../../../projects/ngssm-store/visibility/src/state/ngssm-visibility.state.ts","../../../projects/ngssm-store/visibility/src/reducers/visibility.reducer.ts","../../../projects/ngssm-store/visibility/src/provide-ngssm-visibility.ts","../../../projects/ngssm-store/visibility/src/components/ngssm-is-element-visible.pipe.ts","../../../projects/ngssm-store/visibility/src/components/ngssm-show-element.ts","../../../projects/ngssm-store/visibility/src/components/ngssm-hide-element.ts","../../../projects/ngssm-store/visibility/src/components/ngssm-toggle-element-visibility.ts","../../../projects/ngssm-store/visibility/src/components/ngssm-visibility-toggle-group/ngssm-visibility-toggle-group.ts","../../../projects/ngssm-store/visibility/src/components/ngssm-visibility-toggle-group/ngssm-visibility-toggle-group.html","../../../projects/ngssm-store/visibility/src/signal-helpers.ts","../../../projects/ngssm-store/visibility/ngssm-store-visibility.ts"],"sourcesContent":["export enum NgssmVisibilityActionType {\n defineElementsGroup = '[NgssmVisibilityActionType] defineElementsGroup',\n toggleElementVisibility = '[NgssmVisibilityActionType] toggleElementVisibility',\n hideElement = '[NgssmVisibilityActionType] hideElement',\n showElement = '[NgssmVisibilityActionType] showElement'\n}\n","import { Action } from 'ngssm-store';\nimport { NgssmVisibilityActionType } from './ngssm-visibility-action-type';\n\nexport class ToggleElementVisibilityAction implements Action {\n public readonly type: string = NgssmVisibilityActionType.toggleElementVisibility;\n\n constructor(public readonly elementKey: string) {}\n}\n","import { Action } from 'ngssm-store';\nimport { NgssmVisibilityActionType } from './ngssm-visibility-action-type';\n\nexport class ShowElementAction implements Action {\n public readonly type: string = NgssmVisibilityActionType.showElement;\n\n constructor(public readonly elementKey: string) {}\n}\n","import { Action } from 'ngssm-store';\nimport { NgssmVisibilityActionType } from './ngssm-visibility-action-type';\n\nexport class HideElementAction implements Action {\n public readonly type: string = NgssmVisibilityActionType.hideElement;\n\n constructor(public readonly elementKey: string) {}\n}\n","import { Action } from 'ngssm-store';\nimport { NgssmVisibilityActionType } from './ngssm-visibility-action-type';\n\nexport class DefineElementsGroupAction implements Action {\n public readonly type: string = NgssmVisibilityActionType.defineElementsGroup;\n\n constructor(public readonly elementKeys: string[]) {}\n}\n","import update, { Spec } from 'immutability-helper';\n\nimport { NgSsmFeatureState, State } from 'ngssm-store';\n\nexport const selectNgssmVisibilityState = (state: State): NgssmVisibilityState =>\n state[NgssmVisibilityStateSpecification.featureStateKey] as NgssmVisibilityState;\n\nexport const updateNgssmVisibilityState = (state: State, command: Spec<NgssmVisibilityState, never>): State =>\n update(state, {\n [NgssmVisibilityStateSpecification.featureStateKey]: command\n });\n\nexport interface NgssmVisibilityState {\n elements: Record<string, boolean>;\n elementsGroups: string[][];\n}\n\n@NgSsmFeatureState({\n featureStateKey: NgssmVisibilityStateSpecification.featureStateKey,\n initialState: NgssmVisibilityStateSpecification.initialState\n})\nexport class NgssmVisibilityStateSpecification {\n public static readonly featureStateKey = 'ngssm-visibility-state';\n public static readonly initialState: NgssmVisibilityState = {\n elements: {},\n elementsGroups: []\n };\n}\n","import { Injectable } from '@angular/core';\n\nimport { Spec } from 'immutability-helper';\n\nimport { Reducer, State, Action } from 'ngssm-store';\n\nimport {\n DefineElementsGroupAction,\n HideElementAction,\n NgssmVisibilityActionType,\n ShowElementAction,\n ToggleElementVisibilityAction\n} from '../actions';\nimport { selectNgssmVisibilityState, updateNgssmVisibilityState } from '../state';\n\n@Injectable()\nexport class VisibilityReducer implements Reducer {\n public readonly processedActions: string[] = [\n NgssmVisibilityActionType.toggleElementVisibility,\n NgssmVisibilityActionType.showElement,\n NgssmVisibilityActionType.hideElement,\n NgssmVisibilityActionType.defineElementsGroup\n ];\n\n public updateState(state: State, action: Action): State {\n switch (action.type) {\n case NgssmVisibilityActionType.toggleElementVisibility: {\n const toggleVisibilityAction = action as ToggleElementVisibilityAction;\n if (selectNgssmVisibilityState(state).elements[toggleVisibilityAction.elementKey] === true) {\n return updateNgssmVisibilityState(state, {\n elements: {\n [toggleVisibilityAction.elementKey]: { $set: false }\n }\n });\n }\n\n return this.setElementVisible(state, toggleVisibilityAction.elementKey);\n }\n\n case NgssmVisibilityActionType.showElement: {\n const showAction = action as ShowElementAction;\n return this.setElementVisible(state, showAction.elementKey);\n }\n\n case NgssmVisibilityActionType.hideElement: {\n const hideAction = action as HideElementAction;\n return updateNgssmVisibilityState(state, {\n elements: {\n [hideAction.elementKey]: { $set: false }\n }\n });\n }\n\n case NgssmVisibilityActionType.defineElementsGroup: {\n const defineElementsGroupAction = action as DefineElementsGroupAction;\n const keys = [...defineElementsGroupAction.elementKeys];\n keys.sort();\n if (this.groupExists(keys, selectNgssmVisibilityState(state).elementsGroups)) {\n break;\n }\n\n return updateNgssmVisibilityState(state, {\n elementsGroups: { $push: [keys] }\n });\n }\n }\n\n return state;\n }\n\n private groupExists(keys: string[], groups: string[][]): boolean {\n const index = groups.findIndex((group) => {\n return group.length === keys.length && group.findIndex((k, i) => k !== keys[i]) === -1;\n });\n return index !== -1;\n }\n\n private getElementsKeysGroupedWith(key: string, groups: string[][]): string[] {\n const keys = groups.filter((g) => g.includes(key)).flatMap((g) => g);\n const distinctKeys = new Set<string>(keys);\n distinctKeys.delete(key);\n return [...distinctKeys];\n }\n\n private setElementVisible(state: State, key: string): State {\n const elementsCommand: Spec<Record<string, boolean>, never> = {\n [key]: { $set: true }\n };\n\n const associatedElements = this.getElementsKeysGroupedWith(key, selectNgssmVisibilityState(state).elementsGroups);\n associatedElements.forEach((el) => {\n elementsCommand[el] = { $set: false };\n });\n\n return updateNgssmVisibilityState(state, {\n elements: elementsCommand\n });\n }\n}\n","import { EnvironmentProviders, makeEnvironmentProviders } from '@angular/core';\nimport { provideReducers } from 'ngssm-store';\nimport { VisibilityReducer } from './reducers';\n\nexport const provideNgssmVisibility = (): EnvironmentProviders => {\n return makeEnvironmentProviders([provideReducers(VisibilityReducer)]);\n};\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { State } from 'ngssm-store';\nimport { selectNgssmVisibilityState } from '../state';\n\n@Pipe({\n name: 'ngssmIsElementVisible'\n})\nexport class NgssmIsElementVisiblePipe implements PipeTransform {\n public transform(value: State, ...args: string[]): boolean {\n return selectNgssmVisibilityState(value).elements[args[0]] === true;\n }\n}\n","import { Directive, inject, input } from '@angular/core';\n\nimport { Store } from 'ngssm-store';\n\nimport { ShowElementAction } from '../actions';\n\n@Directive({\n selector: '[ngssmShowElement]',\n host: {\n '(click)': 'showElement()'\n }\n})\nexport class NgssmShowElement {\n public readonly ngssmShowElement = input<string | undefined | null>(undefined);\n\n private readonly store = inject(Store);\n\n public showElement(): void {\n const elementKey = this.ngssmShowElement();\n if (elementKey) {\n this.store.dispatchAction(new ShowElementAction(elementKey));\n }\n }\n}\n","import { Directive, inject, input } from '@angular/core';\n\nimport { Store } from 'ngssm-store';\n\nimport { HideElementAction } from '../actions';\n\n@Directive({\n selector: '[ngssmHideElement]',\n host: {\n '(click)': 'hideElement()'\n }\n})\nexport class NgssmHideElement {\n public readonly ngssmHideElement = input<string | undefined | null>(undefined);\n\n private readonly store = inject(Store);\n\n public hideElement(): void {\n const elementKey = this.ngssmHideElement();\n if (elementKey) {\n this.store.dispatchAction(new HideElementAction(elementKey));\n }\n }\n}\n","import { Directive, inject, input } from '@angular/core';\n\nimport { Store } from 'ngssm-store';\n\nimport { ToggleElementVisibilityAction } from '../actions';\n\n@Directive({\n selector: '[ngssmToggleElementVisibility]',\n host: {\n '(click)': 'toggleElementVisibility()'\n }\n})\nexport class NgssmToggleElementVisibility {\n public readonly ngssmToggleElementVisibility = input<string | undefined | null>(undefined);\n\n private readonly store = inject(Store);\n\n public toggleElementVisibility(): void {\n const elementKey = this.ngssmToggleElementVisibility();\n if (elementKey) {\n this.store.dispatchAction(new ToggleElementVisibilityAction(elementKey));\n }\n }\n}\n","import { Component, booleanAttribute, input, inject } from '@angular/core';\nimport { MatButtonToggle, MatButtonToggleGroup } from '@angular/material/button-toggle';\n\nimport { Store } from 'ngssm-store';\n\nimport { NgssmIsElementVisiblePipe } from '../ngssm-is-element-visible.pipe';\nimport { NgssmToggleElementVisibility } from '../ngssm-toggle-element-visibility';\n\n@Component({\n selector: 'ngssm-visibility-toggle-group',\n imports: [MatButtonToggleGroup, MatButtonToggle, NgssmToggleElementVisibility, NgssmIsElementVisiblePipe],\n templateUrl: './ngssm-visibility-toggle-group.html'\n})\nexport class NgssmVisibilityToggleGroup {\n public readonly items = input<{ label: string; key: string }[]>([]);\n public readonly hideMultipleSelectionIndicator = input<boolean, boolean>(false, { transform: booleanAttribute });\n\n protected readonly store = inject(Store);\n}\n","<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","import { Signal } from '@angular/core';\n\nimport { createSignal } from 'ngssm-store';\n\nimport { selectNgssmVisibilityState } from './state';\n\n/**\n * Represents the visibility state of a specific element.\n * - key: The unique identifier for the element.\n * - visible: A signal that emits the visibility status (true if visible, false otherwise).\n */\nexport interface ElementVisibility {\n key: string;\n visible: Signal<boolean>;\n}\n\n// Creates a signal allowing to listen to changes in element visibility.\nexport const isElementVisible = (elementKey: string): ElementVisibility => ({\n key: elementKey,\n visible: createSignal((state) => selectNgssmVisibilityState(state).elements[elementKey] === true)\n});\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;IAAY;AAAZ,CAAA,UAAY,yBAAyB,EAAA;AACnC,IAAA,yBAAA,CAAA,qBAAA,CAAA,GAAA,iDAAuE;AACvE,IAAA,yBAAA,CAAA,yBAAA,CAAA,GAAA,qDAA+E;AAC/E,IAAA,yBAAA,CAAA,aAAA,CAAA,GAAA,yCAAuD;AACvD,IAAA,yBAAA,CAAA,aAAA,CAAA,GAAA,yCAAuD;AACzD,CAAC,EALW,yBAAyB,KAAzB,yBAAyB,GAAA,EAAA,CAAA,CAAA;;MCGxB,6BAA6B,CAAA;AAGZ,IAAA,UAAA;AAFZ,IAAA,IAAI,GAAW,yBAAyB,CAAC,uBAAuB;AAEhF,IAAA,WAAA,CAA4B,UAAkB,EAAA;QAAlB,IAAA,CAAA,UAAU,GAAV,UAAU;IAAW;AAClD;;MCJY,iBAAiB,CAAA;AAGA,IAAA,UAAA;AAFZ,IAAA,IAAI,GAAW,yBAAyB,CAAC,WAAW;AAEpE,IAAA,WAAA,CAA4B,UAAkB,EAAA;QAAlB,IAAA,CAAA,UAAU,GAAV,UAAU;IAAW;AAClD;;MCJY,iBAAiB,CAAA;AAGA,IAAA,UAAA;AAFZ,IAAA,IAAI,GAAW,yBAAyB,C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ACE,+BAA+B,EAAA,OAAA,EAChC,CAAC,oBAAoB,EAAE,eAAe,EAAE,4BAA4B,EAAE,yBAAyB,CAAC,EAAA,QAAA,EAAA,gaAAA,EAAA;;;AEM3G;MACa,gBAAgB,GAAG,CAAC,UAAkB,MAAyB;AAC1E,IAAA,GAAG,EAAE,UAAU;AACf,IAAA,OAAO,EAAE,YAAY,CAAC,CAAC,KAAK,KAAK,0BAA0B,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,UAAU,CAAC,KAAK,IAAI;AACjG,CAAA;;ACpBD;;AAEG;;;;"}
|
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: "22.0.
|
|
69
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.
|
|
68
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Logger, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
69
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Logger, providedIn: 'root' });
|
|
70
70
|
}
|
|
71
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
71
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", 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: "22.0.
|
|
106
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.
|
|
105
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: ConsoleAppender, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
106
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: ConsoleAppender, providedIn: 'root' });
|
|
107
107
|
}
|
|
108
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
108
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: ConsoleAppender, decorators: [{
|
|
109
109
|
type: Injectable,
|
|
110
110
|
args: [{
|
|
111
111
|
providedIn: 'root'
|
|
@@ -373,10 +373,10 @@ class Store {
|
|
|
373
373
|
Promise.resolve().then(() => this.processNextAction());
|
|
374
374
|
}
|
|
375
375
|
}
|
|
376
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
377
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.
|
|
376
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Store, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
377
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Store, providedIn: 'root' });
|
|
378
378
|
}
|
|
379
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
379
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: Store, decorators: [{
|
|
380
380
|
type: Injectable,
|
|
381
381
|
args: [{
|
|
382
382
|
providedIn: 'root'
|
|
@@ -432,10 +432,10 @@ class ProvideNgssmFeatureStateDirective {
|
|
|
432
432
|
ngOnDestroy() {
|
|
433
433
|
this.store.dispatchAction(new NgssmUnregisterFeatureStateAction(this.component.featureStateKey));
|
|
434
434
|
}
|
|
435
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
436
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.
|
|
435
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: ProvideNgssmFeatureStateDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
436
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.5", type: ProvideNgssmFeatureStateDirective, isStandalone: true, selector: "[provideNgssmFeatureState]", ngImport: i0 });
|
|
437
437
|
}
|
|
438
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
438
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: ProvideNgssmFeatureStateDirective, decorators: [{
|
|
439
439
|
type: Directive,
|
|
440
440
|
args: [{
|
|
441
441
|
// eslint-disable-next-line @angular-eslint/directive-selector
|
|
@@ -462,10 +462,10 @@ class FeatureStateReducer {
|
|
|
462
462
|
}
|
|
463
463
|
return state;
|
|
464
464
|
}
|
|
465
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
466
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.
|
|
465
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: FeatureStateReducer, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
466
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: FeatureStateReducer });
|
|
467
467
|
}
|
|
468
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
468
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: FeatureStateReducer, decorators: [{
|
|
469
469
|
type: Injectable
|
|
470
470
|
}] });
|
|
471
471
|
|
|
@@ -488,10 +488,10 @@ class NgSsmComponent {
|
|
|
488
488
|
dispatchActionType(actionType) {
|
|
489
489
|
this.store.dispatchActionType(actionType);
|
|
490
490
|
}
|
|
491
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.
|
|
492
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.
|
|
491
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: NgSsmComponent, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
492
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.5", type: NgSsmComponent, isStandalone: true, ngImport: i0 });
|
|
493
493
|
}
|
|
494
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.
|
|
494
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: NgSsmComponent, decorators: [{
|
|
495
495
|
type: Directive,
|
|
496
496
|
args: [{}]
|
|
497
497
|
}] });
|