ngssm-store 19.3.0 → 19.3.2

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.
@@ -89,10 +89,10 @@ class CachedItemReducer {
89
89
  }
90
90
  return state;
91
91
  }
92
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: CachedItemReducer, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
93
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: CachedItemReducer }); }
92
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: CachedItemReducer, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
93
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: CachedItemReducer }); }
94
94
  }
95
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: CachedItemReducer, decorators: [{
95
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: CachedItemReducer, decorators: [{
96
96
  type: Injectable
97
97
  }] });
98
98
 
@@ -1,12 +1,11 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Injectable, makeEnvironmentProviders, HostListener, Input, Directive, Pipe, booleanAttribute, ChangeDetectionStrategy, Component } from '@angular/core';
2
+ import { Injectable, makeEnvironmentProviders, HostListener, Input, Directive, Pipe, inject, input, booleanAttribute, ChangeDetectionStrategy, Component } from '@angular/core';
3
3
  import * as i1 from 'ngssm-store';
4
- import { NgSsmFeatureState, provideReducers, NgSsmComponent } from 'ngssm-store';
4
+ import { NgSsmFeatureState, provideReducers, Store } from 'ngssm-store';
5
5
  import { __decorate } from 'tslib';
6
6
  import update from 'immutability-helper';
7
- import * as i2 from '@angular/common';
8
7
  import { CommonModule } from '@angular/common';
9
- import * as i3 from '@angular/material/button-toggle';
8
+ import * as i1$1 from '@angular/material/button-toggle';
10
9
  import { MatButtonToggleModule } from '@angular/material/button-toggle';
11
10
 
12
11
  var NgssmVisibilityActionType;
@@ -135,10 +134,10 @@ class VisibilityReducer {
135
134
  elements: elementsCommand
136
135
  });
137
136
  }
138
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: VisibilityReducer, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
139
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: VisibilityReducer }); }
137
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: VisibilityReducer, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
138
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: VisibilityReducer }); }
140
139
  }
141
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: VisibilityReducer, decorators: [{
140
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: VisibilityReducer, decorators: [{
142
141
  type: Injectable
143
142
  }] });
144
143
 
@@ -157,10 +156,10 @@ class ToggleElementVisibilityDirective {
157
156
  this.store.dispatchAction(new ToggleElementVisibilityAction(elementKey));
158
157
  }
159
158
  }
160
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: ToggleElementVisibilityDirective, deps: [{ token: i1.Store }], target: i0.ɵɵFactoryTarget.Directive }); }
161
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.5", type: ToggleElementVisibilityDirective, isStandalone: true, selector: "[toggleElementVisibility]", inputs: { key: ["toggleElementVisibility", "key"] }, host: { listeners: { "click": "toggleElementvisibility($event)" } }, ngImport: i0 }); }
159
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: ToggleElementVisibilityDirective, deps: [{ token: i1.Store }], target: i0.ɵɵFactoryTarget.Directive }); }
160
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.6", type: ToggleElementVisibilityDirective, isStandalone: true, selector: "[toggleElementVisibility]", inputs: { key: ["toggleElementVisibility", "key"] }, host: { listeners: { "click": "toggleElementvisibility($event)" } }, ngImport: i0 }); }
162
161
  }
