ngssm-store 22.0.1 → 22.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -52
- package/fesm2022/ngssm-store-caching-testing.mjs +61 -126
- package/fesm2022/ngssm-store-caching-testing.mjs.map +1 -1
- package/fesm2022/ngssm-store-caching.mjs +102 -134
- package/fesm2022/ngssm-store-caching.mjs.map +1 -1
- package/fesm2022/ngssm-store-testing.mjs +36 -64
- package/fesm2022/ngssm-store-testing.mjs.map +1 -1
- package/fesm2022/ngssm-store-visibility-testing.mjs +53 -75
- package/fesm2022/ngssm-store-visibility-testing.mjs.map +1 -1
- package/fesm2022/ngssm-store-visibility.mjs +441 -244
- package/fesm2022/ngssm-store-visibility.mjs.map +1 -1
- package/fesm2022/ngssm-store.mjs +385 -488
- package/fesm2022/ngssm-store.mjs.map +1 -1
- package/package.json +1 -1
- package/types/ngssm-store-caching-testing.d.ts +35 -39
- package/types/ngssm-store-caching.d.ts +43 -55
- package/types/ngssm-store-testing.d.ts +13 -19
- package/types/ngssm-store-visibility-testing.d.ts +29 -33
- package/types/ngssm-store-visibility.d.ts +107 -95
- package/types/ngssm-store.d.ts +183 -232
|
@@ -1,254 +1,451 @@
|
|
|
1
|
-
import * as i0 from
|
|
2
|
-
import {
|
|
3
|
-
import { NgSsmFeatureState,
|
|
4
|
-
import { __decorate } from
|
|
5
|
-
import update from
|
|
6
|
-
import {
|
|
7
|
-
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { Component, Directive, Injectable, Pipe, booleanAttribute, inject, input, makeEnvironmentProviders } from "@angular/core";
|
|
3
|
+
import { NgSsmFeatureState, Store, createSignal, provideReducers } from "ngssm-store";
|
|
4
|
+
import { __decorate } from "tslib";
|
|
5
|
+
import update from "immutability-helper";
|
|
6
|
+
import { MatButtonToggle, MatButtonToggleGroup } from "@angular/material/button-toggle";
|
|
8
7
|
var NgssmVisibilityActionType;
|
|
9
|
-
(function
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
(function(NgssmVisibilityActionType) {
|
|
9
|
+
NgssmVisibilityActionType["defineElementsGroup"] = "[NgssmVisibilityActionType] defineElementsGroup";
|
|
10
|
+
NgssmVisibilityActionType["toggleElementVisibility"] = "[NgssmVisibilityActionType] toggleElementVisibility";
|
|
11
|
+
NgssmVisibilityActionType["hideElement"] = "[NgssmVisibilityActionType] hideElement";
|
|
12
|
+
NgssmVisibilityActionType["showElement"] = "[NgssmVisibilityActionType] showElement";
|
|
14
13
|
})(NgssmVisibilityActionType || (NgssmVisibilityActionType = {}));
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
constructor(elementKeys) {
|
|
44
|
-
this.elementKeys = elementKeys;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
14
|
+
var ToggleElementVisibilityAction = class {
|
|
15
|
+
elementKey;
|
|
16
|
+
type = NgssmVisibilityActionType.toggleElementVisibility;
|
|
17
|
+
constructor(elementKey) {
|
|
18
|
+
this.elementKey = elementKey;
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
var ShowElementAction = class {
|
|
22
|
+
elementKey;
|
|
23
|
+
type = NgssmVisibilityActionType.showElement;
|
|
24
|
+
constructor(elementKey) {
|
|
25
|
+
this.elementKey = elementKey;
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
var HideElementAction = class {
|
|
29
|
+
elementKey;
|
|
30
|
+
type = NgssmVisibilityActionType.hideElement;
|
|
31
|
+
constructor(elementKey) {
|
|
32
|
+
this.elementKey = elementKey;
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
var DefineElementsGroupAction = class {
|
|
36
|
+
elementKeys;
|
|
37
|
+
type = NgssmVisibilityActionType.defineElementsGroup;
|
|
38
|
+
constructor(elementKeys) {
|
|
39
|
+
this.elementKeys = elementKeys;
|
|
40
|
+
}
|
|
41
|
+
};
|
|
48
42
|
const selectNgssmVisibilityState = (state) => state[NgssmVisibilityStateSpecification.featureStateKey];
|
|
49
|
-
const updateNgssmVisibilityState = (state, command) => update(state, {
|
|
50
|
-
[NgssmVisibilityStateSpecification.featureStateKey]: command
|
|
51
|
-
});
|
|
43
|
+
const updateNgssmVisibilityState = (state, command) => update(state, { [NgssmVisibilityStateSpecification.featureStateKey]: command });
|
|
52
44
|
let NgssmVisibilityStateSpecification = class NgssmVisibilityStateSpecification {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
45
|
+
static featureStateKey = "ngssm-visibility-state";
|
|
46
|
+
static initialState = {
|
|
47
|
+
elements: {},
|
|
48
|
+
elementsGroups: []
|
|
49
|
+
};
|
|
58
50
|
};
|
|
59
|
-
NgssmVisibilityStateSpecification = __decorate([
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
});
|
|
132
|
-
return updateNgssmVisibilityState(state, {
|
|
133
|
-
elements: elementsCommand
|
|
134
|
-
});
|
|
135
|
-
}
|
|
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
|
-
}
|
|
139
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImport: i0, type: VisibilityReducer, decorators: [{
|
|
140
|
-
type: Injectable
|
|
141
|
-
}] });
|
|
142
|
-
|
|
51
|
+
NgssmVisibilityStateSpecification = __decorate([NgSsmFeatureState({
|
|
52
|
+
featureStateKey: NgssmVisibilityStateSpecification.featureStateKey,
|
|
53
|
+
initialState: NgssmVisibilityStateSpecification.initialState
|
|
54
|
+
})], NgssmVisibilityStateSpecification);
|
|
55
|
+
var VisibilityReducer = class VisibilityReducer {
|
|
56
|
+
processedActions = [
|
|
57
|
+
NgssmVisibilityActionType.toggleElementVisibility,
|
|
58
|
+
NgssmVisibilityActionType.showElement,
|
|
59
|
+
NgssmVisibilityActionType.hideElement,
|
|
60
|
+
NgssmVisibilityActionType.defineElementsGroup
|
|
61
|
+
];
|
|
62
|
+
updateState(state, action) {
|
|
63
|
+
switch (action.type) {
|
|
64
|
+
case NgssmVisibilityActionType.toggleElementVisibility: {
|
|
65
|
+
const toggleVisibilityAction = action;
|
|
66
|
+
if (selectNgssmVisibilityState(state).elements[toggleVisibilityAction.elementKey] === true) return updateNgssmVisibilityState(state, { elements: { [toggleVisibilityAction.elementKey]: { $set: false } } });
|
|
67
|
+
return this.setElementVisible(state, toggleVisibilityAction.elementKey);
|
|
68
|
+
}
|
|
69
|
+
case NgssmVisibilityActionType.showElement: {
|
|
70
|
+
const showAction = action;
|
|
71
|
+
return this.setElementVisible(state, showAction.elementKey);
|
|
72
|
+
}
|
|
73
|
+
case NgssmVisibilityActionType.hideElement: return updateNgssmVisibilityState(state, { elements: { [action.elementKey]: { $set: false } } });
|
|
74
|
+
case NgssmVisibilityActionType.defineElementsGroup: {
|
|
75
|
+
const keys = [...action.elementKeys];
|
|
76
|
+
keys.sort();
|
|
77
|
+
if (this.groupExists(keys, selectNgssmVisibilityState(state).elementsGroups)) break;
|
|
78
|
+
return updateNgssmVisibilityState(state, { elementsGroups: { $push: [keys] } });
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
return state;
|
|
82
|
+
}
|
|
83
|
+
groupExists(keys, groups) {
|
|
84
|
+
return groups.findIndex((group) => {
|
|
85
|
+
return group.length === keys.length && group.findIndex((k, i) => k !== keys[i]) === -1;
|
|
86
|
+
}) !== -1;
|
|
87
|
+
}
|
|
88
|
+
getElementsKeysGroupedWith(key, groups) {
|
|
89
|
+
const keys = groups.filter((g) => g.includes(key)).flatMap((g) => g);
|
|
90
|
+
const distinctKeys = new Set(keys);
|
|
91
|
+
distinctKeys.delete(key);
|
|
92
|
+
return [...distinctKeys];
|
|
93
|
+
}
|
|
94
|
+
setElementVisible(state, key) {
|
|
95
|
+
const elementsCommand = { [key]: { $set: true } };
|
|
96
|
+
this.getElementsKeysGroupedWith(key, selectNgssmVisibilityState(state).elementsGroups).forEach((el) => {
|
|
97
|
+
elementsCommand[el] = { $set: false };
|
|
98
|
+
});
|
|
99
|
+
return updateNgssmVisibilityState(state, { elements: elementsCommand });
|
|
100
|
+
}
|
|
101
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
102
|
+
minVersion: "12.0.0",
|
|
103
|
+
version: "22.2.0",
|
|
104
|
+
ngImport: i0,
|
|
105
|
+
type: VisibilityReducer,
|
|
106
|
+
deps: [],
|
|
107
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
108
|
+
});
|
|
109
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({
|
|
110
|
+
minVersion: "12.0.0",
|
|
111
|
+
version: "22.2.0",
|
|
112
|
+
ngImport: i0,
|
|
113
|
+
type: VisibilityReducer
|
|
114
|
+
});
|
|
115
|
+
};
|
|
116
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
117
|
+
minVersion: "12.0.0",
|
|
118
|
+
version: "22.2.0",
|
|
119
|
+
ngImport: i0,
|
|
120
|
+
type: VisibilityReducer,
|
|
121
|
+
decorators: [{ type: Injectable }]
|
|
122
|
+
});
|
|
143
123
|
const provideNgssmVisibility = () => {
|
|
144
|
-
|
|
124
|
+
return makeEnvironmentProviders([provideReducers(VisibilityReducer)]);
|
|
145
125
|
};
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
class
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
126
|
+
var NgssmIsElementVisiblePipe = class NgssmIsElementVisiblePipe {
|
|
127
|
+
transform(value, ...args) {
|
|
128
|
+
return selectNgssmVisibilityState(value).elements[args[0]] === true;
|
|
129
|
+
}
|
|
130
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
131
|
+
minVersion: "12.0.0",
|
|
132
|
+
version: "22.2.0",
|
|
133
|
+
ngImport: i0,
|
|
134
|
+
type: NgssmIsElementVisiblePipe,
|
|
135
|
+
deps: [],
|
|
136
|
+
target: i0.ɵɵFactoryTarget.Pipe
|
|
137
|
+
});
|
|
138
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({
|
|
139
|
+
minVersion: "14.0.0",
|
|
140
|
+
version: "22.2.0",
|
|
141
|
+
ngImport: i0,
|
|
142
|
+
type: NgssmIsElementVisiblePipe,
|
|
143
|
+
isStandalone: true,
|
|
144
|
+
name: "ngssmIsElementVisible"
|
|
145
|
+
});
|
|
146
|
+
};
|
|
147
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
148
|
+
minVersion: "12.0.0",
|
|
149
|
+
version: "22.2.0",
|
|
150
|
+
ngImport: i0,
|
|
151
|
+
type: NgssmIsElementVisiblePipe,
|
|
152
|
+
decorators: [{
|
|
153
|
+
type: Pipe,
|
|
154
|
+
args: [{ name: "ngssmIsElementVisible" }]
|
|
155
|
+
}]
|
|
156
|
+
});
|
|
157
|
+
var NgssmShowElement = class NgssmShowElement {
|
|
158
|
+
ngssmShowElement = input(void 0, ...ngDevMode ? [{ debugName: "ngssmShowElement" }] : /* istanbul ignore next */ []);
|
|
159
|
+
store = inject(Store);
|
|
160
|
+
showElement() {
|
|
161
|
+
const elementKey = this.ngssmShowElement();
|
|
162
|
+
if (elementKey) this.store.dispatchAction(new ShowElementAction(elementKey));
|
|
163
|
+
}
|
|
164
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
165
|
+
minVersion: "12.0.0",
|
|
166
|
+
version: "22.2.0",
|
|
167
|
+
ngImport: i0,
|
|
168
|
+
type: NgssmShowElement,
|
|
169
|
+
deps: [],
|
|
170
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
171
|
+
});
|
|
172
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
173
|
+
minVersion: "17.1.0",
|
|
174
|
+
version: "22.2.0",
|
|
175
|
+
type: NgssmShowElement,
|
|
176
|
+
isStandalone: true,
|
|
177
|
+
selector: "[ngssmShowElement]",
|
|
178
|
+
inputs: { ngssmShowElement: {
|
|
179
|
+
classPropertyName: "ngssmShowElement",
|
|
180
|
+
publicName: "ngssmShowElement",
|
|
181
|
+
isSignal: true,
|
|
182
|
+
isRequired: false,
|
|
183
|
+
transformFunction: null
|
|
184
|
+
} },
|
|
185
|
+
host: { listeners: { "click": "showElement()" } },
|
|
186
|
+
ngImport: i0
|
|
187
|
+
});
|
|
188
|
+
};
|
|
189
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
190
|
+
minVersion: "12.0.0",
|
|
191
|
+
version: "22.2.0",
|
|
192
|
+
ngImport: i0,
|
|
193
|
+
type: NgssmShowElement,
|
|
194
|
+
decorators: [{
|
|
195
|
+
type: Directive,
|
|
196
|
+
args: [{
|
|
197
|
+
selector: "[ngssmShowElement]",
|
|
198
|
+
host: { "(click)": "showElement()" }
|
|
199
|
+
}]
|
|
200
|
+
}],
|
|
201
|
+
propDecorators: { ngssmShowElement: [{
|
|
202
|
+
type: i0.Input,
|
|
203
|
+
args: [{
|
|
204
|
+
isSignal: true,
|
|
205
|
+
alias: "ngssmShowElement",
|
|
206
|
+
required: false
|
|
207
|
+
}]
|
|
208
|
+
}] }
|
|
209
|
+
});
|
|
210
|
+
var NgssmHideElement = class NgssmHideElement {
|
|
211
|
+
ngssmHideElement = input(void 0, ...ngDevMode ? [{ debugName: "ngssmHideElement" }] : /* istanbul ignore next */ []);
|
|
212
|
+
store = inject(Store);
|
|
213
|
+
hideElement() {
|
|
214
|
+
const elementKey = this.ngssmHideElement();
|
|
215
|
+
if (elementKey) this.store.dispatchAction(new HideElementAction(elementKey));
|
|
216
|
+
}
|
|
217
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
218
|
+
minVersion: "12.0.0",
|
|
219
|
+
version: "22.2.0",
|
|
220
|
+
ngImport: i0,
|
|
221
|
+
type: NgssmHideElement,
|
|
222
|
+
deps: [],
|
|
223
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
224
|
+
});
|
|
225
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
226
|
+
minVersion: "17.1.0",
|
|
227
|
+
version: "22.2.0",
|
|
228
|
+
type: NgssmHideElement,
|
|
229
|
+
isStandalone: true,
|
|
230
|
+
selector: "[ngssmHideElement]",
|
|
231
|
+
inputs: { ngssmHideElement: {
|
|
232
|
+
classPropertyName: "ngssmHideElement",
|
|
233
|
+
publicName: "ngssmHideElement",
|
|
234
|
+
isSignal: true,
|
|
235
|
+
isRequired: false,
|
|
236
|
+
transformFunction: null
|
|
237
|
+
} },
|
|
238
|
+
host: { listeners: { "click": "hideElement()" } },
|
|
239
|
+
ngImport: i0
|
|
240
|
+
});
|
|
241
|
+
};
|
|
242
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
243
|
+
minVersion: "12.0.0",
|
|
244
|
+
version: "22.2.0",
|
|
245
|
+
ngImport: i0,
|
|
246
|
+
type: NgssmHideElement,
|
|
247
|
+
decorators: [{
|
|
248
|
+
type: Directive,
|
|
249
|
+
args: [{
|
|
250
|
+
selector: "[ngssmHideElement]",
|
|
251
|
+
host: { "(click)": "hideElement()" }
|
|
252
|
+
}]
|
|
253
|
+
}],
|
|
254
|
+
propDecorators: { ngssmHideElement: [{
|
|
255
|
+
type: i0.Input,
|
|
256
|
+
args: [{
|
|
257
|
+
isSignal: true,
|
|
258
|
+
alias: "ngssmHideElement",
|
|
259
|
+
required: false
|
|
260
|
+
}]
|
|
261
|
+
}] }
|
|
262
|
+
});
|
|
263
|
+
var NgssmToggleElementVisibility = class NgssmToggleElementVisibility {
|
|
264
|
+
ngssmToggleElementVisibility = input(void 0, ...ngDevMode ? [{ debugName: "ngssmToggleElementVisibility" }] : /* istanbul ignore next */ []);
|
|
265
|
+
store = inject(Store);
|
|
266
|
+
toggleElementVisibility() {
|
|
267
|
+
const elementKey = this.ngssmToggleElementVisibility();
|
|
268
|
+
if (elementKey) this.store.dispatchAction(new ToggleElementVisibilityAction(elementKey));
|
|
269
|
+
}
|
|
270
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
271
|
+
minVersion: "12.0.0",
|
|
272
|
+
version: "22.2.0",
|
|
273
|
+
ngImport: i0,
|
|
274
|
+
type: NgssmToggleElementVisibility,
|
|
275
|
+
deps: [],
|
|
276
|
+
target: i0.ɵɵFactoryTarget.Directive
|
|
277
|
+
});
|
|
278
|
+
static ɵdir = i0.ɵɵngDeclareDirective({
|
|
279
|
+
minVersion: "17.1.0",
|
|
280
|
+
version: "22.2.0",
|
|
281
|
+
type: NgssmToggleElementVisibility,
|
|
282
|
+
isStandalone: true,
|
|
283
|
+
selector: "[ngssmToggleElementVisibility]",
|
|
284
|
+
inputs: { ngssmToggleElementVisibility: {
|
|
285
|
+
classPropertyName: "ngssmToggleElementVisibility",
|
|
286
|
+
publicName: "ngssmToggleElementVisibility",
|
|
287
|
+
isSignal: true,
|
|
288
|
+
isRequired: false,
|
|
289
|
+
transformFunction: null
|
|
290
|
+
} },
|
|
291
|
+
host: { listeners: { "click": "toggleElementVisibility()" } },
|
|
292
|
+
ngImport: i0
|
|
293
|
+
});
|
|
294
|
+
};
|
|
295
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
296
|
+
minVersion: "12.0.0",
|
|
297
|
+
version: "22.2.0",
|
|
298
|
+
ngImport: i0,
|
|
299
|
+
type: NgssmToggleElementVisibility,
|
|
300
|
+
decorators: [{
|
|
301
|
+
type: Directive,
|
|
302
|
+
args: [{
|
|
303
|
+
selector: "[ngssmToggleElementVisibility]",
|
|
304
|
+
host: { "(click)": "toggleElementVisibility()" }
|
|
305
|
+
}]
|
|
306
|
+
}],
|
|
307
|
+
propDecorators: { ngssmToggleElementVisibility: [{
|
|
308
|
+
type: i0.Input,
|
|
309
|
+
args: [{
|
|
310
|
+
isSignal: true,
|
|
311
|
+
alias: "ngssmToggleElementVisibility",
|
|
312
|
+
required: false
|
|
313
|
+
}]
|
|
314
|
+
}] }
|
|
315
|
+
});
|
|
316
|
+
var NgssmVisibilityToggleGroup = class NgssmVisibilityToggleGroup {
|
|
317
|
+
items = input([], ...ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []);
|
|
318
|
+
hideMultipleSelectionIndicator = input(false, {
|
|
319
|
+
...ngDevMode ? { debugName: "hideMultipleSelectionIndicator" } : /* istanbul ignore next */ {},
|
|
320
|
+
transform: booleanAttribute
|
|
321
|
+
});
|
|
322
|
+
store = inject(Store);
|
|
323
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
324
|
+
minVersion: "12.0.0",
|
|
325
|
+
version: "22.2.0",
|
|
326
|
+
ngImport: i0,
|
|
327
|
+
type: NgssmVisibilityToggleGroup,
|
|
328
|
+
deps: [],
|
|
329
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
330
|
+
});
|
|
331
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
332
|
+
minVersion: "17.0.0",
|
|
333
|
+
version: "22.2.0",
|
|
334
|
+
type: NgssmVisibilityToggleGroup,
|
|
335
|
+
isStandalone: true,
|
|
336
|
+
selector: "ngssm-visibility-toggle-group",
|
|
337
|
+
inputs: {
|
|
338
|
+
items: {
|
|
339
|
+
classPropertyName: "items",
|
|
340
|
+
publicName: "items",
|
|
341
|
+
isSignal: true,
|
|
342
|
+
isRequired: false,
|
|
343
|
+
transformFunction: null
|
|
344
|
+
},
|
|
345
|
+
hideMultipleSelectionIndicator: {
|
|
346
|
+
classPropertyName: "hideMultipleSelectionIndicator",
|
|
347
|
+
publicName: "hideMultipleSelectionIndicator",
|
|
348
|
+
isSignal: true,
|
|
349
|
+
isRequired: false,
|
|
350
|
+
transformFunction: null
|
|
351
|
+
}
|
|
352
|
+
},
|
|
353
|
+
ngImport: i0,
|
|
354
|
+
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",
|
|
355
|
+
dependencies: [
|
|
356
|
+
{
|
|
357
|
+
kind: "directive",
|
|
358
|
+
type: MatButtonToggleGroup,
|
|
359
|
+
selector: "mat-button-toggle-group",
|
|
360
|
+
inputs: [
|
|
361
|
+
"appearance",
|
|
362
|
+
"name",
|
|
363
|
+
"vertical",
|
|
364
|
+
"value",
|
|
365
|
+
"multiple",
|
|
366
|
+
"disabled",
|
|
367
|
+
"disabledInteractive",
|
|
368
|
+
"hideSingleSelectionIndicator",
|
|
369
|
+
"hideMultipleSelectionIndicator"
|
|
370
|
+
],
|
|
371
|
+
outputs: ["valueChange", "change"],
|
|
372
|
+
exportAs: ["matButtonToggleGroup"]
|
|
373
|
+
},
|
|
374
|
+
{
|
|
375
|
+
kind: "component",
|
|
376
|
+
type: MatButtonToggle,
|
|
377
|
+
selector: "mat-button-toggle",
|
|
378
|
+
inputs: [
|
|
379
|
+
"aria-label",
|
|
380
|
+
"aria-labelledby",
|
|
381
|
+
"id",
|
|
382
|
+
"name",
|
|
383
|
+
"value",
|
|
384
|
+
"tabIndex",
|
|
385
|
+
"disableRipple",
|
|
386
|
+
"appearance",
|
|
387
|
+
"checked",
|
|
388
|
+
"disabled",
|
|
389
|
+
"disabledInteractive"
|
|
390
|
+
],
|
|
391
|
+
outputs: ["change"],
|
|
392
|
+
exportAs: ["matButtonToggle"]
|
|
393
|
+
},
|
|
394
|
+
{
|
|
395
|
+
kind: "directive",
|
|
396
|
+
type: NgssmToggleElementVisibility,
|
|
397
|
+
selector: "[ngssmToggleElementVisibility]",
|
|
398
|
+
inputs: ["ngssmToggleElementVisibility"]
|
|
399
|
+
},
|
|
400
|
+
{
|
|
401
|
+
kind: "pipe",
|
|
402
|
+
type: NgssmIsElementVisiblePipe,
|
|
403
|
+
name: "ngssmIsElementVisible"
|
|
404
|
+
}
|
|
405
|
+
]
|
|
406
|
+
});
|
|
407
|
+
};
|
|
408
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
409
|
+
minVersion: "12.0.0",
|
|
410
|
+
version: "22.2.0",
|
|
411
|
+
ngImport: i0,
|
|
412
|
+
type: NgssmVisibilityToggleGroup,
|
|
413
|
+
decorators: [{
|
|
414
|
+
type: Component,
|
|
415
|
+
args: [{
|
|
416
|
+
selector: "ngssm-visibility-toggle-group",
|
|
417
|
+
imports: [
|
|
418
|
+
MatButtonToggleGroup,
|
|
419
|
+
MatButtonToggle,
|
|
420
|
+
NgssmToggleElementVisibility,
|
|
421
|
+
NgssmIsElementVisiblePipe
|
|
422
|
+
],
|
|
423
|
+
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"
|
|
424
|
+
}]
|
|
425
|
+
}],
|
|
426
|
+
propDecorators: {
|
|
427
|
+
items: [{
|
|
428
|
+
type: i0.Input,
|
|
429
|
+
args: [{
|
|
430
|
+
isSignal: true,
|
|
431
|
+
alias: "items",
|
|
432
|
+
required: false
|
|
433
|
+
}]
|
|
434
|
+
}],
|
|
435
|
+
hideMultipleSelectionIndicator: [{
|
|
436
|
+
type: i0.Input,
|
|
437
|
+
args: [{
|
|
438
|
+
isSignal: true,
|
|
439
|
+
alias: "hideMultipleSelectionIndicator",
|
|
440
|
+
required: false
|
|
441
|
+
}]
|
|
442
|
+
}]
|
|
443
|
+
}
|
|
444
|
+
});
|
|
244
445
|
const isElementVisible = (elementKey) => ({
|
|
245
|
-
|
|
246
|
-
|
|
446
|
+
key: elementKey,
|
|
447
|
+
visible: createSignal((state) => selectNgssmVisibilityState(state).elements[elementKey] === true)
|
|
247
448
|
});
|
|
248
|
-
|
|
249
|
-
/**
|
|
250
|
-
* Generated bundle index. Do not edit.
|
|
251
|
-
*/
|
|
252
|
-
|
|
253
449
|
export { DefineElementsGroupAction, HideElementAction, NgssmHideElement, NgssmIsElementVisiblePipe, NgssmShowElement, NgssmToggleElementVisibility, NgssmVisibilityActionType, NgssmVisibilityStateSpecification, NgssmVisibilityToggleGroup, ShowElementAction, ToggleElementVisibilityAction, VisibilityReducer, isElementVisible, provideNgssmVisibility, selectNgssmVisibilityState, updateNgssmVisibilityState };
|
|
254
|
-
|
|
450
|
+
|
|
451
|
+
//# sourceMappingURL=ngssm-store-visibility.mjs.map
|