@memberjunction/ng-entity-viewer 6.2.0-edge.6 → 6.2.0-edge.8

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.
Files changed (40) hide show
  1. package/dist/lib/entity-data-grid/entity-data-grid.component.d.ts +99 -2
  2. package/dist/lib/entity-data-grid/entity-data-grid.component.d.ts.map +1 -1
  3. package/dist/lib/entity-data-grid/entity-data-grid.component.js +619 -272
  4. package/dist/lib/entity-data-grid/entity-data-grid.component.js.map +1 -1
  5. package/dist/lib/entity-data-grid/open-in-excel.d.ts +40 -0
  6. package/dist/lib/entity-data-grid/open-in-excel.d.ts.map +1 -0
  7. package/dist/lib/entity-data-grid/open-in-excel.js +60 -0
  8. package/dist/lib/entity-data-grid/open-in-excel.js.map +1 -0
  9. package/dist/lib/entity-record-detail-panel/entity-record-detail-panel.component.d.ts +40 -0
  10. package/dist/lib/entity-record-detail-panel/entity-record-detail-panel.component.d.ts.map +1 -1
  11. package/dist/lib/entity-record-detail-panel/entity-record-detail-panel.component.js +72 -8
  12. package/dist/lib/entity-record-detail-panel/entity-record-detail-panel.component.js.map +1 -1
  13. package/dist/lib/entity-viewer/entity-viewer.component.d.ts +13 -1
  14. package/dist/lib/entity-viewer/entity-viewer.component.d.ts.map +1 -1
  15. package/dist/lib/entity-viewer/entity-viewer.component.js +35 -5
  16. package/dist/lib/entity-viewer/entity-viewer.component.js.map +1 -1
  17. package/dist/lib/utils/record.util.d.ts +23 -0
  18. package/dist/lib/utils/record.util.d.ts.map +1 -1
  19. package/dist/lib/utils/record.util.js +34 -0
  20. package/dist/lib/utils/record.util.js.map +1 -1
  21. package/dist/lib/view-config-panel/view-config-panel.component.d.ts +34 -5
  22. package/dist/lib/view-config-panel/view-config-panel.component.d.ts.map +1 -1
  23. package/dist/lib/view-config-panel/view-config-panel.component.js +158 -56
  24. package/dist/lib/view-config-panel/view-config-panel.component.js.map +1 -1
  25. package/dist/lib/view-selector/view-selector.component.d.ts +7 -1
  26. package/dist/lib/view-selector/view-selector.component.d.ts.map +1 -1
  27. package/dist/lib/view-selector/view-selector.component.js +134 -119
  28. package/dist/lib/view-selector/view-selector.component.js.map +1 -1
  29. package/dist/lib/view-types/renderers/grid-view-renderer.component.d.ts +7 -1
  30. package/dist/lib/view-types/renderers/grid-view-renderer.component.d.ts.map +1 -1
  31. package/dist/lib/view-types/renderers/grid-view-renderer.component.js +13 -3
  32. package/dist/lib/view-types/renderers/grid-view-renderer.component.js.map +1 -1
  33. package/dist/lib/view-types/view-type.contracts.d.ts +6 -0
  34. package/dist/lib/view-types/view-type.contracts.d.ts.map +1 -1
  35. package/dist/lib/view-types/view-type.contracts.js.map +1 -1
  36. package/dist/lib/view-workspace/view-workspace.component.d.ts +20 -0
  37. package/dist/lib/view-workspace/view-workspace.component.d.ts.map +1 -1
  38. package/dist/lib/view-workspace/view-workspace.component.js +104 -19
  39. package/dist/lib/view-workspace/view-workspace.component.js.map +1 -1
  40. package/package.json +23 -22