163
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: ToggleElementVisibilityDirective, decorators: [{
162
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: ToggleElementVisibilityDirective, decorators: [{
164
163
  type: Directive,
165
164
  args: [{
166
165
  // eslint-disable-next-line @angular-eslint/directive-selector
@@ -179,10 +178,10 @@ class IsElementVisiblePipe {
179
178
  transform(value, ...args) {
180
179
  return selectNgssmVisibilityState(value).elements[args[0]] === true;
181
180
  }
182
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: IsElementVisiblePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
183
- static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.5", ngImport: i0, type: IsElementVisiblePipe, isStandalone: true, name: "isElementVisible" }); }
181
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: IsElementVisiblePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
182
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "19.2.6", ngImport: i0, type: IsElementVisiblePipe, isStandalone: true, name: "isElementVisible" }); }
184
183
  }
185
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: IsElementVisiblePipe, decorators: [{
184
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: IsElementVisiblePipe, decorators: [{
186
185
  type: Pipe,
187
186
  args: [{
188
187
  name: 'isElementVisible',
@@ -201,10 +200,10 @@ class ShowElementDirective {
201
200
  this.store.dispatchAction(new ShowElementAction(elementKey));
202
201
  }
203
202
  }
204
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: ShowElementDirective, deps: [{ token: i1.Store }], target: i0.ɵɵFactoryTarget.Directive }); }
205
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.5", type: ShowElementDirective, isStandalone: true, selector: "[showElement]", inputs: { key: ["showElement", "key"] }, host: { listeners: { "click": "toggleElementvisibility($event)" } }, ngImport: i0 }); }
203
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: ShowElementDirective, deps: [{ token: i1.Store }], target: i0.ɵɵFactoryTarget.Directive }); }
204
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.6", type: ShowElementDirective, isStandalone: true, selector: "[showElement]", inputs: { key: ["showElement", "key"] }, host: { listeners: { "click": "toggleElementvisibility($event)" } }, ngImport: i0 }); }
206
205
  }
207
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: ShowElementDirective, decorators: [{
206
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: ShowElementDirective, decorators: [{
208
207
  type: Directive,
209
208
  args: [{
210
209
  // eslint-disable-next-line @angular-eslint/directive-selector
@@ -230,10 +229,10 @@ class HideElementDirective {
230
229
  this.store.dispatchAction(new HideElementAction(elementKey));
231
230
  }
232
231
  }
233
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: HideElementDirective, deps: [{ token: i1.Store }], target: i0.ɵɵFactoryTarget.Directive }); }
234
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.5", type: HideElementDirective, isStandalone: true, selector: "[hideElement]", inputs: { key: ["hideElement", "key"] }, host: { listeners: { "click": "toggleElementvisibility($event)" } }, ngImport: i0 }); }
232
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: HideElementDirective, deps: [{ token: i1.Store }], target: i0.ɵɵFactoryTarget.Directive }); }
233
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.6", type: HideElementDirective, isStandalone: true, selector: "[hideElement]", inputs: { key: ["hideElement", "key"] }, host: { listeners: { "click": "toggleElementvisibility($event)" } }, ngImport: i0 }); }
235
234
  }
236
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: HideElementDirective, decorators: [{
235
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: HideElementDirective, decorators: [{
237
236
  type: Directive,
238
237
  args: [{
239
238
  // eslint-disable-next-line @angular-eslint/directive-selector
@@ -248,24 +247,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImpor
248
247
  args: ['click', ['$event']]
249
248
  }] } });
250
249
 
251
- class VisibilityToggleGroupComponent extends NgSsmComponent {
252
- constructor(store) {
253
- super(store);
254
- this.items = [];
255
- this.hideMultipleSelectionIndicator = false;
250
+ class VisibilityToggleGroupComponent {
251
+ constructor() {
252
+ this.store = inject(Store);
253
+ this.items = input([]);
254
+ this.hideMultipleSelectionIndicator = input(false, { transform: booleanAttribute });
256
255
  }
257
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: VisibilityToggleGroupComponent, deps: [{ token: i1.Store }], target: i0.ɵɵFactoryTarget.Component }); }
258
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "19.2.5", type: VisibilityToggleGroupComponent, isStandalone: true, selector: "ngssm-visibility-toggle-group", inputs: { items: "items", hideMultipleSelectionIndicator: ["hideMultipleSelectionIndicator", "hideMultipleSelectionIndicator", booleanAttribute] }, usesInheritance: true, ngImport: i0, template: "<mat-button-toggle-group [multiple]=\"true\" [hideMultipleSelectionIndicator]=\"hideMultipleSelectionIndicator\">\n <mat-button-toggle *ngFor=\"let item of items\" [toggleElementVisibility]=\"item.key\"\n [checked]=\"store.state() | isElementVisible:item.key\" [id]=\"item.key\">\n {{item.label}}\n </mat-button-toggle>\n</mat-button-toggle-group>", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "ngmodule", type: MatButtonToggleModule }, { kind: "directive", type: i3.MatButtonToggleGroup, selector: "mat-button-toggle-group", inputs: ["appearance", "name", "vertical", "value", "multiple", "disabled", "disabledInteractive", "hideSingleSelectionIndicator", "hideMultipleSelectionIndicator"], outputs: ["valueChange", "change"], exportAs: ["matButtonToggleGroup"] }, { kind: "component", type: i3.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: ToggleElementVisibilityDirective, selector: "[toggleElementVisibility]", inputs: ["toggleElementVisibility"] }, { kind: "pipe", type: IsElementVisiblePipe, name: "isElementVisible" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
256
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: VisibilityToggleGroupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
257
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.6", type: VisibilityToggleGroupComponent, 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 [toggleElementVisibility]=\"item.key\" [checked]=\"store.state() | isElementVisible: item.key\" [id]=\"item.key\">\n {{ item.label }}\n </mat-button-toggle>\n }\n</mat-button-toggle-group>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: MatButtonToggleModule }, { kind: "directive", type: i1$1.MatButtonToggleGroup, selector: "mat-button-toggle-group", inputs: ["appearance", "name", "vertical", "value", "multiple", "disabled", "disabledInteractive", "hideSingleSelectionIndicator", "hideMultipleSelectionIndicator"], outputs: ["valueChange", "change"], exportAs: ["matButtonToggleGroup"] }, { kind: "component", type: i1$1.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: ToggleElementVisibilityDirective, selector: "[toggleElementVisibility]", inputs: ["toggleElementVisibility"] }, { kind: "pipe", type: IsElementVisiblePipe, name: "isElementVisible" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
259
258
  }
