@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,304 +1,517 @@
|
|
|
1
|
-
import * as i0 from
|
|
2
|
-
import {
|
|
3
|
-
import { takeUntilDestroyed } from
|
|
4
|
-
import * as i1 from
|
|
5
|
-
import { CommonModule, NgTemplateOutlet } from
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
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
|
-
|
|
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
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
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
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
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
|
-
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { ChangeDetectionStrategy, Component, DestroyRef, computed, effect, inject, input, output, signal, viewChild } from "@angular/core";
|
|
3
|
+
import { takeUntilDestroyed } from "@angular/core/rxjs-interop";
|
|
4
|
+
import * as i1 from "@angular/common";
|
|
5
|
+
import { CommonModule, NgComponentOutlet, NgTemplateOutlet } from "@angular/common";
|
|
6
|
+
import { ActivatedRoute, Router } from "@angular/router";
|
|
7
|
+
import { Color } from "@mintplayer/ng-bootstrap";
|
|
8
|
+
import { BsBadgeComponent } from "@mintplayer/ng-bootstrap/badge";
|
|
9
|
+
import { BsAlertComponent } from "@mintplayer/ng-bootstrap/alert";
|
|
10
|
+
import { BsGridColumnDirective, BsGridComponent, BsGridRowDirective } from "@mintplayer/ng-bootstrap/grid";
|
|
11
|
+
import { BsPriorityNavComponent, BsPriorityNavItemDirective } from "@mintplayer/ng-bootstrap/priority-nav";
|
|
12
|
+
import { BsSpinnerComponent } from "@mintplayer/ng-bootstrap/spinner";
|
|
13
|
+
import { SparkLanguageService, SparkService, SparkStreamingService } from "@mintplayer/ng-spark/services";
|
|
14
|
+
import { ResolveTranslationPipe, TranslateKeyPipe } from "@mintplayer/ng-spark/pipes";
|
|
15
|
+
import { SparkIconComponent } from "@mintplayer/ng-spark/icon";
|
|
16
|
+
import { SparkQueryGridComponent, SparkSearchBoxComponent, sparkActionClass } from "@mintplayer/ng-spark/grid";
|
|
17
|
+
import { SPARK_QUERY_LIST_ACTIONS, orderSparkExtensions, parseSparkDeletedParam } from "@mintplayer/ng-spark/panels";
|
|
18
|
+
var SparkQueryListComponent = class SparkQueryListComponent {
|
|
19
|
+
route = inject(ActivatedRoute);
|
|
20
|
+
router = inject(Router);
|
|
21
|
+
sparkService = inject(SparkService);
|
|
22
|
+
streamingService = inject(SparkStreamingService);
|
|
23
|
+
destroyRef = inject(DestroyRef);
|
|
24
|
+
lang = inject(SparkLanguageService);
|
|
25
|
+
extraActionsTemplate = input(null, ...ngDevMode ? [{ debugName: "extraActionsTemplate" }] : /* istanbul ignore next */ []);
|
|
26
|
+
showCustomActions = input(true, ...ngDevMode ? [{ debugName: "showCustomActions" }] : /* istanbul ignore next */ []);
|
|
27
|
+
rowRoute = input(null, ...ngDevMode ? [{ debugName: "rowRoute" }] : /* istanbul ignore next */ []);
|
|
28
|
+
rowClicked = output();
|
|
29
|
+
createClicked = output();
|
|
30
|
+
customActionExecuted = output();
|
|
31
|
+
colors = Color;
|
|
32
|
+
queryId = signal(null, ...ngDevMode ? [{ debugName: "queryId" }] : /* istanbul ignore next */ []);
|
|
33
|
+
errorMessage = signal(null, ...ngDevMode ? [{ debugName: "errorMessage" }] : /* istanbul ignore next */ []);
|
|
34
|
+
searchTerm = signal("", ...ngDevMode ? [{ debugName: "searchTerm" }] : /* istanbul ignore next */ []);
|
|
35
|
+
grid = viewChild(SparkQueryGridComponent, ...ngDevMode ? [{ debugName: "grid" }] : /* istanbul ignore next */ []);
|
|
36
|
+
query = computed(() => this.grid()?.query() ?? null, ...ngDevMode ? [{ debugName: "query" }] : /* istanbul ignore next */ []);
|
|
37
|
+
entityType = computed(() => this.grid()?.entityType() ?? null, ...ngDevMode ? [{ debugName: "entityType" }] : /* istanbul ignore next */ []);
|
|
38
|
+
customActions = computed(() => this.grid()?.customActions() ?? [], ...ngDevMode ? [{ debugName: "customActions" }] : /* istanbul ignore next */ []);
|
|
39
|
+
canCreate = computed(() => this.grid()?.offersCreate() ?? false, ...ngDevMode ? [{ debugName: "canCreate" }] : /* istanbul ignore next */ []);
|
|
40
|
+
resultCount = computed(() => this.grid()?.resultCount() ?? null, ...ngDevMode ? [{ debugName: "resultCount" }] : /* istanbul ignore next */ []);
|
|
41
|
+
isVirtualScrolling = computed(() => this.grid()?.isVirtualScrolling() ?? false, ...ngDevMode ? [{ debugName: "isVirtualScrolling" }] : /* istanbul ignore next */ []);
|
|
42
|
+
gridError = computed(() => this.grid()?.errorMessage() ?? null, ...ngDevMode ? [{ debugName: "gridError" }] : /* istanbul ignore next */ []);
|
|
43
|
+
permissions = computed(() => this.grid()?.permissions() ?? null, ...ngDevMode ? [{ debugName: "permissions" }] : /* istanbul ignore next */ []);
|
|
44
|
+
listActions = orderSparkExtensions(inject(SPARK_QUERY_LIST_ACTIONS, { optional: true }), (a) => a.priority ?? 60);
|
|
45
|
+
deletedMode = signal("exclude", ...ngDevMode ? [{ debugName: "deletedMode" }] : /* istanbul ignore next */ []);
|
|
46
|
+
reloadToken = signal(0, ...ngDevMode ? [{ debugName: "reloadToken" }] : /* istanbul ignore next */ []);
|
|
47
|
+
listContext = computed(() => {
|
|
48
|
+
const query = this.query();
|
|
49
|
+
if (!query) return null;
|
|
50
|
+
return {
|
|
51
|
+
query,
|
|
52
|
+
entityType: this.entityType(),
|
|
53
|
+
permissions: this.permissions(),
|
|
54
|
+
deleted: this.deletedMode(),
|
|
55
|
+
setDeleted: (mode) => this.setDeleted(mode),
|
|
56
|
+
reload: () => this.reloadToken.update((n) => n + 1)
|
|
57
|
+
};
|
|
58
|
+
}, ...ngDevMode ? [{ debugName: "listContext" }] : /* istanbul ignore next */ []);
|
|
59
|
+
gridReloadToken = this.reloadToken.asReadonly();
|
|
60
|
+
setDeleted(mode) {
|
|
61
|
+
this.router.navigate([], {
|
|
62
|
+
relativeTo: this.route,
|
|
63
|
+
queryParams: { deleted: mode === "exclude" ? null : mode },
|
|
64
|
+
queryParamsHandling: "merge",
|
|
65
|
+
replaceUrl: true
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
customActionClass(action) {
|
|
69
|
+
const variant = action.variant?.toLowerCase();
|
|
70
|
+
switch (variant) {
|
|
71
|
+
case "danger":
|
|
72
|
+
case "warning":
|
|
73
|
+
case "primary":
|
|
74
|
+
case "secondary":
|
|
75
|
+
case "success": return `btn btn-${variant}`;
|
|
76
|
+
default: return "btn btn-outline-primary";
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
toolbarActions = computed(() => this.grid()?.toolbarActions() ?? [], ...ngDevMode ? [{ debugName: "toolbarActions" }] : /* istanbul ignore next */ []);
|
|
80
|
+
toolbarActionClass(action) {
|
|
81
|
+
return action.kind === "new" ? "btn btn-primary" : sparkActionClass(action.definition);
|
|
82
|
+
}
|
|
83
|
+
isToolbarActionEnabled(action) {
|
|
84
|
+
return this.grid()?.isToolbarActionEnabled(action) ?? false;
|
|
85
|
+
}
|
|
86
|
+
runToolbarAction(action) {
|
|
87
|
+
if (action.kind === "new") {
|
|
88
|
+
this.onCreate();
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
this.grid()?.runToolbarAction(action);
|
|
92
|
+
}
|
|
93
|
+
isActionEnabled(action) {
|
|
94
|
+
return this.grid()?.isActionEnabled(action) ?? false;
|
|
95
|
+
}
|
|
96
|
+
isStreaming = signal(false, ...ngDevMode ? [{ debugName: "isStreaming" }] : /* istanbul ignore next */ []);
|
|
97
|
+
streamingSub = null;
|
|
98
|
+
streamColumns = signal([], ...ngDevMode ? [{ debugName: "streamColumns" }] : /* istanbul ignore next */ []);
|
|
99
|
+
allItems = signal([], ...ngDevMode ? [{ debugName: "allItems" }] : /* istanbul ignore next */ []);
|
|
100
|
+
streamItems = signal([], ...ngDevMode ? [{ debugName: "streamItems" }] : /* istanbul ignore next */ []);
|
|
101
|
+
gridData = computed(() => this.query()?.isStreamingQuery ? this.streamItems() : null, ...ngDevMode ? [{ debugName: "gridData" }] : /* istanbul ignore next */ []);
|
|
102
|
+
constructor() {
|
|
103
|
+
this.route.paramMap.pipe(takeUntilDestroyed()).subscribe((params) => {
|
|
104
|
+
this.onParamsChange(params).catch((e) => this.reportLoadFailure(e));
|
|
105
|
+
});
|
|
106
|
+
this.route.queryParamMap.pipe(takeUntilDestroyed()).subscribe((query) => this.deletedMode.set(parseSparkDeletedParam(query.get("deleted")) ?? "exclude"));
|
|
107
|
+
this.destroyRef.onDestroy(() => this.disconnectStreaming());
|
|
108
|
+
effect(() => {
|
|
109
|
+
const q = this.query();
|
|
110
|
+
if (q?.isStreamingQuery) this.connectStreaming(q.id);
|
|
111
|
+
else this.disconnectStreaming();
|
|
112
|
+
});
|
|
113
|
+
effect(() => {
|
|
114
|
+
this.searchTerm();
|
|
115
|
+
this.grid()?.settings();
|
|
116
|
+
this.allItems();
|
|
117
|
+
if (this.isStreaming()) this.applyFilter();
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
async onParamsChange(params) {
|
|
121
|
+
this.errorMessage.set(null);
|
|
122
|
+
this.queryId.set(null);
|
|
123
|
+
this.allItems.set([]);
|
|
124
|
+
this.streamItems.set([]);
|
|
125
|
+
this.streamColumns.set([]);
|
|
126
|
+
this.disconnectStreaming();
|
|
127
|
+
const queryId = params.get("queryId");
|
|
128
|
+
const typeParam = params.get("type");
|
|
129
|
+
if (queryId) {
|
|
130
|
+
this.queryId.set(queryId);
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
if (!typeParam) return;
|
|
134
|
+
const [entityTypes, queries] = await Promise.all([this.sparkService.getEntityTypes(), this.sparkService.getQueries()]);
|
|
135
|
+
const entityType = entityTypes.find((t) => t.id === typeParam || t.alias === typeParam);
|
|
136
|
+
if (!entityType) {
|
|
137
|
+
this.reportLoadFailure({ status: 404 });
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
const singularName = entityType.name;
|
|
141
|
+
const match = queries.find((q) => {
|
|
142
|
+
if (q.entityType === singularName) return true;
|
|
143
|
+
const sourceName = q.source.includes(".") ? q.source.substring(q.source.indexOf(".") + 1) : q.source;
|
|
144
|
+
return sourceName === singularName || sourceName === singularName + "s";
|
|
145
|
+
});
|
|
146
|
+
if (match) this.queryId.set(match.alias || match.id);
|
|
147
|
+
else this.reportLoadFailure({ status: 404 });
|
|
148
|
+
}
|
|
149
|
+
reportLoadFailure(err) {
|
|
150
|
+
this.errorMessage.set(err?.status === 404 ? this.lang.t("spark.query.unavailable") || "This list is not available." : err?.error?.error || err?.message || "An unexpected error occurred");
|
|
151
|
+
}
|
|
152
|
+
async onCustomAction(action) {
|
|
153
|
+
await this.grid()?.onCustomAction(action);
|
|
154
|
+
}
|
|
155
|
+
onCreate() {
|
|
156
|
+
this.createClicked.emit();
|
|
157
|
+
const et = this.entityType();
|
|
158
|
+
if (et) this.router.navigate([
|
|
159
|
+
"/po",
|
|
160
|
+
et.alias || et.id,
|
|
161
|
+
"new"
|
|
162
|
+
]);
|
|
163
|
+
}
|
|
164
|
+
clearSearch() {
|
|
165
|
+
this.searchTerm.set("");
|
|
166
|
+
}
|
|
167
|
+
connectStreaming(queryId) {
|
|
168
|
+
if (this.streamingSub) return;
|
|
169
|
+
this.isStreaming.set(true);
|
|
170
|
+
this.streamingSub = this.streamingService.connectToStreamingQuery(queryId).subscribe({
|
|
171
|
+
next: (message) => this.handleStreamingMessage(message),
|
|
172
|
+
error: (err) => {
|
|
173
|
+
this.errorMessage.set(err?.message || "Streaming connection failed");
|
|
174
|
+
this.isStreaming.set(false);
|
|
175
|
+
},
|
|
176
|
+
complete: () => this.isStreaming.set(false)
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
disconnectStreaming() {
|
|
180
|
+
if (this.streamingSub) {
|
|
181
|
+
this.streamingSub.unsubscribe();
|
|
182
|
+
this.streamingSub = null;
|
|
183
|
+
}
|
|
184
|
+
this.isStreaming.set(false);
|
|
185
|
+
}
|
|
186
|
+
handleStreamingMessage(message) {
|
|
187
|
+
switch (message.type) {
|
|
188
|
+
case "snapshot":
|
|
189
|
+
this.errorMessage.set(null);
|
|
190
|
+
this.streamColumns.set(message.columns);
|
|
191
|
+
this.allItems.set(message.data);
|
|
192
|
+
break;
|
|
193
|
+
case "patch":
|
|
194
|
+
if (message.updated.length > 0) this.allItems.update((items) => items.map((item) => {
|
|
195
|
+
const patch = message.updated.find((u) => u.id === item.id);
|
|
196
|
+
if (!patch) return item;
|
|
197
|
+
return {
|
|
198
|
+
...item,
|
|
199
|
+
values: item.values.map((v) => v.key in patch.values ? {
|
|
200
|
+
...v,
|
|
201
|
+
value: patch.values[v.key]
|
|
202
|
+
} : v)
|
|
203
|
+
};
|
|
204
|
+
}));
|
|
205
|
+
break;
|
|
206
|
+
case "error": this.errorMessage.set(message.message);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
applyFilter() {
|
|
210
|
+
let items = this.allItems();
|
|
211
|
+
const term = this.searchTerm().toLowerCase();
|
|
212
|
+
if (term) items = items.filter((item) => item.values.some((v) => String(v.value ?? "").toLowerCase().includes(term)));
|
|
213
|
+
const sortCols = this.grid()?.settings().sortColumns ?? [];
|
|
214
|
+
if (sortCols.length > 0) items = [...items].sort((a, b) => {
|
|
215
|
+
for (const col of sortCols) {
|
|
216
|
+
const aVal = a.values.find((v) => v.key === col.property)?.value ?? "";
|
|
217
|
+
const bVal = b.values.find((v) => v.key === col.property)?.value ?? "";
|
|
218
|
+
const cmp = String(aVal).localeCompare(String(bVal));
|
|
219
|
+
if (cmp !== 0) return col.direction === "descending" ? -cmp : cmp;
|
|
220
|
+
}
|
|
221
|
+
return 0;
|
|
222
|
+
});
|
|
223
|
+
this.streamItems.set(items);
|
|
224
|
+
}
|
|
225
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
226
|
+
minVersion: "12.0.0",
|
|
227
|
+
version: "22.2.0",
|
|
228
|
+
ngImport: i0,
|
|
229
|
+
type: SparkQueryListComponent,
|
|
230
|
+
deps: [],
|
|
231
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
232
|
+
});
|
|
233
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
234
|
+
minVersion: "17.0.0",
|
|
235
|
+
version: "22.2.0",
|
|
236
|
+
type: SparkQueryListComponent,
|
|
237
|
+
isStandalone: true,
|
|
238
|
+
selector: "spark-query-list",
|
|
239
|
+
inputs: {
|
|
240
|
+
extraActionsTemplate: {
|
|
241
|
+
classPropertyName: "extraActionsTemplate",
|
|
242
|
+
publicName: "extraActionsTemplate",
|
|
243
|
+
isSignal: true,
|
|
244
|
+
isRequired: false,
|
|
245
|
+
transformFunction: null
|
|
246
|
+
},
|
|
247
|
+
showCustomActions: {
|
|
248
|
+
classPropertyName: "showCustomActions",
|
|
249
|
+
publicName: "showCustomActions",
|
|
250
|
+
isSignal: true,
|
|
251
|
+
isRequired: false,
|
|
252
|
+
transformFunction: null
|
|
253
|
+
},
|
|
254
|
+
rowRoute: {
|
|
255
|
+
classPropertyName: "rowRoute",
|
|
256
|
+
publicName: "rowRoute",
|
|
257
|
+
isSignal: true,
|
|
258
|
+
isRequired: false,
|
|
259
|
+
transformFunction: null
|
|
260
|
+
}
|
|
261
|
+
},
|
|
262
|
+
outputs: {
|
|
263
|
+
rowClicked: "rowClicked",
|
|
264
|
+
createClicked: "createClicked",
|
|
265
|
+
customActionExecuted: "customActionExecuted"
|
|
266
|
+
},
|
|
267
|
+
host: { properties: { "class.virtual-scrolling": "isVirtualScrolling()" } },
|
|
268
|
+
viewQueries: [{
|
|
269
|
+
propertyName: "grid",
|
|
270
|
+
first: true,
|
|
271
|
+
predicate: SparkQueryGridComponent,
|
|
272
|
+
descendants: true,
|
|
273
|
+
isSignal: true
|
|
274
|
+
}],
|
|
275
|
+
ngImport: i0,
|
|
276
|
+
template: "<div class=\"d-flex flex-column h-100\">\n <div class=\"spark-actionbar py-2 flex-shrink-0\" [class.spark-actionbar-wide]=\"isVirtualScrolling()\">\n <bs-priority-nav [moreLabel]=\"lang.t('common.more')\" [collapseAt]=\"'sm'\">\n <!-- The grid's toolbar model (#460, M15): New, Delete and the custom actions — the list the\n sub-query card renders too. Disabled, not hidden: hiding makes the affordance\n undiscoverable and reflows the priority nav on every selection change. The server\n enforces the same rules. -->\n @for (action of toolbarActions(); track action.name) {\n @if (action.kind !== 'custom' || showCustomActions()) {\n <button *bsPriorityNavItem=\"action.priority\" type=\"button\" [class]=\"toolbarActionClass(action)\"\n [attr.data-action]=\"action.name\"\n [disabled]=\"!isToolbarActionEnabled(action)\" (click)=\"runToolbarAction(action)\">\n @if (action.kind === 'new') {\n <spark-icon name=\"plus-lg\" /> {{ 'common.new' | t }}\n } @else {\n @if (action.definition.icon && action.kind === 'delete') {\n <spark-icon [name]=\"action.definition.icon\" />\n }\n {{ action.definition.displayName | resolveTranslation }}\n }\n </button>\n }\n }\n @if (extraActionsTemplate(); as extraActionsTpl) {\n <ng-container *bsPriorityNavItem=\"50\">\n <ng-container *ngTemplateOutlet=\"extraActionsTpl\"></ng-container>\n </ng-container>\n }\n <!-- Add-on actions (SPARK_QUERY_LIST_ACTIONS), e.g. the soft-delete Deleted toggle. -->\n @if (listContext(); as ctx) {\n @for (action of listActions; track action.id) {\n <ng-container *bsPriorityNavItem=\"action.priority ?? 60\">\n <ng-container *ngComponentOutlet=\"action.component; inputs: { context: ctx }\" />\n </ng-container>\n }\n }\n </bs-priority-nav>\n </div>\n\n <h2 class=\"mb-4 flex-shrink-0\" [class.px-4]=\"isVirtualScrolling()\">\n {{ (query()?.description | resolveTranslation) || query()?.name || ('common.loading' | t) }}\n @if (isStreaming()) {\n <bs-badge [type]=\"colors.success\" class=\"ms-2 align-middle spark-live-badge\">LIVE</bs-badge>\n }\n @if (deletedMode() === 'only') {\n <bs-badge [type]=\"colors.secondary\" class=\"ms-2 align-middle spark-deleted-badge\">{{ 'softDelete.deleted' | t }}</bs-badge>\n }\n </h2>\n\n @if (errorMessage(); as err) {\n <!-- The route could not be resolved to a query at all. A failure INSIDE the grid renders in\n the grid; this is the one it cannot report, because it never got a query id. -->\n <bs-alert [type]=\"colors.danger\" class=\"m-3 d-block\">\n {{ err }}\n </bs-alert>\n } @else if (queryId(); as qId) {\n <div class=\"flex-shrink-0\" [class.px-4]=\"isVirtualScrolling()\">\n <bs-grid>\n <div bsRow class=\"mb-3\">\n <div [md]=\"12\">\n <!-- The same box as the sub-query card's header (#460 M15): debounce, clear button. -->\n <spark-search-box [(term)]=\"searchTerm\" />\n </div>\n <!-- Its own full-width row rather than a column beside the box: the count is\n occasional, and reserving 8 columns for it shrank the search permanently. The\n @if moved out of the column so nothing reserves vertical space when absent. -->\n @if (searchTerm() && resultCount() !== null) {\n <div [md]=\"12\" class=\"text-end mt-1\">\n <span class=\"text-muted\">\n {{ resultCount() }} {{ resultCount() === 1 ? ('common.resultFound' | t) : ('common.resultsFound' | t) }}\n </span>\n </div>\n }\n </div>\n </bs-grid>\n </div>\n\n <!--\n One grid, both transports. `data` is null for a normal query, so the grid fetches and pages\n server-side; for a streaming query this page owns the socket and hands the filtered snapshot\n in. This used to be two near-identical <bs-datatable> blocks with a shared row template.\n -->\n <spark-query-grid class=\"flex-grow-1\"\n [queryId]=\"qId\"\n [data]=\"gridData()\"\n [columns]=\"gridData() ? streamColumns() : null\"\n [search]=\"searchTerm()\"\n [deleted]=\"deletedMode()\"\n [reloadToken]=\"gridReloadToken()\"\n [rowRoute]=\"rowRoute()\"\n (rowClicked)=\"rowClicked.emit($event)\"\n (customActionExecuted)=\"customActionExecuted.emit($event)\" />\n } @else {\n <div class=\"text-center p-5\">\n <bs-spinner />\n </div>\n }\n</div>\n",
|
|
277
|
+
styles: [".spark-actionbar{--_bleed-block: var(--spark-content-inset-block, 0px);--_bleed-inline: var(--spark-content-inset-inline, 0px);--_gutter: var(--spark-actionbar-gutter, 1rem);position:sticky;top:calc(-1 * var(--_bleed-block));z-index:400;background-color:var(--bs-tertiary-bg);border-bottom:1px solid var(--bs-border-color);margin-bottom:1rem;margin-inline:calc(-1 * var(--_bleed-inline));padding-inline:calc(var(--_bleed-inline) + var(--_gutter))}.spark-actionbar .btn{border-radius:0}.spark-actionbar-wide{--spark-actionbar-gutter: 1.5rem}:host{display:flex;flex-direction:column;flex:1;min-height:0}:host.virtual-scrolling{margin:0 calc(-1 * var(--spark-main-padding, 1.5rem)) calc(-1 * var(--spark-main-padding, 1.5rem));--spark-content-inset-inline: 0px}:host.virtual-scrolling spark-query-grid{display:flex;flex-direction:column;min-height:0}:host.virtual-scrolling ::ng-deep bs-datatable{display:flex;flex-direction:column;min-height:0;--mp-datatable-virtual-max-height: 100%}:host.virtual-scrolling ::ng-deep bs-datatable mp-datatable{flex:1 1 auto;min-height:0}tr:hover{background-color:#0000000d}td input[type=checkbox]:disabled{opacity:1;pointer-events:none}.spark-live-badge{font-size:.6em}\n"],
|
|
278
|
+
dependencies: [
|
|
279
|
+
{
|
|
280
|
+
kind: "component",
|
|
281
|
+
type: BsBadgeComponent,
|
|
282
|
+
selector: "bs-badge",
|
|
283
|
+
inputs: [
|
|
284
|
+
"type",
|
|
285
|
+
"unit",
|
|
286
|
+
"decorative"
|
|
287
|
+
]
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
kind: "ngmodule",
|
|
291
|
+
type: CommonModule
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
kind: "directive",
|
|
295
|
+
type: i1.NgComponentOutlet,
|
|
296
|
+
selector: "[ngComponentOutlet]",
|
|
297
|
+
inputs: [
|
|
298
|
+
"ngComponentOutlet",
|
|
299
|
+
"ngComponentOutletInputs",
|
|
300
|
+
"ngComponentOutletInjector",
|
|
301
|
+
"ngComponentOutletEnvironmentInjector",
|
|
302
|
+
"ngComponentOutletContent",
|
|
303
|
+
"ngComponentOutletNgModule"
|
|
304
|
+
],
|
|
305
|
+
exportAs: ["ngComponentOutlet"]
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
kind: "directive",
|
|
309
|
+
type: i1.NgTemplateOutlet,
|
|
310
|
+
selector: "[ngTemplateOutlet]",
|
|
311
|
+
inputs: [
|
|
312
|
+
"ngTemplateOutletContext",
|
|
313
|
+
"ngTemplateOutlet",
|
|
314
|
+
"ngTemplateOutletInjector"
|
|
315
|
+
]
|
|
316
|
+
},
|
|
317
|
+
{
|
|
318
|
+
kind: "component",
|
|
319
|
+
type: BsAlertComponent,
|
|
320
|
+
selector: "bs-alert",
|
|
321
|
+
inputs: [
|
|
322
|
+
"type",
|
|
323
|
+
"announce",
|
|
324
|
+
"isVisible"
|
|
325
|
+
],
|
|
326
|
+
outputs: ["isVisibleChange", "afterOpenedOrClosed"]
|
|
327
|
+
},
|
|
328
|
+
{
|
|
329
|
+
kind: "component",
|
|
330
|
+
type: BsGridComponent,
|
|
331
|
+
selector: "bs-grid",
|
|
332
|
+
inputs: ["stopFullWidthAt"]
|
|
333
|
+
},
|
|
334
|
+
{
|
|
335
|
+
kind: "directive",
|
|
336
|
+
type: BsGridRowDirective,
|
|
337
|
+
selector: "[bsRow]"
|
|
338
|
+
},
|
|
339
|
+
{
|
|
340
|
+
kind: "directive",
|
|
341
|
+
type: BsGridColumnDirective,
|
|
342
|
+
selector: "[xxs],[xs],[sm],[md],[lg],[xl],[xxl]",
|
|
343
|
+
inputs: [
|
|
344
|
+
"xxs",
|
|
345
|
+
"xs",
|
|
346
|
+
"sm",
|
|
347
|
+
"md",
|
|
348
|
+
"lg",
|
|
349
|
+
"xl",
|
|
350
|
+
"xxl"
|
|
351
|
+
]
|
|
352
|
+
},
|
|
353
|
+
{
|
|
354
|
+
kind: "component",
|
|
355
|
+
type: BsPriorityNavComponent,
|
|
356
|
+
selector: "bs-priority-nav",
|
|
357
|
+
inputs: [
|
|
358
|
+
"moreLabel",
|
|
359
|
+
"moreLabelTemplate",
|
|
360
|
+
"collapseAt",
|
|
361
|
+
"overflowFrom",
|
|
362
|
+
"hideEmptyMore",
|
|
363
|
+
"ariaLabel"
|
|
364
|
+
],
|
|
365
|
+
outputs: ["overflowChange"]
|
|
366
|
+
},
|
|
367
|
+
{
|
|
368
|
+
kind: "directive",
|
|
369
|
+
type: BsPriorityNavItemDirective,
|
|
370
|
+
selector: "[bsPriorityNavItem]",
|
|
371
|
+
inputs: ["bsPriorityNavItem", "bsPriorityNavItemHideBelow"]
|
|
372
|
+
},
|
|
373
|
+
{
|
|
374
|
+
kind: "component",
|
|
375
|
+
type: BsSpinnerComponent,
|
|
376
|
+
selector: "bs-spinner",
|
|
377
|
+
inputs: ["type", "color"]
|
|
378
|
+
},
|
|
379
|
+
{
|
|
380
|
+
kind: "component",
|
|
381
|
+
type: SparkIconComponent,
|
|
382
|
+
selector: "spark-icon",
|
|
383
|
+
inputs: ["name"]
|
|
384
|
+
},
|
|
385
|
+
{
|
|
386
|
+
kind: "component",
|
|
387
|
+
type: SparkQueryGridComponent,
|
|
388
|
+
selector: "spark-query-grid",
|
|
389
|
+
inputs: [
|
|
390
|
+
"queryId",
|
|
391
|
+
"parentId",
|
|
392
|
+
"parentType",
|
|
393
|
+
"data",
|
|
394
|
+
"search",
|
|
395
|
+
"columns",
|
|
396
|
+
"reloadToken",
|
|
397
|
+
"deleted",
|
|
398
|
+
"parentDeleted",
|
|
399
|
+
"settings",
|
|
400
|
+
"selection",
|
|
401
|
+
"rowRoute",
|
|
402
|
+
"selectionModeSetting"
|
|
403
|
+
],
|
|
404
|
+
outputs: [
|
|
405
|
+
"settingsChange",
|
|
406
|
+
"selectionChange",
|
|
407
|
+
"error",
|
|
408
|
+
"rowClicked",
|
|
409
|
+
"customActionExecuted",
|
|
410
|
+
"createClicked"
|
|
411
|
+
]
|
|
412
|
+
},
|
|
413
|
+
{
|
|
414
|
+
kind: "component",
|
|
415
|
+
type: SparkSearchBoxComponent,
|
|
416
|
+
selector: "spark-search-box",
|
|
417
|
+
inputs: [
|
|
418
|
+
"term",
|
|
419
|
+
"size",
|
|
420
|
+
"debounce"
|
|
421
|
+
],
|
|
422
|
+
outputs: ["termChange"]
|
|
423
|
+
},
|
|
424
|
+
{
|
|
425
|
+
kind: "pipe",
|
|
426
|
+
type: ResolveTranslationPipe,
|
|
427
|
+
name: "resolveTranslation"
|
|
428
|
+
},
|
|
429
|
+
{
|
|
430
|
+
kind: "pipe",
|
|
431
|
+
type: TranslateKeyPipe,
|
|
432
|
+
name: "t"
|
|
433
|
+
}
|
|
434
|
+
],
|
|
435
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush
|
|
436
|
+
});
|
|
437
|
+
};
|
|
438
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
439
|
+
minVersion: "12.0.0",
|
|
440
|
+
version: "22.2.0",
|
|
441
|
+
ngImport: i0,
|
|
442
|
+
type: SparkQueryListComponent,
|
|
443
|
+
decorators: [{
|
|
444
|
+
type: Component,
|
|
445
|
+
args: [{
|
|
446
|
+
selector: "spark-query-list",
|
|
447
|
+
imports: [
|
|
448
|
+
BsBadgeComponent,
|
|
449
|
+
CommonModule,
|
|
450
|
+
NgTemplateOutlet,
|
|
451
|
+
NgComponentOutlet,
|
|
452
|
+
BsAlertComponent,
|
|
453
|
+
BsGridComponent,
|
|
454
|
+
BsGridRowDirective,
|
|
455
|
+
BsGridColumnDirective,
|
|
456
|
+
BsPriorityNavComponent,
|
|
457
|
+
BsPriorityNavItemDirective,
|
|
458
|
+
BsSpinnerComponent,
|
|
459
|
+
SparkIconComponent,
|
|
460
|
+
SparkQueryGridComponent,
|
|
461
|
+
SparkSearchBoxComponent,
|
|
462
|
+
ResolveTranslationPipe,
|
|
463
|
+
TranslateKeyPipe
|
|
464
|
+
],
|
|
465
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
466
|
+
host: { "[class.virtual-scrolling]": "isVirtualScrolling()" },
|
|
467
|
+
template: "<div class=\"d-flex flex-column h-100\">\n <div class=\"spark-actionbar py-2 flex-shrink-0\" [class.spark-actionbar-wide]=\"isVirtualScrolling()\">\n <bs-priority-nav [moreLabel]=\"lang.t('common.more')\" [collapseAt]=\"'sm'\">\n <!-- The grid's toolbar model (#460, M15): New, Delete and the custom actions — the list the\n sub-query card renders too. Disabled, not hidden: hiding makes the affordance\n undiscoverable and reflows the priority nav on every selection change. The server\n enforces the same rules. -->\n @for (action of toolbarActions(); track action.name) {\n @if (action.kind !== 'custom' || showCustomActions()) {\n <button *bsPriorityNavItem=\"action.priority\" type=\"button\" [class]=\"toolbarActionClass(action)\"\n [attr.data-action]=\"action.name\"\n [disabled]=\"!isToolbarActionEnabled(action)\" (click)=\"runToolbarAction(action)\">\n @if (action.kind === 'new') {\n <spark-icon name=\"plus-lg\" /> {{ 'common.new' | t }}\n } @else {\n @if (action.definition.icon && action.kind === 'delete') {\n <spark-icon [name]=\"action.definition.icon\" />\n }\n {{ action.definition.displayName | resolveTranslation }}\n }\n </button>\n }\n }\n @if (extraActionsTemplate(); as extraActionsTpl) {\n <ng-container *bsPriorityNavItem=\"50\">\n <ng-container *ngTemplateOutlet=\"extraActionsTpl\"></ng-container>\n </ng-container>\n }\n <!-- Add-on actions (SPARK_QUERY_LIST_ACTIONS), e.g. the soft-delete Deleted toggle. -->\n @if (listContext(); as ctx) {\n @for (action of listActions; track action.id) {\n <ng-container *bsPriorityNavItem=\"action.priority ?? 60\">\n <ng-container *ngComponentOutlet=\"action.component; inputs: { context: ctx }\" />\n </ng-container>\n }\n }\n </bs-priority-nav>\n </div>\n\n <h2 class=\"mb-4 flex-shrink-0\" [class.px-4]=\"isVirtualScrolling()\">\n {{ (query()?.description | resolveTranslation) || query()?.name || ('common.loading' | t) }}\n @if (isStreaming()) {\n <bs-badge [type]=\"colors.success\" class=\"ms-2 align-middle spark-live-badge\">LIVE</bs-badge>\n }\n @if (deletedMode() === 'only') {\n <bs-badge [type]=\"colors.secondary\" class=\"ms-2 align-middle spark-deleted-badge\">{{ 'softDelete.deleted' | t }}</bs-badge>\n }\n </h2>\n\n @if (errorMessage(); as err) {\n <!-- The route could not be resolved to a query at all. A failure INSIDE the grid renders in\n the grid; this is the one it cannot report, because it never got a query id. -->\n <bs-alert [type]=\"colors.danger\" class=\"m-3 d-block\">\n {{ err }}\n </bs-alert>\n } @else if (queryId(); as qId) {\n <div class=\"flex-shrink-0\" [class.px-4]=\"isVirtualScrolling()\">\n <bs-grid>\n <div bsRow class=\"mb-3\">\n <div [md]=\"12\">\n <!-- The same box as the sub-query card's header (#460 M15): debounce, clear button. -->\n <spark-search-box [(term)]=\"searchTerm\" />\n </div>\n <!-- Its own full-width row rather than a column beside the box: the count is\n occasional, and reserving 8 columns for it shrank the search permanently. The\n @if moved out of the column so nothing reserves vertical space when absent. -->\n @if (searchTerm() && resultCount() !== null) {\n <div [md]=\"12\" class=\"text-end mt-1\">\n <span class=\"text-muted\">\n {{ resultCount() }} {{ resultCount() === 1 ? ('common.resultFound' | t) : ('common.resultsFound' | t) }}\n </span>\n </div>\n }\n </div>\n </bs-grid>\n </div>\n\n <!--\n One grid, both transports. `data` is null for a normal query, so the grid fetches and pages\n server-side; for a streaming query this page owns the socket and hands the filtered snapshot\n in. This used to be two near-identical <bs-datatable> blocks with a shared row template.\n -->\n <spark-query-grid class=\"flex-grow-1\"\n [queryId]=\"qId\"\n [data]=\"gridData()\"\n [columns]=\"gridData() ? streamColumns() : null\"\n [search]=\"searchTerm()\"\n [deleted]=\"deletedMode()\"\n [reloadToken]=\"gridReloadToken()\"\n [rowRoute]=\"rowRoute()\"\n (rowClicked)=\"rowClicked.emit($event)\"\n (customActionExecuted)=\"customActionExecuted.emit($event)\" />\n } @else {\n <div class=\"text-center p-5\">\n <bs-spinner />\n </div>\n }\n</div>\n",
|
|
468
|
+
styles: [".spark-actionbar{--_bleed-block: var(--spark-content-inset-block, 0px);--_bleed-inline: var(--spark-content-inset-inline, 0px);--_gutter: var(--spark-actionbar-gutter, 1rem);position:sticky;top:calc(-1 * var(--_bleed-block));z-index:400;background-color:var(--bs-tertiary-bg);border-bottom:1px solid var(--bs-border-color);margin-bottom:1rem;margin-inline:calc(-1 * var(--_bleed-inline));padding-inline:calc(var(--_bleed-inline) + var(--_gutter))}.spark-actionbar .btn{border-radius:0}.spark-actionbar-wide{--spark-actionbar-gutter: 1.5rem}:host{display:flex;flex-direction:column;flex:1;min-height:0}:host.virtual-scrolling{margin:0 calc(-1 * var(--spark-main-padding, 1.5rem)) calc(-1 * var(--spark-main-padding, 1.5rem));--spark-content-inset-inline: 0px}:host.virtual-scrolling spark-query-grid{display:flex;flex-direction:column;min-height:0}:host.virtual-scrolling ::ng-deep bs-datatable{display:flex;flex-direction:column;min-height:0;--mp-datatable-virtual-max-height: 100%}:host.virtual-scrolling ::ng-deep bs-datatable mp-datatable{flex:1 1 auto;min-height:0}tr:hover{background-color:#0000000d}td input[type=checkbox]:disabled{opacity:1;pointer-events:none}.spark-live-badge{font-size:.6em}\n"]
|
|
469
|
+
}]
|
|
470
|
+
}],
|
|
471
|
+
ctorParameters: () => [],
|
|
472
|
+
propDecorators: {
|
|
473
|
+
extraActionsTemplate: [{
|
|
474
|
+
type: i0.Input,
|
|
475
|
+
args: [{
|
|
476
|
+
isSignal: true,
|
|
477
|
+
alias: "extraActionsTemplate",
|
|
478
|
+
required: false
|
|
479
|
+
}]
|
|
480
|
+
}],
|
|
481
|
+
showCustomActions: [{
|
|
482
|
+
type: i0.Input,
|
|
483
|
+
args: [{
|
|
484
|
+
isSignal: true,
|
|
485
|
+
alias: "showCustomActions",
|
|
486
|
+
required: false
|
|
487
|
+
}]
|
|
488
|
+
}],
|
|
489
|
+
rowRoute: [{
|
|
490
|
+
type: i0.Input,
|
|
491
|
+
args: [{
|
|
492
|
+
isSignal: true,
|
|
493
|
+
alias: "rowRoute",
|
|
494
|
+
required: false
|
|
495
|
+
}]
|
|
496
|
+
}],
|
|
497
|
+
rowClicked: [{
|
|
498
|
+
type: i0.Output,
|
|
499
|
+
args: ["rowClicked"]
|
|
500
|
+
}],
|
|
501
|
+
createClicked: [{
|
|
502
|
+
type: i0.Output,
|
|
503
|
+
args: ["createClicked"]
|
|
504
|
+
}],
|
|
505
|
+
customActionExecuted: [{
|
|
506
|
+
type: i0.Output,
|
|
507
|
+
args: ["customActionExecuted"]
|
|
508
|
+
}],
|
|
509
|
+
grid: [{
|
|
510
|
+
type: i0.ViewChild,
|
|
511
|
+
args: [i0.forwardRef(() => SparkQueryGridComponent), { isSignal: true }]
|
|
512
|
+
}]
|
|
513
|
+
}
|
|
514
|
+
});
|
|
303
515
|
export { SparkQueryListComponent };
|
|
304
|
-
|
|
516
|
+
|
|
517
|
+
//# sourceMappingURL=mintplayer-ng-spark-query-list.mjs.map
|