@memberjunction/ng-entity-viewer 5.43.0 → 5.45.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/dist/lib/aggregate-panel/aggregate-panel.component.d.ts +5 -0
  2. package/dist/lib/aggregate-panel/aggregate-panel.component.d.ts.map +1 -1
  3. package/dist/lib/aggregate-panel/aggregate-panel.component.js +45 -47
  4. package/dist/lib/aggregate-panel/aggregate-panel.component.js.map +1 -1
  5. package/dist/lib/entity-cards/entity-cards.component.js +7 -10
  6. package/dist/lib/entity-cards/entity-cards.component.js.map +1 -1
  7. package/dist/lib/entity-data-grid/entity-data-grid.component.d.ts +10 -1
  8. package/dist/lib/entity-data-grid/entity-data-grid.component.d.ts.map +1 -1
  9. package/dist/lib/entity-data-grid/entity-data-grid.component.js +35 -34
  10. package/dist/lib/entity-data-grid/entity-data-grid.component.js.map +1 -1
  11. package/dist/lib/entity-record-detail-panel/entity-record-detail-panel.component.d.ts +0 -4
  12. package/dist/lib/entity-record-detail-panel/entity-record-detail-panel.component.d.ts.map +1 -1
  13. package/dist/lib/entity-record-detail-panel/entity-record-detail-panel.component.js +166 -207
  14. package/dist/lib/entity-record-detail-panel/entity-record-detail-panel.component.js.map +1 -1
  15. package/dist/lib/entity-viewer/entity-viewer.component.d.ts +109 -5
  16. package/dist/lib/entity-viewer/entity-viewer.component.d.ts.map +1 -1
  17. package/dist/lib/entity-viewer/entity-viewer.component.js +287 -42
  18. package/dist/lib/entity-viewer/entity-viewer.component.js.map +1 -1
  19. package/dist/lib/recycle-bin/recycle-bin.component.js +21 -44
  20. package/dist/lib/recycle-bin/recycle-bin.component.js.map +1 -1
  21. package/dist/lib/shared-view-warning-dialog/shared-view-warning-dialog.component.js +19 -20
  22. package/dist/lib/shared-view-warning-dialog/shared-view-warning-dialog.component.js.map +1 -1
  23. package/dist/lib/view-config-panel/view-config-panel.component.js +268 -301
  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 +26 -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 +118 -76
  28. package/dist/lib/view-selector/view-selector.component.js.map +1 -1
  29. package/dist/lib/view-types/descriptors/grid-view-type.d.ts +7 -0
  30. package/dist/lib/view-types/descriptors/grid-view-type.d.ts.map +1 -1
  31. package/dist/lib/view-types/descriptors/grid-view-type.js +7 -0
  32. package/dist/lib/view-types/descriptors/grid-view-type.js.map +1 -1
  33. package/dist/lib/view-types/renderers/grid-view-renderer.component.d.ts +18 -1
  34. package/dist/lib/view-types/renderers/grid-view-renderer.component.d.ts.map +1 -1
  35. package/dist/lib/view-types/renderers/grid-view-renderer.component.js +29 -3
  36. package/dist/lib/view-types/renderers/grid-view-renderer.component.js.map +1 -1
  37. package/dist/lib/view-types/renderers/map-view-renderer.component.d.ts.map +1 -1
  38. package/dist/lib/view-types/renderers/map-view-renderer.component.js +11 -14
  39. package/dist/lib/view-types/renderers/map-view-renderer.component.js.map +1 -1
  40. package/dist/lib/view-types/renderers/timeline-view-renderer.component.d.ts.map +1 -1
  41. package/dist/lib/view-types/renderers/timeline-view-renderer.component.js +12 -14
  42. package/dist/lib/view-types/renderers/timeline-view-renderer.component.js.map +1 -1
  43. package/dist/lib/view-types/view-type.contracts.d.ts +44 -0
  44. package/dist/lib/view-types/view-type.contracts.d.ts.map +1 -1
  45. package/dist/lib/view-types/view-type.contracts.js +6 -0
  46. package/dist/lib/view-types/view-type.contracts.js.map +1 -1
  47. package/dist/lib/view-workspace/view-workspace.component.d.ts +32 -1
  48. package/dist/lib/view-workspace/view-workspace.component.d.ts.map +1 -1
  49. package/dist/lib/view-workspace/view-workspace.component.js +68 -7
  50. package/dist/lib/view-workspace/view-workspace.component.js.map +1 -1
  51. package/dist/module.d.ts +1 -1
  52. package/dist/module.d.ts.map +1 -1
  53. package/dist/module.js +10 -1
  54. package/dist/module.js.map +1 -1
  55. package/package.json +18 -17
  56. package/dist/__tests__/entity-cards-selection.test.d.ts +0 -2
  57. package/dist/__tests__/entity-cards-selection.test.d.ts.map +0 -1
  58. package/dist/__tests__/entity-cards-selection.test.js +0 -149
  59. package/dist/__tests__/entity-cards-selection.test.js.map +0 -1
  60. package/dist/__tests__/entity-cards-viewmodel.test.d.ts +0 -2
  61. package/dist/__tests__/entity-cards-viewmodel.test.d.ts.map +0 -1
  62. package/dist/__tests__/entity-cards-viewmodel.test.js +0 -208
  63. package/dist/__tests__/entity-cards-viewmodel.test.js.map +0 -1
  64. package/dist/__tests__/highlight.test.d.ts +0 -2
  65. package/dist/__tests__/highlight.test.d.ts.map +0 -1
  66. package/dist/__tests__/highlight.test.js +0 -67
  67. package/dist/__tests__/highlight.test.js.map +0 -1
  68. package/dist/__tests__/index.test.d.ts +0 -2
  69. package/dist/__tests__/index.test.d.ts.map +0 -1
  70. package/dist/__tests__/index.test.js +0 -7
  71. package/dist/__tests__/index.test.js.map +0 -1
  72. package/dist/__tests__/view-types.test.d.ts +0 -2
  73. package/dist/__tests__/view-types.test.d.ts.map +0 -1
  74. package/dist/__tests__/view-types.test.js +0 -102
  75. package/dist/__tests__/view-types.test.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"entity-viewer.component.js","sourceRoot":"","sources":["../../../src/lib/entity-viewer/entity-viewer.component.ts","../../../src/lib/entity-viewer/entity-viewer.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAAmE,SAAS,EAAU,gBAAgB,EAAgB,oBAAoB,EAAE,MAAM,eAAe,CAAC;AACjN,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/B,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC/E,OAAO,EAA+B,OAA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2B;;;iFDgDjD,qBAAqB;cATjC,SAAS;6BACI,KAAK,YACP,kBAAkB,QAGtB;oBACJ,OAAO,EAAE,+BAA+B;iBACzC;;kBAmCA,KAAK;;kBA4EL,KAAK;;kBAeL,KAAK;;kBAgBL,KAAK;;kBAUL,KAAK;;kBAkBL,KAAK;;kBAYL,KAAK;;kBAcL,KAAK;;kBA4BL,KAAK;;kBAiCL,KAAK;;kBA8CL,KAAK;;kBASL,KAAK;;kBASL,MAAM;;kBAKN,MAAM;;kBAKN,MAAM;;kBAKN,MAAM;;kBAKN,MAAM;;kBAQN,MAAM;;kBAON,MAAM;;kBAQN,KAAK;;kBA6DL,KAAK;;kBAoBL,KAAK;;kBAML,MAAM;;kBAMN,MAAM;;kBAKN,MAAM;;kBAMN,MAAM;;kBAGN,SAAS;mBAAC,iBAAiB,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE;;kFArd7C,qBAAqB","sourcesContent":["import { Component, Input, Output, EventEmitter, OnInit, OnDestroy, AfterViewInit, ChangeDetectorRef, ElementRef, ViewChild, NgZone, ViewContainerRef, ComponentRef, reflectComponentType } from '@angular/core';\nimport { BaseAngularComponent } from '@memberjunction/ng-base-types';\nimport { Subject } from 'rxjs';\nimport { debounceTime, distinctUntilChanged, takeUntil } from 'rxjs/operators';\nimport { EntityInfo, EntityFieldInfo, RunView, LogError } from '@memberjunction/core';\nimport { UUIDsEqual } from '@memberjunction/global';\nimport { MJUserViewEntityExtended, UserInfoEngine } from '@memberjunction/core-entities';\nimport { buildCompositeKey, buildPkString } from '../utils/record.util';\nimport { PageChangeEvent } from '@memberjunction/ng-pagination';\nimport {\n EntityViewerConfig,\n DEFAULT_VIEWER_CONFIG,\n RecordSelectedEvent,\n RecordOpenedEvent,\n DataLoadedEvent,\n FilteredCountChangedEvent,\n SortState,\n PaginationState,\n ViewGridState\n} from '../types';\nimport { IViewTypeDescriptor, IViewRenderer, ViewTypeEngine, ViewDataRequest, ViewRelatedRecordNavigation } from '../view-types';\n\n/**\n * A single entry in the view-type switcher, built from the {@link ViewTypeEngine} registry\n * (`MJ: View Types`). Every view type is a dynamic-mounted plug-in implementing `IViewRenderer`;\n * the container has zero knowledge of any specific view type — it mounts the descriptor's\n * `RendererComponent` and feeds it the generic contract.\n */\nexport interface ViewModeOption {\n /**\n * Stable key for this option — the descriptor's `Name` (== `MJ: View Types.DriverClass`),\n * e.g. \"GridViewType\", \"ClusterViewType\". Used as the `@for` track key and to identify the\n * active option.\n */\n key: string;\n /**\n * Always `null` — retained on the interface only so any external reader doesn't break. Every\n * view type is now dynamic-mounted; there is no legacy built-in render mode.\n */\n mode: null;\n /** User-facing label. */\n label: string;\n /** Font Awesome icon class. */\n icon: string;\n /** Always `true` — every view type is dynamic-mounted via the descriptor's RendererComponent. */\n isDynamic: boolean;\n /** The resolved descriptor (carries the RendererComponent + PropSheetComponent). */\n descriptor: IViewTypeDescriptor;\n /** The `MJ: View Types` row ID — for ViewTypeID persistence + per-view-type config keying. */\n viewTypeId: string;\n}\n\n/**\n * Event payload for the view-type change lifecycle. Emitted (cancelable) via\n * {@link EntityViewerComponent.BeforeViewTypeChange} and (notification) via\n * {@link EntityViewerComponent.AfterViewTypeChange}. A handler may set `Cancel = true` on the\n * *Before* event to veto the switch (mirrors the grid's `BeforeRowClick` / `BeforeCellEdit`\n * cancelable pattern).\n */\nexport interface ViewTypeChangeEventArgs {\n /** The `MJ: View Types` row ID being switched to. */\n ViewTypeID: string;\n /** The descriptor `DriverClass` / Name being switched to (e.g. \"ClusterViewType\"). */\n DriverClass: string;\n /** The `MJ: View Types` row ID being switched FROM (null on the first selection). */\n PreviousViewTypeID: string | null;\n /** Set to true in a {@link EntityViewerComponent.BeforeViewTypeChange} handler to veto the switch. */\n Cancel: boolean;\n}\n\n/**\n * Event payload for the per-view-type configuration change lifecycle.\n */\nexport interface ViewTypeConfigChangeEventArgs {\n /** The `MJ: View Types` row ID whose config changed. */\n ViewTypeID: string;\n /** The new configuration payload (shape owned by the plug-in). */\n Config: Record<string, unknown>;\n /** Set to true in a {@link EntityViewerComponent.BeforeViewTypeConfigChange} handler to veto. */\n Cancel: boolean;\n}\n\n/**\n * Where the entity viewer persists view-type/render-state when {@link EntityViewerComponent.AutoSaveView}\n * is enabled:\n * - `'record'` — onto the loaded `UserView` row (shared; everyone who opens that view sees it).\n * - `'user-settings'` — per-user via `UserInfoEngine` (the default-view case, or a personal layer).\n * - `'none'` — nothing to persist to (no view + settings disabled).\n */\nexport type ViewPersistenceTarget = 'record' | 'user-settings' | 'none';\n\n/**\n * EntityViewerComponent - Full-featured composite component for viewing entity data\n *\n * This component provides a complete data viewing experience with:\n * - Switchable grid (AG Grid) and card views\n * - Server-side filtering with UserSearchString\n * - Server-side pagination with StartRow/MaxRows\n * - Server-side sorting with OrderBy\n * - Selection handling with configurable behavior\n * - Loading, empty, and error states\n * - Beautiful pagination UI with \"Load More\" pattern\n *\n * @example\n * ```html\n * <!-- Basic usage - loads data automatically -->\n * <mj-entity-viewer\n * [Entity]=\"selectedEntity\"\n * (RecordSelected)=\"onRecordSelected($event)\"\n * (RecordOpened)=\"onRecordOpened($event)\">\n * </mj-entity-viewer>\n *\n * <!-- With external state control (like Data Explorer) -->\n * <mj-entity-viewer\n * [Entity]=\"selectedEntity\"\n * [ViewTypeID]=\"state.viewTypeId\"\n * [FilterText]=\"state.filterText\"\n * [SelectedRecordID]=\"state.selectedRecordId\"\n * (RecordSelected)=\"onRecordSelected($event)\"\n * (RecordOpened)=\"onRecordOpened($event)\">\n * </mj-entity-viewer>\n * ```\n */\n@Component({\n standalone: false,\n selector: 'mj-entity-viewer',\n templateUrl: './entity-viewer.component.html',\n styleUrls: ['./entity-viewer.component.css'],\n host: {\n 'style': 'display: block; height: 100%;'\n }\n})\nexport class EntityViewerComponent extends BaseAngularComponent implements OnInit, OnDestroy, AfterViewInit {\n /**\n * Safety cap on the number of records loaded when a plug-in renderer asks the container to\n * load the full set (via a {@link ViewDataRequest} with `loadAll: true`). Prevents unbounded\n * queries on very large entities. Generic — not tied to any specific view type.\n */\n private static readonly LOAD_ALL_MAX_RECORDS = 10000;\n\n // ========================================\n // INPUTS (using getter/setter pattern)\n // ========================================\n\n private _entity: EntityInfo | null = null;\n private _records: Record<string, unknown>[] | null = null;\n private _config: Partial<EntityViewerConfig> = {};\n private _filterText: string | null = null;\n private _sortState: SortState | null = null;\n private _viewEntity: MJUserViewEntityExtended | null = null;\n private _initialized = false;\n\n /**\n * When true, the next {@link LoadData} loads the full record set (up to\n * {@link LOAD_ALL_MAX_RECORDS}) instead of paginating. Set generically from a plug-in's\n * {@link ViewDataRequest} (`loadAll`) — never from any view-type check.\n */\n private _loadAllRecords = false;\n\n /** Whether a deferred reload has been queued via deferReload() */\n private _reloadDeferred = false;\n\n /**\n * The entity to display records for\n */\n @Input()\n get Entity(): EntityInfo | null {\n return this._entity;\n }\n set Entity(value: EntityInfo | null) {\n const previousEntity = this._entity;\n this._entity = value;\n\n const entityChanged = !!(this._initialized && value && previousEntity && !UUIDsEqual(value.ID, previousEntity.ID));\n\n // On a real entity change, drop per-entity state BEFORE we recompute view types + re-seed config,\n // so the new entity starts clean:\n // - The per-view-type config map (grid columnSettings, timeline date field, …) is per-ENTITY.\n // Keeping the old entity's config applies its columnSettings to the new entity, so only fields\n // common to both survive (e.g. just Name/Description) — the \"no/too-few columns\" symptom.\n // - The loaded UserView record belongs to the old entity; clear it so re-seeding reads the new\n // entity's saved view / per-user default-view setting.\n // - Sort state references old-entity fields and would produce an invalid ORDER BY.\n if (entityChanged) {\n if (this._viewEntity && value && !UUIDsEqual(this._viewEntity.EntityID, value.ID)) {\n this._viewEntity = null;\n }\n this.viewTypeConfigById.clear();\n this.InternalSortState = null;\n // Throw out the cached plug-in instances — they belong to the previous entity. The next\n // selection rebuilds them fresh for the new entity (correct columns / date fields / geo).\n this.clearDynamicRendererCache();\n }\n\n // Recompute available view types for the new entity from the registry (if loaded). This also\n // re-seeds the per-view-type config from the NEW entity's saved view / default-view setting\n // (now that the stale map was cleared above). Falls back silently when the registry has no data.\n this.refreshAvailableViewTypes();\n\n if (this._initialized) {\n\n if (value && !this._records) {\n // Reset state for new entity - synchronously clear all data and force change detection\n // before starting the async load to prevent stale data display\n this.resetPaginationState();\n this.InternalRecords = [];\n this.TotalRecordCount = 0;\n this.FilteredRecordCount = 0;\n this.cdr.detectChanges();\n // Defer the actual load so all input bindings (viewEntity, gridState, etc.)\n // complete before we fire the RunView — prevents duplicate loads with stale state\n this.deferReload();\n } else if (!value) {\n this.InternalRecords = [];\n this.TotalRecordCount = 0;\n this.FilteredRecordCount = 0;\n this.resetPaginationState();\n this.cdr.detectChanges();\n }\n\n // The cache was thrown out above, so re-create the active view type FRESH for the new entity\n // (unless refreshAvailableViewTypes already re-selected because the active type became\n // unavailable). This rebuilds columns / date fields / geo cleanly; records flow in via the\n // deferred reload. The container stays generic — it re-creates whatever plug-in is active\n // without knowing what it is.\n if (entityChanged && !this.dynamicRendererRef) {\n const activeOption = this.AvailableViewTypes.find(o => o.key === this.ActiveViewTypeKey) ?? this.AvailableViewTypes[0];\n if (activeOption) {\n this.ActiveViewTypeKey = activeOption.key;\n this.ActiveDynamicOption = activeOption;\n this.selectDynamicRenderer(activeOption);\n }\n }\n }\n }\n\n /**\n * Convenience input: the entity to display by **name**. Resolved internally to an `EntityInfo`\n * via the active provider and applied through the {@link entity} setter. Use this OR `[entity]`\n * OR `[EntityID]` — whichever is most convenient for the consumer.\n */\n @Input()\n set EntityName(value: string | null) {\n if (!value) {\n return;\n }\n const resolved = this.ProviderToUse?.EntityByName(value) ?? null;\n if (resolved) {\n this.Entity = resolved;\n }\n }\n\n /**\n * Convenience input: the entity to display by **ID**. Resolved internally to an `EntityInfo`\n * and applied through the {@link entity} setter.\n */\n @Input()\n set EntityID(value: string | null) {\n if (!value) {\n return;\n }\n const resolved = this.ProviderToUse?.Entities.find(e => UUIDsEqual(e.ID, value)) ?? null;\n if (resolved) {\n this.Entity = resolved;\n }\n }\n\n /**\n * Convenience input: load and display a saved view by its `MJ: User Views` **ID**. The viewer\n * loads the record via the active provider and applies it through the {@link viewEntity} setter\n * (which also resolves the entity if `[entity]`/`[EntityName]`/`[EntityID]` weren't supplied).\n */\n @Input()\n set ViewID(value: string | null) {\n if (value) {\n void this.loadViewById(value);\n }\n }\n\n /**\n * Pre-loaded records (optional - if not provided, component loads data)\n */\n @Input()\n get Records(): Record<string, unknown>[] | null {\n return this._records;\n }\n set Records(value: Record<string, unknown>[] | null) {\n this._records = value;\n\n if (value) {\n this.InternalRecords = value;\n this.TotalRecordCount = value.length;\n this.FilteredRecordCount = value.length;\n this.pushDynamicRendererInputs();\n }\n }\n\n /**\n * Configuration options for the viewer\n */\n @Input()\n get Config(): Partial<EntityViewerConfig> {\n return this._config;\n }\n set Config(value: Partial<EntityViewerConfig>) {\n this._config = value;\n this.applyConfig();\n }\n\n /**\n * Currently selected record ID (primary key string)\n */\n @Input()\n get SelectedRecordID(): string | null {\n return this._selectedRecordId;\n }\n set SelectedRecordID(value: string | null) {\n this._selectedRecordId = value;\n this.pushDynamicRendererInputs();\n }\n private _selectedRecordId: string | null = null;\n\n /**\n * External filter text - allows parent to control filter\n * Supports two-way binding: [(filterText)]=\"state.filterText\"\n */\n @Input()\n get FilterText(): string | null {\n return this._filterText;\n }\n set FilterText(value: string | null) {\n const oldFilter = this.DebouncedFilterText;\n this._filterText = value;\n\n const newFilter = value ?? '';\n this.InternalFilterText = newFilter;\n this.DebouncedFilterText = newFilter;\n\n if (this._initialized) {\n // If server-side filtering and filter changed, reload from page 1\n // Keep existing records visible during refresh for better UX\n if (this.EffectiveConfig.serverSideFiltering && newFilter !== oldFilter && !this._records) {\n this.resetPaginationState(false);\n this.LoadData();\n } else {\n this.updateFilteredCount();\n }\n this.cdr.detectChanges();\n }\n }\n\n /**\n * External sort state - allows parent to control sorting\n */\n @Input()\n get SortState(): SortState | null {\n return this._sortState;\n }\n set SortState(value: SortState | null) {\n const oldSort = this.InternalSortState;\n this._sortState = value;\n\n if (value !== null) {\n this.InternalSortState = value;\n\n if (this._initialized) {\n // If sort changed and using server-side sorting, reload\n // Keep existing records visible during refresh for better UX\n if (this.EffectiveConfig.serverSideSorting && !this._records) {\n const sortChanged = !oldSort || !value ||\n oldSort.field !== value.field ||\n oldSort.direction !== value.direction;\n\n if (sortChanged) {\n this.resetPaginationState(false);\n this.LoadData();\n }\n }\n }\n }\n }\n\n /**\n * Optional User View entity that provides view configuration\n * When provided, the component will use the view's WhereClause, GridState, SortState, etc.\n * The view's filter is additive - UserSearchString is applied ON TOP of the view's WhereClause\n */\n @Input()\n get ViewEntity(): MJUserViewEntityExtended | null {\n return this._viewEntity;\n }\n set ViewEntity(value: MJUserViewEntityExtended | null) {\n const previousViewId = this._viewEntity?.ID ?? null;\n const nextViewId = value?.ID ?? null;\n const viewChanged = this._initialized && previousViewId !== nextViewId;\n this._viewEntity = value;\n\n // A changed view (including default↔saved and saved↔different) is a new data context: throw out\n // the cached plug-in instances + per-view-type config so they rebuild/re-seed from the new view.\n if (viewChanged) {\n this.viewTypeConfigById.clear();\n this.clearDynamicRendererCache();\n }\n\n // Re-resolve available view types + the initial view type/config from the new view record\n // (self-contained: the viewer reads ViewTypeID + DisplayState.viewTypeConfigs off the record).\n this.refreshAvailableViewTypes();\n\n // If the cache was thrown out but refreshAvailableViewTypes didn't re-select (active type still\n // valid), re-create the active view type fresh for the new view.\n if (viewChanged && !this.dynamicRendererRef) {\n const activeOption = this.AvailableViewTypes.find(o => o.key === this.ActiveViewTypeKey) ?? this.AvailableViewTypes[0];\n if (activeOption) {\n this.ActiveViewTypeKey = activeOption.key;\n this.ActiveDynamicOption = activeOption;\n this.selectDynamicRenderer(activeOption);\n }\n }\n\n if (this._initialized && this._entity && !this._records) {\n // Apply view's sort state if available, then defer the reload.\n // Deferring ensures all sibling input bindings (gridState, etc.) are\n // updated before we fire the RunView — prevents duplicate loads.\n this.applySortStateFromView(value);\n this.resetPaginationState();\n this.deferReload();\n }\n }\n\n /**\n * Grid state configuration from a User View\n * Controls column visibility, widths, order, and sort settings\n */\n @Input() GridState: ViewGridState | null = null;\n\n /**\n * Whether to render the Recycle Bin chip in the viewer header.\n * The chip auto-hides itself when the entity has no deleted records,\n * doesn't track changes, or the user lacks Delete permission — so it\n * stays out of the way on entities where it's not relevant.\n * @default true\n */\n @Input() ShowRecycleBin: boolean = true;\n\n // ========================================\n // OUTPUTS\n // ========================================\n\n /**\n * Emitted when a record is selected (single click)\n */\n @Output() RecordSelected = new EventEmitter<RecordSelectedEvent>();\n\n /**\n * Emitted when a record should be opened (double-click or open button)\n */\n @Output() RecordOpened = new EventEmitter<RecordOpenedEvent>();\n\n /**\n * Emitted when data is loaded\n */\n @Output() DataLoaded = new EventEmitter<DataLoadedEvent>();\n\n /**\n * Emitted when filter text changes (for two-way binding)\n */\n @Output() FilterTextChange = new EventEmitter<string>();\n\n /**\n * Emitted when filtered count changes\n */\n @Output() FilteredCountChanged = new EventEmitter<FilteredCountChangedEvent>();\n\n /**\n * NAVIGATION request bubbled up from a plug-in renderer to open a *related* record on a\n * (possibly different) entity — e.g. a grid foreign-key drill-through. Routing lives in the\n * outer app, so this is one of the few signals that legitimately bubbles up. The container\n * forwards it untouched.\n */\n @Output() OpenRelatedRecordRequested = new EventEmitter<ViewRelatedRecordNavigation>();\n\n /**\n * NAVIGATION request bubbled up from a plug-in renderer to create a new record of the current\n * entity (e.g. a grid's \"New\" button). Opening the create form is a routing concern owned by\n * the outer app; the container forwards it without acting on it.\n */\n @Output() CreateRecordRequested = new EventEmitter<void>();\n\n /**\n * The initial/active view type to open in, by `MJ: View Types` row ID. Hosts that persist\n * the selection (e.g. Explorer's `UserView.ViewTypeID`) bind this so the viewer opens in the\n * saved type — built-in OR plug-in. Applied once the registry resolves; later user switches\n * emit {@link viewTypeChange} for the host to persist.\n */\n @Input()\n set ViewTypeID(value: string | null) {\n this._initialViewTypeId = value;\n // If options are already loaded, apply immediately; otherwise refreshAvailableViewTypes will.\n if (value && this.AvailableViewTypes.length > 0) {\n const opt = this.AvailableViewTypes.find(o => o.viewTypeId === value);\n if (opt && opt.key !== this.ActiveViewTypeKey) {\n this.applyViewTypeSelection(opt, false);\n }\n }\n }\n get ViewTypeID(): string | null {\n return this._initialViewTypeId;\n }\n private _initialViewTypeId: string | null = null;\n\n // ========================================\n // INTERNAL STATE\n // ========================================\n\n /**\n * The view-type options shown in the switcher, sourced from {@link ViewTypeEngine}\n * (the `MJ: View Types` registry), filtered by each descriptor's availability predicate.\n * Every option is a dynamic-mounted plug-in.\n */\n public AvailableViewTypes: ViewModeOption[] = [];\n\n /** Whether the registry (ViewTypeEngine) successfully sourced the available view types. */\n public ViewTypesFromRegistry: boolean = false;\n\n /**\n * The currently-active view type's stable key (descriptor Name). Null until the registry resolves.\n */\n public ActiveViewTypeKey: string | null = null;\n\n /**\n * The currently-active view type's option (the plug-in being mounted). Null until the\n * registry resolves / a type is selected. Drives the dynamic-mount host in the template.\n */\n public ActiveDynamicOption: ViewModeOption | null = null;\n\n /** True once a plug-in view type is mounted (drives the dynamic host's visibility). */\n public get IsDynamicViewActive(): boolean {\n return this.ActiveDynamicOption !== null;\n }\n\n /** Whether the view-type dropdown menu is currently open. */\n public ViewTypeDropdownOpen = false;\n\n /**\n * Per-view-type configuration payloads, keyed by `MJ: View Types` row ID. Seeded from\n * {@link viewTypeConfigsInput} and updated as plug-in renderers emit config changes;\n * handed to each dynamic renderer on mount.\n */\n private viewTypeConfigById = new Map<string, Record<string, unknown>>();\n\n /**\n * Per-view-type configuration provided by the host (e.g. Explorer reading\n * `UserView.DisplayState.viewTypeConfigs`). The active type is controlled separately via\n * the `viewMode` / ViewTypeID inputs; this carries only the config payloads.\n */\n @Input()\n set ViewTypeConfigs(value: Array<{ viewTypeId: string; config: Record<string, unknown> }> | null) {\n this.viewTypeConfigById.clear();\n for (const entry of value ?? []) {\n if (entry?.viewTypeId) {\n this.viewTypeConfigById.set(entry.viewTypeId, entry.config ?? {});\n }\n }\n if (this.dynamicRendererRef && this.ActiveDynamicOption) {\n this.pushDynamicRendererInputs();\n }\n }\n\n /**\n * When true, the viewer persists view-type/config changes itself — to the loaded `UserView`\n * record (when a `ViewEntity`/`ViewID` is present) or to per-user User Settings (the default-view\n * case). When false (the default), the viewer only emits the `Before…`/`After…` events and the\n * consumer is responsible for persistence. Persistence is provider-based (generic-safe) — never\n * routing, which stays with the host app.\n */\n @Input() AutoSaveView: boolean = false;\n\n /**\n * Emitted (cancelable) BEFORE the active view type changes. A handler may set\n * `args.Cancel = true` to veto the switch. Fires for both built-in and plug-in types.\n */\n @Output() BeforeViewTypeChange = new EventEmitter<ViewTypeChangeEventArgs>();\n\n /**\n * Emitted AFTER the active view type has changed (and, when {@link AutoSaveView} is on, after\n * it has been persisted). Notification only.\n */\n @Output() AfterViewTypeChange = new EventEmitter<ViewTypeChangeEventArgs>();\n\n /**\n * Emitted (cancelable) BEFORE a plug-in renderer's configuration change is applied/persisted.\n */\n @Output() BeforeViewTypeConfigChange = new EventEmitter<ViewTypeConfigChangeEventArgs>();\n\n /**\n * Emitted AFTER a plug-in renderer's configuration change has been applied (and persisted when\n * {@link AutoSaveView} is on).\n */\n @Output() AfterViewTypeConfigChange = new EventEmitter<ViewTypeConfigChangeEventArgs>();\n\n /** Anchor for dynamically-mounted plug-in view renderers. */\n @ViewChild('dynamicViewHost', { read: ViewContainerRef }) private dynamicViewHost?: ViewContainerRef;\n\n /** The currently-ACTIVE (visible) plug-in renderer, if any. */\n private dynamicRendererRef: ComponentRef<IViewRenderer> | null = null;\n\n /** Input names the active plug-in declares (from `reflectComponentType`), used to push only the\n * generic inputs it accepts. Mirrors the active cache entry's input set. */\n private dynamicInputNames = new Set<string>();\n\n /**\n * Cache of mounted plug-in renderer instances for the CURRENT data context (entity + view),\n * keyed by `MJ: View Types` row ID. Switching view types within the same entity+view SHOWS/HIDES\n * cached instances (preserving their state — e.g. a computed cluster scatter, grid scroll) instead\n * of destroy/recreate. The whole cache is destroyed + rebuilt only when the data context changes:\n * entity change, or view (record / ViewID, including default↔saved) change. See\n * {@link clearDynamicRendererCache}.\n */\n private dynamicRendererCache = new Map<string, { ref: ComponentRef<IViewRenderer>; inputs: Set<string> }>();\n\n public InternalFilterText: string = '';\n public DebouncedFilterText: string = '';\n public IsLoading: boolean = false;\n public LoadingMessage: string = 'Loading...';\n public InternalRecords: Record<string, unknown>[] = [];\n public TotalRecordCount: number = 0;\n public FilteredRecordCount: number = 0;\n\n /** Track which records matched on hidden (non-visible) fields */\n public HiddenFieldMatches = new Map<string, string>();\n\n /** Current sort state */\n public InternalSortState: SortState | null = null;\n\n /** Pagination state */\n public Pagination: PaginationState = {\n currentPage: 0,\n pageSize: 100,\n totalRecords: 0,\n hasMore: false,\n isLoading: false\n };\n\n private destroy$ = new Subject<void>();\n private filterInput$ = new Subject<string>();\n\n /** Track if this is the first load (vs. load more) */\n private isInitialLoad: boolean = true;\n\n constructor(private cdr: ChangeDetectorRef, private ngZone: NgZone, private elementRef: ElementRef<HTMLElement>) {\n super();}\n\n /** IntersectionObserver used to detect when this viewer is re-attached/re-shown (Explorer caches +\n * reattaches resource components without firing Angular lifecycle hooks). See {@link ngAfterViewInit}. */\n private _visibilityObserver: IntersectionObserver | null = null;\n private _wasVisible = false;\n\n // ========================================\n // PUBLIC METHODS\n // ========================================\n\n /**\n * Hook retained for hosts (e.g. the workspace) that call this before switching views/entities.\n * View-type-specific persistence (e.g. a grid's live column/sort state) is now owned by the\n * mounted plug-in renderer, so the container has nothing to flush — this is a no-op.\n */\n public EnsurePendingChangesSaved(): void {\n // no-op: plug-in renderers own their own pending-state persistence\n }\n\n // ========================================\n // COMPUTED PROPERTIES\n // ========================================\n\n /**\n * Get the effective entity - uses entity input if provided, otherwise derives from viewEntity\n * This allows callers to provide just a viewEntity without explicitly setting the entity input.\n * Uses fallback resolution when ViewEntityInfo is not available.\n */\n get EffectiveEntity(): EntityInfo | null {\n if (this.Entity) {\n return this.Entity;\n }\n // Auto-derive from viewEntity if available\n if (this.ViewEntity) {\n return this.getEntityInfoFromViewEntity(this.ViewEntity);\n }\n return null;\n }\n\n /**\n * Gets EntityInfo from a ViewEntity with multiple fallback strategies.\n * Priority: 1) ViewEntityInfo property (set by Load)\n * 2) Entity name lookup (virtual field)\n * 3) EntityID lookup\n * Returns null if entity cannot be determined.\n */\n private getEntityInfoFromViewEntity(viewEntity: MJUserViewEntityExtended): EntityInfo | null {\n // First try: ViewEntityInfo is the preferred source (set by MJUserViewEntityExtended.Load)\n if (viewEntity.ViewEntityInfo) {\n return viewEntity.ViewEntityInfo;\n }\n\n const md = this.ProviderToUse;\n\n // Second try: Look up by Entity name (virtual field that returns entity name)\n if (viewEntity.Entity) {\n const entityByName = md.Entities.find(e => e.Name === viewEntity.Entity);\n if (entityByName) {\n return entityByName;\n }\n }\n\n // Third try: Look up by EntityID\n if (viewEntity.EntityID) {\n const entityById = md.Entities.find(e => UUIDsEqual(e.ID, viewEntity.EntityID));\n if (entityById) {\n return entityById;\n }\n }\n\n console.warn(`[EntityViewer] Could not determine entity for view \"${viewEntity.Name}\" (ID: ${viewEntity.ID})`);\n return null;\n }\n\n /**\n * Get the effective filter text (external or internal)\n */\n get EffectiveFilterText(): string {\n return this.FilterText ?? this.InternalFilterText;\n }\n\n /**\n * Get the effective sort state (external or internal)\n */\n get EffectiveSortState(): SortState | null {\n return this.SortState ?? this.InternalSortState;\n }\n\n /**\n * Get merged configuration with defaults\n */\n get EffectiveConfig(): Required<EntityViewerConfig> {\n return { ...DEFAULT_VIEWER_CONFIG, ...this.Config };\n }\n\n /**\n * Get the records to display (external or internal)\n */\n get DisplayRecords(): Record<string, unknown>[] {\n return this.Records ?? this.InternalRecords;\n }\n\n /**\n * Get filtered records - when using server-side filtering, records are already filtered\n * When using client-side filtering, apply filter locally\n */\n get FilteredRecords(): Record<string, unknown>[] {\n const records = this.DisplayRecords;\n\n // If server-side filtering is enabled, records are already filtered\n if (this.EffectiveConfig.serverSideFiltering) {\n return records;\n }\n\n // Client-side filtering fallback\n const filterText = this.DebouncedFilterText?.trim().toLowerCase();\n this.HiddenFieldMatches.clear();\n\n if (!filterText || !this.Entity) {\n return records;\n }\n\n const visibleFields = this.getVisibleFieldNames();\n\n return records.filter(record => {\n const matchResult = this.recordMatchesFilter(record, filterText, visibleFields);\n if (matchResult.matches && matchResult.matchedField && !matchResult.matchedInVisibleField) {\n const recordKey = buildPkString(record, this.Entity!);\n this.HiddenFieldMatches.set(recordKey, matchResult.matchedField);\n }\n return matchResult.matches;\n });\n }\n\n /**\n * Check if a record matches the filter text (client-side)\n */\n private recordMatchesFilter(\n record: Record<string, unknown>,\n filterText: string,\n visibleFields: Set<string>\n ): { matches: boolean; matchedField: string | null; matchedInVisibleField: boolean } {\n if (!this.Entity) return { matches: true, matchedField: null, matchedInVisibleField: false };\n\n let matchedField: string | null = null;\n let matchedInVisibleField = false;\n\n for (const field of this.Entity.Fields) {\n if (!this.shouldSearchField(field)) continue;\n\n const value = record[field.Name];\n if (value == null) continue;\n\n const stringValue = String(value).toLowerCase();\n if (this.matchesSearchTerm(stringValue, filterText)) {\n matchedField = field.Name;\n if (visibleFields.has(field.Name)) {\n matchedInVisibleField = true;\n break;\n }\n }\n }\n\n return {\n matches: matchedField !== null,\n matchedField,\n matchedInVisibleField\n };\n }\n\n /**\n * Determine if a field should be included in search\n */\n private shouldSearchField(field: EntityFieldInfo): boolean {\n if (field.Name.startsWith('__mj_')) return false;\n if (field.TSType === 'Date') return false;\n if (field.SQLFullType?.trim().toLowerCase() === 'uniqueidentifier') return false;\n return true;\n }\n\n /**\n * Check if a value matches the search term (supports SQL-style % wildcards)\n */\n private matchesSearchTerm(value: string, searchTerm: string): boolean {\n if (!searchTerm.includes('%')) {\n return value.includes(searchTerm);\n }\n\n const fragments = searchTerm.split('%').filter(s => s.length > 0);\n if (fragments.length === 0) return true;\n\n let searchStartIndex = 0;\n for (const fragment of fragments) {\n const foundIndex = value.indexOf(fragment, searchStartIndex);\n if (foundIndex === -1) return false;\n searchStartIndex = foundIndex + fragment.length;\n }\n return true;\n }\n\n /**\n * Get set of field names that are visible in the current view\n */\n private getVisibleFieldNames(): Set<string> {\n const visible = new Set<string>();\n if (!this.Entity) return visible;\n\n for (const field of this.Entity.Fields) {\n if (field.DefaultInView === true) {\n visible.add(field.Name);\n }\n }\n\n if (this.Entity.NameField) {\n visible.add(this.Entity.NameField.Name);\n }\n\n return visible;\n }\n\n /**\n * Check if a record matched on a hidden field\n */\n public HasHiddenFieldMatch(record: Record<string, unknown>): boolean {\n if (!this.DebouncedFilterText || !this.Entity) return false;\n return this.HiddenFieldMatches.has(buildPkString(record, this.Entity));\n }\n\n /**\n * Get the name of the hidden field that matched for display\n */\n public GetHiddenMatchFieldName(record: Record<string, unknown>): string {\n if (!this.Entity) return '';\n const fieldName = this.HiddenFieldMatches.get(buildPkString(record, this.Entity));\n if (!fieldName || !this.Entity) return '';\n const field = this.Entity.Fields.find(f => f.Name === fieldName);\n return field ? field.DisplayNameOrName : fieldName;\n }\n\n // ========================================\n // LIFECYCLE HOOKS\n // ========================================\n\n ngOnInit(): void {\n this.applyConfig();\n this.setupFilterDebounce();\n\n // Initialize debounced filter from external filter text if provided\n if (this.FilterText !== null) {\n this.DebouncedFilterText = this.FilterText;\n }\n\n // Initialize sort state from config\n if (this.EffectiveConfig.defaultSortField) {\n this.InternalSortState = {\n field: this.EffectiveConfig.defaultSortField,\n direction: this.EffectiveConfig.defaultSortDirection ?? 'asc'\n };\n }\n\n // Mark as initialized - setters will now trigger data loading\n this._initialized = true;\n\n // Load the view-type registry and source the available-modes list from it.\n // Fire-and-forget: until it resolves (or if it fails), the template uses the\n // hardcoded fallback switcher, so behavior is unchanged on un-seeded systems.\n void this.ensureViewTypesLoaded();\n\n // If viewEntity was set before initialization, extract its sort state now.\n // The viewEntity setter skips this when _initialized is false.\n if (this._viewEntity) {\n this.applySortStateFromView(this._viewEntity);\n }\n\n // If entity was set before initialization, load data now.\n // Use deferReload so all inputs are settled before the first RunView.\n if (this._entity && !this._records) {\n this.deferReload();\n }\n }\n\n /**\n * Defers a data reload to a microtask so that all Angular input bindings\n * (entity, viewEntity, gridState, etc.) complete before we fire a RunView.\n * Multiple calls within the same change detection cycle collapse into one load.\n */\n private deferReload(): void {\n if (this._reloadDeferred) {\n return; // already queued or in-flight\n }\n this._reloadDeferred = true;\n Promise.resolve().then(async () => {\n try {\n if (this._initialized && this._entity && !this._records) {\n await this.LoadData();\n }\n } finally {\n // Clear only after loadData fully completes (including the async RunView).\n // This prevents any re-entry via deferReload() during the entire load cycle.\n this._reloadDeferred = false;\n }\n });\n }\n\n ngAfterViewInit(): void {\n // CRITICAL: the active view type is selected during ngOnInit (Entity setter → refreshAvailableViewTypes\n // → applyViewTypeSelection → selectDynamicRenderer), but `dynamicViewHost` is a NON-static @ViewChild\n // that only resolves now (ngAfterViewInit). So that earlier selectDynamicRenderer() returned early\n // (host undefined) and never created the renderer — leaving a stale ActiveDynamicOption with no\n // mounted ref (symptom: \"171 records\" header but an empty grid, pushInputs SKIPPED ref=null). Now\n // that the host exists, mount the active renderer if it hasn't been.\n if (this.ActiveDynamicOption && !this.dynamicRendererRef && this.dynamicViewHost) {\n this.selectDynamicRenderer(this.ActiveDynamicOption);\n }\n\n // Detect re-attach: Explorer caches resource components and detaches/re-attaches their VIEW\n // without firing ngOnInit/ngOnDestroy. When the dashboard tab is re-focused, this viewer's host\n // re-enters the DOM/viewport — but the mounted plug-in (e.g. AG Grid) was rendered while detached\n // and may show an empty body even though the data is still loaded. An IntersectionObserver gives\n // us a reliable \"became visible again\" signal with no lifecycle hook.\n if (typeof IntersectionObserver !== 'undefined' && this.elementRef?.nativeElement) {\n this.ngZone.runOutsideAngular(() => {\n this._visibilityObserver = new IntersectionObserver((entries) => {\n const visible = entries.some(e => e.isIntersecting);\n if (visible && !this._wasVisible) {\n this._wasVisible = true;\n this.ngZone.run(() => this.onViewerReattached());\n } else if (!visible) {\n this._wasVisible = false;\n }\n });\n this._visibilityObserver.observe(this.elementRef.nativeElement);\n });\n }\n }\n\n /**\n * Called when the viewer becomes visible again after being detached (cached-tab reattach). Mounts\n * the active plug-in if it was never created (host wasn't ready at selection time), or re-pushes the\n * current inputs so a host-fed grid re-renders its rows (the \"N records in header but empty grid on\n * return\" symptom).\n */\n private onViewerReattached(): void {\n const active = this.ActiveDynamicOption;\n if (active && !this.dynamicRendererRef && this.dynamicViewHost) {\n // Active view type selected but never mounted (host wasn't ready at selection time) — mount now.\n this.selectDynamicRenderer(active);\n } else if (active && this.dynamicRendererRef) {\n // Re-assert visibility (force display:block) + re-push inputs so the mounted renderer re-renders.\n this.setRendererVisible(this.dynamicRendererRef, true);\n this.pushDynamicRendererInputs();\n this.dynamicRendererRef.changeDetectorRef.detectChanges();\n }\n }\n\n ngOnDestroy(): void {\n this._visibilityObserver?.disconnect();\n this._visibilityObserver = null;\n this.clearDynamicRendererCache();\n this.destroy$.next();\n this.destroy$.complete();\n }\n\n // ========================================\n // CONFIGURATION\n // ========================================\n\n /**\n * Extracts sort state from a view entity, checking ViewSortInfo first then\n * falling back to GridState.sortSettings. Resets internalSortState if the\n * view has no sort defined (prevents stale sort from a previous view).\n */\n private applySortStateFromView(view: MJUserViewEntityExtended | null): void {\n if (!view) {\n this.InternalSortState = null;\n return;\n }\n\n // Priority 1: SortState column (via ViewSortInfo)\n const viewSortInfo = view.ViewSortInfo;\n if (viewSortInfo && viewSortInfo.length > 0) {\n this.InternalSortState = {\n field: viewSortInfo[0].field,\n direction: viewSortInfo[0].direction?.toLowerCase() === 'desc' ? 'desc' : 'asc'\n };\n return;\n }\n\n // Priority 2: GridState.sortSettings (sort may only be stored here)\n if (view.GridState) {\n const gridState = view.GridStateObject;\n if (gridState?.sortSettings && gridState.sortSettings.length > 0) {\n const firstSort = gridState.sortSettings[0];\n this.InternalSortState = {\n field: firstSort.field,\n direction: firstSort.dir === 'desc' ? 'desc' : 'asc'\n };\n return;\n }\n }\n\n // No sort defined — reset to prevent stale sort from previous view\n this.InternalSortState = null;\n }\n\n private applyConfig(): void {\n const config = this.EffectiveConfig;\n this.Pagination.pageSize = config.pageSize;\n }\n\n private setupFilterDebounce(): void {\n this.filterInput$\n .pipe(\n debounceTime(this.EffectiveConfig.filterDebounceMs),\n distinctUntilChanged(),\n takeUntil(this.destroy$)\n )\n .subscribe(filterText => {\n const oldFilter = this.DebouncedFilterText;\n this.DebouncedFilterText = filterText;\n this.FilterTextChange.emit(filterText);\n\n // If server-side filtering and filter changed, reload from page 1\n // Keep existing records visible during refresh for better UX\n if (this.EffectiveConfig.serverSideFiltering && filterText !== oldFilter && !this.Records) {\n this.resetPaginationState(false);\n this.LoadData();\n } else {\n this.updateFilteredCount();\n }\n this.pushDynamicRendererInputs(); // client-side filter changed — refresh a mounted plug-in\n this.cdr.detectChanges();\n });\n }\n\n /**\n * Update the filtered record count and emit event\n */\n private updateFilteredCount(): void {\n const newCount = this.FilteredRecords.length;\n if (this.FilteredRecordCount !== newCount) {\n this.FilteredRecordCount = newCount;\n this.FilteredCountChanged.emit({\n filteredCount: newCount,\n totalCount: this.TotalRecordCount\n });\n }\n }\n\n /**\n * Reset pagination state for a fresh load.\n * When clearRecords is true (default), clears all record data - use for entity switches.\n * When clearRecords is false, keeps existing records visible during refresh - use for sort/filter changes.\n */\n private resetPaginationState(clearRecords: boolean = true): void {\n this.Pagination = {\n currentPage: 0,\n pageSize: this.EffectiveConfig.pageSize,\n totalRecords: clearRecords ? 0 : this.Pagination.totalRecords,\n hasMore: false,\n isLoading: false\n };\n if (clearRecords) {\n this.InternalRecords = [];\n this.TotalRecordCount = 0;\n this.FilteredRecordCount = 0;\n }\n this.isInitialLoad = true;\n }\n\n // ========================================\n // DATA LOADING\n // ========================================\n\n // Sequence counter for tracking load requests and detecting stale responses\n private _loadSequence = 0;\n // Flag: a reload was requested while a load was already in progress\n private _pendingReload = false;\n\n /**\n * Load data for the current entity with server-side filtering/sorting/pagination\n */\n public async LoadData(): Promise<void> {\n const entity = this.EffectiveEntity;\n if (!entity) {\n this.InternalRecords = [];\n this.TotalRecordCount = 0;\n this.FilteredRecordCount = 0;\n return;\n }\n\n // Increment sequence to track this load request\n const loadId = ++this._loadSequence;\n\n // If a load is already in progress, set a flag so we reload once the current\n // load completes. We can't use deferReload() here because the microtask would\n // fire while isLoading is still true, causing an infinite loop.\n if (this.IsLoading) {\n this._pendingReload = true;\n return;\n }\n\n this.IsLoading = true;\n this.Pagination.isLoading = true;\n this.LoadingMessage = `Loading ${entity.Name}...`;\n this.cdr.detectChanges();\n\n const startTime = Date.now();\n const config = this.EffectiveConfig;\n\n try {\n const rv = RunView.FromMetadataProvider(this.ProviderToUse);\n\n // Build OrderBy clause\n // Priority: 1) External/internal sort state 2) View's OrderByClause\n // 3) GridState.sortSettings (saved user defaults) 4) undefined\n let orderBy: string | undefined;\n const sortState = this.EffectiveSortState;\n if (config.serverSideSorting && sortState?.field && sortState.direction) {\n orderBy = `${sortState.field} ${sortState.direction.toUpperCase()}`;\n } else if (this.ViewEntity?.OrderByClause) {\n orderBy = this.ViewEntity.OrderByClause;\n } else if (this.GridState?.sortSettings?.length) {\n orderBy = this.GridState.sortSettings\n .map(s => `${s.field} ${(s.dir || 'asc').toUpperCase()}`)\n .join(', ');\n }\n\n // When a plug-in renderer has asked the container to load the full set (via a generic\n // ViewDataRequest with loadAll:true), load all records up to the safety cap and skip\n // pagination. Otherwise use standard page-based pagination. This is fully view-type-agnostic\n // — the container never inspects which plug-in is mounted.\n const maxRows = this._loadAllRecords ? EntityViewerComponent.LOAD_ALL_MAX_RECORDS : config.pageSize;\n const startRow = this._loadAllRecords ? 0 : this.Pagination.currentPage * config.pageSize;\n\n // Build ExtraFilter from view's WhereClause if available\n // The view's WhereClause is the \"business filter\" - UserSearchString is additive\n const extraFilter = this.ViewEntity?.WhereClause || undefined;\n\n const result = await rv.RunView<Record<string, unknown>>({\n EntityName: entity.Name,\n ResultType: 'simple',\n // Load the FULL field set. The container is a generic plug-in host: different view types need\n // different fields (the grid shows its columns, but Timeline needs the date field, Map needs\n // lat/long, etc.). It cannot restrict to any one plug-in's columns, so it fetches all fields and\n // lets each plug-in pick what it needs. (Omitting `Fields` on a 'simple' RunView returns all\n // entity fields.) Previously this used `computeFieldsList(entity, GridState)` — correct when the\n // host WAS the grid, but it dropped `__mj_*` date fields, leaving Timeline with \"no events\".\n MaxRows: maxRows,\n StartRow: startRow,\n OrderBy: orderBy,\n ExtraFilter: extraFilter,\n // Only use UserSearchString for regular text search, NOT for smart filters\n // Smart filters generate WhereClause via AI on the server, so the prompt text should not be passed as UserSearchString\n UserSearchString: config.serverSideFiltering && !this.ViewEntity?.SmartFilterEnabled\n ? this.DebouncedFilterText || undefined\n : undefined\n });\n\n // Check if this load is still the current one (detect stale responses)\n if (loadId !== this._loadSequence) {\n return;\n }\n\n if (result.Success) {\n\n // Always replace records (page-based navigation, not accumulation)\n this.InternalRecords = result.Results;\n\n this.TotalRecordCount = result.TotalRowCount;\n this.FilteredRecordCount = this.InternalRecords.length;\n\n // Update pagination state\n this.Pagination.totalRecords = result.TotalRowCount;\n this.Pagination.hasMore = false; // No longer used with page-based paging\n\n this.DataLoaded.emit({\n totalRowCount: result.TotalRowCount,\n loadedRowCount: this.InternalRecords.length,\n loadTime: Date.now() - startTime,\n records: this.InternalRecords\n });\n\n this.FilteredCountChanged.emit({\n filteredCount: this.InternalRecords.length,\n totalCount: result.TotalRowCount\n });\n } else {\n if (this.isInitialLoad) {\n this.InternalRecords = [];\n }\n this.TotalRecordCount = 0;\n this.FilteredRecordCount = 0;\n }\n } catch (error) {\n if (this.isInitialLoad) {\n this.InternalRecords = [];\n }\n this.TotalRecordCount = 0;\n this.FilteredRecordCount = 0;\n } finally {\n // Use ngZone.run() to ensure state changes trigger change detection.\n // With es2022 native async/await + zone.js 0.16, the await resumes\n // outside Angular's zone, so detectChanges() alone may not flush properly.\n this.ngZone.run(() => {\n this.IsLoading = false;\n this.Pagination.isLoading = false;\n this.isInitialLoad = false;\n this.pushDynamicRendererInputs(); // keep a mounted plug-in renderer in sync with new data\n this.cdr.detectChanges();\n });\n\n // If a reload was requested while we were loading, trigger it now.\n // isLoading is false at this point so loadData() won't re-enter the pending path.\n if (this._pendingReload) {\n this._pendingReload = false;\n this.resetPaginationState();\n this.LoadData();\n }\n }\n }\n\n /**\n * Handle page change from PaginationComponent\n */\n public OnPageChange(event: PageChangeEvent): void {\n this.Pagination.currentPage = event.PageNumber - 1; // Convert 1-based to 0-based\n this.isInitialLoad = true; // Treat page navigation as a fresh load for loading state\n this.LoadData();\n }\n\n /**\n * Refresh data (re-load from server, starting at page 1)\n * Keeps existing records visible during refresh for better UX\n */\n public Refresh(): void {\n if (!this.Records) {\n this.resetPaginationState(false);\n this.LoadData();\n }\n }\n\n // ========================================\n // VIEW MODE\n // ========================================\n\n /**\n * Loads the ViewTypeEngine once, then recomputes the available view types for the\n * current entity. Fire-and-forget from lifecycle/setters — failures simply leave the\n * switcher empty until the registry is available.\n */\n private async ensureViewTypesLoaded(): Promise<void> {\n try {\n const provider = this.ProviderToUse;\n await ViewTypeEngine.Instance.Config(false, provider?.CurrentUser, provider ?? undefined);\n // Let plug-in descriptors (e.g. Cluster) preload availability data before predicates run.\n await ViewTypeEngine.Instance.EnsureAvailabilityData(provider ?? undefined);\n this.refreshAvailableViewTypes();\n } catch {\n // Engine unavailable / not seeded — leave the switcher empty.\n this.ViewTypesFromRegistry = false;\n }\n }\n\n /**\n * Recomputes {@link AvailableViewTypes} from the registry for the current entity. Every\n * available view type is a dynamic-mounted plug-in. Reconciles the active selection when the\n * previously-active type is no longer available (e.g. the entity changed).\n */\n private refreshAvailableViewTypes(): void {\n const entity = this.EffectiveEntity;\n if (!entity) {\n this.AvailableViewTypes = [];\n this.ViewTypesFromRegistry = false;\n return;\n }\n // Self-contained config seeding: pull per-view-type config from the loaded view record or\n // the per-user default-view setting when the consumer didn't supply it via [ViewTypeConfigs].\n this.seedViewTypeConfigsIfEmpty();\n\n let rows: Array<{ ViewType: { ID: string }; Descriptor: IViewTypeDescriptor }> = [];\n try {\n rows = ViewTypeEngine.Instance.GetAvailableViewTypeRows(entity, this.ProviderToUse ?? undefined);\n } catch {\n rows = [];\n }\n\n const options: ViewModeOption[] = [];\n for (const { ViewType, Descriptor } of rows) {\n options.push({\n key: Descriptor.Name,\n mode: null, // every view type is dynamic-mounted\n label: Descriptor.DisplayName,\n icon: Descriptor.Icon ?? '',\n isDynamic: true,\n descriptor: Descriptor,\n viewTypeId: ViewType.ID,\n });\n }\n\n this.AvailableViewTypes = options;\n this.ViewTypesFromRegistry = options.length > 0;\n\n // Keep the active key valid: if the previously-active type is no longer available\n // (entity changed), select — in priority order — the resolved initial ViewTypeID\n // (explicit input → loaded view record → per-user default-view setting), then the first\n // available type.\n if (options.length > 0 && !options.some(o => o.key === this.ActiveViewTypeKey)) {\n const desiredId = this.resolveInitialViewTypeId();\n const desired = desiredId ? options.find(o => o.viewTypeId === desiredId) : undefined;\n const fallback = desired ?? options[0];\n this.applyViewTypeSelection(fallback, false);\n }\n\n this.cdr.detectChanges();\n }\n\n /**\n * Returns the switcher option for the active view type (for the current-type chip in the\n * switcher), or null before the registry resolves.\n */\n get ActiveViewTypeOption(): ViewModeOption | null {\n return this.AvailableViewTypes.find(o => o.key === this.ActiveViewTypeKey) ?? null;\n }\n\n /**\n * Selects a view type from the switcher. Built-in types route to {@link setViewMode}\n * (preserving the rich grid/cards/timeline/map integration); plug-in types are\n * dynamic-mounted via the descriptor's RendererComponent. Emits {@link viewTypeChange}\n * so hosts can persist `UserView.ViewTypeID`.\n */\n SelectViewType(option: ViewModeOption): void {\n this.ViewTypeDropdownOpen = false;\n this.applyViewTypeSelection(option, true);\n }\n\n /**\n * Selects a view type by its `MJ: View Types` row ID. This is the entry point used by external\n * chrome (e.g. the workspace toolbar's {@link ViewTypeSwitcherComponent}) that surfaces the\n * switcher outside the viewer's own header. Resolves the matching available option and applies\n * it through the same lifecycle as a header-driven switch (cancelable events + persistence).\n * No-op when the ID isn't an available view type or is already active.\n *\n * @param viewTypeId the `MJ: View Types` row ID to switch to.\n */\n public SelectViewTypeById(viewTypeId: string | null): void {\n if (!viewTypeId) {\n return;\n }\n const option = this.AvailableViewTypes.find(o => o.viewTypeId === viewTypeId);\n if (option && option.key !== this.ActiveViewTypeKey) {\n this.applyViewTypeSelection(option, true);\n }\n }\n\n /**\n * The `MJ: View Types` row ID of the currently-active view type, or null before the registry\n * resolves. Lets external chrome (the workspace toolbar switcher) reflect the viewer's active\n * type without reaching into the viewer's internal {@link ViewModeOption}s.\n */\n public get ActiveViewTypeId(): string | null {\n return this.ActiveViewTypeOption?.viewTypeId ?? null;\n }\n\n /**\n * Applies a view-type selection. `emit` is true for user-initiated switches (fires the\n * cancelable {@link BeforeViewTypeChange}, persists when {@link AutoSaveView} is on, then fires\n * {@link AfterViewTypeChange}) and false for internal reconciliation (no events, no persist).\n *\n * Every view type is a dynamic-mounted plug-in: this tears down the previous renderer and mounts\n * the selected descriptor's `RendererComponent`. The container resets its generic load mode (a\n * fresh plug-in that needs the full set will re-request it via `dataRequest({loadAll:true})`) and\n * reloads page-based data when the active type changes.\n */\n private applyViewTypeSelection(option: ViewModeOption, emit: boolean): void {\n const previousViewTypeId = this.ActiveViewTypeOption?.viewTypeId ?? null;\n\n if (emit) {\n const before: ViewTypeChangeEventArgs = {\n ViewTypeID: option.viewTypeId,\n DriverClass: option.key,\n PreviousViewTypeID: previousViewTypeId,\n Cancel: false,\n };\n this.BeforeViewTypeChange.emit(before);\n if (before.Cancel) {\n return; // a handler vetoed the switch — leave the switcher unchanged\n }\n }\n\n const typeChanged = this.ActiveViewTypeKey !== option.key;\n this.ActiveViewTypeKey = option.key;\n this.ActiveDynamicOption = option;\n this.selectDynamicRenderer(option);\n\n // On a real type switch, drop any prior load-all mode and reload page-based data so the newly\n // mounted plug-in starts from the standard paginated set. A plug-in needing everything (e.g. a\n // map) re-asks via dataRequest on its own init. Skip the reload for the initial reconciliation\n // (no prior type) — the regular entity/view data-load path already handles the first load.\n if (typeChanged && previousViewTypeId !== null && this._loadAllRecords && !this._records) {\n this._loadAllRecords = false;\n this.resetPaginationState(false);\n this.LoadData();\n }\n\n if (emit) {\n if (this.AutoSaveView) {\n void this.persistActiveViewType(option);\n }\n this.AfterViewTypeChange.emit({\n ViewTypeID: option.viewTypeId,\n DriverClass: option.key,\n PreviousViewTypeID: previousViewTypeId,\n Cancel: false,\n });\n }\n this.cdr.detectChanges();\n }\n\n // ========================================\n // VIEW-TYPE PERSISTENCE (provider-based; never routing)\n // ========================================\n\n /**\n * Where view-type/config persists when {@link AutoSaveView} is on: a loaded `UserView` record,\n * per-user User Settings (the default-view case), or nowhere.\n */\n private persistenceTarget(): ViewPersistenceTarget {\n if (this._viewEntity?.ID) {\n return 'record';\n }\n if (this.EffectiveEntity) {\n return 'user-settings';\n }\n return 'none';\n }\n\n /** Persist the active view-type selection to the resolved target. */\n private async persistActiveViewType(option: ViewModeOption): Promise<void> {\n const target = this.persistenceTarget();\n if (target === 'record') {\n const ve = this._viewEntity!;\n ve.ViewTypeID = option.viewTypeId;\n await this.saveViewEntity(ve);\n } else if (target === 'user-settings') {\n this.saveDefaultViewSetting();\n }\n }\n\n /** Persist a per-view-type config change to the resolved target. */\n private async persistViewTypeConfig(viewTypeId: string): Promise<void> {\n const target = this.persistenceTarget();\n if (target === 'record') {\n const ve = this._viewEntity!;\n const displayState = ve.DisplayStateObject ?? { defaultMode: 'grid' };\n const configs = (displayState.viewTypeConfigs ?? []).filter(c => c.viewTypeId !== viewTypeId);\n configs.push({ viewTypeId, config: this.viewTypeConfigById.get(viewTypeId) ?? {} });\n displayState.viewTypeConfigs = configs;\n ve.DisplayStateObject = displayState;\n await this.saveViewEntity(ve);\n } else if (target === 'user-settings') {\n this.saveDefaultViewSetting();\n }\n }\n\n /** Save the loaded view record, logging (not throwing) on failure. */\n private async saveViewEntity(viewEntity: MJUserViewEntityExtended): Promise<void> {\n const saved = await viewEntity.Save();\n if (!saved) {\n LogError(`EntityViewer: failed to persist view: ${viewEntity.LatestResult?.CompleteMessage ?? 'unknown error'}`);\n }\n }\n\n /** User Settings key for this entity's per-user default-view state. */\n private defaultViewSettingKey(): string | null {\n const entity = this.EffectiveEntity;\n return entity ? `mj.entityViewer.${entity.ID.toLowerCase()}.view` : null;\n }\n\n /** Persist the per-user default-view state (active view type + per-type configs) to User Settings. */\n private saveDefaultViewSetting(): void {\n const key = this.defaultViewSettingKey();\n if (!key) {\n return;\n }\n const payload = {\n viewTypeId: this.ActiveViewTypeOption?.viewTypeId ?? null,\n viewTypeConfigs: this.serializeViewTypeConfigs(),\n };\n UserInfoEngine.Instance.SetSettingDebounced(key, JSON.stringify(payload));\n }\n\n /** Convert the in-memory per-view-type config map to the persisted array shape. */\n private serializeViewTypeConfigs(): Array<{ viewTypeId: string; config: Record<string, unknown> }> {\n return Array.from(this.viewTypeConfigById.entries()).map(([viewTypeId, config]) => ({ viewTypeId, config }));\n }\n\n /**\n * Resolve which view type the viewer should open in, in priority order:\n * explicit `ViewTypeID` input → the loaded `UserView` record's `ViewTypeID` → the per-user\n * default-view setting (User Settings). Returns null to let the caller fall back to the legacy\n * mode / first available type. This is how the viewer is self-contained for both the saved-view\n * and default-view cases without the consumer wiring anything.\n */\n private resolveInitialViewTypeId(): string | null {\n if (this._initialViewTypeId) {\n return this._initialViewTypeId;\n }\n if (this._viewEntity?.ViewTypeID) {\n return this._viewEntity.ViewTypeID;\n }\n return this.readDefaultViewSetting()?.viewTypeId ?? null;\n }\n\n /**\n * Load a saved view by ID via the active provider and apply it through the {@link viewEntity}\n * setter. Backs the {@link ViewID} convenience input. Logs (does not throw) on failure.\n */\n private async loadViewById(viewId: string): Promise<void> {\n const provider = this.ProviderToUse;\n if (!provider) {\n return;\n }\n const view = await provider.GetEntityObject<MJUserViewEntityExtended>('MJ: User Views', provider.CurrentUser);\n const loaded = await view.Load(viewId);\n if (loaded) {\n this.ViewEntity = view;\n } else {\n LogError(`EntityViewer: failed to load view ${viewId}: ${view.LatestResult?.CompleteMessage ?? 'unknown error'}`);\n }\n }\n\n /** Read the per-user default-view setting for the current entity (or null). */\n private readDefaultViewSetting(): { viewTypeId: string | null; viewTypeConfigs?: Array<{ viewTypeId: string; config: Record<string, unknown> }> } | null {\n const key = this.defaultViewSettingKey();\n if (!key) {\n return null;\n }\n const raw = UserInfoEngine.Instance.GetSetting(key);\n if (!raw) {\n return null;\n }\n try {\n return JSON.parse(raw);\n } catch {\n return null;\n }\n }\n\n /**\n * Seed the in-memory per-view-type config map from the available sources when the consumer\n * hasn't supplied them via the {@link ViewTypeConfigs} input: the loaded `UserView` record's\n * `DisplayState.viewTypeConfigs` (saved-view case) or the per-user default-view setting.\n * Only seeds when the map is empty, so an explicit input always wins.\n */\n private seedViewTypeConfigsIfEmpty(): void {\n if (this.viewTypeConfigById.size > 0) {\n return;\n }\n const fromRecord = this._viewEntity?.DisplayStateObject?.viewTypeConfigs;\n const source = fromRecord ?? this.readDefaultViewSetting()?.viewTypeConfigs ?? [];\n for (const entry of source) {\n if (entry?.viewTypeId) {\n this.viewTypeConfigById.set(entry.viewTypeId, entry.config ?? {});\n }\n }\n }\n\n // ========================================\n // DYNAMIC (PLUG-IN) VIEW RENDERER MOUNTING\n // ========================================\n\n /**\n * Makes `option`'s plug-in the ACTIVE view: reuses its cached instance when present (preserving\n * state), otherwise creates it. All other cached instances are hidden (kept mounted). The container\n * has zero knowledge of which plug-in this is — it only knows the {@link IViewRenderer} contract.\n */\n private selectDynamicRenderer(option: ViewModeOption): void {\n const host = this.dynamicViewHost;\n if (!host || !option.descriptor.RendererComponent) {\n return;\n }\n\n // Hide every cached instance; the active one is shown below. Hidden instances stay mounted so\n // their state survives a round-trip (e.g. switch Grid → Cluster → Grid without re-clustering).\n for (const entry of this.dynamicRendererCache.values()) {\n this.setRendererVisible(entry.ref, false);\n }\n\n let entry = this.dynamicRendererCache.get(option.viewTypeId);\n if (!entry) {\n entry = this.createDynamicRenderer(option);\n }\n this.dynamicRendererRef = entry.ref;\n this.dynamicInputNames = entry.inputs;\n this.setRendererVisible(entry.ref, true);\n this.pushDynamicRendererInputs();\n entry.ref.changeDetectorRef.detectChanges();\n }\n\n /**\n * Creates a plug-in renderer instance, wires its generic outputs, captures its declared inputs,\n * and caches it by `MJ: View Types` row ID. (Does not show/activate it — {@link selectDynamicRenderer}\n * does that.)\n */\n private createDynamicRenderer(option: ViewModeOption): { ref: ComponentRef<IViewRenderer>; inputs: Set<string> } {\n const host = this.dynamicViewHost!;\n const componentType = option.descriptor.RendererComponent;\n const ref = host.createComponent<IViewRenderer>(componentType as never);\n\n // Capture the set of input names this plug-in actually declares, so we only push the generic\n // inputs it accepts. A lean plug-in (e.g. Timeline/Cards) won't declare grid-only inputs like\n // `totalRecordCount`/`page` — calling `setInput` for those logs NG0303 in dev (the log fires\n // before the throw, so a try/catch can't suppress it). Pre-checking with the reflected metadata\n // keeps the console clean and the container plug-in-agnostic.\n const inputs = new Set<string>(reflectComponentType(componentType)?.inputs.map(i => i.templateName) ?? []);\n\n // Wire the generic IViewRenderer outputs. All are optional on lean plug-ins, so guard each\n // with `?.`. Only navigation (record open / related-record / create) bubbles to the outer app;\n // config and dataRequest are generic plug-in↔container coordination.\n const inst = ref.instance;\n inst.recordSelected?.pipe(takeUntil(this.destroy$)).subscribe((r: unknown) => this.onDynamicRecordSelected(r));\n inst.recordOpened?.pipe(takeUntil(this.destroy$)).subscribe((r: unknown) => this.onDynamicRecordOpened(r));\n inst.configChanged\n ?.pipe(takeUntil(this.destroy$))\n .subscribe((cfg: unknown) => this.onDynamicConfigChanged(option.viewTypeId, (cfg ?? {}) as Record<string, unknown>));\n inst.openRelatedRecordRequested\n ?.pipe(takeUntil(this.destroy$))\n .subscribe((nav: ViewRelatedRecordNavigation) => this.OpenRelatedRecordRequested.emit(nav));\n inst.createRecordRequested\n ?.pipe(takeUntil(this.destroy$))\n .subscribe(() => this.CreateRecordRequested.emit());\n inst.dataRequest\n ?.pipe(takeUntil(this.destroy$))\n .subscribe((req: ViewDataRequest) => this.onDynamicDataRequest(req));\n\n const created = { ref, inputs };\n this.dynamicRendererCache.set(option.viewTypeId, created);\n return created;\n }\n\n /**\n * Toggle a cached renderer's host element visibility without destroying it (preserves state).\n * When visible, force `display: block` + `height: 100%` rather than clearing the style: the wrapper\n * components use `ViewEncapsulation.None`, under which their `:host { display:block; height:100% }`\n * rule is a no-op, so a custom element defaults to `display: inline` — which gives AG Grid a\n * zero-width viewport (no rows/columns render), especially after a hide → show cycle. Forcing block\n * here guarantees every view-type plug-in gets a full-size block container.\n */\n private setRendererVisible(ref: ComponentRef<IViewRenderer>, visible: boolean): void {\n const el = ref.location.nativeElement as HTMLElement | undefined;\n if (el) {\n el.style.display = visible ? 'block' : 'none';\n if (visible) {\n el.style.height = '100%';\n }\n }\n }\n\n /**\n * Destroys ALL cached plug-in instances and clears the host. Called when the data context changes\n * (entity change / view (record / ViewID) change) so the next selection rebuilds fresh. NOT called\n * on a plain view-type switch within the same context — that path reuses cached instances.\n */\n private clearDynamicRendererCache(): void {\n for (const entry of this.dynamicRendererCache.values()) {\n entry.ref.destroy();\n }\n this.dynamicRendererCache.clear();\n this.dynamicRendererRef = null;\n this.dynamicInputNames = new Set<string>();\n this.dynamicViewHost?.clear();\n }\n\n /**\n * Pushes the current generic data-context into the mounted plug-in renderer via `setInput`.\n * Every input is part of the generic {@link IViewRenderer} contract; lean plug-ins may not declare\n * all of them, so each `setInput` is wrapped in try/catch (Angular throws on undeclared inputs).\n */\n private pushDynamicRendererInputs(): void {\n const ref = this.dynamicRendererRef;\n const option = this.ActiveDynamicOption;\n if (!ref || !option) {\n return;\n }\n this.setDynamicInput(ref, 'entity', this.EffectiveEntity);\n this.setDynamicInput(ref, 'provider', this.ProviderToUse);\n this.setDynamicInput(ref, 'Provider', this.Provider);\n this.setDynamicInput(ref, 'records', this.FilteredRecords);\n this.setDynamicInput(ref, 'selectedRecordId', this.SelectedRecordID);\n this.setDynamicInput(ref, 'filterText', this.DebouncedFilterText);\n this.setDynamicInput(ref, 'config', this.viewTypeConfigById.get(option.viewTypeId) ?? {});\n this.setDynamicInput(ref, 'totalRecordCount', this.TotalRecordCount);\n this.setDynamicInput(ref, 'page', this.Pagination.currentPage + 1);\n this.setDynamicInput(ref, 'pageSize', this.Pagination.pageSize);\n this.setDynamicInput(ref, 'isLoading', this.IsLoading);\n }\n\n /**\n * Guarded `setInput`: lean plug-ins implement only the core contract, so we only set an input the\n * mounted plug-in actually declares (per {@link dynamicInputNames}, captured at mount via\n * `reflectComponentType`). This avoids NG0303 dev errors for optional inputs the plug-in omits and\n * keeps the container plug-in-agnostic.\n */\n private setDynamicInput(ref: ComponentRef<IViewRenderer>, name: string, value: unknown): void {\n if (this.dynamicInputNames.has(name)) {\n ref.setInput(name, value);\n }\n }\n\n private onDynamicRecordSelected(record: unknown): void {\n const entity = this.EffectiveEntity;\n if (entity && record) {\n const row = record as Record<string, unknown>;\n this.RecordSelected.emit({ record: row, entity, compositeKey: buildCompositeKey(row, entity) });\n }\n }\n\n private onDynamicRecordOpened(record: unknown): void {\n const entity = this.EffectiveEntity;\n if (entity && record) {\n const row = record as Record<string, unknown>;\n this.RecordOpened.emit({ record: row, entity, compositeKey: buildCompositeKey(row, entity) });\n }\n }\n\n private onDynamicConfigChanged(viewTypeId: string, config: Record<string, unknown>): void {\n const before: ViewTypeConfigChangeEventArgs = { ViewTypeID: viewTypeId, Config: config, Cancel: false };\n this.BeforeViewTypeConfigChange.emit(before);\n if (before.Cancel) {\n return;\n }\n this.viewTypeConfigById.set(viewTypeId, config);\n if (this.AutoSaveView) {\n void this.persistViewTypeConfig(viewTypeId);\n }\n this.AfterViewTypeConfigChange.emit({ ViewTypeID: viewTypeId, Config: config, Cancel: false });\n }\n\n /**\n * Honors a generic {@link ViewDataRequest} from the mounted plug-in. Fully view-type-agnostic —\n * the container applies whatever is present (sort / page / pageSize / loadAll) against its\n * existing generic data-loading path. No per-view-type branching.\n */\n private onDynamicDataRequest(req: ViewDataRequest): void {\n if (!req || this._records) {\n // Nothing to do when records are externally supplied (no internal RunView to retrigger).\n return;\n }\n\n // loadAll → switch the data loader into full-set mode (replaces the old map-specific branch).\n if (req.loadAll === true && !this._loadAllRecords) {\n this._loadAllRecords = true;\n this.resetPaginationState(false);\n this.LoadData();\n return;\n }\n if (req.loadAll === false && this._loadAllRecords) {\n this._loadAllRecords = false;\n this.resetPaginationState(false);\n this.LoadData();\n return;\n }\n\n // sort → set the host's internal sort state and reload via the server-side-sort path.\n if (req.sort) {\n const first = req.sort.length > 0 ? req.sort[0] : null;\n const newSort: SortState | null = first ? { field: first.field, direction: first.direction } : null;\n const oldSort = this.InternalSortState;\n this.InternalSortState = newSort;\n const sortChanged = !oldSort || !newSort ||\n oldSort.field !== newSort.field || oldSort.direction !== newSort.direction;\n if (this.EffectiveConfig.serverSideSorting && sortChanged) {\n this.resetPaginationState(false);\n this.LoadData();\n }\n return;\n }\n\n // page / pageSize → load that page via the existing pager path.\n if (req.pageSize != null && req.pageSize !== this.Pagination.pageSize) {\n this.Pagination.pageSize = req.pageSize;\n }\n if (req.page != null) {\n this.OnPageChange({ PageNumber: req.page, PageSize: req.pageSize ?? this.Pagination.pageSize } as PageChangeEvent);\n }\n }\n\n // ========================================\n // FILTERING\n // ========================================\n\n /**\n * Handle filter input change\n */\n OnFilterChange(value: string): void {\n this.InternalFilterText = value;\n this.filterInput$.next(value);\n }\n\n /**\n * Clear the filter\n */\n ClearFilter(): void {\n this.InternalFilterText = '';\n this.filterInput$.next('');\n this.cdr.detectChanges();\n }\n}\n","<div class=\"entity-viewer-container\" [style.height]=\"EffectiveConfig.height\">\n <!-- Header -->\n @if (EffectiveConfig.showFilter || EffectiveConfig.showViewModeToggle || EffectiveConfig.showRecordCount) {\n <div class=\"viewer-header\">\n <!-- Filter Input -->\n @if (EffectiveConfig.showFilter) {\n <div class=\"filter-container\">\n <i class=\"fa-solid fa-search filter-icon\"></i>\n <input\n type=\"text\"\n class=\"filter-input\"\n [placeholder]=\"EffectiveConfig.filterPlaceholder\"\n [value]=\"EffectiveFilterText\"\n (input)=\"OnFilterChange($any($event.target).value)\"\n />\n @if (EffectiveFilterText) {\n <button class=\"clear-filter-btn\" (click)=\"ClearFilter()\" title=\"Clear filter\">\n <i class=\"fa-solid fa-times\"></i>\n </button>\n }\n </div>\n }\n\n <!-- Record Count -->\n @if (EffectiveConfig.showRecordCount && EffectiveEntity) {\n <div class=\"record-count\">\n @if (FilteredRecordCount !== TotalRecordCount) {\n <span>{{ FilteredRecordCount | number }} of {{ TotalRecordCount | number }} records</span>\n } @else {\n <span>{{ TotalRecordCount | number }} records</span>\n }\n </div>\n }\n\n <!-- View Type Toggle — the reusable switcher, driven entirely by the MJ: View Types\n registry (ViewTypeEngine). The available types and their icons come from metadata\n (ViewType.Icon), filtered by each descriptor's availability predicate. Selecting routes\n back through SelectViewTypeById, which mounts the chosen descriptor's RendererComponent\n into #dynamicViewHost. The container has zero knowledge of any view type's chrome. -->\n @if (EffectiveConfig.showViewModeToggle) {\n <mj-view-type-switcher\n [Provider]=\"Provider\"\n [Entity]=\"EffectiveEntity\"\n [ActiveViewTypeID]=\"ActiveViewTypeId\"\n (ViewTypeSelected)=\"SelectViewTypeById($event.viewTypeId)\">\n </mj-view-type-switcher>\n }\n\n <!-- Recycle Bin chip (auto-hides when entity has no deleted records, no tracking,\n or user lacks Delete permission) -->\n @if (ShowRecycleBin) {\n <mj-recycle-bin-chip [EntityName]=\"EffectiveEntity?.Name ?? null\"></mj-recycle-bin-chip>\n }\n </div>\n }\n\n <!-- Content -->\n <div class=\"viewer-content\">\n <!-- Loading container - full page when no data exists -->\n <div class=\"loading-container\" [hidden]=\"!(IsLoading && FilteredRecords.length === 0)\">\n <mj-loading [text]=\"LoadingMessage\" size=\"medium\"></mj-loading>\n </div>\n\n <!-- Loading overlay - shown on top of content when loading with existing data -->\n <div class=\"loading-overlay\" [hidden]=\"!(IsLoading && FilteredRecords.length > 0)\">\n <mj-loading [text]=\"LoadingMessage\" size=\"small\"></mj-loading>\n </div>\n\n <!-- Empty state: no entity selected -->\n <div class=\"empty-state\" [hidden]=\"!!EffectiveEntity\">\n <i class=\"fa-solid fa-database\"></i>\n <p>Select an entity to view records</p>\n </div>\n\n <!-- Empty state: no records found. Suppressed while a plug-in is active — every plug-in renders\n its own empty/loading state, so the container never shows a generic \"no records\" over it. -->\n <div class=\"empty-state\" [hidden]=\"!EffectiveEntity || FilteredRecords.length > 0 || IsLoading || IsDynamicViewActive\">\n <i class=\"fa-solid fa-inbox\"></i>\n <p>{{ DebouncedFilterText ? 'No matching records' : 'No records found' }}</p>\n </div>\n\n <!-- Plug-in (dynamic) view renderer host — the ONLY render path. The active descriptor's\n RendererComponent is created into #dynamicViewHost via ViewContainerRef and fed the generic\n IViewRenderer contract. Shown whenever there's an entity; the plug-in owns all its chrome. -->\n <div class=\"dynamic-view-host\" [hidden]=\"!EffectiveEntity\">\n <ng-template #dynamicViewHost></ng-template>\n </div>\n </div>\n\n</div>\n"]}
