@mintplayer/ng-spark 0.2.0 → 0.4.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/fesm2022/mintplayer-ng-spark-client-operations.mjs +168 -0
- package/fesm2022/mintplayer-ng-spark-client-operations.mjs.map +1 -0
- package/fesm2022/mintplayer-ng-spark-models.mjs +84 -1
- package/fesm2022/mintplayer-ng-spark-models.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-spark-pipes.mjs +25 -8
- package/fesm2022/mintplayer-ng-spark-pipes.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-spark-po-create.mjs +39 -13
- package/fesm2022/mintplayer-ng-spark-po-create.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-spark-po-detail.mjs +3 -3
- package/fesm2022/mintplayer-ng-spark-po-detail.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-spark-po-edit.mjs +47 -2
- package/fesm2022/mintplayer-ng-spark-po-edit.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-spark-po-form.mjs +1 -1
- package/fesm2022/mintplayer-ng-spark-po-form.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-spark-query-list.mjs +33 -6
- package/fesm2022/mintplayer-ng-spark-query-list.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-spark-retry-action-modal.mjs +165 -14
- package/fesm2022/mintplayer-ng-spark-retry-action-modal.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-spark-services.mjs +51 -30
- package/fesm2022/mintplayer-ng-spark-services.mjs.map +1 -1
- package/package.json +6 -2
- package/types/mintplayer-ng-spark-client-operations.d.ts +159 -0
- package/types/mintplayer-ng-spark-models.d.ts +54 -10
- package/types/mintplayer-ng-spark-pipes.d.ts +8 -0
- package/types/mintplayer-ng-spark-po-create.d.ts +1 -0
- package/types/mintplayer-ng-spark-po-detail.d.ts +2 -1
- package/types/mintplayer-ng-spark-po-edit.d.ts +2 -0
- package/types/mintplayer-ng-spark-query-list.d.ts +10 -2
- package/types/mintplayer-ng-spark-retry-action-modal.d.ts +33 -4
- package/types/mintplayer-ng-spark-services.d.ts +6 -4
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { InjectionToken, inject, Injectable, signal, ChangeDetectionStrategy, Component, makeEnvironmentProviders } from '@angular/core';
|
|
3
|
+
|
|
4
|
+
// Wire types matching MintPlayer.Spark.Abstractions.ClientOperations on the server.
|
|
5
|
+
// Discriminator is the `type` field. Unknown operation types are silently dropped
|
|
6
|
+
// by the dispatcher (forward-compat: new types can land server-side without updating
|
|
7
|
+
// older clients).
|
|
8
|
+
var NotificationKind;
|
|
9
|
+
(function (NotificationKind) {
|
|
10
|
+
NotificationKind[NotificationKind["Info"] = 0] = "Info";
|
|
11
|
+
NotificationKind[NotificationKind["Success"] = 1] = "Success";
|
|
12
|
+
NotificationKind[NotificationKind["Warning"] = 2] = "Warning";
|
|
13
|
+
NotificationKind[NotificationKind["Error"] = 3] = "Error";
|
|
14
|
+
})(NotificationKind || (NotificationKind = {}));
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Multi-provider token. `provideSparkClientOperations()` registers the
|
|
18
|
+
* built-in handlers; apps can add their own with additional `multi: true`
|
|
19
|
+
* providers using this token.
|
|
20
|
+
*/
|
|
21
|
+
const SPARK_CLIENT_OPERATION_HANDLERS = new InjectionToken('SPARK_CLIENT_OPERATION_HANDLERS');
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Routes received operations to registered handlers. Unknown operation types
|
|
25
|
+
* (no matching registration) are silently dropped — this is the forward-compat
|
|
26
|
+
* contract that lets new operation types ship server-side without coordinated
|
|
27
|
+
* client updates.
|
|
28
|
+
*
|
|
29
|
+
* Last-registered-wins on duplicate `type` values, matching standard
|
|
30
|
+
* Angular multi-provider override semantics.
|
|
31
|
+
*/
|
|
32
|
+
class SparkClientOperationDispatcher {
|
|
33
|
+
handlerMap;
|
|
34
|
+
constructor() {
|
|
35
|
+
const registrations = inject(SPARK_CLIENT_OPERATION_HANDLERS, { optional: true }) ?? [];
|
|
36
|
+
const map = new Map();
|
|
37
|
+
for (const { type, handler } of registrations) {
|
|
38
|
+
map.set(type, handler);
|
|
39
|
+
}
|
|
40
|
+
this.handlerMap = map;
|
|
41
|
+
}
|
|
42
|
+
dispatch(operations) {
|
|
43
|
+
if (!operations || operations.length === 0)
|
|
44
|
+
return;
|
|
45
|
+
for (const operation of operations) {
|
|
46
|
+
const handler = this.handlerMap.get(operation.type);
|
|
47
|
+
if (handler) {
|
|
48
|
+
handler(operation);
|
|
49
|
+
}
|
|
50
|
+
// Unknown types: silently dropped (forward-compat).
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: SparkClientOperationDispatcher, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
54
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: SparkClientOperationDispatcher, providedIn: 'root' });
|
|
55
|
+
}
|
|
56
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: SparkClientOperationDispatcher, decorators: [{
|
|
57
|
+
type: Injectable,
|
|
58
|
+
args: [{ providedIn: 'root' }]
|
|
59
|
+
}], ctorParameters: () => [] });
|
|
60
|
+
|
|
61
|
+
const DEFAULT_DURATION_MS = 4000;
|
|
62
|
+
/**
|
|
63
|
+
* Holds the active toasts as a signal. The `<spark-toast-container>` component
|
|
64
|
+
* renders them; the built-in `notify` operation handler pushes new toasts here.
|
|
65
|
+
*
|
|
66
|
+
* Auto-dismissal: each toast schedules its own removal after `durationMs`. Pass
|
|
67
|
+
* `0` to make a toast sticky (manual dismissal only).
|
|
68
|
+
*/
|
|
69
|
+
class SparkNotificationService {
|
|
70
|
+
_toasts = signal([], ...(ngDevMode ? [{ debugName: "_toasts" }] : []));
|
|
71
|
+
toasts = this._toasts.asReadonly();
|
|
72
|
+
show(message, kind = NotificationKind.Info, durationMs) {
|
|
73
|
+
const id = typeof crypto !== 'undefined' && crypto.randomUUID ? crypto.randomUUID() : `${Date.now()}-${Math.random()}`;
|
|
74
|
+
const effectiveDuration = durationMs ?? DEFAULT_DURATION_MS;
|
|
75
|
+
const toast = { id, message, kind, durationMs: effectiveDuration };
|
|
76
|
+
this._toasts.update(toasts => [...toasts, toast]);
|
|
77
|
+
if (effectiveDuration > 0) {
|
|
78
|
+
setTimeout(() => this.dismiss(id), effectiveDuration);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
dismiss(id) {
|
|
82
|
+
this._toasts.update(toasts => toasts.filter(t => t.id !== id));
|
|
83
|
+
}
|
|
84
|
+
clear() {
|
|
85
|
+
this._toasts.set([]);
|
|
86
|
+
}
|
|
87
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: SparkNotificationService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
88
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: SparkNotificationService, providedIn: 'root' });
|
|
89
|
+
}
|
|
90
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: SparkNotificationService, decorators: [{
|
|
91
|
+
type: Injectable,
|
|
92
|
+
args: [{ providedIn: 'root' }]
|
|
93
|
+
}] });
|
|
94
|
+
|
|
95
|
+
class SparkToastContainerComponent {
|
|
96
|
+
notifications = inject(SparkNotificationService);
|
|
97
|
+
Kind = NotificationKind;
|
|
98
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: SparkToastContainerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
99
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.6", type: SparkToastContainerComponent, isStandalone: true, selector: "spark-toast-container", ngImport: i0, template: `
|
|
100
|
+
<div class="spark-toast-container">
|
|
101
|
+
@for (toast of notifications.toasts(); track toast.id) {
|
|
102
|
+
<div
|
|
103
|
+
class="spark-toast"
|
|
104
|
+
[class.spark-toast--info]="toast.kind === Kind.Info"
|
|
105
|
+
[class.spark-toast--success]="toast.kind === Kind.Success"
|
|
106
|
+
[class.spark-toast--warning]="toast.kind === Kind.Warning"
|
|
107
|
+
[class.spark-toast--error]="toast.kind === Kind.Error"
|
|
108
|
+
(click)="notifications.dismiss(toast.id)"
|
|
109
|
+
>
|
|
110
|
+
{{ toast.message }}
|
|
111
|
+
</div>
|
|
112
|
+
}
|
|
113
|
+
</div>
|
|
114
|
+
`, isInline: true, styles: [".spark-toast-container{position:fixed;top:1rem;right:1rem;z-index:9999;display:flex;flex-direction:column;gap:.5rem;pointer-events:none}.spark-toast{padding:.75rem 1rem;border-radius:4px;box-shadow:0 2px 8px #00000026;cursor:pointer;min-width:220px;max-width:400px;color:#fff;font-size:.95rem;pointer-events:auto;animation:spark-toast-in .18s ease-out}.spark-toast--info{background:#0d6efd}.spark-toast--success{background:#198754}.spark-toast--warning{background:#ffc107;color:#000}.spark-toast--error{background:#dc3545}@keyframes spark-toast-in{0%{opacity:0;transform:translate(8px)}to{opacity:1;transform:translate(0)}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
115
|
+
}
|
|
116
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: SparkToastContainerComponent, decorators: [{
|
|
117
|
+
type: Component,
|
|
118
|
+
args: [{ selector: 'spark-toast-container', standalone: true, template: `
|
|
119
|
+
<div class="spark-toast-container">
|
|
120
|
+
@for (toast of notifications.toasts(); track toast.id) {
|
|
121
|
+
<div
|
|
122
|
+
class="spark-toast"
|
|
123
|
+
[class.spark-toast--info]="toast.kind === Kind.Info"
|
|
124
|
+
[class.spark-toast--success]="toast.kind === Kind.Success"
|
|
125
|
+
[class.spark-toast--warning]="toast.kind === Kind.Warning"
|
|
126
|
+
[class.spark-toast--error]="toast.kind === Kind.Error"
|
|
127
|
+
(click)="notifications.dismiss(toast.id)"
|
|
128
|
+
>
|
|
129
|
+
{{ toast.message }}
|
|
130
|
+
</div>
|
|
131
|
+
}
|
|
132
|
+
</div>
|
|
133
|
+
`, changeDetection: ChangeDetectionStrategy.OnPush, styles: [".spark-toast-container{position:fixed;top:1rem;right:1rem;z-index:9999;display:flex;flex-direction:column;gap:.5rem;pointer-events:none}.spark-toast{padding:.75rem 1rem;border-radius:4px;box-shadow:0 2px 8px #00000026;cursor:pointer;min-width:220px;max-width:400px;color:#fff;font-size:.95rem;pointer-events:auto;animation:spark-toast-in .18s ease-out}.spark-toast--info{background:#0d6efd}.spark-toast--success{background:#198754}.spark-toast--warning{background:#ffc107;color:#000}.spark-toast--error{background:#dc3545}@keyframes spark-toast-in{0%{opacity:0;transform:translate(8px)}to{opacity:1;transform:translate(0)}}\n"] }]
|
|
134
|
+
}] });
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Registers the built-in client-operation handlers. Currently registers `notify`;
|
|
138
|
+
* additional types (`navigate`, `refreshQuery`, `refreshAttribute`, `disableAction`)
|
|
139
|
+
* land in subsequent commits. Apps add this once in their bootstrap providers.
|
|
140
|
+
*
|
|
141
|
+
* To register custom operation types alongside the built-ins, add additional
|
|
142
|
+
* `multi: true` providers using <see cref="SPARK_CLIENT_OPERATION_HANDLERS" />.
|
|
143
|
+
*/
|
|
144
|
+
function provideSparkClientOperations() {
|
|
145
|
+
return makeEnvironmentProviders([
|
|
146
|
+
{
|
|
147
|
+
provide: SPARK_CLIENT_OPERATION_HANDLERS,
|
|
148
|
+
useFactory: () => {
|
|
149
|
+
const notifications = inject(SparkNotificationService);
|
|
150
|
+
return {
|
|
151
|
+
type: 'notify',
|
|
152
|
+
handler: (operation) => {
|
|
153
|
+
const notify = operation;
|
|
154
|
+
notifications.show(notify.message, notify.kind, notify.durationMs);
|
|
155
|
+
},
|
|
156
|
+
};
|
|
157
|
+
},
|
|
158
|
+
multi: true,
|
|
159
|
+
},
|
|
160
|
+
]);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Generated bundle index. Do not edit.
|
|
165
|
+
*/
|
|
166
|
+
|
|
167
|
+
export { NotificationKind, SPARK_CLIENT_OPERATION_HANDLERS, SparkClientOperationDispatcher, SparkNotificationService, SparkToastContainerComponent, provideSparkClientOperations };
|
|
168
|
+
//# sourceMappingURL=mintplayer-ng-spark-client-operations.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mintplayer-ng-spark-client-operations.mjs","sources":["../../client-operations/src/operations.ts","../../client-operations/src/handlers.token.ts","../../client-operations/src/dispatcher.service.ts","../../client-operations/src/notification.service.ts","../../client-operations/src/toast-container.component.ts","../../client-operations/src/provide.ts","../../client-operations/mintplayer-ng-spark-client-operations.ts"],"sourcesContent":["// Wire types matching MintPlayer.Spark.Abstractions.ClientOperations on the server.\n// Discriminator is the `type` field. Unknown operation types are silently dropped\n// by the dispatcher (forward-compat: new types can land server-side without updating\n// older clients).\n\nimport type { PersistentObject } from '@mintplayer/ng-spark/models';\n\nexport enum NotificationKind {\n Info = 0,\n Success = 1,\n Warning = 2,\n Error = 3,\n}\n\nexport interface NavigateOperation {\n type: 'navigate';\n objectTypeId?: string;\n id?: string;\n routeName?: string;\n}\n\nexport interface NotifyOperation {\n type: 'notify';\n message: string;\n kind: NotificationKind;\n durationMs?: number;\n}\n\nexport interface RefreshAttributeOperation {\n type: 'refreshAttribute';\n objectTypeId: string;\n id: string;\n attributeName: string;\n value?: unknown;\n}\n\nexport interface RefreshQueryOperation {\n type: 'refreshQuery';\n queryId: string;\n}\n\nexport type DisableTarget =\n | { kind: 'persistentObject'; objectTypeId: string; id: string }\n | { kind: 'query'; queryId: string }\n | { kind: 'currentResponse' }\n | { kind: 'session' };\n\nexport interface DisableActionOperation {\n type: 'disableAction';\n actionName: string;\n target: DisableTarget;\n}\n\nexport interface RetryOperation {\n type: 'retry';\n step: number;\n title: string;\n options: string[];\n defaultOption?: string | null;\n persistentObject?: PersistentObject | null;\n message?: string | null;\n}\n\n/**\n * Discriminated union of known operation types, plus an open shape for unknown\n * future operations. Handlers should narrow via the `type` discriminator before\n * accessing fields specific to their operation type.\n */\nexport type ClientOperation =\n | NavigateOperation\n | NotifyOperation\n | RefreshAttributeOperation\n | RefreshQueryOperation\n | DisableActionOperation\n | RetryOperation\n | { type: string; [key: string]: unknown };\n\n/**\n * Wire envelope returned by every action endpoint. `result` carries the primary\n * payload (the PersistentObject for a Create, the QueryResult for an Execute,\n * etc.); `operations` carries the side-effects the frontend dispatches.\n */\nexport interface ClientOperationEnvelope<T = unknown> {\n result: T | null;\n operations: ClientOperation[];\n}\n","import { InjectionToken } from '@angular/core';\nimport type { ClientOperation } from './operations';\n\n/**\n * A handler for a specific operation type. Receives the operation and\n * executes the side-effect (e.g. show a toast, navigate, refresh a query).\n * Handlers should `as`-narrow the operation to the type they registered for.\n */\nexport type ClientOperationHandler = (operation: ClientOperation) => void;\n\n/**\n * One entry in the multi-provider registration. Apps can register custom\n * handlers alongside the built-in ones to extend the operation set with\n * app-specific operation types.\n */\nexport interface ClientOperationHandlerRegistration {\n type: string;\n handler: ClientOperationHandler;\n}\n\n/**\n * Multi-provider token. `provideSparkClientOperations()` registers the\n * built-in handlers; apps can add their own with additional `multi: true`\n * providers using this token.\n */\nexport const SPARK_CLIENT_OPERATION_HANDLERS = new InjectionToken<readonly ClientOperationHandlerRegistration[]>(\n 'SPARK_CLIENT_OPERATION_HANDLERS',\n);\n","import { Injectable, inject } from '@angular/core';\nimport type { ClientOperation } from './operations';\nimport { SPARK_CLIENT_OPERATION_HANDLERS, type ClientOperationHandler } from './handlers.token';\n\n/**\n * Routes received operations to registered handlers. Unknown operation types\n * (no matching registration) are silently dropped — this is the forward-compat\n * contract that lets new operation types ship server-side without coordinated\n * client updates.\n *\n * Last-registered-wins on duplicate `type` values, matching standard\n * Angular multi-provider override semantics.\n */\n@Injectable({ providedIn: 'root' })\nexport class SparkClientOperationDispatcher {\n private readonly handlerMap: ReadonlyMap<string, ClientOperationHandler>;\n\n constructor() {\n const registrations = inject(SPARK_CLIENT_OPERATION_HANDLERS, { optional: true }) ?? [];\n const map = new Map<string, ClientOperationHandler>();\n for (const { type, handler } of registrations) {\n map.set(type, handler);\n }\n this.handlerMap = map;\n }\n\n dispatch(operations: readonly ClientOperation[] | null | undefined): void {\n if (!operations || operations.length === 0) return;\n for (const operation of operations) {\n const handler = this.handlerMap.get(operation.type);\n if (handler) {\n handler(operation);\n }\n // Unknown types: silently dropped (forward-compat).\n }\n }\n}\n","import { Injectable, signal } from '@angular/core';\nimport { NotificationKind } from './operations';\n\nexport interface SparkToast {\n id: string;\n message: string;\n kind: NotificationKind;\n durationMs: number;\n}\n\nconst DEFAULT_DURATION_MS = 4000;\n\n/**\n * Holds the active toasts as a signal. The `<spark-toast-container>` component\n * renders them; the built-in `notify` operation handler pushes new toasts here.\n *\n * Auto-dismissal: each toast schedules its own removal after `durationMs`. Pass\n * `0` to make a toast sticky (manual dismissal only).\n */\n@Injectable({ providedIn: 'root' })\nexport class SparkNotificationService {\n private readonly _toasts = signal<readonly SparkToast[]>([]);\n readonly toasts = this._toasts.asReadonly();\n\n show(message: string, kind: NotificationKind = NotificationKind.Info, durationMs?: number): void {\n const id = typeof crypto !== 'undefined' && crypto.randomUUID ? crypto.randomUUID() : `${Date.now()}-${Math.random()}`;\n const effectiveDuration = durationMs ?? DEFAULT_DURATION_MS;\n const toast: SparkToast = { id, message, kind, durationMs: effectiveDuration };\n this._toasts.update(toasts => [...toasts, toast]);\n\n if (effectiveDuration > 0) {\n setTimeout(() => this.dismiss(id), effectiveDuration);\n }\n }\n\n dismiss(id: string): void {\n this._toasts.update(toasts => toasts.filter(t => t.id !== id));\n }\n\n clear(): void {\n this._toasts.set([]);\n }\n}\n","import { ChangeDetectionStrategy, Component, inject } from '@angular/core';\nimport { SparkNotificationService } from './notification.service';\nimport { NotificationKind } from './operations';\n\n@Component({\n selector: 'spark-toast-container',\n standalone: true,\n template: `\n <div class=\"spark-toast-container\">\n @for (toast of notifications.toasts(); track toast.id) {\n <div\n class=\"spark-toast\"\n [class.spark-toast--info]=\"toast.kind === Kind.Info\"\n [class.spark-toast--success]=\"toast.kind === Kind.Success\"\n [class.spark-toast--warning]=\"toast.kind === Kind.Warning\"\n [class.spark-toast--error]=\"toast.kind === Kind.Error\"\n (click)=\"notifications.dismiss(toast.id)\"\n >\n {{ toast.message }}\n </div>\n }\n </div>\n `,\n styles: [`\n .spark-toast-container {\n position: fixed;\n top: 1rem;\n right: 1rem;\n z-index: 9999;\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n pointer-events: none;\n }\n .spark-toast {\n padding: 0.75rem 1rem;\n border-radius: 4px;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);\n cursor: pointer;\n min-width: 220px;\n max-width: 400px;\n color: white;\n font-size: 0.95rem;\n pointer-events: auto;\n animation: spark-toast-in 0.18s ease-out;\n }\n .spark-toast--info { background: #0d6efd; }\n .spark-toast--success { background: #198754; }\n .spark-toast--warning { background: #ffc107; color: #000; }\n .spark-toast--error { background: #dc3545; }\n @keyframes spark-toast-in {\n from { opacity: 0; transform: translateX(8px); }\n to { opacity: 1; transform: translateX(0); }\n }\n `],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SparkToastContainerComponent {\n protected readonly notifications = inject(SparkNotificationService);\n protected readonly Kind = NotificationKind;\n}\n","import { type EnvironmentProviders, inject, makeEnvironmentProviders } from '@angular/core';\nimport type { ClientOperation, NotifyOperation } from './operations';\nimport { SPARK_CLIENT_OPERATION_HANDLERS } from './handlers.token';\nimport { SparkNotificationService } from './notification.service';\n\n/**\n * Registers the built-in client-operation handlers. Currently registers `notify`;\n * additional types (`navigate`, `refreshQuery`, `refreshAttribute`, `disableAction`)\n * land in subsequent commits. Apps add this once in their bootstrap providers.\n *\n * To register custom operation types alongside the built-ins, add additional\n * `multi: true` providers using <see cref=\"SPARK_CLIENT_OPERATION_HANDLERS\" />.\n */\nexport function provideSparkClientOperations(): EnvironmentProviders {\n return makeEnvironmentProviders([\n {\n provide: SPARK_CLIENT_OPERATION_HANDLERS,\n useFactory: () => {\n const notifications = inject(SparkNotificationService);\n return {\n type: 'notify',\n handler: (operation: ClientOperation) => {\n const notify = operation as NotifyOperation;\n notifications.show(notify.message, notify.kind, notify.durationMs);\n },\n };\n },\n multi: true,\n },\n ]);\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAAA;AACA;AACA;AACA;IAIY;AAAZ,CAAA,UAAY,gBAAgB,EAAA;AACxB,IAAA,gBAAA,CAAA,gBAAA,CAAA,MAAA,CAAA,GAAA,CAAA,CAAA,GAAA,MAAQ;AACR,IAAA,gBAAA,CAAA,gBAAA,CAAA,SAAA,CAAA,GAAA,CAAA,CAAA,GAAA,SAAW;AACX,IAAA,gBAAA,CAAA,gBAAA,CAAA,SAAA,CAAA,GAAA,CAAA,CAAA,GAAA,SAAW;AACX,IAAA,gBAAA,CAAA,gBAAA,CAAA,OAAA,CAAA,GAAA,CAAA,CAAA,GAAA,OAAS;AACb,CAAC,EALW,gBAAgB,KAAhB,gBAAgB,GAAA,EAAA,CAAA,CAAA;;ACa5B;;;;AAIG;MACU,+BAA+B,GAAG,IAAI,cAAc,CAC7D,iCAAiC;;ACtBrC;;;;;;;;AAQG;MAEU,8BAA8B,CAAA;AACtB,IAAA,UAAU;AAE3B,IAAA,WAAA,GAAA;AACI,QAAA,MAAM,aAAa,GAAG,MAAM,CAAC,+BAA+B,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,IAAI,EAAE;AACvF,QAAA,MAAM,GAAG,GAAG,IAAI,GAAG,EAAkC;QACrD,KAAK,MAAM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BA;;AAEG;;;;"}
|
|
@@ -40,9 +40,92 @@ var ELookupDisplayType;
|
|
|
40
40
|
ELookupDisplayType[ELookupDisplayType["Modal"] = 1] = "Modal";
|
|
41
41
|
})(ELookupDisplayType || (ELookupDisplayType = {}));
|
|
42
42
|
|
|
43
|
+
/**
|
|
44
|
+
* Flattens a nested `PersistentObject` into the plain `Record<string, any>` shape the
|
|
45
|
+
* form state uses throughout ng-spark. Primitive / reference attributes contribute their
|
|
46
|
+
* `value`; nested AsDetail attributes recurse — single becomes an inner dict, array
|
|
47
|
+
* becomes an array of inner dicts. Returns `{}` for `null` / `undefined` input.
|
|
48
|
+
*
|
|
49
|
+
* This is the ONE place that reads the server's new AsDetail wire shape and collapses it
|
|
50
|
+
* back to the flat dict the form components already handle.
|
|
51
|
+
*/
|
|
52
|
+
function nestedPoToDict(po) {
|
|
53
|
+
if (!po)
|
|
54
|
+
return {};
|
|
55
|
+
const dict = {};
|
|
56
|
+
for (const attr of po.attributes ?? []) {
|
|
57
|
+
dict[attr.name] = attributeValueForForm(attr);
|
|
58
|
+
}
|
|
59
|
+
return dict;
|
|
60
|
+
}
|
|
61
|
+
function attributeValueForForm(attr) {
|
|
62
|
+
if (attr.dataType === 'AsDetail') {
|
|
63
|
+
if (attr.isArray)
|
|
64
|
+
return (attr.objects ?? []).map(po => nestedPoToDict(po));
|
|
65
|
+
return attr.object ? nestedPoToDict(attr.object) : null;
|
|
66
|
+
}
|
|
67
|
+
return attr.value;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Builds a nested `PersistentObject` from a flat dict against the schema in
|
|
71
|
+
* <paramref name="entityType"/>. Used when the form is about to save — AsDetail attributes
|
|
72
|
+
* are no longer sent as flat dicts in `attribute.value`; the server now requires
|
|
73
|
+
* `attribute.object` / `attribute.objects` with fully scaffolded nested POs.
|
|
74
|
+
*
|
|
75
|
+
* `resolve` walks through AsDetail types registered elsewhere (usually the full
|
|
76
|
+
* `getEntityTypes()` list, keyed by CLR type name). Nested AsDetail inside AsDetail is
|
|
77
|
+
* handled recursively.
|
|
78
|
+
*/
|
|
79
|
+
function dictToNestedPo(dict, entityType, resolve) {
|
|
80
|
+
const attributes = (entityType.attributes ?? [])
|
|
81
|
+
.map(attrDef => buildAttribute(attrDef, dict?.[attrDef.name], resolve));
|
|
82
|
+
return {
|
|
83
|
+
id: dict?.['Id'] ?? dict?.['id'] ?? '',
|
|
84
|
+
name: entityType.name,
|
|
85
|
+
objectTypeId: entityType.id,
|
|
86
|
+
attributes,
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
function buildAttribute(attrDef, raw, resolve) {
|
|
90
|
+
const attr = {
|
|
91
|
+
id: attrDef.id,
|
|
92
|
+
name: attrDef.name,
|
|
93
|
+
label: attrDef.label,
|
|
94
|
+
dataType: attrDef.dataType,
|
|
95
|
+
isArray: attrDef.isArray,
|
|
96
|
+
isRequired: attrDef.isRequired,
|
|
97
|
+
isVisible: attrDef.isVisible,
|
|
98
|
+
isReadOnly: attrDef.isReadOnly,
|
|
99
|
+
order: attrDef.order,
|
|
100
|
+
rules: attrDef.rules ?? [],
|
|
101
|
+
isValueChanged: true,
|
|
102
|
+
};
|
|
103
|
+
if (attrDef.dataType === 'AsDetail') {
|
|
104
|
+
// Server expects attr.value null for AsDetail; the nested PO carries the data.
|
|
105
|
+
attr.value = null;
|
|
106
|
+
attr.asDetailType = attrDef.asDetailType;
|
|
107
|
+
const nestedType = attrDef.asDetailType ? resolve(attrDef.asDetailType) : undefined;
|
|
108
|
+
if (!nestedType) {
|
|
109
|
+
attr.object = null;
|
|
110
|
+
attr.objects = attrDef.isArray ? [] : null;
|
|
111
|
+
return attr;
|
|
112
|
+
}
|
|
113
|
+
if (attrDef.isArray) {
|
|
114
|
+
const items = Array.isArray(raw) ? raw : [];
|
|
115
|
+
attr.objects = items.map(item => dictToNestedPo(item ?? {}, nestedType, resolve));
|
|
116
|
+
}
|
|
117
|
+
else {
|
|
118
|
+
attr.object = raw ? dictToNestedPo(raw, nestedType, resolve) : null;
|
|
119
|
+
}
|
|
120
|
+
return attr;
|
|
121
|
+
}
|
|
122
|
+
attr.value = raw;
|
|
123
|
+
return attr;
|
|
124
|
+
}
|
|
125
|
+
|
|
43
126
|
/**
|
|
44
127
|
* Generated bundle index. Do not edit.
|
|
45
128
|
*/
|
|
46
129
|
|
|
47
|
-
export { ELookupDisplayType, ShowedOn, currentLanguage, hasShowedOnFlag, resolveTranslation };
|
|
130
|
+
export { ELookupDisplayType, ShowedOn, currentLanguage, dictToNestedPo, hasShowedOnFlag, nestedPoToDict, resolveTranslation };
|
|
48
131
|
//# sourceMappingURL=mintplayer-ng-spark-models.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mintplayer-ng-spark-models.mjs","sources":["../../models/src/translated-string.ts","../../models/src/showed-on.ts","../../models/src/lookup-reference.ts","../../models/mintplayer-ng-spark-models.ts"],"sourcesContent":["import { signal, type WritableSignal } from '@angular/core';\n\nexport type TranslatedString = Record<string, string>;\n\n/** Global reactive language state — shared across library boundaries via globalThis */\nexport const currentLanguage: WritableSignal<string> =\n ((globalThis as any).__sparkCurrentLanguage ??= signal('en'));\n\nexport function resolveTranslation(ts: TranslatedString | undefined, lang?: string): string {\n if (!ts) return '';\n const language = lang ?? currentLanguage();\n return ts[language] ?? ts['en'] ?? Object.values(ts)[0] ?? '';\n}\n","/**\n * Flags enum controlling on which pages an attribute should be displayed.\n * Values can be combined: ShowedOn.Query | ShowedOn.PersistentObject\n */\nexport enum ShowedOn {\n Query = 1,\n PersistentObject = 2,\n}\n\n/**\n * Helper function to check if a ShowedOn value includes a specific flag.\n */\nexport function hasShowedOnFlag(value: ShowedOn | string | undefined, flag: ShowedOn): boolean {\n if (value === undefined) return true; // Default: show on all pages\n\n // Handle string values from JSON (e.g., \"Query, PersistentObject\")\n if (typeof value === 'string') {\n const parts = value.split(',').map(s => s.trim());\n const flagName = ShowedOn[flag];\n return parts.includes(flagName);\n }\n\n // Handle numeric flag values\n return (value & flag) === flag;\n}\n","import { TranslatedString } from './translated-string';\n\nexport enum ELookupDisplayType {\n Dropdown = 0,\n Modal = 1\n}\n\nexport interface LookupReferenceListItem {\n name: string;\n isTransient: boolean;\n valueCount: number;\n displayType: ELookupDisplayType;\n}\n\nexport interface LookupReference {\n name: string;\n isTransient: boolean;\n displayType: ELookupDisplayType;\n values: LookupReferenceValue[];\n}\n\nexport interface LookupReferenceValue {\n key: string;\n values: TranslatedString;\n isActive: boolean;\n extra?: Record<string, unknown>;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;AAIA;AACO,MAAM,eAAe,IACxB,UAAkB,CAAC,sBAAsB,KAAK,MAAM,CAAC,IAAI,CAAC;AAExD,SAAU,kBAAkB,CAAC,EAAgC,EAAE,IAAa,EAAA;AAChF,IAAA,IAAI,CAAC,EAAE;AAAE,QAAA,OAAO,EAAE;AAClB,IAAA,MAAM,QAAQ,GAAG,IAAI,IAAI,eAAe,EAAE;IAC1C,OAAO,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,IAAI,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE;AAC/D;;ACZA;;;AAGG;IACS;AAAZ,CAAA,UAAY,QAAQ,EAAA;AAClB,IAAA,QAAA,CAAA,QAAA,CAAA,OAAA,CAAA,GAAA,CAAA,CAAA,GAAA,OAAS;AACT,IAAA,QAAA,CAAA,QAAA,CAAA,kBAAA,CAAA,GAAA,CAAA,CAAA,GAAA,kBAAoB;AACtB,CAAC,EAHW,QAAQ,KAAR,QAAQ,GAAA,EAAA,CAAA,CAAA;AAKpB;;AAEG;AACG,SAAU,eAAe,CAAC,KAAoC,EAAE,IAAc,EAAA;IAClF,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,IAAI,CAAC;;AAGrC,IAAA,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;QAC7B,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC;AACjD,QAAA,MAAM,QAAQ,GAAG,QAAQ,CAAC,IAAI,CAAC;AAC/B,QAAA,OAAO,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC;IACjC;;AAGA,IAAA,OAAO,CAAC,KAAK,GAAG,IAAI,MAAM,IAAI;AAChC;;ICtBY;AAAZ,CAAA,UAAY,kBAAkB,EAAA;AAC5B,IAAA,kBAAA,CAAA,kBAAA,CAAA,UAAA,CAAA,GAAA,CAAA,CAAA,GAAA,UAAY;AACZ,IAAA,kBAAA,CAAA,kBAAA,CAAA,OAAA,CAAA,GAAA,CAAA,CAAA,GAAA,OAAS;AACX,CAAC,EAHW,kBAAkB,KAAlB,kBAAkB,GAAA,EAAA,CAAA,CAAA;;
|
|
1
|
+
{"version":3,"file":"mintplayer-ng-spark-models.mjs","sources":["../../models/src/translated-string.ts","../../models/src/showed-on.ts","../../models/src/lookup-reference.ts","../../models/src/as-detail-conversions.ts","../../models/mintplayer-ng-spark-models.ts"],"sourcesContent":["import { signal, type WritableSignal } from '@angular/core';\n\nexport type TranslatedString = Record<string, string>;\n\n/** Global reactive language state — shared across library boundaries via globalThis */\nexport const currentLanguage: WritableSignal<string> =\n ((globalThis as any).__sparkCurrentLanguage ??= signal('en'));\n\nexport function resolveTranslation(ts: TranslatedString | undefined, lang?: string): string {\n if (!ts) return '';\n const language = lang ?? currentLanguage();\n return ts[language] ?? ts['en'] ?? Object.values(ts)[0] ?? '';\n}\n","/**\n * Flags enum controlling on which pages an attribute should be displayed.\n * Values can be combined: ShowedOn.Query | ShowedOn.PersistentObject\n */\nexport enum ShowedOn {\n Query = 1,\n PersistentObject = 2,\n}\n\n/**\n * Helper function to check if a ShowedOn value includes a specific flag.\n */\nexport function hasShowedOnFlag(value: ShowedOn | string | undefined, flag: ShowedOn): boolean {\n if (value === undefined) return true; // Default: show on all pages\n\n // Handle string values from JSON (e.g., \"Query, PersistentObject\")\n if (typeof value === 'string') {\n const parts = value.split(',').map(s => s.trim());\n const flagName = ShowedOn[flag];\n return parts.includes(flagName);\n }\n\n // Handle numeric flag values\n return (value & flag) === flag;\n}\n","import { TranslatedString } from './translated-string';\n\nexport enum ELookupDisplayType {\n Dropdown = 0,\n Modal = 1\n}\n\nexport interface LookupReferenceListItem {\n name: string;\n isTransient: boolean;\n valueCount: number;\n displayType: ELookupDisplayType;\n}\n\nexport interface LookupReference {\n name: string;\n isTransient: boolean;\n displayType: ELookupDisplayType;\n values: LookupReferenceValue[];\n}\n\nexport interface LookupReferenceValue {\n key: string;\n values: TranslatedString;\n isActive: boolean;\n extra?: Record<string, unknown>;\n}\n","import { EntityAttributeDefinition } from './entity-type';\nimport { EntityType } from './entity-type';\nimport { PersistentObject } from './persistent-object';\nimport { PersistentObjectAttribute } from './persistent-object-attribute';\n\n/**\n * Resolves an `EntityType` by its CLR type name (e.g. `\"HR.Entities.Address\"`).\n * Callers typically close over `sparkService.getEntityTypes()`'s cached list.\n */\nexport type EntityTypeResolver = (clrTypeName: string) => EntityType | undefined;\n\n/**\n * Flattens a nested `PersistentObject` into the plain `Record<string, any>` shape the\n * form state uses throughout ng-spark. Primitive / reference attributes contribute their\n * `value`; nested AsDetail attributes recurse — single becomes an inner dict, array\n * becomes an array of inner dicts. Returns `{}` for `null` / `undefined` input.\n *\n * This is the ONE place that reads the server's new AsDetail wire shape and collapses it\n * back to the flat dict the form components already handle.\n */\nexport function nestedPoToDict(po: PersistentObject | null | undefined): Record<string, any> {\n if (!po) return {};\n const dict: Record<string, any> = {};\n for (const attr of po.attributes ?? []) {\n dict[attr.name] = attributeValueForForm(attr);\n }\n return dict;\n}\n\nfunction attributeValueForForm(attr: PersistentObjectAttribute): any {\n if (attr.dataType === 'AsDetail') {\n if (attr.isArray) return (attr.objects ?? []).map(po => nestedPoToDict(po));\n return attr.object ? nestedPoToDict(attr.object) : null;\n }\n return attr.value;\n}\n\n/**\n * Builds a nested `PersistentObject` from a flat dict against the schema in\n * <paramref name=\"entityType\"/>. Used when the form is about to save — AsDetail attributes\n * are no longer sent as flat dicts in `attribute.value`; the server now requires\n * `attribute.object` / `attribute.objects` with fully scaffolded nested POs.\n *\n * `resolve` walks through AsDetail types registered elsewhere (usually the full\n * `getEntityTypes()` list, keyed by CLR type name). Nested AsDetail inside AsDetail is\n * handled recursively.\n */\nexport function dictToNestedPo(\n dict: Record<string, any> | null | undefined,\n entityType: EntityType,\n resolve: EntityTypeResolver,\n): PersistentObject {\n const attributes: PersistentObjectAttribute[] = (entityType.attributes ?? [])\n .map(attrDef => buildAttribute(attrDef, dict?.[attrDef.name], resolve));\n\n return {\n id: (dict?.['Id'] as string) ?? (dict?.['id'] as string) ?? '',\n name: entityType.name,\n objectTypeId: entityType.id,\n attributes,\n };\n}\n\nfunction buildAttribute(\n attrDef: EntityAttributeDefinition,\n raw: any,\n resolve: EntityTypeResolver,\n): PersistentObjectAttribute {\n const attr: PersistentObjectAttribute = {\n id: attrDef.id,\n name: attrDef.name,\n label: attrDef.label,\n dataType: attrDef.dataType,\n isArray: attrDef.isArray,\n isRequired: attrDef.isRequired,\n isVisible: attrDef.isVisible,\n isReadOnly: attrDef.isReadOnly,\n order: attrDef.order,\n rules: attrDef.rules ?? [],\n isValueChanged: true,\n };\n\n if (attrDef.dataType === 'AsDetail') {\n // Server expects attr.value null for AsDetail; the nested PO carries the data.\n attr.value = null;\n attr.asDetailType = attrDef.asDetailType;\n\n const nestedType = attrDef.asDetailType ? resolve(attrDef.asDetailType) : undefined;\n if (!nestedType) {\n attr.object = null;\n attr.objects = attrDef.isArray ? [] : null;\n return attr;\n }\n\n if (attrDef.isArray) {\n const items: any[] = Array.isArray(raw) ? raw : [];\n attr.objects = items.map(item => dictToNestedPo((item as Record<string, any>) ?? {}, nestedType, resolve));\n } else {\n attr.object = raw ? dictToNestedPo(raw as Record<string, any>, nestedType, resolve) : null;\n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AAC,GAAG,CAAC,GAAG,GAAG,GAAG,EAAE;YAClD,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,GAAG,CAAC,IAAI,IAAI,cAAc,CAAE,IAA4B,IAAI,EAAE,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;QAC5G;aAAO;AACL,YAAA,IAAI,CAAC,MAAM,GAAG,GAAG,GAAG,cAAc,CAAC,GAA0B,EAAE,UAAU,EAAE,OAAO,CAAC,GAAG,IAAI;QAC5F;AACA,QAAA,OAAO,IAAI;IACb;AAEA,IAAA,IAAI,CAAC,KAAK,GAAG,GAAG;AAChB,IAAA,OAAO,IAAI;AACb;;ACzGA;;AAEG;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { inject, Pipe } from '@angular/core';
|
|
3
3
|
import { SparkLanguageService } from '@mintplayer/ng-spark/services';
|
|
4
|
-
import { resolveTranslation, ELookupDisplayType } from '@mintplayer/ng-spark/models';
|
|
4
|
+
import { resolveTranslation, nestedPoToDict, ELookupDisplayType } from '@mintplayer/ng-spark/models';
|
|
5
5
|
|
|
6
6
|
class TranslateKeyPipe {
|
|
7
7
|
lang = inject(SparkLanguageService);
|
|
@@ -64,12 +64,16 @@ class AttributeValuePipe {
|
|
|
64
64
|
if (attr.breadcrumb)
|
|
65
65
|
return attr.breadcrumb;
|
|
66
66
|
const attrDef = entityType?.attributes.find(a => a.name === attrName);
|
|
67
|
-
if (attrDef?.dataType === 'AsDetail'
|
|
68
|
-
|
|
69
|
-
|
|
67
|
+
if (attrDef?.dataType === 'AsDetail') {
|
|
68
|
+
// Server emits nested PO(s) in attr.objects (array) / attr.object (single) — attr.value is null.
|
|
69
|
+
if (attr.isArray) {
|
|
70
|
+
const count = attr.objects?.length ?? 0;
|
|
71
|
+
if (count === 0)
|
|
72
|
+
return '';
|
|
73
|
+
return `${count} item${count !== 1 ? 's' : ''}`;
|
|
70
74
|
}
|
|
71
|
-
if (
|
|
72
|
-
return this.formatAsDetailValue(attrDef, attr.
|
|
75
|
+
if (attr.object) {
|
|
76
|
+
return this.formatAsDetailValue(attrDef, nestedPoToDict(attr.object), allEntityTypes);
|
|
73
77
|
}
|
|
74
78
|
}
|
|
75
79
|
if (attrDef?.lookupReferenceType && attr.value != null && attr.value !== '') {
|
|
@@ -404,12 +408,25 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.6", ngImpor
|
|
|
404
408
|
args: [{ name: 'iconName', standalone: true, pure: true }]
|
|
405
409
|
}] });
|
|
406
410
|
|
|
411
|
+
/**
|
|
412
|
+
* Resolves an attribute to a list of flat row dicts for the detail-page table.
|
|
413
|
+
* AsDetail array attributes carry their data as nested PersistentObjects in
|
|
414
|
+
* <c>attr.objects</c>, not <c>attr.value</c> — the server stopped putting flat
|
|
415
|
+
* dicts in <c>value</c> when AsDetail moved to its dedicated wire shape. Without
|
|
416
|
+
* this branch, the detail page rendered AsDetail arrays as empty tables even
|
|
417
|
+
* when the edit page (which reads <c>attr.objects</c> directly) showed rows.
|
|
418
|
+
*/
|
|
407
419
|
class ArrayValuePipe {
|
|
408
420
|
transform(attrName, item) {
|
|
409
421
|
const attr = item?.attributes.find(a => a.name === attrName);
|
|
410
|
-
if (!attr
|
|
422
|
+
if (!attr)
|
|
411
423
|
return [];
|
|
412
|
-
|
|
424
|
+
if (attr.dataType === 'AsDetail' && attr.isArray && Array.isArray(attr.objects)) {
|
|
425
|
+
return attr.objects.map(po => nestedPoToDict(po));
|
|
426
|
+
}
|
|
427
|
+
if (Array.isArray(attr.value))
|
|
428
|
+
return attr.value;
|
|
429
|
+
return [];
|
|
413
430
|
}
|
|
414
431
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.6", ngImport: i0, type: ArrayValuePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
415
432
|
static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "21.1.6", ngImport: i0, type: ArrayValuePipe, isStandalone: true, name: "arrayValue" });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mintplayer-ng-spark-pipes.mjs","sources":["../../pipes/src/translate-key.pipe.ts","../../pipes/src/resolve-translation.pipe.ts","../../pipes/src/input-type.pipe.ts","../../pipes/src/attribute-value.pipe.ts","../../pipes/src/raw-attribute-value.pipe.ts","../../pipes/src/reference-display-value.pipe.ts","../../pipes/src/reference-attr-value.pipe.ts","../../pipes/src/reference-link-route.pipe.ts","../../pipes/src/router-link.pipe.ts","../../pipes/src/as-detail-type.pipe.ts","../../pipes/src/as-detail-columns.pipe.ts","../../pipes/src/as-detail-cell-value.pipe.ts","../../pipes/src/as-detail-display-value.pipe.ts","../../pipes/src/can-create-detail-row.pipe.ts","../../pipes/src/can-delete-detail-row.pipe.ts","../../pipes/src/lookup-display-type.pipe.ts","../../pipes/src/lookup-display-value.pipe.ts","../../pipes/src/lookup-options.pipe.ts","../../pipes/src/inline-ref-options.pipe.ts","../../pipes/src/error-for-attribute.pipe.ts","../../pipes/src/icon-name.pipe.ts","../../pipes/src/array-value.pipe.ts","../../pipes/mintplayer-ng-spark-pipes.ts"],"sourcesContent":["import { Pipe, PipeTransform, inject } from '@angular/core';\nimport { SparkLanguageService } from '@mintplayer/ng-spark/services';\n\n@Pipe({ name: 't', pure: false, standalone: true })\nexport class TranslateKeyPipe implements PipeTransform {\n private readonly lang = inject(SparkLanguageService);\n\n transform(key: string): string {\n return this.lang.t(key);\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { TranslatedString, resolveTranslation } from '@mintplayer/ng-spark/models';\n\n@Pipe({ name: 'resolveTranslation', standalone: true, pure: false })\nexport class ResolveTranslationPipe implements PipeTransform {\n transform(value: TranslatedString | undefined, fallback?: string): string {\n return resolveTranslation(value) || fallback || '';\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\n\n@Pipe({ name: 'inputType', standalone: true, pure: true })\nexport class InputTypePipe implements PipeTransform {\n transform(dataType: string): string {\n switch (dataType) {\n case 'number':\n case 'decimal':\n return 'number';\n case 'boolean':\n return 'checkbox';\n case 'datetime':\n return 'datetime-local';\n case 'date':\n return 'date';\n case 'color':\n return 'color';\n default:\n return 'text';\n }\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { EntityAttributeDefinition, EntityType, LookupReference, PersistentObject, resolveTranslation } from '@mintplayer/ng-spark/models';\n\n@Pipe({ name: 'attributeValue', standalone: true, pure: true })\nexport class AttributeValuePipe implements PipeTransform {\n transform(attrName: string, item: PersistentObject | null, entityType: EntityType | null, lookupRefOptions: Record<string, LookupReference>, allEntityTypes: EntityType[]): any {\n if (!item) return '';\n const attr = item.attributes.find(a => a.name === attrName);\n if (!attr) return '';\n\n if (attr.breadcrumb) return attr.breadcrumb;\n\n const attrDef = entityType?.attributes.find(a => a.name === attrName);\n if (attrDef?.dataType === 'AsDetail' && attr.value) {\n if (Array.isArray(attr.value)) {\n return `${attr.value.length} item${attr.value.length !== 1 ? 's' : ''}`;\n }\n if (typeof attr.value === 'object') {\n return this.formatAsDetailValue(attrDef, attr.value, allEntityTypes);\n }\n }\n\n if (attrDef?.lookupReferenceType && attr.value != null && attr.value !== '') {\n const lookupRef = lookupRefOptions[attrDef.lookupReferenceType];\n if (lookupRef) {\n const option = lookupRef.values.find(v => v.key === String(attr.value));\n if (option) {\n return resolveTranslation(option.values) || option.key;\n }\n }\n }\n\n if (attrDef?.dataType === 'boolean') {\n return attr.value ?? null;\n }\n\n return attr.value ?? '';\n }\n\n private formatAsDetailValue(attrDef: EntityAttributeDefinition, value: Record<string, any>, allEntityTypes: EntityType[]): string {\n const asDetailType = allEntityTypes.find(t => t.clrType === attrDef.asDetailType);\n\n if (asDetailType?.displayFormat) {\n const result = this.resolveDisplayFormat(asDetailType.displayFormat, value);\n if (result && result.trim()) return result;\n }\n\n if (asDetailType?.displayAttribute && value[asDetailType.displayAttribute]) {\n return value[asDetailType.displayAttribute];\n }\n\n const displayProps = ['Name', 'Title', 'Street', 'name', 'title'];\n for (const prop of displayProps) {\n if (value[prop]) return value[prop];\n }\n\n return '(object)';\n }\n\n private resolveDisplayFormat(format: string, data: Record<string, any>): string {\n return format.replace(/\\{(\\w+)\\}/g, (match, propertyName) => {\n const value = data[propertyName];\n return value != null ? String(value) : '';\n });\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { PersistentObject } from '@mintplayer/ng-spark/models';\n\n@Pipe({ name: 'rawAttributeValue', standalone: true, pure: true })\nexport class RawAttributeValuePipe implements PipeTransform {\n transform(attrName: string, item: PersistentObject | null): any {\n return item?.attributes.find(a => a.name === attrName)?.value;\n }\n}\n","import { Pipe, PipeTransform, inject } from '@angular/core';\nimport { EntityAttributeDefinition, PersistentObject } from '@mintplayer/ng-spark/models';\nimport { SparkLanguageService } from '@mintplayer/ng-spark/services';\n\n@Pipe({ name: 'referenceDisplayValue', standalone: true, pure: true })\nexport class ReferenceDisplayValuePipe implements PipeTransform {\n private readonly lang = inject(SparkLanguageService);\n\n transform(attr: EntityAttributeDefinition, formData: Record<string, any>, referenceOptions: Record<string, PersistentObject[]>): string {\n const selectedId = formData[attr.name];\n if (!selectedId) return this.lang.t('notSelected');\n\n const options = referenceOptions[attr.name] || [];\n const selected = options.find(o => o.id === selectedId);\n return selected?.breadcrumb || selected?.name || selectedId;\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { PersistentObject } from '@mintplayer/ng-spark/models';\n\n@Pipe({ name: 'referenceAttrValue', standalone: true, pure: true })\nexport class ReferenceAttrValuePipe implements PipeTransform {\n transform(item: PersistentObject, attrName: string): any {\n const attr = item.attributes.find(a => a.name === attrName);\n if (!attr) return '';\n if (attr.breadcrumb) return attr.breadcrumb;\n return attr.value ?? '';\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { EntityType } from '@mintplayer/ng-spark/models';\n\n@Pipe({ name: 'referenceLinkRoute', standalone: true, pure: true })\nexport class ReferenceLinkRoutePipe implements PipeTransform {\n transform(referenceClrType: string, referenceId: any, allEntityTypes: EntityType[]): string[] | null {\n if (!referenceId || !referenceClrType) return null;\n const targetType = allEntityTypes.find(t => t.clrType === referenceClrType);\n if (!targetType) return null;\n return ['/po', targetType.alias || targetType.id, referenceId];\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { ProgramUnit } from '@mintplayer/ng-spark/models';\n\n@Pipe({ name: 'routerLink', standalone: true, pure: true })\nexport class RouterLinkPipe implements PipeTransform {\n transform(unit: ProgramUnit): string[] {\n if (unit.type === 'query') {\n return ['/query', unit.alias || unit.queryId!];\n } else if (unit.type === 'persistentObject') {\n return ['/po', unit.alias || unit.persistentObjectId!];\n }\n return ['/'];\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { EntityAttributeDefinition, EntityType } from '@mintplayer/ng-spark/models';\n\n@Pipe({ name: 'asDetailType', standalone: true, pure: true })\nexport class AsDetailTypePipe implements PipeTransform {\n transform(attr: EntityAttributeDefinition, asDetailTypes: Record<string, EntityType>): EntityType | null {\n return asDetailTypes[attr.name] || null;\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { EntityAttributeDefinition, EntityType } from '@mintplayer/ng-spark/models';\n\n@Pipe({ name: 'asDetailColumns', standalone: true, pure: true })\nexport class AsDetailColumnsPipe implements PipeTransform {\n transform(attr: EntityAttributeDefinition, asDetailTypes: Record<string, EntityType>): EntityAttributeDefinition[] {\n const type = asDetailTypes[attr.name];\n if (!type) return [];\n return type.attributes\n .filter(a => a.isVisible)\n .sort((a, b) => a.order - b.order);\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { EntityAttributeDefinition, PersistentObject } from '@mintplayer/ng-spark/models';\n\n@Pipe({ name: 'asDetailCellValue', standalone: true, pure: true })\nexport class AsDetailCellValuePipe implements PipeTransform {\n transform(row: Record<string, any>, parentAttr: EntityAttributeDefinition, col: EntityAttributeDefinition, asDetailRefOptions: Record<string, Record<string, PersistentObject[]>>): string {\n const value = row[col.name];\n if (value == null) return '';\n\n if (col.dataType === 'Reference' && col.query) {\n const parentOptions = asDetailRefOptions[parentAttr.name];\n if (parentOptions) {\n const options = parentOptions[col.name];\n if (options) {\n const match = options.find(o => o.id === value);\n if (match) return match.breadcrumb || match.name || String(value);\n }\n }\n }\n\n return String(value);\n }\n}\n","import { Pipe, PipeTransform, inject } from '@angular/core';\nimport { EntityAttributeDefinition, EntityType } from '@mintplayer/ng-spark/models';\nimport { SparkLanguageService } from '@mintplayer/ng-spark/services';\n\n@Pipe({ name: 'asDetailDisplayValue', standalone: true, pure: true })\nexport class AsDetailDisplayValuePipe implements PipeTransform {\n private readonly lang = inject(SparkLanguageService);\n\n transform(attr: EntityAttributeDefinition, formData: Record<string, any>, asDetailTypes: Record<string, EntityType>): string {\n const value = formData[attr.name];\n if (!value) return this.lang.t('notSet');\n\n const asDetailType = asDetailTypes[attr.name] || null;\n\n // 1. Try displayFormat (template with {PropertyName} placeholders)\n if (asDetailType?.displayFormat) {\n const result = this.resolveDisplayFormat(asDetailType.displayFormat, value);\n if (result && result.trim()) return result;\n }\n\n // 2. Try displayAttribute (single property name)\n if (asDetailType?.displayAttribute && value[asDetailType.displayAttribute]) {\n return value[asDetailType.displayAttribute];\n }\n\n // 3. Fallback to common property names\n const displayProps = ['Name', 'Title', 'Street', 'name', 'title'];\n for (const prop of displayProps) {\n if (value[prop]) return value[prop];\n }\n\n return this.lang.t('clickToEdit');\n }\n\n private resolveDisplayFormat(format: string, data: Record<string, any>): string {\n return format.replace(/\\{(\\w+)\\}/g, (match, propertyName) => {\n const value = data[propertyName];\n return value != null ? String(value) : '';\n });\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { EntityAttributeDefinition, EntityPermissions } from '@mintplayer/ng-spark/models';\n\n@Pipe({ name: 'canCreateDetailRow', standalone: true, pure: true })\nexport class CanCreateDetailRowPipe implements PipeTransform {\n transform(attr: EntityAttributeDefinition, permissions: Record<string, EntityPermissions>): boolean {\n const perms = permissions[attr.name];\n return perms ? perms.canCreate : true;\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { EntityAttributeDefinition, EntityPermissions } from '@mintplayer/ng-spark/models';\n\n@Pipe({ name: 'canDeleteDetailRow', standalone: true, pure: true })\nexport class CanDeleteDetailRowPipe implements PipeTransform {\n transform(attr: EntityAttributeDefinition, permissions: Record<string, EntityPermissions>): boolean {\n const perms = permissions[attr.name];\n return perms ? perms.canDelete : true;\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { ELookupDisplayType, EntityAttributeDefinition, LookupReference } from '@mintplayer/ng-spark/models';\n\n@Pipe({ name: 'lookupDisplayType', standalone: true, pure: true })\nexport class LookupDisplayTypePipe implements PipeTransform {\n transform(attr: EntityAttributeDefinition, lookupRefOptions: Record<string, LookupReference>): ELookupDisplayType {\n const lookupRef = attr.lookupReferenceType ? lookupRefOptions[attr.lookupReferenceType] : null;\n return lookupRef?.displayType ?? ELookupDisplayType.Dropdown;\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { EntityAttributeDefinition, LookupReference, resolveTranslation } from '@mintplayer/ng-spark/models';\n\n@Pipe({ name: 'lookupDisplayValue', standalone: true, pure: true })\nexport class LookupDisplayValuePipe implements PipeTransform {\n transform(attr: EntityAttributeDefinition, formData: Record<string, any>, lookupRefOptions: Record<string, LookupReference>): string {\n const currentValue = formData[attr.name];\n if (currentValue == null || currentValue === '') return '';\n\n const lookupRef = attr.lookupReferenceType ? lookupRefOptions[attr.lookupReferenceType] : null;\n const options = lookupRef?.values.filter(v => v.isActive) || [];\n const selected = options.find(o => o.key === String(currentValue));\n if (!selected) return String(currentValue);\n\n return resolveTranslation(selected.values) || selected.key;\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { EntityAttributeDefinition, LookupReference, LookupReferenceValue } from '@mintplayer/ng-spark/models';\n\n@Pipe({ name: 'lookupOptions', standalone: true, pure: true })\nexport class LookupOptionsPipe implements PipeTransform {\n transform(attr: EntityAttributeDefinition, lookupRefOptions: Record<string, LookupReference>): LookupReferenceValue[] {\n const lookupRef = attr.lookupReferenceType ? lookupRefOptions[attr.lookupReferenceType] : null;\n return lookupRef?.values.filter(v => v.isActive) || [];\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { EntityAttributeDefinition, PersistentObject } from '@mintplayer/ng-spark/models';\n\n@Pipe({ name: 'inlineRefOptions', standalone: true, pure: true })\nexport class InlineRefOptionsPipe implements PipeTransform {\n transform(parentAttr: EntityAttributeDefinition, col: EntityAttributeDefinition, asDetailRefOptions: Record<string, Record<string, PersistentObject[]>>): PersistentObject[] {\n return asDetailRefOptions[parentAttr.name]?.[col.name] || [];\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { ValidationError, resolveTranslation } from '@mintplayer/ng-spark/models';\n\n@Pipe({ name: 'errorForAttribute', standalone: true, pure: true })\nexport class ErrorForAttributePipe implements PipeTransform {\n transform(attrName: string, validationErrors: ValidationError[]): string | null {\n const error = validationErrors.find(e => e.attributeName === attrName);\n return error ? resolveTranslation(error.errorMessage) : null;\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\n\n@Pipe({ name: 'iconName', standalone: true, pure: true })\nexport class IconNamePipe implements PipeTransform {\n transform(value: string | undefined, fallback: string): string {\n const iconClass = value || fallback;\n // Strip 'bi-' prefix if present\n return iconClass.startsWith('bi-') ? iconClass.substring(3) : iconClass;\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { PersistentObject } from '@mintplayer/ng-spark/models';\n\n@Pipe({ name: 'arrayValue', standalone: true, pure: true })\nexport class ArrayValuePipe implements PipeTransform {\n transform(attrName: string, item: PersistentObject | null): Record<string, any>[] {\n const attr = item?.attributes.find(a => a.name === attrName);\n if (!attr || !Array.isArray(attr.value)) return [];\n return attr.value;\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;MAIa,gBAAgB,CAAA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,YAAA,OAAO,EAAE;QAClD,OAAO,IAAI,CAAC,KAAK;IACnB;uGALW,cAAc,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA;qGAAd,cAAc,EAAA,YAAA,EAAA,IAAA,EAAA,IAAA,EAAA,YAAA,EAAA,CAAA;;2FAAd,cAAc,EAAA,UAAA,EAAA,CAAA;kBAD1B,IAAI;mBAAC,EAAE,IAAI,EAAE,YAAY,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE;;;ACH1D;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"mintplayer-ng-spark-pipes.mjs","sources":["../../pipes/src/translate-key.pipe.ts","../../pipes/src/resolve-translation.pipe.ts","../../pipes/src/input-type.pipe.ts","../../pipes/src/attribute-value.pipe.ts","../../pipes/src/raw-attribute-value.pipe.ts","../../pipes/src/reference-display-value.pipe.ts","../../pipes/src/reference-attr-value.pipe.ts","../../pipes/src/reference-link-route.pipe.ts","../../pipes/src/router-link.pipe.ts","../../pipes/src/as-detail-type.pipe.ts","../../pipes/src/as-detail-columns.pipe.ts","../../pipes/src/as-detail-cell-value.pipe.ts","../../pipes/src/as-detail-display-value.pipe.ts","../../pipes/src/can-create-detail-row.pipe.ts","../../pipes/src/can-delete-detail-row.pipe.ts","../../pipes/src/lookup-display-type.pipe.ts","../../pipes/src/lookup-display-value.pipe.ts","../../pipes/src/lookup-options.pipe.ts","../../pipes/src/inline-ref-options.pipe.ts","../../pipes/src/error-for-attribute.pipe.ts","../../pipes/src/icon-name.pipe.ts","../../pipes/src/array-value.pipe.ts","../../pipes/mintplayer-ng-spark-pipes.ts"],"sourcesContent":["import { Pipe, PipeTransform, inject } from '@angular/core';\nimport { SparkLanguageService } from '@mintplayer/ng-spark/services';\n\n@Pipe({ name: 't', pure: false, standalone: true })\nexport class TranslateKeyPipe implements PipeTransform {\n private readonly lang = inject(SparkLanguageService);\n\n transform(key: string): string {\n return this.lang.t(key);\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { TranslatedString, resolveTranslation } from '@mintplayer/ng-spark/models';\n\n@Pipe({ name: 'resolveTranslation', standalone: true, pure: false })\nexport class ResolveTranslationPipe implements PipeTransform {\n transform(value: TranslatedString | undefined, fallback?: string): string {\n return resolveTranslation(value) || fallback || '';\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\n\n@Pipe({ name: 'inputType', standalone: true, pure: true })\nexport class InputTypePipe implements PipeTransform {\n transform(dataType: string): string {\n switch (dataType) {\n case 'number':\n case 'decimal':\n return 'number';\n case 'boolean':\n return 'checkbox';\n case 'datetime':\n return 'datetime-local';\n case 'date':\n return 'date';\n case 'color':\n return 'color';\n default:\n return 'text';\n }\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { EntityAttributeDefinition, EntityType, LookupReference, PersistentObject, nestedPoToDict, resolveTranslation } from '@mintplayer/ng-spark/models';\n\n@Pipe({ name: 'attributeValue', standalone: true, pure: true })\nexport class AttributeValuePipe implements PipeTransform {\n transform(attrName: string, item: PersistentObject | null, entityType: EntityType | null, lookupRefOptions: Record<string, LookupReference>, allEntityTypes: EntityType[]): any {\n if (!item) return '';\n const attr = item.attributes.find(a => a.name === attrName);\n if (!attr) return '';\n\n if (attr.breadcrumb) return attr.breadcrumb;\n\n const attrDef = entityType?.attributes.find(a => a.name === attrName);\n if (attrDef?.dataType === 'AsDetail') {\n // Server emits nested PO(s) in attr.objects (array) / attr.object (single) — attr.value is null.\n if (attr.isArray) {\n const count = attr.objects?.length ?? 0;\n if (count === 0) return '';\n return `${count} item${count !== 1 ? 's' : ''}`;\n }\n if (attr.object) {\n return this.formatAsDetailValue(attrDef, nestedPoToDict(attr.object), allEntityTypes);\n }\n }\n\n if (attrDef?.lookupReferenceType && attr.value != null && attr.value !== '') {\n const lookupRef = lookupRefOptions[attrDef.lookupReferenceType];\n if (lookupRef) {\n const option = lookupRef.values.find(v => v.key === String(attr.value));\n if (option) {\n return resolveTranslation(option.values) || option.key;\n }\n }\n }\n\n if (attrDef?.dataType === 'boolean') {\n return attr.value ?? null;\n }\n\n return attr.value ?? '';\n }\n\n private formatAsDetailValue(attrDef: EntityAttributeDefinition, value: Record<string, any>, allEntityTypes: EntityType[]): string {\n const asDetailType = allEntityTypes.find(t => t.clrType === attrDef.asDetailType);\n\n if (asDetailType?.displayFormat) {\n const result = this.resolveDisplayFormat(asDetailType.displayFormat, value);\n if (result && result.trim()) return result;\n }\n\n if (asDetailType?.displayAttribute && value[asDetailType.displayAttribute]) {\n return value[asDetailType.displayAttribute];\n }\n\n const displayProps = ['Name', 'Title', 'Street', 'name', 'title'];\n for (const prop of displayProps) {\n if (value[prop]) return value[prop];\n }\n\n return '(object)';\n }\n\n private resolveDisplayFormat(format: string, data: Record<string, any>): string {\n return format.replace(/\\{(\\w+)\\}/g, (match, propertyName) => {\n const value = data[propertyName];\n return value != null ? String(value) : '';\n });\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { PersistentObject } from '@mintplayer/ng-spark/models';\n\n@Pipe({ name: 'rawAttributeValue', standalone: true, pure: true })\nexport class RawAttributeValuePipe implements PipeTransform {\n transform(attrName: string, item: PersistentObject | null): any {\n return item?.attributes.find(a => a.name === attrName)?.value;\n }\n}\n","import { Pipe, PipeTransform, inject } from '@angular/core';\nimport { EntityAttributeDefinition, PersistentObject } from '@mintplayer/ng-spark/models';\nimport { SparkLanguageService } from '@mintplayer/ng-spark/services';\n\n@Pipe({ name: 'referenceDisplayValue', standalone: true, pure: true })\nexport class ReferenceDisplayValuePipe implements PipeTransform {\n private readonly lang = inject(SparkLanguageService);\n\n transform(attr: EntityAttributeDefinition, formData: Record<string, any>, referenceOptions: Record<string, PersistentObject[]>): string {\n const selectedId = formData[attr.name];\n if (!selectedId) return this.lang.t('notSelected');\n\n const options = referenceOptions[attr.name] || [];\n const selected = options.find(o => o.id === selectedId);\n return selected?.breadcrumb || selected?.name || selectedId;\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { PersistentObject } from '@mintplayer/ng-spark/models';\n\n@Pipe({ name: 'referenceAttrValue', standalone: true, pure: true })\nexport class ReferenceAttrValuePipe implements PipeTransform {\n transform(item: PersistentObject, attrName: string): any {\n const attr = item.attributes.find(a => a.name === attrName);\n if (!attr) return '';\n if (attr.breadcrumb) return attr.breadcrumb;\n return attr.value ?? '';\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { EntityType } from '@mintplayer/ng-spark/models';\n\n@Pipe({ name: 'referenceLinkRoute', standalone: true, pure: true })\nexport class ReferenceLinkRoutePipe implements PipeTransform {\n transform(referenceClrType: string, referenceId: any, allEntityTypes: EntityType[]): string[] | null {\n if (!referenceId || !referenceClrType) return null;\n const targetType = allEntityTypes.find(t => t.clrType === referenceClrType);\n if (!targetType) return null;\n return ['/po', targetType.alias || targetType.id, referenceId];\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { ProgramUnit } from '@mintplayer/ng-spark/models';\n\n@Pipe({ name: 'routerLink', standalone: true, pure: true })\nexport class RouterLinkPipe implements PipeTransform {\n transform(unit: ProgramUnit): string[] {\n if (unit.type === 'query') {\n return ['/query', unit.alias || unit.queryId!];\n } else if (unit.type === 'persistentObject') {\n return ['/po', unit.alias || unit.persistentObjectId!];\n }\n return ['/'];\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { EntityAttributeDefinition, EntityType } from '@mintplayer/ng-spark/models';\n\n@Pipe({ name: 'asDetailType', standalone: true, pure: true })\nexport class AsDetailTypePipe implements PipeTransform {\n transform(attr: EntityAttributeDefinition, asDetailTypes: Record<string, EntityType>): EntityType | null {\n return asDetailTypes[attr.name] || null;\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { EntityAttributeDefinition, EntityType } from '@mintplayer/ng-spark/models';\n\n@Pipe({ name: 'asDetailColumns', standalone: true, pure: true })\nexport class AsDetailColumnsPipe implements PipeTransform {\n transform(attr: EntityAttributeDefinition, asDetailTypes: Record<string, EntityType>): EntityAttributeDefinition[] {\n const type = asDetailTypes[attr.name];\n if (!type) return [];\n return type.attributes\n .filter(a => a.isVisible)\n .sort((a, b) => a.order - b.order);\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { EntityAttributeDefinition, PersistentObject } from '@mintplayer/ng-spark/models';\n\n@Pipe({ name: 'asDetailCellValue', standalone: true, pure: true })\nexport class AsDetailCellValuePipe implements PipeTransform {\n transform(row: Record<string, any>, parentAttr: EntityAttributeDefinition, col: EntityAttributeDefinition, asDetailRefOptions: Record<string, Record<string, PersistentObject[]>>): string {\n const value = row[col.name];\n if (value == null) return '';\n\n if (col.dataType === 'Reference' && col.query) {\n const parentOptions = asDetailRefOptions[parentAttr.name];\n if (parentOptions) {\n const options = parentOptions[col.name];\n if (options) {\n const match = options.find(o => o.id === value);\n if (match) return match.breadcrumb || match.name || String(value);\n }\n }\n }\n\n return String(value);\n }\n}\n","import { Pipe, PipeTransform, inject } from '@angular/core';\nimport { EntityAttributeDefinition, EntityType } from '@mintplayer/ng-spark/models';\nimport { SparkLanguageService } from '@mintplayer/ng-spark/services';\n\n@Pipe({ name: 'asDetailDisplayValue', standalone: true, pure: true })\nexport class AsDetailDisplayValuePipe implements PipeTransform {\n private readonly lang = inject(SparkLanguageService);\n\n transform(attr: EntityAttributeDefinition, formData: Record<string, any>, asDetailTypes: Record<string, EntityType>): string {\n const value = formData[attr.name];\n if (!value) return this.lang.t('notSet');\n\n const asDetailType = asDetailTypes[attr.name] || null;\n\n // 1. Try displayFormat (template with {PropertyName} placeholders)\n if (asDetailType?.displayFormat) {\n const result = this.resolveDisplayFormat(asDetailType.displayFormat, value);\n if (result && result.trim()) return result;\n }\n\n // 2. Try displayAttribute (single property name)\n if (asDetailType?.displayAttribute && value[asDetailType.displayAttribute]) {\n return value[asDetailType.displayAttribute];\n }\n\n // 3. Fallback to common property names\n const displayProps = ['Name', 'Title', 'Street', 'name', 'title'];\n for (const prop of displayProps) {\n if (value[prop]) return value[prop];\n }\n\n return this.lang.t('clickToEdit');\n }\n\n private resolveDisplayFormat(format: string, data: Record<string, any>): string {\n return format.replace(/\\{(\\w+)\\}/g, (match, propertyName) => {\n const value = data[propertyName];\n return value != null ? String(value) : '';\n });\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { EntityAttributeDefinition, EntityPermissions } from '@mintplayer/ng-spark/models';\n\n@Pipe({ name: 'canCreateDetailRow', standalone: true, pure: true })\nexport class CanCreateDetailRowPipe implements PipeTransform {\n transform(attr: EntityAttributeDefinition, permissions: Record<string, EntityPermissions>): boolean {\n const perms = permissions[attr.name];\n return perms ? perms.canCreate : true;\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { EntityAttributeDefinition, EntityPermissions } from '@mintplayer/ng-spark/models';\n\n@Pipe({ name: 'canDeleteDetailRow', standalone: true, pure: true })\nexport class CanDeleteDetailRowPipe implements PipeTransform {\n transform(attr: EntityAttributeDefinition, permissions: Record<string, EntityPermissions>): boolean {\n const perms = permissions[attr.name];\n return perms ? perms.canDelete : true;\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { ELookupDisplayType, EntityAttributeDefinition, LookupReference } from '@mintplayer/ng-spark/models';\n\n@Pipe({ name: 'lookupDisplayType', standalone: true, pure: true })\nexport class LookupDisplayTypePipe implements PipeTransform {\n transform(attr: EntityAttributeDefinition, lookupRefOptions: Record<string, LookupReference>): ELookupDisplayType {\n const lookupRef = attr.lookupReferenceType ? lookupRefOptions[attr.lookupReferenceType] : null;\n return lookupRef?.displayType ?? ELookupDisplayType.Dropdown;\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { EntityAttributeDefinition, LookupReference, resolveTranslation } from '@mintplayer/ng-spark/models';\n\n@Pipe({ name: 'lookupDisplayValue', standalone: true, pure: true })\nexport class LookupDisplayValuePipe implements PipeTransform {\n transform(attr: EntityAttributeDefinition, formData: Record<string, any>, lookupRefOptions: Record<string, LookupReference>): string {\n const currentValue = formData[attr.name];\n if (currentValue == null || currentValue === '') return '';\n\n const lookupRef = attr.lookupReferenceType ? lookupRefOptions[attr.lookupReferenceType] : null;\n const options = lookupRef?.values.filter(v => v.isActive) || [];\n const selected = options.find(o => o.key === String(currentValue));\n if (!selected) return String(currentValue);\n\n return resolveTranslation(selected.values) || selected.key;\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { EntityAttributeDefinition, LookupReference, LookupReferenceValue } from '@mintplayer/ng-spark/models';\n\n@Pipe({ name: 'lookupOptions', standalone: true, pure: true })\nexport class LookupOptionsPipe implements PipeTransform {\n transform(attr: EntityAttributeDefinition, lookupRefOptions: Record<string, LookupReference>): LookupReferenceValue[] {\n const lookupRef = attr.lookupReferenceType ? lookupRefOptions[attr.lookupReferenceType] : null;\n return lookupRef?.values.filter(v => v.isActive) || [];\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { EntityAttributeDefinition, PersistentObject } from '@mintplayer/ng-spark/models';\n\n@Pipe({ name: 'inlineRefOptions', standalone: true, pure: true })\nexport class InlineRefOptionsPipe implements PipeTransform {\n transform(parentAttr: EntityAttributeDefinition, col: EntityAttributeDefinition, asDetailRefOptions: Record<string, Record<string, PersistentObject[]>>): PersistentObject[] {\n return asDetailRefOptions[parentAttr.name]?.[col.name] || [];\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { ValidationError, resolveTranslation } from '@mintplayer/ng-spark/models';\n\n@Pipe({ name: 'errorForAttribute', standalone: true, pure: true })\nexport class ErrorForAttributePipe implements PipeTransform {\n transform(attrName: string, validationErrors: ValidationError[]): string | null {\n const error = validationErrors.find(e => e.attributeName === attrName);\n return error ? resolveTranslation(error.errorMessage) : null;\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\n\n@Pipe({ name: 'iconName', standalone: true, pure: true })\nexport class IconNamePipe implements PipeTransform {\n transform(value: string | undefined, fallback: string): string {\n const iconClass = value || fallback;\n // Strip 'bi-' prefix if present\n return iconClass.startsWith('bi-') ? iconClass.substring(3) : iconClass;\n }\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { PersistentObject, nestedPoToDict } from '@mintplayer/ng-spark/models';\n\n/**\n * Resolves an attribute to a list of flat row dicts for the detail-page table.\n * AsDetail array attributes carry their data as nested PersistentObjects in\n * <c>attr.objects</c>, not <c>attr.value</c> — the server stopped putting flat\n * dicts in <c>value</c> when AsDetail moved to its dedicated wire shape. Without\n * this branch, the detail page rendered AsDetail arrays as empty tables even\n * when the edit page (which reads <c>attr.objects</c> directly) showed rows.\n */\n@Pipe({ name: 'arrayValue', standalone: true, pure: true })\nexport class ArrayValuePipe implements PipeTransform {\n transform(attrName: string, item: PersistentObject | null): Record<string, any>[] {\n const attr = item?.attributes.find(a => a.name === attrName);\n if (!attr) return [];\n if (attr.dataType === 'AsDetail' && attr.isArray && Array.isArray(attr.objects)) {\n return attr.objects.map(po => nestedPoToDict(po));\n }\n if (Array.isArray(attr.value)) return attr.value;\n return [];\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;MAIa,gBAAgB,CAAA;AACV,IAAA,IAAI,GAAG,MAAM,CAAC,oBAAoB,CAAC;AAEpD,IAAA,SAAS,CAAC,GAAW,EAAA;QACnB,OAAO,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC;IACzB;uGALW,gBAAgB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA;qGAAhB,gBAAgB,EAAA,YAAA,EAAA,IAAA,EAAA,IAAA,EAAA,GAAA,EAAA,IAAA,EAAA,KAAA,EAAA,CAAA;;2FAAhB,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAD5B,IAAI;mBAAC,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE;;;MCCrC,sB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