260
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: VisibilityToggleGroupComponent, decorators: [{
259
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: VisibilityToggleGroupComponent, decorators: [{
261
260
  type: Component,
262
- args: [{ selector: 'ngssm-visibility-toggle-group', imports: [CommonModule, MatButtonToggleModule, ToggleElementVisibilityDirective, IsElementVisiblePipe], changeDetection: ChangeDetectionStrategy.OnPush, template: "<mat-button-toggle-group [multiple]=\"true\" [hideMultipleSelectionIndicator]=\"hideMultipleSelectionIndicator\">\n <mat-button-toggle *ngFor=\"let item of items\" [toggleElementVisibility]=\"item.key\"\n [checked]=\"store.state() | isElementVisible:item.key\" [id]=\"item.key\">\n {{item.label}}\n </mat-button-toggle>\n</mat-button-toggle-group>" }]
263
- }], ctorParameters: () => [{ type: i1.Store }], propDecorators: { items: [{
264
- type: Input
265
- }], hideMultipleSelectionIndicator: [{
266
- type: Input,
267
- args: [{ transform: booleanAttribute }]
268
- }] } });
261
+ args: [{ selector: 'ngssm-visibility-toggle-group', imports: [CommonModule, MatButtonToggleModule, ToggleElementVisibilityDirective, IsElementVisiblePipe], changeDetection: ChangeDetectionStrategy.OnPush, template: "<mat-button-toggle-group [multiple]=\"true\" [hideMultipleSelectionIndicator]=\"hideMultipleSelectionIndicator()\">\n @for (item of items(); track item.key) {\n <mat-button-toggle [toggleElementVisibility]=\"item.key\" [checked]=\"store.state() | isElementVisible: item.key\" [id]=\"item.key\">\n {{ item.label }}\n </mat-button-toggle>\n }\n</mat-button-toggle-group>\n" }]
262
+ }] });
269
263
 