1
+ {"version":3,"file":"entity-viewer.component.js","sourceRoot":"","sources":["../../../src/lib/entity-viewer/entity-viewer.component.ts","../../../src/lib/entity-viewer/entity-viewer.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAAmE,SAAS,EAAU,gBAAgB,EAAgB,oBAAoB,EAAE,MAAM,eAAe,CAAC;AACjN,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/B,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC/E,OAAO,EAA+B,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACtF,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAA4B,cAAc,EAAE,MAAM,+BAA+B,CAAC;AACzF,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAExE,OAAO,EAEL,qBAAqB,EAStB,MAAM,UAAU,CAAC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BAkBL,KAAK;;kBAYL,KAAK;;kBAcL,KAAK;;kBA4BL,KAAK;;kBAiCL,KAAK;;kBAuDL,KAAK;;kBAmBL,KAAK;;kBASL,MAAM;;kBAKN,MAAM;;kBAKN,MAAM;;kBAKN,MAAM;;kBAKN,MAAM;;kBAQN,MAAM;;kBAON,MAAM;;kBAON,MAAM;;kBAQN,KAAK;;kBA6DL,KAAK;;kBAoBL,KAAK;;kBAML,MAAM;;kBAMN,MAAM;;kBAKN,MAAM;;kBAMN,MAAM;;kBAGN,SAAS;mBAAC,iBAAiB,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE;;kFA/e7C,qBAAqB","sourcesContent":["import { Component, Input, Output, EventEmitter, OnInit, OnDestroy, AfterViewInit, ChangeDetectorRef, ElementRef, ViewChild, NgZone, ViewContainerRef, ComponentRef, reflectComponentType } from '@angular/core';\nimport { BaseAngularComponent } from '@memberjunction/ng-base-types';\nimport { Subject } from 'rxjs';\nimport { debounceTime, distinctUntilChanged, takeUntil } from 'rxjs/operators';\nimport { EntityInfo, EntityFieldInfo, RunView, LogError } from '@memberjunction/core';\nimport { UUIDsEqual } from '@memberjunction/global';\nimport { MJUserViewEntityExtended, UserInfoEngine } from '@memberjunction/core-entities';\nimport { buildCompositeKey, buildPkString } from '../utils/record.util';\nimport { PageChangeEvent } from '@memberjunction/ng-pagination';\nimport {\n EntityViewerConfig,\n DEFAULT_VIEWER_CONFIG,\n RecordSelectedEvent,\n RecordOpenedEvent,\n DataLoadedEvent,\n FilteredCountChangedEvent,\n SortState,\n SortDirection,\n PaginationState,\n ViewGridState\n} from '../types';\nimport { IViewTypeDescriptor, IViewRenderer, ViewTypeEngine, ViewDataRequest, ViewRelatedRecordNavigation } from '../view-types';\n\n/**\n * A single entry in the view-type switcher, built from the {@link ViewTypeEngine} registry\n * (`MJ: View Types`). Every view type is a dynamic-mounted plug-in implementing `IViewRenderer`;\n * the container has zero knowledge of any specific view type — it mounts the descriptor's\n * `RendererComponent` and feeds it the generic contract.\n */\nexport interface ViewModeOption {\n /**\n * Stable key for this option — the descriptor's `Name` (== `MJ: View Types.DriverClass`),\n * e.g. \"GridViewType\", \"ClusterViewType\". Used as the `@for` track key and to identify the\n * active option.\n */\n key: string;\n /**\n * Always `null` — retained on the interface only so any external reader doesn't break. Every\n * view type is now dynamic-mounted; there is no legacy built-in render mode.\n */\n mode: null;\n /** User-facing label. */\n label: string;\n /** Font Awesome icon class. */\n icon: string;\n /** Always `true` — every view type is dynamic-mounted via the descriptor's RendererComponent. */\n isDynamic: boolean;\n /** The resolved descriptor (carries the RendererComponent + PropSheetComponent). */\n descriptor: IViewTypeDescriptor;\n /** The `MJ: View Types` row ID — for ViewTypeID persistence + per-view-type config keying. */\n viewTypeId: string;\n}\n\n/**\n * Event payload for the view-type change lifecycle. Emitted (cancelable) via\n * {@link EntityViewerComponent.BeforeViewTypeChange} and (notification) via\n * {@link EntityViewerComponent.AfterViewTypeChange}. A handler may set `Cancel = true` on the\n * *Before* event to veto the switch (mirrors the grid's `BeforeRowClick` / `BeforeCellEdit`\n * cancelable pattern).\n */\nexport interface ViewTypeChangeEventArgs {\n /** The `MJ: View Types` row ID being switched to. */\n ViewTypeID: string;\n /** The descriptor `DriverClass` / Name being switched to (e.g. \"ClusterViewType\"). */\n DriverClass: string;\n /** The `MJ: View Types` row ID being switched FROM (null on the first selection). */\n PreviousViewTypeID: string | null;\n /** Set to true in a {@link EntityViewerComponent.BeforeViewTypeChange} handler to veto the switch. */\n Cancel: boolean;\n}\n\n/**\n * Event payload for the per-view-type configuration change lifecycle.\n */\nexport interface ViewTypeConfigChangeEventArgs {\n /** The `MJ: View Types` row ID whose config changed. */\n ViewTypeID: string;\n /** The new configuration payload (shape owned by the plug-in). */\n Config: Record<string, unknown>;\n /** Set to true in a {@link EntityViewerComponent.BeforeViewTypeConfigChange} handler to veto. */\n Cancel: boolean;\n}\n\n/**\n * Where the entity viewer persists view-type/render-state when {@link EntityViewerComponent.AutoSaveView}\n * is enabled:\n * - `'record'` — onto the loaded `UserView` row (shared; everyone who opens that view sees it).\n * - `'user-settings'` — per-user via `UserInfoEngine` (the default-view case, or a personal layer).\n * - `'none'` — nothing to persist to (no view + settings disabled).\n */\nexport type ViewPersistenceTarget = 'record' | 'user-settings' | 'none';\n\n/**\n * EntityViewerComponent - Full-featured composite component for viewing entity data\n *\n * This component provides a complete data viewing experience with:\n * - Switchable grid (AG Grid) and card views\n * - Server-side filtering with UserSearchString\n * - Server-side pagination with StartRow/MaxRows\n * - Server-side sorting with OrderBy\n * - Selection handling with configurable behavior\n * - Loading, empty, and error states\n * - Beautiful pagination UI with \"Load More\" pattern\n *\n * @example\n * ```html\n * <!-- Basic usage - loads data automatically -->\n * <mj-entity-viewer\n * [Entity]=\"selectedEntity\"\n * (RecordSelected)=\"onRecordSelected($event)\"\n * (RecordOpened)=\"onRecordOpened($event)\">\n * </mj-entity-viewer>\n *\n * <!-- With external state control (like Data Explorer) -->\n * <mj-entity-viewer\n * [Entity]=\"selectedEntity\"\n * [ViewTypeID]=\"state.viewTypeId\"\n * [FilterText]=\"state.filterText\"\n * [SelectedRecordID]=\"state.selectedRecordId\"\n * (RecordSelected)=\"onRecordSelected($event)\"\n * (RecordOpened)=\"onRecordOpened($event)\">\n * </mj-entity-viewer>\n * ```\n */\n@Component({\n standalone: false,\n selector: 'mj-entity-viewer',\n templateUrl: './entity-viewer.component.html',\n styleUrls: ['./entity-viewer.component.css'],\n host: {\n 'style': 'display: block; height: 100%;'\n }\n})\nexport class EntityViewerComponent extends BaseAngularComponent implements OnInit, OnDestroy, AfterViewInit {\n /**\n * Safety cap on the number of records loaded when a plug-in renderer asks the container to\n * load the full set (via a {@link ViewDataRequest} with `loadAll: true`). Prevents unbounded\n * queries on very large entities. Generic — not tied to any specific view type.\n */\n private static readonly LOAD_ALL_MAX_RECORDS = 10000;\n\n // ========================================\n // INPUTS (using getter/setter pattern)\n // ========================================\n\n private _entity: EntityInfo | null = null;\n private _records: Record<string, unknown>[] | null = null;\n private _config: Partial<EntityViewerConfig> = {};\n private _filterText: string | null = null;\n private _sortState: SortState | null = null;\n private _viewEntity: MJUserViewEntityExtended | null = null;\n private _initialized = false;\n\n /**\n * When true, the next {@link LoadData} loads the full record set (up to\n * {@link LOAD_ALL_MAX_RECORDS}) instead of paginating. Set generically from a plug-in's\n * {@link ViewDataRequest} (`loadAll`) — never from any view-type check.\n */\n private _loadAllRecords = false;\n\n /** Whether a deferred reload has been queued via deferReload() */\n private _reloadDeferred = false;\n\n /**\n * The entity to display records for\n */\n @Input()\n get Entity(): EntityInfo | null {\n return this._entity;\n }\n set Entity(value: EntityInfo | null) {\n const previousEntity = this._entity;\n this._entity = value;\n\n const entityChanged = !!(this._initialized && value && previousEntity && !UUIDsEqual(value.ID, previousEntity.ID));\n\n // On a real entity change, drop per-entity state BEFORE we recompute view types + re-seed config,\n // so the new entity starts clean:\n // - The per-view-type config map (grid columnSettings, timeline date field, …) is per-ENTITY.\n // Keeping the old entity's config applies its columnSettings to the new entity, so only fields\n // common to both survive (e.g. just Name/Description) — the \"no/too-few columns\" symptom.\n // - The loaded UserView record belongs to the old entity; clear it so re-seeding reads the new\n // entity's saved view / per-user default-view setting.\n // - Sort state references old-entity fields and would produce an invalid ORDER BY.\n if (entityChanged) {\n if (this._viewEntity && value && !UUIDsEqual(this._viewEntity.EntityID, value.ID)) {\n this._viewEntity = null;\n }\n this.viewTypeConfigById.clear();\n this.InternalSortState = null;\n // Throw out the cached plug-in instances — they belong to the previous entity. The next\n // selection rebuilds them fresh for the new entity (correct columns / date fields / geo).\n this.clearDynamicRendererCache();\n }\n\n // Recompute available view types for the new entity from the registry (if loaded). This also\n // re-seeds the per-view-type config from the NEW entity's saved view / default-view setting\n // (now that the stale map was cleared above). Falls back silently when the registry has no data.\n this.refreshAvailableViewTypes();\n\n if (this._initialized) {\n\n if (value && !this._records) {\n // Reset state for new entity - synchronously clear all data and force change detection\n // before starting the async load to prevent stale data display\n this.resetPaginationState();\n this.InternalRecords = [];\n this.TotalRecordCount = 0;\n this.FilteredRecordCount = 0;\n this.cdr.detectChanges();\n // Defer the actual load so all input bindings (viewEntity, gridState, etc.)\n // complete before we fire the RunView — prevents duplicate loads with stale state\n this.deferReload();\n } else if (!value) {\n this.InternalRecords = [];\n this.TotalRecordCount = 0;\n this.FilteredRecordCount = 0;\n this.resetPaginationState();\n this.cdr.detectChanges();\n }\n\n // The cache was thrown out above, so re-create the active view type FRESH for the new entity\n // (unless refreshAvailableViewTypes already re-selected because the active type became\n // unavailable). This rebuilds columns / date fields / geo cleanly; records flow in via the\n // deferred reload. The container stays generic — it re-creates whatever plug-in is active\n // without knowing what it is.\n if (entityChanged && !this.dynamicRendererRef) {\n const activeOption = this.AvailableViewTypes.find(o => o.key === this.ActiveViewTypeKey) ?? this.AvailableViewTypes[0];\n if (activeOption) {\n this.ActiveViewTypeKey = activeOption.key;\n this.ActiveDynamicOption = activeOption;\n this.selectDynamicRenderer(activeOption);\n }\n }\n }\n }\n\n /**\n * Convenience input: the entity to display by **name**. Resolved internally to an `EntityInfo`\n * via the active provider and applied through the {@link entity} setter. Use this OR `[entity]`\n * OR `[EntityID]` — whichever is most convenient for the consumer.\n */\n @Input()\n set EntityName(value: string | null) {\n if (!value) {\n return;\n }\n const resolved = this.ProviderToUse?.EntityByName(value) ?? null;\n if (resolved) {\n this.Entity = resolved;\n }\n }\n\n /**\n * Convenience input: the entity to display by **ID**. Resolved internally to an `EntityInfo`\n * and applied through the {@link entity} setter.\n */\n @Input()\n set EntityID(value: string | null) {\n if (!value) {\n return;\n }\n const resolved = this.ProviderToUse?.Entities.find(e => UUIDsEqual(e.ID, value)) ?? null;\n if (resolved) {\n this.Entity = resolved;\n }\n }\n\n /**\n * Convenience input: load and display a saved view by its `MJ: User Views` **ID**. The viewer\n * loads the record via the active provider and applies it through the {@link viewEntity} setter\n * (which also resolves the entity if `[entity]`/`[EntityName]`/`[EntityID]` weren't supplied).\n */\n @Input()\n set ViewID(value: string | null) {\n if (value) {\n void this.loadViewById(value);\n }\n }\n\n /**\n * Pre-loaded records (optional - if not provided, component loads data)\n */\n @Input()\n get Records(): Record<string, unknown>[] | null {\n return this._records;\n }\n set Records(value: Record<string, unknown>[] | null) {\n this._records = value;\n\n if (value) {\n this.InternalRecords = value;\n this.TotalRecordCount = value.length;\n this.FilteredRecordCount = value.length;\n this.pushDynamicRendererInputs();\n }\n }\n\n /**\n * Configuration options for the viewer\n */\n @Input()\n get Config(): Partial<EntityViewerConfig> {\n return this._config;\n }\n set Config(value: Partial<EntityViewerConfig>) {\n this._config = value;\n this.applyConfig();\n }\n\n /**\n * Currently selected record ID (primary key string)\n */\n @Input()\n get SelectedRecordID(): string | null {\n return this._selectedRecordId;\n }\n set SelectedRecordID(value: string | null) {\n this._selectedRecordId = value;\n this.pushDynamicRendererInputs();\n }\n private _selectedRecordId: string | null = null;\n\n /**\n * External filter text - allows parent to control filter\n * Supports two-way binding: [(filterText)]=\"state.filterText\"\n */\n @Input()\n get FilterText(): string | null {\n return this._filterText;\n }\n set FilterText(value: string | null) {\n const oldFilter = this.DebouncedFilterText;\n this._filterText = value;\n\n const newFilter = value ?? '';\n this.InternalFilterText = newFilter;\n this.DebouncedFilterText = newFilter;\n\n if (this._initialized) {\n // If server-side filtering and filter changed, reload from page 1\n // Keep existing records visible during refresh for better UX\n if (this.EffectiveConfig.serverSideFiltering && newFilter !== oldFilter && !this._records) {\n this.resetPaginationState(false);\n this.LoadData();\n } else {\n this.updateFilteredCount();\n }\n this.cdr.detectChanges();\n }\n }\n\n /**\n * External sort state - allows parent to control sorting\n */\n @Input()\n get SortState(): SortState | null {\n return this._sortState;\n }\n set SortState(value: SortState | null) {\n const oldSort = this.InternalSortState;\n this._sortState = value;\n\n if (value !== null) {\n this.InternalSortState = value;\n\n if (this._initialized) {\n // If sort changed and using server-side sorting, reload\n // Keep existing records visible during refresh for better UX\n if (this.EffectiveConfig.serverSideSorting && !this._records) {\n const sortChanged = !oldSort || !value ||\n oldSort.field !== value.field ||\n oldSort.direction !== value.direction;\n\n if (sortChanged) {\n this.resetPaginationState(false);\n this.LoadData();\n }\n }\n }\n }\n }\n\n /**\n * Optional User View entity that provides view configuration\n * When provided, the component will use the view's WhereClause, GridState, SortState, etc.\n * The view's filter is additive - UserSearchString is applied ON TOP of the view's WhereClause\n */\n @Input()\n get ViewEntity(): MJUserViewEntityExtended | null {\n return this._viewEntity;\n }\n set ViewEntity(value: MJUserViewEntityExtended | null) {\n const previousViewId = this._viewEntity?.ID ?? null;\n const nextViewId = value?.ID ?? null;\n const viewChanged = this._initialized && previousViewId !== nextViewId;\n this._viewEntity = value;\n\n // A changed view (including default↔saved and saved↔different) is a new data context: throw out\n // the cached plug-in instances + per-view-type config so they rebuild/re-seed from the new view.\n if (viewChanged) {\n this.viewTypeConfigById.clear();\n this.clearDynamicRendererCache();\n }\n\n // Re-resolve available view types + the initial view type/config from the new view record\n // (self-contained: the viewer reads ViewTypeID + DisplayState.viewTypeConfigs off the record).\n this.refreshAvailableViewTypes();\n\n // If the cache was thrown out but refreshAvailableViewTypes didn't re-select (active type still\n // valid), re-create the active view type fresh for the new view.\n if (viewChanged && !this.dynamicRendererRef) {\n const activeOption = this.AvailableViewTypes.find(o => o.key === this.ActiveViewTypeKey) ?? this.AvailableViewTypes[0];\n if (activeOption) {\n this.ActiveViewTypeKey = activeOption.key;\n this.ActiveDynamicOption = activeOption;\n this.selectDynamicRenderer(activeOption);\n }\n }\n\n if (this._initialized && this._entity && !this._records) {\n // Apply view's sort state if available, then defer the reload.\n // Deferring ensures all sibling input bindings (gridState, etc.) are\n // updated before we fire the RunView — prevents duplicate loads.\n this.applySortStateFromView(value);\n this.resetPaginationState();\n this.deferReload();\n }\n }\n\n private _gridState: ViewGridState | null = null;\n\n /**\n * Canonical grid state for the current view — the single, framework-wide source of truth for a\n * view's columns (visibility / order / width / formatting), sort, filter and aggregates. It is\n * the `UserView.GridState` column, also read by `MJUserViewEntity.Columns`, the GraphQL data\n * provider's server-side field list, the config panel, and export.\n *\n * Any view type that {@link IViewTypeDescriptor.UsesCanonicalGridState} is backed by this store\n * rather than by an opaque per-view-type blob (see {@link effectiveRendererConfig}). Reactive:\n * when the host updates this after the renderer is mounted (e.g. the config panel just saved new\n * columns), we re-push the active renderer's config so the change reflects without a full reload.\n */\n @Input()\n set GridState(value: ViewGridState | null) {\n const previous = this._gridState;\n this._gridState = value;\n if (this._initialized && value !== previous) {\n this.refreshCanonicalGridStateRenderer();\n }\n }\n get GridState(): ViewGridState | null {\n return this._gridState;\n }\n\n /**\n * Whether to render the Recycle Bin chip in the viewer header.\n * The chip auto-hides itself when the entity has no deleted records,\n * doesn't track changes, or the user lacks Delete permission — so it\n * stays out of the way on entities where it's not relevant.\n * @default true\n */\n @Input() ShowRecycleBin: boolean = true;\n\n // ========================================\n // OUTPUTS\n // ========================================\n\n /**\n * Emitted when a record is selected (single click)\n */\n @Output() RecordSelected = new EventEmitter<RecordSelectedEvent>();\n\n /**\n * Emitted when a record should be opened (double-click or open button)\n */\n @Output() RecordOpened = new EventEmitter<RecordOpenedEvent>();\n\n /**\n * Emitted when data is loaded\n */\n @Output() DataLoaded = new EventEmitter<DataLoadedEvent>();\n\n /**\n * Emitted when filter text changes (for two-way binding)\n */\n @Output() FilterTextChange = new EventEmitter<string>();\n\n /**\n * Emitted when filtered count changes\n */\n @Output() FilteredCountChanged = new EventEmitter<FilteredCountChangedEvent>();\n\n /**\n * NAVIGATION request bubbled up from a plug-in renderer to open a *related* record on a\n * (possibly different) entity — e.g. a grid foreign-key drill-through. Routing lives in the\n * outer app, so this is one of the few signals that legitimately bubbles up. The container\n * forwards it untouched.\n */\n @Output() OpenRelatedRecordRequested = new EventEmitter<ViewRelatedRecordNavigation>();\n\n /**\n * NAVIGATION request bubbled up from a plug-in renderer to create a new record of the current\n * entity (e.g. a grid's \"New\" button). Opening the create form is a routing concern owned by\n * the outer app; the container forwards it without acting on it.\n */\n @Output() CreateRecordRequested = new EventEmitter<void>();\n\n /**\n * Bubbled up from a plug-in renderer asking the host to open this view's configuration UI\n * (e.g. the grid's \"Manage Columns\" affordance). The host (the view workspace) owns the config\n * panel; the container just forwards the request. See {@link IViewRenderer.configureRequested}.\n */\n @Output() ConfigureRequested = new EventEmitter<void>();\n\n /**\n * The initial/active view type to open in, by `MJ: View Types` row ID. Hosts that persist\n * the selection (e.g. Explorer's `UserView.ViewTypeID`) bind this so the viewer opens in the\n * saved type — built-in OR plug-in. Applied once the registry resolves; later user switches\n * emit {@link viewTypeChange} for the host to persist.\n */\n @Input()\n set ViewTypeID(value: string | null) {\n this._initialViewTypeId = value;\n // If options are already loaded, apply immediately; otherwise refreshAvailableViewTypes will.\n if (value && this.AvailableViewTypes.length > 0) {\n const opt = this.AvailableViewTypes.find(o => o.viewTypeId === value);\n if (opt && opt.key !== this.ActiveViewTypeKey) {\n this.applyViewTypeSelection(opt, false);\n }\n }\n }\n get ViewTypeID(): string | null {\n return this._initialViewTypeId;\n }\n private _initialViewTypeId: string | null = null;\n\n // ========================================\n // INTERNAL STATE\n // ========================================\n\n /**\n * The view-type options shown in the switcher, sourced from {@link ViewTypeEngine}\n * (the `MJ: View Types` registry), filtered by each descriptor's availability predicate.\n * Every option is a dynamic-mounted plug-in.\n */\n public AvailableViewTypes: ViewModeOption[] = [];\n\n /** Whether the registry (ViewTypeEngine) successfully sourced the available view types. */\n public ViewTypesFromRegistry: boolean = false;\n\n /**\n * The currently-active view type's stable key (descriptor Name). Null until the registry resolves.\n */\n public ActiveViewTypeKey: string | null = null;\n\n /**\n * The currently-active view type's option (the plug-in being mounted). Null until the\n * registry resolves / a type is selected. Drives the dynamic-mount host in the template.\n */\n public ActiveDynamicOption: ViewModeOption | null = null;\n\n /** True once a plug-in view type is mounted (drives the dynamic host's visibility). */\n public get IsDynamicViewActive(): boolean {\n return this.ActiveDynamicOption !== null;\n }\n\n /** Whether the view-type dropdown menu is currently open. */\n public ViewTypeDropdownOpen = false;\n\n /**\n * Per-view-type configuration payloads, keyed by `MJ: View Types` row ID. Seeded from\n * {@link viewTypeConfigsInput} and updated as plug-in renderers emit config changes;\n * handed to each dynamic renderer on mount.\n */\n private viewTypeConfigById = new Map<string, Record<string, unknown>>();\n\n /**\n * Per-view-type configuration provided by the host (e.g. Explorer reading\n * `UserView.DisplayState.viewTypeConfigs`). The active type is controlled separately via\n * the `viewMode` / ViewTypeID inputs; this carries only the config payloads.\n */\n @Input()\n set ViewTypeConfigs(value: Array<{ viewTypeId: string; config: Record<string, unknown> }> | null) {\n this.viewTypeConfigById.clear();\n for (const entry of value ?? []) {\n if (entry?.viewTypeId) {\n this.viewTypeConfigById.set(entry.viewTypeId, entry.config ?? {});\n }\n }\n if (this.dynamicRendererRef && this.ActiveDynamicOption) {\n this.pushDynamicRendererInputs();\n }\n }\n\n /**\n * When true, the viewer persists view-type/config changes itself — to the loaded `UserView`\n * record (when a `ViewEntity`/`ViewID` is present) or to per-user User Settings (the default-view\n * case). When false (the default), the viewer only emits the `Before…`/`After…` events and the\n * consumer is responsible for persistence. Persistence is provider-based (generic-safe) — never\n * routing, which stays with the host app.\n */\n @Input() AutoSaveView: boolean = false;\n\n /**\n * Emitted (cancelable) BEFORE the active view type changes. A handler may set\n * `args.Cancel = true` to veto the switch. Fires for both built-in and plug-in types.\n */\n @Output() BeforeViewTypeChange = new EventEmitter<ViewTypeChangeEventArgs>();\n\n /**\n * Emitted AFTER the active view type has changed (and, when {@link AutoSaveView} is on, after\n * it has been persisted). Notification only.\n */\n @Output() AfterViewTypeChange = new EventEmitter<ViewTypeChangeEventArgs>();\n\n /**\n * Emitted (cancelable) BEFORE a plug-in renderer's configuration change is applied/persisted.\n */\n @Output() BeforeViewTypeConfigChange = new EventEmitter<ViewTypeConfigChangeEventArgs>();\n\n /**\n * Emitted AFTER a plug-in renderer's configuration change has been applied (and persisted when\n * {@link AutoSaveView} is on).\n */\n @Output() AfterViewTypeConfigChange = new EventEmitter<ViewTypeConfigChangeEventArgs>();\n\n /** Anchor for dynamically-mounted plug-in view renderers. */\n @ViewChild('dynamicViewHost', { read: ViewContainerRef }) private dynamicViewHost?: ViewContainerRef;\n\n /** The currently-ACTIVE (visible) plug-in renderer, if any. */\n private dynamicRendererRef: ComponentRef<IViewRenderer> | null = null;\n\n /** Input names the active plug-in declares (from `reflectComponentType`), used to push only the\n * generic inputs it accepts. Mirrors the active cache entry's input set. */\n private dynamicInputNames = new Set<string>();\n\n /**\n * Cache of mounted plug-in renderer instances for the CURRENT data context (entity + view),\n * keyed by `MJ: View Types` row ID. Switching view types within the same entity+view SHOWS/HIDES\n * cached instances (preserving their state — e.g. a computed cluster scatter, grid scroll) instead\n * of destroy/recreate. The whole cache is destroyed + rebuilt only when the data context changes:\n * entity change, or view (record / ViewID, including default↔saved) change. See\n * {@link clearDynamicRendererCache}.\n */\n private dynamicRendererCache = new Map<string, { ref: ComponentRef<IViewRenderer>; inputs: Set<string> }>();\n\n public InternalFilterText: string = '';\n public DebouncedFilterText: string = '';\n public IsLoading: boolean = false;\n public LoadingMessage: string = 'Loading...';\n public InternalRecords: Record<string, unknown>[] = [];\n public TotalRecordCount: number = 0;\n public FilteredRecordCount: number = 0;\n\n /** Track which records matched on hidden (non-visible) fields */\n public HiddenFieldMatches = new Map<string, string>();\n\n /** Current sort state */\n public InternalSortState: SortState | null = null;\n\n /** Pagination state */\n public Pagination: PaginationState = {\n currentPage: 0,\n pageSize: 100,\n totalRecords: 0,\n hasMore: false,\n isLoading: false\n };\n\n private destroy$ = new Subject<void>();\n private filterInput$ = new Subject<string>();\n\n /** Track if this is the first load (vs. load more) */\n private isInitialLoad: boolean = true;\n\n constructor(private cdr: ChangeDetectorRef, private ngZone: NgZone, private elementRef: ElementRef<HTMLElement>) {\n super();}\n\n /** IntersectionObserver used to detect when this viewer is re-attached/re-shown (Explorer caches +\n * reattaches resource components without firing Angular lifecycle hooks). See {@link ngAfterViewInit}. */\n private _visibilityObserver: IntersectionObserver | null = null;\n private _wasVisible = false;\n\n // ========================================\n // PUBLIC METHODS\n // ========================================\n\n /**\n * Hook retained for hosts (e.g. the workspace) that call this before switching views/entities.\n * View-type-specific persistence (e.g. a grid's live column/sort state) is now owned by the\n * mounted plug-in renderer, so the container has nothing to flush — this is a no-op.\n */\n public EnsurePendingChangesSaved(): void {\n // no-op: plug-in renderers own their own pending-state persistence\n }\n\n // ========================================\n // COMPUTED PROPERTIES\n // ========================================\n\n /**\n * Get the effective entity - uses entity input if provided, otherwise derives from viewEntity\n * This allows callers to provide just a viewEntity without explicitly setting the entity input.\n * Uses fallback resolution when ViewEntityInfo is not available.\n */\n get EffectiveEntity(): EntityInfo | null {\n if (this.Entity) {\n return this.Entity;\n }\n // Auto-derive from viewEntity if available\n if (this.ViewEntity) {\n return this.getEntityInfoFromViewEntity(this.ViewEntity);\n }\n return null;\n }\n\n /** Title shown in the \"no records\" empty state — varies with the active filter. */\n get NoRecordsTitle(): string {\n return this.DebouncedFilterText ? 'No matching records' : 'No records found';\n }\n\n /** True when the \"no records\" empty state is the result of an active filter. */\n get IsNoRecordsFiltered(): boolean {\n return !!this.DebouncedFilterText;\n }\n\n /**\n * Gets EntityInfo from a ViewEntity with multiple fallback strategies.\n * Priority: 1) ViewEntityInfo property (set by Load)\n * 2) Entity name lookup (virtual field)\n * 3) EntityID lookup\n * Returns null if entity cannot be determined.\n */\n private getEntityInfoFromViewEntity(viewEntity: MJUserViewEntityExtended): EntityInfo | null {\n // First try: ViewEntityInfo is the preferred source (set by MJUserViewEntityExtended.Load)\n if (viewEntity.ViewEntityInfo) {\n return viewEntity.ViewEntityInfo;\n }\n\n const md = this.ProviderToUse;\n\n // Second try: Look up by Entity name (virtual field that returns entity name)\n if (viewEntity.Entity) {\n const entityByName = md.Entities.find(e => e.Name === viewEntity.Entity);\n if (entityByName) {\n return entityByName;\n }\n }\n\n // Third try: Look up by EntityID\n if (viewEntity.EntityID) {\n const entityById = md.Entities.find(e => UUIDsEqual(e.ID, viewEntity.EntityID));\n if (entityById) {\n return entityById;\n }\n }\n\n console.warn(`[EntityViewer] Could not determine entity for view \"${viewEntity.Name}\" (ID: ${viewEntity.ID})`);\n return null;\n }\n\n /**\n * Get the effective filter text (external or internal)\n */\n get EffectiveFilterText(): string {\n return this.FilterText ?? this.InternalFilterText;\n }\n\n /**\n * Get the effective sort state (external or internal)\n */\n get EffectiveSortState(): SortState | null {\n return this.SortState ?? this.InternalSortState;\n }\n\n /**\n * Get merged configuration with defaults\n */\n get EffectiveConfig(): Required<EntityViewerConfig> {\n return { ...DEFAULT_VIEWER_CONFIG, ...this.Config };\n }\n\n /**\n * Get the records to display (external or internal)\n */\n get DisplayRecords(): Record<string, unknown>[] {\n return this.Records ?? this.InternalRecords;\n }\n\n /**\n * Get filtered records - when using server-side filtering, records are already filtered\n * When using client-side filtering, apply filter locally\n */\n get FilteredRecords(): Record<string, unknown>[] {\n const records = this.DisplayRecords;\n\n // If server-side filtering is enabled, records are already filtered\n if (this.EffectiveConfig.serverSideFiltering) {\n return records;\n }\n\n // Client-side filtering fallback\n const filterText = this.DebouncedFilterText?.trim().toLowerCase();\n this.HiddenFieldMatches.clear();\n\n if (!filterText || !this.Entity) {\n return records;\n }\n\n const visibleFields = this.getVisibleFieldNames();\n\n return records.filter(record => {\n const matchResult = this.recordMatchesFilter(record, filterText, visibleFields);\n if (matchResult.matches && matchResult.matchedField && !matchResult.matchedInVisibleField) {\n const recordKey = buildPkString(record, this.Entity!);\n this.HiddenFieldMatches.set(recordKey, matchResult.matchedField);\n }\n return matchResult.matches;\n });\n }\n\n /**\n * Check if a record matches the filter text (client-side)\n */\n private recordMatchesFilter(\n record: Record<string, unknown>,\n filterText: string,\n visibleFields: Set<string>\n ): { matches: boolean; matchedField: string | null; matchedInVisibleField: boolean } {\n if (!this.Entity) return { matches: true, matchedField: null, matchedInVisibleField: false };\n\n let matchedField: string | null = null;\n let matchedInVisibleField = false;\n\n for (const field of this.Entity.Fields) {\n if (!this.shouldSearchField(field)) continue;\n\n const value = record[field.Name];\n if (value == null) continue;\n\n const stringValue = String(value).toLowerCase();\n if (this.matchesSearchTerm(stringValue, filterText)) {\n matchedField = field.Name;\n if (visibleFields.has(field.Name)) {\n matchedInVisibleField = true;\n break;\n }\n }\n }\n\n return {\n matches: matchedField !== null,\n matchedField,\n matchedInVisibleField\n };\n }\n\n /**\n * Determine if a field should be included in search\n */\n private shouldSearchField(field: EntityFieldInfo): boolean {\n if (field.Name.startsWith('__mj_')) return false;\n if (field.TSType === 'Date') return false;\n if (field.SQLFullType?.trim().toLowerCase() === 'uniqueidentifier') return false;\n return true;\n }\n\n /**\n * Check if a value matches the search term (supports SQL-style % wildcards)\n */\n private matchesSearchTerm(value: string, searchTerm: string): boolean {\n if (!searchTerm.includes('%')) {\n return value.includes(searchTerm);\n }\n\n const fragments = searchTerm.split('%').filter(s => s.length > 0);\n if (fragments.length === 0) return true;\n\n let searchStartIndex = 0;\n for (const fragment of fragments) {\n const foundIndex = value.indexOf(fragment, searchStartIndex);\n if (foundIndex === -1) return false;\n searchStartIndex = foundIndex + fragment.length;\n }\n return true;\n }\n\n /**\n * Get set of field names that are visible in the current view\n */\n private getVisibleFieldNames(): Set<string> {\n const visible = new Set<string>();\n if (!this.Entity) return visible;\n\n for (const field of this.Entity.Fields) {\n if (field.DefaultInView === true) {\n visible.add(field.Name);\n }\n }\n\n if (this.Entity.NameField) {\n visible.add(this.Entity.NameField.Name);\n }\n\n return visible;\n }\n\n /**\n * Check if a record matched on a hidden field\n */\n public HasHiddenFieldMatch(record: Record<string, unknown>): boolean {\n if (!this.DebouncedFilterText || !this.Entity) return false;\n return this.HiddenFieldMatches.has(buildPkString(record, this.Entity));\n }\n\n /**\n * Get the name of the hidden field that matched for display\n */\n public GetHiddenMatchFieldName(record: Record<string, unknown>): string {\n if (!this.Entity) return '';\n const fieldName = this.HiddenFieldMatches.get(buildPkString(record, this.Entity));\n if (!fieldName || !this.Entity) return '';\n const field = this.Entity.Fields.find(f => f.Name === fieldName);\n return field ? field.DisplayNameOrName : fieldName;\n }\n\n // ========================================\n // LIFECYCLE HOOKS\n // ========================================\n\n ngOnInit(): void {\n this.applyConfig();\n this.setupFilterDebounce();\n\n // Initialize debounced filter from external filter text if provided\n if (this.FilterText !== null) {\n this.DebouncedFilterText = this.FilterText;\n }\n\n // Initialize sort state from config\n if (this.EffectiveConfig.defaultSortField) {\n this.InternalSortState = {\n field: this.EffectiveConfig.defaultSortField,\n direction: this.EffectiveConfig.defaultSortDirection ?? 'asc'\n };\n }\n\n // Mark as initialized - setters will now trigger data loading\n this._initialized = true;\n\n // Load the view-type registry and source the available-modes list from it.\n // Fire-and-forget: until it resolves (or if it fails), the template uses the\n // hardcoded fallback switcher, so behavior is unchanged on un-seeded systems.\n void this.ensureViewTypesLoaded();\n\n // If viewEntity was set before initialization, extract its sort state now.\n // The viewEntity setter skips this when _initialized is false.\n if (this._viewEntity) {\n this.applySortStateFromView(this._viewEntity);\n }\n\n // If entity was set before initialization, load data now.\n // Use deferReload so all inputs are settled before the first RunView.\n if (this._entity && !this._records) {\n this.deferReload();\n }\n }\n\n /**\n * Defers a data reload to a microtask so that all Angular input bindings\n * (entity, viewEntity, gridState, etc.) complete before we fire a RunView.\n * Multiple calls within the same change detection cycle collapse into one load.\n */\n private deferReload(): void {\n if (this._reloadDeferred) {\n return; // already queued or in-flight\n }\n this._reloadDeferred = true;\n Promise.resolve().then(async () => {\n try {\n if (this._initialized && this._entity && !this._records) {\n await this.LoadData();\n }\n } finally {\n // Clear only after loadData fully completes (including the async RunView).\n // This prevents any re-entry via deferReload() during the entire load cycle.\n this._reloadDeferred = false;\n }\n });\n }\n\n ngAfterViewInit(): void {\n // CRITICAL: the active view type is selected during ngOnInit (Entity setter → refreshAvailableViewTypes\n // → applyViewTypeSelection → selectDynamicRenderer), but `dynamicViewHost` is a NON-static @ViewChild\n // that only resolves now (ngAfterViewInit). So that earlier selectDynamicRenderer() returned early\n // (host undefined) and never created the renderer — leaving a stale ActiveDynamicOption with no\n // mounted ref (symptom: \"171 records\" header but an empty grid, pushInputs SKIPPED ref=null). Now\n // that the host exists, mount the active renderer if it hasn't been.\n if (this.ActiveDynamicOption && !this.dynamicRendererRef && this.dynamicViewHost) {\n this.selectDynamicRenderer(this.ActiveDynamicOption);\n }\n\n // Detect re-attach: Explorer caches resource components and detaches/re-attaches their VIEW\n // without firing ngOnInit/ngOnDestroy. When the dashboard tab is re-focused, this viewer's host\n // re-enters the DOM/viewport — but the mounted plug-in (e.g. AG Grid) was rendered while detached\n // and may show an empty body even though the data is still loaded. An IntersectionObserver gives\n // us a reliable \"became visible again\" signal with no lifecycle hook.\n if (typeof IntersectionObserver !== 'undefined' && this.elementRef?.nativeElement) {\n this.ngZone.runOutsideAngular(() => {\n this._visibilityObserver = new IntersectionObserver((entries) => {\n const visible = entries.some(e => e.isIntersecting);\n if (visible && !this._wasVisible) {\n this._wasVisible = true;\n this.ngZone.run(() => this.onViewerReattached());\n } else if (!visible) {\n this._wasVisible = false;\n }\n });\n this._visibilityObserver.observe(this.elementRef.nativeElement);\n });\n }\n }\n\n /**\n * Called when the viewer becomes visible again after being detached (cached-tab reattach). Mounts\n * the active plug-in if it was never created (host wasn't ready at selection time), or re-pushes the\n * current inputs so a host-fed grid re-renders its rows (the \"N records in header but empty grid on\n * return\" symptom).\n */\n private onViewerReattached(): void {\n const active = this.ActiveDynamicOption;\n if (active && !this.dynamicRendererRef && this.dynamicViewHost) {\n // Active view type selected but never mounted (host wasn't ready at selection time) — mount now.\n this.selectDynamicRenderer(active);\n } else if (active && this.dynamicRendererRef) {\n // Re-assert visibility (force display:block) + re-push inputs so the mounted renderer re-renders.\n this.setRendererVisible(this.dynamicRendererRef, true);\n this.pushDynamicRendererInputs();\n this.dynamicRendererRef.changeDetectorRef.detectChanges();\n }\n }\n\n ngOnDestroy(): void {\n this._visibilityObserver?.disconnect();\n this._visibilityObserver = null;\n this.clearDynamicRendererCache();\n this.destroy$.next();\n this.destroy$.complete();\n }\n\n // ========================================\n // CONFIGURATION\n // ========================================\n\n /**\n * Extracts sort state from a view entity, checking ViewSortInfo first then\n * falling back to GridState.sortSettings. Resets internalSortState if the\n * view has no sort defined (prevents stale sort from a previous view).\n */\n private applySortStateFromView(view: MJUserViewEntityExtended | null): void {\n if (!view) {\n this.InternalSortState = null;\n return;\n }\n\n // Priority 1: SortState column (via ViewSortInfo)\n const viewSortInfo = view.ViewSortInfo;\n if (viewSortInfo && viewSortInfo.length > 0) {\n this.InternalSortState = {\n field: viewSortInfo[0].field,\n direction: viewSortInfo[0].direction?.toLowerCase() === 'desc' ? 'desc' : 'asc'\n };\n return;\n }\n\n // Priority 2: GridState.sortSettings (sort may only be stored here)\n if (view.GridState) {\n const gridState = view.GridStateObject;\n if (gridState?.sortSettings && gridState.sortSettings.length > 0) {\n const firstSort = gridState.sortSettings[0];\n this.InternalSortState = {\n field: firstSort.field,\n direction: firstSort.dir === 'desc' ? 'desc' : 'asc'\n };\n return;\n }\n }\n\n // No sort defined — reset to prevent stale sort from previous view\n this.InternalSortState = null;\n }\n\n private applyConfig(): void {\n const config = this.EffectiveConfig;\n this.Pagination.pageSize = config.pageSize;\n }\n\n private setupFilterDebounce(): void {\n this.filterInput$\n .pipe(\n debounceTime(this.EffectiveConfig.filterDebounceMs),\n distinctUntilChanged(),\n takeUntil(this.destroy$)\n )\n .subscribe(filterText => {\n const oldFilter = this.DebouncedFilterText;\n this.DebouncedFilterText = filterText;\n this.FilterTextChange.emit(filterText);\n\n // If server-side filtering and filter changed, reload from page 1\n // Keep existing records visible during refresh for better UX\n if (this.EffectiveConfig.serverSideFiltering && filterText !== oldFilter && !this.Records) {\n this.resetPaginationState(false);\n this.LoadData();\n } else {\n this.updateFilteredCount();\n }\n this.pushDynamicRendererInputs(); // client-side filter changed — refresh a mounted plug-in\n this.cdr.detectChanges();\n });\n }\n\n /**\n * Update the filtered record count and emit event\n */\n private updateFilteredCount(): void {\n const newCount = this.FilteredRecords.length;\n if (this.FilteredRecordCount !== newCount) {\n this.FilteredRecordCount = newCount;\n this.FilteredCountChanged.emit({\n filteredCount: newCount,\n totalCount: this.TotalRecordCount\n });\n }\n }\n\n /**\n * Reset pagination state for a fresh load.\n * When clearRecords is true (default), clears all record data - use for entity switches.\n * When clearRecords is false, keeps existing records visible during refresh - use for sort/filter changes.\n */\n private resetPaginationState(clearRecords: boolean = true): void {\n this.Pagination = {\n currentPage: 0,\n pageSize: this.EffectiveConfig.pageSize,\n totalRecords: clearRecords ? 0 : this.Pagination.totalRecords,\n hasMore: false,\n isLoading: false\n };\n if (clearRecords) {\n this.InternalRecords = [];\n this.TotalRecordCount = 0;\n this.FilteredRecordCount = 0;\n }\n this.isInitialLoad = true;\n }\n\n // ========================================\n // DATA LOADING\n // ========================================\n\n // Sequence counter for tracking load requests and detecting stale responses\n private _loadSequence = 0;\n // Flag: a reload was requested while a load was already in progress\n private _pendingReload = false;\n\n /**\n * Load data for the current entity with server-side filtering/sorting/pagination\n */\n public async LoadData(): Promise<void> {\n const entity = this.EffectiveEntity;\n if (!entity) {\n this.InternalRecords = [];\n this.TotalRecordCount = 0;\n this.FilteredRecordCount = 0;\n return;\n }\n\n // Increment sequence to track this load request\n const loadId = ++this._loadSequence;\n\n // If a load is already in progress, set a flag so we reload once the current\n // load completes. We can't use deferReload() here because the microtask would\n // fire while isLoading is still true, causing an infinite loop.\n if (this.IsLoading) {\n this._pendingReload = true;\n return;\n }\n\n this.IsLoading = true;\n this.Pagination.isLoading = true;\n this.LoadingMessage = `Loading ${entity.Name}...`;\n this.cdr.detectChanges();\n\n const startTime = Date.now();\n const config = this.EffectiveConfig;\n\n try {\n const rv = RunView.FromMetadataProvider(this.ProviderToUse);\n\n // Build OrderBy clause\n // Priority: 1) External/internal sort state 2) View's OrderByClause\n // 3) GridState.sortSettings (saved user defaults) 4) undefined\n let orderBy: string | undefined;\n const sortState = this.EffectiveSortState;\n if (config.serverSideSorting && sortState?.field && sortState.direction) {\n orderBy = `${sortState.field} ${sortState.direction.toUpperCase()}`;\n } else if (this.ViewEntity?.OrderByClause) {\n orderBy = this.ViewEntity.OrderByClause;\n } else if (this.GridState?.sortSettings?.length) {\n orderBy = this.GridState.sortSettings\n .map(s => `${s.field} ${(s.dir || 'asc').toUpperCase()}`)\n .join(', ');\n }\n\n // When a plug-in renderer has asked the container to load the full set (via a generic\n // ViewDataRequest with loadAll:true), load all records up to the safety cap and skip\n // pagination. Otherwise use standard page-based pagination. This is fully view-type-agnostic\n // — the container never inspects which plug-in is mounted.\n const maxRows = this._loadAllRecords ? EntityViewerComponent.LOAD_ALL_MAX_RECORDS : config.pageSize;\n const startRow = this._loadAllRecords ? 0 : this.Pagination.currentPage * config.pageSize;\n\n // Build ExtraFilter from view's WhereClause if available\n // The view's WhereClause is the \"business filter\" - UserSearchString is additive\n const extraFilter = this.ViewEntity?.WhereClause || undefined;\n\n const result = await rv.RunView<Record<string, unknown>>({\n EntityName: entity.Name,\n ResultType: 'simple',\n // Load the FULL field set. The container is a generic plug-in host: different view types need\n // different fields (the grid shows its columns, but Timeline needs the date field, Map needs\n // lat/long, etc.). It cannot restrict to any one plug-in's columns, so it fetches all fields and\n // lets each plug-in pick what it needs. (Omitting `Fields` on a 'simple' RunView returns all\n // entity fields.) Previously this used `computeFieldsList(entity, GridState)` — correct when the\n // host WAS the grid, but it dropped `__mj_*` date fields, leaving Timeline with \"no events\".\n MaxRows: maxRows,\n StartRow: startRow,\n OrderBy: orderBy,\n ExtraFilter: extraFilter,\n // Only use UserSearchString for regular text search, NOT for smart filters\n // Smart filters generate WhereClause via AI on the server, so the prompt text should not be passed as UserSearchString\n UserSearchString: config.serverSideFiltering && !this.ViewEntity?.SmartFilterEnabled\n ? this.DebouncedFilterText || undefined\n : undefined\n });\n\n // Check if this load is still the current one (detect stale responses)\n if (loadId !== this._loadSequence) {\n return;\n }\n\n if (result.Success) {\n\n // Always replace records (page-based navigation, not accumulation)\n this.InternalRecords = result.Results;\n\n this.TotalRecordCount = result.TotalRowCount;\n this.FilteredRecordCount = this.InternalRecords.length;\n\n // Update pagination state\n this.Pagination.totalRecords = result.TotalRowCount;\n this.Pagination.hasMore = false; // No longer used with page-based paging\n\n this.DataLoaded.emit({\n totalRowCount: result.TotalRowCount,\n loadedRowCount: this.InternalRecords.length,\n loadTime: Date.now() - startTime,\n records: this.InternalRecords\n });\n\n this.FilteredCountChanged.emit({\n filteredCount: this.InternalRecords.length,\n totalCount: result.TotalRowCount\n });\n } else {\n if (this.isInitialLoad) {\n this.InternalRecords = [];\n }\n this.TotalRecordCount = 0;\n this.FilteredRecordCount = 0;\n }\n } catch (error) {\n if (this.isInitialLoad) {\n this.InternalRecords = [];\n }\n this.TotalRecordCount = 0;\n this.FilteredRecordCount = 0;\n } finally {\n // Use ngZone.run() to ensure state changes trigger change detection.\n // With es2022 native async/await + zone.js 0.16, the await resumes\n // outside Angular's zone, so detectChanges() alone may not flush properly.\n this.ngZone.run(() => {\n this.IsLoading = false;\n this.Pagination.isLoading = false;\n this.isInitialLoad = false;\n this.pushDynamicRendererInputs(); // keep a mounted plug-in renderer in sync with new data\n this.cdr.detectChanges();\n });\n\n // If a reload was requested while we were loading, trigger it now.\n // isLoading is false at this point so loadData() won't re-enter the pending path.\n if (this._pendingReload) {\n this._pendingReload = false;\n this.resetPaginationState();\n this.LoadData();\n }\n }\n }\n\n /**\n * Handle page change from PaginationComponent\n */\n public OnPageChange(event: PageChangeEvent): void {\n this.Pagination.currentPage = event.PageNumber - 1; // Convert 1-based to 0-based\n this.isInitialLoad = true; // Treat page navigation as a fresh load for loading state\n this.LoadData();\n }\n\n /**\n * Refresh data (re-load from server, starting at page 1)\n * Keeps existing records visible during refresh for better UX\n */\n public Refresh(): void {\n if (!this.Records) {\n this.resetPaginationState(false);\n this.LoadData();\n }\n }\n\n // ========================================\n // PROGRAMMATIC GRID CONTROL (agent / external driver)\n // ========================================\n // These thin, public methods expose the same pagination/sort the user drives\n // interactively so an external driver (e.g. the AI agent, via the dashboard's\n // ViewWorkspace passthrough) can page and sort the grid. They are no-ops when\n // records are externally supplied (no internal RunView to retrigger).\n\n /** Current (1-based) page number the grid is showing. Internally stored 0-based. */\n public get CurrentPageNumber(): number {\n return this.Pagination.currentPage + 1;\n }\n\n /** Number of records loaded per page. */\n public get CurrentPageSize(): number {\n return this.Pagination.pageSize;\n }\n\n /** Total records available for the current entity/view/filter (from the server). */\n public get TotalRecords(): number {\n return this.Pagination.totalRecords;\n }\n\n /** The grid's active sort state, or null when unsorted. */\n public get CurrentSortState(): SortState | null {\n return this.InternalSortState;\n }\n\n /**\n * Navigate to a specific (1-based) page. Clamps to the valid range. Returns the\n * page actually navigated to, or null when paging isn't applicable (externally\n * supplied records).\n */\n public GoToPageNumber(pageNumber: number): number | null {\n if (this._records) {\n return null;\n }\n const totalPages = this.TotalPageCount;\n const clamped = Math.min(Math.max(1, Math.floor(pageNumber)), Math.max(1, totalPages));\n this.OnPageChange({ PageNumber: clamped, PageSize: this.Pagination.pageSize } as PageChangeEvent);\n return clamped;\n }\n\n /** Total page count derived from total records and page size (min 1). */\n public get TotalPageCount(): number {\n const size = this.Pagination.pageSize;\n if (size <= 0 || this.Pagination.totalRecords <= 0) {\n return 1;\n }\n return Math.ceil(this.Pagination.totalRecords / size);\n }\n\n /** Advance to the next page (no-op past the last page). Returns the new 1-based page or null. */\n public NextPage(): number | null {\n return this.GoToPageNumber(this.CurrentPageNumber + 1);\n }\n\n /** Go to the previous page (no-op before the first page). Returns the new 1-based page or null. */\n public PreviousPage(): number | null {\n return this.GoToPageNumber(this.CurrentPageNumber - 1);\n }\n\n /**\n * Set the server-side page size and reload from page 1. Returns the size applied,\n * or null when paging isn't applicable (externally supplied records).\n */\n public SetServerPageSize(pageSize: number): number | null {\n if (this._records || !Number.isFinite(pageSize) || pageSize <= 0) {\n return null;\n }\n const size = Math.floor(pageSize);\n this.Pagination.pageSize = size;\n this.OnPageChange({ PageNumber: 1, PageSize: size } as PageChangeEvent);\n return size;\n }\n\n /**\n * Apply a server-side sort by field + direction and reload. Returns true when the\n * sort was applied, false when sorting isn't applicable (externally supplied records).\n */\n public ApplySort(field: string, direction: SortDirection): boolean {\n if (this._records) {\n return false;\n }\n // Drive through the public SortState input so the reload logic stays in one place.\n this.SortState = { field, direction };\n return true;\n }\n\n /**\n * Programmatically select a record — the no-UI equivalent of a user row-click. Highlights\n * the row (by pushing {@link SelectedRecordID} down to the active renderer) AND emits\n * {@link RecordSelected} so the host runs its selection path (open the detail panel, etc.).\n * Returns false when there's no entity context. This is the entry point for an external\n * driver (the AI agent's SelectRecord tool); the record must be one of the loaded rows.\n *\n * @param record - a record from the currently-loaded set\n * @returns true when selection was applied, false when no entity context is available\n */\n public SelectRecord(record: Record<string, unknown>): boolean {\n const entity = this.EffectiveEntity;\n if (!entity || !record) {\n return false;\n }\n const compositeKey = buildCompositeKey(record, entity);\n // Drive the highlight through the same input the user-click path uses.\n this.SelectedRecordID = compositeKey.ToConcatenatedString();\n this.RecordSelected.emit({ record, entity, compositeKey });\n return true;\n }\n\n /**\n * Export the current view's records via the active renderer's optional imperative export\n * ({@link IViewRenderer.exportRecords}). Returns false when no renderer is mounted or the\n * active view type doesn't support export (e.g. timeline/map). The grid renderer downloads\n * the file itself; this is the no-UI entry point for an external driver (the AI agent).\n */\n public async ExportRecords(format?: 'csv' | 'excel' | 'json'): Promise<boolean> {\n const renderer = this.dynamicRendererRef?.instance;\n if (!renderer || typeof renderer.exportRecords !== 'function') {\n return false;\n }\n return renderer.exportRecords(format);\n }\n\n // ========================================\n // VIEW MODE\n // ========================================\n\n /**\n * Loads the ViewTypeEngine once, then recomputes the available view types for the\n * current entity. Fire-and-forget from lifecycle/setters — failures simply leave the\n * switcher empty until the registry is available.\n */\n private async ensureViewTypesLoaded(): Promise<void> {\n try {\n const provider = this.ProviderToUse;\n await ViewTypeEngine.Instance.Config(false, provider?.CurrentUser, provider ?? undefined);\n // Let plug-in descriptors (e.g. Cluster) preload availability data before predicates run.\n await ViewTypeEngine.Instance.EnsureAvailabilityData(provider ?? undefined);\n this.refreshAvailableViewTypes();\n } catch {\n // Engine unavailable / not seeded — leave the switcher empty.\n this.ViewTypesFromRegistry = false;\n }\n }\n\n /**\n * Recomputes {@link AvailableViewTypes} from the registry for the current entity. Every\n * available view type is a dynamic-mounted plug-in. Reconciles the active selection when the\n * previously-active type is no longer available (e.g. the entity changed).\n */\n private refreshAvailableViewTypes(): void {\n const entity = this.EffectiveEntity;\n if (!entity) {\n this.AvailableViewTypes = [];\n this.ViewTypesFromRegistry = false;\n return;\n }\n // Self-contained config seeding: pull per-view-type config from the loaded view record or\n // the per-user default-view setting when the consumer didn't supply it via [ViewTypeConfigs].\n this.seedViewTypeConfigsIfEmpty();\n\n let rows: Array<{ ViewType: { ID: string }; Descriptor: IViewTypeDescriptor }> = [];\n try {\n rows = ViewTypeEngine.Instance.GetAvailableViewTypeRows(entity, this.ProviderToUse ?? undefined);\n } catch {\n rows = [];\n }\n\n const options: ViewModeOption[] = [];\n for (const { ViewType, Descriptor } of rows) {\n options.push({\n key: Descriptor.Name,\n mode: null, // every view type is dynamic-mounted\n label: Descriptor.DisplayName,\n icon: Descriptor.Icon ?? '',\n isDynamic: true,\n descriptor: Descriptor,\n viewTypeId: ViewType.ID,\n });\n }\n\n this.AvailableViewTypes = options;\n this.ViewTypesFromRegistry = options.length > 0;\n\n // Keep the active key valid: if the previously-active type is no longer available\n // (entity changed), select — in priority order — the resolved initial ViewTypeID\n // (explicit input → loaded view record → per-user default-view setting), then the first\n // available type.\n if (options.length > 0 && !options.some(o => o.key === this.ActiveViewTypeKey)) {\n const desiredId = this.resolveInitialViewTypeId();\n const desired = desiredId ? options.find(o => o.viewTypeId === desiredId) : undefined;\n const fallback = desired ?? options[0];\n this.applyViewTypeSelection(fallback, false);\n }\n\n this.cdr.detectChanges();\n }\n\n /**\n * Returns the switcher option for the active view type (for the current-type chip in the\n * switcher), or null before the registry resolves.\n */\n get ActiveViewTypeOption(): ViewModeOption | null {\n return this.AvailableViewTypes.find(o => o.key === this.ActiveViewTypeKey) ?? null;\n }\n\n /**\n * Selects a view type from the switcher. Built-in types route to {@link setViewMode}\n * (preserving the rich grid/cards/timeline/map integration); plug-in types are\n * dynamic-mounted via the descriptor's RendererComponent. Emits {@link viewTypeChange}\n * so hosts can persist `UserView.ViewTypeID`.\n */\n SelectViewType(option: ViewModeOption): void {\n this.ViewTypeDropdownOpen = false;\n this.applyViewTypeSelection(option, true);\n }\n\n /**\n * Selects a view type by its `MJ: View Types` row ID. This is the entry point used by external\n * chrome (e.g. the workspace toolbar's {@link ViewTypeSwitcherComponent}) that surfaces the\n * switcher outside the viewer's own header. Resolves the matching available option and applies\n * it through the same lifecycle as a header-driven switch (cancelable events + persistence).\n * No-op when the ID isn't an available view type or is already active.\n *\n * @param viewTypeId the `MJ: View Types` row ID to switch to.\n */\n public SelectViewTypeById(viewTypeId: string | null): void {\n if (!viewTypeId) {\n return;\n }\n const option = this.AvailableViewTypes.find(o => o.viewTypeId === viewTypeId);\n if (option && option.key !== this.ActiveViewTypeKey) {\n this.applyViewTypeSelection(option, true);\n }\n }\n\n /**\n * The `MJ: View Types` row ID of the currently-active view type, or null before the registry\n * resolves. Lets external chrome (the workspace toolbar switcher) reflect the viewer's active\n * type without reaching into the viewer's internal {@link ViewModeOption}s.\n */\n public get ActiveViewTypeId(): string | null {\n return this.ActiveViewTypeOption?.viewTypeId ?? null;\n }\n\n /**\n * Applies a view-type selection. `emit` is true for user-initiated switches (fires the\n * cancelable {@link BeforeViewTypeChange}, persists when {@link AutoSaveView} is on, then fires\n * {@link AfterViewTypeChange}) and false for internal reconciliation (no events, no persist).\n *\n * Every view type is a dynamic-mounted plug-in: this tears down the previous renderer and mounts\n * the selected descriptor's `RendererComponent`. The container resets its generic load mode (a\n * fresh plug-in that needs the full set will re-request it via `dataRequest({loadAll:true})`) and\n * reloads page-based data when the active type changes.\n */\n private applyViewTypeSelection(option: ViewModeOption, emit: boolean): void {\n const previousViewTypeId = this.ActiveViewTypeOption?.viewTypeId ?? null;\n\n if (emit) {\n const before: ViewTypeChangeEventArgs = {\n ViewTypeID: option.viewTypeId,\n DriverClass: option.key,\n PreviousViewTypeID: previousViewTypeId,\n Cancel: false,\n };\n this.BeforeViewTypeChange.emit(before);\n if (before.Cancel) {\n return; // a handler vetoed the switch — leave the switcher unchanged\n }\n }\n\n const typeChanged = this.ActiveViewTypeKey !== option.key;\n this.ActiveViewTypeKey = option.key;\n this.ActiveDynamicOption = option;\n this.selectDynamicRenderer(option);\n\n // On a real type switch, drop any prior load-all mode and reload page-based data so the newly\n // mounted plug-in starts from the standard paginated set. A plug-in needing everything (e.g. a\n // map) re-asks via dataRequest on its own init. Skip the reload for the initial reconciliation\n // (no prior type) — the regular entity/view data-load path already handles the first load.\n if (typeChanged && previousViewTypeId !== null && this._loadAllRecords && !this._records) {\n this._loadAllRecords = false;\n this.resetPaginationState(false);\n this.LoadData();\n }\n\n if (emit) {\n if (this.AutoSaveView) {\n void this.persistActiveViewType(option);\n }\n this.AfterViewTypeChange.emit({\n ViewTypeID: option.viewTypeId,\n DriverClass: option.key,\n PreviousViewTypeID: previousViewTypeId,\n Cancel: false,\n });\n }\n this.cdr.detectChanges();\n }\n\n // ========================================\n // VIEW-TYPE PERSISTENCE (provider-based; never routing)\n // ========================================\n\n /**\n * Where view-type/config persists when {@link AutoSaveView} is on: a loaded `UserView` record,\n * per-user User Settings (the default-view case), or nowhere.\n */\n private persistenceTarget(): ViewPersistenceTarget {\n if (this._viewEntity?.ID) {\n return 'record';\n }\n if (this.EffectiveEntity) {\n return 'user-settings';\n }\n return 'none';\n }\n\n /** Persist the active view-type selection to the resolved target. */\n private async persistActiveViewType(option: ViewModeOption): Promise<void> {\n const target = this.persistenceTarget();\n if (target === 'record') {\n const ve = this._viewEntity!;\n ve.ViewTypeID = option.viewTypeId;\n await this.saveViewEntity(ve);\n } else if (target === 'user-settings') {\n this.saveDefaultViewSetting();\n }\n }\n\n /** Persist a per-view-type config change to the resolved target. */\n private async persistViewTypeConfig(viewTypeId: string): Promise<void> {\n const target = this.persistenceTarget();\n if (target === 'record') {\n const ve = this._viewEntity!;\n const displayState = ve.DisplayStateObject ?? { defaultMode: 'grid' };\n const configs = (displayState.viewTypeConfigs ?? []).filter(c => c.viewTypeId !== viewTypeId);\n configs.push({ viewTypeId, config: this.viewTypeConfigById.get(viewTypeId) ?? {} });\n displayState.viewTypeConfigs = configs;\n ve.DisplayStateObject = displayState;\n await this.saveViewEntity(ve);\n } else if (target === 'user-settings') {\n this.saveDefaultViewSetting();\n }\n }\n\n /** Save the loaded view record, logging (not throwing) on failure. */\n private async saveViewEntity(viewEntity: MJUserViewEntityExtended): Promise<void> {\n const saved = await viewEntity.Save();\n if (!saved) {\n LogError(`EntityViewer: failed to persist view: ${viewEntity.LatestResult?.CompleteMessage ?? 'unknown error'}`);\n }\n }\n\n /** User Settings key for this entity's per-user default-view state. */\n private defaultViewSettingKey(): string | null {\n const entity = this.EffectiveEntity;\n return entity ? `mj.entityViewer.${entity.ID.toLowerCase()}.view` : null;\n }\n\n /** Persist the per-user default-view state (active view type + per-type configs) to User Settings. */\n private saveDefaultViewSetting(): void {\n const key = this.defaultViewSettingKey();\n if (!key) {\n return;\n }\n const payload = {\n viewTypeId: this.ActiveViewTypeOption?.viewTypeId ?? null,\n viewTypeConfigs: this.serializeViewTypeConfigs(),\n };\n UserInfoEngine.Instance.SetSettingDebounced(key, JSON.stringify(payload));\n }\n\n /** Convert the in-memory per-view-type config map to the persisted array shape. */\n private serializeViewTypeConfigs(): Array<{ viewTypeId: string; config: Record<string, unknown> }> {\n return Array.from(this.viewTypeConfigById.entries()).map(([viewTypeId, config]) => ({ viewTypeId, config }));\n }\n\n /**\n * Resolve which view type the viewer should open in, in priority order:\n * explicit `ViewTypeID` input → the loaded `UserView` record's `ViewTypeID` → the per-user\n * default-view setting (User Settings). Returns null to let the caller fall back to the legacy\n * mode / first available type. This is how the viewer is self-contained for both the saved-view\n * and default-view cases without the consumer wiring anything.\n */\n private resolveInitialViewTypeId(): string | null {\n if (this._initialViewTypeId) {\n return this._initialViewTypeId;\n }\n if (this._viewEntity?.ViewTypeID) {\n return this._viewEntity.ViewTypeID;\n }\n return this.readDefaultViewSetting()?.viewTypeId ?? null;\n }\n\n /**\n * Load a saved view by ID via the active provider and apply it through the {@link viewEntity}\n * setter. Backs the {@link ViewID} convenience input. Logs (does not throw) on failure.\n */\n private async loadViewById(viewId: string): Promise<void> {\n const provider = this.ProviderToUse;\n if (!provider) {\n return;\n }\n const view = await provider.GetEntityObject<MJUserViewEntityExtended>('MJ: User Views', provider.CurrentUser);\n const loaded = await view.Load(viewId);\n if (loaded) {\n this.ViewEntity = view;\n } else {\n LogError(`EntityViewer: failed to load view ${viewId}: ${view.LatestResult?.CompleteMessage ?? 'unknown error'}`);\n }\n }\n\n /** Read the per-user default-view setting for the current entity (or null). */\n private readDefaultViewSetting(): { viewTypeId: string | null; viewTypeConfigs?: Array<{ viewTypeId: string; config: Record<string, unknown> }> } | null {\n const key = this.defaultViewSettingKey();\n if (!key) {\n return null;\n }\n const raw = UserInfoEngine.Instance.GetSetting(key);\n if (!raw) {\n return null;\n }\n try {\n return JSON.parse(raw);\n } catch {\n return null;\n }\n }\n\n /**\n * Seed the in-memory per-view-type config map from the available sources when the consumer\n * hasn't supplied them via the {@link ViewTypeConfigs} input: the loaded `UserView` record's\n * `DisplayState.viewTypeConfigs` (saved-view case) or the per-user default-view setting.\n * Only seeds when the map is empty, so an explicit input always wins.\n */\n private seedViewTypeConfigsIfEmpty(): void {\n if (this.viewTypeConfigById.size > 0) {\n return;\n }\n const fromRecord = this._viewEntity?.DisplayStateObject?.viewTypeConfigs;\n const source = fromRecord ?? this.readDefaultViewSetting()?.viewTypeConfigs ?? [];\n for (const entry of source) {\n if (entry?.viewTypeId) {\n this.viewTypeConfigById.set(entry.viewTypeId, entry.config ?? {});\n }\n }\n }\n\n // ========================================\n // DYNAMIC (PLUG-IN) VIEW RENDERER MOUNTING\n // ========================================\n\n /**\n * Makes `option`'s plug-in the ACTIVE view: reuses its cached instance when present (preserving\n * state), otherwise creates it. All other cached instances are hidden (kept mounted). The container\n * has zero knowledge of which plug-in this is — it only knows the {@link IViewRenderer} contract.\n */\n private selectDynamicRenderer(option: ViewModeOption): void {\n const host = this.dynamicViewHost;\n if (!host || !option.descriptor.RendererComponent) {\n return;\n }\n\n // Hide every cached instance; the active one is shown below. Hidden instances stay mounted so\n // their state survives a round-trip (e.g. switch Grid → Cluster → Grid without re-clustering).\n for (const entry of this.dynamicRendererCache.values()) {\n this.setRendererVisible(entry.ref, false);\n }\n\n let entry = this.dynamicRendererCache.get(option.viewTypeId);\n if (!entry) {\n entry = this.createDynamicRenderer(option);\n }\n this.dynamicRendererRef = entry.ref;\n this.dynamicInputNames = entry.inputs;\n this.setRendererVisible(entry.ref, true);\n this.pushDynamicRendererInputs();\n entry.ref.changeDetectorRef.detectChanges();\n }\n\n /**\n * Creates a plug-in renderer instance, wires its generic outputs, captures its declared inputs,\n * and caches it by `MJ: View Types` row ID. (Does not show/activate it — {@link selectDynamicRenderer}\n * does that.)\n */\n private createDynamicRenderer(option: ViewModeOption): { ref: ComponentRef<IViewRenderer>; inputs: Set<string> } {\n const host = this.dynamicViewHost!;\n const componentType = option.descriptor.RendererComponent;\n const ref = host.createComponent<IViewRenderer>(componentType as never);\n\n // Capture the set of input names this plug-in actually declares, so we only push the generic\n // inputs it accepts. A lean plug-in (e.g. Timeline/Cards) won't declare grid-only inputs like\n // `totalRecordCount`/`page` — calling `setInput` for those logs NG0303 in dev (the log fires\n // before the throw, so a try/catch can't suppress it). Pre-checking with the reflected metadata\n // keeps the console clean and the container plug-in-agnostic.\n const inputs = new Set<string>(reflectComponentType(componentType)?.inputs.map(i => i.templateName) ?? []);\n\n // Wire the generic IViewRenderer outputs. All are optional on lean plug-ins, so guard each\n // with `?.`. Only navigation (record open / related-record / create) bubbles to the outer app;\n // config and dataRequest are generic plug-in↔container coordination.\n const inst = ref.instance;\n inst.recordSelected?.pipe(takeUntil(this.destroy$)).subscribe((r: unknown) => this.onDynamicRecordSelected(r));\n inst.recordOpened?.pipe(takeUntil(this.destroy$)).subscribe((r: unknown) => this.onDynamicRecordOpened(r));\n inst.configChanged\n ?.pipe(takeUntil(this.destroy$))\n .subscribe((cfg: unknown) => this.onDynamicConfigChanged(option.viewTypeId, (cfg ?? {}) as Record<string, unknown>));\n inst.openRelatedRecordRequested\n ?.pipe(takeUntil(this.destroy$))\n .subscribe((nav: ViewRelatedRecordNavigation) => this.OpenRelatedRecordRequested.emit(nav));\n inst.createRecordRequested\n ?.pipe(takeUntil(this.destroy$))\n .subscribe(() => this.CreateRecordRequested.emit());\n inst.dataRequest\n ?.pipe(takeUntil(this.destroy$))\n .subscribe((req: ViewDataRequest) => this.onDynamicDataRequest(req));\n inst.configureRequested\n ?.pipe(takeUntil(this.destroy$))\n .subscribe(() => this.ConfigureRequested.emit());\n\n const created = { ref, inputs };\n this.dynamicRendererCache.set(option.viewTypeId, created);\n return created;\n }\n\n /**\n * Toggle a cached renderer's host element visibility without destroying it (preserves state).\n * When visible, force `display: block` + `height: 100%` rather than clearing the style: the wrapper\n * components use `ViewEncapsulation.None`, under which their `:host { display:block; height:100% }`\n * rule is a no-op, so a custom element defaults to `display: inline` — which gives AG Grid a\n * zero-width viewport (no rows/columns render), especially after a hide → show cycle. Forcing block\n * here guarantees every view-type plug-in gets a full-size block container.\n */\n private setRendererVisible(ref: ComponentRef<IViewRenderer>, visible: boolean): void {\n const el = ref.location.nativeElement as HTMLElement | undefined;\n if (el) {\n el.style.display = visible ? 'block' : 'none';\n if (visible) {\n el.style.height = '100%';\n }\n }\n }\n\n /**\n * Destroys ALL cached plug-in instances and clears the host. Called when the data context changes\n * (entity change / view (record / ViewID) change) so the next selection rebuilds fresh. NOT called\n * on a plain view-type switch within the same context — that path reuses cached instances.\n */\n private clearDynamicRendererCache(): void {\n for (const entry of this.dynamicRendererCache.values()) {\n entry.ref.destroy();\n }\n this.dynamicRendererCache.clear();\n this.dynamicRendererRef = null;\n this.dynamicInputNames = new Set<string>();\n this.dynamicViewHost?.clear();\n }\n\n /**\n * Pushes the current generic data-context into the mounted plug-in renderer via `setInput`.\n * Every input is part of the generic {@link IViewRenderer} contract; lean plug-ins may not declare\n * all of them, so each `setInput` is wrapped in try/catch (Angular throws on undeclared inputs).\n */\n private pushDynamicRendererInputs(): void {\n const ref = this.dynamicRendererRef;\n const option = this.ActiveDynamicOption;\n if (!ref || !option) {\n return;\n }\n this.setDynamicInput(ref, 'entity', this.EffectiveEntity);\n this.setDynamicInput(ref, 'provider', this.ProviderToUse);\n this.setDynamicInput(ref, 'Provider', this.Provider);\n this.setDynamicInput(ref, 'records', this.FilteredRecords);\n this.setDynamicInput(ref, 'selectedRecordId', this.SelectedRecordID);\n this.setDynamicInput(ref, 'filterText', this.DebouncedFilterText);\n this.setDynamicInput(ref, 'config', this.effectiveRendererConfig(option));\n this.setDynamicInput(ref, 'totalRecordCount', this.TotalRecordCount);\n this.setDynamicInput(ref, 'page', this.Pagination.currentPage + 1);\n this.setDynamicInput(ref, 'pageSize', this.Pagination.pageSize);\n this.setDynamicInput(ref, 'isLoading', this.IsLoading);\n }\n\n // ========================================\n // CANONICAL GRID-STATE BRIDGE\n // (keeps view types that render the view's columns reading/writing the one source of truth —\n // UserView.GridState — instead of a divergent per-view-type copy in DisplayState.viewTypeConfigs)\n // ========================================\n\n /**\n * The config object pushed to {@link option}'s renderer. For a view type that\n * {@link IViewTypeDescriptor.UsesCanonicalGridState}, its `gridState` is backed by the canonical\n * store ({@link GridState}) so the grid renders the same columns the config panel, the server\n * query, and export use — rather than the opaque per-view-type blob. All other view types get\n * their per-view-type config verbatim.\n */\n private effectiveRendererConfig(option: ViewModeOption): Record<string, unknown> {\n const base = this.viewTypeConfigById.get(option.viewTypeId) ?? {};\n if (!option.descriptor.UsesCanonicalGridState) {\n return base;\n }\n const gridState = this.resolveCanonicalGridState(base);\n return gridState ? { ...base, gridState } : base;\n }\n\n /**\n * Resolve the grid state a canonical view type should render, preferring the canonical store: the\n * explicit {@link GridState} input (hosts that own persistence, e.g. the view workspace, feed it),\n * else the loaded `UserView` record's GridState column (hosts that pass only `[viewEntity]`, e.g.\n * Explorer's view-resource). Falls back to any columns the per-view-type blob carried — a one-time\n * migration for views whose in-grid column edits landed in `DisplayState.viewTypeConfigs` before\n * this bridge existed; once such a view is re-saved, its columns persist to the canonical store.\n */\n private resolveCanonicalGridState(base: Record<string, unknown>): ViewGridState | null {\n const canonical = this._gridState ?? this.viewRecordGridState();\n if (canonical?.columnSettings?.length) {\n return canonical;\n }\n const fromBlob = base['gridState'] as ViewGridState | undefined;\n if (fromBlob?.columnSettings?.length) {\n return fromBlob;\n }\n // Neither has columns — return canonical (may still carry sort/aggregates) or nothing.\n return canonical ?? null;\n }\n\n /**\n * The canonical grid state off the loaded `UserView` record's GridState column, surfaced as a\n * {@link ViewGridState}. `GridStateObject` (`MJUserViewEntity_IGridState`) and `ViewGridState`\n * share the same persisted shape — the grid and config panel treat them interchangeably.\n */\n private viewRecordGridState(): ViewGridState | null {\n const obj = this._viewEntity?.GridStateObject;\n return obj ? (obj as ViewGridState) : null;\n }\n\n /**\n * Re-push the active renderer's config when the canonical {@link GridState} changes after mount\n * (e.g. the config panel saved new columns). No-op unless a renderer is mounted and the active\n * view type uses the canonical grid state — so non-grid view types and the pre-mount phase are\n * unaffected. Pushing a fresh `config` object reference triggers the renderer's input-change path.\n */\n private refreshCanonicalGridStateRenderer(): void {\n const ref = this.dynamicRendererRef;\n const option = this.ActiveDynamicOption;\n if (!ref || !option?.descriptor.UsesCanonicalGridState) {\n return;\n }\n this.setDynamicInput(ref, 'config', this.effectiveRendererConfig(option));\n ref.changeDetectorRef.detectChanges();\n }\n\n /**\n * Persist a canonical grid-state change to the loaded `UserView` record's GridState column — the\n * same canonical store the config panel writes to. Only the record target reaches here (the\n * per-user default-view case is handled by the existing user-settings persistence). Logs (does\n * not throw) on failure, mirroring {@link saveViewEntity}.\n */\n private async persistCanonicalGridState(gridState: ViewGridState | undefined): Promise<void> {\n const ve = this._viewEntity;\n if (!gridState || !ve?.ID) {\n return;\n }\n ve.GridStateObject = gridState;\n await this.saveViewEntity(ve);\n }\n\n /**\n * Guarded `setInput`: lean plug-ins implement only the core contract, so we only set an input the\n * mounted plug-in actually declares (per {@link dynamicInputNames}, captured at mount via\n * `reflectComponentType`). This avoids NG0303 dev errors for optional inputs the plug-in omits and\n * keeps the container plug-in-agnostic.\n */\n private setDynamicInput(ref: ComponentRef<IViewRenderer>, name: string, value: unknown): void {\n if (this.dynamicInputNames.has(name)) {\n ref.setInput(name, value);\n }\n }\n\n private onDynamicRecordSelected(record: unknown): void {\n const entity = this.EffectiveEntity;\n if (entity && record) {\n const row = record as Record<string, unknown>;\n this.RecordSelected.emit({ record: row, entity, compositeKey: buildCompositeKey(row, entity) });\n }\n }\n\n private onDynamicRecordOpened(record: unknown): void {\n const entity = this.EffectiveEntity;\n if (entity && record) {\n const row = record as Record<string, unknown>;\n this.RecordOpened.emit({ record: row, entity, compositeKey: buildCompositeKey(row, entity) });\n }\n }\n\n private onDynamicConfigChanged(viewTypeId: string, config: Record<string, unknown>): void {\n const before: ViewTypeConfigChangeEventArgs = { ViewTypeID: viewTypeId, Config: config, Cancel: false };\n this.BeforeViewTypeConfigChange.emit(before);\n if (before.Cancel) {\n return;\n }\n this.viewTypeConfigById.set(viewTypeId, config);\n\n // For a canonical-grid-state view type (e.g. the grid), the columns/sort the renderer just\n // changed belong in the canonical `UserView.GridState` store — the same place the config panel,\n // the server-side field list, and export read. Mirror it into the input so re-pushes/reads stay\n // fresh, and (for a saved view record) persist to the GridState column instead of the opaque\n // per-view-type blob. The per-user default-view case has no record, so it keeps the existing\n // user-settings persistence (which already captures the full config including gridState).\n const usesCanonicalGridState = this.AvailableViewTypes.find(o => o.viewTypeId === viewTypeId)\n ?.descriptor.UsesCanonicalGridState === true;\n if (usesCanonicalGridState) {\n const newGridState = config['gridState'] as ViewGridState | undefined;\n if (newGridState) {\n this._gridState = newGridState;\n }\n if (this.AutoSaveView && this.persistenceTarget() === 'record') {\n void this.persistCanonicalGridState(newGridState);\n this.AfterViewTypeConfigChange.emit({ ViewTypeID: viewTypeId, Config: config, Cancel: false });\n return;\n }\n }\n\n if (this.AutoSaveView) {\n void this.persistViewTypeConfig(viewTypeId);\n }\n this.AfterViewTypeConfigChange.emit({ ViewTypeID: viewTypeId, Config: config, Cancel: false });\n }\n\n /**\n * Honors a generic {@link ViewDataRequest} from the mounted plug-in. Fully view-type-agnostic —\n * the container applies whatever is present (sort / page / pageSize / loadAll) against its\n * existing generic data-loading path. No per-view-type branching.\n */\n private onDynamicDataRequest(req: ViewDataRequest): void {\n if (!req || this._records) {\n // Nothing to do when records are externally supplied (no internal RunView to retrigger).\n return;\n }\n\n // loadAll → switch the data loader into full-set mode (replaces the old map-specific branch).\n if (req.loadAll === true && !this._loadAllRecords) {\n this._loadAllRecords = true;\n this.resetPaginationState(false);\n this.LoadData();\n return;\n }\n if (req.loadAll === false && this._loadAllRecords) {\n this._loadAllRecords = false;\n this.resetPaginationState(false);\n this.LoadData();\n return;\n }\n\n // sort → set the host's internal sort state and reload via the server-side-sort path.\n if (req.sort) {\n const first = req.sort.length > 0 ? req.sort[0] : null;\n const newSort: SortState | null = first ? { field: first.field, direction: first.direction } : null;\n const oldSort = this.InternalSortState;\n this.InternalSortState = newSort;\n const sortChanged = !oldSort || !newSort ||\n oldSort.field !== newSort.field || oldSort.direction !== newSort.direction;\n if (this.EffectiveConfig.serverSideSorting && sortChanged) {\n this.resetPaginationState(false);\n this.LoadData();\n }\n return;\n }\n\n // page / pageSize → load that page via the existing pager path.\n if (req.pageSize != null && req.pageSize !== this.Pagination.pageSize) {\n this.Pagination.pageSize = req.pageSize;\n }\n if (req.page != null) {\n this.OnPageChange({ PageNumber: req.page, PageSize: req.pageSize ?? this.Pagination.pageSize } as PageChangeEvent);\n }\n }\n\n // ========================================\n // FILTERING\n // ========================================\n\n /**\n * Handle filter input change\n */\n OnFilterChange(value: string): void {\n this.InternalFilterText = value;\n this.filterInput$.next(value);\n }\n\n /**\n * Clear the filter\n */\n ClearFilter(): void {\n this.InternalFilterText = '';\n this.filterInput$.next('');\n this.cdr.detectChanges();\n }\n}\n","<div class=\"entity-viewer-container\" [style.height]=\"EffectiveConfig.height\">\n <!-- Header -->\n @if (EffectiveConfig.showFilter || EffectiveConfig.showViewModeToggle || EffectiveConfig.showRecordCount) {\n <div class=\"viewer-header\">\n <!-- Filter Input -->\n @if (EffectiveConfig.showFilter) {\n <div class=\"filter-container\">\n <i class=\"fa-solid fa-search filter-icon\"></i>\n <input\n type=\"text\"\n class=\"filter-input\"\n [placeholder]=\"EffectiveConfig.filterPlaceholder\"\n [value]=\"EffectiveFilterText\"\n (input)=\"OnFilterChange($any($event.target).value)\"\n />\n @if (EffectiveFilterText) {\n <button class=\"clear-filter-btn\" (click)=\"ClearFilter()\" title=\"Clear filter\">\n <i class=\"fa-solid fa-times\"></i>\n </button>\n }\n </div>\n }\n\n <!-- Record Count -->\n @if (EffectiveConfig.showRecordCount && EffectiveEntity) {\n <div class=\"record-count\">\n @if (FilteredRecordCount !== TotalRecordCount) {\n <span>{{ FilteredRecordCount | number }} of {{ TotalRecordCount | number }} records</span>\n } @else {\n <span>{{ TotalRecordCount | number }} records</span>\n }\n </div>\n }\n\n <!-- View Type Toggle — the reusable switcher, driven entirely by the MJ: View Types\n registry (ViewTypeEngine). The available types and their icons come from metadata\n (ViewType.Icon), filtered by each descriptor's availability predicate. Selecting routes\n back through SelectViewTypeById, which mounts the chosen descriptor's RendererComponent\n into #dynamicViewHost. The container has zero knowledge of any view type's chrome. -->\n @if (EffectiveConfig.showViewModeToggle) {\n <mj-view-type-switcher\n [Provider]=\"Provider\"\n [Entity]=\"EffectiveEntity\"\n [ActiveViewTypeID]=\"ActiveViewTypeId\"\n (ViewTypeSelected)=\"SelectViewTypeById($event.viewTypeId)\">\n </mj-view-type-switcher>\n }\n\n <!-- Recycle Bin chip (auto-hides when entity has no deleted records, no tracking,\n or user lacks Delete permission) -->\n @if (ShowRecycleBin) {\n <mj-recycle-bin-chip [EntityName]=\"EffectiveEntity?.Name ?? null\"></mj-recycle-bin-chip>\n }\n </div>\n }\n\n <!-- Content -->\n <div class=\"viewer-content\">\n <!-- Loading container - full page when no data exists -->\n <div class=\"loading-container\" [hidden]=\"!(IsLoading && FilteredRecords.length === 0)\">\n <mj-loading [text]=\"LoadingMessage\" size=\"medium\"></mj-loading>\n </div>\n\n <!-- Loading overlay - shown on top of content when loading with existing data -->\n <div class=\"loading-overlay\" [hidden]=\"!(IsLoading && FilteredRecords.length > 0)\">\n <mj-loading [text]=\"LoadingMessage\" size=\"small\"></mj-loading>\n </div>\n\n <!-- Empty state: no entity selected -->\n @if (!EffectiveEntity) {\n <mj-empty-state\n class=\"empty-state-fill\"\n Icon=\"fa-solid fa-database\"\n Title=\"Select an entity to view records\" />\n }\n\n <!-- Empty state: no records found. Suppressed while a plug-in is active — every plug-in renders\n its own empty/loading state, so the container never shows a generic \"no records\" over it. -->\n @if (EffectiveEntity && FilteredRecords.length === 0 && !IsLoading && !IsDynamicViewActive) {\n <mj-empty-state\n class=\"empty-state-fill\"\n [Variant]=\"IsNoRecordsFiltered ? 'no-results' : 'empty'\"\n [Title]=\"NoRecordsTitle\" />\n }\n\n <!-- Plug-in (dynamic) view renderer host — the ONLY render path. The active descriptor's\n RendererComponent is created into #dynamicViewHost via ViewContainerRef and fed the generic\n IViewRenderer contract. Shown whenever there's an entity; the plug-in owns all its chrome. -->\n <div class=\"dynamic-view-host\" [hidden]=\"!EffectiveEntity\">\n <ng-template #dynamicViewHost></ng-template>\n </div>\n </div>\n\n</div>\n"]}