@mintplayer/ng-spark 22.22.0 → 22.24.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 +181 -0
- package/fesm2022/mintplayer-ng-spark-attribute-description.mjs +100 -47
- package/fesm2022/mintplayer-ng-spark-attribute-description.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-spark-client-operations.mjs +308 -329
- package/fesm2022/mintplayer-ng-spark-client-operations.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-spark-column-filter.mjs +175 -135
- package/fesm2022/mintplayer-ng-spark-column-filter.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-spark-grid.mjs +2259 -1117
- package/fesm2022/mintplayer-ng-spark-grid.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-spark-history.mjs +611 -0
- package/fesm2022/mintplayer-ng-spark-history.mjs.map +1 -0
- package/fesm2022/mintplayer-ng-spark-icon.mjs +64 -27
- package/fesm2022/mintplayer-ng-spark-icon.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-spark-models.mjs +365 -753
- package/fesm2022/mintplayer-ng-spark-models.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-spark-moderation.mjs +1212 -0
- package/fesm2022/mintplayer-ng-spark-moderation.mjs.map +1 -0
- package/fesm2022/mintplayer-ng-spark-panels.mjs +52 -0
- package/fesm2022/mintplayer-ng-spark-panels.mjs.map +1 -0
- package/fesm2022/mintplayer-ng-spark-pipes.mjs +1122 -765
- package/fesm2022/mintplayer-ng-spark-pipes.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-spark-po-create.mjs +273 -169
- package/fesm2022/mintplayer-ng-spark-po-create.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-spark-po-detail.mjs +786 -410
- package/fesm2022/mintplayer-ng-spark-po-detail.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-spark-po-edit.mjs +292 -284
- package/fesm2022/mintplayer-ng-spark-po-edit.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-spark-po-form.mjs +2187 -1225
- package/fesm2022/mintplayer-ng-spark-po-form.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-spark-query-list.mjs +516 -303
- package/fesm2022/mintplayer-ng-spark-query-list.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-spark-renderers.mjs +17 -55
- package/fesm2022/mintplayer-ng-spark-renderers.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-spark-retry-action-modal.mjs +216 -177
- package/fesm2022/mintplayer-ng-spark-retry-action-modal.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-spark-routes.mjs +24 -28
- package/fesm2022/mintplayer-ng-spark-routes.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-spark-services.mjs +625 -640
- package/fesm2022/mintplayer-ng-spark-services.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-spark-shell.mjs +1013 -397
- package/fesm2022/mintplayer-ng-spark-shell.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-spark-soft-delete.mjs +294 -0
- package/fesm2022/mintplayer-ng-spark-soft-delete.mjs.map +1 -0
- package/fesm2022/mintplayer-ng-spark.mjs +13 -50
- package/fesm2022/mintplayer-ng-spark.mjs.map +1 -1
- package/package.json +17 -1
- package/types/mintplayer-ng-spark-attribute-description.d.ts +25 -18
- package/types/mintplayer-ng-spark-client-operations.d.ts +133 -160
- package/types/mintplayer-ng-spark-column-filter.d.ts +73 -55
- package/types/mintplayer-ng-spark-grid.d.ts +885 -448
- package/types/mintplayer-ng-spark-history.d.ts +223 -0
- package/types/mintplayer-ng-spark-icon.d.ts +15 -13
- package/types/mintplayer-ng-spark-models.d.ts +624 -573
- package/types/mintplayer-ng-spark-moderation.d.ts +402 -0
- package/types/mintplayer-ng-spark-panels.d.ts +108 -0
- package/types/mintplayer-ng-spark-pipes.d.ts +120 -149
- package/types/mintplayer-ng-spark-po-create.d.ts +46 -37
- package/types/mintplayer-ng-spark-po-detail.d.ts +177 -117
- package/types/mintplayer-ng-spark-po-edit.d.ts +64 -65
- package/types/mintplayer-ng-spark-po-form.d.ts +507 -371
- package/types/mintplayer-ng-spark-query-list.d.ts +118 -82
- package/types/mintplayer-ng-spark-renderers.d.ts +79 -85
- package/types/mintplayer-ng-spark-retry-action-modal.d.ts +31 -34
- package/types/mintplayer-ng-spark-routes.d.ts +7 -11
- package/types/mintplayer-ng-spark-services.d.ts +377 -261
- package/types/mintplayer-ng-spark-shell.d.ts +209 -128
- package/types/mintplayer-ng-spark-soft-delete.d.ts +90 -0
- package/types/mintplayer-ng-spark.d.ts +7 -12
|
@@ -1,115 +1,123 @@
|
|
|
1
|
-
import * as i0 from
|
|
2
|
-
import {
|
|
3
|
-
import { Router } from
|
|
4
|
-
|
|
5
|
-
// Wire types matching MintPlayer.Spark.Abstractions.ClientOperations on the server.
|
|
6
|
-
// Discriminator is the `type` field. Unknown operation types are silently dropped
|
|
7
|
-
// by the dispatcher (forward-compat: new types can land server-side without updating
|
|
8
|
-
// older clients).
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { ChangeDetectionStrategy, Component, Injectable, InjectionToken, inject, makeEnvironmentProviders, signal } from "@angular/core";
|
|
3
|
+
import { Router } from "@angular/router";
|
|
9
4
|
var NotificationKind;
|
|
10
|
-
(function
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
5
|
+
(function(NotificationKind) {
|
|
6
|
+
NotificationKind[NotificationKind["Info"] = 0] = "Info";
|
|
7
|
+
NotificationKind[NotificationKind["Success"] = 1] = "Success";
|
|
8
|
+
NotificationKind[NotificationKind["Warning"] = 2] = "Warning";
|
|
9
|
+
NotificationKind[NotificationKind["Error"] = 3] = "Error";
|
|
15
10
|
})(NotificationKind || (NotificationKind = {}));
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
*/
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
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
|
-
|
|
11
|
+
const SPARK_CLIENT_OPERATION_HANDLERS = new InjectionToken("SPARK_CLIENT_OPERATION_HANDLERS");
|
|
12
|
+
var SparkClientOperationDispatcher = class SparkClientOperationDispatcher {
|
|
13
|
+
handlerMap;
|
|
14
|
+
constructor() {
|
|
15
|
+
const registrations = inject(SPARK_CLIENT_OPERATION_HANDLERS, { optional: true }) ?? [];
|
|
16
|
+
const map = /* @__PURE__ */ new Map();
|
|
17
|
+
for (const { type, handler } of registrations) map.set(type, handler);
|
|
18
|
+
this.handlerMap = map;
|
|
19
|
+
}
|
|
20
|
+
dispatch(operations) {
|
|
21
|
+
if (!operations || operations.length === 0) return;
|
|
22
|
+
for (const operation of operations) {
|
|
23
|
+
const handler = this.handlerMap.get(operation.type);
|
|
24
|
+
if (handler) handler(operation);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
28
|
+
minVersion: "12.0.0",
|
|
29
|
+
version: "22.2.0",
|
|
30
|
+
ngImport: i0,
|
|
31
|
+
type: SparkClientOperationDispatcher,
|
|
32
|
+
deps: [],
|
|
33
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
34
|
+
});
|
|
35
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({
|
|
36
|
+
minVersion: "12.0.0",
|
|
37
|
+
version: "22.2.0",
|
|
38
|
+
ngImport: i0,
|
|
39
|
+
type: SparkClientOperationDispatcher,
|
|
40
|
+
providedIn: "root"
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
44
|
+
minVersion: "12.0.0",
|
|
45
|
+
version: "22.2.0",
|
|
46
|
+
ngImport: i0,
|
|
47
|
+
type: SparkClientOperationDispatcher,
|
|
48
|
+
decorators: [{
|
|
49
|
+
type: Injectable,
|
|
50
|
+
args: [{ providedIn: "root" }]
|
|
51
|
+
}],
|
|
52
|
+
ctorParameters: () => []
|
|
53
|
+
});
|
|
54
|
+
const DEFAULT_DURATION_MS = 4e3;
|
|
55
|
+
var SparkNotificationService = class SparkNotificationService {
|
|
56
|
+
_toasts = signal([], ...ngDevMode ? [{ debugName: "_toasts" }] : /* istanbul ignore next */ []);
|
|
57
|
+
toasts = this._toasts.asReadonly();
|
|
58
|
+
show(message, kind = NotificationKind.Info, durationMs) {
|
|
59
|
+
const id = typeof crypto !== "undefined" && crypto.randomUUID ? crypto.randomUUID() : `${Date.now()}-${Math.random()}`;
|
|
60
|
+
const effectiveDuration = durationMs ?? DEFAULT_DURATION_MS;
|
|
61
|
+
const toast = {
|
|
62
|
+
id,
|
|
63
|
+
message,
|
|
64
|
+
kind,
|
|
65
|
+
durationMs: effectiveDuration
|
|
66
|
+
};
|
|
67
|
+
this._toasts.update((toasts) => [...toasts, toast]);
|
|
68
|
+
if (effectiveDuration > 0) setTimeout(() => this.dismiss(id), effectiveDuration);
|
|
69
|
+
}
|
|
70
|
+
dismiss(id) {
|
|
71
|
+
this._toasts.update((toasts) => toasts.filter((t) => t.id !== id));
|
|
72
|
+
}
|
|
73
|
+
clear() {
|
|
74
|
+
this._toasts.set([]);
|
|
75
|
+
}
|
|
76
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
77
|
+
minVersion: "12.0.0",
|
|
78
|
+
version: "22.2.0",
|
|
79
|
+
ngImport: i0,
|
|
80
|
+
type: SparkNotificationService,
|
|
81
|
+
deps: [],
|
|
82
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
83
|
+
});
|
|
84
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({
|
|
85
|
+
minVersion: "12.0.0",
|
|
86
|
+
version: "22.2.0",
|
|
87
|
+
ngImport: i0,
|
|
88
|
+
type: SparkNotificationService,
|
|
89
|
+
providedIn: "root"
|
|
90
|
+
});
|
|
91
|
+
};
|
|
92
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
93
|
+
minVersion: "12.0.0",
|
|
94
|
+
version: "22.2.0",
|
|
95
|
+
ngImport: i0,
|
|
96
|
+
type: SparkNotificationService,
|
|
97
|
+
decorators: [{
|
|
98
|
+
type: Injectable,
|
|
99
|
+
args: [{ providedIn: "root" }]
|
|
100
|
+
}]
|
|
101
|
+
});
|
|
102
|
+
var SparkToastContainerComponent = class SparkToastContainerComponent {
|
|
103
|
+
notifications = inject(SparkNotificationService);
|
|
104
|
+
Kind = NotificationKind;
|
|
105
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
106
|
+
minVersion: "12.0.0",
|
|
107
|
+
version: "22.2.0",
|
|
108
|
+
ngImport: i0,
|
|
109
|
+
type: SparkToastContainerComponent,
|
|
110
|
+
deps: [],
|
|
111
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
112
|
+
});
|
|
113
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
114
|
+
minVersion: "17.0.0",
|
|
115
|
+
version: "22.2.0",
|
|
116
|
+
type: SparkToastContainerComponent,
|
|
117
|
+
isStandalone: true,
|
|
118
|
+
selector: "spark-toast-container",
|
|
119
|
+
ngImport: i0,
|
|
120
|
+
template: `
|
|
113
121
|
<div class="spark-toast-container">
|
|
114
122
|
@for (toast of notifications.toasts(); track toast.id) {
|
|
115
123
|
<div
|
|
@@ -124,11 +132,23 @@ class SparkToastContainerComponent {
|
|
|
124
132
|
</div>
|
|
125
133
|
}
|
|
126
134
|
</div>
|
|
127
|
-
`,
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
135
|
+
`,
|
|
136
|
+
isInline: true,
|
|
137
|
+
styles: [".spark-toast-container{position:fixed;top:1rem;right:1rem;z-index:9999;display:flex;flex-direction:column;gap:.5rem;pointer-events:none}.spark-toast{padding:.75rem 1rem;border-radius:4px;box-shadow:0 2px 8px #00000026;cursor:pointer;min-width:220px;max-width:400px;color:#fff;font-size:.95rem;pointer-events:auto;animation:spark-toast-in .18s ease-out}.spark-toast--info{background:#0d6efd}.spark-toast--success{background:#198754}.spark-toast--warning{background:#ffc107;color:#000}.spark-toast--error{background:#dc3545}@keyframes spark-toast-in{0%{opacity:0;transform:translate(8px)}to{opacity:1;transform:translate(0)}}\n"],
|
|
138
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
139
|
+
});
|
|
140
|
+
};
|
|
141
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
142
|
+
minVersion: "12.0.0",
|
|
143
|
+
version: "22.2.0",
|
|
144
|
+
ngImport: i0,
|
|
145
|
+
type: SparkToastContainerComponent,
|
|
146
|
+
decorators: [{
|
|
147
|
+
type: Component,
|
|
148
|
+
args: [{
|
|
149
|
+
selector: "spark-toast-container",
|
|
150
|
+
standalone: true,
|
|
151
|
+
template: `
|
|
132
152
|
<div class="spark-toast-container">
|
|
133
153
|
@for (toast of notifications.toasts(); track toast.id) {
|
|
134
154
|
<div
|
|
@@ -143,220 +163,179 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImpor
|
|
|
143
163
|
</div>
|
|
144
164
|
}
|
|
145
165
|
</div>
|
|
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
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
/**
|
|
245
|
-
* Registers the built-in client-operation handlers: `notify`, `refreshQuery`,
|
|
246
|
-
* `refreshAttribute` and `navigate`. Apps add this once in their bootstrap providers.
|
|
247
|
-
*
|
|
248
|
-
* Unregistered operation types are dropped SILENTLY by the dispatcher, which is why
|
|
249
|
-
* `refreshQuery` did nothing at all for as long as it went unhandled — the server emitted
|
|
250
|
-
* it, nothing listened, and no error said so.
|
|
251
|
-
*
|
|
252
|
-
* That happened twice more before anyone noticed. `refreshAttribute` and `navigate` were both
|
|
253
|
-
* declared wire types with no handler anywhere in the repository: every
|
|
254
|
-
* `IClientAccessor.RefreshAttribute` and `Navigate` call in every Spark application was
|
|
255
|
-
* computed, serialised, sent and discarded. Both are registered below. The remaining gap is
|
|
256
|
-
* `disableAction`, registered purely to log so that it stays visible rather than invisible.
|
|
257
|
-
*
|
|
258
|
-
* The lesson worth keeping: a wire type in `operations.ts` is not a feature. Adding one without
|
|
259
|
-
* a handler here produces a server API that appears to work and does nothing.
|
|
260
|
-
*
|
|
261
|
-
* To register custom operation types alongside the built-ins, add additional
|
|
262
|
-
* `multi: true` providers using <see cref="SPARK_CLIENT_OPERATION_HANDLERS" />.
|
|
263
|
-
*/
|
|
166
|
+
`,
|
|
167
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
168
|
+
styles: [".spark-toast-container{position:fixed;top:1rem;right:1rem;z-index:9999;display:flex;flex-direction:column;gap:.5rem;pointer-events:none}.spark-toast{padding:.75rem 1rem;border-radius:4px;box-shadow:0 2px 8px #00000026;cursor:pointer;min-width:220px;max-width:400px;color:#fff;font-size:.95rem;pointer-events:auto;animation:spark-toast-in .18s ease-out}.spark-toast--info{background:#0d6efd}.spark-toast--success{background:#198754}.spark-toast--warning{background:#ffc107;color:#000}.spark-toast--error{background:#dc3545}@keyframes spark-toast-in{0%{opacity:0;transform:translate(8px)}to{opacity:1;transform:translate(0)}}\n"]
|
|
169
|
+
}]
|
|
170
|
+
}]
|
|
171
|
+
});
|
|
172
|
+
var SparkAttributeRefreshService = class SparkAttributeRefreshService {
|
|
173
|
+
tokens = signal({}, ...ngDevMode ? [{ debugName: "tokens" }] : /* istanbul ignore next */ []);
|
|
174
|
+
patches = signal({}, ...ngDevMode ? [{ debugName: "patches" }] : /* istanbul ignore next */ []);
|
|
175
|
+
static keyFor(objectTypeId, id) {
|
|
176
|
+
return `${objectTypeId}${id}`;
|
|
177
|
+
}
|
|
178
|
+
tokenFor(objectTypeId, id) {
|
|
179
|
+
if (!objectTypeId || !id) return 0;
|
|
180
|
+
return this.tokens()[SparkAttributeRefreshService.keyFor(objectTypeId, id)] ?? 0;
|
|
181
|
+
}
|
|
182
|
+
patchesFor(objectTypeId, id) {
|
|
183
|
+
if (!objectTypeId || !id) return {};
|
|
184
|
+
return this.patches()[SparkAttributeRefreshService.keyFor(objectTypeId, id)] ?? {};
|
|
185
|
+
}
|
|
186
|
+
request(objectTypeId, id, attributeName, patch) {
|
|
187
|
+
const key = SparkAttributeRefreshService.keyFor(objectTypeId, id);
|
|
188
|
+
this.patches.update((current) => ({
|
|
189
|
+
...current,
|
|
190
|
+
[key]: {
|
|
191
|
+
...current[key] ?? {},
|
|
192
|
+
[attributeName]: patch
|
|
193
|
+
}
|
|
194
|
+
}));
|
|
195
|
+
this.tokens.update((current) => ({
|
|
196
|
+
...current,
|
|
197
|
+
[key]: (current[key] ?? 0) + 1
|
|
198
|
+
}));
|
|
199
|
+
}
|
|
200
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
201
|
+
minVersion: "12.0.0",
|
|
202
|
+
version: "22.2.0",
|
|
203
|
+
ngImport: i0,
|
|
204
|
+
type: SparkAttributeRefreshService,
|
|
205
|
+
deps: [],
|
|
206
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
207
|
+
});
|
|
208
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({
|
|
209
|
+
minVersion: "12.0.0",
|
|
210
|
+
version: "22.2.0",
|
|
211
|
+
ngImport: i0,
|
|
212
|
+
type: SparkAttributeRefreshService,
|
|
213
|
+
providedIn: "root"
|
|
214
|
+
});
|
|
215
|
+
};
|
|
216
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
217
|
+
minVersion: "12.0.0",
|
|
218
|
+
version: "22.2.0",
|
|
219
|
+
ngImport: i0,
|
|
220
|
+
type: SparkAttributeRefreshService,
|
|
221
|
+
decorators: [{
|
|
222
|
+
type: Injectable,
|
|
223
|
+
args: [{ providedIn: "root" }]
|
|
224
|
+
}]
|
|
225
|
+
});
|
|
226
|
+
var SparkQueryRefreshService = class SparkQueryRefreshService {
|
|
227
|
+
tokens = signal({}, ...ngDevMode ? [{ debugName: "tokens" }] : /* istanbul ignore next */ []);
|
|
228
|
+
tokenFor(queryId) {
|
|
229
|
+
if (!queryId) return 0;
|
|
230
|
+
return this.tokens()[queryId] ?? 0;
|
|
231
|
+
}
|
|
232
|
+
request(queryId) {
|
|
233
|
+
this.tokens.update((current) => ({
|
|
234
|
+
...current,
|
|
235
|
+
[queryId]: (current[queryId] ?? 0) + 1
|
|
236
|
+
}));
|
|
237
|
+
}
|
|
238
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
239
|
+
minVersion: "12.0.0",
|
|
240
|
+
version: "22.2.0",
|
|
241
|
+
ngImport: i0,
|
|
242
|
+
type: SparkQueryRefreshService,
|
|
243
|
+
deps: [],
|
|
244
|
+
target: i0.ɵɵFactoryTarget.Injectable
|
|
245
|
+
});
|
|
246
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({
|
|
247
|
+
minVersion: "12.0.0",
|
|
248
|
+
version: "22.2.0",
|
|
249
|
+
ngImport: i0,
|
|
250
|
+
type: SparkQueryRefreshService,
|
|
251
|
+
providedIn: "root"
|
|
252
|
+
});
|
|
253
|
+
};
|
|
254
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
255
|
+
minVersion: "12.0.0",
|
|
256
|
+
version: "22.2.0",
|
|
257
|
+
ngImport: i0,
|
|
258
|
+
type: SparkQueryRefreshService,
|
|
259
|
+
decorators: [{
|
|
260
|
+
type: Injectable,
|
|
261
|
+
args: [{ providedIn: "root" }]
|
|
262
|
+
}]
|
|
263
|
+
});
|
|
264
264
|
function provideSparkClientOperations() {
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
},
|
|
339
|
-
{
|
|
340
|
-
provide: SPARK_CLIENT_OPERATION_HANDLERS,
|
|
341
|
-
useFactory: () => ({
|
|
342
|
-
type: 'disableAction',
|
|
343
|
-
handler: (operation) => {
|
|
344
|
-
// Deliberately a no-op with a warning, not silence. The server's
|
|
345
|
-
// IClientAccessor.DisableQueryActions presumes a client that honours it;
|
|
346
|
-
// nothing renders the disabled state yet, and a silently dropped operation
|
|
347
|
-
// reads as "the server did not send it" when debugging.
|
|
348
|
-
const disable = operation;
|
|
349
|
-
console.warn(`[spark] disableAction('${disable.actionName}') is not implemented by this client; the action stays enabled.`);
|
|
350
|
-
},
|
|
351
|
-
}),
|
|
352
|
-
multi: true,
|
|
353
|
-
},
|
|
354
|
-
]);
|
|
265
|
+
return makeEnvironmentProviders([
|
|
266
|
+
{
|
|
267
|
+
provide: SPARK_CLIENT_OPERATION_HANDLERS,
|
|
268
|
+
useFactory: () => {
|
|
269
|
+
const notifications = inject(SparkNotificationService);
|
|
270
|
+
return {
|
|
271
|
+
type: "notify",
|
|
272
|
+
handler: (operation) => {
|
|
273
|
+
const notify = operation;
|
|
274
|
+
notifications.show(notify.message, notify.kind, notify.durationMs);
|
|
275
|
+
}
|
|
276
|
+
};
|
|
277
|
+
},
|
|
278
|
+
multi: true
|
|
279
|
+
},
|
|
280
|
+
{
|
|
281
|
+
provide: SPARK_CLIENT_OPERATION_HANDLERS,
|
|
282
|
+
useFactory: () => {
|
|
283
|
+
const refresh = inject(SparkQueryRefreshService);
|
|
284
|
+
return {
|
|
285
|
+
type: "refreshQuery",
|
|
286
|
+
handler: (operation) => {
|
|
287
|
+
refresh.request(operation.queryId);
|
|
288
|
+
}
|
|
289
|
+
};
|
|
290
|
+
},
|
|
291
|
+
multi: true
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
provide: SPARK_CLIENT_OPERATION_HANDLERS,
|
|
295
|
+
useFactory: () => {
|
|
296
|
+
const attributes = inject(SparkAttributeRefreshService);
|
|
297
|
+
return {
|
|
298
|
+
type: "refreshAttribute",
|
|
299
|
+
handler: (operation) => {
|
|
300
|
+
const patch = operation;
|
|
301
|
+
attributes.request(patch.objectTypeId, patch.id, patch.attributeName, {
|
|
302
|
+
value: patch.value,
|
|
303
|
+
object: patch.object,
|
|
304
|
+
objects: patch.objects
|
|
305
|
+
});
|
|
306
|
+
}
|
|
307
|
+
};
|
|
308
|
+
},
|
|
309
|
+
multi: true
|
|
310
|
+
},
|
|
311
|
+
{
|
|
312
|
+
provide: SPARK_CLIENT_OPERATION_HANDLERS,
|
|
313
|
+
useFactory: () => {
|
|
314
|
+
const router = inject(Router);
|
|
315
|
+
return {
|
|
316
|
+
type: "navigate",
|
|
317
|
+
handler: (operation) => {
|
|
318
|
+
const navigate = operation;
|
|
319
|
+
if (navigate.routeName) {
|
|
320
|
+
router.navigateByUrl(navigate.routeName.startsWith("/") ? navigate.routeName : `/${navigate.routeName}`);
|
|
321
|
+
return;
|
|
322
|
+
}
|
|
323
|
+
if (navigate.objectTypeId && navigate.id) {
|
|
324
|
+
router.navigate([
|
|
325
|
+
"/po",
|
|
326
|
+
navigate.objectTypeId,
|
|
327
|
+
navigate.id
|
|
328
|
+
]);
|
|
329
|
+
return;
|
|
330
|
+
}
|
|
331
|
+
console.warn("[spark] navigate operation carried neither routeName nor objectTypeId+id; ignored.");
|
|
332
|
+
}
|
|
333
|
+
};
|
|
334
|
+
},
|
|
335
|
+
multi: true
|
|
336
|
+
}
|
|
337
|
+
]);
|
|
355
338
|
}
|
|
356
|
-
|
|
357
|
-
/**
|
|
358
|
-
* Generated bundle index. Do not edit.
|
|
359
|
-
*/
|
|
360
|
-
|
|
361
339
|
export { NotificationKind, SPARK_CLIENT_OPERATION_HANDLERS, SparkAttributeRefreshService, SparkClientOperationDispatcher, SparkNotificationService, SparkQueryRefreshService, SparkToastContainerComponent, provideSparkClientOperations };
|
|
362
|
-
|
|
340
|
+
|
|
341
|
+
//# sourceMappingURL=mintplayer-ng-spark-client-operations.mjs.map
|