@mintplayer/ng-spark 22.23.0 → 22.25.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 +196 -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 +310 -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-contributions.mjs +721 -0
- package/fesm2022/mintplayer-ng-spark-contributions.mjs.map +1 -0
- package/fesm2022/mintplayer-ng-spark-grid.mjs +2385 -1118
- package/fesm2022/mintplayer-ng-spark-grid.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-spark-history.mjs +598 -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 +405 -762
- 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 +60 -0
- package/fesm2022/mintplayer-ng-spark-panels.mjs.map +1 -0
- package/fesm2022/mintplayer-ng-spark-pipes.mjs +1158 -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 +795 -410
- package/fesm2022/mintplayer-ng-spark-po-detail.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-spark-po-edit.mjs +1196 -280
- package/fesm2022/mintplayer-ng-spark-po-edit.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-spark-po-form.mjs +2244 -1224
- package/fesm2022/mintplayer-ng-spark-po-form.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-spark-query-list.mjs +571 -303
- package/fesm2022/mintplayer-ng-spark-query-list.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-spark-renderers.mjs +44 -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 +1031 -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 +14 -48
- package/fesm2022/mintplayer-ng-spark.mjs.map +1 -1
- package/package.json +23 -2
- package/types/mintplayer-ng-spark-attribute-description.d.ts +25 -18
- package/types/mintplayer-ng-spark-client-operations.d.ts +139 -160
- package/types/mintplayer-ng-spark-column-filter.d.ts +73 -55
- package/types/mintplayer-ng-spark-contributions.d.ts +231 -0
- package/types/mintplayer-ng-spark-grid.d.ts +917 -448
- package/types/mintplayer-ng-spark-history.d.ts +216 -0
- package/types/mintplayer-ng-spark-icon.d.ts +15 -13
- package/types/mintplayer-ng-spark-models.d.ts +681 -573
- package/types/mintplayer-ng-spark-moderation.d.ts +402 -0
- package/types/mintplayer-ng-spark-panels.d.ts +143 -0
- package/types/mintplayer-ng-spark-pipes.d.ts +131 -149
- package/types/mintplayer-ng-spark-po-create.d.ts +46 -37
- package/types/mintplayer-ng-spark-po-detail.d.ts +180 -117
- package/types/mintplayer-ng-spark-po-edit.d.ts +367 -64
- package/types/mintplayer-ng-spark-po-form.d.ts +558 -373
- package/types/mintplayer-ng-spark-query-list.d.ts +143 -82
- package/types/mintplayer-ng-spark-renderers.d.ts +121 -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 +228 -132
- package/types/mintplayer-ng-spark-soft-delete.d.ts +90 -0
- package/types/mintplayer-ng-spark.d.ts +19 -12
|
@@ -1,768 +1,1161 @@
|
|
|
1
|
-
import * as i0 from
|
|
2
|
-
import {
|
|
3
|
-
import { SparkLanguageService } from
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
class TranslateKeyPipe {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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
|
-
|
|
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
|
-
class
|
|
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
|
-
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { Pipe, inject } from "@angular/core";
|
|
3
|
+
import { SparkLanguageService } from "@mintplayer/ng-spark/services";
|
|
4
|
+
import { AS_DETAIL_BREADCRUMBS_KEY, ELookupDisplayType, isReservedAsDetailKey, nestedPoToDict, nestedPoToDisplayRow, resolveTranslation, resolvedBreadcrumb, selfBreadcrumb, valueFor } from "@mintplayer/ng-spark/models";
|
|
5
|
+
import { isRowRendered, resolveRowRenderer } from "@mintplayer/ng-spark/renderers";
|
|
6
|
+
var TranslateKeyPipe = class TranslateKeyPipe {
|
|
7
|
+
lang = inject(SparkLanguageService);
|
|
8
|
+
transform(key) {
|
|
9
|
+
return this.lang.t(key);
|
|
10
|
+
}
|
|
11
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
12
|
+
minVersion: "12.0.0",
|
|
13
|
+
version: "22.2.0",
|
|
14
|
+
ngImport: i0,
|
|
15
|
+
type: TranslateKeyPipe,
|
|
16
|
+
deps: [],
|
|
17
|
+
target: i0.ɵɵFactoryTarget.Pipe
|
|
18
|
+
});
|
|
19
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({
|
|
20
|
+
minVersion: "14.0.0",
|
|
21
|
+
version: "22.2.0",
|
|
22
|
+
ngImport: i0,
|
|
23
|
+
type: TranslateKeyPipe,
|
|
24
|
+
isStandalone: true,
|
|
25
|
+
name: "t",
|
|
26
|
+
pure: false
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
30
|
+
minVersion: "12.0.0",
|
|
31
|
+
version: "22.2.0",
|
|
32
|
+
ngImport: i0,
|
|
33
|
+
type: TranslateKeyPipe,
|
|
34
|
+
decorators: [{
|
|
35
|
+
type: Pipe,
|
|
36
|
+
args: [{
|
|
37
|
+
name: "t",
|
|
38
|
+
pure: false,
|
|
39
|
+
standalone: true
|
|
40
|
+
}]
|
|
41
|
+
}]
|
|
42
|
+
});
|
|
43
|
+
var ResolveTranslationPipe = class ResolveTranslationPipe {
|
|
44
|
+
transform(value, fallback) {
|
|
45
|
+
return resolveTranslation(value) || fallback || "";
|
|
46
|
+
}
|
|
47
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
48
|
+
minVersion: "12.0.0",
|
|
49
|
+
version: "22.2.0",
|
|
50
|
+
ngImport: i0,
|
|
51
|
+
type: ResolveTranslationPipe,
|
|
52
|
+
deps: [],
|
|
53
|
+
target: i0.ɵɵFactoryTarget.Pipe
|
|
54
|
+
});
|
|
55
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({
|
|
56
|
+
minVersion: "14.0.0",
|
|
57
|
+
version: "22.2.0",
|
|
58
|
+
ngImport: i0,
|
|
59
|
+
type: ResolveTranslationPipe,
|
|
60
|
+
isStandalone: true,
|
|
61
|
+
name: "resolveTranslation",
|
|
62
|
+
pure: false
|
|
63
|
+
});
|
|
64
|
+
};
|
|
65
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
66
|
+
minVersion: "12.0.0",
|
|
67
|
+
version: "22.2.0",
|
|
68
|
+
ngImport: i0,
|
|
69
|
+
type: ResolveTranslationPipe,
|
|
70
|
+
decorators: [{
|
|
71
|
+
type: Pipe,
|
|
72
|
+
args: [{
|
|
73
|
+
name: "resolveTranslation",
|
|
74
|
+
standalone: true,
|
|
75
|
+
pure: false
|
|
76
|
+
}]
|
|
77
|
+
}]
|
|
78
|
+
});
|
|
79
|
+
var InputTypePipe = class InputTypePipe {
|
|
80
|
+
transform(dataType) {
|
|
81
|
+
switch (dataType) {
|
|
82
|
+
case "number":
|
|
83
|
+
case "decimal": return "number";
|
|
84
|
+
case "boolean": return "checkbox";
|
|
85
|
+
case "datetime": return "datetime-local";
|
|
86
|
+
case "date": return "date";
|
|
87
|
+
case "color": return "color";
|
|
88
|
+
case "url":
|
|
89
|
+
case "image": return "url";
|
|
90
|
+
default: return "text";
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
94
|
+
minVersion: "12.0.0",
|
|
95
|
+
version: "22.2.0",
|
|
96
|
+
ngImport: i0,
|
|
97
|
+
type: InputTypePipe,
|
|
98
|
+
deps: [],
|
|
99
|
+
target: i0.ɵɵFactoryTarget.Pipe
|
|
100
|
+
});
|
|
101
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({
|
|
102
|
+
minVersion: "14.0.0",
|
|
103
|
+
version: "22.2.0",
|
|
104
|
+
ngImport: i0,
|
|
105
|
+
type: InputTypePipe,
|
|
106
|
+
isStandalone: true,
|
|
107
|
+
name: "inputType"
|
|
108
|
+
});
|
|
109
|
+
};
|
|
110
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
111
|
+
minVersion: "12.0.0",
|
|
112
|
+
version: "22.2.0",
|
|
113
|
+
ngImport: i0,
|
|
114
|
+
type: InputTypePipe,
|
|
115
|
+
decorators: [{
|
|
116
|
+
type: Pipe,
|
|
117
|
+
args: [{
|
|
118
|
+
name: "inputType",
|
|
119
|
+
standalone: true,
|
|
120
|
+
pure: true
|
|
121
|
+
}]
|
|
122
|
+
}]
|
|
123
|
+
});
|
|
124
|
+
var ParsedDatePipe = class ParsedDatePipe {
|
|
125
|
+
transform(value) {
|
|
126
|
+
if (value == null || value === "") return null;
|
|
127
|
+
if (value instanceof Date) return Number.isNaN(value.getTime()) ? null : value;
|
|
128
|
+
if (typeof value !== "string" && typeof value !== "number") return null;
|
|
129
|
+
const parsed = new Date(value);
|
|
130
|
+
return Number.isNaN(parsed.getTime()) ? null : parsed;
|
|
131
|
+
}
|
|
132
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
133
|
+
minVersion: "12.0.0",
|
|
134
|
+
version: "22.2.0",
|
|
135
|
+
ngImport: i0,
|
|
136
|
+
type: ParsedDatePipe,
|
|
137
|
+
deps: [],
|
|
138
|
+
target: i0.ɵɵFactoryTarget.Pipe
|
|
139
|
+
});
|
|
140
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({
|
|
141
|
+
minVersion: "14.0.0",
|
|
142
|
+
version: "22.2.0",
|
|
143
|
+
ngImport: i0,
|
|
144
|
+
type: ParsedDatePipe,
|
|
145
|
+
isStandalone: true,
|
|
146
|
+
name: "parsedDate"
|
|
147
|
+
});
|
|
148
|
+
};
|
|
149
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
150
|
+
minVersion: "12.0.0",
|
|
151
|
+
version: "22.2.0",
|
|
152
|
+
ngImport: i0,
|
|
153
|
+
type: ParsedDatePipe,
|
|
154
|
+
decorators: [{
|
|
155
|
+
type: Pipe,
|
|
156
|
+
args: [{
|
|
157
|
+
name: "parsedDate",
|
|
158
|
+
standalone: true,
|
|
159
|
+
pure: true
|
|
160
|
+
}]
|
|
161
|
+
}]
|
|
162
|
+
});
|
|
105
163
|
function applyFieldTemplate(template, data) {
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
class AttributeValuePipe {
|
|
113
|
-
transform(attrName, item, entityType, lookupRefOptions, allEntityTypes) {
|
|
114
|
-
if (!item)
|
|
115
|
-
return '';
|
|
116
|
-
const attr = item.attributes.find(a => a.name === attrName);
|
|
117
|
-
if (!attr)
|
|
118
|
-
return '';
|
|
119
|
-
if (attr.breadcrumb)
|
|
120
|
-
return attr.breadcrumb;
|
|
121
|
-
const attrDef = entityType?.attributes.find(a => a.name === attrName);
|
|
122
|
-
if (attrDef?.dataType === 'AsDetail') {
|
|
123
|
-
// Server emits nested PO(s) in attr.objects (array) / attr.object (single) — attr.value is null.
|
|
124
|
-
if (attr.isArray) {
|
|
125
|
-
const count = attr.objects?.length ?? 0;
|
|
126
|
-
if (count === 0)
|
|
127
|
-
return '';
|
|
128
|
-
return `${count} item${count !== 1 ? 's' : ''}`;
|
|
129
|
-
}
|
|
130
|
-
if (attr.object) {
|
|
131
|
-
// The server has already resolved this object's breadcrumb, and it can resolve templates
|
|
132
|
-
// this side cannot. A type's breadcrumb may name a computed property that `[IgnoreProperty]`
|
|
133
|
-
// keeps out of the model — HR's `Address.Crumb` is exactly that, `[Breadcrumb, IgnoreProperty]`
|
|
134
|
-
// — so the template `{Crumb}` has no matching attribute here and never will. Recomputing it
|
|
135
|
-
// client-side produced an empty string and fell through to "(object)" while the correct
|
|
136
|
-
// "Voorbeeldstraat 1, 1000 Brussel" sat unread on `attr.object.breadcrumb`.
|
|
137
|
-
//
|
|
138
|
-
// One value on that property is NOT a breadcrumb: when the template renders blank the
|
|
139
|
-
// server substitutes the CLR type name, and printing it reads as data — a `Build` whose
|
|
140
|
-
// `Feedback.State` was unset showed the literal "BuildFeedback" (#384). Filtering it here
|
|
141
|
-
// lets the fallbacks below run, which is what they are for.
|
|
142
|
-
const resolved = resolvedBreadcrumb(attr.object.breadcrumb, attrDef.asDetailType);
|
|
143
|
-
if (resolved)
|
|
144
|
-
return resolved;
|
|
145
|
-
return this.formatAsDetailValue(attrDef, nestedPoToDict(attr.object), allEntityTypes);
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
if (attrDef?.lookupReferenceType && attr.value != null && attr.value !== '') {
|
|
149
|
-
const lookupRef = lookupRefOptions[attrDef.lookupReferenceType];
|
|
150
|
-
if (lookupRef) {
|
|
151
|
-
const option = lookupRef.values.find(v => v.key === String(attr.value));
|
|
152
|
-
if (option) {
|
|
153
|
-
return resolveTranslation(option.values) || option.key;
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
if (attrDef?.dataType === 'boolean') {
|
|
158
|
-
return attr.value ?? null;
|
|
159
|
-
}
|
|
160
|
-
return attr.value ?? '';
|
|
161
|
-
}
|
|
162
|
-
formatAsDetailValue(attrDef, value, allEntityTypes) {
|
|
163
|
-
const asDetailType = allEntityTypes.find(t => t.clrType === attrDef.asDetailType);
|
|
164
|
-
if (asDetailType?.breadcrumb) {
|
|
165
|
-
const result = applyFieldTemplate(asDetailType.breadcrumb, value);
|
|
166
|
-
if (result && result.trim())
|
|
167
|
-
return result;
|
|
168
|
-
}
|
|
169
|
-
// Last resort, reached when the type declares no breadcrumb or its template resolved to
|
|
170
|
-
// nothing. Joining the scalar values is always more use to a reader than "(object)", which
|
|
171
|
-
// named the failure rather than the row and looked identical for every unresolvable cell.
|
|
172
|
-
// Reserved keys are skipped: `nestedPoToDict` stashes the row key and the row's own breadcrumb
|
|
173
|
-
// in this same dict, and joining those prints a guid and a placeholder as though they were
|
|
174
|
-
// fields. Previously masked -- this branch was only reachable when the server sent no
|
|
175
|
-
// breadcrumb, which is exactly when there was nothing stashed to leak.
|
|
176
|
-
return Object.entries(value)
|
|
177
|
-
.filter(([k, v]) => !isReservedAsDetailKey(k) && v != null && typeof v !== 'object' && String(v).trim() !== '')
|
|
178
|
-
.map(([, v]) => v)
|
|
179
|
-
.join(', ');
|
|
180
|
-
}
|
|
181
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: AttributeValuePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
182
|
-
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "22.1.3", ngImport: i0, type: AttributeValuePipe, isStandalone: true, name: "attributeValue" });
|
|
183
|
-
}
|
|
184
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: AttributeValuePipe, decorators: [{
|
|
185
|
-
type: Pipe,
|
|
186
|
-
args: [{ name: 'attributeValue', standalone: true, pure: true }]
|
|
187
|
-
}] });
|
|
188
|
-
|
|
189
|
-
class RawAttributeValuePipe {
|
|
190
|
-
transform(attrName, item) {
|
|
191
|
-
return item?.attributes.find(a => a.name === attrName)?.value;
|
|
192
|
-
}
|
|
193
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: RawAttributeValuePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
194
|
-
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "22.1.3", ngImport: i0, type: RawAttributeValuePipe, isStandalone: true, name: "rawAttributeValue" });
|
|
195
|
-
}
|
|
196
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: RawAttributeValuePipe, decorators: [{
|
|
197
|
-
type: Pipe,
|
|
198
|
-
args: [{ name: 'rawAttributeValue', standalone: true, pure: true }]
|
|
199
|
-
}] });
|
|
200
|
-
|
|
201
|
-
class ReferenceDisplayValuePipe {
|
|
202
|
-
lang = inject(SparkLanguageService);
|
|
203
|
-
transform(attr, formData, referenceOptions) {
|
|
204
|
-
const selectedId = formData[attr.name];
|
|
205
|
-
if (!selectedId)
|
|
206
|
-
return this.lang.t('notSelected');
|
|
207
|
-
const options = referenceOptions[attr.name] || [];
|
|
208
|
-
const selected = options.find(o => o.id === selectedId);
|
|
209
|
-
// The server resolves a row's display string into `breadcrumb`; falling back to the id
|
|
210
|
-
// beats showing nothing, and there is no third source now that a row carries no `name`.
|
|
211
|
-
return selected?.breadcrumb || selectedId;
|
|
212
|
-
}
|
|
213
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ReferenceDisplayValuePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
214
|
-
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "22.1.3", ngImport: i0, type: ReferenceDisplayValuePipe, isStandalone: true, name: "referenceDisplayValue" });
|
|
215
|
-
}
|
|
216
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ReferenceDisplayValuePipe, decorators: [{
|
|
217
|
-
type: Pipe,
|
|
218
|
-
args: [{ name: 'referenceDisplayValue', standalone: true, pure: true }]
|
|
219
|
-
}] });
|
|
220
|
-
|
|
221
|
-
/**
|
|
222
|
-
* The text a reference picker's result grid shows in one column.
|
|
223
|
-
*
|
|
224
|
-
* ⚠️ **Reads the row through {@link valueFor}, not through a shape it assumes.** This used to do
|
|
225
|
-
* `item.attributes.find(...)`, which is the `PersistentObject` shape — but a picker's rows are
|
|
226
|
-
* `QueryResultItem`s, which carry `values` (`[{ key, value, breadcrumb }]`) and have no `attributes`
|
|
227
|
-
* at all. Every cell therefore threw `can't access property "find", item.attributes is undefined`,
|
|
228
|
-
* and the picker rendered nothing selectable.
|
|
229
|
-
*
|
|
230
|
-
* There are three row shapes in this codebase and `valueFor` exists precisely so a consumer does not
|
|
231
|
-
* have to know which one it was handed. Using it is also what keeps this working if a picker is ever
|
|
232
|
-
* pointed at an AsDetail sub-table, whose rows are the flat record shape.
|
|
233
|
-
*/
|
|
234
|
-
class ReferenceAttrValuePipe {
|
|
235
|
-
transform(item, attrName) {
|
|
236
|
-
const cell = valueFor(item, attrName);
|
|
237
|
-
if (!cell)
|
|
238
|
-
return '';
|
|
239
|
-
// Breadcrumb first: a reference cell's value is an id, and the id is not what a person reads.
|
|
240
|
-
if (cell.breadcrumb)
|
|
241
|
-
return cell.breadcrumb;
|
|
242
|
-
return cell.value ?? '';
|
|
243
|
-
}
|
|
244
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ReferenceAttrValuePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
245
|
-
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "22.1.3", ngImport: i0, type: ReferenceAttrValuePipe, isStandalone: true, name: "referenceAttrValue" });
|
|
246
|
-
}
|
|
247
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ReferenceAttrValuePipe, decorators: [{
|
|
248
|
-
type: Pipe,
|
|
249
|
-
args: [{ name: 'referenceAttrValue', standalone: true, pure: true }]
|
|
250
|
-
}] });
|
|
251
|
-
|
|
252
|
-
class ReferenceLinkRoutePipe {
|
|
253
|
-
transform(referenceClrType, referenceId, allEntityTypes) {
|
|
254
|
-
if (!referenceId || !referenceClrType)
|
|
255
|
-
return null;
|
|
256
|
-
const targetType = allEntityTypes.find(t => t.clrType === referenceClrType);
|
|
257
|
-
if (!targetType)
|
|
258
|
-
return null;
|
|
259
|
-
// Presence in the catalogue means the caller may LIST this type; opening one is a different
|
|
260
|
-
// right. Without this a type granted Query but not Read rendered a clickable reference whose
|
|
261
|
-
// click refused on arrival — while the grid's own first column, three components away, gated on
|
|
262
|
-
// canRead and got it right. Same question, two answers.
|
|
263
|
-
if (targetType.canRead === false)
|
|
264
|
-
return null;
|
|
265
|
-
return ['/po', targetType.alias || targetType.id, referenceId];
|
|
266
|
-
}
|
|
267
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ReferenceLinkRoutePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
268
|
-
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "22.1.3", ngImport: i0, type: ReferenceLinkRoutePipe, isStandalone: true, name: "referenceLinkRoute" });
|
|
269
|
-
}
|
|
270
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ReferenceLinkRoutePipe, decorators: [{
|
|
271
|
-
type: Pipe,
|
|
272
|
-
args: [{ name: 'referenceLinkRoute', standalone: true, pure: true }]
|
|
273
|
-
}] });
|
|
274
|
-
|
|
275
|
-
/**
|
|
276
|
-
* Resolves a multi-reference attribute (`dataType === 'Reference'`, `isArray === true`)
|
|
277
|
-
* to a list of chips. The attribute's `value` carries the id array; `breadcrumbs` (a
|
|
278
|
-
* server-resolved id → label map) provides each chip's display label, falling back to
|
|
279
|
-
* the id when no breadcrumb is present. Mirrors the single-reference `breadcrumb`
|
|
280
|
-
* display, applied per id.
|
|
281
|
-
*/
|
|
282
|
-
class ReferenceChipsPipe {
|
|
283
|
-
transform(attrName, item) {
|
|
284
|
-
const attr = item?.attributes.find(a => a.name === attrName);
|
|
285
|
-
if (!attr || !Array.isArray(attr.value))
|
|
286
|
-
return [];
|
|
287
|
-
const breadcrumbs = attr.breadcrumbs ?? {};
|
|
288
|
-
return attr.value
|
|
289
|
-
.filter(v => v != null && v !== '')
|
|
290
|
-
.map(v => {
|
|
291
|
-
const id = String(v);
|
|
292
|
-
return { id, label: breadcrumbs[id] || id };
|
|
293
|
-
});
|
|
294
|
-
}
|
|
295
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.3", ngImport: i0, type: ReferenceChipsPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
296
|
-
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "22.1.3", ngImport: i0, type: ReferenceChipsPipe, isStandalone: true, name: "referenceChips" });
|
|
164
|
+
return template.replace(/\{(\w+)\}/g, (_match, propertyName) => {
|
|
165
|
+
const value = data[propertyName];
|
|
166
|
+
return value != null ? String(value) : "";
|
|
167
|
+
});
|
|
297
168
|
}
|
|
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
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
}
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
}
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
}
|
|
666
|
-
i0.ɵɵngDeclareClassMetadata({
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
}
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
169
|
+
var AttributeValuePipe = class AttributeValuePipe {
|
|
170
|
+
transform(attrName, item, entityType, lookupRefOptions, allEntityTypes) {
|
|
171
|
+
if (!item) return "";
|
|
172
|
+
const attr = item.attributes.find((a) => a.name === attrName);
|
|
173
|
+
if (!attr) return "";
|
|
174
|
+
if (attr.breadcrumb) return attr.breadcrumb;
|
|
175
|
+
const attrDef = entityType?.attributes.find((a) => a.name === attrName);
|
|
176
|
+
if (attrDef?.dataType === "AsDetail") {
|
|
177
|
+
if (attr.isArray) {
|
|
178
|
+
const count = attr.objects?.length ?? 0;
|
|
179
|
+
if (count === 0) return "";
|
|
180
|
+
return `${count} item${count !== 1 ? "s" : ""}`;
|
|
181
|
+
}
|
|
182
|
+
if (attr.object) {
|
|
183
|
+
const resolved = resolvedBreadcrumb(attr.object.breadcrumb, attrDef.asDetailType);
|
|
184
|
+
if (resolved) return resolved;
|
|
185
|
+
return this.formatAsDetailValue(attrDef, nestedPoToDict(attr.object), allEntityTypes);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
if (attrDef?.lookupReferenceType && attr.value != null && attr.value !== "") {
|
|
189
|
+
const lookupRef = lookupRefOptions[attrDef.lookupReferenceType];
|
|
190
|
+
if (lookupRef) {
|
|
191
|
+
const option = lookupRef.values.find((v) => v.key === String(attr.value));
|
|
192
|
+
if (option) return resolveTranslation(option.values) || option.key;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
if (attrDef?.dataType === "boolean") return attr.value ?? null;
|
|
196
|
+
return attr.value ?? "";
|
|
197
|
+
}
|
|
198
|
+
formatAsDetailValue(attrDef, value, allEntityTypes) {
|
|
199
|
+
const asDetailType = allEntityTypes.find((t) => t.clrType === attrDef.asDetailType);
|
|
200
|
+
if (asDetailType?.breadcrumb) {
|
|
201
|
+
const result = applyFieldTemplate(asDetailType.breadcrumb, value);
|
|
202
|
+
if (result && result.trim()) return result;
|
|
203
|
+
}
|
|
204
|
+
return Object.entries(value).filter(([k, v]) => !isReservedAsDetailKey(k) && v != null && typeof v !== "object" && String(v).trim() !== "").map(([, v]) => v).join(", ");
|
|
205
|
+
}
|
|
206
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
207
|
+
minVersion: "12.0.0",
|
|
208
|
+
version: "22.2.0",
|
|
209
|
+
ngImport: i0,
|
|
210
|
+
type: AttributeValuePipe,
|
|
211
|
+
deps: [],
|
|
212
|
+
target: i0.ɵɵFactoryTarget.Pipe
|
|
213
|
+
});
|
|
214
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({
|
|
215
|
+
minVersion: "14.0.0",
|
|
216
|
+
version: "22.2.0",
|
|
217
|
+
ngImport: i0,
|
|
218
|
+
type: AttributeValuePipe,
|
|
219
|
+
isStandalone: true,
|
|
220
|
+
name: "attributeValue"
|
|
221
|
+
});
|
|
222
|
+
};
|
|
223
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
224
|
+
minVersion: "12.0.0",
|
|
225
|
+
version: "22.2.0",
|
|
226
|
+
ngImport: i0,
|
|
227
|
+
type: AttributeValuePipe,
|
|
228
|
+
decorators: [{
|
|
229
|
+
type: Pipe,
|
|
230
|
+
args: [{
|
|
231
|
+
name: "attributeValue",
|
|
232
|
+
standalone: true,
|
|
233
|
+
pure: true
|
|
234
|
+
}]
|
|
235
|
+
}]
|
|
236
|
+
});
|
|
237
|
+
var RawAttributeValuePipe = class RawAttributeValuePipe {
|
|
238
|
+
transform(attrName, item) {
|
|
239
|
+
return item?.attributes.find((a) => a.name === attrName)?.value;
|
|
240
|
+
}
|
|
241
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
242
|
+
minVersion: "12.0.0",
|
|
243
|
+
version: "22.2.0",
|
|
244
|
+
ngImport: i0,
|
|
245
|
+
type: RawAttributeValuePipe,
|
|
246
|
+
deps: [],
|
|
247
|
+
target: i0.ɵɵFactoryTarget.Pipe
|
|
248
|
+
});
|
|
249
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({
|
|
250
|
+
minVersion: "14.0.0",
|
|
251
|
+
version: "22.2.0",
|
|
252
|
+
ngImport: i0,
|
|
253
|
+
type: RawAttributeValuePipe,
|
|
254
|
+
isStandalone: true,
|
|
255
|
+
name: "rawAttributeValue"
|
|
256
|
+
});
|
|
257
|
+
};
|
|
258
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
259
|
+
minVersion: "12.0.0",
|
|
260
|
+
version: "22.2.0",
|
|
261
|
+
ngImport: i0,
|
|
262
|
+
type: RawAttributeValuePipe,
|
|
263
|
+
decorators: [{
|
|
264
|
+
type: Pipe,
|
|
265
|
+
args: [{
|
|
266
|
+
name: "rawAttributeValue",
|
|
267
|
+
standalone: true,
|
|
268
|
+
pure: true
|
|
269
|
+
}]
|
|
270
|
+
}]
|
|
271
|
+
});
|
|
272
|
+
var ReferenceDisplayValuePipe = class ReferenceDisplayValuePipe {
|
|
273
|
+
lang = inject(SparkLanguageService);
|
|
274
|
+
transform(attr, formData, referenceOptions) {
|
|
275
|
+
const selectedId = formData[attr.name];
|
|
276
|
+
if (!selectedId) return this.lang.t("common.notSelected");
|
|
277
|
+
return (referenceOptions[attr.name] || []).find((o) => o.id === selectedId)?.breadcrumb || selectedId;
|
|
278
|
+
}
|
|
279
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
280
|
+
minVersion: "12.0.0",
|
|
281
|
+
version: "22.2.0",
|
|
282
|
+
ngImport: i0,
|
|
283
|
+
type: ReferenceDisplayValuePipe,
|
|
284
|
+
deps: [],
|
|
285
|
+
target: i0.ɵɵFactoryTarget.Pipe
|
|
286
|
+
});
|
|
287
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({
|
|
288
|
+
minVersion: "14.0.0",
|
|
289
|
+
version: "22.2.0",
|
|
290
|
+
ngImport: i0,
|
|
291
|
+
type: ReferenceDisplayValuePipe,
|
|
292
|
+
isStandalone: true,
|
|
293
|
+
name: "referenceDisplayValue"
|
|
294
|
+
});
|
|
295
|
+
};
|
|
296
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
297
|
+
minVersion: "12.0.0",
|
|
298
|
+
version: "22.2.0",
|
|
299
|
+
ngImport: i0,
|
|
300
|
+
type: ReferenceDisplayValuePipe,
|
|
301
|
+
decorators: [{
|
|
302
|
+
type: Pipe,
|
|
303
|
+
args: [{
|
|
304
|
+
name: "referenceDisplayValue",
|
|
305
|
+
standalone: true,
|
|
306
|
+
pure: true
|
|
307
|
+
}]
|
|
308
|
+
}]
|
|
309
|
+
});
|
|
310
|
+
var ReferenceAttrValuePipe = class ReferenceAttrValuePipe {
|
|
311
|
+
transform(item, attrName) {
|
|
312
|
+
const cell = valueFor(item, attrName);
|
|
313
|
+
if (!cell) return "";
|
|
314
|
+
if (cell.breadcrumb) return cell.breadcrumb;
|
|
315
|
+
return cell.value ?? "";
|
|
316
|
+
}
|
|
317
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
318
|
+
minVersion: "12.0.0",
|
|
319
|
+
version: "22.2.0",
|
|
320
|
+
ngImport: i0,
|
|
321
|
+
type: ReferenceAttrValuePipe,
|
|
322
|
+
deps: [],
|
|
323
|
+
target: i0.ɵɵFactoryTarget.Pipe
|
|
324
|
+
});
|
|
325
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({
|
|
326
|
+
minVersion: "14.0.0",
|
|
327
|
+
version: "22.2.0",
|
|
328
|
+
ngImport: i0,
|
|
329
|
+
type: ReferenceAttrValuePipe,
|
|
330
|
+
isStandalone: true,
|
|
331
|
+
name: "referenceAttrValue"
|
|
332
|
+
});
|
|
333
|
+
};
|
|
334
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
335
|
+
minVersion: "12.0.0",
|
|
336
|
+
version: "22.2.0",
|
|
337
|
+
ngImport: i0,
|
|
338
|
+
type: ReferenceAttrValuePipe,
|
|
339
|
+
decorators: [{
|
|
340
|
+
type: Pipe,
|
|
341
|
+
args: [{
|
|
342
|
+
name: "referenceAttrValue",
|
|
343
|
+
standalone: true,
|
|
344
|
+
pure: true
|
|
345
|
+
}]
|
|
346
|
+
}]
|
|
347
|
+
});
|
|
348
|
+
var ReferenceLinkRoutePipe = class ReferenceLinkRoutePipe {
|
|
349
|
+
transform(referenceClrType, referenceId, allEntityTypes) {
|
|
350
|
+
if (!referenceId || !referenceClrType) return null;
|
|
351
|
+
const targetType = allEntityTypes.find((t) => t.clrType === referenceClrType);
|
|
352
|
+
if (!targetType) return null;
|
|
353
|
+
if (targetType.canRead === false) return null;
|
|
354
|
+
return [
|
|
355
|
+
"/po",
|
|
356
|
+
targetType.alias || targetType.id,
|
|
357
|
+
referenceId
|
|
358
|
+
];
|
|
359
|
+
}
|
|
360
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
361
|
+
minVersion: "12.0.0",
|
|
362
|
+
version: "22.2.0",
|
|
363
|
+
ngImport: i0,
|
|
364
|
+
type: ReferenceLinkRoutePipe,
|
|
365
|
+
deps: [],
|
|
366
|
+
target: i0.ɵɵFactoryTarget.Pipe
|
|
367
|
+
});
|
|
368
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({
|
|
369
|
+
minVersion: "14.0.0",
|
|
370
|
+
version: "22.2.0",
|
|
371
|
+
ngImport: i0,
|
|
372
|
+
type: ReferenceLinkRoutePipe,
|
|
373
|
+
isStandalone: true,
|
|
374
|
+
name: "referenceLinkRoute"
|
|
375
|
+
});
|
|
376
|
+
};
|
|
377
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
378
|
+
minVersion: "12.0.0",
|
|
379
|
+
version: "22.2.0",
|
|
380
|
+
ngImport: i0,
|
|
381
|
+
type: ReferenceLinkRoutePipe,
|
|
382
|
+
decorators: [{
|
|
383
|
+
type: Pipe,
|
|
384
|
+
args: [{
|
|
385
|
+
name: "referenceLinkRoute",
|
|
386
|
+
standalone: true,
|
|
387
|
+
pure: true
|
|
388
|
+
}]
|
|
389
|
+
}]
|
|
390
|
+
});
|
|
391
|
+
var ReferenceChipsPipe = class ReferenceChipsPipe {
|
|
392
|
+
transform(attrName, item) {
|
|
393
|
+
const attr = item?.attributes.find((a) => a.name === attrName);
|
|
394
|
+
if (!attr || !Array.isArray(attr.value)) return [];
|
|
395
|
+
const breadcrumbs = attr.breadcrumbs ?? {};
|
|
396
|
+
return attr.value.filter((v) => v != null && v !== "").map((v) => {
|
|
397
|
+
const id = String(v);
|
|
398
|
+
return {
|
|
399
|
+
id,
|
|
400
|
+
label: breadcrumbs[id] || id
|
|
401
|
+
};
|
|
402
|
+
});
|
|
403
|
+
}
|
|
404
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
405
|
+
minVersion: "12.0.0",
|
|
406
|
+
version: "22.2.0",
|
|
407
|
+
ngImport: i0,
|
|
408
|
+
type: ReferenceChipsPipe,
|
|
409
|
+
deps: [],
|
|
410
|
+
target: i0.ɵɵFactoryTarget.Pipe
|
|
411
|
+
});
|
|
412
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({
|
|
413
|
+
minVersion: "14.0.0",
|
|
414
|
+
version: "22.2.0",
|
|
415
|
+
ngImport: i0,
|
|
416
|
+
type: ReferenceChipsPipe,
|
|
417
|
+
isStandalone: true,
|
|
418
|
+
name: "referenceChips"
|
|
419
|
+
});
|
|
420
|
+
};
|
|
421
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
422
|
+
minVersion: "12.0.0",
|
|
423
|
+
version: "22.2.0",
|
|
424
|
+
ngImport: i0,
|
|
425
|
+
type: ReferenceChipsPipe,
|
|
426
|
+
decorators: [{
|
|
427
|
+
type: Pipe,
|
|
428
|
+
args: [{
|
|
429
|
+
name: "referenceChips",
|
|
430
|
+
standalone: true,
|
|
431
|
+
pure: true
|
|
432
|
+
}]
|
|
433
|
+
}]
|
|
434
|
+
});
|
|
435
|
+
var RouterLinkPipe = class RouterLinkPipe {
|
|
436
|
+
transform(unit) {
|
|
437
|
+
if (unit.type === "query") return ["/query", unit.alias || unit.queryId];
|
|
438
|
+
else if (unit.type === "persistentObject") {
|
|
439
|
+
const type = unit.alias || unit.persistentObjectId;
|
|
440
|
+
return unit.objectId ? [
|
|
441
|
+
"/po",
|
|
442
|
+
type,
|
|
443
|
+
unit.objectId
|
|
444
|
+
] : ["/po", type];
|
|
445
|
+
} else if (unit.type === "url") return null;
|
|
446
|
+
return ["/"];
|
|
447
|
+
}
|
|
448
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
449
|
+
minVersion: "12.0.0",
|
|
450
|
+
version: "22.2.0",
|
|
451
|
+
ngImport: i0,
|
|
452
|
+
type: RouterLinkPipe,
|
|
453
|
+
deps: [],
|
|
454
|
+
target: i0.ɵɵFactoryTarget.Pipe
|
|
455
|
+
});
|
|
456
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({
|
|
457
|
+
minVersion: "14.0.0",
|
|
458
|
+
version: "22.2.0",
|
|
459
|
+
ngImport: i0,
|
|
460
|
+
type: RouterLinkPipe,
|
|
461
|
+
isStandalone: true,
|
|
462
|
+
name: "routerLink"
|
|
463
|
+
});
|
|
464
|
+
};
|
|
465
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
466
|
+
minVersion: "12.0.0",
|
|
467
|
+
version: "22.2.0",
|
|
468
|
+
ngImport: i0,
|
|
469
|
+
type: RouterLinkPipe,
|
|
470
|
+
decorators: [{
|
|
471
|
+
type: Pipe,
|
|
472
|
+
args: [{
|
|
473
|
+
name: "routerLink",
|
|
474
|
+
standalone: true,
|
|
475
|
+
pure: true
|
|
476
|
+
}]
|
|
477
|
+
}]
|
|
478
|
+
});
|
|
479
|
+
var AsDetailTypePipe = class AsDetailTypePipe {
|
|
480
|
+
transform(attr, asDetailTypes) {
|
|
481
|
+
return asDetailTypes[attr.name] || null;
|
|
482
|
+
}
|
|
483
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
484
|
+
minVersion: "12.0.0",
|
|
485
|
+
version: "22.2.0",
|
|
486
|
+
ngImport: i0,
|
|
487
|
+
type: AsDetailTypePipe,
|
|
488
|
+
deps: [],
|
|
489
|
+
target: i0.ɵɵFactoryTarget.Pipe
|
|
490
|
+
});
|
|
491
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({
|
|
492
|
+
minVersion: "14.0.0",
|
|
493
|
+
version: "22.2.0",
|
|
494
|
+
ngImport: i0,
|
|
495
|
+
type: AsDetailTypePipe,
|
|
496
|
+
isStandalone: true,
|
|
497
|
+
name: "asDetailType"
|
|
498
|
+
});
|
|
499
|
+
};
|
|
500
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
501
|
+
minVersion: "12.0.0",
|
|
502
|
+
version: "22.2.0",
|
|
503
|
+
ngImport: i0,
|
|
504
|
+
type: AsDetailTypePipe,
|
|
505
|
+
decorators: [{
|
|
506
|
+
type: Pipe,
|
|
507
|
+
args: [{
|
|
508
|
+
name: "asDetailType",
|
|
509
|
+
standalone: true,
|
|
510
|
+
pure: true
|
|
511
|
+
}]
|
|
512
|
+
}]
|
|
513
|
+
});
|
|
514
|
+
var AsDetailColumnsPipe = class AsDetailColumnsPipe {
|
|
515
|
+
transform(attr, asDetailTypes, renderers) {
|
|
516
|
+
const type = asDetailTypes[attr.name];
|
|
517
|
+
if (!type) return [];
|
|
518
|
+
return type.attributes.filter((a) => a.isVisible && !isRowRendered(a, renderers)).sort((a, b) => a.order - b.order);
|
|
519
|
+
}
|
|
520
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
521
|
+
minVersion: "12.0.0",
|
|
522
|
+
version: "22.2.0",
|
|
523
|
+
ngImport: i0,
|
|
524
|
+
type: AsDetailColumnsPipe,
|
|
525
|
+
deps: [],
|
|
526
|
+
target: i0.ɵɵFactoryTarget.Pipe
|
|
527
|
+
});
|
|
528
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({
|
|
529
|
+
minVersion: "14.0.0",
|
|
530
|
+
version: "22.2.0",
|
|
531
|
+
ngImport: i0,
|
|
532
|
+
type: AsDetailColumnsPipe,
|
|
533
|
+
isStandalone: true,
|
|
534
|
+
name: "asDetailColumns"
|
|
535
|
+
});
|
|
536
|
+
};
|
|
537
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
538
|
+
minVersion: "12.0.0",
|
|
539
|
+
version: "22.2.0",
|
|
540
|
+
ngImport: i0,
|
|
541
|
+
type: AsDetailColumnsPipe,
|
|
542
|
+
decorators: [{
|
|
543
|
+
type: Pipe,
|
|
544
|
+
args: [{
|
|
545
|
+
name: "asDetailColumns",
|
|
546
|
+
standalone: true,
|
|
547
|
+
pure: true
|
|
548
|
+
}]
|
|
549
|
+
}]
|
|
550
|
+
});
|
|
551
|
+
var AsDetailRowRendererPipe = class AsDetailRowRendererPipe {
|
|
552
|
+
transform(attr, asDetailTypes, renderers) {
|
|
553
|
+
return resolveRowRenderer(asDetailTypes[attr.name], renderers);
|
|
554
|
+
}
|
|
555
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
556
|
+
minVersion: "12.0.0",
|
|
557
|
+
version: "22.2.0",
|
|
558
|
+
ngImport: i0,
|
|
559
|
+
type: AsDetailRowRendererPipe,
|
|
560
|
+
deps: [],
|
|
561
|
+
target: i0.ɵɵFactoryTarget.Pipe
|
|
562
|
+
});
|
|
563
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({
|
|
564
|
+
minVersion: "14.0.0",
|
|
565
|
+
version: "22.2.0",
|
|
566
|
+
ngImport: i0,
|
|
567
|
+
type: AsDetailRowRendererPipe,
|
|
568
|
+
isStandalone: true,
|
|
569
|
+
name: "asDetailRowRenderer"
|
|
570
|
+
});
|
|
571
|
+
};
|
|
572
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
573
|
+
minVersion: "12.0.0",
|
|
574
|
+
version: "22.2.0",
|
|
575
|
+
ngImport: i0,
|
|
576
|
+
type: AsDetailRowRendererPipe,
|
|
577
|
+
decorators: [{
|
|
578
|
+
type: Pipe,
|
|
579
|
+
args: [{
|
|
580
|
+
name: "asDetailRowRenderer",
|
|
581
|
+
standalone: true,
|
|
582
|
+
pure: true
|
|
583
|
+
}]
|
|
584
|
+
}]
|
|
585
|
+
});
|
|
586
|
+
var AsDetailCellValuePipe = class AsDetailCellValuePipe {
|
|
587
|
+
transform(row, parentAttr, col, asDetailRefOptions) {
|
|
588
|
+
const value = row[col.name];
|
|
589
|
+
switch (col.dataType) {
|
|
590
|
+
case "boolean": return typeof value === "boolean" ? value : null;
|
|
591
|
+
case "number":
|
|
592
|
+
case "decimal": {
|
|
593
|
+
if (value == null || value === "") return null;
|
|
594
|
+
const asNumber = typeof value === "number" ? value : Number(value);
|
|
595
|
+
return Number.isNaN(asNumber) ? String(value) : asNumber;
|
|
596
|
+
}
|
|
597
|
+
case "date":
|
|
598
|
+
case "datetime": {
|
|
599
|
+
if (value == null || value === "") return null;
|
|
600
|
+
if (value instanceof Date) return Number.isNaN(value.getTime()) ? null : value;
|
|
601
|
+
const parsed = new Date(value);
|
|
602
|
+
return Number.isNaN(parsed.getTime()) ? String(value) : parsed;
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
if (value == null) return "";
|
|
606
|
+
if (col.dataType === "Reference" && col.query) {
|
|
607
|
+
const serverBreadcrumb = row[AS_DETAIL_BREADCRUMBS_KEY]?.[col.name];
|
|
608
|
+
if (serverBreadcrumb) return serverBreadcrumb;
|
|
609
|
+
const parentOptions = asDetailRefOptions[parentAttr.name];
|
|
610
|
+
if (parentOptions) {
|
|
611
|
+
const options = parentOptions[col.name];
|
|
612
|
+
if (options) {
|
|
613
|
+
const match = options.find((o) => o.id === value);
|
|
614
|
+
if (match) return match.breadcrumb || String(value);
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
}
|
|
618
|
+
if (col.dataType === "AsDetail" && typeof value === "object") return selfBreadcrumb(value, col.asDetailType) ?? "";
|
|
619
|
+
return String(value);
|
|
620
|
+
}
|
|
621
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
622
|
+
minVersion: "12.0.0",
|
|
623
|
+
version: "22.2.0",
|
|
624
|
+
ngImport: i0,
|
|
625
|
+
type: AsDetailCellValuePipe,
|
|
626
|
+
deps: [],
|
|
627
|
+
target: i0.ɵɵFactoryTarget.Pipe
|
|
628
|
+
});
|
|
629
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({
|
|
630
|
+
minVersion: "14.0.0",
|
|
631
|
+
version: "22.2.0",
|
|
632
|
+
ngImport: i0,
|
|
633
|
+
type: AsDetailCellValuePipe,
|
|
634
|
+
isStandalone: true,
|
|
635
|
+
name: "asDetailCellValue"
|
|
636
|
+
});
|
|
637
|
+
};
|
|
638
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
639
|
+
minVersion: "12.0.0",
|
|
640
|
+
version: "22.2.0",
|
|
641
|
+
ngImport: i0,
|
|
642
|
+
type: AsDetailCellValuePipe,
|
|
643
|
+
decorators: [{
|
|
644
|
+
type: Pipe,
|
|
645
|
+
args: [{
|
|
646
|
+
name: "asDetailCellValue",
|
|
647
|
+
standalone: true,
|
|
648
|
+
pure: true
|
|
649
|
+
}]
|
|
650
|
+
}]
|
|
651
|
+
});
|
|
652
|
+
var AsDetailDisplayValuePipe = class AsDetailDisplayValuePipe {
|
|
653
|
+
lang = inject(SparkLanguageService);
|
|
654
|
+
transform(attr, formData, asDetailTypes) {
|
|
655
|
+
const value = formData[attr.name];
|
|
656
|
+
if (!value) return this.lang.t("common.notSet");
|
|
657
|
+
const asDetailType = asDetailTypes[attr.name] || null;
|
|
658
|
+
const resolved = selfBreadcrumb(value, asDetailType?.name);
|
|
659
|
+
if (resolved) return resolved;
|
|
660
|
+
if (asDetailType?.breadcrumb) {
|
|
661
|
+
const result = applyFieldTemplate(asDetailType.breadcrumb, value);
|
|
662
|
+
if (result && result.trim()) return result;
|
|
663
|
+
}
|
|
664
|
+
return this.lang.t("common.clickToEdit");
|
|
665
|
+
}
|
|
666
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
667
|
+
minVersion: "12.0.0",
|
|
668
|
+
version: "22.2.0",
|
|
669
|
+
ngImport: i0,
|
|
670
|
+
type: AsDetailDisplayValuePipe,
|
|
671
|
+
deps: [],
|
|
672
|
+
target: i0.ɵɵFactoryTarget.Pipe
|
|
673
|
+
});
|
|
674
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({
|
|
675
|
+
minVersion: "14.0.0",
|
|
676
|
+
version: "22.2.0",
|
|
677
|
+
ngImport: i0,
|
|
678
|
+
type: AsDetailDisplayValuePipe,
|
|
679
|
+
isStandalone: true,
|
|
680
|
+
name: "asDetailDisplayValue"
|
|
681
|
+
});
|
|
682
|
+
};
|
|
683
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
684
|
+
minVersion: "12.0.0",
|
|
685
|
+
version: "22.2.0",
|
|
686
|
+
ngImport: i0,
|
|
687
|
+
type: AsDetailDisplayValuePipe,
|
|
688
|
+
decorators: [{
|
|
689
|
+
type: Pipe,
|
|
690
|
+
args: [{
|
|
691
|
+
name: "asDetailDisplayValue",
|
|
692
|
+
standalone: true,
|
|
693
|
+
pure: true
|
|
694
|
+
}]
|
|
695
|
+
}]
|
|
696
|
+
});
|
|
697
|
+
var CanCreateDetailRowPipe = class CanCreateDetailRowPipe {
|
|
698
|
+
transform(attr, permissions) {
|
|
699
|
+
const perms = permissions[attr.name];
|
|
700
|
+
return perms ? perms.canCreate : false;
|
|
701
|
+
}
|
|
702
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
703
|
+
minVersion: "12.0.0",
|
|
704
|
+
version: "22.2.0",
|
|
705
|
+
ngImport: i0,
|
|
706
|
+
type: CanCreateDetailRowPipe,
|
|
707
|
+
deps: [],
|
|
708
|
+
target: i0.ɵɵFactoryTarget.Pipe
|
|
709
|
+
});
|
|
710
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({
|
|
711
|
+
minVersion: "14.0.0",
|
|
712
|
+
version: "22.2.0",
|
|
713
|
+
ngImport: i0,
|
|
714
|
+
type: CanCreateDetailRowPipe,
|
|
715
|
+
isStandalone: true,
|
|
716
|
+
name: "canCreateDetailRow"
|
|
717
|
+
});
|
|
718
|
+
};
|
|
719
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
720
|
+
minVersion: "12.0.0",
|
|
721
|
+
version: "22.2.0",
|
|
722
|
+
ngImport: i0,
|
|
723
|
+
type: CanCreateDetailRowPipe,
|
|
724
|
+
decorators: [{
|
|
725
|
+
type: Pipe,
|
|
726
|
+
args: [{
|
|
727
|
+
name: "canCreateDetailRow",
|
|
728
|
+
standalone: true,
|
|
729
|
+
pure: true
|
|
730
|
+
}]
|
|
731
|
+
}]
|
|
732
|
+
});
|
|
733
|
+
var CanDeleteDetailRowPipe = class CanDeleteDetailRowPipe {
|
|
734
|
+
transform(attr, permissions) {
|
|
735
|
+
const perms = permissions[attr.name];
|
|
736
|
+
return perms ? perms.canDelete : false;
|
|
737
|
+
}
|
|
738
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
739
|
+
minVersion: "12.0.0",
|
|
740
|
+
version: "22.2.0",
|
|
741
|
+
ngImport: i0,
|
|
742
|
+
type: CanDeleteDetailRowPipe,
|
|
743
|
+
deps: [],
|
|
744
|
+
target: i0.ɵɵFactoryTarget.Pipe
|
|
745
|
+
});
|
|
746
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({
|
|
747
|
+
minVersion: "14.0.0",
|
|
748
|
+
version: "22.2.0",
|
|
749
|
+
ngImport: i0,
|
|
750
|
+
type: CanDeleteDetailRowPipe,
|
|
751
|
+
isStandalone: true,
|
|
752
|
+
name: "canDeleteDetailRow"
|
|
753
|
+
});
|
|
754
|
+
};
|
|
755
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
756
|
+
minVersion: "12.0.0",
|
|
757
|
+
version: "22.2.0",
|
|
758
|
+
ngImport: i0,
|
|
759
|
+
type: CanDeleteDetailRowPipe,
|
|
760
|
+
decorators: [{
|
|
761
|
+
type: Pipe,
|
|
762
|
+
args: [{
|
|
763
|
+
name: "canDeleteDetailRow",
|
|
764
|
+
standalone: true,
|
|
765
|
+
pure: true
|
|
766
|
+
}]
|
|
767
|
+
}]
|
|
768
|
+
});
|
|
769
|
+
var CanEditDetailRowPipe = class CanEditDetailRowPipe {
|
|
770
|
+
transform(attr, permissions) {
|
|
771
|
+
const perms = permissions[attr.name];
|
|
772
|
+
return perms ? perms.canEdit : false;
|
|
773
|
+
}
|
|
774
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
775
|
+
minVersion: "12.0.0",
|
|
776
|
+
version: "22.2.0",
|
|
777
|
+
ngImport: i0,
|
|
778
|
+
type: CanEditDetailRowPipe,
|
|
779
|
+
deps: [],
|
|
780
|
+
target: i0.ɵɵFactoryTarget.Pipe
|
|
781
|
+
});
|
|
782
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({
|
|
783
|
+
minVersion: "14.0.0",
|
|
784
|
+
version: "22.2.0",
|
|
785
|
+
ngImport: i0,
|
|
786
|
+
type: CanEditDetailRowPipe,
|
|
787
|
+
isStandalone: true,
|
|
788
|
+
name: "canEditDetailRow"
|
|
789
|
+
});
|
|
790
|
+
};
|
|
791
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
792
|
+
minVersion: "12.0.0",
|
|
793
|
+
version: "22.2.0",
|
|
794
|
+
ngImport: i0,
|
|
795
|
+
type: CanEditDetailRowPipe,
|
|
796
|
+
decorators: [{
|
|
797
|
+
type: Pipe,
|
|
798
|
+
args: [{
|
|
799
|
+
name: "canEditDetailRow",
|
|
800
|
+
standalone: true,
|
|
801
|
+
pure: true
|
|
802
|
+
}]
|
|
803
|
+
}]
|
|
804
|
+
});
|
|
805
|
+
var LookupDisplayTypePipe = class LookupDisplayTypePipe {
|
|
806
|
+
transform(attr, lookupRefOptions) {
|
|
807
|
+
return (attr.lookupReferenceType ? lookupRefOptions[attr.lookupReferenceType] : null)?.displayType ?? ELookupDisplayType.Dropdown;
|
|
808
|
+
}
|
|
809
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
810
|
+
minVersion: "12.0.0",
|
|
811
|
+
version: "22.2.0",
|
|
812
|
+
ngImport: i0,
|
|
813
|
+
type: LookupDisplayTypePipe,
|
|
814
|
+
deps: [],
|
|
815
|
+
target: i0.ɵɵFactoryTarget.Pipe
|
|
816
|
+
});
|
|
817
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({
|
|
818
|
+
minVersion: "14.0.0",
|
|
819
|
+
version: "22.2.0",
|
|
820
|
+
ngImport: i0,
|
|
821
|
+
type: LookupDisplayTypePipe,
|
|
822
|
+
isStandalone: true,
|
|
823
|
+
name: "lookupDisplayType"
|
|
824
|
+
});
|
|
825
|
+
};
|
|
826
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
827
|
+
minVersion: "12.0.0",
|
|
828
|
+
version: "22.2.0",
|
|
829
|
+
ngImport: i0,
|
|
830
|
+
type: LookupDisplayTypePipe,
|
|
831
|
+
decorators: [{
|
|
832
|
+
type: Pipe,
|
|
833
|
+
args: [{
|
|
834
|
+
name: "lookupDisplayType",
|
|
835
|
+
standalone: true,
|
|
836
|
+
pure: true
|
|
837
|
+
}]
|
|
838
|
+
}]
|
|
839
|
+
});
|
|
840
|
+
var LookupDisplayValuePipe = class LookupDisplayValuePipe {
|
|
841
|
+
transform(attr, formData, lookupRefOptions) {
|
|
842
|
+
const currentValue = formData[attr.name];
|
|
843
|
+
if (currentValue == null || currentValue === "") return "";
|
|
844
|
+
const selected = ((attr.lookupReferenceType ? lookupRefOptions[attr.lookupReferenceType] : null)?.values.filter((v) => v.isActive) || []).find((o) => o.key === String(currentValue));
|
|
845
|
+
if (!selected) return String(currentValue);
|
|
846
|
+
return resolveTranslation(selected.values) || selected.key;
|
|
847
|
+
}
|
|
848
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
849
|
+
minVersion: "12.0.0",
|
|
850
|
+
version: "22.2.0",
|
|
851
|
+
ngImport: i0,
|
|
852
|
+
type: LookupDisplayValuePipe,
|
|
853
|
+
deps: [],
|
|
854
|
+
target: i0.ɵɵFactoryTarget.Pipe
|
|
855
|
+
});
|
|
856
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({
|
|
857
|
+
minVersion: "14.0.0",
|
|
858
|
+
version: "22.2.0",
|
|
859
|
+
ngImport: i0,
|
|
860
|
+
type: LookupDisplayValuePipe,
|
|
861
|
+
isStandalone: true,
|
|
862
|
+
name: "lookupDisplayValue"
|
|
863
|
+
});
|
|
864
|
+
};
|
|
865
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
866
|
+
minVersion: "12.0.0",
|
|
867
|
+
version: "22.2.0",
|
|
868
|
+
ngImport: i0,
|
|
869
|
+
type: LookupDisplayValuePipe,
|
|
870
|
+
decorators: [{
|
|
871
|
+
type: Pipe,
|
|
872
|
+
args: [{
|
|
873
|
+
name: "lookupDisplayValue",
|
|
874
|
+
standalone: true,
|
|
875
|
+
pure: true
|
|
876
|
+
}]
|
|
877
|
+
}]
|
|
878
|
+
});
|
|
879
|
+
var LookupOptionsPipe = class LookupOptionsPipe {
|
|
880
|
+
transform(attr, lookupRefOptions) {
|
|
881
|
+
return (attr.lookupReferenceType ? lookupRefOptions[attr.lookupReferenceType] : null)?.values.filter((v) => v.isActive) || [];
|
|
882
|
+
}
|
|
883
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
884
|
+
minVersion: "12.0.0",
|
|
885
|
+
version: "22.2.0",
|
|
886
|
+
ngImport: i0,
|
|
887
|
+
type: LookupOptionsPipe,
|
|
888
|
+
deps: [],
|
|
889
|
+
target: i0.ɵɵFactoryTarget.Pipe
|
|
890
|
+
});
|
|
891
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({
|
|
892
|
+
minVersion: "14.0.0",
|
|
893
|
+
version: "22.2.0",
|
|
894
|
+
ngImport: i0,
|
|
895
|
+
type: LookupOptionsPipe,
|
|
896
|
+
isStandalone: true,
|
|
897
|
+
name: "lookupOptions"
|
|
898
|
+
});
|
|
899
|
+
};
|
|
900
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
901
|
+
minVersion: "12.0.0",
|
|
902
|
+
version: "22.2.0",
|
|
903
|
+
ngImport: i0,
|
|
904
|
+
type: LookupOptionsPipe,
|
|
905
|
+
decorators: [{
|
|
906
|
+
type: Pipe,
|
|
907
|
+
args: [{
|
|
908
|
+
name: "lookupOptions",
|
|
909
|
+
standalone: true,
|
|
910
|
+
pure: true
|
|
911
|
+
}]
|
|
912
|
+
}]
|
|
913
|
+
});
|
|
914
|
+
var InlineRefOptionsPipe = class InlineRefOptionsPipe {
|
|
915
|
+
transform(parentAttr, col, asDetailRefOptions) {
|
|
916
|
+
return asDetailRefOptions[parentAttr.name]?.[col.name] || [];
|
|
917
|
+
}
|
|
918
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
919
|
+
minVersion: "12.0.0",
|
|
920
|
+
version: "22.2.0",
|
|
921
|
+
ngImport: i0,
|
|
922
|
+
type: InlineRefOptionsPipe,
|
|
923
|
+
deps: [],
|
|
924
|
+
target: i0.ɵɵFactoryTarget.Pipe
|
|
925
|
+
});
|
|
926
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({
|
|
927
|
+
minVersion: "14.0.0",
|
|
928
|
+
version: "22.2.0",
|
|
929
|
+
ngImport: i0,
|
|
930
|
+
type: InlineRefOptionsPipe,
|
|
931
|
+
isStandalone: true,
|
|
932
|
+
name: "inlineRefOptions"
|
|
933
|
+
});
|
|
934
|
+
};
|
|
935
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
936
|
+
minVersion: "12.0.0",
|
|
937
|
+
version: "22.2.0",
|
|
938
|
+
ngImport: i0,
|
|
939
|
+
type: InlineRefOptionsPipe,
|
|
940
|
+
decorators: [{
|
|
941
|
+
type: Pipe,
|
|
942
|
+
args: [{
|
|
943
|
+
name: "inlineRefOptions",
|
|
944
|
+
standalone: true,
|
|
945
|
+
pure: true
|
|
946
|
+
}]
|
|
947
|
+
}]
|
|
948
|
+
});
|
|
949
|
+
var ErrorForAttributePipe = class ErrorForAttributePipe {
|
|
950
|
+
transform(attrName, validationErrors) {
|
|
951
|
+
const error = validationErrors.find((e) => e.attributeName === attrName);
|
|
952
|
+
return error ? resolveTranslation(error.errorMessage) : null;
|
|
953
|
+
}
|
|
954
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
955
|
+
minVersion: "12.0.0",
|
|
956
|
+
version: "22.2.0",
|
|
957
|
+
ngImport: i0,
|
|
958
|
+
type: ErrorForAttributePipe,
|
|
959
|
+
deps: [],
|
|
960
|
+
target: i0.ɵɵFactoryTarget.Pipe
|
|
961
|
+
});
|
|
962
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({
|
|
963
|
+
minVersion: "14.0.0",
|
|
964
|
+
version: "22.2.0",
|
|
965
|
+
ngImport: i0,
|
|
966
|
+
type: ErrorForAttributePipe,
|
|
967
|
+
isStandalone: true,
|
|
968
|
+
name: "errorForAttribute"
|
|
969
|
+
});
|
|
970
|
+
};
|
|
971
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
972
|
+
minVersion: "12.0.0",
|
|
973
|
+
version: "22.2.0",
|
|
974
|
+
ngImport: i0,
|
|
975
|
+
type: ErrorForAttributePipe,
|
|
976
|
+
decorators: [{
|
|
977
|
+
type: Pipe,
|
|
978
|
+
args: [{
|
|
979
|
+
name: "errorForAttribute",
|
|
980
|
+
standalone: true,
|
|
981
|
+
pure: true
|
|
982
|
+
}]
|
|
983
|
+
}]
|
|
984
|
+
});
|
|
985
|
+
var IconNamePipe = class IconNamePipe {
|
|
986
|
+
transform(value, fallback) {
|
|
987
|
+
const iconClass = value || fallback;
|
|
988
|
+
return iconClass.startsWith("bi-") ? iconClass.substring(3) : iconClass;
|
|
989
|
+
}
|
|
990
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
991
|
+
minVersion: "12.0.0",
|
|
992
|
+
version: "22.2.0",
|
|
993
|
+
ngImport: i0,
|
|
994
|
+
type: IconNamePipe,
|
|
995
|
+
deps: [],
|
|
996
|
+
target: i0.ɵɵFactoryTarget.Pipe
|
|
997
|
+
});
|
|
998
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({
|
|
999
|
+
minVersion: "14.0.0",
|
|
1000
|
+
version: "22.2.0",
|
|
1001
|
+
ngImport: i0,
|
|
1002
|
+
type: IconNamePipe,
|
|
1003
|
+
isStandalone: true,
|
|
1004
|
+
name: "iconName"
|
|
1005
|
+
});
|
|
1006
|
+
};
|
|
1007
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1008
|
+
minVersion: "12.0.0",
|
|
1009
|
+
version: "22.2.0",
|
|
1010
|
+
ngImport: i0,
|
|
1011
|
+
type: IconNamePipe,
|
|
1012
|
+
decorators: [{
|
|
1013
|
+
type: Pipe,
|
|
1014
|
+
args: [{
|
|
1015
|
+
name: "iconName",
|
|
1016
|
+
standalone: true,
|
|
1017
|
+
pure: true
|
|
1018
|
+
}]
|
|
1019
|
+
}]
|
|
1020
|
+
});
|
|
1021
|
+
var ArrayValuePipe = class ArrayValuePipe {
|
|
1022
|
+
transform(attrName, item) {
|
|
1023
|
+
const attr = item?.attributes.find((a) => a.name === attrName);
|
|
1024
|
+
if (!attr) return [];
|
|
1025
|
+
if (attr.dataType === "AsDetail" && attr.isArray && Array.isArray(attr.objects)) return attr.objects.map((po) => nestedPoToDisplayRow(po));
|
|
1026
|
+
if (Array.isArray(attr.value)) return attr.value;
|
|
1027
|
+
return [];
|
|
1028
|
+
}
|
|
1029
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
1030
|
+
minVersion: "12.0.0",
|
|
1031
|
+
version: "22.2.0",
|
|
1032
|
+
ngImport: i0,
|
|
1033
|
+
type: ArrayValuePipe,
|
|
1034
|
+
deps: [],
|
|
1035
|
+
target: i0.ɵɵFactoryTarget.Pipe
|
|
1036
|
+
});
|
|
1037
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({
|
|
1038
|
+
minVersion: "14.0.0",
|
|
1039
|
+
version: "22.2.0",
|
|
1040
|
+
ngImport: i0,
|
|
1041
|
+
type: ArrayValuePipe,
|
|
1042
|
+
isStandalone: true,
|
|
1043
|
+
name: "arrayValue"
|
|
1044
|
+
});
|
|
1045
|
+
};
|
|
1046
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1047
|
+
minVersion: "12.0.0",
|
|
1048
|
+
version: "22.2.0",
|
|
1049
|
+
ngImport: i0,
|
|
1050
|
+
type: ArrayValuePipe,
|
|
1051
|
+
decorators: [{
|
|
1052
|
+
type: Pipe,
|
|
1053
|
+
args: [{
|
|
1054
|
+
name: "arrayValue",
|
|
1055
|
+
standalone: true,
|
|
1056
|
+
pure: true
|
|
1057
|
+
}]
|
|
1058
|
+
}]
|
|
1059
|
+
});
|
|
1060
|
+
var QueryCellValuePipe = class QueryCellValuePipe {
|
|
1061
|
+
transform(column, item, lookupRefOptions) {
|
|
1062
|
+
const cell = valueFor(item, column.name);
|
|
1063
|
+
if (!cell) return "";
|
|
1064
|
+
const resolved = resolvedBreadcrumb(cell.breadcrumb, column.asDetailType);
|
|
1065
|
+
if (resolved) return resolved;
|
|
1066
|
+
if (column.dataType === "AsDetail") {
|
|
1067
|
+
if (!column.isArray) return "";
|
|
1068
|
+
const count = typeof cell.value === "number" ? cell.value : 0;
|
|
1069
|
+
return count === 0 ? "" : `${count} item${count !== 1 ? "s" : ""}`;
|
|
1070
|
+
}
|
|
1071
|
+
if (column.lookupReferenceType && cell.value != null && cell.value !== "") {
|
|
1072
|
+
const option = lookupRefOptions[column.lookupReferenceType]?.values.find((v) => v.key === String(cell.value));
|
|
1073
|
+
if (option) return resolveTranslation(option.values) || option.key;
|
|
1074
|
+
}
|
|
1075
|
+
if (column.dataType === "boolean") return cell.value ?? null;
|
|
1076
|
+
if (column.dataType === "date" || column.dataType === "datetime") {
|
|
1077
|
+
if (cell.value == null || cell.value === "") return null;
|
|
1078
|
+
if (cell.value instanceof Date) return Number.isNaN(cell.value.getTime()) ? null : cell.value;
|
|
1079
|
+
const parsed = new Date(cell.value);
|
|
1080
|
+
return Number.isNaN(parsed.getTime()) ? String(cell.value) : parsed;
|
|
1081
|
+
}
|
|
1082
|
+
return cell.value ?? "";
|
|
1083
|
+
}
|
|
1084
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
1085
|
+
minVersion: "12.0.0",
|
|
1086
|
+
version: "22.2.0",
|
|
1087
|
+
ngImport: i0,
|
|
1088
|
+
type: QueryCellValuePipe,
|
|
1089
|
+
deps: [],
|
|
1090
|
+
target: i0.ɵɵFactoryTarget.Pipe
|
|
1091
|
+
});
|
|
1092
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({
|
|
1093
|
+
minVersion: "14.0.0",
|
|
1094
|
+
version: "22.2.0",
|
|
1095
|
+
ngImport: i0,
|
|
1096
|
+
type: QueryCellValuePipe,
|
|
1097
|
+
isStandalone: true,
|
|
1098
|
+
name: "queryCellValue"
|
|
1099
|
+
});
|
|
1100
|
+
};
|
|
1101
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1102
|
+
minVersion: "12.0.0",
|
|
1103
|
+
version: "22.2.0",
|
|
1104
|
+
ngImport: i0,
|
|
1105
|
+
type: QueryCellValuePipe,
|
|
1106
|
+
decorators: [{
|
|
1107
|
+
type: Pipe,
|
|
1108
|
+
args: [{
|
|
1109
|
+
name: "queryCellValue",
|
|
1110
|
+
standalone: true,
|
|
1111
|
+
pure: true
|
|
1112
|
+
}]
|
|
1113
|
+
}]
|
|
1114
|
+
});
|
|
1115
|
+
var QueryReferenceChipsPipe = class QueryReferenceChipsPipe {
|
|
1116
|
+
transform(column, item) {
|
|
1117
|
+
const cell = valueFor(item, column.name);
|
|
1118
|
+
if (!cell || !Array.isArray(cell.value)) return [];
|
|
1119
|
+
const breadcrumbs = cell.breadcrumbs ?? {};
|
|
1120
|
+
return cell.value.filter((v) => v != null && v !== "").map((v) => {
|
|
1121
|
+
const id = String(v);
|
|
1122
|
+
return {
|
|
1123
|
+
id,
|
|
1124
|
+
label: breadcrumbs[id] || id
|
|
1125
|
+
};
|
|
1126
|
+
});
|
|
1127
|
+
}
|
|
1128
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
1129
|
+
minVersion: "12.0.0",
|
|
1130
|
+
version: "22.2.0",
|
|
1131
|
+
ngImport: i0,
|
|
1132
|
+
type: QueryReferenceChipsPipe,
|
|
1133
|
+
deps: [],
|
|
1134
|
+
target: i0.ɵɵFactoryTarget.Pipe
|
|
1135
|
+
});
|
|
1136
|
+
static ɵpipe = i0.ɵɵngDeclarePipe({
|
|
1137
|
+
minVersion: "14.0.0",
|
|
1138
|
+
version: "22.2.0",
|
|
1139
|
+
ngImport: i0,
|
|
1140
|
+
type: QueryReferenceChipsPipe,
|
|
1141
|
+
isStandalone: true,
|
|
1142
|
+
name: "queryReferenceChips"
|
|
1143
|
+
});
|
|
1144
|
+
};
|
|
1145
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
1146
|
+
minVersion: "12.0.0",
|
|
1147
|
+
version: "22.2.0",
|
|
1148
|
+
ngImport: i0,
|
|
1149
|
+
type: QueryReferenceChipsPipe,
|
|
1150
|
+
decorators: [{
|
|
1151
|
+
type: Pipe,
|
|
1152
|
+
args: [{
|
|
1153
|
+
name: "queryReferenceChips",
|
|
1154
|
+
standalone: true,
|
|
1155
|
+
pure: true
|
|
1156
|
+
}]
|
|
1157
|
+
}]
|
|
1158
|
+
});
|
|
1159
|
+
export { ArrayValuePipe, AsDetailCellValuePipe, AsDetailColumnsPipe, AsDetailDisplayValuePipe, AsDetailRowRendererPipe, AsDetailTypePipe, AttributeValuePipe, CanCreateDetailRowPipe, CanDeleteDetailRowPipe, CanEditDetailRowPipe, ErrorForAttributePipe, IconNamePipe, InlineRefOptionsPipe, InputTypePipe, LookupDisplayTypePipe, LookupDisplayValuePipe, LookupOptionsPipe, ParsedDatePipe, QueryCellValuePipe, QueryReferenceChipsPipe, RawAttributeValuePipe, ReferenceAttrValuePipe, ReferenceChipsPipe, ReferenceDisplayValuePipe, ReferenceLinkRoutePipe, ResolveTranslationPipe, RouterLinkPipe, TranslateKeyPipe };
|
|
766
1160
|
|
|
767
|
-
|
|
768
|
-
//# sourceMappingURL=mintplayer-ng-spark-pipes.mjs.map
|
|
1161
|
+
//# sourceMappingURL=mintplayer-ng-spark-pipes.mjs.map
|