@mintplayer/ng-spark 22.0.3 → 22.0.5

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.
@@ -66,6 +66,45 @@ function attributeValueForForm(attr) {
66
66
  }
67
67
  return attr.value;
68
68
  }
69
+ /**
70
+ * Reserved key under which {@link nestedPoToDisplayRow} stashes the server-resolved breadcrumb of
71
+ * each reference attribute (keyed by attribute name). Lets an AsDetail reference cell render the
72
+ * label the server already resolved by id — page-independent — instead of guessing from a single
73
+ * reference-query options page. Prefixed to avoid colliding with a real attribute name.
74
+ */
75
+ const AS_DETAIL_BREADCRUMBS_KEY = '__sparkBreadcrumbs';
76
+ /**
77
+ * Like {@link nestedPoToDict}, but for the read-only detail display path. In addition to each
78
+ * attribute's value it preserves the server-resolved per-reference `breadcrumb` under
79
+ * {@link AS_DETAIL_BREADCRUMBS_KEY}, so an AsDetail reference cell can render the label by id
80
+ * regardless of whether the referenced document fits on the reference query's first options page.
81
+ * The form/edit path keeps using {@link nestedPoToDict}, which never carries breadcrumbs.
82
+ */
83
+ function nestedPoToDisplayRow(po) {
84
+ if (!po)
85
+ return {};
86
+ const dict = {};
87
+ let breadcrumbs;
88
+ for (const attr of po.attributes ?? []) {
89
+ dict[attr.name] = displayValueForAttribute(attr);
90
+ if (attr.dataType === 'Reference' && !attr.isArray && typeof attr.breadcrumb === 'string' && attr.breadcrumb !== '') {
91
+ (breadcrumbs ??= {})[attr.name] = attr.breadcrumb;
92
+ }
93
+ }
94
+ // Only attach the side channel when something resolved — keeps reference-free rows (the common
95
+ // case) byte-for-byte identical to the plain flat dict.
96
+ if (breadcrumbs)
97
+ dict[AS_DETAIL_BREADCRUMBS_KEY] = breadcrumbs;
98
+ return dict;
99
+ }
100
+ function displayValueForAttribute(attr) {
101
+ if (attr.dataType === 'AsDetail') {
102
+ if (attr.isArray)
103
+ return (attr.objects ?? []).map(po => nestedPoToDisplayRow(po));
104
+ return attr.object ? nestedPoToDisplayRow(attr.object) : null;
105
+ }
106
+ return attr.value;
107
+ }
69
108
  /**
70
109
  * Builds a nested `PersistentObject` from a flat dict against the schema in
71
110
  * <paramref name="entityType"/>. Used when the form is about to save — AsDetail attributes
@@ -127,5 +166,5 @@ function buildAttribute(attrDef, raw, resolve) {
127
166
  * Generated bundle index. Do not edit.
128
167
  */
129
168
 
130
- export { ELookupDisplayType, ShowedOn, currentLanguage, dictToNestedPo, hasShowedOnFlag, nestedPoToDict, resolveTranslation };
169
+ export { AS_DETAIL_BREADCRUMBS_KEY, ELookupDisplayType, ShowedOn, currentLanguage, dictToNestedPo, hasShowedOnFlag, nestedPoToDict, nestedPoToDisplayRow, resolveTranslation };
131
170
  //# 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/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 }\n return attr;\n }\n\n attr.value = raw;\n return attr;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[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AAC,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
+ {"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 * Reserved key under which {@link nestedPoToDisplayRow} stashes the server-resolved breadcrumb of\n * each reference attribute (keyed by attribute name). Lets an AsDetail reference cell render the\n * label the server already resolved by id — page-independent — instead of guessing from a single\n * reference-query options page. Prefixed to avoid colliding with a real attribute name.\n */\nexport const AS_DETAIL_BREADCRUMBS_KEY = '__sparkBreadcrumbs';\n\n/**\n * Like {@link nestedPoToDict}, but for the read-only detail display path. In addition to each\n * attribute's value it preserves the server-resolved per-reference `breadcrumb` under\n * {@link AS_DETAIL_BREADCRUMBS_KEY}, so an AsDetail reference cell can render the label by id\n * regardless of whether the referenced document fits on the reference query's first options page.\n * The form/edit path keeps using {@link nestedPoToDict}, which never carries breadcrumbs.\n */\nexport function nestedPoToDisplayRow(po: PersistentObject | null | undefined): Record<string, any> {\n if (!po) return {};\n const dict: Record<string, any> = {};\n let breadcrumbs: Record<string, string> | undefined;\n for (const attr of po.attributes ?? []) {\n dict[attr.name] = displayValueForAttribute(attr);\n if (attr.dataType === 'Reference' && !attr.isArray && typeof attr.breadcrumb === 'string' && attr.breadcrumb !== '') {\n (breadcrumbs ??= {})[attr.name] = attr.breadcrumb;\n }\n }\n // Only attach the side channel when something resolved — keeps reference-free rows (the common\n // case) byte-for-byte identical to the plain flat dict.\n if (breadcrumbs) dict[AS_DETAIL_BREADCRUMBS_KEY] = breadcrumbs;\n return dict;\n}\n\nfunction displayValueForAttribute(attr: PersistentObjectAttribute): any {\n if (attr.dataType === 'AsDetail') {\n if (attr.isArray) return (attr.objects ?? []).map(po => nestedPoToDisplayRow(po));\n return attr.object ? nestedPoToDisplayRow(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 }\n return attr;\n }\n\n attr.value = raw;\n return attr;\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,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AK,EAAE,OAAO,CAAC,KAAK;AACpB,QAAA,KAAK,EAAE,OAAO,CAAC,KAAK,IAAI,EAAE;AAC1B,QAAA,cAAc,EAAE,IAAI;KACrB;AAED,IAAA,IAAI,OAAO,CAAC,QAAQ,KAAK,UAAU,EAAE;;AAEnC,QAAA,IAAI,CAAC,KAAK,GAAG,IAAI;AACjB,QAAA,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC,YAAY;AAExC,QAAA,MAAM,UAAU,GAAG,OAAO,CAAC,YAAY,GAAG,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,GAAG,SAAS;QACnF,IAAI,CAAC,UAAU,EAAE;AACf,YAAA,IAAI,CAAC,MAAM,GAAG,IAAI;AAClB,YAAA,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,GAAG,EAAE,GAAG,IAAI;AAC1C,YAAA,OAAO,IAAI;QACb;AAEA,QAAA,IAAI,OAAO,CAAC,OAAO,EAAE;AACnB,YAAA,MAAM,KAAK,GAAU,KAAK,CAAC,OAAO,CAAC,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;;AChJA;;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, nestedPoToDict, ELookupDisplayType } from '@mintplayer/ng-spark/models';
4
+ import { resolveTranslation, nestedPoToDict, AS_DETAIL_BREADCRUMBS_KEY, ELookupDisplayType, nestedPoToDisplayRow } from '@mintplayer/ng-spark/models';
5
5
 
6
6
  class TranslateKeyPipe {
7
7
  lang = inject(SparkLanguageService);
@@ -54,6 +54,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.0", ngImpor
54
54
  args: [{ name: 'inputType', standalone: true, pure: true }]
55
55
  }] });
56
56
 
57
+ /**
58
+ * Fills a `{Field}` template from a plain object's own fields. Used ONLY for AsDetail
59
+ * nested-object summary display: an embedded value object (no id, no document) is rendered
60
+ * client-side from its own fields. This is deliberately distinct from entity/reference
61
+ * breadcrumbs — those are resolved recursively on the server (BreadcrumbResolver) and the
62
+ * client only reads the resulting strings. Unknown or null placeholders render empty.
63
+ */
64
+ function applyFieldTemplate(template, data) {
65
+ return template.replace(/\{(\w+)\}/g, (_match, propertyName) => {
66
+ const value = data[propertyName];
67
+ return value != null ? String(value) : '';
68
+ });
69
+ }
70
+
57
71
  class AttributeValuePipe {
58
72
  transform(attrName, item, entityType, lookupRefOptions, allEntityTypes) {
59
73
  if (!item)
@@ -92,27 +106,13 @@ class AttributeValuePipe {
92
106
  }
93
107
  formatAsDetailValue(attrDef, value, allEntityTypes) {
94
108
  const asDetailType = allEntityTypes.find(t => t.clrType === attrDef.asDetailType);
95
- if (asDetailType?.displayFormat) {
96
- const result = this.resolveDisplayFormat(asDetailType.displayFormat, value);
109
+ if (asDetailType?.breadcrumb) {
110
+ const result = applyFieldTemplate(asDetailType.breadcrumb, value);
97
111
  if (result && result.trim())
98
112
  return result;
99
113
  }
100
- if (asDetailType?.displayAttribute && value[asDetailType.displayAttribute]) {
101
- return value[asDetailType.displayAttribute];
102
- }
103
- const displayProps = ['Name', 'Title', 'Street', 'name', 'title'];
104
- for (const prop of displayProps) {
105
- if (value[prop])
106
- return value[prop];
107
- }
108
114
  return '(object)';
109
115
  }
110
- resolveDisplayFormat(format, data) {
111
- return format.replace(/\{(\w+)\}/g, (match, propertyName) => {
112
- const value = data[propertyName];
113
- return value != null ? String(value) : '';
114
- });
115
- }
116
116
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: AttributeValuePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
117
117
  static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "22.0.0", ngImport: i0, type: AttributeValuePipe, isStandalone: true, name: "attributeValue" });
118
118
  }
