@mintplayer/ng-spark 22.6.0 → 22.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/mintplayer-ng-spark-grid.mjs +133 -52
- package/fesm2022/mintplayer-ng-spark-grid.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-spark-models.mjs +77 -7
- package/fesm2022/mintplayer-ng-spark-models.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-spark-pipes.mjs +85 -4
- package/fesm2022/mintplayer-ng-spark-pipes.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-spark-po-detail.mjs +3 -3
- package/fesm2022/mintplayer-ng-spark-po-detail.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-spark-po-form.mjs +12 -14
- package/fesm2022/mintplayer-ng-spark-po-form.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-spark-query-list.mjs +21 -7
- package/fesm2022/mintplayer-ng-spark-query-list.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-spark-renderers.mjs +14 -1
- package/fesm2022/mintplayer-ng-spark-renderers.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-spark-services.mjs +92 -5
- package/fesm2022/mintplayer-ng-spark-services.mjs.map +1 -1
- package/fesm2022/mintplayer-ng-spark-shell.mjs +41 -4
- package/fesm2022/mintplayer-ng-spark-shell.mjs.map +1 -1
- package/package.json +1 -1
- package/types/mintplayer-ng-spark-grid.d.ts +75 -33
- package/types/mintplayer-ng-spark-models.d.ts +132 -7
- package/types/mintplayer-ng-spark-pipes.d.ts +33 -5
- package/types/mintplayer-ng-spark-po-detail.d.ts +2 -2
- package/types/mintplayer-ng-spark-po-form.d.ts +7 -7
- package/types/mintplayer-ng-spark-query-list.d.ts +11 -4
- package/types/mintplayer-ng-spark-renderers.d.ts +29 -11
- package/types/mintplayer-ng-spark-services.d.ts +71 -2
- package/types/mintplayer-ng-spark-shell.d.ts +32 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mintplayer-ng-spark-grid.mjs","sources":["../../grid/src/spark-grid-columns.ts","../../grid/src/spark-grid-renderers.ts","../../grid/src/spark-query-slots.ts","../../grid/src/spark-grid-cell.component.ts","../../grid/src/spark-grid-cell.component.html","../../grid/src/spark-query-grid.component.ts","../../grid/src/spark-query-grid.component.html","../../grid/src/spark-query-card.component.ts","../../grid/src/spark-query-card.component.html","../../grid/mintplayer-ng-spark-grid.ts"],"sourcesContent":["import { DatatableSettings } from '@mintplayer/ng-bootstrap/datatable';\nimport { SortColumn } from '@mintplayer/pagination';\nimport {\n EntityAttributeDefinition,\n EntityType,\n ShowedOn,\n SparkQuery,\n hasShowedOnFlag,\n} from '@mintplayer/ng-spark/models';\n\n/** Page sizes offered by every Spark grid. */\nexport const SPARK_GRID_PAGE_SIZES = [10, 25, 50];\n\n/**\n * The attributes a grid shows, in display order.\n *\n * Shared so the two grids cannot disagree about what \"visible\" means — they each had their own\n * copy of this expression, which is the kind of thing that stays identical right up until it\n * doesn't.\n */\nexport function visibleGridAttributes(entityType: EntityType | null): EntityAttributeDefinition[] {\n return entityType?.attributes\n .filter(a => a.isVisible && hasShowedOnFlag(a.showedOn, ShowedOn.Query))\n .sort((a, b) => a.order - b.order) ?? [];\n}\n\n/**\n * Initial datatable settings for a query, seeded with the query's declared sort.\n *\n * The datatable owns paging and sorting from here on and calls the fetch callback per page; this\n * only decides where it starts.\n */\nexport function initialGridSettings(query: SparkQuery | null): DatatableSettings {\n // Nullable because one caller resolves its query from a route param and may not have one yet;\n // an unsorted grid is the right fallback, not a crash.\n const sortColumns: SortColumn[] = (query?.sortColumns || []).map(sc => ({\n property: sc.property,\n direction: sc.direction === 'desc' ? 'descending' as const : 'ascending' as const,\n }));\n\n return new DatatableSettings({\n perPage: { values: SPARK_GRID_PAGE_SIZES, selected: SPARK_GRID_PAGE_SIZES[0] },\n page: { values: [1], selected: 1 },\n sortColumns,\n });\n}\n\n/** Whether a query renders as a virtual-scrolling grid rather than a paged one. */\nexport function isVirtualScrollingQuery(query: SparkQuery | null): boolean {\n return query?.renderMode === 'VirtualScrolling';\n}\n","import { inject, Injectable, Type } from '@angular/core';\nimport {\n EntityAttributeDefinition,\n LookupReference,\n PersistentObject,\n} from '@mintplayer/ng-spark/models';\nimport { SPARK_ATTRIBUTE_RENDERERS, rendererValue, withDeclaredInputs } from '@mintplayer/ng-spark/renderers';\nimport { SparkService } from '@mintplayer/ng-spark/services';\n\n/**\n * Renderer lookup and lookup-reference loading for a Spark grid.\n *\n * This was extracted when `spark-query-list` and `spark-sub-query` were two components holding\n * byte-identical copies of it — around 120 lines between them. That duplication was not a\n * tidiness complaint: it produced drift. The two copies disagreed about `[indeterminate]`, about\n * resetting permission state, about whether a fetch failure surfaces or is swallowed, and about\n * virtual-scroll sizing — four user-visible bugs, each fixed on one side and not the other.\n *\n * There is now one grid, {@link SparkQueryGridComponent}, so the drift cannot recur. This stays\n * separate because it is stateless service-shaped logic rather than view state, and because it is\n * what a custom grid would need in order to render Spark cells at all.\n *\n * The constraint that shaped the split still holds and is why the grid takes rows as an input\n * rather than owning a socket: streaming's dependency graph must not reach the bundle of every\n * detail page.\n */\n@Injectable({ providedIn: 'root' })\nexport class SparkGridRenderers {\n private readonly registry = inject(SPARK_ATTRIBUTE_RENDERERS);\n private readonly sparkService = inject(SparkService);\n\n /** The registered column component for an attribute, or null to fall back to the default cell. */\n columnComponentFor(attr: EntityAttributeDefinition): Type<any> | null {\n if (!attr.renderer) return null;\n return this.registry.find(r => r.name === attr.renderer)?.columnComponent ?? null;\n }\n\n /**\n * Inputs for a column renderer, filtered to what the component actually declares —\n * `NgComponentOutlet` throws on an input the target does not have, which is what lets every\n * member of the renderer contract be optional.\n */\n columnInputsFor(component: Type<any>, item: PersistentObject, attr: EntityAttributeDefinition): Record<string, any> {\n const itemAttr = item.attributes.find(a => a.name === attr.name);\n return this.cellInputsFor(component, rendererValue(itemAttr), attr, item);\n }\n\n /**\n * The same contract for a row that is not a <see cref=\"PersistentObject\"/>.\n *\n * An AsDetail row is a plain dictionary — embedded values with no id and no attribute list — so\n * its value cannot be read the way {@link columnInputsFor} reads one. Only the extraction\n * differs; the renderer contract is identical, and stating it once is what stops the two from\n * drifting the way the cell markup already had.\n */\n cellInputsFor(component: Type<any>, value: unknown, column: EntityAttributeDefinition, item: unknown): Record<string, any> {\n return withDeclaredInputs(component, {\n value,\n attribute: column,\n options: column.rendererOptions,\n item,\n });\n }\n\n /**\n * Loads every lookup reference the visible attributes need, in one pass.\n *\n * Returns an empty map rather than throwing when there are none, so callers never branch on it.\n */\n async loadLookupOptions(attributes: EntityAttributeDefinition[]): Promise<Record<string, LookupReference>> {\n const lookupAttrs = attributes.filter(a => a.lookupReferenceType);\n if (lookupAttrs.length === 0) return {};\n\n const names = [...new Set(lookupAttrs.map(a => a.lookupReferenceType!))];\n const entries = await Promise.all(\n names.map(async name => [name, await this.sparkService.getLookupReference(name)] as const),\n );\n return entries.reduce((acc, [k, v]) => ({ ...acc, [k]: v }), {} as Record<string, LookupReference>);\n }\n}\n","import { Directive, inject, input, TemplateRef } from '@angular/core';\nimport { CustomActionDefinition, PersistentObject, SparkQuery } from '@mintplayer/ng-spark/models';\n\n/**\n * Header slots for `<spark-query-card>`.\n *\n * Each directive marks a template that REPLACES one region of the card header. Supplying one\n * leaves the other two alone — that is the whole point of having three rather than the single\n * whole-header template they replace, where changing the icon meant re-implementing the caption\n * and the action bar as well.\n *\n * An omitted slot is not an empty slot: the card renders its default. This is what keeps the\n * auto-rendered sub-query working. A sub-query is rendered from `EntityTypeDefinition.Queries`\n * with no host to project into, so a mechanism that only ever REPLACED chrome would leave that\n * call site with nothing — which is why an earlier design had the query declare its own chrome\n * server-side. Overriding a default needs no host; replacing one does.\n *\n * The two ends of that are visible in the defaults themselves. Neither `SparkQuery` nor\n * `EntityType` carries an icon, so the server has nothing to say and the slot is the only\n * source. Actions are the mirror image: the server declares them per type, so the default is\n * the real answer and the slot is a rare override.\n *\n * Naming follows ng-bootstrap's `*bsDatatableColumn` convention — prefix, component, slot —\n * with `spark`, since these are ng-spark directives and `bs` is another package's prefix. These\n * are the first attribute directives in ng-spark; every existing selector is an element.\n *\n * ## Targeting one query\n *\n * Each slot takes an optional query alias or id as its value. A detail page renders one card per\n * entry in `EntityTypeDefinition.Queries`, so a host that supplies a bare slot would decorate\n * every one of them identically — rarely what is wanted. A targeted slot applies to that query;\n * an untargeted one is the fallback for the rest.\n *\n * ```html\n * <span *sparkQueryIcon=\"'cars'\"><spark-icon name=\"car-front\" /></span>\n * <span *sparkQueryIcon><spark-icon name=\"table\" /></span>\n * ```\n *\n * Matching is case-insensitive, against the query's alias and then its id. This is the\n * `bsPriorityNavItem` shape: a value input aliased to the selector, collected with\n * `contentChildren`.\n */\n\n/** Resolves a slot list to the one that applies to a query: targeted first, then untargeted. */\nexport function slotFor<T extends { forQuery: () => string }>(\n slots: readonly T[],\n query: SparkQuery | null,\n): T | null {\n if (!slots.length) return null;\n\n const matches = (target: string) =>\n !!target && (\n target.localeCompare(query?.alias ?? '', undefined, { sensitivity: 'accent' }) === 0 ||\n target.localeCompare(query?.id ?? '', undefined, { sensitivity: 'accent' }) === 0);\n\n // A targeted slot wins over the catch-all even when it is declared later: \"this one query\"\n // is the more specific statement, and declaration order in a template is not a priority.\n return slots.find(s => matches(s.forQuery())) ?? slots.find(s => !s.forQuery()) ?? null;\n}\n\n/**\n * The icon at the header's leading edge. No default: nothing in the model describes one.\n *\n * ```html\n * <spark-query-card [queryId]=\"'cars'\">\n * <spark-icon *sparkQueryIcon name=\"car-front\" />\n * </spark-query-card>\n * ```\n */\n@Directive({ selector: '[sparkQueryIcon]' })\nexport class SparkQueryIconDirective {\n readonly templateRef = inject<TemplateRef<SparkQuerySlotContext>>(TemplateRef);\n\n /** Query alias or id this slot applies to. Empty targets every query on the page. */\n readonly forQuery = input('', { alias: 'sparkQueryIcon' });\n\n static ngTemplateContextGuard(\n _dir: SparkQueryIconDirective,\n ctx: unknown,\n ): ctx is SparkQuerySlotContext {\n return true;\n }\n}\n\n/**\n * The header caption. Defaults to the query's translated description, falling back to its name.\n *\n * The context carries that resolved default as `$implicit`, so a host can decorate it — add a\n * count, a badge — without re-resolving the translation itself.\n */\n@Directive({ selector: '[sparkQueryCaption]' })\nexport class SparkQueryCaptionDirective {\n readonly templateRef = inject<TemplateRef<SparkQueryCaptionContext>>(TemplateRef);\n\n readonly forQuery = input('', { alias: 'sparkQueryCaption' });\n\n static ngTemplateContextGuard(\n _dir: SparkQueryCaptionDirective,\n ctx: unknown,\n ): ctx is SparkQueryCaptionContext {\n return true;\n }\n}\n\n/**\n * The buttons at the header's trailing edge. Defaults to the server-declared custom actions.\n *\n * The context carries those actions and the current selection, so a host that wants its own\n * buttons ALONGSIDE the server's can render both rather than choosing. Without that, overriding\n * this slot to add one button would silently drop every action the type declares — and the\n * server's actions are the ones carrying `selectionRule` and the permission filter.\n *\n * ```html\n * <ng-container *sparkQueryActions=\"let actions; selection as rows\">\n * <button (click)=\"export(rows)\">Export</button>\n * </ng-container>\n * ```\n */\n@Directive({ selector: '[sparkQueryActions]' })\nexport class SparkQueryActionsDirective {\n readonly templateRef = inject<TemplateRef<SparkQueryActionsContext>>(TemplateRef);\n\n readonly forQuery = input('', { alias: 'sparkQueryActions' });\n\n static ngTemplateContextGuard(\n _dir: SparkQueryActionsDirective,\n ctx: unknown,\n ): ctx is SparkQueryActionsContext {\n return true;\n }\n}\n\n/** Context for the icon slot: the query whose card is being rendered. */\nexport class SparkQuerySlotContext {\n $implicit: SparkQuery | null = null;\n}\n\nexport class SparkQueryCaptionContext {\n /** The caption the card would have rendered: description, or the query name. */\n $implicit = '';\n query: SparkQuery | null = null;\n}\n\nexport class SparkQueryActionsContext {\n /** The custom actions the card would have rendered, already filtered for this query. */\n $implicit: CustomActionDefinition[] = [];\n /** Rows currently ticked. Empty unless an action is selection-gated. */\n selection: PersistentObject[] = [];\n query: SparkQuery | null = null;\n}\n","import { ChangeDetectionStrategy, Component, computed, inject, input } from '@angular/core';\nimport { CommonModule, NgComponentOutlet } from '@angular/common';\nimport { RouterModule } from '@angular/router';\nimport { EntityAttributeDefinition } from '@mintplayer/ng-spark/models';\nimport { ReferenceChip } from '@mintplayer/ng-spark/pipes';\nimport { SparkGridRenderers } from './spark-grid-renderers';\n\n/**\n * One cell of a Spark table, wherever that table is.\n *\n * ## Why this exists\n *\n * The cell markup was written out three times: twice in the query grids (since merged into\n * {@link SparkQueryGridComponent}) and once more in the AsDetail table on the PO detail page. The\n * third copy was never counted, and it had already drifted — a `boolean` column rendered the text\n * `\"true\"` there while the grid rendered a checkbox, a `color` rendered its hex string rather than\n * a swatch, and a custom renderer was dispatched by a second, hand-copied lookup.\n *\n * ## What it does and does not own\n *\n * It owns **presentation**: which control a `dataType` becomes, and dispatching a declared custom\n * renderer. It does not own **value resolution**, and deliberately so — the two callers read from\n * genuinely different row models. A query row is a `PersistentObject` with an attribute list and\n * an id; an AsDetail row is a plain dictionary of embedded values with neither. Trying to unify\n * that would put a second row-access path inside this component and buy nothing.\n *\n * So the caller resolves the value with whichever pipe fits its row model, and passes the result.\n *\n * ## The two links are not the same link, and only one is here\n *\n * `link` is for a cell whose own value points at another entity — an AsDetail reference column.\n * The query grid's first-column link is a different rule (it points at the row's own detail page,\n * gated on `Read`), and it stays in the grid, wrapping this component. Passing both would nest\n * anchors, which is invalid HTML; the grid therefore leaves `link` unset.\n */\n@Component({\n selector: 'spark-grid-cell',\n imports: [CommonModule, NgComponentOutlet, RouterModule],\n templateUrl: './spark-grid-cell.component.html',\n styleUrl: './spark-grid-cell.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SparkGridCellComponent {\n private readonly renderers = inject(SparkGridRenderers);\n\n /** The column being rendered. Its `dataType` and `renderer` decide everything below. */\n column = input.required<EntityAttributeDefinition>();\n\n /**\n * What the caller's value pipe produced: the display text for most columns, and the raw value\n * for `boolean` and `color`, which need the value rather than a rendering of it.\n */\n display = input<unknown>(null);\n\n /**\n * The value handed to a declared custom renderer.\n *\n * Separate from {@link display} because they are not the same thing: a renderer receives the\n * underlying value — for AsDetail, the nested object itself — while `display` has already been\n * flattened to something printable.\n */\n rendererValue = input<unknown>(null);\n\n /** The row, passed through to a custom renderer as `item`. */\n item = input<unknown>(null);\n\n /**\n * Pre-resolved chips for a reference-array column, or empty when the column is not one.\n *\n * Resolved by the caller because the label source differs: a query row carries a per-id\n * breadcrumb map, while an AsDetail row's `__sparkBreadcrumbs` is keyed by column name only and\n * so cannot label the members of an array. Rather than render a row of raw ids, an AsDetail\n * caller passes nothing and the cell falls through to text.\n */\n chips = input<ReferenceChip[]>([]);\n\n /** Route for a cell whose value references another entity. See the class comment. */\n link = input<unknown[] | null>(null);\n\n protected readonly rendererComponent = computed(() => this.renderers.columnComponentFor(this.column()));\n\n protected readonly rendererInputs = computed(() => {\n const component = this.rendererComponent();\n return component\n ? this.renderers.cellInputsFor(component, this.rendererValue(), this.column(), this.item())\n : {};\n });\n\n /** Null and undefined are distinct from `false` here — see the template. */\n protected readonly isUnsetBoolean = computed(() => this.display() == null);\n}\n","@if (rendererComponent(); as rendererType) {\n <ng-container *ngComponentOutlet=\"rendererType; inputs: rendererInputs()\"></ng-container>\n} @else if (column().dataType === 'boolean') {\n <!-- [indeterminate] matters: without it a null boolean renders as an unchecked box, which reads\n as an explicit `false`. One of the three copies of this cell bound it and the others had\n drifted, so the same column said different things on a detail page and in a grid. -->\n <input type=\"checkbox\"\n [checked]=\"display() === true\"\n [indeterminate]=\"isUnsetBoolean()\"\n disabled\n onclick=\"return false;\">\n} @else if (column().dataType === 'color') {\n @if (display(); as colorVal) {\n <!-- Inline on purpose, and it is not a style-guide slip. In a query grid this cell is\n rendered INSIDE <mp-datatable>'s shadow root, which does not see document\n stylesheets: neither this component's scoped rules nor Bootstrap utilities apply\n there. Inline styles do. Measured 2026-08-23 -- see the comment in the .scss. -->\n <span class=\"d-inline-block align-middle border rounded\"\n [style.background-color]=\"colorVal\"\n style=\"width: 1.5em; height: 1.5em;\"></span>\n }\n} @else if (chips().length) {\n <span class=\"d-inline-flex flex-wrap gap-1\">\n @for (chip of chips(); track chip.id) {\n <span class=\"spark-chip\">{{ chip.label }}</span>\n }\n </span>\n} @else if (link(); as route) {\n <a [routerLink]=\"route\">{{ display() }}</a>\n} @else {\n {{ display() }}\n}\n","import { ChangeDetectionStrategy, Component, computed, effect, inject, input, model, output, signal, untracked, Type } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { HttpErrorResponse } from '@angular/common/http';\nimport { RouterModule } from '@angular/router';\nimport { Color } from '@mintplayer/ng-bootstrap';\nimport { BsAlertComponent } from '@mintplayer/ng-bootstrap/alert';\nimport { BsDatatableComponent, BsDatatableColumnDirective, BsRowTemplateDirective, DatatableSettings, type BsDatatableFetch } from '@mintplayer/ng-bootstrap/datatable';\nimport { BsSpinnerComponent } from '@mintplayer/ng-bootstrap/spinner';\nimport { SparkQueryRefreshService } from '@mintplayer/ng-spark/client-operations';\nimport { rendererValue } from '@mintplayer/ng-spark/renderers';\nimport { AttributeValuePipe, ReferenceChipsPipe, ResolveTranslationPipe, TranslateKeyPipe } from '@mintplayer/ng-spark/pipes';\nimport { SparkLanguageService, SparkService } from '@mintplayer/ng-spark/services';\nimport {\n CustomActionDefinition,\n EntityAttributeDefinition,\n EntityType,\n LookupReference,\n PersistentObject,\n SparkQuery,\n filterQueryActions,\n parseSelectionRule,\n selectionModeFor,\n} from '@mintplayer/ng-spark/models';\nimport { SPARK_GRID_PAGE_SIZES, initialGridSettings, isVirtualScrollingQuery, visibleGridAttributes } from './spark-grid-columns';\nimport { SparkGridRenderers } from './spark-grid-renderers';\nimport { SparkGridCellComponent } from './spark-grid-cell.component';\n\n/**\n * The one Spark grid: a `<bs-datatable>` rendering a query or a sub-query.\n *\n * This replaces two components that were the same grid written twice — and, counting\n * `spark-query-list`'s streaming and paged branches, the `<bs-datatable>` element itself written\n * three times. The duplication had already produced four user-visible bugs, each fixed on one\n * side and not the other: `[indeterminate]` on null booleans, permission state surviving a failed\n * reload, a swallowed fetch failure, and virtual-scroll sizing. `SparkGridRenderers` was\n * extracted to stop that and could only take the stateless helpers with it; this takes the rest.\n *\n * ## What it deliberately does NOT own: streaming\n *\n * `spark-grid-renderers.ts` records why — a websocket dependency graph must not reach the bundle\n * of every PO detail page, none of which stream. So rows can come from **either** side:\n *\n * - unbound `data` — the grid fetches for itself, paging and sorting server-side;\n * - bound `data` — the grid renders what it is given and never fetches.\n *\n * `spark-query-list` keeps the socket and feeds its snapshot in. This is the line `bs-datatable`\n * itself draws: `[data]` and `[fetch]` are mutually exclusive, and binding both makes `[fetch]`\n * win silently.\n *\n * ## Reading its state\n *\n * `query`, `entityType`, `customActions`, `selection`, `canRead`, `canCreate` and `resultCount`\n * are readable so a host can render chrome around the grid. Read them through a template\n * reference variable — `<spark-query-grid #grid>` … `grid.query()` — not `viewChild`: hosts wrap\n * grids in `@if`, where a `viewChild` is intermittently undefined.\n */\n@Component({\n selector: 'spark-query-grid',\n imports: [CommonModule, RouterModule, BsAlertComponent, BsDatatableComponent, BsDatatableColumnDirective, BsRowTemplateDirective, BsSpinnerComponent, SparkGridCellComponent, ResolveTranslationPipe, AttributeValuePipe, ReferenceChipsPipe, TranslateKeyPipe],\n templateUrl: './spark-query-grid.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SparkQueryGridComponent {\n private readonly sparkService = inject(SparkService);\n private readonly gridRenderers = inject(SparkGridRenderers);\n private readonly queryRefresh = inject(SparkQueryRefreshService);\n readonly lang = inject(SparkLanguageService);\n\n /** Query alias or id. */\n queryId = input.required<string>();\n\n /**\n * The parent persistent object this query is scoped to, when it has one.\n *\n * Optional, because not every query is a detail of something: a page can host a grid that\n * stands on its own — \"my accounts\", a dashboard list — and the server already treats an absent\n * parent as \"no parent\" rather than as an error. Requiring these made that shape impossible to\n * express: the component simply never loaded, with no request, no error and no log.\n *\n * Pass both or neither. One without the other is ignored, matching `SparkService.executeQuery`,\n * which omits either param when it is falsy, and the execute endpoint, which resolves a parent\n * only when both are present.\n */\n parentId = input<string>('');\n parentType = input<string>('');\n\n /**\n * Rows supplied from outside. When bound, the grid renders these and runs no fetch.\n *\n * This is how streaming stays out of this component (see the class comment). `null` — the\n * default — means \"fetch for yourself\"; an empty array means \"you have been given no rows\",\n * which is a different statement and renders an empty grid rather than triggering a load.\n */\n data = input<PersistentObject[] | null>(null);\n\n /**\n * Server-side search term, passed through to the query.\n *\n * An input rather than a box, so the host owns the control and the grid owns the request. A\n * host with client-side rows filters them itself before binding `data`.\n */\n search = input<string>('');\n\n /**\n * Change this to re-run the query. Any value works; only its identity matters.\n *\n * A declarative token rather than only a `reload()` method, because calling a method means\n * holding a component handle, and hosts wrap this grid in `@if`, where a `viewChild` is\n * intermittently undefined.\n *\n * This drives the CHEAP refresh (see {@link reload}). It deliberately does not feed the main\n * effect: re-running `loadData` would re-resolve the query, the entity types, the permissions\n * and the lookups, and reset the user's page and sort on every button press.\n */\n reloadToken = input<unknown>(null);\n\n /**\n * Paging and sorting. Two-way, so a host driving `data` can sort those rows by whatever the\n * user actually clicked — the datatable writes the new sort back through here.\n */\n settings = model(new DatatableSettings({\n perPage: { values: SPARK_GRID_PAGE_SIZES, selected: SPARK_GRID_PAGE_SIZES[0] },\n page: { values: [1], selected: 1 },\n sortColumns: [],\n }));\n\n /** Rows the user has ticked. Two-way so chrome outside the grid can read and clear them. */\n selection = model<PersistentObject[]>([]);\n\n /** Emitted whenever a load or a page fetch fails, for a host in bespoke chrome. */\n error = output<HttpErrorResponse>();\n rowClicked = output<PersistentObject>();\n customActionExecuted = output<{ action: CustomActionDefinition }>();\n\n colors = Color;\n\n query = signal<SparkQuery | null>(null);\n entityType = signal<EntityType | null>(null);\n allEntityTypes = signal<EntityType[]>([]);\n lookupReferenceOptions = signal<Record<string, LookupReference>>({});\n loading = signal(true);\n canRead = signal(false);\n canCreate = signal(false);\n resultCount = signal<number | null>(null);\n customActions = signal<CustomActionDefinition[]>([]);\n fetchFn = signal<BsDatatableFetch<PersistentObject> | null>(null);\n\n /**\n * Why the component renders its own failure instead of only reporting one.\n *\n * `SparkService` is a bare `firstValueFrom` passthrough with no interceptor, so every failure\n * surfaces here and nowhere else. A host embedding this grid cannot surface what it never sees,\n * and the default has to be visible with no host cooperation — hence a rendered alert, not just\n * an output.\n */\n errorMessage = signal<string | null>(null);\n\n /** 'none' unless an action is selection-gated, so unaffected grids gain no checkbox column. */\n selectionMode = computed(() => selectionModeFor(this.customActions()));\n\n isVirtualScrolling = computed(() => isVirtualScrollingQuery(this.query()));\n\n visibleAttributes = computed(() => visibleGridAttributes(this.entityType()));\n\n /**\n * True when rows do not come from this component's own fetch.\n *\n * Either because the host bound `data`, or because the query streams — a streaming query's rows\n * arrive over a socket and `/execute` is not a way to get them. The grid recognises the second\n * case itself rather than waiting to be told, because it resolves the query before the host can\n * see it: left to `data` alone, every streaming grid would fire one pointless fetch on mount,\n * before the host had anything to bind.\n */\n hasExternalData = computed(() =>\n this.data() !== null || this.query()?.isStreamingQuery === true);\n\n /** Whether an action's selection rule is satisfied right now. The server checks it again. */\n isActionEnabled(action: CustomActionDefinition): boolean {\n return parseSelectionRule(action.selectionRule)(this.selection().length);\n }\n\n constructor() {\n effect(() => {\n const qId = this.queryId();\n const pId = this.parentId();\n const pType = this.parentType();\n // Only the query id is required. Requiring a parent here is what made a standalone grid\n // silently render nothing.\n if (qId) {\n this.loadData(qId, pId, pType);\n } else {\n // No query id at all. `loading` starts true, so without this the component would spin\n // forever instead of saying anything.\n this.loading.set(false);\n }\n });\n\n // Separate effect, so the token drives the cheap refresh and never the full metadata reload.\n // `first` skips the initial run: the effect above has already fetched, and reacting to the\n // token's starting value would double-fetch on mount.\n let first = true;\n effect(() => {\n // Both the host's token and the server's refreshQuery drive the same cheap refresh.\n this.reloadToken();\n this.queryRefresh.tokenFor(this.queryId());\n if (first) { first = false; return; }\n untracked(() => this.reload());\n });\n\n // A new search term must refetch even when page, perPage and sort are unchanged — the\n // datatable dedupes reloads by exactly that triple, and a new fetch identity is what resets\n // its dedupe key. Skipping the first run keeps mount to a single request.\n let firstSearch = true;\n effect(() => {\n this.search();\n if (firstSearch) { firstSearch = false; return; }\n untracked(() => this.onSearchChanged());\n });\n }\n\n /**\n * Re-run the query, keeping the current page, sort and scroll position.\n *\n * Data-level on purpose: it re-seeds the fetch closure and nothing else. For a definition\n * change — new columns, a renamed query — the inputs themselves must change; that is the\n * expensive path. Inert when rows come from the host: there is nothing here to re-run.\n */\n reload(): void {\n if (this.hasExternalData()) return;\n const q = this.query();\n if (q) this.fetchFn.set(this.makeFetch(q, this.parentId(), this.parentType()));\n }\n\n private onSearchChanged(): void {\n if (this.hasExternalData()) return;\n const s = this.settings();\n // Back to page 1: the old page number means nothing against a different result set.\n this.settings.set(new DatatableSettings({\n perPage: { values: s.perPage.values, selected: s.perPage.selected },\n page: { values: [1], selected: 1 },\n sortColumns: s.sortColumns,\n }));\n this.reload();\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.entityType()!.id, action.name, undefined, this.selection());\n this.customActionExecuted.emit({ action });\n if (action.refreshOnCompleted) this.reload();\n } catch (e) {\n const err = e as HttpErrorResponse;\n this.errorMessage.set(err.error?.error || err.message || this.lang.t('common.actionFailed') || 'Action failed');\n }\n }\n\n private reportError(err: HttpErrorResponse): void {\n this.errorMessage.set(this.describe(err));\n this.error.emit(err);\n }\n\n /**\n * A 404 is deliberately generic.\n *\n * `Endpoints/Queries/Get.cs` answers 404 with byte-identical bodies for \"no such query\" and\n * \"you may not see it\", so existence is not disclosed (security audit M-3). The component\n * therefore genuinely cannot tell them apart, and both \"Not found\" and \"Access denied\" would be\n * a guess — one of them leaking, the other misleading.\n */\n private describe(err: HttpErrorResponse): string {\n if (err?.status === 404) {\n return this.lang.t('spark.query.unavailable') || 'This list is not available.';\n }\n return err?.error?.error || err?.message\n || this.lang.t('common.unexpectedError') || 'An unexpected error occurred';\n }\n\n private async loadData(queryId: string, parentId: string, parentType: string): Promise<void> {\n this.loading.set(true);\n this.errorMessage.set(null);\n this.fetchFn.set(null);\n // Reset everything derived from the previous query, not just the fetch. Leaving\n // `entityType`/`canRead` behind let a failed reload build a row link out of the PREVIOUS type\n // and the previous permission.\n this.query.set(null);\n this.entityType.set(null);\n this.canRead.set(false);\n this.canCreate.set(false);\n this.customActions.set([]);\n this.resultCount.set(null);\n // Ids from the previous query are meaningless against the next one, and would be POSTed as\n // though they belonged to it.\n this.selection.set([]);\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 et = this.resolveEntityType(resolvedQuery, entityTypes);\n this.entityType.set(et);\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.canRead.set(permissions.canRead);\n this.canCreate.set(permissions.canCreate);\n // 'query', not 'list'. The server model has always documented \"detail\" | \"query\" |\n // \"both\"; a filter testing for a value nothing emits renders the action NOWHERE.\n this.customActions.set(filterQueryActions(actions));\n }\n\n this.settings.set(initialGridSettings(resolvedQuery));\n // The datatable drives paging/sorting via [(settings)] and calls fetchFn per page. Virtual\n // scrolling is just the [virtualScroll] template flag.\n // `resolvedQuery`, not `hasExternalData()`: the query signal is set above, but reading the\n // computed here would depend on signal-read ordering inside an async method. Ask the value\n // directly.\n if (this.data() === null && !resolvedQuery?.isStreamingQuery) {\n this.fetchFn.set(this.makeFetch(resolvedQuery, parentId, parentType));\n }\n\n this.loadLookupReferenceOptions();\n } catch (e) {\n this.fetchFn.set(null);\n this.reportError(e as HttpErrorResponse);\n } finally {\n this.loading.set(false);\n }\n }\n\n /**\n * The query's entity type.\n *\n * The source-name fallback is not optional garnish: a `Database.*` query need not declare\n * `entityType`, and the sub-query grid — which matched on the declared name alone — rendered\n * those as an empty card with no columns, no rows and no error, while the identical query\n * rendered correctly as a page. Both grids are this one now, so there is one answer.\n */\n private resolveEntityType(query: SparkQuery | null, entityTypes: EntityType[]): EntityType | null {\n if (!query) return null;\n\n if (query.entityType) {\n return entityTypes.find(t =>\n t.name === query.entityType || t.alias === query.entityType?.toLowerCase()) ?? null;\n }\n\n const sourceName = extractSourceName(query.source);\n const singular = singularize(sourceName);\n return entityTypes.find(t =>\n t.name === sourceName || t.name === singular || t.clrType.endsWith(singular)) ?? null;\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 search: this.search() || undefined,\n parentId, parentType,\n }).then(r => {\n this.errorMessage.set(null);\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((e: HttpErrorResponse) => {\n // Report before returning the empty page, or a failed fetch is indistinguishable from a\n // query that legitimately has no rows.\n this.reportError(e);\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 this.lookupReferenceOptions.set(await this.gridRenderers.loadLookupOptions(this.visibleAttributes()));\n }\n\n /**\n * The underlying value a custom renderer receives, which is not the printable one.\n *\n * `rendererValue` unwraps an AsDetail attribute to the nested object (or objects) rather than\n * flattening it to text — a renderer for a nested type needs the object, not a summary of it.\n */\n rendererValueFor(item: PersistentObject, attr: EntityAttributeDefinition): unknown {\n return rendererValue(item.attributes.find(a => a.name === attr.name));\n }\n\n getColumnRendererComponent(attr: EntityAttributeDefinition): Type<any> | null {\n return this.gridRenderers.columnComponentFor(attr);\n }\n\n getColumnRendererInputs(component: Type<any>, item: PersistentObject, attr: EntityAttributeDefinition): Record<string, any> {\n return this.gridRenderers.columnInputsFor(component, item, attr);\n }\n}\n\nfunction extractSourceName(source: string): string {\n const dotIndex = source.indexOf('.');\n return dotIndex >= 0 ? source.substring(dotIndex + 1) : source;\n}\n\n/**\n * Enough English to map a query source onto a type name — `Cars` to `Car`, `People` to `Person`.\n *\n * Deliberately a small table plus three suffix rules rather than a library: it runs against type\n * names the application itself chose, and a wrong guess costs nothing, since the caller falls\n * through to matching the plural and the CLR type name.\n */\nfunction singularize(plural: string): string {\n const irregulars: Record<string, string> = {\n 'People': 'Person',\n 'Children': 'Child',\n 'Men': 'Man',\n 'Women': 'Woman',\n };\n if (irregulars[plural]) return irregulars[plural];\n if (plural.endsWith('ies')) return plural.slice(0, -3) + 'y';\n if (plural.endsWith('es')) return plural.slice(0, -2);\n if (plural.endsWith('s')) return plural.slice(0, -1);\n return plural;\n}\n","<!--\n Three explicit states, in this order, and the order is load-bearing.\n\n This template used to open with `@if (query(); as q)` wrapping EVERYTHING, and `query()` is only\n set after loadData's awaits resolve. Three separate bugs fell out of that one line: the spinner\n was unreachable on a first load (it rendered inside the gate, while `loading` starts true and\n `query` starts null), a first-load failure rendered ZERO DOM — no card, no message, nothing to\n see or report — and a failed RELOAD left the previous query's rows on screen.\n\n So: `loading` is checked first and outside any dependency on `query`, and the final `@else`\n always renders something. Do not fold these back into one gate, and do not move the spinner\n inside the `query()` branch.\n-->\n@if (loading()) {\n <div class=\"text-center p-3\">\n <bs-spinner />\n </div>\n} @else if (query()) {\n <!-- A page-fetch failure while the grid is already resolved. Without this the catch returns an\n empty page and a failed query is indistinguishable from one that legitimately has no rows. -->\n @if (errorMessage(); as err) {\n <bs-alert [type]=\"colors.danger\" class=\"mb-3\">\n {{ err }}\n </bs-alert>\n }\n\n <!--\n One datatable, two row sources. `[data]` and `[fetch]` are mutually exclusive in\n ng-bootstrap — binding both makes `[fetch]` win silently — so exactly one is ever non-null\n here: `fetchFn` is left null whenever `data` is bound. See the class comment for why rows can\n arrive from outside at all (streaming must not put a websocket in every detail page's bundle).\n -->\n <bs-datatable\n [selectionMode]=\"selectionMode()\"\n [(selection)]=\"selection\"\n [virtualScroll]=\"isVirtualScrolling()\"\n [itemSize]=\"40\"\n [isResponsive]=\"isVirtualScrolling()\"\n [data]=\"data()\"\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 <!-- The first column links to the row's detail page. Two things about this are\n routinely misread:\n\n 1. `cellContent` is projected INSIDE the anchor, so a custom `renderer` does NOT\n suppress this link — a renderer that emits its own <a> produces nested anchors\n (invalid HTML) rather than replacing this one.\n 2. `canRead()` is the whole gate, and it is the rights model: `Query` without\n `Read` lists the rows and withholds the link. Withhold `Read` for a query\n whose rows no detail page can load — a Custom.* query that fabricates rows in\n memory, say. -->\n @if (first && canRead()) {\n <a [routerLink]=\"['/po', entityType()!.alias || entityType()!.id, row.id]\"\n (click)=\"rowClicked.emit(row)\">\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 \n }\n </td>\n }\n </ng-container>\n </bs-datatable>\n} @else {\n <!-- The query could not be resolved. Rendering something keeps the host's layout intact and,\n crucially, makes the failure visible: this branch used to render nothing at all. -->\n <bs-alert [type]=\"colors.danger\" class=\"mb-0\">\n {{ errorMessage() || ('spark.query.unavailable' | t) }}\n </bs-alert>\n}\n\n<ng-template #cellContent let-item let-attr=\"attr\">\n <!--\n Presentation lives in <spark-grid-cell>, shared with the AsDetail table on the PO detail page.\n Value resolution stays here: a query row is a PersistentObject with an attribute list, and the\n AsDetail table's rows are plain dictionaries, so only the rendering is common.\n\n `link` is deliberately not passed. The first-column link is the grid's own rule and wraps this\n template from outside; setting both would nest anchors.\n -->\n <spark-grid-cell\n [column]=\"attr\"\n [display]=\"(attr.name | attributeValue:item:entityType():lookupReferenceOptions():allEntityTypes())\"\n [rendererValue]=\"rendererValueFor(item, attr)\"\n [item]=\"item\"\n [chips]=\"(attr.name | referenceChips:item)\" />\n</ng-template>\n","import { ChangeDetectionStrategy, Component, computed, contentChildren, input, output, viewChild, TemplateRef } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { HttpErrorResponse } from '@angular/common/http';\nimport { Color } from '@mintplayer/ng-bootstrap';\nimport { BsCardComponent, BsCardHeaderComponent } from '@mintplayer/ng-bootstrap/card';\nimport { BsPriorityNavComponent, BsPriorityNavItemDirective } from '@mintplayer/ng-bootstrap/priority-nav';\nimport { ResolveTranslationPipe } from '@mintplayer/ng-spark/pipes';\nimport { SparkLanguageService } from '@mintplayer/ng-spark/services';\nimport { CustomActionDefinition, PersistentObject } from '@mintplayer/ng-spark/models';\nimport { inject } from '@angular/core';\nimport { SparkQueryGridComponent } from './spark-query-grid.component';\nimport {\n SparkQueryActionsDirective,\n SparkQueryCaptionDirective,\n SparkQueryIconDirective,\n slotFor,\n} from './spark-query-slots';\n\n/**\n * A `<bs-card>` around a {@link SparkQueryGridComponent}: icon, caption, actions, grid.\n *\n * ## Chrome is overridden, not replaced\n *\n * Every header region has a default, and a host replaces only the ones it supplies. That is what\n * lets this component serve the auto-rendered case: a sub-query is rendered once per entry in\n * `EntityTypeDefinition.Queries` with nobody projecting into it, and it must look right with no\n * host cooperation at all. A slot mechanism that only ever *replaced* chrome would leave that\n * call site blank — which is why an earlier design had the query carry its own chrome from the\n * server. Overriding a default needs no host; replacing one does.\n *\n * ## Two ways in, one set of templates\n *\n * Hand-written markup uses the structural directives and is found with `contentChildren`.\n * The auto-rendered path cannot: `spark-po-detail` is created by the router, so in a default app\n * there is no tag to project into. It therefore forwards `TemplateRef`s as inputs instead — a\n * directive cannot cross a component boundary but its template can, and that forwarding is\n * already the idiom in `spark-po-detail` (`extraActionsTemplate`, `extraContentTemplate`).\n *\n * Content wins over a forwarded input: the closer declaration is the more specific one.\n */\n@Component({\n selector: 'spark-query-card',\n imports: [CommonModule, BsCardComponent, BsCardHeaderComponent, BsPriorityNavComponent, BsPriorityNavItemDirective, SparkQueryGridComponent, ResolveTranslationPipe],\n templateUrl: './spark-query-card.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SparkQueryCardComponent {\n readonly lang = inject(SparkLanguageService);\n\n queryId = input.required<string>();\n parentId = input<string>('');\n parentType = input<string>('');\n reloadToken = input<unknown>(null);\n data = input<PersistentObject[] | null>(null);\n search = input<string>('');\n\n /**\n * Slots forwarded from a host that cannot project content — see the class comment. A card\n * reached through hand-written markup should use the structural directives instead.\n */\n iconTemplate = input<TemplateRef<any> | null>(null);\n captionTemplate = input<TemplateRef<any> | null>(null);\n actionsTemplate = input<TemplateRef<any> | null>(null);\n\n error = output<HttpErrorResponse>();\n rowClicked = output<PersistentObject>();\n customActionExecuted = output<{ action: CustomActionDefinition }>();\n\n colors = Color;\n\n private readonly iconSlots = contentChildren(SparkQueryIconDirective);\n private readonly captionSlots = contentChildren(SparkQueryCaptionDirective);\n private readonly actionSlots = contentChildren(SparkQueryActionsDirective);\n\n /**\n * The grid, read only to surface its state — the query, the actions, the selection — to this\n * component's own header.\n *\n * Optional rather than `required` on purpose. The header renders ABOVE the grid in this\n * template, so on the first change-detection pass the view query has not resolved yet and\n * `viewChild.required()` would throw where a plain one returns `undefined`. Everything below\n * therefore reads it defensively; the signal updates once the view initialises and the header\n * re-renders with the real query.\n *\n * A host reads grid state through a template reference variable instead, because a host may put\n * the grid behind an `@if`, where a view query genuinely is intermittently undefined.\n */\n protected readonly grid = viewChild(SparkQueryGridComponent);\n\n protected readonly query = computed(() => this.grid()?.query() ?? null);\n\n protected readonly iconTpl = computed(() =>\n slotFor(this.iconSlots(), this.query())?.templateRef ?? this.iconTemplate());\n\n protected readonly captionTpl = computed(() =>\n slotFor(this.captionSlots(), this.query())?.templateRef ?? this.captionTemplate());\n\n protected readonly actionsTpl = computed(() =>\n slotFor(this.actionSlots(), this.query())?.templateRef ?? this.actionsTemplate());\n\n /** The caption the card renders unless a slot replaces it. */\n protected readonly caption = computed(() => {\n const q = this.query();\n return (q?.description ? this.lang.resolve(q.description) : '') || q?.name || '';\n });\n\n protected readonly customActions = computed(() => this.grid()?.customActions() ?? []);\n protected readonly selection = computed(() => this.grid()?.selection() ?? []);\n}\n","<!--\n The card is always rendered. A host that wants no card uses <spark-query-grid> directly — which\n is what the old `showCard=\"false\"` meant, expressed as a component choice rather than a flag.\n-->\n<bs-card class=\"d-block my-3\">\n <bs-card-header>\n <div class=\"d-flex align-items-center gap-2\">\n @if (iconTpl(); as tpl) {\n <ng-container *ngTemplateOutlet=\"tpl; context: { $implicit: query() }\"></ng-container>\n }\n\n <span class=\"me-auto\">\n @if (captionTpl(); as tpl) {\n <ng-container *ngTemplateOutlet=\"tpl; context: { $implicit: caption(), query: query() }\"></ng-container>\n } @else {\n {{ caption() }}\n }\n </span>\n\n @if (actionsTpl(); as tpl) {\n <ng-container *ngTemplateOutlet=\"tpl; context: { $implicit: customActions(), selection: selection(), query: query() }\"></ng-container>\n } @else if (customActions().length) {\n <!-- The default: the actions the server declares for this type. The nav renders only when\n there are any, so a query without actions is pixel-identical to a plain caption.\n\n Disabled, not hidden: hiding makes the affordance undiscoverable and reflows the\n priority nav on every selection change. The server enforces the same rule. -->\n <bs-priority-nav [moreLabel]=\"lang.t('common.more')\" [collapseAt]=\"'sm'\">\n @for (action of customActions(); track action.name) {\n <button *bsPriorityNavItem=\"10 + action.offset\" class=\"btn btn-sm btn-outline-primary\"\n [disabled]=\"!grid()?.isActionEnabled(action)\" (click)=\"grid()?.onCustomAction(action)\">\n {{ action.displayName | resolveTranslation }}\n </button>\n }\n </bs-priority-nav>\n }\n </div>\n </bs-card-header>\n\n <div class=\"p-3\">\n <spark-query-grid\n [queryId]=\"queryId()\"\n [parentId]=\"parentId()\"\n [parentType]=\"parentType()\"\n [reloadToken]=\"reloadToken()\"\n [data]=\"data()\"\n [search]=\"search()\"\n (error)=\"error.emit($event)\"\n (rowClicked)=\"rowClicked.emit($event)\"\n (customActionExecuted)=\"customActionExecuted.emit($event)\" />\n </div>\n</bs-card>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAUA;AACO,MAAM,qBAAqB,GAAG,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE;AAEhD;;;;;;AAMG;AACG,SAAU,qBAAqB,CAAC,UAA6B,EAAA;IACjE,OAAO,UAAU,EAAE;AAChB,SAAA,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,IAAI,eAAe,CAAC,CAAC,CAAC,QAAQ,EAAE,QAAQ,CAAC,KAAK,CAAC;AACtE,SAAA,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE;AAC5C;AAEA;;;;;AAKG;AACG,SAAU,mBAAmB,CAAC,KAAwB,EAAA;;;AAG1D,IAAA,MAAM,WAAW,GAAiB,CAAC,KAAK,EAAE,WAAW,IAAI,EAAE,EAAE,GAAG,CAAC,EAAE,KAAK;QACtE,QAAQ,EAAE,EAAE,CAAC,QAAQ;AACrB,QAAA,SAAS,EAAE,EAAE,CAAC,SAAS,KAAK,MAAM,GAAG,YAAqB,GAAG,WAAoB;AAClF,KAAA,CAAC,CAAC;IAEH,OAAO,IAAI,iBAAiB,CAAC;AAC3B,QAAA,OAAO,EAAE,EAAE,MAAM,EAAE,qBAAqB,EAAE,QAAQ,EAAE,qBAAqB,CAAC,CAAC,CAAC,EAAE;QAC9E,IAAI,EA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,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,eAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,UAAA,CAAA,MACpB,0BAA0B,CAAA,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,WAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,eAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,UAAA,CAAA,MAC3B,0BAA0B,mFAerC,uBAAuB,CAAA,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AEvF7D;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"mintplayer-ng-spark-grid.mjs","sources":["../../grid/src/spark-grid-columns.ts","../../grid/src/spark-grid-renderers.ts","../../grid/src/spark-query-slots.ts","../../grid/src/spark-grid-cell.component.ts","../../grid/src/spark-grid-cell.component.html","../../grid/src/spark-query-grid.component.ts","../../grid/src/spark-query-grid.component.html","../../grid/src/spark-query-card.component.ts","../../grid/src/spark-query-card.component.html","../../grid/mintplayer-ng-spark-grid.ts"],"sourcesContent":["import { DatatableSettings } from '@mintplayer/ng-bootstrap/datatable';\nimport { SortColumn } from '@mintplayer/pagination';\nimport {\n EntityAttributeDefinition,\n EntityType,\n ShowedOn,\n SparkQuery,\n hasShowedOnFlag,\n} from '@mintplayer/ng-spark/models';\n\n/** Page sizes offered by every Spark grid. */\nexport const SPARK_GRID_PAGE_SIZES = [10, 25, 50];\n\n/**\n * The attributes a grid shows, in display order.\n *\n * Shared so the two grids cannot disagree about what \"visible\" means — they each had their own\n * copy of this expression, which is the kind of thing that stays identical right up until it\n * doesn't.\n */\nexport function visibleGridAttributes(entityType: EntityType | null): EntityAttributeDefinition[] {\n return entityType?.attributes\n .filter(a => a.isVisible && hasShowedOnFlag(a.showedOn, ShowedOn.Query))\n .sort((a, b) => a.order - b.order) ?? [];\n}\n\n/**\n * Initial datatable settings for a query, seeded with the query's declared sort.\n *\n * The datatable owns paging and sorting from here on and calls the fetch callback per page; this\n * only decides where it starts.\n */\nexport function initialGridSettings(query: SparkQuery | null): DatatableSettings {\n // Nullable because one caller resolves its query from a route param and may not have one yet;\n // an unsorted grid is the right fallback, not a crash.\n const sortColumns: SortColumn[] = (query?.sortColumns || []).map(sc => ({\n property: sc.property,\n direction: sc.direction === 'desc' ? 'descending' as const : 'ascending' as const,\n }));\n\n return new DatatableSettings({\n perPage: { values: SPARK_GRID_PAGE_SIZES, selected: SPARK_GRID_PAGE_SIZES[0] },\n page: { values: [1], selected: 1 },\n sortColumns,\n });\n}\n\n/** Whether a query renders as a virtual-scrolling grid rather than a paged one. */\nexport function isVirtualScrollingQuery(query: SparkQuery | null): boolean {\n return query?.renderMode === 'VirtualScrolling';\n}\n","import { inject, Injectable, Type } from '@angular/core';\nimport {\n EntityAttributeDefinition,\n LookupReference,\n QueryColumn,\n QueryResultItem,\n SparkCellColumn,\n valueFor,\n} from '@mintplayer/ng-spark/models';\nimport { SPARK_ATTRIBUTE_RENDERERS, cellValue, withDeclaredInputs } from '@mintplayer/ng-spark/renderers';\nimport { SparkService } from '@mintplayer/ng-spark/services';\n\n/**\n * Renderer lookup and lookup-reference loading for a Spark grid.\n *\n * This was extracted when `spark-query-list` and `spark-sub-query` were two components holding\n * byte-identical copies of it — around 120 lines between them. That duplication was not a\n * tidiness complaint: it produced drift. The two copies disagreed about `[indeterminate]`, about\n * resetting permission state, about whether a fetch failure surfaces or is swallowed, and about\n * virtual-scroll sizing — four user-visible bugs, each fixed on one side and not the other.\n *\n * There is now one grid, {@link SparkQueryGridComponent}, so the drift cannot recur. This stays\n * separate because it is stateless service-shaped logic rather than view state, and because it is\n * what a custom grid would need in order to render Spark cells at all.\n */\n@Injectable({ providedIn: 'root' })\nexport class SparkGridRenderers {\n private readonly registry = inject(SPARK_ATTRIBUTE_RENDERERS);\n private readonly sparkService = inject(SparkService);\n\n /** The registered column component for a column, or null to fall back to the default cell. */\n columnComponentFor(column: SparkCellColumn): Type<any> | null {\n if (!column.renderer) return null;\n return this.registry.find(r => r.name === column.renderer)?.columnComponent ?? null;\n }\n\n /**\n * Inputs for a query-grid cell renderer, filtered to what the component actually declares —\n * `NgComponentOutlet` throws on an input the target does not have, which is what lets every\n * member of the renderer contract be optional.\n */\n columnInputsFor(component: Type<any>, item: QueryResultItem, column: QueryColumn): Record<string, any> {\n return this.cellInputsFor(component, cellValue(valueFor(item, column.name)), column, item);\n }\n\n /**\n * The same contract for a row that is not a query result — an AsDetail sub-table row, which is\n * a plain dictionary of embedded values with no id and no column metadata of its own, so its\n * value cannot be read the way {@link columnInputsFor} reads one.\n *\n * Only the extraction differs; the renderer contract is identical, and stating it once is what\n * stops the two from drifting the way the cell markup already had.\n */\n cellInputsFor(component: Type<any>, value: unknown, column: SparkCellColumn, item: unknown): Record<string, any> {\n return withDeclaredInputs(component, {\n value,\n column,\n options: column.rendererOptions,\n item,\n });\n }\n\n /**\n * Loads every lookup reference the visible columns need, in one pass.\n *\n * Returns an empty map rather than throwing when there are none, so callers never branch on it.\n */\n async loadLookupOptions(columns: readonly (SparkCellColumn | EntityAttributeDefinition)[]): Promise<Record<string, LookupReference>> {\n const lookupColumns = columns.filter(c => c.lookupReferenceType);\n if (lookupColumns.length === 0) return {};\n\n const names = [...new Set(lookupColumns.map(c => c.lookupReferenceType!))];\n const entries = await Promise.all(\n names.map(async name => [name, await this.sparkService.getLookupReference(name)] as const),\n );\n return entries.reduce((acc, [k, v]) => ({ ...acc, [k]: v }), {} as Record<string, LookupReference>);\n }\n}\n","import { Directive, inject, input, TemplateRef } from '@angular/core';\nimport { CustomActionDefinition, PersistentObject, SparkQuery } from '@mintplayer/ng-spark/models';\n\n/**\n * Header slots for `<spark-query-card>`.\n *\n * Each directive marks a template that REPLACES one region of the card header. Supplying one\n * leaves the other two alone — that is the whole point of having three rather than the single\n * whole-header template they replace, where changing the icon meant re-implementing the caption\n * and the action bar as well.\n *\n * An omitted slot is not an empty slot: the card renders its default. This is what keeps the\n * auto-rendered sub-query working. A sub-query is rendered from `EntityTypeDefinition.Queries`\n * with no host to project into, so a mechanism that only ever REPLACED chrome would leave that\n * call site with nothing — which is why an earlier design had the query declare its own chrome\n * server-side. Overriding a default needs no host; replacing one does.\n *\n * The two ends of that are visible in the defaults themselves. Neither `SparkQuery` nor\n * `EntityType` carries an icon, so the server has nothing to say and the slot is the only\n * source. Actions are the mirror image: the server declares them per type, so the default is\n * the real answer and the slot is a rare override.\n *\n * Naming follows ng-bootstrap's `*bsDatatableColumn` convention — prefix, component, slot —\n * with `spark`, since these are ng-spark directives and `bs` is another package's prefix. These\n * are the first attribute directives in ng-spark; every existing selector is an element.\n *\n * ## Targeting one query\n *\n * Each slot takes an optional query alias or id as its value. A detail page renders one card per\n * entry in `EntityTypeDefinition.Queries`, so a host that supplies a bare slot would decorate\n * every one of them identically — rarely what is wanted. A targeted slot applies to that query;\n * an untargeted one is the fallback for the rest.\n *\n * ```html\n * <span *sparkQueryIcon=\"'cars'\"><spark-icon name=\"car-front\" /></span>\n * <span *sparkQueryIcon><spark-icon name=\"table\" /></span>\n * ```\n *\n * Matching is case-insensitive, against the query's alias and then its id. This is the\n * `bsPriorityNavItem` shape: a value input aliased to the selector, collected with\n * `contentChildren`.\n */\n\n/** Resolves a slot list to the one that applies to a query: targeted first, then untargeted. */\nexport function slotFor<T extends { forQuery: () => string }>(\n slots: readonly T[],\n query: SparkQuery | null,\n): T | null {\n if (!slots.length) return null;\n\n const matches = (target: string) =>\n !!target && (\n target.localeCompare(query?.alias ?? '', undefined, { sensitivity: 'accent' }) === 0 ||\n target.localeCompare(query?.id ?? '', undefined, { sensitivity: 'accent' }) === 0);\n\n // A targeted slot wins over the catch-all even when it is declared later: \"this one query\"\n // is the more specific statement, and declaration order in a template is not a priority.\n return slots.find(s => matches(s.forQuery())) ?? slots.find(s => !s.forQuery()) ?? null;\n}\n\n/**\n * The icon at the header's leading edge. No default: nothing in the model describes one.\n *\n * ```html\n * <spark-query-card [queryId]=\"'cars'\">\n * <spark-icon *sparkQueryIcon name=\"car-front\" />\n * </spark-query-card>\n * ```\n */\n@Directive({ selector: '[sparkQueryIcon]' })\nexport class SparkQueryIconDirective {\n readonly templateRef = inject<TemplateRef<SparkQuerySlotContext>>(TemplateRef);\n\n /** Query alias or id this slot applies to. Empty targets every query on the page. */\n readonly forQuery = input('', { alias: 'sparkQueryIcon' });\n\n static ngTemplateContextGuard(\n _dir: SparkQueryIconDirective,\n ctx: unknown,\n ): ctx is SparkQuerySlotContext {\n return true;\n }\n}\n\n/**\n * The header caption. Defaults to the query's translated description, falling back to its name.\n *\n * The context carries that resolved default as `$implicit`, so a host can decorate it — add a\n * count, a badge — without re-resolving the translation itself.\n */\n@Directive({ selector: '[sparkQueryCaption]' })\nexport class SparkQueryCaptionDirective {\n readonly templateRef = inject<TemplateRef<SparkQueryCaptionContext>>(TemplateRef);\n\n readonly forQuery = input('', { alias: 'sparkQueryCaption' });\n\n static ngTemplateContextGuard(\n _dir: SparkQueryCaptionDirective,\n ctx: unknown,\n ): ctx is SparkQueryCaptionContext {\n return true;\n }\n}\n\n/**\n * The buttons at the header's trailing edge. Defaults to the server-declared custom actions.\n *\n * The context carries those actions and the current selection, so a host that wants its own\n * buttons ALONGSIDE the server's can render both rather than choosing. Without that, overriding\n * this slot to add one button would silently drop every action the type declares — and the\n * server's actions are the ones carrying `selectionRule` and the permission filter.\n *\n * ```html\n * <ng-container *sparkQueryActions=\"let actions; selection as rows\">\n * <button (click)=\"export(rows)\">Export</button>\n * </ng-container>\n * ```\n */\n@Directive({ selector: '[sparkQueryActions]' })\nexport class SparkQueryActionsDirective {\n readonly templateRef = inject<TemplateRef<SparkQueryActionsContext>>(TemplateRef);\n\n readonly forQuery = input('', { alias: 'sparkQueryActions' });\n\n static ngTemplateContextGuard(\n _dir: SparkQueryActionsDirective,\n ctx: unknown,\n ): ctx is SparkQueryActionsContext {\n return true;\n }\n}\n\n/** Context for the icon slot: the query whose card is being rendered. */\nexport class SparkQuerySlotContext {\n $implicit: SparkQuery | null = null;\n}\n\nexport class SparkQueryCaptionContext {\n /** The caption the card would have rendered: description, or the query name. */\n $implicit = '';\n query: SparkQuery | null = null;\n}\n\nexport class SparkQueryActionsContext {\n /** The custom actions the card would have rendered, already filtered for this query. */\n $implicit: CustomActionDefinition[] = [];\n /** Rows currently ticked. Empty unless an action is selection-gated. */\n selection: PersistentObject[] = [];\n query: SparkQuery | null = null;\n}\n","import { ChangeDetectionStrategy, Component, computed, inject, input } from '@angular/core';\nimport { CommonModule, NgComponentOutlet } from '@angular/common';\nimport { RouterModule } from '@angular/router';\nimport { EntityAttributeDefinition, SparkCellColumn } from '@mintplayer/ng-spark/models';\nimport { ReferenceChip } from '@mintplayer/ng-spark/pipes';\nimport { SparkGridRenderers } from './spark-grid-renderers';\n\n/**\n * One cell of a Spark table, wherever that table is.\n *\n * ## Why this exists\n *\n * The cell markup was written out three times: twice in the query grids (since merged into\n * {@link SparkQueryGridComponent}) and once more in the AsDetail table on the PO detail page. The\n * third copy was never counted, and it had already drifted — a `boolean` column rendered the text\n * `\"true\"` there while the grid rendered a checkbox, a `color` rendered its hex string rather than\n * a swatch, and a custom renderer was dispatched by a second, hand-copied lookup.\n *\n * ## What it does and does not own\n *\n * It owns **presentation**: which control a `dataType` becomes, and dispatching a declared custom\n * renderer. It does not own **value resolution**, and deliberately so — the two callers read from\n * genuinely different row models. A query row is a `PersistentObject` with an attribute list and\n * an id; an AsDetail row is a plain dictionary of embedded values with neither. Trying to unify\n * that would put a second row-access path inside this component and buy nothing.\n *\n * So the caller resolves the value with whichever pipe fits its row model, and passes the result.\n *\n * ## The two links are not the same link, and only one is here\n *\n * `link` is for a cell whose own value points at another entity — an AsDetail reference column.\n * The query grid's first-column link is a different rule (it points at the row's own detail page,\n * gated on `Read`), and it stays in the grid, wrapping this component. Passing both would nest\n * anchors, which is invalid HTML; the grid therefore leaves `link` unset.\n */\n@Component({\n selector: 'spark-grid-cell',\n imports: [CommonModule, NgComponentOutlet, RouterModule],\n templateUrl: './spark-grid-cell.component.html',\n styleUrl: './spark-grid-cell.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SparkGridCellComponent {\n private readonly renderers = inject(SparkGridRenderers);\n\n /** The column being rendered. Its `dataType` and `renderer` decide everything below. */\n column = input.required<SparkCellColumn>();\n\n /**\n * What the caller's value pipe produced: the display text for most columns, and the raw value\n * for `boolean` and `color`, which need the value rather than a rendering of it.\n */\n display = input<unknown>(null);\n\n /**\n * The value handed to a declared custom renderer.\n *\n * Separate from {@link display} because they are not the same thing: a renderer receives the\n * underlying value — for AsDetail, the nested object itself — while `display` has already been\n * flattened to something printable.\n */\n rendererValue = input<unknown>(null);\n\n /** The row, passed through to a custom renderer as `item`. */\n item = input<unknown>(null);\n\n /**\n * Pre-resolved chips for a reference-array column, or empty when the column is not one.\n *\n * Resolved by the caller because the label source differs: a query row carries a per-id\n * breadcrumb map, while an AsDetail row's `__sparkBreadcrumbs` is keyed by column name only and\n * so cannot label the members of an array. Rather than render a row of raw ids, an AsDetail\n * caller passes nothing and the cell falls through to text.\n */\n chips = input<ReferenceChip[]>([]);\n\n /** Route for a cell whose value references another entity. See the class comment. */\n link = input<unknown[] | null>(null);\n\n protected readonly rendererComponent = computed(() => this.renderers.columnComponentFor(this.column()));\n\n protected readonly rendererInputs = computed(() => {\n const component = this.rendererComponent();\n return component\n ? this.renderers.cellInputsFor(component, this.rendererValue(), this.column(), this.item())\n : {};\n });\n\n /** Null and undefined are distinct from `false` here — see the template. */\n protected readonly isUnsetBoolean = computed(() => this.display() == null);\n}\n","@if (rendererComponent(); as rendererType) {\n <ng-container *ngComponentOutlet=\"rendererType; inputs: rendererInputs()\"></ng-container>\n} @else if (column().dataType === 'boolean') {\n <!-- [indeterminate] matters: without it a null boolean renders as an unchecked box, which reads\n as an explicit `false`. One of the three copies of this cell bound it and the others had\n drifted, so the same column said different things on a detail page and in a grid. -->\n <input type=\"checkbox\"\n [checked]=\"display() === true\"\n [indeterminate]=\"isUnsetBoolean()\"\n disabled\n onclick=\"return false;\">\n} @else if (column().dataType === 'color') {\n @if (display(); as colorVal) {\n <!-- Inline on purpose, and it is not a style-guide slip. In a query grid this cell is\n rendered INSIDE <mp-datatable>'s shadow root, which does not see document\n stylesheets: neither this component's scoped rules nor Bootstrap utilities apply\n there. Inline styles do. Measured 2026-08-23 -- see the comment in the .scss. -->\n <span class=\"d-inline-block align-middle border rounded\"\n [style.background-color]=\"colorVal\"\n style=\"width: 1.5em; height: 1.5em;\"></span>\n }\n} @else if (column().dataType === 'image') {\n @if (display(); as src) {\n <!-- Inline sizing for the same reason the colour swatch above uses it: in a query grid this\n renders inside <mp-datatable>'s shadow root, which sees neither this component's scoped\n rules nor Bootstrap's. `alt` is empty on purpose — the cell is decorative next to the\n row's own labelled columns, and a filename read aloud is worse than nothing. -->\n <img [src]=\"src\" alt=\"\" loading=\"lazy\" class=\"align-middle rounded\"\n style=\"max-height: 2.5em; max-width: 100%; object-fit: contain;\">\n }\n} @else if (column().dataType === 'url') {\n @if (display(); as href) {\n <!-- rel is not optional with target=_blank: without noopener the opened page gets a handle on\n this one through window.opener, and these hrefs are data. -->\n <a [href]=\"href\" target=\"_blank\" rel=\"noopener noreferrer\">{{ href }}</a>\n }\n} @else if (chips().length) {\n <span class=\"d-inline-flex flex-wrap gap-1\">\n @for (chip of chips(); track chip.id) {\n <span class=\"spark-chip\">{{ chip.label }}</span>\n }\n </span>\n} @else if (link(); as route) {\n <a [routerLink]=\"route\">{{ display() }}</a>\n} @else {\n {{ display() }}\n}\n","import { ChangeDetectionStrategy, Component, computed, effect, inject, input, model, output, signal, untracked, Type } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { HttpErrorResponse } from '@angular/common/http';\nimport { RouterModule } from '@angular/router';\nimport { Color } from '@mintplayer/ng-bootstrap';\nimport { BsAlertComponent } from '@mintplayer/ng-bootstrap/alert';\nimport { BsDatatableComponent, BsDatatableColumnDirective, BsRowTemplateDirective, DatatableSettings, type BsDatatableFetch } from '@mintplayer/ng-bootstrap/datatable';\nimport { BsSpinnerComponent } from '@mintplayer/ng-bootstrap/spinner';\nimport { SparkQueryRefreshService } from '@mintplayer/ng-spark/client-operations';\nimport { cellValue } from '@mintplayer/ng-spark/renderers';\nimport { QueryCellValuePipe, QueryReferenceChipsPipe, ResolveTranslationPipe, TranslateKeyPipe } from '@mintplayer/ng-spark/pipes';\nimport { SparkLanguageService, SparkService } from '@mintplayer/ng-spark/services';\nimport {\n CustomActionDefinition,\n EntityAttributeDefinition,\n EntityType,\n LookupReference,\n QueryColumn,\n QueryResultItem,\n SparkQuery,\n filterQueryActions,\n parseSelectionRule,\n selectionModeFor,\n valueFor,\n} from '@mintplayer/ng-spark/models';\nimport { SPARK_GRID_PAGE_SIZES, initialGridSettings, isVirtualScrollingQuery } from './spark-grid-columns';\nimport { SparkGridRenderers } from './spark-grid-renderers';\nimport { SparkGridCellComponent } from './spark-grid-cell.component';\n\n/**\n * The one Spark grid: a `<bs-datatable>` rendering a query or a sub-query.\n *\n * This replaces two components that were the same grid written twice — and, counting\n * `spark-query-list`'s streaming and paged branches, the `<bs-datatable>` element itself written\n * three times. The duplication had already produced four user-visible bugs, each fixed on one\n * side and not the other: `[indeterminate]` on null booleans, permission state surviving a failed\n * reload, a swallowed fetch failure, and virtual-scroll sizing. `SparkGridRenderers` was\n * extracted to stop that and could only take the stateless helpers with it; this takes the rest.\n *\n * ## What it deliberately does NOT own: streaming\n *\n * `spark-grid-renderers.ts` records why — a websocket dependency graph must not reach the bundle\n * of every PO detail page, none of which stream. So rows can come from **either** side:\n *\n * - unbound `data` — the grid fetches for itself, paging and sorting server-side;\n * - bound `data` — the grid renders what it is given and never fetches.\n *\n * `spark-query-list` keeps the socket and feeds its snapshot in. This is the line `bs-datatable`\n * itself draws: `[data]` and `[fetch]` are mutually exclusive, and binding both makes `[fetch]`\n * win silently.\n *\n * ## Reading its state\n *\n * `query`, `entityType`, `customActions`, `selection`, `canRead`, `canCreate` and `resultCount`\n * are readable so a host can render chrome around the grid. Read them through a template\n * reference variable — `<spark-query-grid #grid>` … `grid.query()` — not `viewChild`: hosts wrap\n * grids in `@if`, where a `viewChild` is intermittently undefined.\n */\n@Component({\n selector: 'spark-query-grid',\n imports: [CommonModule, RouterModule, BsAlertComponent, BsDatatableComponent, BsDatatableColumnDirective, BsRowTemplateDirective, BsSpinnerComponent, SparkGridCellComponent, ResolveTranslationPipe, QueryCellValuePipe, QueryReferenceChipsPipe, TranslateKeyPipe],\n templateUrl: './spark-query-grid.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SparkQueryGridComponent {\n private readonly sparkService = inject(SparkService);\n private readonly gridRenderers = inject(SparkGridRenderers);\n private readonly queryRefresh = inject(SparkQueryRefreshService);\n readonly lang = inject(SparkLanguageService);\n\n /** Query alias or id. */\n queryId = input.required<string>();\n\n /**\n * The parent persistent object this query is scoped to, when it has one.\n *\n * Optional, because not every query is a detail of something: a page can host a grid that\n * stands on its own — \"my accounts\", a dashboard list — and the server already treats an absent\n * parent as \"no parent\" rather than as an error. Requiring these made that shape impossible to\n * express: the component simply never loaded, with no request, no error and no log.\n *\n * Pass both or neither. One without the other is ignored, matching `SparkService.executeQuery`,\n * which omits either param when it is falsy, and the execute endpoint, which resolves a parent\n * only when both are present.\n */\n parentId = input<string>('');\n parentType = input<string>('');\n\n /**\n * Rows supplied from outside. When bound, the grid renders these and runs no fetch.\n *\n * This is how streaming stays out of this component (see the class comment). `null` — the\n * default — means \"fetch for yourself\"; an empty array means \"you have been given no rows\",\n * which is a different statement and renders an empty grid rather than triggering a load.\n */\n data = input<QueryResultItem[] | null>(null);\n\n /**\n * Server-side search term, passed through to the query.\n *\n * An input rather than a box, so the host owns the control and the grid owns the request. A\n * host with client-side rows filters them itself before binding `data`.\n */\n search = input<string>('');\n\n /**\n * Column metadata for externally supplied rows. Required whenever `data` is bound, because a\n * projection cannot describe itself — there is no per-row metadata left to infer it from.\n */\n columns = input<QueryColumn[] | null>(null);\n\n /**\n * Change this to re-run the query. Any value works; only its identity matters.\n *\n * A declarative token rather than only a `reload()` method, because calling a method means\n * holding a component handle, and hosts wrap this grid in `@if`, where a `viewChild` is\n * intermittently undefined.\n *\n * This drives the CHEAP refresh (see {@link reload}). It deliberately does not feed the main\n * effect: re-running `loadData` would re-resolve the query, the entity types, the permissions\n * and the lookups, and reset the user's page and sort on every button press.\n */\n reloadToken = input<unknown>(null);\n\n /**\n * Paging and sorting. Two-way, so a host driving `data` can sort those rows by whatever the\n * user actually clicked — the datatable writes the new sort back through here.\n */\n settings = model(new DatatableSettings({\n perPage: { values: SPARK_GRID_PAGE_SIZES, selected: SPARK_GRID_PAGE_SIZES[0] },\n page: { values: [1], selected: 1 },\n sortColumns: [],\n }));\n\n /** Rows the user has ticked. Two-way so chrome outside the grid can read and clear them. */\n selection = model<QueryResultItem[]>([]);\n\n /**\n * Replaces where the first column's link points, per row.\n *\n * Return `null` to suppress the link for that row — useful when a grid mixes rows that have a\n * detail page with rows that do not.\n *\n * ⚠️ **It changes the destination, not the permission.** `canRead()` still gates whether any\n * link is rendered at all, and this function is never consulted when that gate is closed. It\n * cannot be used to reach a row the rights model withheld; it exists for the case where the\n * row's natural destination is not `/po/{type}/{id}` — a composed row that maps to a page of\n * its own, or a grid embedded in a route that owns its own child paths.\n */\n rowRoute = input<((row: QueryResultItem) => unknown[] | null) | null>(null);\n\n /** Emitted whenever a load or a page fetch fails, for a host in bespoke chrome. */\n error = output<HttpErrorResponse>();\n rowClicked = output<QueryResultItem>();\n customActionExecuted = output<{ action: CustomActionDefinition }>();\n\n colors = Color;\n\n /**\n * Where the first column's link points for this row: the host's `rowRoute` when it supplied one,\n * otherwise the row's own detail page.\n *\n * A method rather than a computed because the answer is per row, and the template already\n * iterates rows — a computed would have to be a map keyed by id, rebuilt on every page.\n */\n protected rowRouteFor(row: QueryResultItem): unknown[] | null {\n const custom = this.rowRoute();\n if (custom) return custom(row);\n\n const type = this.entityType();\n\n // ⚠️ A composed type has no per-row detail page by construction: its rows are computed, and\n // `{Name}Actions.OnLoadAsync` serves ONE page which is free to ignore the id it was given. So\n // /po/{type}/{rowId} does not 404 — it silently renders that same page, which is worse, because\n // nothing looks wrong. This branch is live in DemoApp today: Read/StartPage implies\n // Query/StartPage, so the composed grid renders with canRead() true and every row linked.\n //\n // `clrType` is absent exactly for those types and is already on the wire; the grid simply never\n // consulted it. A host whose composed rows DO have a page says so with `rowRoute`.\n if (!type?.clrType) return null;\n\n return ['/po', type.alias || type.id, row.id];\n }\n\n query = signal<SparkQuery | null>(null);\n entityType = signal<EntityType | null>(null);\n allEntityTypes = signal<EntityType[]>([]);\n lookupReferenceOptions = signal<Record<string, LookupReference>>({});\n loading = signal(true);\n canRead = signal(false);\n canCreate = signal(false);\n resultCount = signal<number | null>(null);\n customActions = signal<CustomActionDefinition[]>([]);\n fetchFn = signal<BsDatatableFetch<QueryResultItem> | null>(null);\n\n /**\n * Why the component renders its own failure instead of only reporting one.\n *\n * `SparkService` is a bare `firstValueFrom` passthrough with no interceptor, so every failure\n * surfaces here and nowhere else. A host embedding this grid cannot surface what it never sees,\n * and the default has to be visible with no host cooperation — hence a rendered alert, not just\n * an output.\n */\n errorMessage = signal<string | null>(null);\n\n /** 'none' unless an action is selection-gated, so unaffected grids gain no checkbox column. */\n selectionMode = computed(() => selectionModeFor(this.customActions()));\n\n isVirtualScrolling = computed(() => isVirtualScrollingQuery(this.query()));\n\n /**\n * Columns as sent with the most recent fetched page.\n *\n * A host binding `data` (streaming) supplies its own via the `columns` input instead — the\n * snapshot carries them once, exactly as a paged result does.\n */\n private readonly fetchedColumns = signal<QueryColumn[]>([]);\n\n /** Every column on the wire, drawn or not — what renderers and lookups resolve against. */\n allColumns = computed(() => this.columns() ?? this.fetchedColumns());\n\n /**\n * The columns the grid draws. `isVisible: false` ships a value without a column, so a renderer\n * can read a sibling the grid does not show; undefined means visible, so a server that predates\n * the field still draws everything.\n */\n visibleColumns = computed(() => this.allColumns().filter(c => c.isVisible !== false));\n\n /**\n * True when rows do not come from this component's own fetch.\n *\n * Either because the host bound `data`, or because the query streams — a streaming query's rows\n * arrive over a socket and `/execute` is not a way to get them. The grid recognises the second\n * case itself rather than waiting to be told, because it resolves the query before the host can\n * see it: left to `data` alone, every streaming grid would fire one pointless fetch on mount,\n * before the host had anything to bind.\n */\n hasExternalData = computed(() =>\n this.data() !== null || this.query()?.isStreamingQuery === true);\n\n /** Whether an action's selection rule is satisfied right now. The server checks it again. */\n isActionEnabled(action: CustomActionDefinition): boolean {\n return parseSelectionRule(action.selectionRule)(this.selection().map(r => r.id).length);\n }\n\n constructor() {\n effect(() => {\n const qId = this.queryId();\n const pId = this.parentId();\n const pType = this.parentType();\n // Only the query id is required. Requiring a parent here is what made a standalone grid\n // silently render nothing.\n if (qId) {\n this.loadData(qId, pId, pType);\n } else {\n // No query id at all. `loading` starts true, so without this the component would spin\n // forever instead of saying anything.\n this.loading.set(false);\n }\n });\n\n // Separate effect, so the token drives the cheap refresh and never the full metadata reload.\n // `first` skips the initial run: the effect above has already fetched, and reacting to the\n // token's starting value would double-fetch on mount.\n let first = true;\n effect(() => {\n // Both the host's token and the server's refreshQuery drive the same cheap refresh.\n this.reloadToken();\n this.queryRefresh.tokenFor(this.queryId());\n if (first) { first = false; return; }\n untracked(() => this.reload());\n });\n\n // A new search term must refetch even when page, perPage and sort are unchanged — the\n // datatable dedupes reloads by exactly that triple, and a new fetch identity is what resets\n // its dedupe key. Skipping the first run keeps mount to a single request.\n let firstSearch = true;\n effect(() => {\n this.search();\n if (firstSearch) { firstSearch = false; return; }\n untracked(() => this.onSearchChanged());\n });\n }\n\n /**\n * Re-run the query, keeping the current page, sort and scroll position.\n *\n * Data-level on purpose: it re-seeds the fetch closure and nothing else. For a definition\n * change — new columns, a renamed query — the inputs themselves must change; that is the\n * expensive path. Inert when rows come from the host: there is nothing here to re-run.\n */\n reload(): void {\n if (this.hasExternalData()) return;\n const q = this.query();\n if (q) this.fetchFn.set(this.makeFetch(q, this.parentId(), this.parentType()));\n }\n\n private onSearchChanged(): void {\n if (this.hasExternalData()) return;\n const s = this.settings();\n // Back to page 1: the old page number means nothing against a different result set.\n this.settings.set(new DatatableSettings({\n perPage: { values: s.perPage.values, selected: s.perPage.selected },\n page: { values: [1], selected: 1 },\n sortColumns: s.sortColumns,\n }));\n this.reload();\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 // The sub-query's container travels with the action (#327). Without it an action invoked\n // from a company's Cars tab could not tell it was on a company's page at all — the grid knew\n // (it filters the rows by that parent) and simply dropped the fact on the way out.\n //\n // Sent as parentId/parentType, NOT as the `parent` argument: that one means an object of this\n // action's OWN type and is loaded under it server-side, so handing it a Company id for a Car\n // action refuses — correctly, and confusingly.\n const pId = this.parentId();\n const pType = this.parentType();\n await this.sparkService.executeCustomAction(\n this.entityType()!.id,\n action.name,\n undefined,\n this.selection().map(r => r.id),\n pId && pType ? { id: pId, type: pType } : undefined,\n // The query too: the server re-runs it narrowed to these ids, so the action receives the\n // rows this grid rendered rather than a re-derivation from documents.\n this.query()?.id);\n this.customActionExecuted.emit({ action });\n if (action.refreshOnCompleted) this.reload();\n } catch (e) {\n const err = e as HttpErrorResponse;\n this.errorMessage.set(err.error?.error || err.message || this.lang.t('common.actionFailed') || 'Action failed');\n }\n }\n\n private reportError(err: HttpErrorResponse): void {\n this.errorMessage.set(this.describe(err));\n this.error.emit(err);\n }\n\n /**\n * A 404 is deliberately generic.\n *\n * `Endpoints/Queries/Get.cs` answers 404 with byte-identical bodies for \"no such query\" and\n * \"you may not see it\", so existence is not disclosed (security audit M-3). The component\n * therefore genuinely cannot tell them apart, and both \"Not found\" and \"Access denied\" would be\n * a guess — one of them leaking, the other misleading.\n */\n private describe(err: HttpErrorResponse): string {\n if (err?.status === 404) {\n return this.lang.t('spark.query.unavailable') || 'This list is not available.';\n }\n return err?.error?.error || err?.message\n || this.lang.t('common.unexpectedError') || 'An unexpected error occurred';\n }\n\n private async loadData(queryId: string, parentId: string, parentType: string): Promise<void> {\n this.loading.set(true);\n this.errorMessage.set(null);\n this.fetchFn.set(null);\n // Reset everything derived from the previous query, not just the fetch. Leaving\n // `entityType`/`canRead` behind let a failed reload build a row link out of the PREVIOUS type\n // and the previous permission.\n this.query.set(null);\n this.entityType.set(null);\n this.canRead.set(false);\n this.canCreate.set(false);\n this.customActions.set([]);\n this.resultCount.set(null);\n // Ids from the previous query are meaningless against the next one, and would be POSTed as\n // though they belonged to it.\n this.selection.set([]);\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 et = this.resolveEntityType(resolvedQuery, entityTypes);\n this.entityType.set(et);\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.canRead.set(permissions.canRead);\n this.canCreate.set(permissions.canCreate);\n // 'query', not 'list'. The server model has always documented \"detail\" | \"query\" |\n // \"both\"; a filter testing for a value nothing emits renders the action NOWHERE.\n this.customActions.set(filterQueryActions(actions));\n }\n\n this.settings.set(initialGridSettings(resolvedQuery));\n // The datatable drives paging/sorting via [(settings)] and calls fetchFn per page. Virtual\n // scrolling is just the [virtualScroll] template flag.\n // `resolvedQuery`, not `hasExternalData()`: the query signal is set above, but reading the\n // computed here would depend on signal-read ordering inside an async method. Ask the value\n // directly.\n if (this.data() === null && !resolvedQuery?.isStreamingQuery) {\n this.fetchFn.set(this.makeFetch(resolvedQuery, parentId, parentType));\n }\n\n this.loadLookupReferenceOptions();\n } catch (e) {\n this.fetchFn.set(null);\n this.reportError(e as HttpErrorResponse);\n } finally {\n this.loading.set(false);\n }\n }\n\n /**\n * The query's entity type.\n *\n * The source-name fallback is not optional garnish: a `Database.*` query need not declare\n * `entityType`, and the sub-query grid — which matched on the declared name alone — rendered\n * those as an empty card with no columns, no rows and no error, while the identical query\n * rendered correctly as a page. Both grids are this one now, so there is one answer.\n */\n private resolveEntityType(query: SparkQuery | null, entityTypes: EntityType[]): EntityType | null {\n if (!query) return null;\n\n if (query.entityType) {\n return entityTypes.find(t =>\n t.name === query.entityType || t.alias === query.entityType?.toLowerCase()) ?? null;\n }\n\n const sourceName = extractSourceName(query.source);\n const singular = singularize(sourceName);\n return entityTypes.find(t =>\n t.name === sourceName || t.name === singular || t.clrType?.endsWith(singular)) ?? null;\n }\n\n private makeFetch(query: SparkQuery, parentId: string, parentType: string): BsDatatableFetch<QueryResultItem> {\n return (req) => this.sparkService.executeQuery(query.id, {\n sortColumns: req.sortColumns,\n skip: (req.page - 1) * req.perPage,\n take: req.perPage,\n search: this.search() || undefined,\n parentId, parentType,\n }).then(r => {\n this.errorMessage.set(null);\n this.resultCount.set(r.totalItems);\n // Columns come from the result now, not from the entity type: the server decides the query\n // surface (ShowedOn.Query) and is the same place the sort-column allow-list is checked.\n // ?? [] because a malformed or older response must render an empty grid, not throw inside a\n // computed — where the stack points at the column filter and not at the response that lacked them.\n this.fetchedColumns.set(r.columns ?? []);\n return {\n data: r.items,\n totalRecords: r.totalItems,\n totalPages: Math.ceil(r.totalItems / req.perPage) || 1,\n perPage: req.perPage,\n page: req.page,\n };\n }).catch((e: HttpErrorResponse) => {\n // Report before returning the empty page, or a failed fetch is indistinguishable from a\n // query that legitimately has no rows.\n this.reportError(e);\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 // Over ALL columns, not just the drawn ones: an undrawn column's value can still be rendered\n // by a renderer reading it as a sibling, and it would resolve to a raw key without its options.\n this.lookupReferenceOptions.set(await this.gridRenderers.loadLookupOptions(this.allColumns()));\n }\n\n /**\n * The underlying value a custom renderer receives, which is not the printable one.\n *\n * A projection is flat, so this is the cell's own value rather than a display string. It is\n * deliberately not the attribute-shaped `rendererValue`: a query row has no nested object to\n * fall back to, and reaching for one would hand every renderer `undefined`.\n */\n rendererValueFor(item: QueryResultItem, column: QueryColumn): unknown {\n return cellValue(valueFor(item, column.name));\n }\n\n getColumnRendererComponent(column: QueryColumn): Type<any> | null {\n return this.gridRenderers.columnComponentFor(column);\n }\n\n getColumnRendererInputs(component: Type<any>, item: QueryResultItem, column: QueryColumn): Record<string, any> {\n return this.gridRenderers.columnInputsFor(component, item, column);\n }\n}\n\nfunction extractSourceName(source: string): string {\n const dotIndex = source.indexOf('.');\n return dotIndex >= 0 ? source.substring(dotIndex + 1) : source;\n}\n\n/**\n * Enough English to map a query source onto a type name — `Cars` to `Car`, `People` to `Person`.\n *\n * Deliberately a small table plus three suffix rules rather than a library: it runs against type\n * names the application itself chose, and a wrong guess costs nothing, since the caller falls\n * through to matching the plural and the CLR type name.\n */\nfunction singularize(plural: string): string {\n const irregulars: Record<string, string> = {\n 'People': 'Person',\n 'Children': 'Child',\n 'Men': 'Man',\n 'Women': 'Woman',\n };\n if (irregulars[plural]) return irregulars[plural];\n if (plural.endsWith('ies')) return plural.slice(0, -3) + 'y';\n if (plural.endsWith('es')) return plural.slice(0, -2);\n if (plural.endsWith('s')) return plural.slice(0, -1);\n return plural;\n}\n","<!--\n Three explicit states, in this order, and the order is load-bearing.\n\n This template used to open with `@if (query(); as q)` wrapping EVERYTHING, and `query()` is only\n set after loadData's awaits resolve. Three separate bugs fell out of that one line: the spinner\n was unreachable on a first load (it rendered inside the gate, while `loading` starts true and\n `query` starts null), a first-load failure rendered ZERO DOM — no card, no message, nothing to\n see or report — and a failed RELOAD left the previous query's rows on screen.\n\n So: `loading` is checked first and outside any dependency on `query`, and the final `@else`\n always renders something. Do not fold these back into one gate, and do not move the spinner\n inside the `query()` branch.\n-->\n@if (loading()) {\n <div class=\"text-center p-3\">\n <bs-spinner />\n </div>\n} @else if (query()) {\n <!-- A page-fetch failure while the grid is already resolved. Without this the catch returns an\n empty page and a failed query is indistinguishable from one that legitimately has no rows. -->\n @if (errorMessage(); as err) {\n <bs-alert [type]=\"colors.danger\" class=\"mb-3\">\n {{ err }}\n </bs-alert>\n }\n\n <!--\n One datatable, two row sources. `[data]` and `[fetch]` are mutually exclusive in\n ng-bootstrap — binding both makes `[fetch]` win silently — so exactly one is ever non-null\n here: `fetchFn` is left null whenever `data` is bound. See the class comment for why rows can\n arrive from outside at all (streaming must not put a websocket in every detail page's bundle).\n -->\n <bs-datatable\n [selectionMode]=\"selectionMode()\"\n [(selection)]=\"selection\"\n [virtualScroll]=\"isVirtualScrolling()\"\n [itemSize]=\"40\"\n [isResponsive]=\"isVirtualScrolling()\"\n [data]=\"data()\"\n [fetch]=\"fetchFn()\"\n [(settings)]=\"settings\">\n @for (col of visibleColumns(); track col.name) {\n <div *bsDatatableColumn=\"col.name; sortable: true\">\n {{ (col.label | resolveTranslation) || col.name }}\n </div>\n }\n\n <ng-container *bsRowTemplate=\"let item\">\n @let row = $any(item);\n @for (col of visibleColumns(); track col.name; let first = $first) {\n <td>\n @if (row) {\n <!-- The first column links to the row's detail page. Two things about this are\n routinely misread:\n\n 1. `cellContent` is projected INSIDE the anchor, so a custom `renderer` does NOT\n suppress this link — a renderer that emits its own <a> produces nested anchors\n (invalid HTML) rather than replacing this one.\n 2. `canRead()` is the whole gate, and it is the rights model: `Query` without\n `Read` lists the rows and withholds the link. Withhold `Read` for a query\n whose rows no detail page can load — a Custom.* query that fabricates rows in\n memory, say.\n 3. `rowRoute` replaces the DESTINATION only, never the gate: returning a route\n from it cannot make a row clickable that `canRead()` withheld, and returning\n null from it suppresses the link for that one row. -->\n @if (first && canRead() && rowRouteFor(row); as route) {\n <a [routerLink]=\"route\"\n (click)=\"rowClicked.emit(row)\">\n <ng-container *ngTemplateOutlet=\"cellContent; context: { $implicit: row, col: col }\"></ng-container>\n </a>\n } @else {\n <ng-container *ngTemplateOutlet=\"cellContent; context: { $implicit: row, col: col }\"></ng-container>\n }\n } @else {\n \n }\n </td>\n }\n </ng-container>\n </bs-datatable>\n} @else {\n <!-- The query could not be resolved. Rendering something keeps the host's layout intact and,\n crucially, makes the failure visible: this branch used to render nothing at all. -->\n <bs-alert [type]=\"colors.danger\" class=\"mb-0\">\n {{ errorMessage() || ('spark.query.unavailable' | t) }}\n </bs-alert>\n}\n\n<ng-template #cellContent let-item let-col=\"col\">\n <!--\n Presentation lives in <spark-grid-cell>, shared with the AsDetail table on the PO detail page.\n Value resolution stays here: a query row is a PersistentObject with an attribute list, and the\n AsDetail table's rows are plain dictionaries, so only the rendering is common.\n\n `link` is deliberately not passed. The first-column link is the grid's own rule and wraps this\n template from outside; setting both would nest anchors.\n -->\n <spark-grid-cell\n [column]=\"col\"\n [display]=\"(col | queryCellValue:item:lookupReferenceOptions())\"\n [rendererValue]=\"rendererValueFor(item, col)\"\n [item]=\"item\"\n [chips]=\"(col | queryReferenceChips:item)\" />\n</ng-template>\n","import { ChangeDetectionStrategy, Component, computed, contentChildren, input, output, viewChild, TemplateRef } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { HttpErrorResponse } from '@angular/common/http';\nimport { Color } from '@mintplayer/ng-bootstrap';\nimport { BsCardComponent, BsCardHeaderComponent } from '@mintplayer/ng-bootstrap/card';\nimport { BsPriorityNavComponent, BsPriorityNavItemDirective } from '@mintplayer/ng-bootstrap/priority-nav';\nimport { ResolveTranslationPipe } from '@mintplayer/ng-spark/pipes';\nimport { SparkLanguageService } from '@mintplayer/ng-spark/services';\nimport { CustomActionDefinition, PersistentObject, QueryResultItem } from '@mintplayer/ng-spark/models';\nimport { inject } from '@angular/core';\nimport { SparkQueryGridComponent } from './spark-query-grid.component';\nimport {\n SparkQueryActionsDirective,\n SparkQueryCaptionDirective,\n SparkQueryIconDirective,\n slotFor,\n} from './spark-query-slots';\n\n/**\n * A `<bs-card>` around a {@link SparkQueryGridComponent}: icon, caption, actions, grid.\n *\n * ## Chrome is overridden, not replaced\n *\n * Every header region has a default, and a host replaces only the ones it supplies. That is what\n * lets this component serve the auto-rendered case: a sub-query is rendered once per entry in\n * `EntityTypeDefinition.Queries` with nobody projecting into it, and it must look right with no\n * host cooperation at all. A slot mechanism that only ever *replaced* chrome would leave that\n * call site blank — which is why an earlier design had the query carry its own chrome from the\n * server. Overriding a default needs no host; replacing one does.\n *\n * ## Two ways in, one set of templates\n *\n * Hand-written markup uses the structural directives and is found with `contentChildren`.\n * The auto-rendered path cannot: `spark-po-detail` is created by the router, so in a default app\n * there is no tag to project into. It therefore forwards `TemplateRef`s as inputs instead — a\n * directive cannot cross a component boundary but its template can, and that forwarding is\n * already the idiom in `spark-po-detail` (`extraActionsTemplate`, `extraContentTemplate`).\n *\n * Content wins over a forwarded input: the closer declaration is the more specific one.\n */\n@Component({\n selector: 'spark-query-card',\n imports: [CommonModule, BsCardComponent, BsCardHeaderComponent, BsPriorityNavComponent, BsPriorityNavItemDirective, SparkQueryGridComponent, ResolveTranslationPipe],\n templateUrl: './spark-query-card.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SparkQueryCardComponent {\n readonly lang = inject(SparkLanguageService);\n\n queryId = input.required<string>();\n parentId = input<string>('');\n parentType = input<string>('');\n reloadToken = input<unknown>(null);\n data = input<QueryResultItem[] | null>(null);\n search = input<string>('');\n\n /**\n * Slots forwarded from a host that cannot project content — see the class comment. A card\n * reached through hand-written markup should use the structural directives instead.\n */\n iconTemplate = input<TemplateRef<any> | null>(null);\n captionTemplate = input<TemplateRef<any> | null>(null);\n actionsTemplate = input<TemplateRef<any> | null>(null);\n\n error = output<HttpErrorResponse>();\n rowClicked = output<QueryResultItem>();\n customActionExecuted = output<{ action: CustomActionDefinition }>();\n\n /**\n * Forwarded to the grid. Without this the escape hatch was unreachable from a card — i.e. from\n * every auto-rendered sub-query and program-unit query page, which is most grids.\n */\n rowRoute = input<((row: QueryResultItem) => unknown[] | null) | null>(null);\n\n colors = Color;\n\n private readonly iconSlots = contentChildren(SparkQueryIconDirective);\n private readonly captionSlots = contentChildren(SparkQueryCaptionDirective);\n private readonly actionSlots = contentChildren(SparkQueryActionsDirective);\n\n /**\n * The grid, read only to surface its state — the query, the actions, the selection — to this\n * component's own header.\n *\n * Optional rather than `required` on purpose. The header renders ABOVE the grid in this\n * template, so on the first change-detection pass the view query has not resolved yet and\n * `viewChild.required()` would throw where a plain one returns `undefined`. Everything below\n * therefore reads it defensively; the signal updates once the view initialises and the header\n * re-renders with the real query.\n *\n * A host reads grid state through a template reference variable instead, because a host may put\n * the grid behind an `@if`, where a view query genuinely is intermittently undefined.\n */\n protected readonly grid = viewChild(SparkQueryGridComponent);\n\n protected readonly query = computed(() => this.grid()?.query() ?? null);\n\n protected readonly iconTpl = computed(() =>\n slotFor(this.iconSlots(), this.query())?.templateRef ?? this.iconTemplate());\n\n protected readonly captionTpl = computed(() =>\n slotFor(this.captionSlots(), this.query())?.templateRef ?? this.captionTemplate());\n\n protected readonly actionsTpl = computed(() =>\n slotFor(this.actionSlots(), this.query())?.templateRef ?? this.actionsTemplate());\n\n /** The caption the card renders unless a slot replaces it. */\n protected readonly caption = computed(() => {\n const q = this.query();\n return (q?.description ? this.lang.resolve(q.description) : '') || q?.name || '';\n });\n\n protected readonly customActions = computed(() => this.grid()?.customActions() ?? []);\n protected readonly selection = computed(() => this.grid()?.selection() ?? []);\n}\n","<!--\n The card is always rendered. A host that wants no card uses <spark-query-grid> directly — which\n is what the old `showCard=\"false\"` meant, expressed as a component choice rather than a flag.\n-->\n<bs-card class=\"d-block my-3\">\n <bs-card-header>\n <div class=\"d-flex align-items-center gap-2\">\n @if (iconTpl(); as tpl) {\n <ng-container *ngTemplateOutlet=\"tpl; context: { $implicit: query() }\"></ng-container>\n }\n\n @if (actionsTpl(); as tpl) {\n <ng-container *ngTemplateOutlet=\"tpl; context: { $implicit: customActions(), selection: selection(), query: query() }\"></ng-container>\n } @else if (customActions().length) {\n <!-- The default: the actions the server declares for this type. The nav renders only when\n there are any, so a query without actions is pixel-identical to a plain caption.\n\n Disabled, not hidden: hiding makes the affordance undiscoverable and reflows the\n priority nav on every selection change. The server enforces the same rule. -->\n <bs-priority-nav [moreLabel]=\"lang.t('common.more')\" [collapseAt]=\"'sm'\">\n @for (action of customActions(); track action.name) {\n <button *bsPriorityNavItem=\"10 + action.offset\" class=\"btn btn-sm btn-outline-primary\"\n [disabled]=\"!grid()?.isActionEnabled(action)\" (click)=\"grid()?.onCustomAction(action)\">\n {{ action.displayName | resolveTranslation }}\n </button>\n }\n </bs-priority-nav>\n }\n\n <!--\n Caption last, actions first. The auto margin is conditional rather than fixed, and that is\n the point: with actions present `ms-auto` pushes the caption to the trailing edge, and with\n none it falls back to `me-auto` so a plain card looks exactly as it always did. A fixed\n `ms-auto` would have right-aligned the caption of every action-less query card in every app\n — a change nobody asked for, to fix a layout only some cards have.\n -->\n <span [class.ms-auto]=\"customActions().length\" [class.me-auto]=\"!customActions().length\">\n @if (captionTpl(); as tpl) {\n <ng-container *ngTemplateOutlet=\"tpl; context: { $implicit: caption(), query: query() }\"></ng-container>\n } @else {\n {{ caption() }}\n }\n </span>\n </div>\n </bs-card-header>\n\n <div class=\"p-3\">\n <spark-query-grid\n [queryId]=\"queryId()\"\n [parentId]=\"parentId()\"\n [parentType]=\"parentType()\"\n [reloadToken]=\"reloadToken()\"\n [data]=\"data()\"\n [search]=\"search()\"\n [rowRoute]=\"rowRoute()\"\n (error)=\"error.emit($event)\"\n (rowClicked)=\"rowClicked.emit($event)\"\n (customActionExecuted)=\"customActionExecuted.emit($event)\" />\n </div>\n</bs-card>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAUA;AACO,MAAM,qBAAqB,GAAG,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE;AAEhD;;;;;;AAMG;AACG,SAAU,qBAAqB,CA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AAA,CAAA,MAAA,uBAAuB,CAAA,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,eAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,UAAA,CAAA,MACpB,0BAA0B,CAAA,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,WAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,eAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,UAAA,CAAA,MAC3B,0BAA0B,mFAerC,uBAAuB,CAAA,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AE7F7D;;AAEG;;;;"}
|
|
@@ -46,12 +46,6 @@ var EReferenceDisplayType;
|
|
|
46
46
|
EReferenceDisplayType["Modal"] = "Modal";
|
|
47
47
|
})(EReferenceDisplayType || (EReferenceDisplayType = {}));
|
|
48
48
|
|
|
49
|
-
var ELookupDisplayType;
|
|
50
|
-
(function (ELookupDisplayType) {
|
|
51
|
-
ELookupDisplayType[ELookupDisplayType["Dropdown"] = 0] = "Dropdown";
|
|
52
|
-
ELookupDisplayType[ELookupDisplayType["Modal"] = 1] = "Modal";
|
|
53
|
-
})(ELookupDisplayType || (ELookupDisplayType = {}));
|
|
54
|
-
|
|
55
49
|
/**
|
|
56
50
|
* Flattens a nested `PersistentObject` into the plain `Record<string, any>` shape the
|
|
57
51
|
* form state uses throughout ng-spark. Primitive / reference attributes contribute their
|
|
@@ -222,6 +216,82 @@ function buildAttribute(attrDef, raw, resolve) {
|
|
|
222
216
|
return attr;
|
|
223
217
|
}
|
|
224
218
|
|
|
219
|
+
/**
|
|
220
|
+
* The value a row carries for a column, whatever shape the row is in — or `undefined` when it
|
|
221
|
+
* carries none.
|
|
222
|
+
*
|
|
223
|
+
* ```ts
|
|
224
|
+
* const isPrivate = valueFor(this.item(), 'IsPrivate')?.value === true;
|
|
225
|
+
* ```
|
|
226
|
+
*
|
|
227
|
+
* Always returns the **cell** rather than the bare value, because a reference cell is worth as much
|
|
228
|
+
* for its `objectId` as for its text, and a helper that discarded it would have to be replaced the
|
|
229
|
+
* first time a renderer wanted to link somewhere. `?.value` is the cost, once per call site.
|
|
230
|
+
*
|
|
231
|
+
* ⚠️ A value only reaches a grid row if its attribute is on the **query surface**. To read a sibling
|
|
232
|
+
* the grid does not draw, mark it `"showedOn": "Query", "isVisible": false` — shipped, not drawn. An
|
|
233
|
+
* attribute marked `"showedOn": "PersistentObject"` is absent from a row by design, and this returns
|
|
234
|
+
* `undefined` for it; that is the first thing to check when a sibling read comes back empty.
|
|
235
|
+
*/
|
|
236
|
+
function valueFor(item, columnName) {
|
|
237
|
+
if (!item)
|
|
238
|
+
return undefined;
|
|
239
|
+
if (isQueryRow(item)) {
|
|
240
|
+
return item.values.find(v => v.key === columnName);
|
|
241
|
+
}
|
|
242
|
+
if (isPersistentObject(item)) {
|
|
243
|
+
const attribute = item.attributes.find(a => a.name === columnName);
|
|
244
|
+
if (!attribute)
|
|
245
|
+
return undefined;
|
|
246
|
+
return {
|
|
247
|
+
key: attribute.name,
|
|
248
|
+
value: attribute.value,
|
|
249
|
+
// A single reference's value IS the target's id, which is what the row shape carries
|
|
250
|
+
// separately. Deriving it here keeps a renderer from having to know that.
|
|
251
|
+
objectId: attribute.dataType === 'Reference' && !attribute.isArray && attribute.value != null
|
|
252
|
+
? String(attribute.value)
|
|
253
|
+
: undefined,
|
|
254
|
+
breadcrumb: attribute.breadcrumb,
|
|
255
|
+
breadcrumbs: attribute.breadcrumbs,
|
|
256
|
+
};
|
|
257
|
+
}
|
|
258
|
+
const record = item;
|
|
259
|
+
if (!(columnName in record))
|
|
260
|
+
return undefined;
|
|
261
|
+
const value = record[columnName];
|
|
262
|
+
// The flat row's side channel is populated only for single references, so its presence for this
|
|
263
|
+
// key is what identifies one — the record itself carries no dataType to ask.
|
|
264
|
+
const breadcrumb = record[AS_DETAIL_BREADCRUMBS_KEY]?.[columnName];
|
|
265
|
+
return {
|
|
266
|
+
key: columnName,
|
|
267
|
+
value,
|
|
268
|
+
objectId: breadcrumb !== undefined && value != null ? String(value) : undefined,
|
|
269
|
+
breadcrumb,
|
|
270
|
+
};
|
|
271
|
+
}
|
|
272
|
+
/**
|
|
273
|
+
* Whether this row is a query result item.
|
|
274
|
+
*
|
|
275
|
+
* Discriminated on the *elements*, not just on `Array.isArray(values)`: a flat AsDetail record may
|
|
276
|
+
* legitimately have a column named `values` holding an array, and mistaking one for the other would
|
|
277
|
+
* silently read the wrong thing.
|
|
278
|
+
*/
|
|
279
|
+
function isQueryRow(row) {
|
|
280
|
+
const values = row?.values;
|
|
281
|
+
return Array.isArray(values) && (values.length === 0 || typeof values[0]?.key === 'string');
|
|
282
|
+
}
|
|
283
|
+
/** Whether this row is a full persistent object. Discriminated on elements, as above. */
|
|
284
|
+
function isPersistentObject(row) {
|
|
285
|
+
const attributes = row?.attributes;
|
|
286
|
+
return Array.isArray(attributes) && (attributes.length === 0 || typeof attributes[0]?.name === 'string');
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
var ELookupDisplayType;
|
|
290
|
+
(function (ELookupDisplayType) {
|
|
291
|
+
ELookupDisplayType[ELookupDisplayType["Dropdown"] = 0] = "Dropdown";
|
|
292
|
+
ELookupDisplayType[ELookupDisplayType["Modal"] = 1] = "Modal";
|
|
293
|
+
})(ELookupDisplayType || (ELookupDisplayType = {}));
|
|
294
|
+
|
|
225
295
|
/**
|
|
226
296
|
* The custom actions a query should offer, from the entity type's full set.
|
|
227
297
|
*
|
|
@@ -521,5 +591,5 @@ function toNumber(value) {
|
|
|
521
591
|
* Generated bundle index. Do not edit.
|
|
522
592
|
*/
|
|
523
593
|
|
|
524
|
-
export { AS_DETAIL_BREADCRUMBS_KEY, AS_DETAIL_SELF_BREADCRUMB_KEY, ELookupDisplayType, EReferenceDisplayType, ShowedOn, applyOverlay, currentLanguage, dictToNestedPo, evaluateRules, filterQueryActions, hasShowedOnFlag, mergeRefreshValues, nestedPoToDict, nestedPoToDisplayRow, overlayFromResponse, parseSelectionRule, resolveTranslation, selectionModeFor, selfBreadcrumb };
|
|
594
|
+
export { AS_DETAIL_BREADCRUMBS_KEY, AS_DETAIL_SELF_BREADCRUMB_KEY, ELookupDisplayType, EReferenceDisplayType, ShowedOn, applyOverlay, currentLanguage, dictToNestedPo, evaluateRules, filterQueryActions, hasShowedOnFlag, isPersistentObject, isQueryRow, mergeRefreshValues, nestedPoToDict, nestedPoToDisplayRow, overlayFromResponse, parseSelectionRule, resolveTranslation, selectionModeFor, selfBreadcrumb, valueFor };
|
|
525
595
|
//# sourceMappingURL=mintplayer-ng-spark-models.mjs.map
|