@@ -1 +1 @@
1
- {"version":3,"file":"grid-view-renderer.component.js","sourceRoot":"","sources":["../../../../src/lib/view-types/renderers/grid-view-renderer.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,iBAAiB,EAAE,SAAS,EAAE,iBAAiB,EAAa,MAAM,EAAE,MAAM,eAAe,CAAC;AAC3I,OAAO,EAA6B,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAEtH,OAAO,EACL,uBAAuB,GAIxB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAQrE,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;;;;;;;;;;;IA+IrE,oDAMC;IADC,AADA,4NAAY,uCA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ewChild, ChangeDetectorRef, OnDestroy, inject } from '@angular/core';\nimport { EntityInfo, RunViewParams, LogError, CompositeKey, RunView, RecordMergeRequest } from '@memberjunction/core';\nimport { ExportColumn } from '@memberjunction/export-engine';\nimport {\n RecordComparisonService,\n type FieldComparison,\n type MergeConfig,\n type MergeConfirmedEvent,\n} from '@memberjunction/ng-record-merge';\nimport { UUIDsEqual } from '@memberjunction/global';\nimport { BaseAngularComponent } from '@memberjunction/ng-base-types';\nimport { PageChangeEvent } from '@memberjunction/ng-pagination';\nimport { ListManagementDialogConfig, ListManagementResult } from '@memberjunction/ng-list-management';\nimport { IViewRenderer, ViewDataRequest, ViewRelatedRecordNavigation } from '../view-type.contracts';\nimport { ViewGridState } from '../../types';\nimport { GridSelectionMode, GridToolbarConfig, ForeignKeyClickEvent } from '../../entity-data-grid/models/grid-types';\nimport { AfterRowClickEventArgs, AfterRowDoubleClickEventArgs, AfterSortEventArgs } from '../../entity-data-grid/events/grid-events';\nimport { GridStateChangedEvent } from '../../types';\nimport { BuildPkString, BuildCompositeKey } from '../../utils/record.util';\nimport { EntityDataGridComponent } from '../../entity-data-grid/entity-data-grid.component';\n\n/**\n * Opaque per-view configuration for the Grid view type.\n * -----------------------------------------------------\n * This is the blob the host persists verbatim against the active `ViewTypeID` and never\n * inspects (see {@link IViewRenderer.configChanged}). The renderer seeds the\n * `<mj-entity-data-grid>` bindings from these fields, applying sensible defaults when a\n * field is absent (see {@link GridViewRendererComponent}). It is intentionally a plain,\n * fully-serializable shape — every field is optional so an empty `{}` is a valid config.\n */\nexport interface GridViewConfig {\n /**\n * Persisted grid state (columns/widths/order/sort) from a User View. Mutated in place when\n * the grid emits sort or generic grid-state changes, then surfaced via `configChanged` so the\n * host persists it. Fed straight into `[GridState]`.\n */\n gridState?: ViewGridState;\n /** Whether the grid's own toolbar is shown. Defaults to `true` when absent. */\n showToolbar?: boolean;\n /** The grid toolbar configuration. Fed into `[ToolbarConfig]`. */\n toolbarConfig?: GridToolbarConfig;\n /** Row selection mode. Defaults to `'checkbox'` when absent. */\n selectionMode?: GridSelectionMode;\n /** Whether the \"Add to List\" button is shown. Defaults to `true` when absent. */\n showAddToListButton?: boolean;\n /** Whether the pager is shown. Defaults to `true` when absent. */\n showPager?: boolean;\n /** Page size for the grid's pager. Falls back to the `pageSize` input when absent. */\n pageSize?: number;\n /**\n * Explicit RunViewParams for the grid's data source. When absent the renderer builds a minimal\n * dynamic-view params object from {@link entity}. Fed into `[Params]`.\n */\n params?: RunViewParams;\n}\n\n/**\n * GridViewRendererComponent\n * -------------------------\n * The Grid **view type** renderer — a fully self-contained {@link IViewRenderer} adapter that hosts\n * the existing {@link EntityDataGridComponent} (`<mj-entity-data-grid>`) inside the entity-viewer's\n * pluggable view-type system. It is the dynamic-mounted plug-in that the `GridViewType` descriptor\n * points at.\n *\n * **Architectural intent — the container knows nothing about grids, and grid *features* never bubble\n * up.** The host (entity-viewer) binds only the generic {@link IViewRenderer} surface: the core\n * inputs (`entity` / `provider` / `records` / `selectedRecordId` / `filterText` / `config`), the\n * generic data-context inputs (`totalRecordCount` / `page` / `pageSize` / `isLoading`), and a small\n * set of generic outputs. There is **no opaque `hostAction` channel** — everything a grid does is\n * resolved through one of these three categories:\n *\n * 1. **Self-contained (owned end-to-end — never bubbles up):**\n * - **Export** → owned entirely by `<mj-entity-data-grid>` itself (its `onExportClick` opens its\n * OWN export dialog with format/sampling via `ExportService`). This wrapper does NOT host an\n * export dialog — doing so produced two stacked dialogs.\n * - **Add to List** → hosts `<mj-list-management-dialog>` ({@link ListManagementModule}). On\n * `(AddToListRequested)` the wrapper builds a {@link ListManagementDialogConfig} from the\n * entity + selected records and opens the dialog.\n * - **Delete** → hosts the Generic `<mj-ev-confirm-dialog>` (from {@link EntityViewerModule}).\n * On `(DeleteButtonClick)` the wrapper confirms, deletes via the MJ entity layer, then\n * re-requests data so the host reloads the current page.\n * - **Refresh** → on `(RefreshButtonClick)` the wrapper re-emits {@link dataRequest} so the host\n * reloads. No feature event leaves the wrapper.\n * - **Selection** → kept INTERNAL; it only drives the wrapper's own add-to-list. Never bubbles.\n *\n * 2. **Navigation (the ONLY legitimate upward signals — routing lives in the outer app):**\n * - Row double-click → {@link recordOpened}.\n * - Foreign-key cell click `(ForeignKeyClick)` → {@link openRelatedRecordRequested}.\n * - New button `(NewButtonClick)` → {@link createRecordRequested}.\n *\n * 3. **Container ↔ plug-in generic coordination (NOT outer-app signals):**\n * - Sort `(AfterSort)` → {@link dataRequest} (`sort`) + persisted into `config.gridState` via\n * {@link configChanged}.\n * - Pager `(PageChange)` → {@link dataRequest} (`page` / `pageSize`).\n * - Generic grid-state `(GridStateChanged)` → merged into `config.gridState` + {@link configChanged}.\n *\n * **Seeding the grid from `config` with defaults:** absent config fields fall back to sensible\n * defaults so a brand-new view (`config === {}`) renders a fully-functional grid — toolbar on,\n * checkbox selection, add-to-list on, pager on. The grid never loads its own data\n * (`[AllowLoad]=\"false\"`) — the host owns the fetch.\n *\n * This is an NgModule-declared (`standalone: false`) component, declared in `EntityViewerModule`.\n * It renders `<mj-entity-data-grid>` + the Generic `<mj-list-management-dialog>` / `<mj-ev-confirm-dialog>`\n * straight from the module's compilation scope (the module imports `ListManagementModule` and declares\n * the grid + confirm dialog; the grid component brings its own export dialog) — so there's\n * no `imports` array and, crucially, no self-import of `EntityViewerModule`: the module loads the\n * view-type descriptors, which reference these wrappers, so a wrapper importing the module back would\n * form a runtime import cycle (NG0919).\n *\n * Inputs use the camelCase names mandated by the {@link IViewRenderer} contract (the host binds them\n * by those exact names via `setInput`), rather than MJ's usual PascalCase for public members —\n * mirroring the Cards and Cluster renderers.\n */\n@Component({\n standalone: false,\n selector: 'mj-grid-view-renderer',\n encapsulation: ViewEncapsulation.None,\n template: `\n <mj-entity-data-grid\n #grid\n [Provider]=\"Provider\"\n [Data]=\"records\"\n [ExportDataProvider]=\"exportDataProvider\"\n [Params]=\"effectiveParams\"\n [FilterText]=\"filterText ?? ''\"\n [GridState]=\"config.gridState ?? null\"\n [Height]=\"'auto'\"\n [AllowLoad]=\"false\"\n [AutoLoadEntityActions]=\"AutoLoadEntityActions\"\n [ShowToolbar]=\"effectiveShowToolbar\"\n [ShowSearch]=\"effectiveShowSearch\"\n [ToolbarConfig]=\"config.toolbarConfig ?? {}\"\n [SelectionMode]=\"effectiveSelectionMode\"\n [ShowAddToListButton]=\"effectiveShowAddToListButton\"\n [ShowPager]=\"effectiveShowPager\"\n [PageSize]=\"effectivePageSize\"\n [TotalRowCount]=\"totalRecordCount ?? 0\"\n [PagerPageNumber]=\"page ?? 1\"\n (AfterRowClick)=\"onAfterRowClick($event)\"\n (AfterRowDoubleClick)=\"onAfterRowDoubleClick($event)\"\n (AfterSort)=\"onAfterSort($event)\"\n (GridStateChanged)=\"onGridStateChanged($event)\"\n (SelectionChange)=\"onSelectionChange($event)\"\n (NewButtonClick)=\"onNewButtonClick()\"\n (RefreshButtonClick)=\"onRefreshButtonClick()\"\n (DeleteButtonClick)=\"onDeleteButtonClick($event)\"\n (AddToListRequested)=\"onAddToListRequested($event)\"\n (ForeignKeyClick)=\"onForeignKeyClick($event)\"\n (PageChange)=\"onPageChange($event)\"\n (ManageColumnsRequested)=\"configureRequested.emit()\"\n [ShowMergeButton]=\"effectiveShowMergeButton\"\n (MergeRecordsRequested)=\"onMergeRequested($event)\"\n >\n </mj-entity-data-grid>\n\n <!-- NOTE: Export is NOT handled here — mj-entity-data-grid hosts its OWN export dialog\n (its onExportClick opens it with formats/sampling via ExportService). Adding a second\n dialog here produced two stacked export dialogs. The grid owns export self-contained. -->\n\n <!-- Self-contained Add-to-List dialog (Generic) — owned by this wrapper, never bubbles up. -->\n @if (listManagementConfig) {\n <mj-list-management-dialog\n [Provider]=\"Provider\"\n [visible]=\"showListManagementDialog\"\n [config]=\"listManagementConfig\"\n (complete)=\"onListManagementComplete($event)\"\n (cancel)=\"onListManagementCancel()\"\n >\n </mj-list-management-dialog>\n }\n\n <!-- Self-contained Delete confirmation (Generic) — owned by this wrapper, never bubbles up. -->\n <mj-ev-confirm-dialog\n [IsOpen]=\"showDeleteConfirm\"\n Title=\"Delete Records\"\n [Message]=\"deleteConfirmMessage\"\n DetailMessage=\"This action cannot be undone.\"\n ConfirmText=\"Delete\"\n ConfirmStyle=\"danger\"\n Icon=\"fa-solid fa-trash\"\n (Confirmed)=\"onDeleteConfirmed()\"\n (Cancelled)=\"onDeleteCancelled()\"\n >\n </mj-ev-confirm-dialog>\n\n <!-- Self-contained merge panel (Generic) — owned by this wrapper, never bubbles up.\n Lives inside the @if so the panel rebuilds its comparison (ngOnInit) per request. -->\n @if (mergeState) {\n <mj-dialog [Visible]=\"true\" Size=\"lg\" [Closeable]=\"!mergeState.IsMerging\" (Close)=\"onMergeCancelled()\">\n <div class=\"mj-ev-merge-survivor\" role=\"radiogroup\" aria-label=\"Record to keep\">\n <span>Keep</span>\n <button type=\"button\" mjButton size=\"sm\" role=\"radio\"\n [variant]=\"mergeState.Config.SurvivorSide === 'left' ? 'primary' : 'secondary'\"\n [attr.aria-checked]=\"mergeState.Config.SurvivorSide === 'left'\"\n [disabled]=\"mergeState.IsMerging\"\n (click)=\"onSurvivorChange('left')\">{{ mergeState.Config.LeftLabel }}</button>\n <button type=\"button\" mjButton size=\"sm\" role=\"radio\"\n [variant]=\"mergeState.Config.SurvivorSide === 'right' ? 'primary' : 'secondary'\"\n [attr.aria-checked]=\"mergeState.Config.SurvivorSide === 'right'\"\n [disabled]=\"mergeState.IsMerging\"\n (click)=\"onSurvivorChange('right')\">{{ mergeState.Config.RightLabel }}</button>\n <span class=\"mj-ev-merge-survivor-note\">{{ mergeLoserLabel }} will be deleted; its linked records move to the record you keep.</span>\n </div>\n <mj-record-merge-panel\n [Fields]=\"mergeState.Fields\"\n [Config]=\"mergeState.Config\"\n [MergeEnabled]=\"!mergeState.IsMerging\"\n [IsMerging]=\"mergeState.IsMerging\"\n (MergeConfirmed)=\"onMergeConfirmed($event)\"\n (MergeCancelled)=\"onMergeCancelled()\"\n >\n </mj-record-merge-panel>\n @if (mergeState.DependencyNote) {\n <p class=\"mj-ev-merge-deps\">{{ mergeState.DependencyNote }}</p>\n }\n </mj-dialog>\n }\n @if (mergeNotice) {\n <div class=\"mj-ev-merge-notice\" role=\"status\">\n <span class=\"mj-ev-merge-notice-text\">{{ mergeNotice }}</span>\n <button type=\"button\" class=\"mj-ev-merge-notice-dismiss\" (click)=\"onDismissMergeNotice()\" title=\"Dismiss\" aria-label=\"Dismiss\">\n <i class=\"fa-solid fa-xmark\"></i>\n </button>\n </div>\n }\n `,\n styles: [\n `\n :host {\n display: block;\n height: 100%;\n }\n\n .mj-ev-merge-survivor {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: 8px;\n margin-bottom: 12px;\n font-size: var(--mj-text-sm);\n color: var(--mj-text-secondary);\n }\n\n .mj-ev-merge-survivor-note {\n color: var(--mj-text-muted);\n }\n\n .mj-ev-merge-deps {\n margin: 0;\n font-size: var(--mj-text-xs);\n color: var(--mj-text-muted);\n }\n\n .mj-ev-merge-notice {\n position: fixed;\n bottom: 16px;\n left: 50%;\n transform: translateX(-50%);\n z-index: 1001;\n padding: 8px 14px;\n border: 1px solid var(--mj-border-subtle);\n border-radius: var(--mj-radius-md);\n background: var(--mj-bg-surface-elevated);\n color: var(--mj-text-primary);\n font-size: var(--mj-text-sm);\n box-shadow: var(--mj-shadow-md);\n display: flex;\n align-items: center;\n gap: 10px;\n }\n\n .mj-ev-merge-notice-dismiss {\n flex-shrink: 0;\n background: none;\n border: none;\n padding: 0 2px;\n cursor: pointer;\n color: var(--mj-text-muted);\n font-size: var(--mj-text-sm);\n line-height: 1;\n }\n\n .mj-ev-merge-notice-dismiss:hover {\n color: var(--mj-text-primary);\n }\n `,\n ],\n})\nexport class GridViewRendererComponent extends BaseAngularComponent implements IViewRenderer<GridViewConfig>, OnDestroy {\n /** Change detection ref used to flush dialog visibility toggles driven by grid events. */\n private cdr = inject(ChangeDetectorRef);\n\n // ---- IViewRenderer core inputs (camelCase per the host contract) ----\n\n /** The entity whose records are being rendered. Used to build default params + resolve selection. */\n @Input() entity: EntityInfo | null = null;\n\n /** The records to render (already loaded / filtered / paged by the host). Fed into `[Data]`. */\n @Input() records: Record<string, unknown>[] = [];\n\n /**\n * Optional full-result-set fetcher supplied by the host, forwarded to the grid's ExportDataProvider\n * so exports cover every matching row rather than just the loaded page (bug C1).\n */\n @Input() ExportDataProvider: (() => Promise<Record<string, unknown>[]>) | null = null;\n\n /** @deprecated Use {@link ExportDataProvider}. */\n @Input() set exportDataProvider(value: (() => Promise<Record<string, unknown>[]>) | null) {\n this.ExportDataProvider = value;\n }\n /** @deprecated Use {@link ExportDataProvider}. */\n get exportDataProvider(): (() => Promise<Record<string, unknown>[]>) | null {\n return this.ExportDataProvider;\n }\n\n /** Primary-key string of the currently selected record, if any. */\n @Input() selectedRecordId: string | null = null;\n\n /** Active filter text — passed through for the grid's cell highlighting. */\n @Input() filterText: string | null = null;\n\n /** Opaque per-view configuration. Seeds the grid bindings; mutated + re-emitted on grid changes. */\n @Input() config: GridViewConfig = {};\n\n /**\n * When true (default), the grid self-loads the entity's active EntityActions and shows them — buttons\n * appear only for entities that actually have actions (data-driven). Actions whose invocation names a\n * `RuntimeUXDriverClass` mount that interactive driver (e.g. the Record Process runner) in-place.\n */\n @Input() AutoLoadEntityActions = true;\n\n // ---- IViewRenderer generic data-context inputs ----\n\n /** Total record count across all pages, for the grid's pager. Fed into `[TotalRowCount]`. */\n @Input() totalRecordCount?: number;\n\n /** One-based current page the host is showing. Fed into `[PagerPageNumber]` (already 1-based). */\n @Input() page?: number;\n\n /** Page size the host is using — fallback when `config.pageSize` is absent. */\n @Input() pageSize?: number;\n\n /** Whether the host is currently (re)loading the record set. Accepted per contract; unused here. */\n @Input() isLoading?: boolean;\n\n /** Active alternate base view semantic name pushed by the host, forwarded into `EffectiveParams`. */\n @Input() alternateBaseView: string | null = null;\n\n // ---- IViewRenderer outputs (generic + navigation channels only) ----\n\n /** Emitted when a row is single-clicked — payload is the raw record object (host builds the key). */\n @Output() recordSelected = new EventEmitter<unknown>();\n\n /** Emitted when a row is double-clicked — payload is the raw record object (host builds the key). */\n @Output() recordOpened = new EventEmitter<unknown>();\n\n /** Emitted when this renderer mutates its opaque {@link config} (sort / grid-state persistence). */\n @Output() configChanged = new EventEmitter<GridViewConfig>();\n\n /** Generic data-access channel: ask the host to re-load with different sort / page. */\n @Output() dataRequest = new EventEmitter<ViewDataRequest>();\n\n /**\n * Ask the host to open this view's configuration UI. Raised when the grid emits\n * `ManageColumnsRequested` (its \"Manage Columns\" toolbar affordance). Part of the generic\n * {@link IViewRenderer} contract; the container forwards it to the workspace, which opens the\n * config panel (Columns tab) — the canonical column editor.\n */\n @Output() configureRequested = new EventEmitter<void>();\n\n /**\n * NAVIGATION: open a related record on a (possibly different) entity from a foreign-key cell click.\n * Routing lives in the outer app, so this is one of the few signals that legitimately bubbles up.\n */\n @Output() openRelatedRecordRequested = new EventEmitter<ViewRelatedRecordNavigation>();\n\n /** NAVIGATION: create a new record of the current entity (grid \"New\" button). Bubbles up for routing. */\n @Output() createRecordRequested = new EventEmitter<void>();\n\n /**\n * Reference to the hosted grid. Currently only retained for parity / future selection resolution;\n * selection is mapped from the {@link records} input rather than read from the grid, per contract.\n */\n @ViewChild('grid') protected grid?: EntityDataGridComponent;\n\n /**\n * IMPERATIVE export entry point ({@link IViewRenderer.exportRecords}). Lets the host trigger\n * an export programmatically (ultimately for the AI agent) by delegating to the hosted grid's\n * self-contained {@link EntityDataGridComponent.Export} (which downloads the file). The grid's\n * toolbar export button remains the interactive path; this is the no-UI equivalent.\n *\n * @param format optional output format; the grid defaults to 'excel' when omitted.\n * @returns true when the export succeeded, false when the grid isn't ready or the export failed.\n */\n async exportRecords(format?: 'csv' | 'excel' | 'json'): Promise<boolean> {\n if (!this.grid) {\n return false;\n }\n const result = await this.grid.Export(format ? { format } : undefined, true);\n return !!result?.success;\n }\n\n /** The hosted grid's on-screen columns ({@link IViewRenderer.GetExportColumns}); empty before it mounts. */\n GetExportColumns(): ExportColumn[] {\n return this.grid?.GetExportColumns() ?? [];\n }\n\n // ================================================================\n // Self-contained dialog state (never surfaced to the host)\n // ================================================================\n // NOTE: Export has no state here — mj-entity-data-grid owns its export dialog.\n\n /** Whether the add-to-list dialog is visible. Toggled internally by {@link onAddToListRequested}. */\n protected showListManagementDialog = false;\n\n /** Config fed into `<mj-list-management-dialog>`. Built from the entity + selected records. */\n protected listManagementConfig: ListManagementDialogConfig | null = null;\n\n /** Whether the delete-confirmation dialog is visible. Toggled internally by {@link onDeleteButtonClick}. */\n protected showDeleteConfirm = false;\n\n /** Records staged for deletion while the confirm dialog is open. */\n private pendingDeleteRecords: Record<string, unknown>[] = [];\n\n /** Dynamic message for the delete-confirmation dialog (reflects the staged record count). */\n protected deleteConfirmMessage = 'Are you sure you want to delete the selected records?';\n\n // ================================================================\n // Effective binding accessors — seed grid inputs from config + defaults\n // ================================================================\n\n /** Effective toolbar visibility — defaults to `true` when not set in config. */\n get EffectiveShowToolbar(): boolean {\n return this.config.showToolbar ?? true;\n }\n\n /** @deprecated Use {@link EffectiveShowToolbar}. */\n get effectiveShowToolbar(): boolean {\n return this.EffectiveShowToolbar;\n }\n\n /**\n * Grid search defaults OFF when hosted in entity-viewer. The container already owns\n * `filterText` (\"Filter records...\"). Opt in with `toolbarConfig.showSearch: true`.\n */\n get EffectiveShowSearch(): boolean {\n return this.config.toolbarConfig?.showSearch ?? false;\n }\n\n /** @deprecated Use {@link EffectiveShowSearch}. */\n get effectiveShowSearch(): boolean {\n return this.EffectiveShowSearch;\n }\n\n /** Effective selection mode — defaults to `'checkbox'` when not set in config. */\n get EffectiveSelectionMode(): GridSelectionMode {\n return this.config.selectionMode ?? 'checkbox';\n }\n\n /** @deprecated Use {@link EffectiveSelectionMode}. */\n get effectiveSelectionMode(): GridSelectionMode {\n return this.EffectiveSelectionMode;\n }\n\n /** Effective add-to-list button visibility — defaults to `true` when not set in config. */\n get EffectiveShowAddToListButton(): boolean {\n return this.config.showAddToListButton ?? true;\n }\n\n /** @deprecated Use {@link EffectiveShowAddToListButton}. */\n get effectiveShowAddToListButton(): boolean {\n return this.EffectiveShowAddToListButton;\n }\n\n /** Effective pager visibility — defaults to `true` when not set in config. */\n get EffectiveShowPager(): boolean {\n return this.config.showPager ?? true;\n }\n\n /** @deprecated Use {@link EffectiveShowPager}. */\n get effectiveShowPager(): boolean {\n return this.EffectiveShowPager;\n }\n\n /** Effective page size — config wins, else the generic `pageSize` input, else the grid's own default. */\n get EffectivePageSize(): number {\n return this.config.pageSize ?? this.pageSize ?? 100;\n }\n\n /** @deprecated Use {@link EffectivePageSize}. */\n get effectivePageSize(): number {\n return this.EffectivePageSize;\n }\n\n /**\n * Effective RunViewParams for the grid. Uses `config.params` when supplied; otherwise builds a\n * minimal dynamic-view params object from {@link entity}. Returns `null` when no entity is known\n * yet (the grid renders empty until the host provides one).\n */\n get EffectiveParams(): RunViewParams | null {\n if (this.config.params) {\n return this.alternateBaseView && !this.config.params.AlternateBaseView\n ? { ...this.config.params, AlternateBaseView: this.alternateBaseView }\n : this.config.params;\n }\n if (this.entity) {\n return {\n EntityName: this.entity.Name,\n ...(this.alternateBaseView ? { AlternateBaseView: this.alternateBaseView } : {}),\n };\n }\n return null;\n }\n\n /** @deprecated Use {@link EffectiveParams}. */\n get effectiveParams(): RunViewParams | null {\n return this.EffectiveParams;\n }\n\n // ================================================================\n // Navigation + generic coordination output mapping\n // ================================================================\n\n /**\n * Row single-click → {@link recordSelected}. Extracts the raw record (`event.row`) so the host\n * builds the composite key itself, matching the other renderers.\n */\n OnAfterRowClick(event: AfterRowClickEventArgs): void {\n if (event.row) {\n this.recordSelected.emit(event.row);\n }\n }\n\n /** @deprecated Use {@link OnAfterRowClick}. */\n onAfterRowClick(event: AfterRowClickEventArgs): void {\n return this.OnAfterRowClick(event);\n }\n\n /** Row double-click → {@link recordOpened} (NAVIGATION), emitting the raw record object. */\n OnAfterRowDoubleClick(event: AfterRowDoubleClickEventArgs): void {\n if (event.row) {\n this.recordOpened.emit(event.row);\n }\n }\n\n /** @deprecated Use {@link OnAfterRowDoubleClick}. */\n onAfterRowDoubleClick(event: AfterRowDoubleClickEventArgs): void {\n return this.OnAfterRowDoubleClick(event);\n }\n\n /**\n * Sort change → both generic coordination channels:\n * 1. {@link dataRequest} with the generic `sort` shape so the host re-loads with a new OrderBy.\n * 2. persists the sort into `config.gridState.sortSettings` and emits {@link configChanged} so\n * the grid's sort survives view reloads via the opaque config channel.\n */\n OnAfterSort(event: AfterSortEventArgs): void {\n const sort = (event.newSortState ?? []).map((s) => ({ field: s.field, direction: s.direction }));\n this.dataRequest.emit({ sort });\n\n const gridState: ViewGridState = { ...(this.config.gridState ?? {}) };\n gridState.sortSettings = (event.newSortState ?? []).map((s) => ({ field: s.field, dir: s.direction }));\n this.config = { ...this.config, gridState };\n this.configChanged.emit(this.config);\n }\n\n /** @deprecated Use {@link OnAfterSort}. */\n onAfterSort(event: AfterSortEventArgs): void {\n return this.OnAfterSort(event);\n }\n\n /**\n * Generic grid-state change (column resize / reorder / visibility) → merge the grid's updated\n * {@link ViewGridState} into the opaque config and emit {@link configChanged}; the host persists\n * the blob verbatim. No `dataRequest` here — column changes don't alter the loaded record set.\n */\n OnGridStateChanged(event: GridStateChangedEvent): void {\n this.config = { ...this.config, gridState: event.gridState };\n this.configChanged.emit(this.config);\n }\n\n /** @deprecated Use {@link OnGridStateChanged}. */\n onGridStateChanged(event: GridStateChangedEvent): void {\n return this.OnGridStateChanged(event);\n }\n\n /**\n * Selection change → kept INTERNAL. The grid drives its own add-to-list from the selection, so the\n * wrapper has no need to surface it. We intentionally do not bubble selection anywhere.\n */\n OnSelectionChange(_selectedKeys: string[]): void {\n // No-op: selection is internal to the grid + this wrapper's add-to-list. It never bubbles up.\n }\n\n /** @deprecated Use {@link OnSelectionChange}. */\n onSelectionChange(_selectedKeys: string[]): void {\n return this.OnSelectionChange(_selectedKeys);\n }\n\n /**\n * Foreign-key link click → {@link openRelatedRecordRequested} (NAVIGATION). Maps the grid's\n * {@link ForeignKeyClickEvent} (which carries the related entity + the FK value) onto the generic\n * {@link ViewRelatedRecordNavigation} the container forwards to the outer app for routing. The\n * related entity name is taken from the event when present, else resolved from the metadata by ID.\n */\n OnForeignKeyClick(event: ForeignKeyClickEvent): void {\n const entityName = event.relatedEntityName ?? this.resolveEntityNameById(event.relatedEntityId);\n if (!entityName) {\n return;\n }\n this.openRelatedRecordRequested.emit({ entityName, recordKey: event.recordId });\n }\n\n /** @deprecated Use {@link OnForeignKeyClick}. */\n onForeignKeyClick(event: ForeignKeyClickEvent): void {\n return this.OnForeignKeyClick(event);\n }\n\n /** New button → {@link createRecordRequested} (NAVIGATION) — opening the create form is routing. */\n OnNewButtonClick(): void {\n this.createRecordRequested.emit();\n }\n\n /** @deprecated Use {@link OnNewButtonClick}. */\n onNewButtonClick(): void {\n return this.OnNewButtonClick();\n }\n\n /**\n * Pager navigation → generic {@link dataRequest}. Maps the grid's {@link PageChangeEvent}\n * (`PageNumber` is already 1-based, `PageSize`) onto the generic `{ page, pageSize }` shape the\n * host honors against its own RunView.\n */\n OnPageChange(event: PageChangeEvent): void {\n this.dataRequest.emit({ page: event.PageNumber, pageSize: event.PageSize });\n }\n\n /** @deprecated Use {@link OnPageChange}. */\n onPageChange(event: PageChangeEvent): void {\n return this.OnPageChange(event);\n }\n\n // ================================================================\n // Self-contained: Refresh\n // ================================================================\n\n /**\n * Refresh button → re-emit {@link dataRequest} so the host reloads the current page. This is\n * generic container ↔ plug-in coordination (a data-access request), NOT a feature event surfaced\n * to the outer app.\n */\n OnRefreshButtonClick(): void {\n this.dataRequest.emit(this.currentPageDataRequest());\n }\n\n /** @deprecated Use {@link OnRefreshButtonClick}. */\n onRefreshButtonClick(): void {\n return this.OnRefreshButtonClick();\n }\n\n // ================================================================\n // Export: handled entirely by mj-entity-data-grid (its onExportClick opens its own export dialog\n // via ExportService). This wrapper intentionally does NOT host an export dialog — doing so produced\n // two stacked dialogs. Nothing to do here.\n // ================================================================\n\n // ================================================================\n // Self-contained: Add to List (hosts <mj-list-management-dialog>)\n // ================================================================\n\n /**\n * Add-to-list button → build a {@link ListManagementDialogConfig} from the entity + the records the\n * grid supplied, then open the Generic list-management dialog. The dialog persists membership\n * changes itself — nothing bubbles up. Mirrors the config construction the legacy host did in\n * `data-explorer-dashboard`'s `onAddToListRequested()`.\n */\n OnAddToListRequested(event: { entityInfo: EntityInfo; records: Record<string, unknown>[]; recordIds: string[] }): void {\n const entity = event.entityInfo ?? this.entity;\n if (!entity || !event.records || event.records.length === 0) {\n return;\n }\n\n const recordDisplayNames = event.records.map((record) => this.getRecordDisplayName(record, entity));\n const recordIds = this.buildRawRecordIds(event.records, entity);\n if (recordIds.length === 0) {\n return;\n }\n\n const recordCount = event.records.length;\n const dialogTitle = recordCount === 1 ? `Manage Lists for \"${recordDisplayNames[0]}\"` : `Add ${recordCount} Records to List`;\n\n this.listManagementConfig = {\n mode: 'manage',\n entityId: entity.ID,\n entityName: entity.Name,\n recordIds,\n recordDisplayNames,\n allowCreate: true,\n allowRemove: recordCount === 1,\n showMembership: recordCount === 1,\n dialogTitle,\n };\n this.showListManagementDialog = true;\n this.cdr.detectChanges();\n }\n\n /** @deprecated Use {@link OnAddToListRequested}. */\n onAddToListRequested(event: { entityInfo: EntityInfo; records: Record<string, unknown>[]; recordIds: string[] }): void {\n return this.OnAddToListRequested(event);\n }\n\n /** List-management dialog completed (membership changes applied) → tear down state. */\n OnListManagementComplete(_result: ListManagementResult): void {\n this.showListManagementDialog = false;\n this.listManagementConfig = null;\n this.cdr.detectChanges();\n }\n\n /** @deprecated Use {@link OnListManagementComplete}. */\n onListManagementComplete(_result: ListManagementResult): void {\n return this.OnListManagementComplete(_result);\n }\n\n /** List-management dialog cancelled → tear down state. */\n OnListManagementCancel(): void {\n this.showListManagementDialog = false;\n this.listManagementConfig = null;\n this.cdr.detectChanges();\n }\n\n /** @deprecated Use {@link OnListManagementCancel}. */\n onListManagementCancel(): void {\n return this.OnListManagementCancel();\n }\n\n /**\n * Resolve a human-friendly display name for a record using the entity's NameField, falling back to\n * the composite-key string. Mirrors the legacy host's display-name resolution.\n */\n private getRecordDisplayName(record: Record<string, unknown>, entity: EntityInfo): string {\n if (entity.NameField) {\n const nameValue = record[entity.NameField.Name];\n if (nameValue != null) {\n return String(nameValue);\n }\n }\n return BuildPkString(record, entity) || 'Unknown';\n }\n\n /**\n * Build the record-id strings used by list membership matching, in the compact form `MJ: List Details`\n * stores in `RecordID`: the bare value for a single-column primary key (whatever the column is called),\n * or the full `Field1|Value1||Field2|Value2` segment for a composite key. The entity is arbitrary, so the\n * key is built from all of its primary-key columns rather than assuming a single `ID`.\n */\n private buildRawRecordIds(records: Record<string, unknown>[], entity: EntityInfo): string[] {\n if (entity.PrimaryKeys.length === 0) {\n return [];\n }\n return records\n .map((record) => CompositeKey.FromEntityRecord(entity, record).ToCompactURLSegment())\n .filter((id) => id !== '');\n }\n\n // ================================================================\n // Self-contained: Delete (hosts <mj-ev-confirm-dialog> + MJ entity layer)\n // ================================================================\n\n /**\n * Delete button → stage the records and open the Generic confirm dialog. The actual delete happens\n * in {@link onDeleteConfirmed} after the user confirms — nothing bubbles up.\n */\n OnDeleteButtonClick(records: Record<string, unknown>[]): void {\n if (!records || records.length === 0) {\n return;\n }\n this.pendingDeleteRecords = records;\n const count = records.length;\n this.deleteConfirmMessage = count === 1 ? 'Are you sure you want to delete this record?' : `Are you sure you want to delete these ${count} records?`;\n this.showDeleteConfirm = true;\n this.cdr.detectChanges();\n }\n\n /** @deprecated Use {@link OnDeleteButtonClick}. */\n onDeleteButtonClick(records: Record<string, unknown>[]): void {\n return this.OnDeleteButtonClick(records);\n }\n\n /**\n * Delete confirmed → delete each staged record through the MJ entity layer\n * (`ProviderToUse.GetEntityObject(name, compositeKey, user)` → `Delete`), checking the boolean\n * result and surfacing failures via {@link LogError}. After deletion, re-request the current page\n * so the host reloads. Self-contained — no feature event leaves the wrapper.\n */\n async OnDeleteConfirmed(): Promise<void> {\n this.showDeleteConfirm = false;\n const entity = this.entity;\n const records = this.pendingDeleteRecords;\n this.pendingDeleteRecords = [];\n\n if (!entity || records.length === 0) {\n return;\n }\n\n let anyDeleted = false;\n const provider = this.ProviderToUse;\n const user = provider.CurrentUser;\n\n for (const record of records) {\n const key = BuildCompositeKey(record, entity);\n try {\n // The (name, key, user) overload instantiates AND loads in one call (throws if it can't load).\n const obj = await provider.GetEntityObject(entity.Name, key, user);\n const deleted = await obj.Delete();\n if (deleted) {\n anyDeleted = true;\n } else {\n LogError(`Delete failed: ${obj.LatestResult?.CompleteMessage ?? 'unknown error'}`);\n }\n } catch (err) {\n LogError(`Delete failed for ${entity.Name} (${key.ToString()}): ${err instanceof Error ? err.message : String(err)}`);\n }\n }\n\n if (anyDeleted) {\n // Re-request the current page so the host reloads the (now smaller) record set.\n this.dataRequest.emit(this.currentPageDataRequest());\n }\n this.cdr.detectChanges();\n }\n\n /** @deprecated Use {@link OnDeleteConfirmed}. */\n async onDeleteConfirmed(): Promise<void> {\n return this.OnDeleteConfirmed();\n }\n\n /** Delete cancelled → discard the staged records and close the confirm dialog. */\n OnDeleteCancelled(): void {\n this.showDeleteConfirm = false;\n this.pendingDeleteRecords = [];\n this.cdr.detectChanges();\n }\n\n /** @deprecated Use {@link OnDeleteCancelled}. */\n onDeleteCancelled(): void {\n return this.OnDeleteCancelled();\n }\n\n // ================================================================\n // Record merge\n // ================================================================\n\n /**\n * The in-flight merge, or null when the panel is closed. Holds everything the panel needs\n * plus the dependency preview, so the panel itself stays a pure presentation component.\n */\n protected mergeState: {\n Config: MergeConfig;\n Fields: FieldComparison[];\n IsMerging: boolean;\n DependencyNote: string | null;\n /** The entity and the two records' real keys — the Config only carries their serialized form. */\n Entity: EntityInfo;\n Keys: [CompositeKey, CompositeKey];\n } | null = null;\n\n /** A one-line status shown under the grid — why a merge was refused, or how one ended. */\n protected mergeNotice: string | null = null;\n\n /** Auto-dismiss timer for {@link mergeNotice}; cleared whenever the notice is replaced. */\n private mergeNoticeTimer: ReturnType<typeof setTimeout> | null = null;\n\n /**\n * How long a merge notice stays up before dismissing itself. The banner is fixed-position over\n * the whole application, so leaving it until the next merge pins it across navigation and every\n * other record the user visits afterwards.\n */\n private static readonly MERGE_NOTICE_TIMEOUT_MS = 8000;\n\n private readonly comparison = inject(RecordComparisonService);\n\n ngOnDestroy(): void {\n // The notice's auto-dismiss outlives the view otherwise, and fires detectChanges on a\n // destroyed component.\n if (this.mergeNoticeTimer) {\n clearTimeout(this.mergeNoticeTimer);\n this.mergeNoticeTimer = null;\n }\n }\n\n /** Dismiss the merge notice from its own close button. */\n OnDismissMergeNotice(): void {\n this.setMergeNotice(null);\n this.cdr.detectChanges();\n }\n\n /** @deprecated Use {@link OnDismissMergeNotice}. */\n onDismissMergeNotice(): void {\n return this.OnDismissMergeNotice();\n }\n\n /**\n * Set (or clear) the merge notice, replacing any pending auto-dismiss. Every write to\n * `mergeNotice` goes through here so a notice cannot outlive its timer or strand an old one.\n */\n private setMergeNotice(message: string | null): void {\n if (this.mergeNoticeTimer) {\n clearTimeout(this.mergeNoticeTimer);\n this.mergeNoticeTimer = null;\n }\n this.mergeNotice = message;\n if (message) {\n this.mergeNoticeTimer = setTimeout(() => {\n this.mergeNoticeTimer = null;\n this.mergeNotice = null;\n this.cdr.detectChanges();\n }, GridViewRendererComponent.MERGE_NOTICE_TIMEOUT_MS);\n }\n }\n\n /**\n * Show the Merge button only where merging can actually succeed: the entity opts in and the\n * user can both update the survivor and delete the loser.\n */\n protected get effectiveShowMergeButton(): boolean {\n const entity = this.entity;\n const user = this.ProviderToUse?.CurrentUser;\n if (!entity?.AllowRecordMerge || !user) return false;\n const permissions = entity.GetUserPermisions(user);\n return !!permissions && permissions.CanUpdate && permissions.CanDelete;\n }\n\n /** The record that will be deleted, named so the user sees the choice before confirming. */\n protected get mergeLoserLabel(): string {\n const config = this.mergeState?.Config;\n if (!config) return '';\n return config.SurvivorSide === 'left' ? config.RightLabel : config.LeftLabel;\n }\n\n /**\n * The grid asked to merge the selected rows. Compare them, preview what will move, and open\n * the panel — nothing is written until the user confirms.\n */\n async OnMergeRequested(event: { entityInfo: EntityInfo; records: Record<string, unknown>[] }): Promise<void> {\n this.setMergeNotice(null);\n try {\n await this.prepareMerge(event);\n } catch (err) {\n // A transport failure in any pre-flight query must not leave the user with nothing.\n this.setMergeNotice(`Could not prepare the merge: ${err instanceof Error ? err.message : String(err)}`);\n this.cdr.detectChanges();\n }\n }\n\n /** @deprecated Use {@link OnMergeRequested}. */\n async onMergeRequested(event: { entityInfo: EntityInfo; records: Record<string, unknown>[] }): Promise<void> {\n return this.OnMergeRequested(event);\n }\n\n /** The user chose which record survives; differing fields default to that record's values. */\n OnSurvivorChange(side: 'left' | 'right'): void {\n if (!this.mergeState || this.mergeState.IsMerging) return;\n this.mergeState.Config = { ...this.mergeState.Config, SurvivorSide: side };\n for (const field of this.mergeState.Fields) {\n if (!field.IsReadOnly) field.SelectedSide = side;\n }\n this.cdr.detectChanges();\n }\n\n /** @deprecated Use {@link OnSurvivorChange}. */\n onSurvivorChange(side: 'left' | 'right'): void {\n return this.OnSurvivorChange(side);\n }\n\n private async prepareMerge(event: { entityInfo: EntityInfo; records: Record<string, unknown>[] }): Promise<void> {\n const entity = event.entityInfo ?? this.entity;\n if (!entity) return;\n\n // The merge panel is two-sided by construction, so n > 2 has nowhere to render.\n if (event.records.length !== 2) {\n this.setMergeNotice('Select exactly two records to merge.');\n this.cdr.detectChanges();\n return;\n }\n\n // Composite-key safe: the grid renders arbitrary entities, so never assume one key column.\n const keys = event.records.map(r => CompositeKey.FromEntityRecord(entity, r)) as [CompositeKey, CompositeKey];\n if (keys.some(k => k.KeyValuePairs.length === 0 || k.KeyValuePairs.some(kv => kv.Value == null || kv.Value === ''))) {\n this.setMergeNotice('Could not read the primary key of the selected records.');\n this.cdr.detectChanges();\n return;\n }\n // The merge panel's config is string-keyed, so keys travel through it as compact segments.\n const [left, right] = keys.map(k => k.ToCompactURLSegment());\n\n // Subtype records: the merge re-points only the keys that target this entity, then the loser's\n // delete follows the shared key into the parent row, whose own references never moved.\n if (entity.ParentID) {\n this.setMergeNotice(`${entity.DisplayName} records extend a parent type; merging subtype records is not supported yet.`);\n this.cdr.detectChanges();\n return;\n }\n const childRows = await this.hasIsAChildRows(entity, keys);\n if (childRows === null) {\n this.setMergeNotice('Could not verify whether the selected records have subtype rows, so the merge was not started.');\n this.cdr.detectChanges();\n return;\n }\n if (childRows) {\n this.setMergeNotice(\n `${entity.DisplayName} records that another app extends (shared-key subtype rows) cannot be merged yet — ` +\n 'the merge would collide on the shared key. Merge them from the extending app instead.',\n );\n this.cdr.detectChanges();\n return;\n }\n\n const result = await this.comparison.GetRecordComparison(\n {\n EntityName: entity.Name,\n Keys: keys.map(k => ({\n KeyValuePairs: k.KeyValuePairs.map(kv => ({ FieldName: kv.FieldName, Value: String(kv.Value) })),\n })),\n },\n this.ProviderToUse,\n );\n if (!result.Success || !result.Output) {\n this.setMergeNotice(result.ErrorMessage ?? 'Could not compare the selected records.');\n this.cdr.detectChanges();\n return;\n }\n\n this.mergeState = {\n Config: {\n EntityName: entity.Name,\n LeftRecordID: left,\n RightRecordID: right,\n SurvivorSide: 'left',\n LeftLabel: this.labelFor(event.records[0], entity, keys[0]),\n RightLabel: this.labelFor(event.records[1], entity, keys[1]),\n },\n Fields: result.Output.Fields.map(delta => ({\n FieldName: delta.FieldName,\n DisplayLabel: delta.DisplayName,\n LeftValue: delta.Cells[0]?.Value,\n RightValue: delta.Cells[1]?.Value,\n HasConflict: delta.Differs,\n SelectedSide: 'left' as const,\n // What the ORM will refuse to write — keys, AllowUpdateAPI = 0, timestamps. A field the\n // metadata does not know cannot be written either.\n IsReadOnly: entity.FieldByName(delta.FieldName)?.ReadOnly ?? true,\n DataType: 'string',\n })),\n IsMerging: false,\n DependencyNote: await this.describeDependencies(entity, keys),\n Entity: entity,\n Keys: keys,\n };\n this.cdr.detectChanges();\n }\n\n /** The user confirmed: merge, then reload the page so the loser disappears from the grid. */\n async OnMergeConfirmed(event: MergeConfirmedEvent): Promise<void> {\n if (!this.mergeState) return;\n this.mergeState.IsMerging = true;\n this.cdr.detectChanges();\n\n const survivorIsLeft = event.Config.SurvivorSide === 'left';\n const [leftKey, rightKey] = this.mergeState.Keys;\n const survivor = survivorIsLeft ? leftKey : rightKey;\n const loser = survivorIsLeft ? rightKey : leftKey;\n\n const request = new RecordMergeRequest();\n request.EntityName = event.Config.EntityName;\n request.SurvivingRecordCompositeKey = survivor;\n request.RecordsToMerge = [loser];\n request.FieldMap = this.buildFieldMap(event, survivorIsLeft);\n\n try {\n const result = await this.ProviderToUse.MergeRecords(request);\n this.mergeState = null;\n this.setMergeNotice(result.Success ? 'Records merged.' : `Merge failed: ${result.OverallStatus}`);\n if (result.Success) {\n this.dataRequest.emit(this.currentPageDataRequest());\n }\n } catch (err) {\n this.mergeState = null;\n this.setMergeNotice(`Merge failed: ${err instanceof Error ? err.message : String(err)}`);\n }\n this.cdr.detectChanges();\n }\n\n /** @deprecated Use {@link OnMergeConfirmed}. */\n async onMergeConfirmed(event: MergeConfirmedEvent): Promise<void> {\n return this.OnMergeConfirmed(event);\n }\n\n /** Merge cancelled → close the panel, write nothing. */\n OnMergeCancelled(): void {\n this.mergeState = null;\n this.cdr.detectChanges();\n }\n\n /** @deprecated Use {@link OnMergeCancelled}. */\n onMergeCancelled(): void {\n return this.OnMergeCancelled();\n }\n\n /**\n * Fields whose resolution has to travel, and only those: the survivor already holds the value\n * for any field resolved to its own side.\n *\n * The distinction that matters is \"the user did not change this\" versus \"the user chose the\n * blank side\". Both arrive as an absent value, so deciding from the value alone drops a real\n * resolution — the survivor silently keeps its old value on the one operation where someone is\n * reconciling two records field by field, and the loser is gone afterwards. So the skip is\n * decided from WHICH SIDE was chosen, and a chosen blank is written through as null.\n */\n private buildFieldMap(event: MergeConfirmedEvent, survivorIsLeft: boolean): { FieldName: string; Value: unknown }[] {\n const map: { FieldName: string; Value: unknown }[] = [];\n for (const field of event.ResolvedFields) {\n if (field.IsReadOnly || !field.HasConflict) continue;\n // Resolved to the survivor's own side — nothing to write, whatever the value is.\n if (field.SelectedSide !== 'custom' && (field.SelectedSide === 'left') === survivorIsLeft) continue;\n const chosen =\n field.SelectedSide === 'custom'\n ? field.CustomValue\n : (survivorIsLeft ? field.RightValue : field.LeftValue);\n // A chosen blank is a clear, not a no-op. Normalize undefined to null so the transport\n // carries an explicit value rather than an absent one.\n map.push({ FieldName: field.FieldName, Value: chosen === undefined ? null : chosen });\n }\n return map;\n }\n\n /**\n * True when any of these records has a row in an IS-A child entity, null when that could not be\n * determined (a child view the user cannot read answers `Success: false`, which must not pass\n * for \"no rows\"). `MergeRecords` has no subtype handling: the child rows share the parent's key,\n * so merging would collide. Refuse rather than half-merge.\n */\n private async hasIsAChildRows(entity: EntityInfo, keys: ReadonlyArray<CompositeKey>): Promise<boolean | null> {\n const children = entity.ChildEntities;\n if (children.length === 0) return false;\n\n // An IS-A child shares its parent's key SEMANTICALLY; nothing requires it to share the column\n // NAME. `CompositeKey.ToWhereClause()` emits the parent's names, so filtering a child view\n // with it fails wherever the names differ — and a failed probe refuses the merge, which would\n // disable merge for that entity permanently. Pair each key's values onto the child's own PK\n // columns instead, the way the platform's own child discovery does\n // (SQLServerDataProvider.BuildChildDiscoverySQL).\n const probes = children\n .map(child => ({ child, filter: this.buildChildKeyFilter(child, keys) }))\n .filter((probe): probe is { child: EntityInfo; filter: string } => probe.filter !== null);\n if (probes.length === 0) return false;\n\n const results = await RunView.FromMetadataProvider(this.ProviderToUse).RunViews(\n probes.map(({ child, filter }) => ({\n EntityName: child.Name,\n ExtraFilter: filter,\n Fields: child.PrimaryKeys.map(f => f.Name),\n ResultType: 'simple' as const,\n MaxRows: 1,\n })),\n );\n if (results.some(r => !r.Success)) return null;\n return results.some(r => r.Results.length > 0);\n }\n\n /**\n * `(childPk = v1) OR (childPk = v2)` against one child entity, built from the parent's key\n * VALUES and the child's own key COLUMN NAMES, paired positionally because an IS-A child shares\n * its parent's key by design. Null when the child's key arity differs, which means it does not\n * share the key and cannot hold a subtype row for these records.\n */\n private buildChildKeyFilter(child: EntityInfo, keys: ReadonlyArray<CompositeKey>): string | null {\n const childPkFields = child.PrimaryKeys;\n if (childPkFields.length === 0 || keys.some(k => k.KeyValuePairs.length !== childPkFields.length)) {\n return null;\n }\n const clauses = keys.map(key =>\n childPkFields\n .map((field, i) => `[${field.Name}] = '${String(key.KeyValuePairs[i].Value ?? '').replace(/'/g, \"''\")}'`)\n .join(' AND '),\n );\n return clauses.map(c => `(${c})`).join(' OR ');\n }\n\n /**\n * How many linked records will move to the survivor — the thing users most want to know.\n *\n * Indexes `counts[0]` / `counts[1]` directly: `onMergeRequested` refuses anything other than\n * exactly two records before reaching here, and the merge panel's config is two-sided by\n * construction, so this is only ever called with a pair. Widen both together.\n */\n private async describeDependencies(entity: EntityInfo, keys: ReadonlyArray<CompositeKey>): Promise<string | null> {\n try {\n const counts = await Promise.all(\n keys.map(key => this.ProviderToUse.GetRecordDependencies(entity.Name, key)),\n );\n return `Linked records that would move to the survivor: ${counts[0].length} on the left, ${counts[1].length} on the right.`;\n } catch (err) {\n LogError(`Could not load merge dependencies for ${entity.Name}: ${err instanceof Error ? err.message : String(err)}`);\n return null;\n }\n }\n\n /** A human label for a row — its name field when it has one, else its key. */\n private labelFor(row: Record<string, unknown>, entity: EntityInfo, key: CompositeKey): string {\n const nameField = entity.NameField?.Name;\n const name = nameField ? String(row[nameField] ?? '') : '';\n return name || key.ToCompactURLSegment();\n }\n\n // ================================================================\n // Helpers\n // ================================================================\n\n /** Build a {@link ViewDataRequest} that re-requests the host's current page/pageSize, if known. */\n private currentPageDataRequest(): ViewDataRequest {\n const req: ViewDataRequest = {};\n if (this.page != null) {\n req.page = this.page;\n }\n const ps = this.config.pageSize ?? this.pageSize;\n if (ps != null) {\n req.pageSize = ps;\n }\n return req;\n }\n\n /**\n * Resolve an entity's name from its ID via the active provider's metadata. Used when a foreign-key\n * click event omits the related entity name and only carries its ID.\n */\n private resolveEntityNameById(entityId: string): string | null {\n if (!entityId) {\n return null;\n }\n const match = this.ProviderToUse.Entities.find((e) => UUIDsEqual(e.ID, entityId));\n return match ? match.Name : null;\n }\n}\n\n/**\n * Tree-shaking guard. Force-references this renderer so bundlers (ESBuild/Vite) don't drop the\n * component in builds that only mount it dynamically via the ClassFactory/descriptor. Mirrors the\n * Cards/Cluster renderers' load guards; the parent wires this into a barrel/module load path.\n */\nexport function LoadGridViewRenderer(): void {\n // no-op; presence prevents tree-shaking of this component\n}\n"]}
1
+ {"version":3,"file":"grid-view-renderer.component.js","sourceRoot":"","sources":["../../../../src/lib/view-types/renderers/grid-view-renderer.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,iBAAiB,EAAE,SAAS,EAAE,iBAAiB,EAAa,MAAM,EAAE,MAAM,eAAe,CAAC;AAC3I,OAAO,EAA6B,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAEtH,OAAO,EACL,uBAAuB,GAIxB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAQrE,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;;;;;;;;;;;IAgJrE,oDAMC;IADC,AADA,4NAAY,uCAAgC,KAAC,qMACnC,+BAAwB,KAAC;IAErC,iBAA4B;;;IAJ1B,AADA,AADA,0CAAqB,4CACe,uCACL;;;IAiD7B,6BAA4B;IAAA,YAA+B;IAAA,iBAAI;;;IAAnC,cAA+B;IAA/B,sDAA+B;;;;IAzB/D,oCAAuG;IAA7B,gMAAS,yBAAkB,KAAC;IAElG,AADF,8BAAgF,WACxE;IAAA,oBAAI;IAAA,iBAAO;IACjB,iCAIqC;IAAnC,6LAAS,wBAA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A,AADA,AADA,AADA,AADA,AADA,AADA,AADA,AADA,AADA,AADA,AADA,AADA,AADA,AADA,AADA,AADA,AADA,uCAAqB,qBACL,8CACyB,+BACf,gCACC,oCACI,2CACO,kBACrB,oBACE,oDAC4B,yCACX,uCACF,0EACU,6CACJ,yDACY,qCACpB,mCACF,4CACS,kCACV,iDAae;YAU9C,eASC;YATD,mDASC;YAIC,cAA4B;YAE5B,AAFA,8CAA4B,qCAEI;YAYlC,cA6BC;YA7BD,yCA6BC;YACD,cAOC;YAPD,0CAOC;;;iFAgEQ,yBAAyB;cAhLrC,SAAS;6BACI,KAAK,YACP,uBAAuB,iBAClB,iBAAiB,CAAC,IAAI,YAC3B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6GT;;kBAsEA,KAAK;;kBAGL,KAAK;;kBAML,KAAK;;kBAGL,KAAK;;kBASL,KAAK;;kBAGL,KAAK;;kBAGL,KAAK;;kBAOL,KAAK;;kBAKL,KAAK;;kBAGL,KAAK;;kBAGL,KAAK;;kBAGL,KAAK;;kBAGL,KAAK;;kBAOL,KAAK;;kBAKL,MAAM;;kBAGN,MAAM;;kBAGN,MAAM;;kBAGN,MAAM;;kBAQN,MAAM;;kBAMN,MAAM;;kBAGN,MAAM;;kBAMN,SAAS;mBAAC,MAAM;;kFAtGN,yBAAyB;AAo8BtC;;;;GAIG;AACH,MAAM,UAAU,oBAAoB;IAClC,0DAA0D;AAC5D,CAAC","sourcesContent":["import { Component, Input, Output, EventEmitter, ViewEncapsulation, ViewChild, ChangeDetectorRef, OnDestroy, inject } from '@angular/core';\nimport { EntityInfo, RunViewParams, LogError, CompositeKey, RunView, RecordMergeRequest } from '@memberjunction/core';\nimport { ExportColumn } from '@memberjunction/export-engine';\nimport {\n RecordComparisonService,\n type FieldComparison,\n type MergeConfig,\n type MergeConfirmedEvent,\n} from '@memberjunction/ng-record-merge';\nimport { UUIDsEqual } from '@memberjunction/global';\nimport { BaseAngularComponent } from '@memberjunction/ng-base-types';\nimport { PageChangeEvent } from '@memberjunction/ng-pagination';\nimport { ListManagementDialogConfig, ListManagementResult } from '@memberjunction/ng-list-management';\nimport { IViewRenderer, ViewDataRequest, ViewRelatedRecordNavigation } from '../view-type.contracts';\nimport { ViewGridState } from '../../types';\nimport { GridSelectionMode, GridToolbarConfig, ForeignKeyClickEvent } from '../../entity-data-grid/models/grid-types';\nimport { AfterRowClickEventArgs, AfterRowDoubleClickEventArgs, AfterSortEventArgs } from '../../entity-data-grid/events/grid-events';\nimport { GridStateChangedEvent } from '../../types';\nimport { BuildPkString, BuildCompositeKey } from '../../utils/record.util';\nimport { EntityDataGridComponent } from '../../entity-data-grid/entity-data-grid.component';\n\n/**\n * Opaque per-view configuration for the Grid view type.\n * -----------------------------------------------------\n * This is the blob the host persists verbatim against the active `ViewTypeID` and never\n * inspects (see {@link IViewRenderer.configChanged}). The renderer seeds the\n * `<mj-entity-data-grid>` bindings from these fields, applying sensible defaults when a\n * field is absent (see {@link GridViewRendererComponent}). It is intentionally a plain,\n * fully-serializable shape — every field is optional so an empty `{}` is a valid config.\n */\nexport interface GridViewConfig {\n /**\n * Persisted grid state (columns/widths/order/sort) from a User View. Mutated in place when\n * the grid emits sort or generic grid-state changes, then surfaced via `configChanged` so the\n * host persists it. Fed straight into `[GridState]`.\n */\n gridState?: ViewGridState;\n /** Whether the grid's own toolbar is shown. Defaults to `true` when absent. */\n showToolbar?: boolean;\n /** The grid toolbar configuration. Fed into `[ToolbarConfig]`. */\n toolbarConfig?: GridToolbarConfig;\n /** Row selection mode. Defaults to `'checkbox'` when absent. */\n selectionMode?: GridSelectionMode;\n /** Whether the \"Add to List\" button is shown. Defaults to `true` when absent. */\n showAddToListButton?: boolean;\n /** Whether the pager is shown. Defaults to `true` when absent. */\n showPager?: boolean;\n /** Page size for the grid's pager. Falls back to the `pageSize` input when absent. */\n pageSize?: number;\n /**\n * Explicit RunViewParams for the grid's data source. When absent the renderer builds a minimal\n * dynamic-view params object from {@link entity}. Fed into `[Params]`.\n */\n params?: RunViewParams;\n}\n\n/**\n * GridViewRendererComponent\n * -------------------------\n * The Grid **view type** renderer — a fully self-contained {@link IViewRenderer} adapter that hosts\n * the existing {@link EntityDataGridComponent} (`<mj-entity-data-grid>`) inside the entity-viewer's\n * pluggable view-type system. It is the dynamic-mounted plug-in that the `GridViewType` descriptor\n * points at.\n *\n * **Architectural intent — the container knows nothing about grids, and grid *features* never bubble\n * up.** The host (entity-viewer) binds only the generic {@link IViewRenderer} surface: the core\n * inputs (`entity` / `provider` / `records` / `selectedRecordId` / `filterText` / `config`), the\n * generic data-context inputs (`totalRecordCount` / `page` / `pageSize` / `isLoading`), and a small\n * set of generic outputs. There is **no opaque `hostAction` channel** — everything a grid does is\n * resolved through one of these three categories:\n *\n * 1. **Self-contained (owned end-to-end — never bubbles up):**\n * - **Export** → owned entirely by `<mj-entity-data-grid>` itself (its `onExportClick` opens its\n * OWN export dialog with format/sampling via `ExportService`). This wrapper does NOT host an\n * export dialog — doing so produced two stacked dialogs.\n * - **Add to List** → hosts `<mj-list-management-dialog>` ({@link ListManagementModule}). On\n * `(AddToListRequested)` the wrapper builds a {@link ListManagementDialogConfig} from the\n * entity + selected records and opens the dialog.\n * - **Delete** → hosts the Generic `<mj-ev-confirm-dialog>` (from {@link EntityViewerModule}).\n * On `(DeleteButtonClick)` the wrapper confirms, deletes via the MJ entity layer, then\n * re-requests data so the host reloads the current page.\n * - **Refresh** → on `(RefreshButtonClick)` the wrapper re-emits {@link dataRequest} so the host\n * reloads. No feature event leaves the wrapper.\n * - **Selection** → kept INTERNAL; it only drives the wrapper's own add-to-list. Never bubbles.\n *\n * 2. **Navigation (the ONLY legitimate upward signals — routing lives in the outer app):**\n * - Row double-click → {@link recordOpened}.\n * - Foreign-key cell click `(ForeignKeyClick)` → {@link openRelatedRecordRequested}.\n * - New button `(NewButtonClick)` → {@link createRecordRequested}.\n *\n * 3. **Container ↔ plug-in generic coordination (NOT outer-app signals):**\n * - Sort `(AfterSort)` → {@link dataRequest} (`sort`) + persisted into `config.gridState` via\n * {@link configChanged}.\n * - Pager `(PageChange)` → {@link dataRequest} (`page` / `pageSize`).\n * - Generic grid-state `(GridStateChanged)` → merged into `config.gridState` + {@link configChanged}.\n *\n * **Seeding the grid from `config` with defaults:** absent config fields fall back to sensible\n * defaults so a brand-new view (`config === {}`) renders a fully-functional grid — toolbar on,\n * checkbox selection, add-to-list on, pager on. The grid never loads its own data\n * (`[AllowLoad]=\"false\"`) — the host owns the fetch.\n *\n * This is an NgModule-declared (`standalone: false`) component, declared in `EntityViewerModule`.\n * It renders `<mj-entity-data-grid>` + the Generic `<mj-list-management-dialog>` / `<mj-ev-confirm-dialog>`\n * straight from the module's compilation scope (the module imports `ListManagementModule` and declares\n * the grid + confirm dialog; the grid component brings its own export dialog) — so there's\n * no `imports` array and, crucially, no self-import of `EntityViewerModule`: the module loads the\n * view-type descriptors, which reference these wrappers, so a wrapper importing the module back would\n * form a runtime import cycle (NG0919).\n *\n * Inputs use the camelCase names mandated by the {@link IViewRenderer} contract (the host binds them\n * by those exact names via `setInput`), rather than MJ's usual PascalCase for public members —\n * mirroring the Cards and Cluster renderers.\n */\n@Component({\n standalone: false,\n selector: 'mj-grid-view-renderer',\n encapsulation: ViewEncapsulation.None,\n template: `\n <mj-entity-data-grid\n #grid\n [Provider]=\"Provider\"\n [Data]=\"records\"\n [ExportDataProvider]=\"exportDataProvider\"\n [Params]=\"effectiveParams\"\n [SavedViewID]=\"SavedViewID\"\n [FilterText]=\"filterText ?? ''\"\n [GridState]=\"config.gridState ?? null\"\n [Height]=\"'auto'\"\n [AllowLoad]=\"false\"\n [AutoLoadEntityActions]=\"AutoLoadEntityActions\"\n [ShowToolbar]=\"effectiveShowToolbar\"\n [ShowSearch]=\"effectiveShowSearch\"\n [ToolbarConfig]=\"config.toolbarConfig ?? {}\"\n [SelectionMode]=\"effectiveSelectionMode\"\n [ShowAddToListButton]=\"effectiveShowAddToListButton\"\n [ShowPager]=\"effectiveShowPager\"\n [PageSize]=\"effectivePageSize\"\n [TotalRowCount]=\"totalRecordCount ?? 0\"\n [PagerPageNumber]=\"page ?? 1\"\n (AfterRowClick)=\"onAfterRowClick($event)\"\n (AfterRowDoubleClick)=\"onAfterRowDoubleClick($event)\"\n (AfterSort)=\"onAfterSort($event)\"\n (GridStateChanged)=\"onGridStateChanged($event)\"\n (SelectionChange)=\"onSelectionChange($event)\"\n (NewButtonClick)=\"onNewButtonClick()\"\n (RefreshButtonClick)=\"onRefreshButtonClick()\"\n (DeleteButtonClick)=\"onDeleteButtonClick($event)\"\n (AddToListRequested)=\"onAddToListRequested($event)\"\n (ForeignKeyClick)=\"onForeignKeyClick($event)\"\n (PageChange)=\"onPageChange($event)\"\n (ManageColumnsRequested)=\"configureRequested.emit()\"\n [ShowMergeButton]=\"effectiveShowMergeButton\"\n (MergeRecordsRequested)=\"onMergeRequested($event)\"\n >\n </mj-entity-data-grid>\n\n <!-- NOTE: Export is NOT handled here — mj-entity-data-grid hosts its OWN export dialog\n (its onExportClick opens it with formats/sampling via ExportService). Adding a second\n dialog here produced two stacked export dialogs. The grid owns export self-contained. -->\n\n <!-- Self-contained Add-to-List dialog (Generic) — owned by this wrapper, never bubbles up. -->\n @if (listManagementConfig) {\n <mj-list-management-dialog\n [Provider]=\"Provider\"\n [visible]=\"showListManagementDialog\"\n [config]=\"listManagementConfig\"\n (complete)=\"onListManagementComplete($event)\"\n (cancel)=\"onListManagementCancel()\"\n >\n </mj-list-management-dialog>\n }\n\n <!-- Self-contained Delete confirmation (Generic) — owned by this wrapper, never bubbles up. -->\n <mj-ev-confirm-dialog\n [IsOpen]=\"showDeleteConfirm\"\n Title=\"Delete Records\"\n [Message]=\"deleteConfirmMessage\"\n DetailMessage=\"This action cannot be undone.\"\n ConfirmText=\"Delete\"\n ConfirmStyle=\"danger\"\n Icon=\"fa-solid fa-trash\"\n (Confirmed)=\"onDeleteConfirmed()\"\n (Cancelled)=\"onDeleteCancelled()\"\n >\n </mj-ev-confirm-dialog>\n\n <!-- Self-contained merge panel (Generic) — owned by this wrapper, never bubbles up.\n Lives inside the @if so the panel rebuilds its comparison (ngOnInit) per request. -->\n @if (mergeState) {\n <mj-dialog [Visible]=\"true\" Size=\"lg\" [Closeable]=\"!mergeState.IsMerging\" (Close)=\"onMergeCancelled()\">\n <div class=\"mj-ev-merge-survivor\" role=\"radiogroup\" aria-label=\"Record to keep\">\n <span>Keep</span>\n <button type=\"button\" mjButton size=\"sm\" role=\"radio\"\n [variant]=\"mergeState.Config.SurvivorSide === 'left' ? 'primary' : 'secondary'\"\n [attr.aria-checked]=\"mergeState.Config.SurvivorSide === 'left'\"\n [disabled]=\"mergeState.IsMerging\"\n (click)=\"onSurvivorChange('left')\">{{ mergeState.Config.LeftLabel }}</button>\n <button type=\"button\" mjButton size=\"sm\" role=\"radio\"\n [variant]=\"mergeState.Config.SurvivorSide === 'right' ? 'primary' : 'secondary'\"\n [attr.aria-checked]=\"mergeState.Config.SurvivorSide === 'right'\"\n [disabled]=\"mergeState.IsMerging\"\n (click)=\"onSurvivorChange('right')\">{{ mergeState.Config.RightLabel }}</button>\n <span class=\"mj-ev-merge-survivor-note\">{{ mergeLoserLabel }} will be deleted; its linked records move to the record you keep.</span>\n </div>\n <mj-record-merge-panel\n [Fields]=\"mergeState.Fields\"\n [Config]=\"mergeState.Config\"\n [MergeEnabled]=\"!mergeState.IsMerging\"\n [IsMerging]=\"mergeState.IsMerging\"\n (MergeConfirmed)=\"onMergeConfirmed($event)\"\n (MergeCancelled)=\"onMergeCancelled()\"\n >\n </mj-record-merge-panel>\n @if (mergeState.DependencyNote) {\n <p class=\"mj-ev-merge-deps\">{{ mergeState.DependencyNote }}</p>\n }\n </mj-dialog>\n }\n @if (mergeNotice) {\n <div class=\"mj-ev-merge-notice\" role=\"status\">\n <span class=\"mj-ev-merge-notice-text\">{{ mergeNotice }}</span>\n <button type=\"button\" class=\"mj-ev-merge-notice-dismiss\" (click)=\"onDismissMergeNotice()\" title=\"Dismiss\" aria-label=\"Dismiss\">\n <i class=\"fa-solid fa-xmark\"></i>\n </button>\n </div>\n }\n `,\n styles: [\n `\n :host {\n display: block;\n height: 100%;\n }\n\n .mj-ev-merge-survivor {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: 8px;\n margin-bottom: 12px;\n font-size: var(--mj-text-sm);\n color: var(--mj-text-secondary);\n }\n\n .mj-ev-merge-survivor-note {\n color: var(--mj-text-muted);\n }\n\n .mj-ev-merge-deps {\n margin: 0;\n font-size: var(--mj-text-xs);\n color: var(--mj-text-muted);\n }\n\n .mj-ev-merge-notice {\n position: fixed;\n bottom: 16px;\n left: 50%;\n transform: translateX(-50%);\n z-index: 1001;\n padding: 8px 14px;\n border: 1px solid var(--mj-border-subtle);\n border-radius: var(--mj-radius-md);\n background: var(--mj-bg-surface-elevated);\n color: var(--mj-text-primary);\n font-size: var(--mj-text-sm);\n box-shadow: var(--mj-shadow-md);\n display: flex;\n align-items: center;\n gap: 10px;\n }\n\n .mj-ev-merge-notice-dismiss {\n flex-shrink: 0;\n background: none;\n border: none;\n padding: 0 2px;\n cursor: pointer;\n color: var(--mj-text-muted);\n font-size: var(--mj-text-sm);\n line-height: 1;\n }\n\n .mj-ev-merge-notice-dismiss:hover {\n color: var(--mj-text-primary);\n }\n `,\n ],\n})\nexport class GridViewRendererComponent extends BaseAngularComponent implements IViewRenderer<GridViewConfig>, OnDestroy {\n /** Change detection ref used to flush dialog visibility toggles driven by grid events. */\n private cdr = inject(ChangeDetectorRef);\n\n // ---- IViewRenderer core inputs (camelCase per the host contract) ----\n\n /** The entity whose records are being rendered. Used to build default params + resolve selection. */\n @Input() entity: EntityInfo | null = null;\n\n /** The records to render (already loaded / filtered / paged by the host). Fed into `[Data]`. */\n @Input() records: Record<string, unknown>[] = [];\n\n /**\n * Optional full-result-set fetcher supplied by the host, forwarded to the grid's ExportDataProvider\n * so exports cover every matching row rather than just the loaded page (bug C1).\n */\n @Input() ExportDataProvider: (() => Promise<Record<string, unknown>[]>) | null = null;\n\n /** @deprecated Use {@link ExportDataProvider}. */\n @Input() set exportDataProvider(value: (() => Promise<Record<string, unknown>[]>) | null) {\n this.ExportDataProvider = value;\n }\n /** @deprecated Use {@link ExportDataProvider}. */\n get exportDataProvider(): (() => Promise<Record<string, unknown>[]>) | null {\n return this.ExportDataProvider;\n }\n\n /** Primary-key string of the currently selected record, if any. */\n @Input() selectedRecordId: string | null = null;\n\n /** Active filter text — passed through for the grid's cell highlighting. */\n @Input() filterText: string | null = null;\n\n /** Opaque per-view configuration. Seeds the grid bindings; mutated + re-emitted on grid changes. */\n @Input() config: GridViewConfig = {};\n\n /**\n * When true (default), the grid self-loads the entity's active EntityActions and shows them — buttons\n * appear only for entities that actually have actions (data-driven). Actions whose invocation names a\n * `RuntimeUXDriverClass` mount that interactive driver (e.g. the Record Process runner) in-place.\n */\n @Input() AutoLoadEntityActions = true;\n\n // ---- IViewRenderer generic data-context inputs ----\n\n /** Total record count across all pages, for the grid's pager. Fed into `[TotalRowCount]`. */\n @Input() totalRecordCount?: number;\n\n /** One-based current page the host is showing. Fed into `[PagerPageNumber]` (already 1-based). */\n @Input() page?: number;\n\n /** Page size the host is using — fallback when `config.pageSize` is absent. */\n @Input() pageSize?: number;\n\n /** Whether the host is currently (re)loading the record set. Accepted per contract; unused here. */\n @Input() isLoading?: boolean;\n\n /** Active alternate base view semantic name pushed by the host, forwarded into `EffectiveParams`. */\n @Input() alternateBaseView: string | null = null;\n\n /**\n * ID of the persisted `MJ: User Views` record backing the current record set, or `null` for a\n * dynamic / unsaved view. Forwarded to `[SavedViewID]` on `<mj-entity-data-grid>` so Open in Excel\n * works when hosted inside `<mj-entity-viewer>` without handing `_viewEntity` persistence to the grid.\n */\n @Input() SavedViewID: string | null = null;\n\n // ---- IViewRenderer outputs (generic + navigation channels only) ----\n\n /** Emitted when a row is single-clicked — payload is the raw record object (host builds the key). */\n @Output() recordSelected = new EventEmitter<unknown>();\n\n /** Emitted when a row is double-clicked — payload is the raw record object (host builds the key). */\n @Output() recordOpened = new EventEmitter<unknown>();\n\n /** Emitted when this renderer mutates its opaque {@link config} (sort / grid-state persistence). */\n @Output() configChanged = new EventEmitter<GridViewConfig>();\n\n /** Generic data-access channel: ask the host to re-load with different sort / page. */\n @Output() dataRequest = new EventEmitter<ViewDataRequest>();\n\n /**\n * Ask the host to open this view's configuration UI. Raised when the grid emits\n * `ManageColumnsRequested` (its \"Manage Columns\" toolbar affordance). Part of the generic\n * {@link IViewRenderer} contract; the container forwards it to the workspace, which opens the\n * config panel (Columns tab) — the canonical column editor.\n */\n @Output() configureRequested = new EventEmitter<void>();\n\n /**\n * NAVIGATION: open a related record on a (possibly different) entity from a foreign-key cell click.\n * Routing lives in the outer app, so this is one of the few signals that legitimately bubbles up.\n */\n @Output() openRelatedRecordRequested = new EventEmitter<ViewRelatedRecordNavigation>();\n\n /** NAVIGATION: create a new record of the current entity (grid \"New\" button). Bubbles up for routing. */\n @Output() createRecordRequested = new EventEmitter<void>();\n\n /**\n * Reference to the hosted grid. Currently only retained for parity / future selection resolution;\n * selection is mapped from the {@link records} input rather than read from the grid, per contract.\n */\n @ViewChild('grid') protected grid?: EntityDataGridComponent;\n\n /**\n * IMPERATIVE export entry point ({@link IViewRenderer.exportRecords}). Lets the host trigger\n * an export programmatically (ultimately for the AI agent) by delegating to the hosted grid's\n * self-contained {@link EntityDataGridComponent.Export} (which downloads the file). The grid's\n * toolbar export button remains the interactive path; this is the no-UI equivalent.\n *\n * @param format optional output format; the grid defaults to 'excel' when omitted.\n * @returns true when the export succeeded, false when the grid isn't ready or the export failed.\n */\n async exportRecords(format?: 'csv' | 'excel' | 'json'): Promise<boolean> {\n if (!this.grid) {\n return false;\n }\n const result = await this.grid.Export(format ? { format } : undefined, true);\n return !!result?.success;\n }\n\n /** The hosted grid's on-screen columns ({@link IViewRenderer.GetExportColumns}); empty before it mounts. */\n GetExportColumns(): ExportColumn[] {\n return this.grid?.GetExportColumns() ?? [];\n }\n\n // ================================================================\n // Self-contained dialog state (never surfaced to the host)\n // ================================================================\n // NOTE: Export has no state here — mj-entity-data-grid owns its export dialog.\n\n /** Whether the add-to-list dialog is visible. Toggled internally by {@link onAddToListRequested}. */\n protected showListManagementDialog = false;\n\n /** Config fed into `<mj-list-management-dialog>`. Built from the entity + selected records. */\n protected listManagementConfig: ListManagementDialogConfig | null = null;\n\n /** Whether the delete-confirmation dialog is visible. Toggled internally by {@link onDeleteButtonClick}. */\n protected showDeleteConfirm = false;\n\n /** Records staged for deletion while the confirm dialog is open. */\n private pendingDeleteRecords: Record<string, unknown>[] = [];\n\n /** Dynamic message for the delete-confirmation dialog (reflects the staged record count). */\n protected deleteConfirmMessage = 'Are you sure you want to delete the selected records?';\n\n // ================================================================\n // Effective binding accessors — seed grid inputs from config + defaults\n // ================================================================\n\n /** Effective toolbar visibility — defaults to `true` when not set in config. */\n get EffectiveShowToolbar(): boolean {\n return this.config.showToolbar ?? true;\n }\n\n /** @deprecated Use {@link EffectiveShowToolbar}. */\n get effectiveShowToolbar(): boolean {\n return this.EffectiveShowToolbar;\n }\n\n /**\n * Grid search defaults OFF when hosted in entity-viewer. The container already owns\n * `filterText` (\"Filter records...\"). Opt in with `toolbarConfig.showSearch: true`.\n */\n get EffectiveShowSearch(): boolean {\n return this.config.toolbarConfig?.showSearch ?? false;\n }\n\n /** @deprecated Use {@link EffectiveShowSearch}. */\n get effectiveShowSearch(): boolean {\n return this.EffectiveShowSearch;\n }\n\n /** Effective selection mode — defaults to `'checkbox'` when not set in config. */\n get EffectiveSelectionMode(): GridSelectionMode {\n return this.config.selectionMode ?? 'checkbox';\n }\n\n /** @deprecated Use {@link EffectiveSelectionMode}. */\n get effectiveSelectionMode(): GridSelectionMode {\n return this.EffectiveSelectionMode;\n }\n\n /** Effective add-to-list button visibility — defaults to `true` when not set in config. */\n get EffectiveShowAddToListButton(): boolean {\n return this.config.showAddToListButton ?? true;\n }\n\n /** @deprecated Use {@link EffectiveShowAddToListButton}. */\n get effectiveShowAddToListButton(): boolean {\n return this.EffectiveShowAddToListButton;\n }\n\n /** Effective pager visibility — defaults to `true` when not set in config. */\n get EffectiveShowPager(): boolean {\n return this.config.showPager ?? true;\n }\n\n /** @deprecated Use {@link EffectiveShowPager}. */\n get effectiveShowPager(): boolean {\n return this.EffectiveShowPager;\n }\n\n /** Effective page size — config wins, else the generic `pageSize` input, else the grid's own default. */\n get EffectivePageSize(): number {\n return this.config.pageSize ?? this.pageSize ?? 100;\n }\n\n /** @deprecated Use {@link EffectivePageSize}. */\n get effectivePageSize(): number {\n return this.EffectivePageSize;\n }\n\n /**\n * Effective RunViewParams for the grid. Uses `config.params` when supplied; otherwise builds a\n * minimal dynamic-view params object from {@link entity}. Returns `null` when no entity is known\n * yet (the grid renders empty until the host provides one).\n */\n get EffectiveParams(): RunViewParams | null {\n if (this.config.params) {\n return this.alternateBaseView && !this.config.params.AlternateBaseView\n ? { ...this.config.params, AlternateBaseView: this.alternateBaseView }\n : this.config.params;\n }\n if (this.entity) {\n return {\n EntityName: this.entity.Name,\n ...(this.alternateBaseView ? { AlternateBaseView: this.alternateBaseView } : {}),\n };\n }\n return null;\n }\n\n /** @deprecated Use {@link EffectiveParams}. */\n get effectiveParams(): RunViewParams | null {\n return this.EffectiveParams;\n }\n\n // ================================================================\n // Navigation + generic coordination output mapping\n // ================================================================\n\n /**\n * Row single-click → {@link recordSelected}. Extracts the raw record (`event.row`) so the host\n * builds the composite key itself, matching the other renderers.\n */\n OnAfterRowClick(event: AfterRowClickEventArgs): void {\n if (event.row) {\n this.recordSelected.emit(event.row);\n }\n }\n\n /** @deprecated Use {@link OnAfterRowClick}. */\n onAfterRowClick(event: AfterRowClickEventArgs): void {\n return this.OnAfterRowClick(event);\n }\n\n /** Row double-click → {@link recordOpened} (NAVIGATION), emitting the raw record object. */\n OnAfterRowDoubleClick(event: AfterRowDoubleClickEventArgs): void {\n if (event.row) {\n this.recordOpened.emit(event.row);\n }\n }\n\n /** @deprecated Use {@link OnAfterRowDoubleClick}. */\n onAfterRowDoubleClick(event: AfterRowDoubleClickEventArgs): void {\n return this.OnAfterRowDoubleClick(event);\n }\n\n /**\n * Sort change → both generic coordination channels:\n * 1. {@link dataRequest} with the generic `sort` shape so the host re-loads with a new OrderBy.\n * 2. persists the sort into `config.gridState.sortSettings` and emits {@link configChanged} so\n * the grid's sort survives view reloads via the opaque config channel.\n */\n OnAfterSort(event: AfterSortEventArgs): void {\n const sort = (event.newSortState ?? []).map((s) => ({ field: s.field, direction: s.direction }));\n this.dataRequest.emit({ sort });\n\n const gridState: ViewGridState = { ...(this.config.gridState ?? {}) };\n gridState.sortSettings = (event.newSortState ?? []).map((s) => ({ field: s.field, dir: s.direction }));\n this.config = { ...this.config, gridState };\n this.configChanged.emit(this.config);\n }\n\n /** @deprecated Use {@link OnAfterSort}. */\n onAfterSort(event: AfterSortEventArgs): void {\n return this.OnAfterSort(event);\n }\n\n /**\n * Generic grid-state change (column resize / reorder / visibility) → merge the grid's updated\n * {@link ViewGridState} into the opaque config and emit {@link configChanged}; the host persists\n * the blob verbatim. No `dataRequest` here — column changes don't alter the loaded record set.\n */\n OnGridStateChanged(event: GridStateChangedEvent): void {\n this.config = { ...this.config, gridState: event.gridState };\n this.configChanged.emit(this.config);\n }\n\n /** @deprecated Use {@link OnGridStateChanged}. */\n onGridStateChanged(event: GridStateChangedEvent): void {\n return this.OnGridStateChanged(event);\n }\n\n /**\n * Selection change → kept INTERNAL. The grid drives its own add-to-list from the selection, so the\n * wrapper has no need to surface it. We intentionally do not bubble selection anywhere.\n */\n OnSelectionChange(_selectedKeys: string[]): void {\n // No-op: selection is internal to the grid + this wrapper's add-to-list. It never bubbles up.\n }\n\n /** @deprecated Use {@link OnSelectionChange}. */\n onSelectionChange(_selectedKeys: string[]): void {\n return this.OnSelectionChange(_selectedKeys);\n }\n\n /**\n * Foreign-key link click → {@link openRelatedRecordRequested} (NAVIGATION). Maps the grid's\n * {@link ForeignKeyClickEvent} (which carries the related entity + the FK value) onto the generic\n * {@link ViewRelatedRecordNavigation} the container forwards to the outer app for routing. The\n * related entity name is taken from the event when present, else resolved from the metadata by ID.\n */\n OnForeignKeyClick(event: ForeignKeyClickEvent): void {\n const entityName = event.relatedEntityName ?? this.resolveEntityNameById(event.relatedEntityId);\n if (!entityName) {\n return;\n }\n this.openRelatedRecordRequested.emit({ entityName, recordKey: event.recordId });\n }\n\n /** @deprecated Use {@link OnForeignKeyClick}. */\n onForeignKeyClick(event: ForeignKeyClickEvent): void {\n return this.OnForeignKeyClick(event);\n }\n\n /** New button → {@link createRecordRequested} (NAVIGATION) — opening the create form is routing. */\n OnNewButtonClick(): void {\n this.createRecordRequested.emit();\n }\n\n /** @deprecated Use {@link OnNewButtonClick}. */\n onNewButtonClick(): void {\n return this.OnNewButtonClick();\n }\n\n /**\n * Pager navigation → generic {@link dataRequest}. Maps the grid's {@link PageChangeEvent}\n * (`PageNumber` is already 1-based, `PageSize`) onto the generic `{ page, pageSize }` shape the\n * host honors against its own RunView.\n */\n OnPageChange(event: PageChangeEvent): void {\n this.dataRequest.emit({ page: event.PageNumber, pageSize: event.PageSize });\n }\n\n /** @deprecated Use {@link OnPageChange}. */\n onPageChange(event: PageChangeEvent): void {\n return this.OnPageChange(event);\n }\n\n // ================================================================\n // Self-contained: Refresh\n // ================================================================\n\n /**\n * Refresh button → re-emit {@link dataRequest} so the host reloads the current page. This is\n * generic container ↔ plug-in coordination (a data-access request), NOT a feature event surfaced\n * to the outer app.\n */\n OnRefreshButtonClick(): void {\n this.dataRequest.emit(this.currentPageDataRequest());\n }\n\n /** @deprecated Use {@link OnRefreshButtonClick}. */\n onRefreshButtonClick(): void {\n return this.OnRefreshButtonClick();\n }\n\n // ================================================================\n // Export: handled entirely by mj-entity-data-grid (its onExportClick opens its own export dialog\n // via ExportService). This wrapper intentionally does NOT host an export dialog — doing so produced\n // two stacked dialogs. Nothing to do here.\n // ================================================================\n\n // ================================================================\n // Self-contained: Add to List (hosts <mj-list-management-dialog>)\n // ================================================================\n\n /**\n * Add-to-list button → build a {@link ListManagementDialogConfig} from the entity + the records the\n * grid supplied, then open the Generic list-management dialog. The dialog persists membership\n * changes itself — nothing bubbles up. Mirrors the config construction the legacy host did in\n * `data-explorer-dashboard`'s `onAddToListRequested()`.\n */\n OnAddToListRequested(event: { entityInfo: EntityInfo; records: Record<string, unknown>[]; recordIds: string[] }): void {\n const entity = event.entityInfo ?? this.entity;\n if (!entity || !event.records || event.records.length === 0) {\n return;\n }\n\n const recordDisplayNames = event.records.map((record) => this.getRecordDisplayName(record, entity));\n const recordIds = this.buildRawRecordIds(event.records, entity);\n if (recordIds.length === 0) {\n return;\n }\n\n const recordCount = event.records.length;\n const dialogTitle = recordCount === 1 ? `Manage Lists for \"${recordDisplayNames[0]}\"` : `Add ${recordCount} Records to List`;\n\n this.listManagementConfig = {\n mode: 'manage',\n entityId: entity.ID,\n entityName: entity.Name,\n recordIds,\n recordDisplayNames,\n allowCreate: true,\n allowRemove: recordCount === 1,\n showMembership: recordCount === 1,\n dialogTitle,\n };\n this.showListManagementDialog = true;\n this.cdr.detectChanges();\n }\n\n /** @deprecated Use {@link OnAddToListRequested}. */\n onAddToListRequested(event: { entityInfo: EntityInfo; records: Record<string, unknown>[]; recordIds: string[] }): void {\n return this.OnAddToListRequested(event);\n }\n\n /** List-management dialog completed (membership changes applied) → tear down state. */\n OnListManagementComplete(_result: ListManagementResult): void {\n this.showListManagementDialog = false;\n this.listManagementConfig = null;\n this.cdr.detectChanges();\n }\n\n /** @deprecated Use {@link OnListManagementComplete}. */\n onListManagementComplete(_result: ListManagementResult): void {\n return this.OnListManagementComplete(_result);\n }\n\n /** List-management dialog cancelled → tear down state. */\n OnListManagementCancel(): void {\n this.showListManagementDialog = false;\n this.listManagementConfig = null;\n this.cdr.detectChanges();\n }\n\n /** @deprecated Use {@link OnListManagementCancel}. */\n onListManagementCancel(): void {\n return this.OnListManagementCancel();\n }\n\n /**\n * Resolve a human-friendly display name for a record using the entity's NameField, falling back to\n * the composite-key string. Mirrors the legacy host's display-name resolution.\n */\n private getRecordDisplayName(record: Record<string, unknown>, entity: EntityInfo): string {\n if (entity.NameField) {\n const nameValue = record[entity.NameField.Name];\n if (nameValue != null) {\n return String(nameValue);\n }\n }\n return BuildPkString(record, entity) || 'Unknown';\n }\n\n /**\n * Build the record-id strings used by list membership matching, in the compact form `MJ: List Details`\n * stores in `RecordID`: the bare value for a single-column primary key (whatever the column is called),\n * or the full `Field1|Value1||Field2|Value2` segment for a composite key. The entity is arbitrary, so the\n * key is built from all of its primary-key columns rather than assuming a single `ID`.\n */\n private buildRawRecordIds(records: Record<string, unknown>[], entity: EntityInfo): string[] {\n if (entity.PrimaryKeys.length === 0) {\n return [];\n }\n return records\n .map((record) => CompositeKey.FromEntityRecord(entity, record).ToCompactURLSegment())\n .filter((id) => id !== '');\n }\n\n // ================================================================\n // Self-contained: Delete (hosts <mj-ev-confirm-dialog> + MJ entity layer)\n // ================================================================\n\n /**\n * Delete button → stage the records and open the Generic confirm dialog. The actual delete happens\n * in {@link onDeleteConfirmed} after the user confirms — nothing bubbles up.\n */\n OnDeleteButtonClick(records: Record<string, unknown>[]): void {\n if (!records || records.length === 0) {\n return;\n }\n this.pendingDeleteRecords = records;\n const count = records.length;\n this.deleteConfirmMessage = count === 1 ? 'Are you sure you want to delete this record?' : `Are you sure you want to delete these ${count} records?`;\n this.showDeleteConfirm = true;\n this.cdr.detectChanges();\n }\n\n /** @deprecated Use {@link OnDeleteButtonClick}. */\n onDeleteButtonClick(records: Record<string, unknown>[]): void {\n return this.OnDeleteButtonClick(records);\n }\n\n /**\n * Delete confirmed → delete each staged record through the MJ entity layer\n * (`ProviderToUse.GetEntityObject(name, compositeKey, user)` → `Delete`), checking the boolean\n * result and surfacing failures via {@link LogError}. After deletion, re-request the current page\n * so the host reloads. Self-contained — no feature event leaves the wrapper.\n */\n async OnDeleteConfirmed(): Promise<void> {\n this.showDeleteConfirm = false;\n const entity = this.entity;\n const records = this.pendingDeleteRecords;\n this.pendingDeleteRecords = [];\n\n if (!entity || records.length === 0) {\n return;\n }\n\n let anyDeleted = false;\n const provider = this.ProviderToUse;\n const user = provider.CurrentUser;\n\n for (const record of records) {\n const key = BuildCompositeKey(record, entity);\n try {\n // The (name, key, user) overload instantiates AND loads in one call (throws if it can't load).\n const obj = await provider.GetEntityObject(entity.Name, key, user);\n const deleted = await obj.Delete();\n if (deleted) {\n anyDeleted = true;\n } else {\n LogError(`Delete failed: ${obj.LatestResult?.CompleteMessage ?? 'unknown error'}`);\n }\n } catch (err) {\n LogError(`Delete failed for ${entity.Name} (${key.ToString()}): ${err instanceof Error ? err.message : String(err)}`);\n }\n }\n\n if (anyDeleted) {\n // Re-request the current page so the host reloads the (now smaller) record set.\n this.dataRequest.emit(this.currentPageDataRequest());\n }\n this.cdr.detectChanges();\n }\n\n /** @deprecated Use {@link OnDeleteConfirmed}. */\n async onDeleteConfirmed(): Promise<void> {\n return this.OnDeleteConfirmed();\n }\n\n /** Delete cancelled → discard the staged records and close the confirm dialog. */\n OnDeleteCancelled(): void {\n this.showDeleteConfirm = false;\n this.pendingDeleteRecords = [];\n this.cdr.detectChanges();\n }\n\n /** @deprecated Use {@link OnDeleteCancelled}. */\n onDeleteCancelled(): void {\n return this.OnDeleteCancelled();\n }\n\n // ================================================================\n // Record merge\n // ================================================================\n\n /**\n * The in-flight merge, or null when the panel is closed. Holds everything the panel needs\n * plus the dependency preview, so the panel itself stays a pure presentation component.\n */\n protected mergeState: {\n Config: MergeConfig;\n Fields: FieldComparison[];\n IsMerging: boolean;\n DependencyNote: string | null;\n /** The entity and the two records' real keys — the Config only carries their serialized form. */\n Entity: EntityInfo;\n Keys: [CompositeKey, CompositeKey];\n } | null = null;\n\n /** A one-line status shown under the grid — why a merge was refused, or how one ended. */\n protected mergeNotice: string | null = null;\n\n /** Auto-dismiss timer for {@link mergeNotice}; cleared whenever the notice is replaced. */\n private mergeNoticeTimer: ReturnType<typeof setTimeout> | null = null;\n\n /**\n * How long a merge notice stays up before dismissing itself. The banner is fixed-position over\n * the whole application, so leaving it until the next merge pins it across navigation and every\n * other record the user visits afterwards.\n */\n private static readonly MERGE_NOTICE_TIMEOUT_MS = 8000;\n\n private readonly comparison = inject(RecordComparisonService);\n\n ngOnDestroy(): void {\n // The notice's auto-dismiss outlives the view otherwise, and fires detectChanges on a\n // destroyed component.\n if (this.mergeNoticeTimer) {\n clearTimeout(this.mergeNoticeTimer);\n this.mergeNoticeTimer = null;\n }\n }\n\n /** Dismiss the merge notice from its own close button. */\n OnDismissMergeNotice(): void {\n this.setMergeNotice(null);\n this.cdr.detectChanges();\n }\n\n /** @deprecated Use {@link OnDismissMergeNotice}. */\n onDismissMergeNotice(): void {\n return this.OnDismissMergeNotice();\n }\n\n /**\n * Set (or clear) the merge notice, replacing any pending auto-dismiss. Every write to\n * `mergeNotice` goes through here so a notice cannot outlive its timer or strand an old one.\n */\n private setMergeNotice(message: string | null): void {\n if (this.mergeNoticeTimer) {\n clearTimeout(this.mergeNoticeTimer);\n this.mergeNoticeTimer = null;\n }\n this.mergeNotice = message;\n if (message) {\n this.mergeNoticeTimer = setTimeout(() => {\n this.mergeNoticeTimer = null;\n this.mergeNotice = null;\n this.cdr.detectChanges();\n }, GridViewRendererComponent.MERGE_NOTICE_TIMEOUT_MS);\n }\n }\n\n /**\n * Show the Merge button only where merging can actually succeed: the entity opts in and the\n * user can both update the survivor and delete the loser.\n */\n protected get effectiveShowMergeButton(): boolean {\n const entity = this.entity;\n const user = this.ProviderToUse?.CurrentUser;\n if (!entity?.AllowRecordMerge || !user) return false;\n const permissions = entity.GetUserPermisions(user);\n return !!permissions && permissions.CanUpdate && permissions.CanDelete;\n }\n\n /** The record that will be deleted, named so the user sees the choice before confirming. */\n protected get mergeLoserLabel(): string {\n const config = this.mergeState?.Config;\n if (!config) return '';\n return config.SurvivorSide === 'left' ? config.RightLabel : config.LeftLabel;\n }\n\n /**\n * The grid asked to merge the selected rows. Compare them, preview what will move, and open\n * the panel — nothing is written until the user confirms.\n */\n async OnMergeRequested(event: { entityInfo: EntityInfo; records: Record<string, unknown>[] }): Promise<void> {\n this.setMergeNotice(null);\n try {\n await this.prepareMerge(event);\n } catch (err) {\n // A transport failure in any pre-flight query must not leave the user with nothing.\n this.setMergeNotice(`Could not prepare the merge: ${err instanceof Error ? err.message : String(err)}`);\n this.cdr.detectChanges();\n }\n }\n\n /** @deprecated Use {@link OnMergeRequested}. */\n async onMergeRequested(event: { entityInfo: EntityInfo; records: Record<string, unknown>[] }): Promise<void> {\n return this.OnMergeRequested(event);\n }\n\n /** The user chose which record survives; differing fields default to that record's values. */\n OnSurvivorChange(side: 'left' | 'right'): void {\n if (!this.mergeState || this.mergeState.IsMerging) return;\n this.mergeState.Config = { ...this.mergeState.Config, SurvivorSide: side };\n for (const field of this.mergeState.Fields) {\n if (!field.IsReadOnly) field.SelectedSide = side;\n }\n this.cdr.detectChanges();\n }\n\n /** @deprecated Use {@link OnSurvivorChange}. */\n onSurvivorChange(side: 'left' | 'right'): void {\n return this.OnSurvivorChange(side);\n }\n\n private async prepareMerge(event: { entityInfo: EntityInfo; records: Record<string, unknown>[] }): Promise<void> {\n const entity = event.entityInfo ?? this.entity;\n if (!entity) return;\n\n // The merge panel is two-sided by construction, so n > 2 has nowhere to render.\n if (event.records.length !== 2) {\n this.setMergeNotice('Select exactly two records to merge.');\n this.cdr.detectChanges();\n return;\n }\n\n // Composite-key safe: the grid renders arbitrary entities, so never assume one key column.\n const keys = event.records.map(r => CompositeKey.FromEntityRecord(entity, r)) as [CompositeKey, CompositeKey];\n if (keys.some(k => k.KeyValuePairs.length === 0 || k.KeyValuePairs.some(kv => kv.Value == null || kv.Value === ''))) {\n this.setMergeNotice('Could not read the primary key of the selected records.');\n this.cdr.detectChanges();\n return;\n }\n // The merge panel's config is string-keyed, so keys travel through it as compact segments.\n const [left, right] = keys.map(k => k.ToCompactURLSegment());\n\n // Subtype records: the merge re-points only the keys that target this entity, then the loser's\n // delete follows the shared key into the parent row, whose own references never moved.\n if (entity.ParentID) {\n this.setMergeNotice(`${entity.DisplayName} records extend a parent type; merging subtype records is not supported yet.`);\n this.cdr.detectChanges();\n return;\n }\n const childRows = await this.hasIsAChildRows(entity, keys);\n if (childRows === null) {\n this.setMergeNotice('Could not verify whether the selected records have subtype rows, so the merge was not started.');\n this.cdr.detectChanges();\n return;\n }\n if (childRows) {\n this.setMergeNotice(\n `${entity.DisplayName} records that another app extends (shared-key subtype rows) cannot be merged yet — ` +\n 'the merge would collide on the shared key. Merge them from the extending app instead.',\n );\n this.cdr.detectChanges();\n return;\n }\n\n const result = await this.comparison.GetRecordComparison(\n {\n EntityName: entity.Name,\n Keys: keys.map(k => ({\n KeyValuePairs: k.KeyValuePairs.map(kv => ({ FieldName: kv.FieldName, Value: String(kv.Value) })),\n })),\n },\n this.ProviderToUse,\n );\n if (!result.Success || !result.Output) {\n this.setMergeNotice(result.ErrorMessage ?? 'Could not compare the selected records.');\n this.cdr.detectChanges();\n return;\n }\n\n this.mergeState = {\n Config: {\n EntityName: entity.Name,\n LeftRecordID: left,\n RightRecordID: right,\n SurvivorSide: 'left',\n LeftLabel: this.labelFor(event.records[0], entity, keys[0]),\n RightLabel: this.labelFor(event.records[1], entity, keys[1]),\n },\n Fields: result.Output.Fields.map(delta => ({\n FieldName: delta.FieldName,\n DisplayLabel: delta.DisplayName,\n LeftValue: delta.Cells[0]?.Value,\n RightValue: delta.Cells[1]?.Value,\n HasConflict: delta.Differs,\n SelectedSide: 'left' as const,\n // What the ORM will refuse to write — keys, AllowUpdateAPI = 0, timestamps. A field the\n // metadata does not know cannot be written either.\n IsReadOnly: entity.FieldByName(delta.FieldName)?.ReadOnly ?? true,\n DataType: 'string',\n })),\n IsMerging: false,\n DependencyNote: await this.describeDependencies(entity, keys),\n Entity: entity,\n Keys: keys,\n };\n this.cdr.detectChanges();\n }\n\n /** The user confirmed: merge, then reload the page so the loser disappears from the grid. */\n async OnMergeConfirmed(event: MergeConfirmedEvent): Promise<void> {\n if (!this.mergeState) return;\n this.mergeState.IsMerging = true;\n this.cdr.detectChanges();\n\n const survivorIsLeft = event.Config.SurvivorSide === 'left';\n const [leftKey, rightKey] = this.mergeState.Keys;\n const survivor = survivorIsLeft ? leftKey : rightKey;\n const loser = survivorIsLeft ? rightKey : leftKey;\n\n const request = new RecordMergeRequest();\n request.EntityName = event.Config.EntityName;\n request.SurvivingRecordCompositeKey = survivor;\n request.RecordsToMerge = [loser];\n request.FieldMap = this.buildFieldMap(event, survivorIsLeft);\n\n try {\n const result = await this.ProviderToUse.MergeRecords(request);\n this.mergeState = null;\n this.setMergeNotice(result.Success ? 'Records merged.' : `Merge failed: ${result.OverallStatus}`);\n if (result.Success) {\n this.dataRequest.emit(this.currentPageDataRequest());\n }\n } catch (err) {\n this.mergeState = null;\n this.setMergeNotice(`Merge failed: ${err instanceof Error ? err.message : String(err)}`);\n }\n this.cdr.detectChanges();\n }\n\n /** @deprecated Use {@link OnMergeConfirmed}. */\n async onMergeConfirmed(event: MergeConfirmedEvent): Promise<void> {\n return this.OnMergeConfirmed(event);\n }\n\n /** Merge cancelled → close the panel, write nothing. */\n OnMergeCancelled(): void {\n this.mergeState = null;\n this.cdr.detectChanges();\n }\n\n /** @deprecated Use {@link OnMergeCancelled}. */\n onMergeCancelled(): void {\n return this.OnMergeCancelled();\n }\n\n /**\n * Fields whose resolution has to travel, and only those: the survivor already holds the value\n * for any field resolved to its own side.\n *\n * The distinction that matters is \"the user did not change this\" versus \"the user chose the\n * blank side\". Both arrive as an absent value, so deciding from the value alone drops a real\n * resolution — the survivor silently keeps its old value on the one operation where someone is\n * reconciling two records field by field, and the loser is gone afterwards. So the skip is\n * decided from WHICH SIDE was chosen, and a chosen blank is written through as null.\n */\n private buildFieldMap(event: MergeConfirmedEvent, survivorIsLeft: boolean): { FieldName: string; Value: unknown }[] {\n const map: { FieldName: string; Value: unknown }[] = [];\n for (const field of event.ResolvedFields) {\n if (field.IsReadOnly || !field.HasConflict) continue;\n // Resolved to the survivor's own side — nothing to write, whatever the value is.\n if (field.SelectedSide !== 'custom' && (field.SelectedSide === 'left') === survivorIsLeft) continue;\n const chosen =\n field.SelectedSide === 'custom'\n ? field.CustomValue\n : (survivorIsLeft ? field.RightValue : field.LeftValue);\n // A chosen blank is a clear, not a no-op. Normalize undefined to null so the transport\n // carries an explicit value rather than an absent one.\n map.push({ FieldName: field.FieldName, Value: chosen === undefined ? null : chosen });\n }\n return map;\n }\n\n /**\n * True when any of these records has a row in an IS-A child entity, null when that could not be\n * determined (a child view the user cannot read answers `Success: false`, which must not pass\n * for \"no rows\"). `MergeRecords` has no subtype handling: the child rows share the parent's key,\n * so merging would collide. Refuse rather than half-merge.\n */\n private async hasIsAChildRows(entity: EntityInfo, keys: ReadonlyArray<CompositeKey>): Promise<boolean | null> {\n const children = entity.ChildEntities;\n if (children.length === 0) return false;\n\n // An IS-A child shares its parent's key SEMANTICALLY; nothing requires it to share the column\n // NAME. `CompositeKey.ToWhereClause()` emits the parent's names, so filtering a child view\n // with it fails wherever the names differ — and a failed probe refuses the merge, which would\n // disable merge for that entity permanently. Pair each key's values onto the child's own PK\n // columns instead, the way the platform's own child discovery does\n // (SQLServerDataProvider.BuildChildDiscoverySQL).\n const probes = children\n .map(child => ({ child, filter: this.buildChildKeyFilter(child, keys) }))\n .filter((probe): probe is { child: EntityInfo; filter: string } => probe.filter !== null);\n if (probes.length === 0) return false;\n\n const results = await RunView.FromMetadataProvider(this.ProviderToUse).RunViews(\n probes.map(({ child, filter }) => ({\n EntityName: child.Name,\n ExtraFilter: filter,\n Fields: child.PrimaryKeys.map(f => f.Name),\n ResultType: 'simple' as const,\n MaxRows: 1,\n SkipTotalRowCount: true,\n })),\n );\n if (results.some(r => !r.Success)) return null;\n return results.some(r => r.Results.length > 0);\n }\n\n /**\n * `(childPk = v1) OR (childPk = v2)` against one child entity, built from the parent's key\n * VALUES and the child's own key COLUMN NAMES, paired positionally because an IS-A child shares\n * its parent's key by design. Null when the child's key arity differs, which means it does not\n * share the key and cannot hold a subtype row for these records.\n */\n private buildChildKeyFilter(child: EntityInfo, keys: ReadonlyArray<CompositeKey>): string | null {\n const childPkFields = child.PrimaryKeys;\n if (childPkFields.length === 0 || keys.some(k => k.KeyValuePairs.length !== childPkFields.length)) {\n return null;\n }\n const clauses = keys.map(key =>\n childPkFields\n .map((field, i) => `[${field.Name}] = '${String(key.KeyValuePairs[i].Value ?? '').replace(/'/g, \"''\")}'`)\n .join(' AND '),\n );\n return clauses.map(c => `(${c})`).join(' OR ');\n }\n\n /**\n * How many linked records will move to the survivor — the thing users most want to know.\n *\n * Indexes `counts[0]` / `counts[1]` directly: `onMergeRequested` refuses anything other than\n * exactly two records before reaching here, and the merge panel's config is two-sided by\n * construction, so this is only ever called with a pair. Widen both together.\n */\n private async describeDependencies(entity: EntityInfo, keys: ReadonlyArray<CompositeKey>): Promise<string | null> {\n try {\n const counts = await Promise.all(\n keys.map(key => this.ProviderToUse.GetRecordDependencies(entity.Name, key)),\n );\n return `Linked records that would move to the survivor: ${counts[0].length} on the left, ${counts[1].length} on the right.`;\n } catch (err) {\n LogError(`Could not load merge dependencies for ${entity.Name}: ${err instanceof Error ? err.message : String(err)}`);\n return null;\n }\n }\n\n /** A human label for a row — its name field when it has one, else its key. */\n private labelFor(row: Record<string, unknown>, entity: EntityInfo, key: CompositeKey): string {\n const nameField = entity.NameField?.Name;\n const name = nameField ? String(row[nameField] ?? '') : '';\n return name || key.ToCompactURLSegment();\n }\n\n // ================================================================\n // Helpers\n // ================================================================\n\n /** Build a {@link ViewDataRequest} that re-requests the host's current page/pageSize, if known. */\n private currentPageDataRequest(): ViewDataRequest {\n const req: ViewDataRequest = {};\n if (this.page != null) {\n req.page = this.page;\n }\n const ps = this.config.pageSize ?? this.pageSize;\n if (ps != null) {\n req.pageSize = ps;\n }\n return req;\n }\n\n /**\n * Resolve an entity's name from its ID via the active provider's metadata. Used when a foreign-key\n * click event omits the related entity name and only carries its ID.\n */\n private resolveEntityNameById(entityId: string): string | null {\n if (!entityId) {\n return null;\n }\n const match = this.ProviderToUse.Entities.find((e) => UUIDsEqual(e.ID, entityId));\n return match ? match.Name : null;\n }\n}\n\n/**\n * Tree-shaking guard. Force-references this renderer so bundlers (ESBuild/Vite) don't drop the\n * component in builds that only mount it dynamically via the ClassFactory/descriptor. Mirrors the\n * Cards/Cluster renderers' load guards; the parent wires this into a barrel/module load path.\n */\nexport function LoadGridViewRenderer(): void {\n // no-op; presence prevents tree-shaking of this component\n}\n"]}
@@ -130,6 +130,12 @@ export interface IViewRenderer<TConfig = unknown> {
130
130
  pageSize?: number;
131
131
  /** Whether the host is currently (re)loading the record set. */
132
132
  isLoading?: boolean;
133
+ /**
134
+ * Optional ID of the persisted `MJ: User Views` record backing the current record set, or `null`
135
+ * for a dynamic / unsaved view. Generic view context — lets a renderer offer saved-view actions
136
+ * (such as Open in Excel) without taking ownership of the `UserView` entity record.
137
+ */
138
+ SavedViewID?: string | null;
133
139
  /** Emitted when a record is selected (single click). Payload is the raw record object. */
134
140
  recordSelected: EventEmitter<unknown>;
135
141
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"view-type.contracts.d.ts","sourceRoot":"","sources":["../../../src/lib/view-types/view-type.contracts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAG7D;;;;;;;;;;;;;;;;;;GAkBG;AAEH;;;;;;;;GAQG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IAEtB,oFAAoF;IACpF,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAE7B,gFAAgF;IAChF,QAAQ,CAAC,IAA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":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AA8QvD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,OAAgB,sBAAsB;IAKjC,kBAAkB,CAAiB;IAE5C;;;;OAIG;IACM,sBAAsB,GAAY,KAAK,CAAC;IAEjD;;;;OAIG;IACM,iBAAiB,GAAY,KAAK,CAAC;IAE5C;;;OAGG;IACH,cAAc,CAAC,OAAmB,EAAE,SAA6B;QAC/D,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,sBAAsB,CAAC,SAA6B;QACxD,mBAAmB;IACrB,CAAC;CACF;AAED;;;;;GAKG;AACH,MAAM,UAAU,qBAAqB;IACnC,kFAAkF;IAClF,KAAK,aAAa,CAAC;AACrB,CAAC","sourcesContent":["import { Type, EventEmitter } from '@angular/core';\nimport { EntityInfo, IMetadataProvider } from '@memberjunction/core';\nimport { ExportColumn } from '@memberjunction/export-engine';\nimport { RegisterClass } from '@memberjunction/global';\n\n/**\n * View-Type Plugin Architecture — Contracts\n * -----------------------------------------\n * This file defines the framework-level contracts for the entity-viewer's pluggable\n * view-type system. A \"view type\" is a way of rendering a set of entity records — the\n * built-in ones being Grid, Cards, Timeline, and Map, with future additions like\n * Cluster and Tag Cloud.\n *\n * The design separates three concerns:\n * 1. {@link IViewTypeDescriptor} — metadata + availability + the component types to mount.\n * Descriptors are discovered at runtime via the {@link https MemberJunction ClassFactory}\n * keyed off the `DriverClass` stored in the `MJ: View Types` entity.\n * 2. {@link IViewRenderer} — the contract a renderer component honors so the host can\n * feed it data and listen for selection/open/config events uniformly.\n * 3. {@link IViewPropSheet} — the contract a configuration prop-sheet component honors.\n *\n * Because this lives in an Angular package, it is acceptable for the descriptor to reference\n * Angular's `Type<T>` (it points at the concrete component classes to instantiate).\n */\n\n/**\n * Framework-agnostic-ish descriptor for a single view type.\n *\n * A descriptor is the bridge between the `MJ: View Types` metadata row (which stores\n * the `DriverClass` name) and the concrete Angular components that actually render the\n * view and edit its configuration. Descriptors are registered with the ClassFactory via\n * `@RegisterClass(BaseViewTypeDescriptor, '<DriverClass>')` so they can be discovered by\n * name without a hard import from the host.\n */\nexport interface IViewTypeDescriptor {\n /**\n * Stable internal key for the view type — matches the `DriverClass` column on the\n * `MJ: View Types` entity and the `@RegisterClass` registration key\n * (e.g. \"GridViewType\", \"CardsViewType\").\n */\n readonly Name: string;\n\n /** User-facing label shown in the view-mode switcher (e.g. \"Grid\", \"Tag Cloud\"). */\n readonly DisplayName: string;\n\n /** Font Awesome icon class shown in the switcher (e.g. \"fa-solid fa-table\"). */\n readonly Icon: string;\n\n /**\n * The Angular component class that renders this view type. The host instantiates /\n * mounts this component and feeds it data per the {@link IViewRenderer} contract.\n */\n readonly RendererComponent: Type<unknown>;\n\n /**\n * Optional Angular component class for this view type's configuration prop-sheet\n * (honors {@link IViewPropSheet}). Undefined when the view type has no configurable\n * options.\n */\n readonly PropSheetComponent?: Type<unknown>;\n\n /**\n * When `true`, this view type's `config.gridState` is backed by the **canonical**\n * `UserView.GridState` column (the single, framework-wide store for a view's\n * columns / sort / filter / aggregates — also read by `MJUserViewEntity.Columns`,\n * the GraphQL data provider's field list, and export) rather than by an opaque\n * per-view-type blob in `DisplayState.viewTypeConfigs`.\n *\n * The container honors this by (a) seeding the renderer's `config.gridState` from\n * the canonical store and (b) routing the renderer's `configChanged.gridState`\n * back to it on persist. This keeps the grid, the config panel, the server query,\n * and export all reading/writing one source of truth. Defaults to `false`, so\n * non-grid view types (Cards/Timeline/Map) keep their opaque per-type config.\n */\n readonly UsesCanonicalGridState?: boolean;\n\n /**\n * When `true`, this view type ships its OWN in-view export affordance (e.g. the Grid renderer's\n * in-toolbar \"Export\" button + {@link IViewRenderer.exportRecords}). Hosts use this to decide\n * whether to render a FALLBACK export button for view types that DON'T (Cards / Map / Timeline),\n * so every view type can export without a duplicate button on the ones that already have one.\n * Defaults to `false`. This is read off the (synchronously-resolved) descriptor rather than the\n * mounted renderer instance, so it's correct the instant the active view type changes.\n */\n readonly ProvidesOwnExport?: boolean;\n\n /**\n * Predicate that decides whether this view type is available for a given entity.\n * For example, Timeline requires a date field; Map requires geocoding support.\n * Grid and Cards are always available.\n *\n * @param entity the entity the viewer is currently displaying\n * @param provider optional metadata provider (for multi-provider scenarios)\n */\n IsAvailableFor(entity: EntityInfo, provider?: IMetadataProvider): boolean;\n\n /**\n * Optional async hook to load any data this descriptor's {@link IsAvailableFor} predicate\n * depends on (e.g. the Cluster view type needs the set of entities that have an active\n * Entity Document with vectors). The host awaits this once — before computing availability —\n * so the synchronous predicate can read from a now-populated cache. Implementations should\n * be cheap/idempotent (typically `await SomeEngine.Instance.Config(false, ...)`). Omit when\n * availability is computable purely from the {@link EntityInfo} (Grid/Cards/Timeline/Map).\n *\n * @param provider optional metadata provider (for multi-provider scenarios)\n */\n EnsureAvailabilityData?(provider?: IMetadataProvider): Promise<void>;\n}\n\n/**\n * Contract honored by a view renderer component. The host binds these inputs and\n * subscribes to these outputs uniformly across all view types.\n *\n * @typeParam TConfig the shape of this view type's configuration object\n */\nexport interface IViewRenderer<TConfig = unknown> {\n /** The entity whose records are being rendered. */\n entity: EntityInfo | null; // case-violation-ok-legacy-back-compat: the type is named in an exported signature, so consumers build object literals against it; an interface has no runtime carrier for a stub\n\n /** The records to render (already loaded/filtered by the host). */\n records: Record<string, unknown>[]; // case-violation-ok-legacy-back-compat: the type is named in an exported signature, so consumers build object literals against it; an interface has no runtime carrier for a stub\n\n /** Primary-key string of the currently selected record, if any. */\n selectedRecordId: string | null; // case-violation-ok-legacy-back-compat: the type is named in an exported signature, so consumers build object literals against it; an interface has no runtime carrier for a stub\n\n /** Active filter text (for highlighting / client-side concerns). */\n filterText: string | null; // case-violation-ok-legacy-back-compat: the type is named in an exported signature, so consumers build object literals against it; an interface has no runtime carrier for a stub\n\n /** View-type-specific configuration. */\n config: TConfig; // case-violation-ok-legacy-back-compat: the type is named in an exported signature, so consumers build object literals against it; an interface has no runtime carrier for a stub\n\n /**\n * Optional: the metadata provider, handed to plug-ins that issue their own data calls\n * (multi-provider safety). Generic — not specific to any one view type.\n */\n provider?: IMetadataProvider | null; // case-violation-ok-legacy-back-compat: the type is named in an exported signature, so consumers build object literals against it; an interface has no runtime carrier for a stub\n\n /**\n * Optional generic data-context the host supplies alongside {@link records}. These are\n * universal \"a view of records\" concepts (counts, current page, loading) — NOT specific to any\n * view type — so a renderer that paginates or shows a total can read them, and one that doesn't\n * simply ignores them. The host owns the actual data fetch; these describe its current result.\n */\n totalRecordCount?: number; // case-violation-ok-legacy-back-compat: the type is named in an exported signature, so consumers build object literals against it; an interface has no runtime carrier for a stub\n /** One-based current page of {@link records} when the host is paginating. */\n page?: number; // case-violation-ok-legacy-back-compat: the type is named in an exported signature, so consumers build object literals against it; an interface has no runtime carrier for a stub\n /** Page size the host is using. */\n pageSize?: number; // case-violation-ok-legacy-back-compat: the type is named in an exported signature, so consumers build object literals against it; an interface has no runtime carrier for a stub\n /** Whether the host is currently (re)loading the record set. */\n isLoading?: boolean; // case-violation-ok-legacy-back-compat: the type is named in an exported signature, so consumers build object literals against it; an interface has no runtime carrier for a stub\n\n /** Emitted when a record is selected (single click). Payload is the raw record object. */\n recordSelected: EventEmitter<unknown>; // case-violation-ok-legacy-back-compat: the type is named in an exported signature, so consumers build object literals against it; an interface has no runtime carrier for a stub\n\n /**\n * Emitted when THIS entity's record should be opened (double-click / open). Payload is the raw\n * record. This is a NAVIGATION request — the only category of signal that legitimately bubbles\n * to the outer app (routing lives there). Everything else a view does (export, add-to-list,\n * delete, …) is self-contained in the plug-in via Generic dialogs and never bubbles up.\n */\n recordOpened: EventEmitter<unknown>; // case-violation-ok-legacy-back-compat: the type is named in an exported signature, so consumers build object literals against it; an interface has no runtime carrier for a stub\n\n /**\n * Optional: NAVIGATION request to open a *related* record on a DIFFERENT entity (e.g. a\n * foreign-key drill-through in a grid cell). Bubbles to the outer app for routing. Generic —\n * the container forwards it without acting on it.\n */\n openRelatedRecordRequested?: EventEmitter<ViewRelatedRecordNavigation>; // case-violation-ok-legacy-back-compat: the type is named in an exported signature, so consumers build object literals against it; an interface has no runtime carrier for a stub\n\n /**\n * Optional: NAVIGATION request to create a new record of the current entity (e.g. a grid's\n * \"New\" button) — opening the create form is a routing concern owned by the outer app. Bubbles\n * up; the container forwards it without acting on it.\n */\n createRecordRequested?: EventEmitter<void>; // case-violation-ok-legacy-back-compat: the type is named in an exported signature, so consumers build object literals against it; an interface has no runtime carrier for a stub\n\n /**\n * Emitted when the renderer mutates its own opaque {@link config} (e.g. timeline date field,\n * grid columns/sort/widths, map render mode). The container persists the blob verbatim against\n * the active `ViewTypeID` and never inspects it. (Container ↔ plug-in coordination inside the\n * Generic layer — NOT a signal that drives the outer app.)\n */\n configChanged: EventEmitter<TConfig>; // case-violation-ok-legacy-back-compat: the type is named in an exported signature, so consumers build object literals against it; an interface has no runtime carrier for a stub\n\n /**\n * Optional: ask the container to (re)load the record set differently. The ONLY data-access\n * channel a plug-in has, fully generic — the container honors the request (sort / page /\n * load-all) without knowing which plug-in asked or why. A grid emits sort/page; a map emits\n * `{ loadAll: true }`; a plug-in happy with the records it's given emits nothing. The container\n * owns the actual `RunView`; no per-view-type branching. (Container ↔ plug-in coordination —\n * NOT a signal that drives the outer app.)\n */\n dataRequest?: EventEmitter<ViewDataRequest>; // case-violation-ok-legacy-back-compat: the type is named in an exported signature, so consumers build object literals against it; an interface has no runtime carrier for a stub\n\n /**\n * Optional: ask the host to open this view's configuration UI (e.g. the workspace's config\n * panel). Generic — every view type has configurable settings (the descriptor's\n * {@link IViewTypeDescriptor.PropSheetComponent}); a plug-in raises this when the user invokes\n * an in-renderer affordance for it (e.g. the grid's \"Manage Columns\" toolbar item). The\n * container forwards it to the host, which owns the config UI; no per-view-type branching.\n * (Container ↔ plug-in coordination — NOT a signal that drives the outer app.)\n */\n configureRequested?: EventEmitter<void>; // case-violation-ok-legacy-back-compat: the type is named in an exported signature, so consumers build object literals against it; an interface has no runtime carrier for a stub\n\n /**\n * Optional IMPERATIVE export entry point. A renderer that owns a self-contained export\n * affordance (e.g. the grid's export dialog) may expose this so an external driver — the\n * host's programmatic API, ultimately the AI agent — can trigger an export of the current\n * record set WITHOUT going through the renderer's own toolbar UI. Renderers that don't\n * support export simply don't implement it (the host treats absence as \"not exportable\").\n *\n * This is NOT a navigation/UI-coordination signal — it's a direct method call the host makes\n * on the active renderer, mirroring how export is otherwise self-contained in the plug-in.\n *\n * @param format optional output format ('csv' | 'excel' | 'json'); the renderer picks a sensible\n * default (typically 'excel') when omitted.\n * @returns true when the export was initiated, false when it couldn't be (no data / unsupported).\n */\n exportRecords?(format?: 'csv' | 'excel' | 'json'): Promise<boolean>; // case-violation-ok-legacy-back-compat: the type is named in an exported signature, so consumers build object literals against it; an interface has no runtime carrier for a stub\n\n /**\n * Optional: the columns this renderer is showing, in on-screen order and with on-screen headers.\n * A host that exports on the renderer's behalf (the workspace toolbar's Export) uses this so its\n * export matches the screen. Renderers without a column layout (Cards, Map, Timeline) omit it and\n * the host falls back to the view's saved columns.\n */\n GetExportColumns?(): ExportColumn[];\n}\n\n/**\n * A generic, view-type-agnostic request from a renderer for the host to change how it loads the\n * record set. Every field is optional; the host applies whatever is present. No field names a\n * specific view type — these are universal data-access concepts.\n */\nexport interface ViewDataRequest {\n /** Desired sort, applied to the host's RunView OrderBy. Empty/omitted clears sorting. */\n sort?: Array<{ field: string; direction: 'asc' | 'desc' }>;\n /** One-based page to load (for paginated views). */\n page?: number;\n /** Page size to load. */\n pageSize?: number;\n /** When true, the host loads the full result set (up to its safety cap) instead of paginating. */\n loadAll?: boolean;\n}\n\n/**\n * A NAVIGATION request to open a record on a (possibly different) entity — the generic payload\n * for {@link IViewRenderer.openRelatedRecordRequested}. Routing lives in the outer app, so this\n * is one of the few signals that legitimately bubbles up. The container forwards it untouched.\n */\nexport interface ViewRelatedRecordNavigation {\n /** The entity whose record should be opened. */\n entityName: string;\n /** The record's key — a composite-key string or the raw key value(s). Opaque to the container. */\n recordKey: unknown;\n}\n\n/**\n * Contract honored by a view-type configuration prop-sheet component.\n *\n * @typeParam TConfig the shape of the configuration object being edited\n */\nexport interface IViewPropSheet<TConfig = unknown> {\n /** The entity the configuration applies to. */\n entity: EntityInfo | null; // case-violation-ok-legacy-back-compat: the type is named in an exported signature, so consumers build object literals against it; an interface has no runtime carrier for a stub\n\n /** The current configuration being edited. */\n config: TConfig; // case-violation-ok-legacy-back-compat: the type is named in an exported signature, so consumers build object literals against it; an interface has no runtime carrier for a stub\n\n /** Emitted when the user changes the configuration. */\n configChange: EventEmitter<TConfig>; // case-violation-ok-legacy-back-compat: the type is named in an exported signature, so consumers build object literals against it; an interface has no runtime carrier for a stub\n}\n\n/**\n * Abstract base class for all view-type descriptors.\n *\n * Concrete descriptors extend this and register themselves with the ClassFactory:\n *\n * ```typescript\n * @RegisterClass(BaseViewTypeDescriptor, 'GridViewType')\n * export class GridViewType extends BaseViewTypeDescriptor {\n * readonly Name = 'GridViewType';\n * readonly DisplayName = 'Grid';\n * readonly Icon = 'fa-solid fa-table';\n * readonly RendererComponent = EntityDataGridComponent;\n * IsAvailableFor(): boolean { return true; }\n * }\n * ```\n *\n * The {@link ViewTypeEngine} resolves descriptors by `DriverClass` name after\n * probing ClassFactory registrations, then `CreateInstance`. Unregistered keys\n * (e.g. a seeded TagCloud row) are omitted rather than falling back to this base.\n *\n * NOTE: This class is registered with the ClassFactory itself (via subclasses) and is\n * intentionally NOT decorated — only concrete subclasses carry `@RegisterClass`.\n */\nexport abstract class BaseViewTypeDescriptor implements IViewTypeDescriptor {\n abstract readonly Name: string;\n abstract readonly DisplayName: string;\n abstract readonly Icon: string;\n abstract readonly RendererComponent: Type<unknown>;\n readonly PropSheetComponent?: Type<unknown>;\n\n /**\n * Default: this view type uses its own opaque per-view-type config (stored in\n * `DisplayState.viewTypeConfigs`). Override to `true` in a view type that renders the\n * canonical grid columns (see {@link IViewTypeDescriptor.UsesCanonicalGridState}).\n */\n readonly UsesCanonicalGridState: boolean = false;\n\n /**\n * Default: this view type has no built-in export UI, so a host should provide a fallback Export\n * affordance. Override to `true` in a view type that ships its own export (see\n * {@link IViewTypeDescriptor.ProvidesOwnExport}).\n */\n readonly ProvidesOwnExport: boolean = false;\n\n /**\n * Default availability: available for every entity. Override in subclasses that have\n * requirements (e.g. Timeline needs a date field, Map needs geocoding).\n */\n IsAvailableFor(_entity: EntityInfo, _provider?: IMetadataProvider): boolean {\n return true;\n }\n\n /**\n * Default: nothing to preload. Override in subclasses whose availability predicate needs\n * async data (e.g. the Cluster view type loading which entities have Entity Documents).\n */\n async EnsureAvailabilityData(_provider?: IMetadataProvider): Promise<void> {\n // no-op by default\n }\n}\n\n/**\n * Tree-shaking guard. Force-references {@link RegisterClass} so bundlers don't drop the\n * decorator import in builds that only touch this contracts module. Concrete descriptor\n * modules each carry their own `@RegisterClass` and load guard, but this keeps the base\n * module self-consistent.\n */\nexport function LoadViewTypeContracts(): void {\n // no-op; presence prevents tree-shaking of this module's side-effect-free exports\n void RegisterClass;\n}\n"]}
1
+ {"version":3,"file":"view-type.contracts.js","sourceRoot":"","sources":["../../../src/lib/view-types/view-type.contracts.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAoRvD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,OAAgB,sBAAsB;IAKjC,kBAAkB,CAAiB;IAE5C;;;;OAIG;IACM,sBAAsB,GAAY,KAAK,CAAC;IAEjD;;;;OAIG;IACM,iBAAiB,GAAY,KAAK,CAAC;IAE5C;;;OAGG;IACH,cAAc,CAAC,OAAmB,EAAE,SAA6B;QAC/D,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,sBAAsB,CAAC,SAA6B;QACxD,mBAAmB;IACrB,CAAC;CACF;AAED;;;;;GAKG;AACH,MAAM,UAAU,qBAAqB;IACnC,kFAAkF;IAClF,KAAK,aAAa,CAAC;AACrB,CAAC","sourcesContent":["import { Type, EventEmitter } from '@angular/core';\nimport { EntityInfo, IMetadataProvider } from '@memberjunction/core';\nimport { ExportColumn } from '@memberjunction/export-engine';\nimport { RegisterClass } from '@memberjunction/global';\n\n/**\n * View-Type Plugin Architecture — Contracts\n * -----------------------------------------\n * This file defines the framework-level contracts for the entity-viewer's pluggable\n * view-type system. A \"view type\" is a way of rendering a set of entity records — the\n * built-in ones being Grid, Cards, Timeline, and Map, with future additions like\n * Cluster and Tag Cloud.\n *\n * The design separates three concerns:\n * 1. {@link IViewTypeDescriptor} — metadata + availability + the component types to mount.\n * Descriptors are discovered at runtime via the {@link https MemberJunction ClassFactory}\n * keyed off the `DriverClass` stored in the `MJ: View Types` entity.\n * 2. {@link IViewRenderer} — the contract a renderer component honors so the host can\n * feed it data and listen for selection/open/config events uniformly.\n * 3. {@link IViewPropSheet} — the contract a configuration prop-sheet component honors.\n *\n * Because this lives in an Angular package, it is acceptable for the descriptor to reference\n * Angular's `Type<T>` (it points at the concrete component classes to instantiate).\n */\n\n/**\n * Framework-agnostic-ish descriptor for a single view type.\n *\n * A descriptor is the bridge between the `MJ: View Types` metadata row (which stores\n * the `DriverClass` name) and the concrete Angular components that actually render the\n * view and edit its configuration. Descriptors are registered with the ClassFactory via\n * `@RegisterClass(BaseViewTypeDescriptor, '<DriverClass>')` so they can be discovered by\n * name without a hard import from the host.\n */\nexport interface IViewTypeDescriptor {\n /**\n * Stable internal key for the view type — matches the `DriverClass` column on the\n * `MJ: View Types` entity and the `@RegisterClass` registration key\n * (e.g. \"GridViewType\", \"CardsViewType\").\n */\n readonly Name: string;\n\n /** User-facing label shown in the view-mode switcher (e.g. \"Grid\", \"Tag Cloud\"). */\n readonly DisplayName: string;\n\n /** Font Awesome icon class shown in the switcher (e.g. \"fa-solid fa-table\"). */\n readonly Icon: string;\n\n /**\n * The Angular component class that renders this view type. The host instantiates /\n * mounts this component and feeds it data per the {@link IViewRenderer} contract.\n */\n readonly RendererComponent: Type<unknown>;\n\n /**\n * Optional Angular component class for this view type's configuration prop-sheet\n * (honors {@link IViewPropSheet}). Undefined when the view type has no configurable\n * options.\n */\n readonly PropSheetComponent?: Type<unknown>;\n\n /**\n * When `true`, this view type's `config.gridState` is backed by the **canonical**\n * `UserView.GridState` column (the single, framework-wide store for a view's\n * columns / sort / filter / aggregates — also read by `MJUserViewEntity.Columns`,\n * the GraphQL data provider's field list, and export) rather than by an opaque\n * per-view-type blob in `DisplayState.viewTypeConfigs`.\n *\n * The container honors this by (a) seeding the renderer's `config.gridState` from\n * the canonical store and (b) routing the renderer's `configChanged.gridState`\n * back to it on persist. This keeps the grid, the config panel, the server query,\n * and export all reading/writing one source of truth. Defaults to `false`, so\n * non-grid view types (Cards/Timeline/Map) keep their opaque per-type config.\n */\n readonly UsesCanonicalGridState?: boolean;\n\n /**\n * When `true`, this view type ships its OWN in-view export affordance (e.g. the Grid renderer's\n * in-toolbar \"Export\" button + {@link IViewRenderer.exportRecords}). Hosts use this to decide\n * whether to render a FALLBACK export button for view types that DON'T (Cards / Map / Timeline),\n * so every view type can export without a duplicate button on the ones that already have one.\n * Defaults to `false`. This is read off the (synchronously-resolved) descriptor rather than the\n * mounted renderer instance, so it's correct the instant the active view type changes.\n */\n readonly ProvidesOwnExport?: boolean;\n\n /**\n * Predicate that decides whether this view type is available for a given entity.\n * For example, Timeline requires a date field; Map requires geocoding support.\n * Grid and Cards are always available.\n *\n * @param entity the entity the viewer is currently displaying\n * @param provider optional metadata provider (for multi-provider scenarios)\n */\n IsAvailableFor(entity: EntityInfo, provider?: IMetadataProvider): boolean;\n\n /**\n * Optional async hook to load any data this descriptor's {@link IsAvailableFor} predicate\n * depends on (e.g. the Cluster view type needs the set of entities that have an active\n * Entity Document with vectors). The host awaits this once — before computing availability —\n * so the synchronous predicate can read from a now-populated cache. Implementations should\n * be cheap/idempotent (typically `await SomeEngine.Instance.Config(false, ...)`). Omit when\n * availability is computable purely from the {@link EntityInfo} (Grid/Cards/Timeline/Map).\n *\n * @param provider optional metadata provider (for multi-provider scenarios)\n */\n EnsureAvailabilityData?(provider?: IMetadataProvider): Promise<void>;\n}\n\n/**\n * Contract honored by a view renderer component. The host binds these inputs and\n * subscribes to these outputs uniformly across all view types.\n *\n * @typeParam TConfig the shape of this view type's configuration object\n */\nexport interface IViewRenderer<TConfig = unknown> {\n /** The entity whose records are being rendered. */\n entity: EntityInfo | null; // case-violation-ok-legacy-back-compat: the type is named in an exported signature, so consumers build object literals against it; an interface has no runtime carrier for a stub\n\n /** The records to render (already loaded/filtered by the host). */\n records: Record<string, unknown>[]; // case-violation-ok-legacy-back-compat: the type is named in an exported signature, so consumers build object literals against it; an interface has no runtime carrier for a stub\n\n /** Primary-key string of the currently selected record, if any. */\n selectedRecordId: string | null; // case-violation-ok-legacy-back-compat: the type is named in an exported signature, so consumers build object literals against it; an interface has no runtime carrier for a stub\n\n /** Active filter text (for highlighting / client-side concerns). */\n filterText: string | null; // case-violation-ok-legacy-back-compat: the type is named in an exported signature, so consumers build object literals against it; an interface has no runtime carrier for a stub\n\n /** View-type-specific configuration. */\n config: TConfig; // case-violation-ok-legacy-back-compat: the type is named in an exported signature, so consumers build object literals against it; an interface has no runtime carrier for a stub\n\n /**\n * Optional: the metadata provider, handed to plug-ins that issue their own data calls\n * (multi-provider safety). Generic — not specific to any one view type.\n */\n provider?: IMetadataProvider | null; // case-violation-ok-legacy-back-compat: the type is named in an exported signature, so consumers build object literals against it; an interface has no runtime carrier for a stub\n\n /**\n * Optional generic data-context the host supplies alongside {@link records}. These are\n * universal \"a view of records\" concepts (counts, current page, loading) — NOT specific to any\n * view type — so a renderer that paginates or shows a total can read them, and one that doesn't\n * simply ignores them. The host owns the actual data fetch; these describe its current result.\n */\n totalRecordCount?: number; // case-violation-ok-legacy-back-compat: the type is named in an exported signature, so consumers build object literals against it; an interface has no runtime carrier for a stub\n /** One-based current page of {@link records} when the host is paginating. */\n page?: number; // case-violation-ok-legacy-back-compat: the type is named in an exported signature, so consumers build object literals against it; an interface has no runtime carrier for a stub\n /** Page size the host is using. */\n pageSize?: number; // case-violation-ok-legacy-back-compat: the type is named in an exported signature, so consumers build object literals against it; an interface has no runtime carrier for a stub\n /** Whether the host is currently (re)loading the record set. */\n isLoading?: boolean; // case-violation-ok-legacy-back-compat: the type is named in an exported signature, so consumers build object literals against it; an interface has no runtime carrier for a stub\n /**\n * Optional ID of the persisted `MJ: User Views` record backing the current record set, or `null`\n * for a dynamic / unsaved view. Generic view context — lets a renderer offer saved-view actions\n * (such as Open in Excel) without taking ownership of the `UserView` entity record.\n */\n SavedViewID?: string | null;\n\n /** Emitted when a record is selected (single click). Payload is the raw record object. */\n recordSelected: EventEmitter<unknown>; // case-violation-ok-legacy-back-compat: the type is named in an exported signature, so consumers build object literals against it; an interface has no runtime carrier for a stub\n\n /**\n * Emitted when THIS entity's record should be opened (double-click / open). Payload is the raw\n * record. This is a NAVIGATION request — the only category of signal that legitimately bubbles\n * to the outer app (routing lives there). Everything else a view does (export, add-to-list,\n * delete, …) is self-contained in the plug-in via Generic dialogs and never bubbles up.\n */\n recordOpened: EventEmitter<unknown>; // case-violation-ok-legacy-back-compat: the type is named in an exported signature, so consumers build object literals against it; an interface has no runtime carrier for a stub\n\n /**\n * Optional: NAVIGATION request to open a *related* record on a DIFFERENT entity (e.g. a\n * foreign-key drill-through in a grid cell). Bubbles to the outer app for routing. Generic —\n * the container forwards it without acting on it.\n */\n openRelatedRecordRequested?: EventEmitter<ViewRelatedRecordNavigation>; // case-violation-ok-legacy-back-compat: the type is named in an exported signature, so consumers build object literals against it; an interface has no runtime carrier for a stub\n\n /**\n * Optional: NAVIGATION request to create a new record of the current entity (e.g. a grid's\n * \"New\" button) — opening the create form is a routing concern owned by the outer app. Bubbles\n * up; the container forwards it without acting on it.\n */\n createRecordRequested?: EventEmitter<void>; // case-violation-ok-legacy-back-compat: the type is named in an exported signature, so consumers build object literals against it; an interface has no runtime carrier for a stub\n\n /**\n * Emitted when the renderer mutates its own opaque {@link config} (e.g. timeline date field,\n * grid columns/sort/widths, map render mode). The container persists the blob verbatim against\n * the active `ViewTypeID` and never inspects it. (Container ↔ plug-in coordination inside the\n * Generic layer — NOT a signal that drives the outer app.)\n */\n configChanged: EventEmitter<TConfig>; // case-violation-ok-legacy-back-compat: the type is named in an exported signature, so consumers build object literals against it; an interface has no runtime carrier for a stub\n\n /**\n * Optional: ask the container to (re)load the record set differently. The ONLY data-access\n * channel a plug-in has, fully generic — the container honors the request (sort / page /\n * load-all) without knowing which plug-in asked or why. A grid emits sort/page; a map emits\n * `{ loadAll: true }`; a plug-in happy with the records it's given emits nothing. The container\n * owns the actual `RunView`; no per-view-type branching. (Container ↔ plug-in coordination —\n * NOT a signal that drives the outer app.)\n */\n dataRequest?: EventEmitter<ViewDataRequest>; // case-violation-ok-legacy-back-compat: the type is named in an exported signature, so consumers build object literals against it; an interface has no runtime carrier for a stub\n\n /**\n * Optional: ask the host to open this view's configuration UI (e.g. the workspace's config\n * panel). Generic — every view type has configurable settings (the descriptor's\n * {@link IViewTypeDescriptor.PropSheetComponent}); a plug-in raises this when the user invokes\n * an in-renderer affordance for it (e.g. the grid's \"Manage Columns\" toolbar item). The\n * container forwards it to the host, which owns the config UI; no per-view-type branching.\n * (Container ↔ plug-in coordination — NOT a signal that drives the outer app.)\n */\n configureRequested?: EventEmitter<void>; // case-violation-ok-legacy-back-compat: the type is named in an exported signature, so consumers build object literals against it; an interface has no runtime carrier for a stub\n\n /**\n * Optional IMPERATIVE export entry point. A renderer that owns a self-contained export\n * affordance (e.g. the grid's export dialog) may expose this so an external driver — the\n * host's programmatic API, ultimately the AI agent — can trigger an export of the current\n * record set WITHOUT going through the renderer's own toolbar UI. Renderers that don't\n * support export simply don't implement it (the host treats absence as \"not exportable\").\n *\n * This is NOT a navigation/UI-coordination signal — it's a direct method call the host makes\n * on the active renderer, mirroring how export is otherwise self-contained in the plug-in.\n *\n * @param format optional output format ('csv' | 'excel' | 'json'); the renderer picks a sensible\n * default (typically 'excel') when omitted.\n * @returns true when the export was initiated, false when it couldn't be (no data / unsupported).\n */\n exportRecords?(format?: 'csv' | 'excel' | 'json'): Promise<boolean>; // case-violation-ok-legacy-back-compat: the type is named in an exported signature, so consumers build object literals against it; an interface has no runtime carrier for a stub\n\n /**\n * Optional: the columns this renderer is showing, in on-screen order and with on-screen headers.\n * A host that exports on the renderer's behalf (the workspace toolbar's Export) uses this so its\n * export matches the screen. Renderers without a column layout (Cards, Map, Timeline) omit it and\n * the host falls back to the view's saved columns.\n */\n GetExportColumns?(): ExportColumn[];\n}\n\n/**\n * A generic, view-type-agnostic request from a renderer for the host to change how it loads the\n * record set. Every field is optional; the host applies whatever is present. No field names a\n * specific view type — these are universal data-access concepts.\n */\nexport interface ViewDataRequest {\n /** Desired sort, applied to the host's RunView OrderBy. Empty/omitted clears sorting. */\n sort?: Array<{ field: string; direction: 'asc' | 'desc' }>;\n /** One-based page to load (for paginated views). */\n page?: number;\n /** Page size to load. */\n pageSize?: number;\n /** When true, the host loads the full result set (up to its safety cap) instead of paginating. */\n loadAll?: boolean;\n}\n\n/**\n * A NAVIGATION request to open a record on a (possibly different) entity — the generic payload\n * for {@link IViewRenderer.openRelatedRecordRequested}. Routing lives in the outer app, so this\n * is one of the few signals that legitimately bubbles up. The container forwards it untouched.\n */\nexport interface ViewRelatedRecordNavigation {\n /** The entity whose record should be opened. */\n entityName: string;\n /** The record's key — a composite-key string or the raw key value(s). Opaque to the container. */\n recordKey: unknown;\n}\n\n/**\n * Contract honored by a view-type configuration prop-sheet component.\n *\n * @typeParam TConfig the shape of the configuration object being edited\n */\nexport interface IViewPropSheet<TConfig = unknown> {\n /** The entity the configuration applies to. */\n entity: EntityInfo | null; // case-violation-ok-legacy-back-compat: the type is named in an exported signature, so consumers build object literals against it; an interface has no runtime carrier for a stub\n\n /** The current configuration being edited. */\n config: TConfig; // case-violation-ok-legacy-back-compat: the type is named in an exported signature, so consumers build object literals against it; an interface has no runtime carrier for a stub\n\n /** Emitted when the user changes the configuration. */\n configChange: EventEmitter<TConfig>; // case-violation-ok-legacy-back-compat: the type is named in an exported signature, so consumers build object literals against it; an interface has no runtime carrier for a stub\n}\n\n/**\n * Abstract base class for all view-type descriptors.\n *\n * Concrete descriptors extend this and register themselves with the ClassFactory:\n *\n * ```typescript\n * @RegisterClass(BaseViewTypeDescriptor, 'GridViewType')\n * export class GridViewType extends BaseViewTypeDescriptor {\n * readonly Name = 'GridViewType';\n * readonly DisplayName = 'Grid';\n * readonly Icon = 'fa-solid fa-table';\n * readonly RendererComponent = EntityDataGridComponent;\n * IsAvailableFor(): boolean { return true; }\n * }\n * ```\n *\n * The {@link ViewTypeEngine} resolves descriptors by `DriverClass` name after\n * probing ClassFactory registrations, then `CreateInstance`. Unregistered keys\n * (e.g. a seeded TagCloud row) are omitted rather than falling back to this base.\n *\n * NOTE: This class is registered with the ClassFactory itself (via subclasses) and is\n * intentionally NOT decorated — only concrete subclasses carry `@RegisterClass`.\n */\nexport abstract class BaseViewTypeDescriptor implements IViewTypeDescriptor {\n abstract readonly Name: string;\n abstract readonly DisplayName: string;\n abstract readonly Icon: string;\n abstract readonly RendererComponent: Type<unknown>;\n readonly PropSheetComponent?: Type<unknown>;\n\n /**\n * Default: this view type uses its own opaque per-view-type config (stored in\n * `DisplayState.viewTypeConfigs`). Override to `true` in a view type that renders the\n * canonical grid columns (see {@link IViewTypeDescriptor.UsesCanonicalGridState}).\n */\n readonly UsesCanonicalGridState: boolean = false;\n\n /**\n * Default: this view type has no built-in export UI, so a host should provide a fallback Export\n * affordance. Override to `true` in a view type that ships its own export (see\n * {@link IViewTypeDescriptor.ProvidesOwnExport}).\n */\n readonly ProvidesOwnExport: boolean = false;\n\n /**\n * Default availability: available for every entity. Override in subclasses that have\n * requirements (e.g. Timeline needs a date field, Map needs geocoding).\n */\n IsAvailableFor(_entity: EntityInfo, _provider?: IMetadataProvider): boolean {\n return true;\n }\n\n /**\n * Default: nothing to preload. Override in subclasses whose availability predicate needs\n * async data (e.g. the Cluster view type loading which entities have Entity Documents).\n */\n async EnsureAvailabilityData(_provider?: IMetadataProvider): Promise<void> {\n // no-op by default\n }\n}\n\n/**\n * Tree-shaking guard. Force-references {@link RegisterClass} so bundlers don't drop the\n * decorator import in builds that only touch this contracts module. Concrete descriptor\n * modules each carry their own `@RegisterClass` and load guard, but this keeps the base\n * module self-consistent.\n */\nexport function LoadViewTypeContracts(): void {\n // no-op; presence prevents tree-shaking of this module's side-effect-free exports\n void RegisterClass;\n}\n"]}
@@ -402,6 +402,14 @@ export declare class ViewWorkspaceComponent extends BaseAngularComponent impleme
402
402
  constructor(cdr: ChangeDetectorRef);
403
403
  /** Controls the workspace-level export dialog (the same generic dialog the grid uses). */
404
404
  ShowExportDialog: boolean;
405
+ /**
406
+ * True only when the active view type does NOT provide its own toolbar Export button (e.g. Cards,
407
+ * Map, Timeline). When Grid is active, the grid toolbar already renders Export, so the top
408
+ * selector bar suppresses its duplicate Export icon.
409
+ */
410
+ ShowFallbackExportButton: boolean;
411
+ /** Recomputes {@link ShowFallbackExportButton} when the inner viewer resolves or switches view types. */
412
+ OnActiveViewTypeResolved(): void;
405
413
  /** @deprecated Use {@link ShowExportDialog}. */
406
414
  get showExportDialog(): boolean;
407
415
  /** @deprecated Use {@link ShowExportDialog}. */
@@ -572,6 +580,18 @@ export declare class ViewWorkspaceComponent extends BaseAngularComponent impleme
572
580
  OnCloseConfigPanel(): void;
573
581
  /** @deprecated Use {@link OnCloseConfigPanel}. */
574
582
  onCloseConfigPanel(): void;
583
+ /**
584
+ * Handle the config panel switching from "Save as New Named View" to "Personal Default Layout".
585
+ * Exits the new-view flow inside the open Studio session while deferring view deselection and
586
+ * `ViewSelected(null)` emission until the user commits "Save Default Layout" — so cancelling
587
+ * the Studio preserves the previously selected view, grid rows, and host URL deep link (#6037).
588
+ */
589
+ OnSwitchToDefaultLayout(): void;
590
+ /**
591
+ * Commit deselection of any active saved view or ad-hoc alternate base view when saving the
592
+ * user's Personal Default Layout (#6037).
593
+ */
594
+ private deselectActiveViewForDefaultLayout;
575
595
  /** Reset the carry-over state used when continuing a new-view flow into the config panel. */
576
596
  private clearPendingNewViewState;
577
597
  /** Open the full-width filter dialog from the config panel's request. */