@@ -266,6 +266,13 @@ class AsDetailCellValuePipe {
266
266
  if (value == null)
267
267
  return '';
268
268
  if (col.dataType === 'Reference' && col.query) {
269
+ // Prefer the breadcrumb the server already resolved by id — it is page-independent, so it
270
+ // renders the label even when the referenced document falls outside the reference query's
271
+ // first options page (issue #185).
272
+ const serverBreadcrumb = row[AS_DETAIL_BREADCRUMBS_KEY]?.[col.name];
273
+ if (serverBreadcrumb)
274
+ return serverBreadcrumb;
275
+ // Fallback: resolve against the loaded options page (legacy path).
269
276
  const parentOptions = asDetailRefOptions[parentAttr.name];
270
277
  if (parentOptions) {
271
278
  const options = parentOptions[col.name];
@@ -293,30 +300,16 @@ class AsDetailDisplayValuePipe {
293
300
  if (!value)
294
301
  return this.lang.t('notSet');
295
302
  const asDetailType = asDetailTypes[attr.name] || null;
296
- // 1. Try displayFormat (template with {PropertyName} placeholders)
297
- if (asDetailType?.displayFormat) {
298
- const result = this.resolveDisplayFormat(asDetailType.displayFormat, value);
303
+ // Resolve the breadcrumb template against the nested object's own fields.
304
+ // (Phase 1: flat substitution mirrors the server's transitional behavior; Phase 5
305
+ // replaces this with a server-emitted breadcrumb on the nested object.)
306
+ if (asDetailType?.breadcrumb) {
307
+ const result = applyFieldTemplate(asDetailType.breadcrumb, value);
299
308
  if (result && result.trim())
300
309
  return result;
301
310
  }
302
- // 2. Try displayAttribute (single property name)
303
- if (asDetailType?.displayAttribute && value[asDetailType.displayAttribute]) {
304
- return value[asDetailType.displayAttribute];
305
- }
306
- // 3. Fallback to common property names
307
- const displayProps = ['Name', 'Title', 'Street', 'name', 'title'];
308
- for (const prop of displayProps) {
309
- if (value[prop])
310
- return value[prop];
311
- }
312
311
  return this.lang.t('clickToEdit');
313
312
  }
314
- resolveDisplayFormat(format, data) {
315
- return format.replace(/\{(\w+)\}/g, (match, propertyName) => {
316
- const value = data[propertyName];
317
- return value != null ? String(value) : '';
318
- });
319
- }
320
313
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: AsDetailDisplayValuePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
321
314
  static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "22.0.0", ngImport: i0, type: AsDetailDisplayValuePipe, isStandalone: true, name: "asDetailDisplayValue" });
322
315
  }
@@ -450,7 +443,7 @@ class ArrayValuePipe {
450
443
  if (!attr)
451
444
  return [];
452
445
  if (attr.dataType === 'AsDetail' && attr.isArray && Array.isArray(attr.objects)) {
453
- return attr.objects.map(po => nestedPoToDict(po));
446
+ return attr.objects.map(po => nestedPoToDisplayRow(po));
454
447
  }
455
448
  if (Array.isArray(attr.value))
456
449
  return attr.value;
@@ -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/reference-chips.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 { PersistentObject } from '@mintplayer/ng-spark/models';\n\nexport interface ReferenceChip {\n id: string;\n label: string;\n}\n\n/**\n * Resolves a multi-reference attribute (`dataType === 'Reference'`, `isArray === true`)\n * to a list of chips. The attribute's `value` carries the id array; `breadcrumbs` (a\n * server-resolved id → label map) provides each chip's display label, falling back to\n * the id when no breadcrumb is present. Mirrors the single-reference `breadcrumb`\n * display, applied per id.\n */\n@Pipe({ name: 'referenceChips', standalone: true, pure: true })\nexport class ReferenceChipsPipe implements PipeTransform {\n transform(attrName: string, item: PersistentObject | null): ReferenceChip[] {\n const attr = item?.attributes.find(a => a.name === attrName);\n if (!attr || !Array.isArray(attr.value)) return [];\n const breadcrumbs = attr.breadcrumbs ?? {};\n return attr.value\n .filter(v => v != null && v !== '')\n .map(v => {\n const id = String(v);\n return { id, label: breadcrumbs[id] || id };\n });\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,sBAAsB,CAAA;IACjC,SAAS,CAAC,KAAmC,EAAE,QAAiB,EAAA;QAC9D,OAAO,kBAAkB,CAAC,KAAK,CAAC,IAAI,QAAQ,IAAI,EAAE;IACpD;uGAHW,sBAAsB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA;qGAAtB,sBAAsB,EAAA,YAAA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;;ACCxD;;;;;;;AAOG;MAEU,cAAc,CAAA;IACzB,SAAS,CAAC,QAAgB,EAAE,IAA6B,EAAA;AACvD,QAAA,MAAM,IAAI,GAAG,IAAI,EAAE,UAAU,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,KAAK,QAAQ,CAAC;AAC5D,QAAA,IAAI,CAAC,IAAI;AAAE,YAAA,OAAO,EAAE;AACpB,QAAA,IAAI,IAAI,CAAC,QAAQ,KAAK,UAAU,IAAI,IAAI,CAAC,OAAO,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE;AAC/E,YAAA,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,IAAI,cAAc,CAAC,EAAE,CAAC,CAAC;QACnD;AACA,QAAA,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC;YAAE,OAAO,IAAI,CAAC,KAAK;AAChD,QAAA,OAAO,EAAE;IACX;uGATW,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;;;ACX1D;;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/apply-field-template.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/reference-chips.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","/**\n * Fills a `{Field}` template from a plain object's own fields. Used ONLY for AsDetail\n * nested-object summary display: an embedded value object (no id, no document) is rendered\n * client-side from its own fields. This is deliberately distinct from entity/reference\n * breadcrumbs — those are resolved recursively on the server (BreadcrumbResolver) and the\n * client only reads the resulting strings. Unknown or null placeholders render empty.\n */\nexport function applyFieldTemplate(template: string, data: Record<string, any>): string {\n return template.replace(/\\{(\\w+)\\}/g, (_match, propertyName) => {\n const value = data[propertyName];\n return value != null ? String(value) : '';\n });\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { EntityAttributeDefinition, EntityType, LookupReference, PersistentObject, nestedPoToDict, resolveTranslation } from '@mintplayer/ng-spark/models';\nimport { applyFieldTemplate } from './apply-field-template';\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?.breadcrumb) {\n const result = applyFieldTemplate(asDetailType.breadcrumb, value);\n if (result && result.trim()) return result;\n }\n\n return '(object)';\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 { PersistentObject } from '@mintplayer/ng-spark/models';\n\nexport interface ReferenceChip {\n id: string;\n label: string;\n}\n\n/**\n * Resolves a multi-reference attribute (`dataType === 'Reference'`, `isArray === true`)\n * to a list of chips. The attribute's `value` carries the id array; `breadcrumbs` (a\n * server-resolved id → label map) provides each chip's display label, falling back to\n * the id when no breadcrumb is present. Mirrors the single-reference `breadcrumb`\n * display, applied per id.\n */\n@Pipe({ name: 'referenceChips', standalone: true, pure: true })\nexport class ReferenceChipsPipe implements PipeTransform {\n transform(attrName: string, item: PersistentObject | null): ReferenceChip[] {\n const attr = item?.attributes.find(a => a.name === attrName);\n if (!attr || !Array.isArray(attr.value)) return [];\n const breadcrumbs = attr.breadcrumbs ?? {};\n return attr.value\n .filter(v => v != null && v !== '')\n .map(v => {\n const id = String(v);\n return { id, label: breadcrumbs[id] || id };\n });\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 { AS_DETAIL_BREADCRUMBS_KEY, 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 // Prefer the breadcrumb the server already resolved by id — it is page-independent, so it\n // renders the label even when the referenced document falls outside the reference query's\n // first options page (issue #185).\n const serverBreadcrumb = (row[AS_DETAIL_BREADCRUMBS_KEY] as Record<string, string> | undefined)?.[col.name];\n if (serverBreadcrumb) return serverBreadcrumb;\n\n // Fallback: resolve against the loaded options page (legacy path).\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';\nimport { applyFieldTemplate } from './apply-field-template';\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 // Resolve the breadcrumb template against the nested object's own fields.\n // (Phase 1: flat substitution mirrors the server's transitional behavior; Phase 5\n // replaces this with a server-emitted breadcrumb on the nested object.)\n if (asDetailType?.breadcrumb) {\n const result = applyFieldTemplate(asDetailType.breadcrumb, value);\n if (result && result.trim()) return result;\n }\n\n return this.lang.t('clickToEdit');\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, nestedPoToDisplayRow } 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 => nestedPoToDisplayRow(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,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,EAAE;IACX;uGATW,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;;;ACX1D;;AAEG;;;;"}
@@ -15,7 +15,7 @@ import { BsTableComponent } from '@mintplayer/ng-bootstrap/table';
15
15
  import { BsTabControlComponent, BsTabPageComponent, BsTabPageHeaderDirective } from '@mintplayer/ng-bootstrap/tab-control';
16
16
  import { BsSpinnerComponent } from '@mintplayer/ng-bootstrap/spinner';
17
17
  import { SparkService, SparkLanguageService } from '@mintplayer/ng-spark/services';
18
- import { ResolveTranslationPipe, AttributeValuePipe, TranslateKeyPipe, RawAttributeValuePipe, AsDetailColumnsPipe, AsDetailCellValuePipe, ArrayValuePipe, ReferenceLinkRoutePipe, ReferenceChipsPipe } from '@mintplayer/ng-spark/pipes';
18
+ import { ResolveTranslationPipe, AttributeValuePipe, ReferenceChipsPipe, TranslateKeyPipe, RawAttributeValuePipe, AsDetailColumnsPipe, AsDetailCellValuePipe, ArrayValuePipe, ReferenceLinkRoutePipe } from '@mintplayer/ng-spark/pipes';
19
19
  import { SparkIconComponent } from '@mintplayer/ng-spark/icon';
20
20
  import { DatatableSettings, BsDatatableComponent, BsDatatableColumnDirective, BsRowTemplateDirective } from '@mintplayer/ng-bootstrap/datatable';
21
21
  import { SPARK_ATTRIBUTE_RENDERERS } from '@mintplayer/ng-spark/renderers';
@@ -156,11 +156,11 @@ class SparkSubQueryComponent {
156
156
  };
157
157
  }
158
158
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: SparkSubQueryComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
159
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.0", type: SparkSubQueryComponent, isStandalone: true, selector: "spark-sub-query", inputs: { queryId: { classPropertyName: "queryId", publicName: "queryId", isSignal: true, isRequired: true, transformFunction: null }, parentId: { classPropertyName: "parentId", publicName: "parentId", isSignal: true, isRequired: true, transformFunction: null }, parentType: { classPropertyName: "parentType", publicName: "parentType", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "@if (query(); as q) {\n <bs-card style=\"display: block; margin: 1rem 0;\">\n <bs-card-header>{{ (q.description | resolveTranslation) || q.name }}</bs-card-header>\n @if (loading()) {\n <div class=\"text-center p-3\">\n <bs-spinner />\n </div>\n } @else {\n <div class=\"p-3\">\n <bs-datatable\n [virtualScroll]=\"isVirtualScrolling()\"\n [itemSize]=\"40\"\n [isResponsive]=\"isVirtualScrolling()\"\n [fetch]=\"fetchFn()\"\n [(settings)]=\"settings\">\n @for (attr of visibleAttributes(); track attr.id) {\n <div *bsDatatableColumn=\"attr.name; sortable: true\">\n {{ (attr.label | resolveTranslation) || attr.name }}\n </div>\n }\n\n <ng-container *bsRowTemplate=\"let item\">\n @let row = $any(item);\n @for (attr of visibleAttributes(); track attr.id; let first = $first) {\n <td>\n @if (row) {\n @if (first && canRead()) {\n <a [routerLink]=\"['/po', entityType()!.alias || entityType()!.id, row.id]\">\n <ng-container *ngTemplateOutlet=\"cellContent; context: { $implicit: row, attr: attr }\"></ng-container>\n </a>\n } @else {\n <ng-container *ngTemplateOutlet=\"cellContent; context: { $implicit: row, attr: attr }\"></ng-container>\n }\n } @else {\n &nbsp;\n }\n </td>\n }\n </ng-container>\n </bs-datatable>\n </div>\n }\n </bs-card>\n}\n\n<ng-template #cellContent let-item let-attr=\"attr\">\n @if (getColumnRendererComponent(attr); as rendererType) {\n <ng-container *ngComponentOutlet=\"rendererType; inputs: getColumnRendererInputs(item, attr)\"></ng-container>\n } @else if (attr.dataType === 'boolean') {\n <input type=\"checkbox\"\n [checked]=\"(attr.name | attributeValue:item:entityType():lookupReferenceOptions():allEntityTypes()) === true\"\n disabled\n onclick=\"return false;\">\n } @else if (attr.dataType === 'color') {\n @let colorVal = (attr.name | attributeValue:item:entityType():lookupReferenceOptions():allEntityTypes());\n @if (colorVal) {\n <span class=\"d-inline-block align-middle border rounded\" [style.background-color]=\"colorVal\" style=\"width: 1.5em; height: 1.5em;\"></span>\n }\n } @else {\n {{ (attr.name | attributeValue:item:entityType():lookupReferenceOptions():allEntityTypes()) }}\n }\n</ng-template>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletEnvironmentInjector", "ngComponentOutletContent", "ngComponentOutletNgModule"], exportAs: ["ngComponentOutlet"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: RouterModule }, { kind: "directive", type: i2.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "browserUrl", "routerLink"] }, { kind: "component", type: BsCardComponent, selector: "bs-card", inputs: ["color", "outline"] }, { kind: "component", type: BsCardHeaderComponent, selector: "bs-card-header", inputs: ["color", "navStyle"] }, { kind: "component", type: BsDatatableComponent, selector: "bs-datatable", inputs: ["columns", "data", "fetch", "settings", "selectionMode", "selectable", "selection", "rowKey", "resizableColumns", "pagination", "virtualScroll", "itemSize", "virtualBuffer", "isResponsive", "compareWith", "tree", "idKey", "childCountKey", "treeIndent", "expandedIds", "selectionStrategy"], outputs: ["settingsChange", "selectionChange", "rowClick", "rowDblClick", "rowContextMenu", "expandedIdsChange", "rowExpand", "rowCollapse"] }, { kind: "directive", type: BsDatatableColumnDirective, selector: "[bsDatatableColumn]", inputs: ["bsDatatableColumn", "bsDatatableColumnSortable"] }, { kind: "directive", type: BsRowTemplateDirective, selector: "[bsRowTemplate]" }, { kind: "component", type: BsSpinnerComponent, selector: "bs-spinner", inputs: ["type", "color"] }, { kind: "pipe", type: ResolveTranslationPipe, name: "resolveTranslation" }, { kind: "pipe", type: AttributeValuePipe, name: "attributeValue" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
159
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.0", type: SparkSubQueryComponent, isStandalone: true, selector: "spark-sub-query", inputs: { queryId: { classPropertyName: "queryId", publicName: "queryId", isSignal: true, isRequired: true, transformFunction: null }, parentId: { classPropertyName: "parentId", publicName: "parentId", isSignal: true, isRequired: true, transformFunction: null }, parentType: { classPropertyName: "parentType", publicName: "parentType", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "@if (query(); as q) {\n <bs-card style=\"display: block; margin: 1rem 0;\">\n <bs-card-header>{{ (q.description | resolveTranslation) || q.name }}</bs-card-header>\n @if (loading()) {\n <div class=\"text-center p-3\">\n <bs-spinner />\n </div>\n } @else {\n <div class=\"p-3\">\n <bs-datatable\n [virtualScroll]=\"isVirtualScrolling()\"\n [itemSize]=\"40\"\n [isResponsive]=\"isVirtualScrolling()\"\n [fetch]=\"fetchFn()\"\n [(settings)]=\"settings\">\n @for (attr of visibleAttributes(); track attr.id) {\n <div *bsDatatableColumn=\"attr.name; sortable: true\">\n {{ (attr.label | resolveTranslation) || attr.name }}\n </div>\n }\n\n <ng-container *bsRowTemplate=\"let item\">\n @let row = $any(item);\n @for (attr of visibleAttributes(); track attr.id; let first = $first) {\n <td>\n @if (row) {\n @if (first && canRead()) {\n <a [routerLink]=\"['/po', entityType()!.alias || entityType()!.id, row.id]\">\n <ng-container *ngTemplateOutlet=\"cellContent; context: { $implicit: row, attr: attr }\"></ng-container>\n </a>\n } @else {\n <ng-container *ngTemplateOutlet=\"cellContent; context: { $implicit: row, attr: attr }\"></ng-container>\n }\n } @else {\n &nbsp;\n }\n </td>\n }\n </ng-container>\n </bs-datatable>\n </div>\n }\n </bs-card>\n}\n\n<ng-template #cellContent let-item let-attr=\"attr\">\n @if (getColumnRendererComponent(attr); as rendererType) {\n <ng-container *ngComponentOutlet=\"rendererType; inputs: getColumnRendererInputs(item, attr)\"></ng-container>\n } @else if (attr.dataType === 'boolean') {\n <input type=\"checkbox\"\n [checked]=\"(attr.name | attributeValue:item:entityType():lookupReferenceOptions():allEntityTypes()) === true\"\n disabled\n onclick=\"return false;\">\n } @else if (attr.dataType === 'color') {\n @let colorVal = (attr.name | attributeValue:item:entityType():lookupReferenceOptions():allEntityTypes());\n @if (colorVal) {\n <span class=\"d-inline-block align-middle border rounded\" [style.background-color]=\"colorVal\" style=\"width: 1.5em; height: 1.5em;\"></span>\n }\n } @else if (attr.dataType === 'Reference' && attr.isArray) {\n <span class=\"d-inline-flex flex-wrap gap-1\">\n @for (chip of (attr.name | referenceChips:item); track chip.id) {\n <span class=\"badge rounded-pill border bg-body-secondary text-body px-3 py-2\">{{ chip.label }}</span>\n }\n </span>\n } @else {\n {{ (attr.name | attributeValue:item:entityType():lookupReferenceOptions():allEntityTypes()) }}\n }\n</ng-template>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletEnvironmentInjector", "ngComponentOutletContent", "ngComponentOutletNgModule"], exportAs: ["ngComponentOutlet"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: RouterModule }, { kind: "directive", type: i2.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "browserUrl", "routerLink"] }, { kind: "component", type: BsCardComponent, selector: "bs-card", inputs: ["color", "outline"] }, { kind: "component", type: BsCardHeaderComponent, selector: "bs-card-header", inputs: ["color", "navStyle"] }, { kind: "component", type: BsDatatableComponent, selector: "bs-datatable", inputs: ["columns", "data", "fetch", "settings", "selectionMode", "selectable", "selection", "rowKey", "resizableColumns", "pagination", "virtualScroll", "itemSize", "virtualBuffer", "isResponsive", "compareWith", "tree", "idKey", "childCountKey", "treeIndent", "expandedIds", "selectionStrategy"], outputs: ["settingsChange", "selectionChange", "rowClick", "rowDblClick", "rowContextMenu", "expandedIdsChange", "rowExpand", "rowCollapse"] }, { kind: "directive", type: BsDatatableColumnDirective, selector: "[bsDatatableColumn]", inputs: ["bsDatatableColumn", "bsDatatableColumnSortable"] }, { kind: "directive", type: BsRowTemplateDirective, selector: "[bsRowTemplate]" }, { kind: "component", type: BsSpinnerComponent, selector: "bs-spinner", inputs: ["type", "color"] }, { kind: "pipe", type: ResolveTranslationPipe, name: "resolveTranslation" }, { kind: "pipe", type: AttributeValuePipe, name: "attributeValue" }, { kind: "pipe", type: ReferenceChipsPipe, name: "referenceChips" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
160
160
  }
161
161
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.0", ngImport: i0, type: SparkSubQueryComponent, decorators: [{
162
162
  type: Component,
163
- args: [{ selector: 'spark-sub-query', imports: [CommonModule, NgComponentOutlet, RouterModule, BsCardComponent, BsCardHeaderComponent, BsDatatableComponent, BsDatatableColumnDirective, BsRowTemplateDirective, BsSpinnerComponent, ResolveTranslationPipe, AttributeValuePipe], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (query(); as q) {\n <bs-card style=\"display: block; margin: 1rem 0;\">\n <bs-card-header>{{ (q.description | resolveTranslation) || q.name }}</bs-card-header>\n @if (loading()) {\n <div class=\"text-center p-3\">\n <bs-spinner />\n </div>\n } @else {\n <div class=\"p-3\">\n <bs-datatable\n [virtualScroll]=\"isVirtualScrolling()\"\n [itemSize]=\"40\"\n [isResponsive]=\"isVirtualScrolling()\"\n [fetch]=\"fetchFn()\"\n [(settings)]=\"settings\">\n @for (attr of visibleAttributes(); track attr.id) {\n <div *bsDatatableColumn=\"attr.name; sortable: true\">\n {{ (attr.label | resolveTranslation) || attr.name }}\n </div>\n }\n\n <ng-container *bsRowTemplate=\"let item\">\n @let row = $any(item);\n @for (attr of visibleAttributes(); track attr.id; let first = $first) {\n <td>\n @if (row) {\n @if (first && canRead()) {\n <a [routerLink]=\"['/po', entityType()!.alias || entityType()!.id, row.id]\">\n <ng-container *ngTemplateOutlet=\"cellContent; context: { $implicit: row, attr: attr }\"></ng-container>\n </a>\n } @else {\n <ng-container *ngTemplateOutlet=\"cellContent; context: { $implicit: row, attr: attr }\"></ng-container>\n }\n } @else {\n &nbsp;\n }\n </td>\n }\n </ng-container>\n </bs-datatable>\n </div>\n }\n </bs-card>\n}\n\n<ng-template #cellContent let-item let-attr=\"attr\">\n @if (getColumnRendererComponent(attr); as rendererType) {\n <ng-container *ngComponentOutlet=\"rendererType; inputs: getColumnRendererInputs(item, attr)\"></ng-container>\n } @else if (attr.dataType === 'boolean') {\n <input type=\"checkbox\"\n [checked]=\"(attr.name | attributeValue:item:entityType():lookupReferenceOptions():allEntityTypes()) === true\"\n disabled\n onclick=\"return false;\">\n } @else if (attr.dataType === 'color') {\n @let colorVal = (attr.name | attributeValue:item:entityType():lookupReferenceOptions():allEntityTypes());\n @if (colorVal) {\n <span class=\"d-inline-block align-middle border rounded\" [style.background-color]=\"colorVal\" style=\"width: 1.5em; height: 1.5em;\"></span>\n }\n } @else {\n {{ (attr.name | attributeValue:item:entityType():lookupReferenceOptions():allEntityTypes()) }}\n }\n</ng-template>\n" }]
163
+ args: [{ selector: 'spark-sub-query', imports: [CommonModule, NgComponentOutlet, RouterModule, BsCardComponent, BsCardHeaderComponent, BsDatatableComponent, BsDatatableColumnDirective, BsRowTemplateDirective, BsSpinnerComponent, ResolveTranslationPipe, AttributeValuePipe, ReferenceChipsPipe], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (query(); as q) {\n <bs-card style=\"display: block; margin: 1rem 0;\">\n <bs-card-header>{{ (q.description | resolveTranslation) || q.name }}</bs-card-header>\n @if (loading()) {\n <div class=\"text-center p-3\">\n <bs-spinner />\n </div>\n } @else {\n <div class=\"p-3\">\n <bs-datatable\n [virtualScroll]=\"isVirtualScrolling()\"\n [itemSize]=\"40\"\n [isResponsive]=\"isVirtualScrolling()\"\n [fetch]=\"fetchFn()\"\n [(settings)]=\"settings\">\n @for (attr of visibleAttributes(); track attr.id) {\n <div *bsDatatableColumn=\"attr.name; sortable: true\">\n {{ (attr.label | resolveTranslation) || attr.name }}\n </div>\n }\n\n <ng-container *bsRowTemplate=\"let item\">\n @let row = $any(item);\n @for (attr of visibleAttributes(); track attr.id; let first = $first) {\n <td>\n @if (row) {\n @if (first && canRead()) {\n <a [routerLink]=\"['/po', entityType()!.alias || entityType()!.id, row.id]\">\n <ng-container *ngTemplateOutlet=\"cellContent; context: { $implicit: row, attr: attr }\"></ng-container>\n </a>\n } @else {\n <ng-container *ngTemplateOutlet=\"cellContent; context: { $implicit: row, attr: attr }\"></ng-container>\n }\n } @else {\n &nbsp;\n }\n </td>\n }\n </ng-container>\n </bs-datatable>\n </div>\n }\n </bs-card>\n}\n\n<ng-template #cellContent let-item let-attr=\"attr\">\n @if (getColumnRendererComponent(attr); as rendererType) {\n <ng-container *ngComponentOutlet=\"rendererType; inputs: getColumnRendererInputs(item, attr)\"></ng-container>\n } @else if (attr.dataType === 'boolean') {\n <input type=\"checkbox\"\n [checked]=\"(attr.name | attributeValue:item:entityType():lookupReferenceOptions():allEntityTypes()) === true\"\n disabled\n onclick=\"return false;\">\n } @else if (attr.dataType === 'color') {\n @let colorVal = (attr.name | attributeValue:item:entityType():lookupReferenceOptions():allEntityTypes());\n @if (colorVal) {\n <span class=\"d-inline-block align-middle border rounded\" [style.background-color]=\"colorVal\" style=\"width: 1.5em; height: 1.5em;\"></span>\n }\n } @else if (attr.dataType === 'Reference' && attr.isArray) {\n <span class=\"d-inline-flex flex-wrap gap-1\">\n @for (chip of (attr.name | referenceChips:item); track chip.id) {\n <span class=\"badge rounded-pill border bg-body-secondary text-body px-3 py-2\">{{ chip.label }}</span>\n }\n </span>\n } @else {\n {{ (attr.name | attributeValue:item:entityType():lookupReferenceOptions():allEntityTypes()) }}\n }\n</ng-template>\n" }]
164
164
  }], ctorParameters: () => [], propDecorators: { queryId: [{ type: i0.Input, args: [{ isSignal: true, alias: "queryId", required: true }] }], parentId: [{ type: i0.Input, args: [{ isSignal: true, alias: "parentId", required: true }] }], parentType: [{ type: i0.Input, args: [{ isSignal: true, alias: "parentType", required: true }] }] } });
165
165
 
166
166
  class SparkPoDetailComponent {
@@ -1 +1 @@
1
- {"version":3,"file":"mintplayer-ng-spark-po-detail.mjs","sources":["../../po-detail/src/spark-sub-query.component.ts","../../po-detail/src/spark-sub-query.component.html","../../po-detail/src/spark-po-detail.component.ts","../../po-detail/src/spark-po-detail.component.html","../../po-detail/mintplayer-ng-spark-po-detail.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, computed, effect, inject, input, signal, Type } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { RouterModule } from '@angular/router';\nimport { BsCardComponent, BsCardHeaderComponent } from '@mintplayer/ng-bootstrap/card';\nimport { BsDatatableComponent, BsDatatableColumnDirective, BsRowTemplateDirective, DatatableSettings, type BsDatatableFetch } from '@mintplayer/ng-bootstrap/datatable';\nimport { BsSpinnerComponent } from '@mintplayer/ng-bootstrap/spinner';\nimport { SortColumn } from '@mintplayer/pagination';\nimport { SparkService } from '@mintplayer/ng-spark/services';\nimport { ResolveTranslationPipe, AttributeValuePipe } from '@mintplayer/ng-spark/pipes';\nimport { NgComponentOutlet } from '@angular/common';\nimport { SPARK_ATTRIBUTE_RENDERERS } from '@mintplayer/ng-spark/renderers';\nimport {\n EntityType,\n EntityAttributeDefinition,\n LookupReference,\n PersistentObject,\n SparkQuery,\n ShowedOn,\n hasShowedOnFlag,\n} from '@mintplayer/ng-spark/models';\n\n@Component({\n selector: 'spark-sub-query',\n imports: [CommonModule, NgComponentOutlet, RouterModule, BsCardComponent, BsCardHeaderComponent, BsDatatableComponent, BsDatatableColumnDirective, BsRowTemplateDirective, BsSpinnerComponent, ResolveTranslationPipe, AttributeValuePipe],\n templateUrl: './spark-sub-query.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class SparkSubQueryComponent {\n private readonly sparkService = inject(SparkService);\n private readonly rendererRegistry = inject(SPARK_ATTRIBUTE_RENDERERS);\n\n queryId = input.required<string>();\n parentId = input.required<string>();\n parentType = input.required<string>();\n\n query = signal<SparkQuery | null>(null);\n entityType = signal<EntityType | null>(null);\n allEntityTypes = signal<EntityType[]>([]);\n resultCount = signal<number | null>(null);\n lookupReferenceOptions = signal<Record<string, LookupReference>>({});\n loading = signal(true);\n canRead = signal(false);\n settings = signal(new DatatableSettings({\n perPage: { values: [10, 25, 50], selected: 10 },\n page: { values: [1], selected: 1 },\n sortColumns: []\n }));\n fetchFn = signal<BsDatatableFetch<PersistentObject> | null>(null);\n isVirtualScrolling = computed(() => this.query()?.renderMode === 'VirtualScrolling');\n\n visibleAttributes = computed(() => {\n return this.entityType()?.attributes\n .filter(a => a.isVisible && hasShowedOnFlag(a.showedOn, ShowedOn.Query))\n .sort((a, b) => a.order - b.order) || [];\n });\n\n constructor() {\n effect(() => {\n const qId = this.queryId();\n const pId = this.parentId();\n const pType = this.parentType();\n if (qId && pId && pType) {\n this.loadData(qId, pId, pType);\n }\n });\n }\n\n private async loadData(queryId: string, parentId: string, parentType: string): Promise<void> {\n this.loading.set(true);\n this.resultCount.set(null);\n this.fetchFn.set(null);\n try {\n const [resolvedQuery, entityTypes] = await Promise.all([\n this.sparkService.getQuery(queryId),\n this.sparkService.getEntityTypes()\n ]);\n\n this.query.set(resolvedQuery);\n this.allEntityTypes.set(entityTypes);\n\n const initialSortColumns: SortColumn[] = (resolvedQuery.sortColumns || []).map(sc => ({\n property: sc.property,\n direction: sc.direction === 'desc' ? 'descending' as const : 'ascending' as const\n }));\n\n // Resolve entity type from query's entityType field\n if (resolvedQuery.entityType) {\n const et = entityTypes.find(t =>\n t.name === resolvedQuery.entityType || t.alias === resolvedQuery.entityType?.toLowerCase()\n );\n this.entityType.set(et || null);\n if (et) {\n const permissions = await this.sparkService.getPermissions(et.id);\n this.canRead.set(permissions.canRead);\n }\n }\n\n this.settings.set(new DatatableSettings({\n perPage: { values: [10, 25, 50], selected: 10 },\n page: { values: [1], selected: 1 },\n sortColumns: initialSortColumns\n }));\n // The datatable drives paging/sorting via [(settings)] and calls fetchFn\n // per page. Virtual scrolling is just the [virtualScroll] template flag.\n this.fetchFn.set(this.makeFetch(resolvedQuery, parentId, parentType));\n\n this.loadLookupReferenceOptions();\n } catch {\n this.fetchFn.set(null);\n } finally {\n this.loading.set(false);\n }\n }\n\n private makeFetch(query: SparkQuery, parentId: string, parentType: string): BsDatatableFetch<PersistentObject> {\n return (req) => this.sparkService.executeQuery(query.id, {\n sortColumns: req.sortColumns,\n skip: (req.page - 1) * req.perPage,\n take: req.perPage,\n parentId, parentType,\n }).then(r => {\n this.resultCount.set(r.totalRecords);\n return {\n data: r.data,\n totalRecords: r.totalRecords,\n totalPages: Math.ceil(r.totalRecords / req.perPage) || 1,\n perPage: req.perPage,\n page: req.page,\n };\n }).catch(() => {\n this.resultCount.set(0);\n return { data: [], totalRecords: 0, totalPages: 1, perPage: req.perPage, page: req.page };\n });\n }\n\n private async loadLookupReferenceOptions(): Promise<void> {\n const lookupAttrs = this.visibleAttributes().filter(a => a.lookupReferenceType);\n if (lookupAttrs.length === 0) return;\n\n const lookupNames = [...new Set(lookupAttrs.map(a => a.lookupReferenceType!))];\n const entries = await Promise.all(\n lookupNames.map(async name => {\n const result = await this.sparkService.getLookupReference(name);\n return [name, result] as const;\n })\n );\n this.lookupReferenceOptions.set(entries.reduce((acc, [k, v]) => ({ ...acc, [k]: v }), {} as Record<string, LookupReference>));\n }\n\n getColumnRendererComponent(attr: EntityAttributeDefinition): Type<any> | null {\n if (!attr.renderer) return null;\n return this.rendererRegistry.find(r => r.name === attr.renderer)?.columnComponent ?? null;\n }\n\n getColumnRendererInputs(item: PersistentObject, attr: EntityAttributeDefinition): Record<string, any> {\n const itemAttr = item.attributes.find(a => a.name === attr.name);\n return {\n value: itemAttr?.value,\n attribute: attr,\n options: attr.rendererOptions,\n };\n }\n}\n","@if (query(); as q) {\n <bs-card style=\"display: block; margin: 1rem 0;\">\n <bs-card-header>{{ (q.description | resolveTranslation) || q.name }}</bs-card-header>\n @if (loading()) {\n <div class=\"text-center p-3\">\n <bs-spinner />\n </div>\n } @else {\n <div class=\"p-3\">\n <bs-datatable\n [virtualScroll]=\"isVirtualScrolling()\"\n [itemSize]=\"40\"\n [isResponsive]=\"isVirtualScrolling()\"\n [fetch]=\"fetchFn()\"\n [(settings)]=\"settings\">\n @for (attr of visibleAttributes(); track attr.id) {\n <div *bsDatatableColumn=\"attr.name; sortable: true\">\n {{ (attr.label | resolveTranslation) || attr.name }}\n </div>\n }\n\n <ng-container *bsRowTemplate=\"let item\">\n @let row = $any(item);\n @for (attr of visibleAttributes(); track attr.id; let first = $first) {\n <td>\n @if (row) {\n @if (first && canRead()) {\n <a [routerLink]=\"['/po', entityType()!.alias || entityType()!.id, row.id]\">\n <ng-container *ngTemplateOutlet=\"cellContent; context: { $implicit: row, attr: attr }\"></ng-container>\n </a>\n } @else {\n <ng-container *ngTemplateOutlet=\"cellContent; context: { $implicit: row, attr: attr }\"></ng-container>\n }\n } @else {\n &nbsp;\n }\n </td>\n }\n </ng-container>\n </bs-datatable>\n </div>\n }\n </bs-card>\n}\n\n<ng-template #cellContent let-item let-attr=\"attr\">\n @if (getColumnRendererComponent(attr); as rendererType) {\n <ng-container *ngComponentOutlet=\"rendererType; inputs: getColumnRendererInputs(item, attr)\"></ng-container>\n } @else if (attr.dataType === 'boolean') {\n <input type=\"checkbox\"\n [checked]=\"(attr.name | attributeValue:item:entityType():lookupReferenceOptions():allEntityTypes()) === true\"\n disabled\n onclick=\"return false;\">\n } @else if (attr.dataType === 'color') {\n @let colorVal = (attr.name | attributeValue:item:entityType():lookupReferenceOptions():allEntityTypes());\n @if (colorVal) {\n <span class=\"d-inline-block align-middle border rounded\" [style.background-color]=\"colorVal\" style=\"width: 1.5em; height: 1.5em;\"></span>\n }\n } @else {\n {{ (attr.name | attributeValue:item:entityType():lookupReferenceOptions():allEntityTypes()) }}\n }\n</ng-template>\n","import { ChangeDetectionStrategy, Component, computed, inject, input, output, signal, TemplateRef, Type } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { CommonModule, NgTemplateOutlet, NgComponentOutlet } from '@angular/common';\nimport { ActivatedRoute, Router, RouterModule } from '@angular/router';\nimport { HttpErrorResponse } from '@angular/common/http';\nimport { Color } from '@mintplayer/ng-bootstrap';\nimport { BsAlertComponent } from '@mintplayer/ng-bootstrap/alert';\nimport { BsCardComponent, BsCardHeaderComponent } from '@mintplayer/ng-bootstrap/card';\nimport { BsContainerComponent } from '@mintplayer/ng-bootstrap/container';\nimport { BsGridComponent, BsGridRowDirective, BsGridColumnDirective } from '@mintplayer/ng-bootstrap/grid';\nimport { BsPriorityNavComponent, BsPriorityNavItemDirective } from '@mintplayer/ng-bootstrap/priority-nav';\nimport { BsTableComponent } from '@mintplayer/ng-bootstrap/table';\nimport { BsTabControlComponent, BsTabPageComponent, BsTabPageHeaderDirective } from '@mintplayer/ng-bootstrap/tab-control';\nimport { BsSpinnerComponent } from '@mintplayer/ng-bootstrap/spinner';\nimport { SparkService, SparkLanguageService } from '@mintplayer/ng-spark/services';\nimport {\n TranslateKeyPipe,\n ResolveTranslationPipe,\n AttributeValuePipe,\n RawAttributeValuePipe,\n AsDetailColumnsPipe,\n AsDetailCellValuePipe,\n ArrayValuePipe,\n ReferenceLinkRoutePipe,\n ReferenceChipsPipe,\n} from '@mintplayer/ng-spark/pipes';\nimport { SparkIconComponent } from '@mintplayer/ng-spark/icon';\nimport { SparkSubQueryComponent } from './spark-sub-query.component';\nimport { SPARK_ATTRIBUTE_RENDERERS } from '@mintplayer/ng-spark/renderers';\nimport {\n CustomActionDefinition,\n EntityType,\n EntityAttributeDefinition,\n AttributeTab,\n AttributeGroup,\n LookupReference,\n PersistentObject,\n ShowedOn,\n hasShowedOnFlag,\n} from '@mintplayer/ng-spark/models';\n\n@Component({\n selector: 'spark-po-detail',\n imports: [CommonModule, NgTemplateOutlet, NgComponentOutlet, RouterModule, BsAlertComponent, BsCardComponent, BsCardHeaderComponent, BsContainerComponent, BsGridComponent, BsGridRowDirective, BsGridColumnDirective, BsPriorityNavComponent, BsPriorityNavItemDirective, BsTableComponent, BsTabControlComponent, BsTabPageComponent, BsTabPageHeaderDirective, BsSpinnerComponent, SparkIconComponent, SparkSubQueryComponent, ResolveTranslationPipe, TranslateKeyPipe, AttributeValuePipe, RawAttributeValuePipe, AsDetailColumnsPipe, AsDetailCellValuePipe, ArrayValuePipe, ReferenceLinkRoutePipe, ReferenceChipsPipe],\n templateUrl: './spark-po-detail.component.html',\n styleUrl: './spark-po-detail.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class SparkPoDetailComponent {\n private readonly route = inject(ActivatedRoute);\n private readonly router = inject(Router);\n private readonly sparkService = inject(SparkService);\n protected readonly lang = inject(SparkLanguageService);\n private readonly rendererRegistry = inject(SPARK_ATTRIBUTE_RENDERERS);\n\n showCustomActions = input(true);\n extraActionsTemplate = input<TemplateRef<void> | null>(null);\n extraContentTemplate = input<TemplateRef<{ $implicit: PersistentObject; entityType: EntityType }> | null>(null);\n\n edited = output<void>();\n deleted = output<void>();\n customActionExecuted = output<{ action: CustomActionDefinition; item: PersistentObject }>();\n\n colors = Color;\n errorMessage = signal<string | null>(null);\n entityType = signal<EntityType | null>(null);\n allEntityTypes = signal<EntityType[]>([]);\n item = signal<PersistentObject | null>(null);\n lookupReferenceOptions = signal<Record<string, LookupReference>>({});\n asDetailTypes = signal<Record<string, EntityType>>({});\n asDetailReferenceOptions = signal<Record<string, Record<string, PersistentObject[]>>>({});\n type = '';\n id = '';\n canEdit = signal(false);\n canDelete = signal(false);\n customActions = signal<CustomActionDefinition[]>([]);\n\n constructor() {\n this.route.paramMap.pipe(takeUntilDestroyed()).subscribe(params => this.onParamsChange(params));\n }\n\n private async onParamsChange(params: any): Promise<void> {\n this.type = params.get('type') || '';\n this.id = params.get('id') || '';\n\n try {\n const [entityTypes, item] = await Promise.all([\n this.sparkService.getEntityTypes(),\n this.sparkService.get(this.type, this.id)\n ]);\n\n this.allEntityTypes.set(entityTypes);\n this.entityType.set(entityTypes.find(t => t.id === this.type || t.alias === this.type) || null);\n this.item.set(item);\n this.loadLookupReferenceOptions();\n this.loadAsDetailTypes();\n\n const et = this.entityType();\n if (et) {\n const [permissions, actions] = await Promise.all([\n this.sparkService.getPermissions(et.id),\n this.sparkService.getCustomActions(et.id)\n ]);\n this.canEdit.set(permissions.canEdit);\n this.canDelete.set(permissions.canDelete);\n this.customActions.set(actions.filter(a => a.showedOn === 'detail' || a.showedOn === 'both'));\n }\n } catch (e) {\n const error = e as HttpErrorResponse;\n this.errorMessage.set(error.error?.error || error.message || 'An unexpected error occurred');\n }\n }\n\n visibleAttributes = computed(() => {\n return this.entityType()?.attributes\n .filter(a => a.isVisible && hasShowedOnFlag(a.showedOn, ShowedOn.PersistentObject))\n .sort((a, b) => a.order - b.order) || [];\n });\n\n private static readonly DEFAULT_TAB: AttributeTab = { id: '__default__', name: 'Algemeen', label: { nl: 'Algemeen', en: 'General' }, order: 0 };\n\n ungroupedAttributes = computed(() => {\n const attrs = this.visibleAttributes();\n const groupIds = new Set((this.entityType()?.groups || []).map(g => g.id));\n return attrs.filter(a => !a.group || !groupIds.has(a.group));\n });\n\n resolvedTabs = computed((): AttributeTab[] => {\n const et = this.entityType();\n const definedTabs = et?.tabs?.length ? [...et.tabs].sort((a, b) => a.order - b.order) : [];\n const hasUngroupedAttrs = this.ungroupedAttributes().length > 0;\n const hasUntabbedGroups = (et?.groups || []).some(g => !g.tab);\n\n if (hasUngroupedAttrs || hasUntabbedGroups || definedTabs.length === 0) {\n return [SparkPoDetailComponent.DEFAULT_TAB, ...definedTabs];\n }\n return definedTabs;\n });\n\n groupsForTab(tab: AttributeTab): AttributeGroup[] {\n const groups = this.entityType()?.groups || [];\n if (tab.id === '__default__') {\n return groups.filter(g => !g.tab).sort((a, b) => a.order - b.order);\n }\n return groups.filter(g => g.tab === tab.id).sort((a, b) => a.order - b.order);\n }\n\n attrsForGroup(group: AttributeGroup): EntityAttributeDefinition[] {\n return this.visibleAttributes().filter(a => a.group === group.id);\n }\n\n getDetailRendererComponent(attr: EntityAttributeDefinition): Type<any> | null {\n if (!attr.renderer) return null;\n return this.rendererRegistry.find(r => r.name === attr.renderer)?.detailComponent ?? null;\n }\n\n getDetailRendererInputs(attr: EntityAttributeDefinition, item: PersistentObject): Record<string, any> {\n const itemAttr = item.attributes.find(a => a.name === attr.name);\n const formData: Record<string, any> = {};\n for (const a of item.attributes) {\n formData[a.name] = a.value;\n }\n return {\n value: itemAttr?.value,\n attribute: attr,\n options: attr.rendererOptions,\n formData,\n };\n }\n\n /** Column renderer for a cell of an AsDetail sub-table (so embedded rows honor `col.renderer` too). */\n getAsDetailCellRendererComponent(col: EntityAttributeDefinition): Type<any> | null {\n if (!col.renderer) return null;\n return this.rendererRegistry.find(r => r.name === col.renderer)?.columnComponent ?? null;\n }\n\n getAsDetailCellRendererInputs(row: Record<string, any>, col: EntityAttributeDefinition): Record<string, any> {\n return {\n value: row[col.name],\n attribute: col,\n options: col.rendererOptions,\n };\n }\n\n private async loadLookupReferenceOptions(): Promise<void> {\n const lookupAttrs = this.visibleAttributes().filter(a => a.lookupReferenceType);\n if (lookupAttrs.length === 0) return;\n\n const lookupNames = [...new Set(lookupAttrs.map(a => a.lookupReferenceType!))];\n const entries = await Promise.all(\n lookupNames.map(async name => {\n const result = await this.sparkService.getLookupReference(name);\n return [name, result] as const;\n })\n );\n this.lookupReferenceOptions.set(entries.reduce((acc, [k, v]) => ({ ...acc, [k]: v }), {} as Record<string, LookupReference>));\n }\n\n private async loadAsDetailTypes(): Promise<void> {\n const asDetailAttrs = this.visibleAttributes().filter(a => a.dataType === 'AsDetail' && a.isArray && a.asDetailType);\n if (asDetailAttrs.length === 0) return;\n\n const types = this.allEntityTypes();\n const newAsDetailTypes: Record<string, EntityType> = {};\n\n for (const attr of asDetailAttrs) {\n const asDetailType = types.find(t => t.clrType === attr.asDetailType);\n if (asDetailType) {\n newAsDetailTypes[attr.name] = asDetailType;\n const refCols = asDetailType.attributes.filter(a => a.dataType === 'Reference' && a.query);\n if (refCols.length > 0) {\n const refEntries = await Promise.all(\n refCols.map(async col => {\n const result = await this.sparkService.executeQueryByName(col.query!, {\n parentId: this.id,\n parentType: this.type,\n });\n return [col.name, result.data] as const;\n })\n );\n this.asDetailReferenceOptions.update(prev => ({\n ...prev,\n [attr.name]: refEntries.reduce((acc, [k, v]) => ({ ...acc, [k]: v }), {} as Record<string, PersistentObject[]>)\n }));\n }\n }\n }\n this.asDetailTypes.set(newAsDetailTypes);\n }\n\n async onCustomAction(action: CustomActionDefinition): Promise<void> {\n if (action.confirmationMessageKey) {\n const message = this.lang.t(action.confirmationMessageKey) || 'Are you sure?';\n if (!confirm(message)) return;\n }\n try {\n await this.sparkService.executeCustomAction(this.type, action.name, this.item() || undefined);\n this.customActionExecuted.emit({ action, item: this.item()! });\n if (action.refreshOnCompleted) {\n const item = await this.sparkService.get(this.type, this.id);\n this.item.set(item);\n }\n } catch (e) {\n const err = e as HttpErrorResponse;\n this.errorMessage.set(err.error?.error || err.message || 'Action failed');\n }\n }\n\n onEdit(): void {\n this.edited.emit();\n this.router.navigate(['/po', this.type, this.id, 'edit']);\n }\n\n async onDelete(): Promise<void> {\n if (confirm(this.lang.t('confirmDelete'))) {\n await this.sparkService.delete(this.type, this.id);\n this.deleted.emit();\n this.router.navigate(['/']);\n }\n }\n\n onBack(): void {\n window.history.back();\n }\n}\n","<bs-container>\n<div class=\"container\">\n @if (errorMessage(); as err) {\n <bs-alert [type]=\"colors.danger\" class=\"mb-3\">\n {{ err }}\n </bs-alert>\n } @else if (item(); as currentItem) {\n @if (entityType(); as et) {\n <div class=\"spark-actionbar px-3 py-2\">\n <bs-priority-nav [moreLabel]=\"lang.t('common.more')\" [collapseAt]=\"'sm'\">\n <button *bsPriorityNavItem=\"1\" class=\"btn btn-outline-secondary\" (click)=\"onBack()\">\n <spark-icon name=\"arrow-left\" /> {{ 'common.back' | t }}\n </button>\n @if (canEdit()) {\n <button *bsPriorityNavItem=\"2\" class=\"btn btn-primary\" (click)=\"onEdit()\">\n <spark-icon name=\"pencil\" /> {{ 'common.edit' | t }}\n </button>\n }\n @if (canDelete()) {\n <button *bsPriorityNavItem=\"3\" class=\"btn btn-danger\" (click)=\"onDelete()\">\n <spark-icon name=\"trash\" /> {{ 'common.delete' | t }}\n </button>\n }\n @if (showCustomActions()) {\n @for (action of customActions(); track action.name) {\n <button *bsPriorityNavItem=\"10 + action.offset\" class=\"btn btn-outline-primary\" (click)=\"onCustomAction(action)\">\n {{ action.displayName | resolveTranslation }}\n </button>\n }\n }\n @if (extraActionsTemplate(); as extraActionsTpl) {\n <ng-container *bsPriorityNavItem=\"50\">\n <ng-container *ngTemplateOutlet=\"extraActionsTpl\"></ng-container>\n </ng-container>\n }\n </bs-priority-nav>\n </div>\n <h2>{{ currentItem.breadcrumb || currentItem.name }}</h2>\n\n <bs-grid>\n <bs-tab-control>\n @for (tab of resolvedTabs(); track tab.id) {\n <bs-tab-page>\n <ng-template bsTabPageHeader>{{ tab.label | resolveTranslation:tab.name }}</ng-template>\n <ng-container *ngTemplateOutlet=\"detailTabContent; context: { $implicit: tab }\"></ng-container>\n </bs-tab-page>\n }\n </bs-tab-control>\n\n <ng-template #detailTabContent let-tab>\n @if (tab.id === '__default__') {\n @let ungroupedAttrs = ungroupedAttributes();\n @if (ungroupedAttrs.length > 0) {\n <bs-card style=\"display: block; margin: 1rem;\">\n <div class=\"p-3\">\n <dl bsRow>\n @for (attr of ungroupedAttrs; track attr.id) {\n <ng-container *ngTemplateOutlet=\"detailAttrField; context: { $implicit: attr, item: currentItem }\"></ng-container>\n }\n </dl>\n </div>\n </bs-card>\n }\n }\n @for (group of groupsForTab(tab); track group.id) {\n @if (attrsForGroup(group); as groupAttrs) {\n @if (groupAttrs.length > 0) {\n <bs-card style=\"display: block; margin: 1rem;\">\n @if (group.label) {\n <bs-card-header>{{ group.label | resolveTranslation:group.name }}</bs-card-header>\n }\n <div class=\"p-3\">\n <dl bsRow>\n @for (attr of groupAttrs; track attr.id) {\n <ng-container *ngTemplateOutlet=\"detailAttrField; context: { $implicit: attr, item: currentItem }\"></ng-container>\n }\n </dl>\n </div>\n </bs-card>\n }\n }\n }\n </ng-template>\n\n <ng-template #detailAttrField let-attr let-currentItem=\"item\">\n <dt [sm]=\"3\">{{ (attr.label | resolveTranslation) || attr.name }}</dt>\n <dd [sm]=\"9\">\n @if (getDetailRendererComponent(attr); as rendererType) {\n <ng-container *ngComponentOutlet=\"rendererType; inputs: getDetailRendererInputs(attr, currentItem)\"></ng-container>\n } @else if (attr.dataType === 'AsDetail' && attr.isArray) {\n <bs-table [isResponsive]=\"true\">\n <thead>\n <tr>\n @for (col of (attr | asDetailColumns:asDetailTypes()); track col.name) {\n <th>{{ (col.label | resolveTranslation) || col.name }}</th>\n }\n </tr>\n </thead>\n <tbody class=\"align-middle\">\n @for (row of (attr.name | arrayValue:currentItem); track $index) {\n <tr>\n @for (col of (attr | asDetailColumns:asDetailTypes()); track col.name) {\n <td>\n @if (getAsDetailCellRendererComponent(col); as cellRenderer) {\n <ng-container *ngComponentOutlet=\"cellRenderer; inputs: getAsDetailCellRendererInputs(row, col)\"></ng-container>\n } @else if (col.dataType === 'Reference' && col.referenceType) {\n @let route = (col.referenceType | referenceLinkRoute:row[col.name]:allEntityTypes());\n @if (route) {\n <a [routerLink]=\"route\">{{ (row | asDetailCellValue:attr:col:asDetailReferenceOptions()) }}</a>\n } @else {\n {{ (row | asDetailCellValue:attr:col:asDetailReferenceOptions()) }}\n }\n } @else {\n {{ (row | asDetailCellValue:attr:col:asDetailReferenceOptions()) }}\n }\n </td>\n }\n </tr>\n } @empty {\n <tr>\n <td [attr.colspan]=\"(attr | asDetailColumns:asDetailTypes()).length\" class=\"text-center text-muted\">\n {{ 'common.noItemsFound' | t }}\n </td>\n </tr>\n }\n </tbody>\n </bs-table>\n } @else if (attr.dataType === 'boolean') {\n <input type=\"checkbox\"\n [checked]=\"(attr.name | attributeValue:item():entityType():lookupReferenceOptions():allEntityTypes()) === true\"\n [indeterminate]=\"(attr.name | attributeValue:item():entityType():lookupReferenceOptions():allEntityTypes()) == null\"\n disabled\n onclick=\"return false;\"\n style=\"opacity: 1;\">\n } @else if (attr.dataType === 'color') {\n @let colorVal = (attr.name | attributeValue:item():entityType():lookupReferenceOptions():allEntityTypes());\n @if (colorVal) {\n <span class=\"d-inline-block align-middle border rounded me-2\" [style.background-color]=\"colorVal\" style=\"width: 1.5em; height: 1.5em;\"></span>\n {{ colorVal }}\n } @else {\n -\n }\n } @else if (attr.dataType === 'Reference' && attr.isArray) {\n @let chips = (attr.name | referenceChips:item());\n @if (chips.length) {\n <div class=\"d-flex flex-wrap gap-1\">\n @for (chip of chips; track chip.id) {\n @let chipRoute = (attr.referenceType ? (attr.referenceType | referenceLinkRoute:chip.id:allEntityTypes()) : null);\n @if (chipRoute) {\n <a class=\"badge rounded-pill border bg-body-secondary text-body text-decoration-none px-3 py-2\" [routerLink]=\"chipRoute\">{{ chip.label }}</a>\n } @else {\n <span class=\"badge rounded-pill border bg-body-secondary text-body px-3 py-2\">{{ chip.label }}</span>\n }\n }\n </div>\n } @else {\n -\n }\n } @else if (attr.dataType === 'Reference' && attr.referenceType) {\n @let refRoute = (attr.referenceType | referenceLinkRoute:(attr.name | rawAttributeValue:item()):allEntityTypes());\n @if (refRoute && (attr.name | attributeValue:item():entityType():lookupReferenceOptions():allEntityTypes())) {\n <a [routerLink]=\"refRoute\">{{ (attr.name | attributeValue:item():entityType():lookupReferenceOptions():allEntityTypes()) }}</a>\n } @else {\n {{ (attr.name | attributeValue:item():entityType():lookupReferenceOptions():allEntityTypes()) || '-' }}\n }\n } @else {\n {{ (attr.name | attributeValue:item():entityType():lookupReferenceOptions():allEntityTypes()) || '-' }}\n }\n </dd>\n </ng-template>\n </bs-grid>\n @if (et.queries?.length) {\n @for (queryAlias of et.queries; track queryAlias) {\n <spark-sub-query [queryId]=\"queryAlias\" [parentId]=\"currentItem.id!\" [parentType]=\"et.name\" />\n }\n }\n @if (extraContentTemplate(); as extraContentTpl) {\n <ng-container *ngTemplateOutlet=\"extraContentTpl; context: { $implicit: currentItem, entityType: et }\"></ng-container>\n }\n }\n } @else {\n <div class=\"text-center p-5\">\n <bs-spinner />\n </div>\n }\n</div>\n</bs-container>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;MA2Ba,sBAAsB,CAAA;AAChB,IAAA,YAAY,GAAG,MAAM,CAAC,YAAY,CAAC;AACnC,IAAA,gBAAgB,GAAG,MAAM,CAAC,yBAAyB,CAAC;IAErE,OAAO,GAAG,KAAK,CAAC,QAAQ;gFAAU;IAClC,QAAQ,GAAG,KAAK,CAAC,QAAQ;iFAAU;IACnC,UAAU,GAAG,KAAK,CAAC,QAAQ;mFAAU;IAErC,KAAK,GAAG,MAAM,CAAoB,IAAI;8EAAC;IACvC,UAAU,GAAG,MAAM,CAAoB,IAAI;mFAAC;IAC5C,cAAc,GAAG,MAAM,CAAe,EAAE;uFAAC;IACzC,WAAW,GAAG,MAAM,CAAgB,IAAI;oFAAC;IACzC,sBAAsB,GAAG,MAAM,CAAkC,EAAE;+FAAC;IACpE,OAAO,GAA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BAAkB,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,cAAc,EAAE,sBAAsB,EAAE,kBAAkB,CAAC,EAAA,eAAA,EAG7kB,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,yuSAAA,EAAA,MAAA,EAAA,CAAA,sMAAA,CAAA,EAAA;;;AE9CjD;;AAEG;;;;"}
1
+ {"version":3,"file":"mintplayer-ng-spark-po-detail.mjs","sources":["../../po-detail/src/spark-sub-query.component.ts","../../po-detail/src/spark-sub-query.component.html","../../po-detail/src/spark-po-detail.component.ts","../../po-detail/src/spark-po-detail.component.html","../../po-detail/mintplayer-ng-spark-po-detail.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, computed, effect, inject, input, signal, Type } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { RouterModule } from '@angular/router';\nimport { BsCardComponent, BsCardHeaderComponent } from '@mintplayer/ng-bootstrap/card';\nimport { BsDatatableComponent, BsDatatableColumnDirective, BsRowTemplateDirective, DatatableSettings, type BsDatatableFetch } from '@mintplayer/ng-bootstrap/datatable';\nimport { BsSpinnerComponent } from '@mintplayer/ng-bootstrap/spinner';\nimport { SortColumn } from '@mintplayer/pagination';\nimport { SparkService } from '@mintplayer/ng-spark/services';\nimport { ResolveTranslationPipe, AttributeValuePipe, ReferenceChipsPipe } from '@mintplayer/ng-spark/pipes';\nimport { NgComponentOutlet } from '@angular/common';\nimport { SPARK_ATTRIBUTE_RENDERERS } from '@mintplayer/ng-spark/renderers';\nimport {\n EntityType,\n EntityAttributeDefinition,\n LookupReference,\n PersistentObject,\n SparkQuery,\n ShowedOn,\n hasShowedOnFlag,\n} from '@mintplayer/ng-spark/models';\n\n@Component({\n selector: 'spark-sub-query',\n imports: [CommonModule, NgComponentOutlet, RouterModule, BsCardComponent, BsCardHeaderComponent, BsDatatableComponent, BsDatatableColumnDirective, BsRowTemplateDirective, BsSpinnerComponent, ResolveTranslationPipe, AttributeValuePipe, ReferenceChipsPipe],\n templateUrl: './spark-sub-query.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class SparkSubQueryComponent {\n private readonly sparkService = inject(SparkService);\n private readonly rendererRegistry = inject(SPARK_ATTRIBUTE_RENDERERS);\n\n queryId = input.required<string>();\n parentId = input.required<string>();\n parentType = input.required<string>();\n\n query = signal<SparkQuery | null>(null);\n entityType = signal<EntityType | null>(null);\n allEntityTypes = signal<EntityType[]>([]);\n resultCount = signal<number | null>(null);\n lookupReferenceOptions = signal<Record<string, LookupReference>>({});\n loading = signal(true);\n canRead = signal(false);\n settings = signal(new DatatableSettings({\n perPage: { values: [10, 25, 50], selected: 10 },\n page: { values: [1], selected: 1 },\n sortColumns: []\n }));\n fetchFn = signal<BsDatatableFetch<PersistentObject> | null>(null);\n isVirtualScrolling = computed(() => this.query()?.renderMode === 'VirtualScrolling');\n\n visibleAttributes = computed(() => {\n return this.entityType()?.attributes\n .filter(a => a.isVisible && hasShowedOnFlag(a.showedOn, ShowedOn.Query))\n .sort((a, b) => a.order - b.order) || [];\n });\n\n constructor() {\n effect(() => {\n const qId = this.queryId();\n const pId = this.parentId();\n const pType = this.parentType();\n if (qId && pId && pType) {\n this.loadData(qId, pId, pType);\n }\n });\n }\n\n private async loadData(queryId: string, parentId: string, parentType: string): Promise<void> {\n this.loading.set(true);\n this.resultCount.set(null);\n this.fetchFn.set(null);\n try {\n const [resolvedQuery, entityTypes] = await Promise.all([\n this.sparkService.getQuery(queryId),\n this.sparkService.getEntityTypes()\n ]);\n\n this.query.set(resolvedQuery);\n this.allEntityTypes.set(entityTypes);\n\n const initialSortColumns: SortColumn[] = (resolvedQuery.sortColumns || []).map(sc => ({\n property: sc.property,\n direction: sc.direction === 'desc' ? 'descending' as const : 'ascending' as const\n }));\n\n // Resolve entity type from query's entityType field\n if (resolvedQuery.entityType) {\n const et = entityTypes.find(t =>\n t.name === resolvedQuery.entityType || t.alias === resolvedQuery.entityType?.toLowerCase()\n );\n this.entityType.set(et || null);\n if (et) {\n const permissions = await this.sparkService.getPermissions(et.id);\n this.canRead.set(permissions.canRead);\n }\n }\n\n this.settings.set(new DatatableSettings({\n perPage: { values: [10, 25, 50], selected: 10 },\n page: { values: [1], selected: 1 },\n sortColumns: initialSortColumns\n }));\n // The datatable drives paging/sorting via [(settings)] and calls fetchFn\n // per page. Virtual scrolling is just the [virtualScroll] template flag.\n this.fetchFn.set(this.makeFetch(resolvedQuery, parentId, parentType));\n\n this.loadLookupReferenceOptions();\n } catch {\n this.fetchFn.set(null);\n } finally {\n this.loading.set(false);\n }\n }\n\n private makeFetch(query: SparkQuery, parentId: string, parentType: string): BsDatatableFetch<PersistentObject> {\n return (req) => this.sparkService.executeQuery(query.id, {\n sortColumns: req.sortColumns,\n skip: (req.page - 1) * req.perPage,\n take: req.perPage,\n parentId, parentType,\n }).then(r => {\n this.resultCount.set(r.totalRecords);\n return {\n data: r.data,\n totalRecords: r.totalRecords,\n totalPages: Math.ceil(r.totalRecords / req.perPage) || 1,\n perPage: req.perPage,\n page: req.page,\n };\n }).catch(() => {\n this.resultCount.set(0);\n return { data: [], totalRecords: 0, totalPages: 1, perPage: req.perPage, page: req.page };\n });\n }\n\n private async loadLookupReferenceOptions(): Promise<void> {\n const lookupAttrs = this.visibleAttributes().filter(a => a.lookupReferenceType);\n if (lookupAttrs.length === 0) return;\n\n const lookupNames = [...new Set(lookupAttrs.map(a => a.lookupReferenceType!))];\n const entries = await Promise.all(\n lookupNames.map(async name => {\n const result = await this.sparkService.getLookupReference(name);\n return [name, result] as const;\n })\n );\n this.lookupReferenceOptions.set(entries.reduce((acc, [k, v]) => ({ ...acc, [k]: v }), {} as Record<string, LookupReference>));\n }\n\n getColumnRendererComponent(attr: EntityAttributeDefinition): Type<any> | null {\n if (!attr.renderer) return null;\n return this.rendererRegistry.find(r => r.name === attr.renderer)?.columnComponent ?? null;\n }\n\n getColumnRendererInputs(item: PersistentObject, attr: EntityAttributeDefinition): Record<string, any> {\n const itemAttr = item.attributes.find(a => a.name === attr.name);\n return {\n value: itemAttr?.value,\n attribute: attr,\n options: attr.rendererOptions,\n };\n }\n}\n","@if (query(); as q) {\n <bs-card style=\"display: block; margin: 1rem 0;\">\n <bs-card-header>{{ (q.description | resolveTranslation) || q.name }}</bs-card-header>\n @if (loading()) {\n <div class=\"text-center p-3\">\n <bs-spinner />\n </div>\n } @else {\n <div class=\"p-3\">\n <bs-datatable\n [virtualScroll]=\"isVirtualScrolling()\"\n [itemSize]=\"40\"\n [isResponsive]=\"isVirtualScrolling()\"\n [fetch]=\"fetchFn()\"\n [(settings)]=\"settings\">\n @for (attr of visibleAttributes(); track attr.id) {\n <div *bsDatatableColumn=\"attr.name; sortable: true\">\n {{ (attr.label | resolveTranslation) || attr.name }}\n </div>\n }\n\n <ng-container *bsRowTemplate=\"let item\">\n @let row = $any(item);\n @for (attr of visibleAttributes(); track attr.id; let first = $first) {\n <td>\n @if (row) {\n @if (first && canRead()) {\n <a [routerLink]=\"['/po', entityType()!.alias || entityType()!.id, row.id]\">\n <ng-container *ngTemplateOutlet=\"cellContent; context: { $implicit: row, attr: attr }\"></ng-container>\n </a>\n } @else {\n <ng-container *ngTemplateOutlet=\"cellContent; context: { $implicit: row, attr: attr }\"></ng-container>\n }\n } @else {\n &nbsp;\n }\n </td>\n }\n </ng-container>\n </bs-datatable>\n </div>\n }\n </bs-card>\n}\n\n<ng-template #cellContent let-item let-attr=\"attr\">\n @if (getColumnRendererComponent(attr); as rendererType) {\n <ng-container *ngComponentOutlet=\"rendererType; inputs: getColumnRendererInputs(item, attr)\"></ng-container>\n } @else if (attr.dataType === 'boolean') {\n <input type=\"checkbox\"\n [checked]=\"(attr.name | attributeValue:item:entityType():lookupReferenceOptions():allEntityTypes()) === true\"\n disabled\n onclick=\"return false;\">\n } @else if (attr.dataType === 'color') {\n @let colorVal = (attr.name | attributeValue:item:entityType():lookupReferenceOptions():allEntityTypes());\n @if (colorVal) {\n <span class=\"d-inline-block align-middle border rounded\" [style.background-color]=\"colorVal\" style=\"width: 1.5em; height: 1.5em;\"></span>\n }\n } @else if (attr.dataType === 'Reference' && attr.isArray) {\n <span class=\"d-inline-flex flex-wrap gap-1\">\n @for (chip of (attr.name | referenceChips:item); track chip.id) {\n <span class=\"badge rounded-pill border bg-body-secondary text-body px-3 py-2\">{{ chip.label }}</span>\n }\n </span>\n } @else {\n {{ (attr.name | attributeValue:item:entityType():lookupReferenceOptions():allEntityTypes()) }}\n }\n</ng-template>\n","import { ChangeDetectionStrategy, Component, computed, inject, input, output, signal, TemplateRef, Type } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { CommonModule, NgTemplateOutlet, NgComponentOutlet } from '@angular/common';\nimport { ActivatedRoute, Router, RouterModule } from '@angular/router';\nimport { HttpErrorResponse } from '@angular/common/http';\nimport { Color } from '@mintplayer/ng-bootstrap';\nimport { BsAlertComponent } from '@mintplayer/ng-bootstrap/alert';\nimport { BsCardComponent, BsCardHeaderComponent } from '@mintplayer/ng-bootstrap/card';\nimport { BsContainerComponent } from '@mintplayer/ng-bootstrap/container';\nimport { BsGridComponent, BsGridRowDirective, BsGridColumnDirective } from '@mintplayer/ng-bootstrap/grid';\nimport { BsPriorityNavComponent, BsPriorityNavItemDirective } from '@mintplayer/ng-bootstrap/priority-nav';\nimport { BsTableComponent } from '@mintplayer/ng-bootstrap/table';\nimport { BsTabControlComponent, BsTabPageComponent, BsTabPageHeaderDirective } from '@mintplayer/ng-bootstrap/tab-control';\nimport { BsSpinnerComponent } from '@mintplayer/ng-bootstrap/spinner';\nimport { SparkService, SparkLanguageService } from '@mintplayer/ng-spark/services';\nimport {\n TranslateKeyPipe,\n ResolveTranslationPipe,\n AttributeValuePipe,\n RawAttributeValuePipe,\n AsDetailColumnsPipe,\n AsDetailCellValuePipe,\n ArrayValuePipe,\n ReferenceLinkRoutePipe,\n ReferenceChipsPipe,\n} from '@mintplayer/ng-spark/pipes';\nimport { SparkIconComponent } from '@mintplayer/ng-spark/icon';\nimport { SparkSubQueryComponent } from './spark-sub-query.component';\nimport { SPARK_ATTRIBUTE_RENDERERS } from '@mintplayer/ng-spark/renderers';\nimport {\n CustomActionDefinition,\n EntityType,\n EntityAttributeDefinition,\n AttributeTab,\n AttributeGroup,\n LookupReference,\n PersistentObject,\n ShowedOn,\n hasShowedOnFlag,\n} from '@mintplayer/ng-spark/models';\n\n@Component({\n selector: 'spark-po-detail',\n imports: [CommonModule, NgTemplateOutlet, NgComponentOutlet, RouterModule, BsAlertComponent, BsCardComponent, BsCardHeaderComponent, BsContainerComponent, BsGridComponent, BsGridRowDirective, BsGridColumnDirective, BsPriorityNavComponent, BsPriorityNavItemDirective, BsTableComponent, BsTabControlComponent, BsTabPageComponent, BsTabPageHeaderDirective, BsSpinnerComponent, SparkIconComponent, SparkSubQueryComponent, ResolveTranslationPipe, TranslateKeyPipe, AttributeValuePipe, RawAttributeValuePipe, AsDetailColumnsPipe, AsDetailCellValuePipe, ArrayValuePipe, ReferenceLinkRoutePipe, ReferenceChipsPipe],\n templateUrl: './spark-po-detail.component.html',\n styleUrl: './spark-po-detail.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class SparkPoDetailComponent {\n private readonly route = inject(ActivatedRoute);\n private readonly router = inject(Router);\n private readonly sparkService = inject(SparkService);\n protected readonly lang = inject(SparkLanguageService);\n private readonly rendererRegistry = inject(SPARK_ATTRIBUTE_RENDERERS);\n\n showCustomActions = input(true);\n extraActionsTemplate = input<TemplateRef<void> | null>(null);\n extraContentTemplate = input<TemplateRef<{ $implicit: PersistentObject; entityType: EntityType }> | null>(null);\n\n edited = output<void>();\n deleted = output<void>();\n customActionExecuted = output<{ action: CustomActionDefinition; item: PersistentObject }>();\n\n colors = Color;\n errorMessage = signal<string | null>(null);\n entityType = signal<EntityType | null>(null);\n allEntityTypes = signal<EntityType[]>([]);\n item = signal<PersistentObject | null>(null);\n lookupReferenceOptions = signal<Record<string, LookupReference>>({});\n asDetailTypes = signal<Record<string, EntityType>>({});\n asDetailReferenceOptions = signal<Record<string, Record<string, PersistentObject[]>>>({});\n type = '';\n id = '';\n canEdit = signal(false);\n canDelete = signal(false);\n customActions = signal<CustomActionDefinition[]>([]);\n\n constructor() {\n this.route.paramMap.pipe(takeUntilDestroyed()).subscribe(params => this.onParamsChange(params));\n }\n\n private async onParamsChange(params: any): Promise<void> {\n this.type = params.get('type') || '';\n this.id = params.get('id') || '';\n\n try {\n const [entityTypes, item] = await Promise.all([\n this.sparkService.getEntityTypes(),\n this.sparkService.get(this.type, this.id)\n ]);\n\n this.allEntityTypes.set(entityTypes);\n this.entityType.set(entityTypes.find(t => t.id === this.type || t.alias === this.type) || null);\n this.item.set(item);\n this.loadLookupReferenceOptions();\n this.loadAsDetailTypes();\n\n const et = this.entityType();\n if (et) {\n const [permissions, actions] = await Promise.all([\n this.sparkService.getPermissions(et.id),\n this.sparkService.getCustomActions(et.id)\n ]);\n this.canEdit.set(permissions.canEdit);\n this.canDelete.set(permissions.canDelete);\n this.customActions.set(actions.filter(a => a.showedOn === 'detail' || a.showedOn === 'both'));\n }\n } catch (e) {\n const error = e as HttpErrorResponse;\n this.errorMessage.set(error.error?.error || error.message || 'An unexpected error occurred');\n }\n }\n\n visibleAttributes = computed(() => {\n return this.entityType()?.attributes\n .filter(a => a.isVisible && hasShowedOnFlag(a.showedOn, ShowedOn.PersistentObject))\n .sort((a, b) => a.order - b.order) || [];\n });\n\n private static readonly DEFAULT_TAB: AttributeTab = { id: '__default__', name: 'Algemeen', label: { nl: 'Algemeen', en: 'General' }, order: 0 };\n\n ungroupedAttributes = computed(() => {\n const attrs = this.visibleAttributes();\n const groupIds = new Set((this.entityType()?.groups || []).map(g => g.id));\n return attrs.filter(a => !a.group || !groupIds.has(a.group));\n });\n\n resolvedTabs = computed((): AttributeTab[] => {\n const et = this.entityType();\n const definedTabs = et?.tabs?.length ? [...et.tabs].sort((a, b) => a.order - b.order) : [];\n const hasUngroupedAttrs = this.ungroupedAttributes().length > 0;\n const hasUntabbedGroups = (et?.groups || []).some(g => !g.tab);\n\n if (hasUngroupedAttrs || hasUntabbedGroups || definedTabs.length === 0) {\n return [SparkPoDetailComponent.DEFAULT_TAB, ...definedTabs];\n }\n return definedTabs;\n });\n\n groupsForTab(tab: AttributeTab): AttributeGroup[] {\n const groups = this.entityType()?.groups || [];\n if (tab.id === '__default__') {\n return groups.filter(g => !g.tab).sort((a, b) => a.order - b.order);\n }\n return groups.filter(g => g.tab === tab.id).sort((a, b) => a.order - b.order);\n }\n\n attrsForGroup(group: AttributeGroup): EntityAttributeDefinition[] {\n return this.visibleAttributes().filter(a => a.group === group.id);\n }\n\n getDetailRendererComponent(attr: EntityAttributeDefinition): Type<any> | null {\n if (!attr.renderer) return null;\n return this.rendererRegistry.find(r => r.name === attr.renderer)?.detailComponent ?? null;\n }\n\n getDetailRendererInputs(attr: EntityAttributeDefinition, item: PersistentObject): Record<string, any> {\n const itemAttr = item.attributes.find(a => a.name === attr.name);\n const formData: Record<string, any> = {};\n for (const a of item.attributes) {\n formData[a.name] = a.value;\n }\n return {\n value: itemAttr?.value,\n attribute: attr,\n options: attr.rendererOptions,\n formData,\n };\n }\n\n /** Column renderer for a cell of an AsDetail sub-table (so embedded rows honor `col.renderer` too). */\n getAsDetailCellRendererComponent(col: EntityAttributeDefinition): Type<any> | null {\n if (!col.renderer) return null;\n return this.rendererRegistry.find(r => r.name === col.renderer)?.columnComponent ?? null;\n }\n\n getAsDetailCellRendererInputs(row: Record<string, any>, col: EntityAttributeDefinition): Record<string, any> {\n return {\n value: row[col.name],\n attribute: col,\n options: col.rendererOptions,\n };\n }\n\n private async loadLookupReferenceOptions(): Promise<void> {\n const lookupAttrs = this.visibleAttributes().filter(a => a.lookupReferenceType);\n if (lookupAttrs.length === 0) return;\n\n const lookupNames = [...new Set(lookupAttrs.map(a => a.lookupReferenceType!))];\n const entries = await Promise.all(\n lookupNames.map(async name => {\n const result = await this.sparkService.getLookupReference(name);\n return [name, result] as const;\n })\n );\n this.lookupReferenceOptions.set(entries.reduce((acc, [k, v]) => ({ ...acc, [k]: v }), {} as Record<string, LookupReference>));\n }\n\n private async loadAsDetailTypes(): Promise<void> {\n const asDetailAttrs = this.visibleAttributes().filter(a => a.dataType === 'AsDetail' && a.isArray && a.asDetailType);\n if (asDetailAttrs.length === 0) return;\n\n const types = this.allEntityTypes();\n const newAsDetailTypes: Record<string, EntityType> = {};\n\n for (const attr of asDetailAttrs) {\n const asDetailType = types.find(t => t.clrType === attr.asDetailType);\n if (asDetailType) {\n newAsDetailTypes[attr.name] = asDetailType;\n const refCols = asDetailType.attributes.filter(a => a.dataType === 'Reference' && a.query);\n if (refCols.length > 0) {\n const refEntries = await Promise.all(\n refCols.map(async col => {\n const result = await this.sparkService.executeQueryByName(col.query!, {\n parentId: this.id,\n parentType: this.type,\n });\n return [col.name, result.data] as const;\n })\n );\n this.asDetailReferenceOptions.update(prev => ({\n ...prev,\n [attr.name]: refEntries.reduce((acc, [k, v]) => ({ ...acc, [k]: v }), {} as Record<string, PersistentObject[]>)\n }));\n }\n }\n }\n this.asDetailTypes.set(newAsDetailTypes);\n }\n\n async onCustomAction(action: CustomActionDefinition): Promise<void> {\n if (action.confirmationMessageKey) {\n const message = this.lang.t(action.confirmationMessageKey) || 'Are you sure?';\n if (!confirm(message)) return;\n }\n try {\n await this.sparkService.executeCustomAction(this.type, action.name, this.item() || undefined);\n this.customActionExecuted.emit({ action, item: this.item()! });\n if (action.refreshOnCompleted) {\n const item = await this.sparkService.get(this.type, this.id);\n this.item.set(item);\n }\n } catch (e) {\n const err = e as HttpErrorResponse;\n this.errorMessage.set(err.error?.error || err.message || 'Action failed');\n }\n }\n\n onEdit(): void {\n this.edited.emit();\n this.router.navigate(['/po', this.type, this.id, 'edit']);\n }\n\n async onDelete(): Promise<void> {\n if (confirm(this.lang.t('confirmDelete'))) {\n await this.sparkService.delete(this.type, this.id);\n this.deleted.emit();\n this.router.navigate(['/']);\n }\n }\n\n onBack(): void {\n window.history.back();\n }\n}\n","<bs-container>\n<div class=\"container\">\n @if (errorMessage(); as err) {\n <bs-alert [type]=\"colors.danger\" class=\"mb-3\">\n {{ err }}\n </bs-alert>\n } @else if (item(); as currentItem) {\n @if (entityType(); as et) {\n <div class=\"spark-actionbar px-3 py-2\">\n <bs-priority-nav [moreLabel]=\"lang.t('common.more')\" [collapseAt]=\"'sm'\">\n <button *bsPriorityNavItem=\"1\" class=\"btn btn-outline-secondary\" (click)=\"onBack()\">\n <spark-icon name=\"arrow-left\" /> {{ 'common.back' | t }}\n </button>\n @if (canEdit()) {\n <button *bsPriorityNavItem=\"2\" class=\"btn btn-primary\" (click)=\"onEdit()\">\n <spark-icon name=\"pencil\" /> {{ 'common.edit' | t }}\n </button>\n }\n @if (canDelete()) {\n <button *bsPriorityNavItem=\"3\" class=\"btn btn-danger\" (click)=\"onDelete()\">\n <spark-icon name=\"trash\" /> {{ 'common.delete' | t }}\n </button>\n }\n @if (showCustomActions()) {\n @for (action of customActions(); track action.name) {\n <button *bsPriorityNavItem=\"10 + action.offset\" class=\"btn btn-outline-primary\" (click)=\"onCustomAction(action)\">\n {{ action.displayName | resolveTranslation }}\n </button>\n }\n }\n @if (extraActionsTemplate(); as extraActionsTpl) {\n <ng-container *bsPriorityNavItem=\"50\">\n <ng-container *ngTemplateOutlet=\"extraActionsTpl\"></ng-container>\n </ng-container>\n }\n </bs-priority-nav>\n </div>\n <h2>{{ currentItem.breadcrumb || currentItem.name }}</h2>\n\n <bs-grid>\n <bs-tab-control>\n @for (tab of resolvedTabs(); track tab.id) {\n <bs-tab-page>\n <ng-template bsTabPageHeader>{{ tab.label | resolveTranslation:tab.name }}</ng-template>\n <ng-container *ngTemplateOutlet=\"detailTabContent; context: { $implicit: tab }\"></ng-container>\n </bs-tab-page>\n }\n </bs-tab-control>\n\n <ng-template #detailTabContent let-tab>\n @if (tab.id === '__default__') {\n @let ungroupedAttrs = ungroupedAttributes();\n @if (ungroupedAttrs.length > 0) {\n <bs-card style=\"display: block; margin: 1rem;\">\n <div class=\"p-3\">\n <dl bsRow>\n @for (attr of ungroupedAttrs; track attr.id) {\n <ng-container *ngTemplateOutlet=\"detailAttrField; context: { $implicit: attr, item: currentItem }\"></ng-container>\n }\n </dl>\n </div>\n </bs-card>\n }\n }\n @for (group of groupsForTab(tab); track group.id) {\n @if (attrsForGroup(group); as groupAttrs) {\n @if (groupAttrs.length > 0) {\n <bs-card style=\"display: block; margin: 1rem;\">\n @if (group.label) {\n <bs-card-header>{{ group.label | resolveTranslation:group.name }}</bs-card-header>\n }\n <div class=\"p-3\">\n <dl bsRow>\n @for (attr of groupAttrs; track attr.id) {\n <ng-container *ngTemplateOutlet=\"detailAttrField; context: { $implicit: attr, item: currentItem }\"></ng-container>\n }\n </dl>\n </div>\n </bs-card>\n }\n }\n }\n </ng-template>\n\n <ng-template #detailAttrField let-attr let-currentItem=\"item\">\n <dt [sm]=\"3\">{{ (attr.label | resolveTranslation) || attr.name }}</dt>\n <dd [sm]=\"9\">\n @if (getDetailRendererComponent(attr); as rendererType) {\n <ng-container *ngComponentOutlet=\"rendererType; inputs: getDetailRendererInputs(attr, currentItem)\"></ng-container>\n } @else if (attr.dataType === 'AsDetail' && attr.isArray) {\n <bs-table [isResponsive]=\"true\">\n <thead>\n <tr>\n @for (col of (attr | asDetailColumns:asDetailTypes()); track col.name) {\n <th>{{ (col.label | resolveTranslation) || col.name }}</th>\n }\n </tr>\n </thead>\n <tbody class=\"align-middle\">\n @for (row of (attr.name | arrayValue:currentItem); track $index) {\n <tr>\n @for (col of (attr | asDetailColumns:asDetailTypes()); track col.name) {\n <td>\n @if (getAsDetailCellRendererComponent(col); as cellRenderer) {\n <ng-container *ngComponentOutlet=\"cellRenderer; inputs: getAsDetailCellRendererInputs(row, col)\"></ng-container>\n } @else if (col.dataType === 'Reference' && col.referenceType) {\n @let route = (col.referenceType | referenceLinkRoute:row[col.name]:allEntityTypes());\n @if (route) {\n <a [routerLink]=\"route\">{{ (row | asDetailCellValue:attr:col:asDetailReferenceOptions()) }}</a>\n } @else {\n {{ (row | asDetailCellValue:attr:col:asDetailReferenceOptions()) }}\n }\n } @else {\n {{ (row | asDetailCellValue:attr:col:asDetailReferenceOptions()) }}\n }\n </td>\n }\n </tr>\n } @empty {\n <tr>\n <td [attr.colspan]=\"(attr | asDetailColumns:asDetailTypes()).length\" class=\"text-center text-muted\">\n {{ 'common.noItemsFound' | t }}\n </td>\n </tr>\n }\n </tbody>\n </bs-table>\n } @else if (attr.dataType === 'boolean') {\n <input type=\"checkbox\"\n [checked]=\"(attr.name | attributeValue:item():entityType():lookupReferenceOptions():allEntityTypes()) === true\"\n [indeterminate]=\"(attr.name | attributeValue:item():entityType():lookupReferenceOptions():allEntityTypes()) == null\"\n disabled\n onclick=\"return false;\"\n style=\"opacity: 1;\">\n } @else if (attr.dataType === 'color') {\n @let colorVal = (attr.name | attributeValue:item():entityType():lookupReferenceOptions():allEntityTypes());\n @if (colorVal) {\n <span class=\"d-inline-block align-middle border rounded me-2\" [style.background-color]=\"colorVal\" style=\"width: 1.5em; height: 1.5em;\"></span>\n {{ colorVal }}\n } @else {\n -\n }\n } @else if (attr.dataType === 'Reference' && attr.isArray) {\n @let chips = (attr.name | referenceChips:item());\n @if (chips.length) {\n <div class=\"d-flex flex-wrap gap-1\">\n @for (chip of chips; track chip.id) {\n @let chipRoute = (attr.referenceType ? (attr.referenceType | referenceLinkRoute:chip.id:allEntityTypes()) : null);\n @if (chipRoute) {\n <a class=\"badge rounded-pill border bg-body-secondary text-body text-decoration-none px-3 py-2\" [routerLink]=\"chipRoute\">{{ chip.label }}</a>\n } @else {\n <span class=\"badge rounded-pill border bg-body-secondary text-body px-3 py-2\">{{ chip.label }}</span>\n }\n }\n </div>\n } @else {\n -\n }\n } @else if (attr.dataType === 'Reference' && attr.referenceType) {\n @let refRoute = (attr.referenceType | referenceLinkRoute:(attr.name | rawAttributeValue:item()):allEntityTypes());\n @if (refRoute && (attr.name | attributeValue:item():entityType():lookupReferenceOptions():allEntityTypes())) {\n <a [routerLink]=\"refRoute\">{{ (attr.name | attributeValue:item():entityType():lookupReferenceOptions():allEntityTypes()) }}</a>\n } @else {\n {{ (attr.name | attributeValue:item():entityType():lookupReferenceOptions():allEntityTypes()) || '-' }}\n }\n } @else {\n {{ (attr.name | attributeValue:item():entityType():lookupReferenceOptions():allEntityTypes()) || '-' }}\n }\n </dd>\n </ng-template>\n </bs-grid>\n @if (et.queries?.length) {\n @for (queryAlias of et.queries; track queryAlias) {\n <spark-sub-query [queryId]=\"queryAlias\" [parentId]=\"currentItem.id!\" [parentType]=\"et.name\" />\n }\n }\n @if (extraContentTemplate(); as extraContentTpl) {\n <ng-container *ngTemplateOutlet=\"extraContentTpl; context: { $implicit: currentItem, entityType: et }\"></ng-container>\n }\n }\n } @else {\n <div class=\"text-center p-5\">\n <bs-spinner />\n </div>\n }\n</div>\n</bs-container>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;MA2Ba,sBAAsB,CAAA;AAChB,IAAA,YAAY,GAAG,MAAM,CAAC,YAAY,CAAC;AACnC,IAAA,gBAAgB,GAAG,MAAM,CAAC,yBAAyB,CAAC;IAErE,OAAO,GAAG,KAAK,CAAC,QAAQ;gFAAU;IAClC,QAAQ,GAAG,KAAK,CAAC,QAAQ;iFAAU;IACnC,UAAU,GAAG,KAAK,CAAC,QAAQ;mFAAU;IAErC,KAAK,GAAG,MAAM,CAAoB,IAAI;8EAAC;IACvC,UAAU,GAAG,MAAM,CAAoB,IAAI;mFAAC;IAC5C,cAAc,GAAG,MAAM,CAAe,EAAE;uFAAC;IACzC,WAAW,GAAG,MAAM,CAAgB,IAAI;oFAAC;IACzC,sBAAsB,GAAG,MAAM,CAAkC,EAAE;+FAAC;IACpE,OAAO,GAAG,MAAM,CAAC,IAAI;gFAAC;IACtB,OAAO,GAAG,MAAM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AAe,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,eAAe,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,0BAA0B,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,cAAc,EAAE,sBAAsB,EAAE,kBAAkB,CAAC,EAAA,eAAA,EAG7kB,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,yuSAAA,EAAA,MAAA,EAAA,CAAA,sMAAA,CAAA,EAAA;;;AE9CjD;;AAEG;;;;"}
@@ -184,7 +184,7 @@ function entityTypeFromPo(po) {
184
184
  id: po.objectTypeId,
185
185
  name: po.name,
186
186
  clrType: '', // Not needed by the form's rendering path; the PO's attributes carry the schema.
187
- displayAttribute: undefined,
187
+ breadcrumb: undefined,
188
188
  tabs: [],
189
189
  groups: [],
190
190
  attributes: (po.attributes ?? []).map(attrToDefinition),
@@ -1 +1 @@
1
- {"version":3,"file":"mintplayer-ng-spark-retry-action-modal.mjs","sources":["../../retry-action-modal/src/spark-retry-action-modal.component.ts","../../retry-action-modal/mintplayer-ng-spark-retry-action-modal.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, computed, effect, inject, signal } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { Color } from '@mintplayer/ng-bootstrap';\nimport { BsModalHostComponent, BsModalDirective, BsModalHeaderDirective, BsModalBodyDirective, BsModalFooterDirective } from '@mintplayer/ng-bootstrap/modal';\nimport { BsButtonTypeDirective } from '@mintplayer/ng-bootstrap/button-type';\nimport { RetryActionService, SparkService } from '@mintplayer/ng-spark/services';\nimport { SparkPoFormComponent } from '@mintplayer/ng-spark/po-form';\nimport {\n dictToNestedPo,\n EntityAttributeDefinition,\n EntityType,\n EntityTypeResolver,\n nestedPoToDict,\n PersistentObject,\n PersistentObjectAttribute,\n} from '@mintplayer/ng-spark/models';\n\n/**\n * Renders a retry-action popup. Before PRD §3 this component rendered title / message /\n * option buttons only and silently forwarded the incoming <c>persistentObject</c> back to\n * the server on submit — meaning any <c>Retry.Action(..., persistentObject)</c> flow had\n * no UI to actually edit the PO. This component now embeds the shared PO form so every\n * scalar / Reference / AsDetail attribute on the scaffolded Virtual PO is a real form\n * field, and the values the user fills in flow back to the server via\n * <c>RetryResult.PersistentObject</c>.\n */\n@Component({\n selector: 'spark-retry-action-modal',\n imports: [CommonModule, BsModalHostComponent, BsModalDirective, BsModalHeaderDirective, BsModalBodyDirective, BsModalFooterDirective, BsButtonTypeDirective, SparkPoFormComponent],\n template: `\n <bs-modal [isOpen]=\"isOpen()\" (isOpenChange)=\"!$event && onOption('Cancel')\">\n <div *bsModal>\n <div bsModalHeader>\n <h5 class=\"modal-title\">{{ retryActionService.payload()?.title }}</h5>\n </div>\n <div bsModalBody>\n @if (retryActionService.payload()?.message; as message) {\n <p>{{ message }}</p>\n }\n @if (entityType(); as et) {\n <spark-po-form\n [entityType]=\"et\"\n [(formData)]=\"formData\"\n [showButtons]=\"false\">\n </spark-po-form>\n }\n </div>\n <div bsModalFooter>\n @for (option of retryActionService.payload()?.options; track option) {\n <button\n type=\"button\"\n [color]=\"option === 'Cancel' ? colors.secondary : colors.primary\"\n (click)=\"onOption(option)\">\n {{ option }}\n </button>\n }\n </div>\n </div>\n </bs-modal>\n `,\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class SparkRetryActionModalComponent {\n protected readonly retryActionService = inject(RetryActionService);\n private readonly sparkService = inject(SparkService);\n\n colors = Color;\n isOpen = computed(() => this.retryActionService.payload() !== null);\n\n /**\n * EntityType definition for the incoming PO — fetched lazily via SparkService so the\n * form knows which attributes are editable, their labels, rules, renderers, etc.\n * `null` when the payload has no persistentObject or its objectTypeId doesn't match\n * any registered entity type (renders the modal as a simple option picker).\n */\n entityType = signal<EntityType | null>(null);\n formData = signal<Record<string, any>>({});\n private allEntityTypes: EntityType[] = [];\n\n constructor() {\n // Reseed form state every time the retry service opens/closes the modal. Effect\n // cleanup isn't needed since `payload` is a signal and the component's own lifetime\n // is root-scoped.\n effect(() => {\n const payload = this.retryActionService.payload();\n if (!payload?.persistentObject) {\n this.entityType.set(null);\n this.formData.set({});\n return;\n }\n void this.seedForm(payload.persistentObject);\n });\n }\n\n private async seedForm(po: PersistentObject): Promise<void> {\n // Virtual POs used for retry prompts (e.g. ConfirmDeleteCar) typically have no\n // security.json grant — so `getEntityTypes()` filters them out for the current user\n // and the lookup-by-id would return null, leaving the form blank. The scaffolded PO\n // already carries full attribute metadata (label / dataType / rules / renderer / etc.),\n // so we synthesize an EntityType from the attributes directly and skip the HTTP\n // lookup altogether. `getEntityTypes()` is still fetched once (cached on the\n // component) because the embedded spark-po-form needs the full list to resolve\n // nested AsDetail / Reference types the retry PO might point at.\n if (this.allEntityTypes.length === 0) {\n try { this.allEntityTypes = await this.sparkService.getEntityTypes(); }\n catch { this.allEntityTypes = []; }\n }\n this.entityType.set(entityTypeFromPo(po));\n // Flatten the nested PO into the Record<string, any> shape the shared form uses\n // throughout the rest of ng-spark — same transformation po-edit applies.\n this.formData.set(nestedPoToDict(po));\n }\n\n onOption(option: string): void {\n const payload = this.retryActionService.payload();\n if (!payload) return;\n\n const populated = this.populatedPersistentObject(payload.persistentObject);\n this.retryActionService.respond({\n step: payload.step,\n option,\n persistentObject: populated,\n });\n }\n\n /**\n * Builds the PO the server sees under <c>Retry.Result.PersistentObject</c>. If the\n * form resolved an EntityType, rebuild from the schema + formData (identical to the\n * po-edit save path — AsDetail recursion included). Otherwise forward the incoming\n * PO unmodified so pre-§3 flows without editable attributes keep working.\n */\n private populatedPersistentObject(incoming: PersistentObject | undefined): PersistentObject | undefined {\n if (!incoming) return undefined;\n const type = this.entityType();\n if (!type) return incoming;\n\n const resolver: EntityTypeResolver = (clrName) => this.allEntityTypes.find(t => t.clrType === clrName);\n const rebuilt = dictToNestedPo(this.formData(), type, resolver);\n const populated: PersistentObject = {\n ...incoming,\n attributes: mergeAttributeMetadata(incoming.attributes ?? [], rebuilt.attributes),\n };\n return populated;\n }\n}\n\n/**\n * Builds a synthetic <see cref=\"EntityType\"/> from the PO's own scaffolded attributes so\n * the embedded spark-po-form can render without having to locate the matching server-side\n * EntityType registration. Used for Virtual POs that are schema-registered but not\n * security-granted (retry-action popups).\n */\nfunction entityTypeFromPo(po: PersistentObject): EntityType {\n return {\n id: po.objectTypeId,\n name: po.name,\n clrType: '', // Not needed by the form's rendering path; the PO's attributes carry the schema.\n displayAttribute: undefined,\n tabs: [],\n groups: [],\n attributes: (po.attributes ?? []).map(attrToDefinition),\n queries: [],\n };\n}\n\nfunction attrToDefinition(attr: PersistentObjectAttribute): EntityAttributeDefinition {\n return {\n id: attr.id ?? '',\n name: attr.name,\n label: attr.label,\n dataType: attr.dataType,\n isArray: attr.isArray,\n isRequired: attr.isRequired,\n isVisible: attr.isVisible,\n isReadOnly: attr.isReadOnly,\n order: attr.order,\n query: attr.query,\n asDetailType: attr.asDetailType,\n showedOn: attr.showedOn,\n rules: attr.rules ?? [],\n group: attr.group,\n renderer: attr.renderer,\n rendererOptions: attr.rendererOptions,\n };\n}\n\n/**\n * Keeps the server-issued id + metadata on each attribute while overlaying the user's\n * values from the rebuilt PO. Prevents the modal from accidentally dropping server-only\n * fields (e.g. rules, renderer options) that the form didn't need to know about.\n */\nfunction mergeAttributeMetadata(\n incoming: PersistentObjectAttribute[],\n rebuilt: PersistentObjectAttribute[],\n): PersistentObjectAttribute[] {\n const byName = new Map(rebuilt.map(a => [a.name, a]));\n return incoming.map(source => {\n const updated = byName.get(source.name);\n if (!updated) return source;\n return {\n ...source,\n value: updated.value,\n object: updated.object,\n objects: updated.objects,\n asDetailType: updated.asDetailType ?? source.asDetailType,\n isValueChanged: true,\n };\n });\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":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AE,IAAI,CAAC,KAAK,IAAI,EAAE;QACvB,KAAK,EAAE,IAAI,CAAC,KAAK;QACjB,QAAQ,EAAE,IAAI,CAAC,QAAQ;QACvB,eAAe,EAAE,IAAI,CAAC,eAAe;KACtC;AACH;AAEA;;;;AAIG;AACH,SAAS,sBAAsB,CAC7B,QAAqC,EACrC,OAAoC,EAAA;IAEpC,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;AACrD,IAAA,OAAO,QAAQ,CAAC,GAAG,CAAC,MAAM,IAAG;QAC3B,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC;AACvC,QAAA,IAAI,CAAC,OAAO;AAAE,YAAA,OAAO,MAAM;QAC3B,OAAO;AACL,YAAA,GAAG,MAAM;YACT,KAAK,EAAE,OAAO,CAAC,KAAK;YACpB,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,OAAO,EAAE,OAAO,CAAC,OAAO;AACxB,YAAA,YAAY,EAAE,OAAO,CAAC,YAAY,IAAI,MAAM,CAAC,YAAY;AACzD,YAAA,cAAc,EAAE,IAAI;SACrB;AACH,IAAA,CAAC,CAAC;AACJ;;AChNA;;AAEG;;;;"}
1
+ {"version":3,"file":"mintplayer-ng-spark-retry-action-modal.mjs","sources":["../../retry-action-modal/src/spark-retry-action-modal.component.ts","../../retry-action-modal/mintplayer-ng-spark-retry-action-modal.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, computed, effect, inject, signal } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { Color } from '@mintplayer/ng-bootstrap';\nimport { BsModalHostComponent, BsModalDirective, BsModalHeaderDirective, BsModalBodyDirective, BsModalFooterDirective } from '@mintplayer/ng-bootstrap/modal';\nimport { BsButtonTypeDirective } from '@mintplayer/ng-bootstrap/button-type';\nimport { RetryActionService, SparkService } from '@mintplayer/ng-spark/services';\nimport { SparkPoFormComponent } from '@mintplayer/ng-spark/po-form';\nimport {\n dictToNestedPo,\n EntityAttributeDefinition,\n EntityType,\n EntityTypeResolver,\n nestedPoToDict,\n PersistentObject,\n PersistentObjectAttribute,\n} from '@mintplayer/ng-spark/models';\n\n/**\n * Renders a retry-action popup. Before PRD §3 this component rendered title / message /\n * option buttons only and silently forwarded the incoming <c>persistentObject</c> back to\n * the server on submit — meaning any <c>Retry.Action(..., persistentObject)</c> flow had\n * no UI to actually edit the PO. This component now embeds the shared PO form so every\n * scalar / Reference / AsDetail attribute on the scaffolded Virtual PO is a real form\n * field, and the values the user fills in flow back to the server via\n * <c>RetryResult.PersistentObject</c>.\n */\n@Component({\n selector: 'spark-retry-action-modal',\n imports: [CommonModule, BsModalHostComponent, BsModalDirective, BsModalHeaderDirective, BsModalBodyDirective, BsModalFooterDirective, BsButtonTypeDirective, SparkPoFormComponent],\n template: `\n <bs-modal [isOpen]=\"isOpen()\" (isOpenChange)=\"!$event && onOption('Cancel')\">\n <div *bsModal>\n <div bsModalHeader>\n <h5 class=\"modal-title\">{{ retryActionService.payload()?.title }}</h5>\n </div>\n <div bsModalBody>\n @if (retryActionService.payload()?.message; as message) {\n <p>{{ message }}</p>\n }\n @if (entityType(); as et) {\n <spark-po-form\n [entityType]=\"et\"\n [(formData)]=\"formData\"\n [showButtons]=\"false\">\n </spark-po-form>\n }\n </div>\n <div bsModalFooter>\n @for (option of retryActionService.payload()?.options; track option) {\n <button\n type=\"button\"\n [color]=\"option === 'Cancel' ? colors.secondary : colors.primary\"\n (click)=\"onOption(option)\">\n {{ option }}\n </button>\n }\n </div>\n </div>\n </bs-modal>\n `,\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class SparkRetryActionModalComponent {\n protected readonly retryActionService = inject(RetryActionService);\n private readonly sparkService = inject(SparkService);\n\n colors = Color;\n isOpen = computed(() => this.retryActionService.payload() !== null);\n\n /**\n * EntityType definition for the incoming PO — fetched lazily via SparkService so the\n * form knows which attributes are editable, their labels, rules, renderers, etc.\n * `null` when the payload has no persistentObject or its objectTypeId doesn't match\n * any registered entity type (renders the modal as a simple option picker).\n */\n entityType = signal<EntityType | null>(null);\n formData = signal<Record<string, any>>({});\n private allEntityTypes: EntityType[] = [];\n\n constructor() {\n // Reseed form state every time the retry service opens/closes the modal. Effect\n // cleanup isn't needed since `payload` is a signal and the component's own lifetime\n // is root-scoped.\n effect(() => {\n const payload = this.retryActionService.payload();\n if (!payload?.persistentObject) {\n this.entityType.set(null);\n this.formData.set({});\n return;\n }\n void this.seedForm(payload.persistentObject);\n });\n }\n\n private async seedForm(po: PersistentObject): Promise<void> {\n // Virtual POs used for retry prompts (e.g. ConfirmDeleteCar) typically have no\n // security.json grant — so `getEntityTypes()` filters them out for the current user\n // and the lookup-by-id would return null, leaving the form blank. The scaffolded PO\n // already carries full attribute metadata (label / dataType / rules / renderer / etc.),\n // so we synthesize an EntityType from the attributes directly and skip the HTTP\n // lookup altogether. `getEntityTypes()` is still fetched once (cached on the\n // component) because the embedded spark-po-form needs the full list to resolve\n // nested AsDetail / Reference types the retry PO might point at.\n if (this.allEntityTypes.length === 0) {\n try { this.allEntityTypes = await this.sparkService.getEntityTypes(); }\n catch { this.allEntityTypes = []; }\n }\n this.entityType.set(entityTypeFromPo(po));\n // Flatten the nested PO into the Record<string, any> shape the shared form uses\n // throughout the rest of ng-spark — same transformation po-edit applies.\n this.formData.set(nestedPoToDict(po));\n }\n\n onOption(option: string): void {\n const payload = this.retryActionService.payload();\n if (!payload) return;\n\n const populated = this.populatedPersistentObject(payload.persistentObject);\n this.retryActionService.respond({\n step: payload.step,\n option,\n persistentObject: populated,\n });\n }\n\n /**\n * Builds the PO the server sees under <c>Retry.Result.PersistentObject</c>. If the\n * form resolved an EntityType, rebuild from the schema + formData (identical to the\n * po-edit save path — AsDetail recursion included). Otherwise forward the incoming\n * PO unmodified so pre-§3 flows without editable attributes keep working.\n */\n private populatedPersistentObject(incoming: PersistentObject | undefined): PersistentObject | undefined {\n if (!incoming) return undefined;\n const type = this.entityType();\n if (!type) return incoming;\n\n const resolver: EntityTypeResolver = (clrName) => this.allEntityTypes.find(t => t.clrType === clrName);\n const rebuilt = dictToNestedPo(this.formData(), type, resolver);\n const populated: PersistentObject = {\n ...incoming,\n attributes: mergeAttributeMetadata(incoming.attributes ?? [], rebuilt.attributes),\n };\n return populated;\n }\n}\n\n/**\n * Builds a synthetic <see cref=\"EntityType\"/> from the PO's own scaffolded attributes so\n * the embedded spark-po-form can render without having to locate the matching server-side\n * EntityType registration. Used for Virtual POs that are schema-registered but not\n * security-granted (retry-action popups).\n */\nfunction entityTypeFromPo(po: PersistentObject): EntityType {\n return {\n id: po.objectTypeId,\n name: po.name,\n clrType: '', // Not needed by the form's rendering path; the PO's attributes carry the schema.\n breadcrumb: undefined,\n tabs: [],\n groups: [],\n attributes: (po.attributes ?? []).map(attrToDefinition),\n queries: [],\n };\n}\n\nfunction attrToDefinition(attr: PersistentObjectAttribute): EntityAttributeDefinition {\n return {\n id: attr.id ?? '',\n name: attr.name,\n label: attr.label,\n dataType: attr.dataType,\n isArray: attr.isArray,\n isRequired: attr.isRequired,\n isVisible: attr.isVisible,\n isReadOnly: attr.isReadOnly,\n order: attr.order,\n query: attr.query,\n asDetailType: attr.asDetailType,\n showedOn: attr.showedOn,\n rules: attr.rules ?? [],\n group: attr.group,\n renderer: attr.renderer,\n rendererOptions: attr.rendererOptions,\n };\n}\n\n/**\n * Keeps the server-issued id + metadata on each attribute while overlaying the user's\n * values from the rebuilt PO. Prevents the modal from accidentally dropping server-only\n * fields (e.g. rules, renderer options) that the form didn't need to know about.\n */\nfunction mergeAttributeMetadata(\n incoming: PersistentObjectAttribute[],\n rebuilt: PersistentObjectAttribute[],\n): PersistentObjectAttribute[] {\n const byName = new Map(rebuilt.map(a => [a.name, a]));\n return incoming.map(source => {\n const updated = byName.get(source.name);\n if (!updated) return source;\n return {\n ...source,\n value: updated.value,\n object: updated.object,\n objects: updated.objects,\n asDetailType: updated.asDetailType ?? source.asDetailType,\n isValueChanged: true,\n };\n });\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;AAiBA;;;;;;;;AAQG;MAqCU,8BAA8B,CAAA;AACtB,IAAA,kBAAkB,GAAG,MAAM,CAAC,kBAAkB,CAAC;AACjD,IAAA,YAAY,GAAG,MAAM,CAAC,YAAY,CAAC;IAEpD,MAAM,GAAG,KAAK;AACd,IAAA,MAAM,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,kBAAkB,CAAC,OAAO,EAAE,KAAK,IAAI;+EAAC;AAEnE;;;;;AAKG;IACH,UAAU,GAAG,MAAM,CAAoB,IAAI;mFAAC;IAC5C,QAAQ,GAAG,MAAM,CAAsB,EAAE;iFAAC;IAClC,cAAc,GAAiB,EAAE;AAEzC,IAAA,WAAA,GAAA;;;;QAIE,MAAM,CAAC,MAAK;YACV,MAAM,OAAO,GAAG,IAAI,CAAC,kBAAkB,CAAC,OAAO,EAAE;AACjD,YAAA,IAAI,CAAC,OAAO,EAAE,gBAAgB,EAAE;AAC9B,gBAAA,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC;AACzB,gBAAA,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;gBACrB;YACF;YACA,KAAK,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,gBAAgB,CAAC;AAC9C,QAAA,CAAC,CAAC;IACJ;IAEQ,MAAM,QAAQ,CAAC,EAAoB,EAAA;;;;;;;;;QASzC,IAAI,IAAI,CAAC,cAAc,CAAC,MAAM,KAAK,CAAC,EAAE;AACpC,YAAA,IAAI;gBAAE,IAAI,CAAC,cAAc,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,cAAc,EAAE;YAAE;AACtE,YAAA,MAAM;AAAE,gBAAA,IAAI,CAAC,cAAc,GAAG,EAAE;YAAE;QACpC;QACA,IAAI,CA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AK,EAAE,IAAI,CAAC,KAAK;QACjB,YAAY,EAAE,IAAI,CAAC,YAAY;QAC/B,QAAQ,EAAE,IAAI,CAAC,QAAQ;AACvB,QAAA,KAAK,EAAE,IAAI,CAAC,KAAK,IAAI,EAAE;QACvB,KAAK,EAAE,IAAI,CAAC,KAAK;QACjB,QAAQ,EAAE,IAAI,CAAC,QAAQ;QACvB,eAAe,EAAE,IAAI,CAAC,eAAe;KACtC;AACH;AAEA;;;;AAIG;AACH,SAAS,sBAAsB,CAC7B,QAAqC,EACrC,OAAoC,EAAA;IAEpC,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;AACrD,IAAA,OAAO,QAAQ,CAAC,GAAG,CAAC,MAAM,IAAG;QAC3B,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC;AACvC,QAAA,IAAI,CAAC,OAAO;AAAE,YAAA,OAAO,MAAM;QAC3B,OAAO;AACL,YAAA,GAAG,MAAM;YACT,KAAK,EAAE,OAAO,CAAC,KAAK;YACpB,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,OAAO,EAAE,OAAO,CAAC,OAAO;AACxB,YAAA,YAAY,EAAE,OAAO,CAAC,YAAY,IAAI,MAAM,CAAC,YAAY;AACzD,YAAA,cAAc,EAAE,IAAI;SACrB;AACH,IAAA,CAAC,CAAC;AACJ;;AChNA;;AAEG;;;;"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mintplayer/ng-spark",
3
3
  "private": false,
4
- "version": "22.0.3",
4
+ "version": "22.0.5",
5
5
  "description": "Angular component library for MintPlayer.Spark CRUD applications",
6
6
  "repository": {
7
7
  "type": "git",
@@ -153,14 +153,16 @@ interface EntityType {
153
153
  clrType: string;
154
154
  alias?: string;
155
155
  /**
156
- * Template string with {PropertyName} placeholders for building a formatted display value.
157
- * Example: "{Street}, {PostalCode} {City}"
156
+ * Breadcrumb template: literal text plus `{AttributeName}` placeholders. A scalar placeholder
157
+ * renders its value; a reference placeholder renders the referenced entity's breadcrumb.
158
+ * The server resolves this — clients only read the resulting strings. Example: "{Street}, {City}".
158
159
  */
159
- displayFormat?: string;
160
+ breadcrumb?: string;
160
161
  /**
161
- * (Fallback) Single attribute name to use as display value when displayFormat is not specified.
162
+ * When false, the breadcrumb needs the collection document (a placeholder field is not on the
163
+ * projection). null/absent means renderable from the projection. Informational on the client.
162
164
  */
163
- displayAttribute?: string;
165
+ breadcrumbProjectionSatisfiable?: boolean;
164
166
  tabs?: AttributeTab[];
165
167
  groups?: AttributeGroup[];
166
168
  attributes: EntityAttributeDefinition[];
@@ -309,6 +311,21 @@ type EntityTypeResolver = (clrTypeName: string) => EntityType | undefined;
309
311
  * back to the flat dict the form components already handle.
310
312
  */
311
313
  declare function nestedPoToDict(po: PersistentObject | null | undefined): Record<string, any>;
314
+ /**
315
+ * Reserved key under which {@link nestedPoToDisplayRow} stashes the server-resolved breadcrumb of
316
+ * each reference attribute (keyed by attribute name). Lets an AsDetail reference cell render the
317
+ * label the server already resolved by id — page-independent — instead of guessing from a single
318
+ * reference-query options page. Prefixed to avoid colliding with a real attribute name.
319
+ */
320
+ declare const AS_DETAIL_BREADCRUMBS_KEY = "__sparkBreadcrumbs";
321
+ /**
322
+ * Like {@link nestedPoToDict}, but for the read-only detail display path. In addition to each
323
+ * attribute's value it preserves the server-resolved per-reference `breadcrumb` under
324
+ * {@link AS_DETAIL_BREADCRUMBS_KEY}, so an AsDetail reference cell can render the label by id
325
+ * regardless of whether the referenced document fits on the reference query's first options page.
326
+ * The form/edit path keeps using {@link nestedPoToDict}, which never carries breadcrumbs.
327
+ */
328
+ declare function nestedPoToDisplayRow(po: PersistentObject | null | undefined): Record<string, any>;
312
329
  /**
313
330
  * Builds a nested `PersistentObject` from a flat dict against the schema in
314
331
  * <paramref name="entityType"/>. Used when the form is about to save — AsDetail attributes
@@ -321,5 +338,5 @@ declare function nestedPoToDict(po: PersistentObject | null | undefined): Record
321
338
  */
322
339
  declare function dictToNestedPo(dict: Record<string, any> | null | undefined, entityType: EntityType, resolve: EntityTypeResolver): PersistentObject;
323
340
 
324
- export { ELookupDisplayType, ShowedOn, currentLanguage, dictToNestedPo, hasShowedOnFlag, nestedPoToDict, resolveTranslation };
341
+ export { AS_DETAIL_BREADCRUMBS_KEY, ELookupDisplayType, ShowedOn, currentLanguage, dictToNestedPo, hasShowedOnFlag, nestedPoToDict, nestedPoToDisplayRow, resolveTranslation };
325
342
  export type { AttributeGroup, AttributeTab, CustomActionDefinition, EntityAttributeDefinition, EntityPermissions, EntityType, EntityTypeResolver, LookupReference, LookupReferenceListItem, LookupReferenceValue, PersistentObject, PersistentObjectAttribute, ProgramUnit, ProgramUnitGroup, ProgramUnitsConfiguration, QueryResult, RetryActionPayload, RetryActionResult, SparkQuery, SparkQueryRenderMode, SparkQuerySortColumn, StreamingErrorMessage, StreamingMessage, StreamingPatchItem, StreamingPatchMessage, StreamingSnapshotMessage, TranslatedString, ValidationError, ValidationErrorResponse, ValidationRule };
@@ -24,7 +24,6 @@ declare class InputTypePipe implements PipeTransform {
24
24
  declare class AttributeValuePipe implements PipeTransform {
25
25
  transform(attrName: string, item: PersistentObject | null, entityType: EntityType | null, lookupRefOptions: Record<string, LookupReference>, allEntityTypes: EntityType[]): any;
26
26
  private formatAsDetailValue;
27
- private resolveDisplayFormat;
28
27
  static ɵfac: i0.ɵɵFactoryDeclaration<AttributeValuePipe, never>;
29
28
  static ɵpipe: i0.ɵɵPipeDeclaration<AttributeValuePipe, "attributeValue", true>;
30
29
  }
@@ -98,7 +97,6 @@ declare class AsDetailCellValuePipe implements PipeTransform {
98
97
  declare class AsDetailDisplayValuePipe implements PipeTransform {
99
98
  private readonly lang;
100
99
  transform(attr: EntityAttributeDefinition, formData: Record<string, any>, asDetailTypes: Record<string, EntityType>): string;
101
- private resolveDisplayFormat;
102
100
  static ɵfac: i0.ɵɵFactoryDeclaration<AsDetailDisplayValuePipe, never>;
103
101
  static ɵpipe: i0.ɵɵPipeDeclaration<AsDetailDisplayValuePipe, "asDetailDisplayValue", true>;
104
102
  }