270
264
  /**
271
265
  * Generated bundle index. Do not edit.
@@ -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/toggle-element-visibility.directive.ts","../../../projects/ngssm-store/visibility/src/components/is-element-visible.pipe.ts","../../../projects/ngssm-store/visibility/src/components/show-element.directive.ts","../../../projects/ngssm-store/visibility/src/components/hide-element.directive.ts","../../../projects/ngssm-store/visibility/src/components/visibility-toggle-group/visibility-toggle-group.component.ts","../../../projects/ngssm-store/visibility/src/components/visibility-toggle-group/visibility-toggle-group.component.html","../../../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 { Directive, HostListener, Input } from '@angular/core';\n\nimport { Store } from 'ngssm-store';\n\nimport { ToggleElementVisibilityAction } from '../actions';\n\n@Directive({\n // eslint-disable-next-line @angular-eslint/directive-selector\n selector: '[toggleElementVisibility]',\n standalone: true\n})\nexport class ToggleElementVisibilityDirective {\n @Input('toggleElementVisibility') public key: string | undefined | null = '';\n\n constructor(private store: Store) {}\n\n @HostListener('click', ['$event'])\n public toggleElementvisibility(): void {\n const elementKey = this.key;\n if (elementKey) {\n this.store.dispatchAction(new ToggleElementVisibilityAction(elementKey));\n }\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { State } from 'ngssm-store';\nimport { selectNgssmVisibilityState } from '../state';\n\n@Pipe({\n name: 'isElementVisible',\n standalone: true\n})\nexport class IsElementVisiblePipe implements PipeTransform {\n public transform(value: State, ...args: string[]): boolean {\n return selectNgssmVisibilityState(value).elements[args[0]] === true;\n }\n}\n","import { Directive, HostListener, Input } from '@angular/core';\nimport { Store } from 'ngssm-store';\nimport { ShowElementAction } from '../actions';\n\n@Directive({\n // eslint-disable-next-line @angular-eslint/directive-selector\n selector: '[showElement]',\n standalone: true\n})\nexport class ShowElementDirective {\n @Input('showElement') public key: string | undefined | null = '';\n\n constructor(private store: Store) {}\n\n @HostListener('click', ['$event'])\n public toggleElementvisibility(): void {\n const elementKey = this.key;\n if (elementKey) {\n this.store.dispatchAction(new ShowElementAction(elementKey));\n }\n }\n}\n","import { Directive, HostListener, Input } from '@angular/core';\nimport { Store } from 'ngssm-store';\nimport { HideElementAction } from '../actions';\n\n@Directive({\n // eslint-disable-next-line @angular-eslint/directive-selector\n selector: '[hideElement]',\n standalone: true\n})\nexport class HideElementDirective {\n @Input('hideElement') public key: string | undefined | null = '';\n\n constructor(private store: Store) {}\n\n @HostListener('click', ['$event'])\n public toggleElementvisibility(): void {\n const elementKey = this.key;\n if (elementKey) {\n this.store.dispatchAction(new HideElementAction(elementKey));\n }\n }\n}\n","import { Component, ChangeDetectionStrategy, Input, booleanAttribute } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { MatButtonToggleModule } from '@angular/material/button-toggle';\n\nimport { NgSsmComponent, Store } from 'ngssm-store';\n\nimport { ToggleElementVisibilityDirective } from '../toggle-element-visibility.directive';\nimport { IsElementVisiblePipe } from '../is-element-visible.pipe';\n\n@Component({\n selector: 'ngssm-visibility-toggle-group',\n imports: [CommonModule, MatButtonToggleModule, ToggleElementVisibilityDirective, IsElementVisiblePipe],\n templateUrl: './visibility-toggle-group.component.html',\n styleUrls: [],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class VisibilityToggleGroupComponent extends NgSsmComponent {\n @Input() public items: { label: string; key: string }[] = [];\n @Input({ transform: booleanAttribute }) hideMultipleSelectionIndicator = false;\n\n constructor(store: Store) {\n super(store);\n }\n}\n","<mat-button-toggle-group [multiple]=\"true\" [hideMultipleSelectionIndicator]=\"hideMultipleSelectionIndicator\">\n <mat-button-toggle *ngFor=\"let item of items\" [toggleElementVisibility]=\"item.key\"\n [checked]=\"store.state() | isElementVisible:item.key\" [id]=\"item.key\">\n {{item.label}}\n </mat-button-toggle>\n</mat-button-toggle-group>","/**\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,GAKpC,EAAA,CAAA,CAAA;;MCFY,6BAA6B,CAAA;AAGxC,IAAA,WAAA,CAA4B,UAAkB,EAAA;QAAlB,IAAU,CAAA,UAAA,GAAV,UAAU;AAFtB,QAAA,IAAA,CAAA,IAAI,GAAW,yBAAyB,CAAC,uBAAuB;;AAGjF;;MCJY,iBAAiB,CAAA;AAG5B,IAAA,WAAA,CAA4B,UAAkB,EAAA;QAAlB,IAAU,CAAA,UAAA,GAAV,UAAU;AAFtB,QAAA,IAAA,CAAA,IAAI,GAAW,yBAAyB,CAAC,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":["../../../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/toggle-element-visibility.directive.ts","../../../projects/ngssm-store/visibility/src/components/is-element-visible.pipe.ts","../../../projects/ngssm-store/visibility/src/components/show-element.directive.ts","../../../projects/ngssm-store/visibility/src/components/hide-element.directive.ts","../../../projects/ngssm-store/visibility/src/components/visibility-toggle-group/visibility-toggle-group.component.ts","../../../projects/ngssm-store/visibility/src/components/visibility-toggle-group/visibility-toggle-group.component.html","../../../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 { Directive, HostListener, Input } from '@angular/core';\n\nimport { Store } from 'ngssm-store';\n\nimport { ToggleElementVisibilityAction } from '../actions';\n\n@Directive({\n // eslint-disable-next-line @angular-eslint/directive-selector\n selector: '[toggleElementVisibility]',\n standalone: true\n})\nexport class ToggleElementVisibilityDirective {\n @Input('toggleElementVisibility') public key: string | undefined | null = '';\n\n constructor(private store: Store) {}\n\n @HostListener('click', ['$event'])\n public toggleElementvisibility(): void {\n const elementKey = this.key;\n if (elementKey) {\n this.store.dispatchAction(new ToggleElementVisibilityAction(elementKey));\n }\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { State } from 'ngssm-store';\nimport { selectNgssmVisibilityState } from '../state';\n\n@Pipe({\n name: 'isElementVisible',\n standalone: true\n})\nexport class IsElementVisiblePipe implements PipeTransform {\n public transform(value: State, ...args: string[]): boolean {\n return selectNgssmVisibilityState(value).elements[args[0]] === true;\n }\n}\n","import { Directive, HostListener, Input } from '@angular/core';\nimport { Store } from 'ngssm-store';\nimport { ShowElementAction } from '../actions';\n\n@Directive({\n // eslint-disable-next-line @angular-eslint/directive-selector\n selector: '[showElement]',\n standalone: true\n})\nexport class ShowElementDirective {\n @Input('showElement') public key: string | undefined | null = '';\n\n constructor(private store: Store) {}\n\n @HostListener('click', ['$event'])\n public toggleElementvisibility(): void {\n const elementKey = this.key;\n if (elementKey) {\n this.store.dispatchAction(new ShowElementAction(elementKey));\n }\n }\n}\n","import { Directive, HostListener, Input } from '@angular/core';\nimport { Store } from 'ngssm-store';\nimport { HideElementAction } from '../actions';\n\n@Directive({\n // eslint-disable-next-line @angular-eslint/directive-selector\n selector: '[hideElement]',\n standalone: true\n})\nexport class HideElementDirective {\n @Input('hideElement') public key: string | undefined | null = '';\n\n constructor(private store: Store) {}\n\n @HostListener('click', ['$event'])\n public toggleElementvisibility(): void {\n const elementKey = this.key;\n if (elementKey) {\n this.store.dispatchAction(new HideElementAction(elementKey));\n }\n }\n}\n","import { Component, ChangeDetectionStrategy, booleanAttribute, input, inject } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { MatButtonToggleModule } from '@angular/material/button-toggle';\n\nimport { Store } from 'ngssm-store';\n\nimport { ToggleElementVisibilityDirective } from '../toggle-element-visibility.directive';\nimport { IsElementVisiblePipe } from '../is-element-visible.pipe';\n\n@Component({\n selector: 'ngssm-visibility-toggle-group',\n imports: [CommonModule, MatButtonToggleModule, ToggleElementVisibilityDirective, IsElementVisiblePipe],\n templateUrl: './visibility-toggle-group.component.html',\n styleUrls: [],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class VisibilityToggleGroupComponent {\n public readonly store = inject(Store);\n\n public readonly items = input<{ label: string; key: string }[]>([]);\n public readonly hideMultipleSelectionIndicator = input<boolean, boolean>(false, { transform: booleanAttribute });\n}\n","<mat-button-toggle-group [multiple]=\"true\" [hideMultipleSelectionIndicator]=\"hideMultipleSelectionIndicator()\">\n @for (item of items(); track item.key) {\n <mat-button-toggle [toggleElementVisibility]=\"item.key\" [checked]=\"store.state() | isElementVisible: item.key\" [id]=\"item.key\">\n {{ item.label }}\n </mat-button-toggle>\n }\n</mat-button-toggle-group>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["i1"],"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,GAKpC,EAAA,CAAA,CAAA;;MCFY,6BAA6B,CAAA;AAGxC,IAAA,WAAA,CAA4B,UAAkB,EAAA;QAAlB,IAAU,CAAA,UAAA,GAAV,UAAU;AAFtB,QAAA,IAAA,CAA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AAM,EAAA,QAAA,EAAA,iYAAA,EAAA;;;AEdjD;;AAEG;;;;"}
@@ -67,10 +67,10 @@ class Logger {
67
67
  payload
68
68
  });
69
69
  }
70
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: Logger, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
71
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: Logger, providedIn: 'root' }); }
70
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: Logger, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
71
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: Logger, providedIn: 'root' }); }
72
72
  }
73
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: Logger, decorators: [{
73
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: Logger, decorators: [{
74
74
  type: Injectable,
75
75
  args: [{
76
76
  providedIn: 'root'
@@ -106,10 +106,10 @@ class ConsoleAppender {
106
106
  stop() {
107
107
  this.stopEvent$.next(true);
108
108
  }
109
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: ConsoleAppender, deps: [{ token: Logger }], target: i0.ɵɵFactoryTarget.Injectable }); }
110
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: ConsoleAppender, providedIn: 'root' }); }
109
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: ConsoleAppender, deps: [{ token: Logger }], target: i0.ɵɵFactoryTarget.Injectable }); }
110
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: ConsoleAppender, providedIn: 'root' }); }
111
111
  }
112
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: ConsoleAppender, decorators: [{
112
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: ConsoleAppender, decorators: [{
113
113
  type: Injectable,
114
114
  args: [{
115
115
  providedIn: 'root'
@@ -343,10 +343,10 @@ class Store {
343
343
  });
344
344
  });
345
345
  }
346
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: Store, deps: [{ token: Logger }, { token: NGSSM_REDUCER, optional: true }, { token: NGSSM_EFFECT, optional: true }, { token: NGSSM_STATE_INITIALIZER, optional: true }, { token: i0.EnvironmentInjector }], target: i0.ɵɵFactoryTarget.Injectable }); }
347
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: Store, providedIn: 'root' }); }
346
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: Store, deps: [{ token: Logger }, { token: NGSSM_REDUCER, optional: true }, { token: NGSSM_EFFECT, optional: true }, { token: NGSSM_STATE_INITIALIZER, optional: true }, { token: i0.EnvironmentInjector }], target: i0.ɵɵFactoryTarget.Injectable }); }
347
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: Store, providedIn: 'root' }); }
348
348
  }
349
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: Store, decorators: [{
349
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: Store, decorators: [{
350
350
  type: Injectable,
351
351
  args: [{
352
352
  providedIn: 'root'
@@ -414,10 +414,10 @@ class ProvideNgssmFeatureStateDirective {
414
414
  ngOnDestroy() {
415
415
  this.store.dispatchAction(new NgssmUnregisterFeatureStateAction(this.component.featureStateKey));
416
416
  }
417
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: ProvideNgssmFeatureStateDirective, deps: [{ token: NGSSM_COMPONENT_WITH_FEATURE_STATE }, { token: Store }], target: i0.ɵɵFactoryTarget.Directive }); }
418
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.5", type: ProvideNgssmFeatureStateDirective, isStandalone: true, selector: "[provideNgssmFeatureState]", ngImport: i0 }); }
417
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: ProvideNgssmFeatureStateDirective, deps: [{ token: NGSSM_COMPONENT_WITH_FEATURE_STATE }, { token: Store }], target: i0.ɵɵFactoryTarget.Directive }); }
418
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.6", type: ProvideNgssmFeatureStateDirective, isStandalone: true, selector: "[provideNgssmFeatureState]", ngImport: i0 }); }
419
419
  }
420
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: ProvideNgssmFeatureStateDirective, decorators: [{
420
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: ProvideNgssmFeatureStateDirective, decorators: [{
421
421
  type: Directive,
422
422
  args: [{
423
423
  // eslint-disable-next-line @angular-eslint/directive-selector
@@ -450,10 +450,10 @@ class FeatureStateReducer {
450
450
  }
451
451
  return state;
452
452
  }
453
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: FeatureStateReducer, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
454
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: FeatureStateReducer }); }
453
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: FeatureStateReducer, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
454
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: FeatureStateReducer }); }
455
455
  }
456
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: FeatureStateReducer, decorators: [{
456
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: FeatureStateReducer, decorators: [{
457
457
  type: Injectable
458
458
  }] });
459
459
 
@@ -478,10 +478,10 @@ class NgSsmComponent {
478
478
  dispatchActionType(actionType) {
479
479
  this.store.dispatchActionType(actionType);
480
480
  }
481
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: NgSsmComponent, deps: [{ token: Store }], target: i0.ɵɵFactoryTarget.Directive }); }
482
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.5", type: NgSsmComponent, isStandalone: true, ngImport: i0 }); }
481
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: NgSsmComponent, deps: [{ token: Store }], target: i0.ɵɵFactoryTarget.Directive }); }
482
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.2.6", type: NgSsmComponent, isStandalone: true, ngImport: i0 }); }
483
483
  }
484
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.5", ngImport: i0, type: NgSsmComponent, decorators: [{
484
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.6", ngImport: i0, type: NgSsmComponent, decorators: [{
485
485
  type: Directive,
486
486
  args: [{}]
487
487
  }], ctorParameters: () => [{ type: Store }] });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ngssm-store",
3
- "version": "19.3.0",
3
+ "version": "19.3.2",
4
4
  "description": "NgSsm - Simple state management implementation.",
5
5
  "author": "Lion Marc",
6
6
  "license": "MIT",
@@ -1,13 +1,12 @@
1
- import { NgSsmComponent, Store } from 'ngssm-store';
1
+ import { Store } from 'ngssm-store';
2
2
  import * as i0 from "@angular/core";
3
- export declare class VisibilityToggleGroupComponent extends NgSsmComponent {
4
- items: {
3
+ export declare class VisibilityToggleGroupComponent {
4
+ readonly store: Store;
5
+ readonly items: import("@angular/core").InputSignal<{
5
6
  label: string;
6
7
  key: string;
7
- }[];
8
- hideMultipleSelectionIndicator: boolean;
9
- constructor(store: Store);
8
+ }[]>;
9
+ readonly hideMultipleSelectionIndicator: import("@angular/core").InputSignalWithTransform<boolean, boolean>;
10
10
  static ɵfac: i0.ɵɵFactoryDeclaration<VisibilityToggleGroupComponent, never>;
11
- static ɵcmp: i0.ɵɵComponentDeclaration<VisibilityToggleGroupComponent, "ngssm-visibility-toggle-group", never, { "items": { "alias": "items"; "required": false; }; "hideMultipleSelectionIndicator": { "alias": "hideMultipleSelectionIndicator"; "required": false; }; }, {}, never, never, true, never>;
12
- static ngAcceptInputType_hideMultipleSelectionIndicator: unknown;
11
+ static ɵcmp: i0.ɵɵComponentDeclaration<VisibilityToggleGroupComponent, "ngssm-visibility-toggle-group", never, { "items": { "alias": "items"; "required": false; "isSignal": true; }; "hideMultipleSelectionIndicator": { "alias": "hideMultipleSelectionIndicator"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
13
12
  }