@memberjunction/ng-entity-viewer 5.39.0 → 5.40.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/__tests__/view-types.test.d.ts +2 -0
- package/dist/__tests__/view-types.test.d.ts.map +1 -0
- package/dist/__tests__/view-types.test.js +102 -0
- package/dist/__tests__/view-types.test.js.map +1 -0
- package/dist/lib/entity-data-grid/entity-data-grid.component.d.ts.map +1 -1
- package/dist/lib/entity-data-grid/entity-data-grid.component.js +8 -0
- package/dist/lib/entity-data-grid/entity-data-grid.component.js.map +1 -1
- package/dist/lib/entity-viewer/entity-viewer.component.d.ts +356 -341
- package/dist/lib/entity-viewer/entity-viewer.component.d.ts.map +1 -1
- package/dist/lib/entity-viewer/entity-viewer.component.js +993 -1097
- package/dist/lib/entity-viewer/entity-viewer.component.js.map +1 -1
- package/dist/lib/view-config-panel/view-config-panel.component.d.ts +126 -126
- package/dist/lib/view-config-panel/view-config-panel.component.js +635 -635
- package/dist/lib/view-config-panel/view-config-panel.component.js.map +1 -1
- package/dist/lib/view-selector/view-selector.component.d.ts +226 -0
- package/dist/lib/view-selector/view-selector.component.d.ts.map +1 -0
- package/dist/lib/view-selector/view-selector.component.js +861 -0
- package/dist/lib/view-selector/view-selector.component.js.map +1 -0
- package/dist/lib/view-type-switcher/view-type-switcher.component.d.ts +114 -0
- package/dist/lib/view-type-switcher/view-type-switcher.component.d.ts.map +1 -0
- package/dist/lib/view-type-switcher/view-type-switcher.component.js +209 -0
- package/dist/lib/view-type-switcher/view-type-switcher.component.js.map +1 -0
- package/dist/lib/view-types/descriptors/cards-view-type.d.ts +18 -0
- package/dist/lib/view-types/descriptors/cards-view-type.d.ts.map +1 -0
- package/dist/lib/view-types/descriptors/cards-view-type.js +31 -0
- package/dist/lib/view-types/descriptors/cards-view-type.js.map +1 -0
- package/dist/lib/view-types/descriptors/grid-view-type.d.ts +17 -0
- package/dist/lib/view-types/descriptors/grid-view-type.d.ts.map +1 -0
- package/dist/lib/view-types/descriptors/grid-view-type.js +30 -0
- package/dist/lib/view-types/descriptors/grid-view-type.js.map +1 -0
- package/dist/lib/view-types/descriptors/map-view-type.d.ts +21 -0
- package/dist/lib/view-types/descriptors/map-view-type.d.ts.map +1 -0
- package/dist/lib/view-types/descriptors/map-view-type.js +35 -0
- package/dist/lib/view-types/descriptors/map-view-type.js.map +1 -0
- package/dist/lib/view-types/descriptors/timeline-view-type.d.ts +22 -0
- package/dist/lib/view-types/descriptors/timeline-view-type.d.ts.map +1 -0
- package/dist/lib/view-types/descriptors/timeline-view-type.js +40 -0
- package/dist/lib/view-types/descriptors/timeline-view-type.js.map +1 -0
- package/dist/lib/view-types/index.d.ts +20 -0
- package/dist/lib/view-types/index.d.ts.map +1 -0
- package/dist/lib/view-types/index.js +29 -0
- package/dist/lib/view-types/index.js.map +1 -0
- package/dist/lib/view-types/renderers/cards-view-renderer.component.d.ts +93 -0
- package/dist/lib/view-types/renderers/cards-view-renderer.component.d.ts.map +1 -0
- package/dist/lib/view-types/renderers/cards-view-renderer.component.js +144 -0
- package/dist/lib/view-types/renderers/cards-view-renderer.component.js.map +1 -0
- package/dist/lib/view-types/renderers/grid-view-renderer.component.d.ts +273 -0
- package/dist/lib/view-types/renderers/grid-view-renderer.component.d.ts.map +1 -0
- package/dist/lib/view-types/renderers/grid-view-renderer.component.js +558 -0
- package/dist/lib/view-types/renderers/grid-view-renderer.component.js.map +1 -0
- package/dist/lib/view-types/renderers/map-view-renderer.component.d.ts +135 -0
- package/dist/lib/view-types/renderers/map-view-renderer.component.d.ts.map +1 -0
- package/dist/lib/view-types/renderers/map-view-renderer.component.js +216 -0
- package/dist/lib/view-types/renderers/map-view-renderer.component.js.map +1 -0
- package/dist/lib/view-types/renderers/timeline-view-renderer.component.d.ts +176 -0
- package/dist/lib/view-types/renderers/timeline-view-renderer.component.d.ts.map +1 -0
- package/dist/lib/view-types/renderers/timeline-view-renderer.component.js +535 -0
- package/dist/lib/view-types/renderers/timeline-view-renderer.component.js.map +1 -0
- package/dist/lib/view-types/view-type.contracts.d.ts +235 -0
- package/dist/lib/view-types/view-type.contracts.d.ts.map +1 -0
- package/dist/lib/view-types/view-type.contracts.js +51 -0
- package/dist/lib/view-types/view-type.contracts.js.map +1 -0
- package/dist/lib/view-types/view-type.engine.d.ts +76 -0
- package/dist/lib/view-types/view-type.engine.d.ts.map +1 -0
- package/dist/lib/view-types/view-type.engine.js +138 -0
- package/dist/lib/view-types/view-type.engine.js.map +1 -0
- package/dist/lib/view-workspace/view-workspace.component.d.ts +451 -0
- package/dist/lib/view-workspace/view-workspace.component.d.ts.map +1 -0
- package/dist/lib/view-workspace/view-workspace.component.js +1212 -0
- package/dist/lib/view-workspace/view-workspace.component.js.map +1 -0
- package/dist/module.d.ts +20 -11
- package/dist/module.d.ts.map +1 -1
- package/dist/module.js +50 -8
- package/dist/module.js.map +1 -1
- package/dist/public-api.d.ts +8 -0
- package/dist/public-api.d.ts.map +1 -1
- package/dist/public-api.js +14 -0
- package/dist/public-api.js.map +1 -1
- package/package.json +16 -15
|
@@ -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,EAAwC,SAAS,EAAU,MAAM,eAAe,CAAC;AAChI,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,iBAAiB,EAAE,OAAO,EAA2B,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACtI,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEp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AK;;kBA+BL,KAAK;;kBAKL,KAAK;;kBAOL,KAAK;;kBAqBL,KAAK;;kBAML,KAAK;;kBA6BL,KAAK;;kBAML,KAAK;;kBAML,KAAK;;kBAOL,KAAK;;kBASL,KAAK;;kBASL,MAAM;;kBAKN,MAAM;;kBAKN,MAAM;;kBAKN,MAAM;;kBAKN,MAAM;;kBAKN,MAAM;;kBAKN,MAAM;;kBAKN,MAAM;;kBAKN,MAAM;;kBAKN,MAAM;;kBAMN,MAAM;;kBAKN,MAAM;;kBAKN,MAAM;;kBAMN,MAAM;;kBAUN,MAAM;;kBA2FN,SAAS;mBAAC,uBAAuB;;kBAu9BjC,KAAK;;kBAGL,KAAK;;kBAGL,MAAM;;kBAGN,MAAM;;kFAx7CI,qBAAqB","sourcesContent":["import { Component, Input, Output, EventEmitter, OnInit, OnDestroy, ChangeDetectorRef, ViewChild, NgZone } from '@angular/core';\nimport { BaseAngularComponent } from '@memberjunction/ng-base-types';\nimport { Subject } from 'rxjs';\nimport { debounceTime, distinctUntilChanged, takeUntil } from 'rxjs/operators';\nimport { EntityInfo, EntityFieldInfo, EntityFieldTSType, RunView, RunViewParams, Metadata, CompositeKey } from '@memberjunction/core';\nimport { UUIDsEqual } from '@memberjunction/global';\nimport { MJUserViewEntityExtended } from '@memberjunction/core-entities';\nimport { buildCompositeKey, buildPkString, computeFieldsList } from '../utils/record.util';\nimport { PageChangeEvent } from '@memberjunction/ng-pagination';\nimport { TimelineGroup, TimeSegmentGrouping, TimelineSortOrder, AfterEventClickArgs } from '@memberjunction/ng-timeline';\nimport { MapDisplayState, MapRenderMode } from '@memberjunction/ng-map-view';\nimport {\n EntityViewMode,\n EntityViewerConfig,\n DEFAULT_VIEWER_CONFIG,\n RecordSelectedEvent,\n RecordOpenedEvent,\n DataLoadedEvent,\n FilteredCountChangedEvent,\n CardTemplate,\n GridColumnDef,\n SortState,\n SortChangedEvent,\n PaginationState,\n ViewGridState,\n GridStateChangedEvent,\n TimelineSegmentGrouping,\n TimelineOrientation,\n TimelineState\n} from '../types';\nimport {\n AfterRowClickEventArgs,\n AfterRowDoubleClickEventArgs,\n AfterSortEventArgs\n} from '../entity-data-grid/events/grid-events';\nimport { GridToolbarConfig, GridSelectionMode, ForeignKeyClickEvent } from '../entity-data-grid/models/grid-types';\nimport { EntityDataGridComponent } from '../entity-data-grid/entity-data-grid.component';\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 * [(viewMode)]=\"state.viewMode\"\n * [filterText]=\"state.filterText\"\n * [selectedRecordId]=\"state.selectedRecordId\"\n * (recordSelected)=\"onRecordSelected($event)\"\n * (recordOpened)=\"onRecordOpened($event)\"\n * (sortChanged)=\"onSortChanged($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 {\n /**\n * Maximum records to load in map mode. Map view needs all records for\n * geographic visualization — paging doesn't make sense for maps. This cap\n * prevents unbounded queries on very large entities.\n */\n private static readonly MAP_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 _viewMode: EntityViewMode | null = null;\n private _filterText: string | null = null;\n private _sortState: SortState | null = null;\n private _viewEntity: MJUserViewEntityExtended | null = null;\n private _timelineConfig: TimelineState | null = null;\n private _initialized = 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 // Detect date fields for timeline support\n this.detectDateFields();\n\n // Detect geocoding support for map view\n this.updateGeoCodingSupport();\n\n if (this._initialized) {\n // If entity changed to a different entity, clear all stale state from the old entity\n if (value && previousEntity && !UUIDsEqual(value.ID, previousEntity.ID)) {\n if (this._viewEntity && !UUIDsEqual(this._viewEntity.EntityID, value.ID)) {\n this._viewEntity = null;\n }\n // Clear sort state — it references fields from the old entity (e.g., FirstName)\n // and would produce invalid ORDER BY on the new entity\n this.internalSortState = null;\n }\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 }\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 // Update timeline with new records\n this.updateTimelineGroups();\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() selectedRecordId: string | null = null;\n\n /**\n * External view mode - allows parent to control view mode\n * Supports two-way binding: [(viewMode)]=\"state.viewMode\"\n */\n @Input()\n get viewMode(): EntityViewMode | null {\n return this._viewMode;\n }\n set viewMode(value: EntityViewMode | null) {\n const previousEffective = this.effectiveViewMode;\n this._viewMode = value;\n if (value !== null) {\n this.internalViewMode = value;\n }\n // Map mode uses different RunView params (MaxRows = MAP_MAX_RECORDS, no pagination)\n // and different field set (includes BoundaryGeoJSON when entity.SupportsGeoCoding=1).\n // If the parent flips us into/out of map mode via two-way binding we need to reload —\n // otherwise the map gets the grid's paginated data without per-record geometry.\n const newEffective = this.effectiveViewMode;\n if (this._initialized && previousEffective !== newEffective &&\n (newEffective === 'map' || previousEffective === 'map')) {\n this.resetPaginationState();\n this.loadData();\n }\n }\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 * Custom grid column definitions\n */\n @Input() gridColumns: GridColumnDef[] = [];\n\n /**\n * Custom card template\n */\n @Input() cardTemplate: CardTemplate | null = null;\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 this._viewEntity = value;\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 * Timeline configuration state\n * Controls which date field is used and segment grouping\n */\n @Input()\n get timelineConfig(): TimelineState | null {\n return this._timelineConfig;\n }\n set timelineConfig(value: TimelineState | null) {\n const prev = this._timelineConfig;\n // Compare by value, not reference\n const isEqual = (prev === null && value === null) ||\n (prev !== null && value !== null &&\n prev.dateFieldName === value.dateFieldName &&\n prev.sortOrder === value.sortOrder &&\n prev.orientation === value.orientation &&\n prev.segmentGrouping === value.segmentGrouping);\n\n if (!isEqual) {\n this._timelineConfig = value;\n if (value && this._entity) {\n this.configureTimeline();\n this.cdr.markForCheck();\n }\n }\n }\n\n /**\n * Whether to show the grid toolbar.\n * When false, the grid is displayed without its own toolbar - useful when\n * entity-viewer provides its own filter/actions in the header.\n * @default false\n */\n @Input() showGridToolbar: boolean = false;\n\n /**\n * Grid toolbar configuration - controls which buttons are shown and their behavior\n * When not provided, uses sensible defaults\n */\n @Input() gridToolbarConfig: Partial<GridToolbarConfig> | null = null;\n\n /**\n * Grid selection mode\n * @default 'single'\n */\n @Input() gridSelectionMode: GridSelectionMode = 'single';\n\n /**\n * Show the \"Add to List\" button in the grid toolbar.\n * Requires gridSelectionMode to be 'multiple' for best UX.\n * @default false\n */\n @Input() showAddToListButton: boolean = false;\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 the view mode changes (for two-way binding)\n */\n @Output() viewModeChange = new EventEmitter<EntityViewMode>();\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 * Emitted when sort state changes\n */\n @Output() sortChanged = new EventEmitter<SortChangedEvent>();\n\n /**\n * Emitted when grid state changes (column resize, reorder, etc.)\n */\n @Output() gridStateChanged = new EventEmitter<GridStateChangedEvent>();\n\n /**\n * Emitted when timeline configuration changes (date field, grouping, etc.)\n */\n @Output() timelineConfigChange = new EventEmitter<TimelineState>();\n\n /**\n * Emitted when the Add/New button is clicked in the grid toolbar\n */\n @Output() addRequested = new EventEmitter<void>();\n\n /**\n * Emitted when the Delete button is clicked in the grid toolbar\n * Includes the selected records to be deleted\n */\n @Output() deleteRequested = new EventEmitter<{ records: Record<string, unknown>[] }>();\n\n /**\n * Emitted when the Refresh button is clicked in the grid toolbar\n */\n @Output() refreshRequested = new EventEmitter<void>();\n\n /**\n * Emitted when the Export button is clicked in the grid toolbar\n */\n @Output() exportRequested = new EventEmitter<{ format: 'excel' | 'csv' | 'json' }>();\n\n /**\n * Emitted when the Add to List button is clicked in the grid toolbar.\n * Parent components should handle this to show the list management dialog.\n */\n @Output() addToListRequested = new EventEmitter<{\n entityInfo: EntityInfo;\n records: Record<string, unknown>[];\n recordIds: string[];\n }>();\n\n /**\n * Emitted when grid selection changes.\n * Parent components can use this to track selected records for their own toolbar buttons.\n */\n @Output() selectionChanged = new EventEmitter<{\n records: Record<string, unknown>[];\n recordIds: string[];\n }>();\n\n // ========================================\n // INTERNAL STATE\n // ========================================\n\n public internalViewMode: EntityViewMode = 'grid';\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 /** Cached grid params to avoid recreating object on every change detection */\n private _cachedGridParams: RunViewParams | null = null;\n private _lastGridParamsEntity: string | null = null;\n private _lastGridParamsViewEntity: MJUserViewEntityExtended | 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 // ========================================\n // TIMELINE STATE\n // ========================================\n\n /** Whether the current entity has date fields available for timeline view */\n public hasDateFields: boolean = false;\n\n /** Whether the current entity supports geocoding (has SupportsGeoCoding = 1) */\n public HasGeoCoding: boolean = false;\n\n /** Available date fields from the entity (sorted by priority) */\n public availableDateFields: EntityFieldInfo[] = [];\n\n /** Timeline groups configuration for the timeline component */\n get timelineGroups(): TimelineGroup<Record<string, unknown>>[] {\n return this._timelineGroups;\n }\n set timelineGroups(value: TimelineGroup<Record<string, unknown>>[]) {\n const prev = this._timelineGroups;\n this._timelineGroups = value;\n\n // Detect meaningful changes to trigger refresh in child timeline component\n const hasChanged = prev !== value ||\n (prev.length > 0 && value.length > 0 &&\n (prev[0].EntityObjects !== value[0]?.EntityObjects ||\n prev[0].DateFieldName !== value[0]?.DateFieldName));\n\n if (hasChanged) {\n // Force change detection to propagate to child timeline component\n this.cdr.markForCheck();\n }\n }\n private _timelineGroups: TimelineGroup<Record<string, unknown>>[] = [];\n\n /** Timeline sort order */\n public timelineSortOrder: TimelineSortOrder = 'desc';\n\n /** Timeline segment grouping */\n public timelineSegmentGrouping: TimeSegmentGrouping = 'month';\n\n /** Timeline orientation (vertical or horizontal) */\n public timelineOrientation: TimelineOrientation = 'vertical';\n\n /** Currently selected date field for timeline */\n public selectedTimelineDateField: string | null = null;\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 /** Reference to the data grid component for flushing pending changes */\n @ViewChild(EntityDataGridComponent) private dataGridRef: EntityDataGridComponent | undefined;\n\n constructor(private cdr: ChangeDetectorRef, private ngZone: NgZone) {\n super();}\n\n // ========================================\n // PUBLIC METHODS\n // ========================================\n\n /**\n * Ensures any pending grid state changes are saved immediately without waiting for debounce.\n * Call this before switching views or entities to ensure changes are saved.\n */\n public EnsurePendingChangesSaved(): void {\n this.dataGridRef?.EnsurePendingChangesSaved();\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 view mode (external or internal)\n */\n get effectiveViewMode(): EntityViewMode {\n return this.viewMode ?? this.internalViewMode;\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 raw ID value from selectedRecordId for timeline selection.\n * The selectedRecordId is in composite key format (e.g., \"ID|abc-123\" or \"ID=abc-123\"),\n * but the timeline stores just the raw ID value.\n */\n get timelineSelectedEventId(): string | null {\n if (!this.selectedRecordId) return null;\n\n // Handle \"ID|value\" format (pipe separator)\n if (this.selectedRecordId.includes('|')) {\n const parts = this.selectedRecordId.split('|');\n return parts.length > 1 ? parts[1] : this.selectedRecordId;\n }\n\n // Handle \"ID=value\" format (equals separator)\n if (this.selectedRecordId.includes('=')) {\n const parts = this.selectedRecordId.split('=');\n return parts.length > 1 ? parts[1] : this.selectedRecordId;\n }\n\n // Return as-is if no separator found\n return this.selectedRecordId;\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 the OrderBy string for mj-entity-data-grid from the effective sort state\n */\n get effectiveSortOrderBy(): string {\n const sortState = this.effectiveSortState;\n if (!sortState?.field || !sortState.direction) {\n return '';\n }\n return `${sortState.field} ${sortState.direction.toUpperCase()}`;\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 cached grid params - only recreates object when entity or viewEntity changes\n * This prevents Angular from seeing a new object reference on every change detection\n * which would cause the grid to reinitialize\n */\n get gridParams(): RunViewParams | null {\n const entity = this.effectiveEntity;\n if (!entity) {\n return null;\n }\n\n // Check if we need to recreate the params object\n const entityChanged = this._lastGridParamsEntity !== entity.Name;\n const viewEntityChanged = this._lastGridParamsViewEntity !== this.viewEntity;\n\n if (entityChanged || viewEntityChanged || !this._cachedGridParams) {\n this._lastGridParamsEntity = entity.Name;\n this._lastGridParamsViewEntity = this.viewEntity ?? null;\n this._cachedGridParams = {\n EntityName: entity.Name,\n ViewEntity: this.viewEntity || undefined\n };\n }\n\n return this._cachedGridParams;\n }\n\n /**\n * Get the effective grid toolbar configuration\n * Merges user-provided config with defaults appropriate for entity-viewer context\n */\n get effectiveGridToolbarConfig(): GridToolbarConfig {\n const defaults: GridToolbarConfig = {\n showSearch: false, // Entity-viewer has its own filter\n showRefresh: true,\n showAdd: true,\n showDelete: true,\n showExport: true,\n showColumnChooser: true,\n showRowCount: true,\n showSelectionCount: true\n };\n return { ...defaults, ...this.gridToolbarConfig };\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 // 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 ngOnDestroy(): void {\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 if (this.viewMode === null) {\n this.internalViewMode = config.defaultViewMode;\n }\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.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 // Map mode loads all records (up to MAP_MAX_RECORDS) since paging\n // doesn't make sense for geographic visualization. Other modes use\n // standard page-based pagination.\n const isMapMode = this.effectiveViewMode === 'map';\n const maxRows = isMapMode ? EntityViewerComponent.MAP_MAX_RECORDS : config.pageSize;\n const startRow = isMapMode ? 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 Fields: computeFieldsList(entity, this.gridState),\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 // Re-check geo support after data loads (effectiveEntity may have resolved via viewEntity)\n this.updateGeoCodingSupport();\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\n // Update timeline groups with new data\n this.updateTimelineGroups();\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.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 * Set the view mode and emit change event\n */\n setViewMode(mode: EntityViewMode): void {\n const previousMode = this.effectiveViewMode;\n if (previousMode !== mode) {\n this.internalViewMode = mode;\n this.viewModeChange.emit(mode);\n\n // Reload data when switching to/from map mode because map loads all\n // records (up to MAP_MAX_RECORDS) while other modes use page-based pagination.\n const switchingToMap = mode === 'map' && previousMode !== 'map';\n const switchingFromMap = mode !== 'map' && previousMode === 'map';\n if (switchingToMap || switchingFromMap) {\n this.resetPaginationState();\n this.loadData();\n } else {\n this.cdr.detectChanges();\n }\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 // ========================================\n // SORTING\n // ========================================\n\n /**\n * Handle sort change from grid component\n */\n onSortChanged(event: SortChangedEvent): void {\n const oldSort = this.internalSortState;\n this.internalSortState = event.sort;\n this.sortChanged.emit(event);\n\n // If server-side sorting, reload from page 1\n // Keep existing records visible during refresh for better UX\n if (this.effectiveConfig.serverSideSorting && !this.records) {\n const sortChanged = !oldSort || !event.sort ||\n oldSort.field !== event.sort?.field ||\n oldSort.direction !== event.sort?.direction;\n\n if (sortChanged) {\n this.resetPaginationState(false);\n this.loadData();\n }\n }\n }\n\n // ========================================\n // EVENT HANDLERS\n // ========================================\n\n /**\n * Handle record selection from child components (grid or cards)\n */\n onRecordSelected(event: RecordSelectedEvent): void {\n this.recordSelected.emit(event);\n }\n\n /**\n * Handle record opened from child components (grid or cards)\n */\n onRecordOpened(event: RecordOpenedEvent): void {\n this.recordOpened.emit(event);\n }\n\n /**\n * Handle grid state changes (column resize, reorder, etc.)\n */\n onGridStateChanged(event: GridStateChangedEvent): void {\n this.gridStateChanged.emit(event);\n }\n\n /**\n * Handle page change from the data grid's pager\n */\n onGridPageChange(event: PageChangeEvent): void {\n this.onPageChange(event);\n }\n\n // ========================================\n // DATA GRID EVENT HANDLERS\n // ========================================\n\n /**\n * Handle row click from mj-entity-data-grid\n * Maps to recordSelected event for parent components\n */\n onDataGridRowClick(event: AfterRowClickEventArgs): void {\n const entity = this.effectiveEntity;\n if (!entity || !event.row) return;\n\n this.recordSelected.emit({\n record: event.row,\n entity: entity,\n compositeKey: buildCompositeKey(event.row, entity)\n });\n }\n\n /**\n * Handle row double-click from mj-entity-data-grid\n * Maps to recordOpened event for parent components\n */\n onDataGridRowDoubleClick(event: AfterRowDoubleClickEventArgs): void {\n const entity = this.effectiveEntity;\n if (!entity || !event.row) return;\n\n this.recordOpened.emit({\n record: event.row,\n entity: entity,\n compositeKey: buildCompositeKey(event.row, entity)\n });\n }\n\n /**\n * Handle sort changed from mj-entity-data-grid\n * Maps to sortChanged event for parent components\n */\n onDataGridSortChanged(event: AfterSortEventArgs): void {\n // Convert the data grid's sort state to our SortState format\n const newSort: SortState | null = event.newSortState && event.newSortState.length > 0\n ? {\n field: event.newSortState[0].field,\n direction: event.newSortState[0].direction\n }\n : null;\n\n this.internalSortState = newSort;\n this.sortChanged.emit({ sort: newSort });\n\n // If server-side sorting, reload from page 1.\n // Use deferReload() so that if a view-switch reload is already in-flight\n // (e.g., AG Grid fired an async sortChanged from applySortStateToGrid),\n // we don't trigger a redundant second RunView.\n // For normal user-initiated column-header clicks, no deferred reload is\n // pending so deferReload() fires immediately — no UX difference.\n if (this.effectiveConfig.serverSideSorting && !this.records) {\n this.resetPaginationState(false);\n this.deferReload();\n }\n }\n\n /**\n * Handle foreign key link click from mj-entity-data-grid\n * Bubbles the event up for parent components to handle navigation\n */\n /**\n * Handle foreign key link click from mj-entity-data-grid\n * Converts to recordOpened event for seamless navigation integration\n */\n onForeignKeyClick(event: ForeignKeyClickEvent): void {\n // Look up the related entity by name\n const md = this.ProviderToUse;\n const relatedEntity = event.relatedEntityName\n ? md.Entities.find(e => e.Name === event.relatedEntityName)\n : md.Entities.find(e => UUIDsEqual(e.ID, event.relatedEntityId));\n\n if (!relatedEntity) {\n return;\n }\n\n // Create composite key using the target entity's actual primary key field name\n const pkFieldName = relatedEntity.FirstPrimaryKey?.Name || 'ID';\n const compositeKey = new CompositeKey([{ FieldName: pkFieldName, Value: event.recordId }]);\n\n // Emit recordOpened for the related entity (record is undefined since it's not loaded)\n this.recordOpened.emit({\n entity: relatedEntity,\n compositeKey\n });\n }\n\n /**\n * Handle Add/New button click from data grid toolbar\n */\n onGridAddRequested(): void {\n this.addRequested.emit();\n }\n\n /**\n * Handle Refresh button click from data grid toolbar\n */\n onGridRefreshRequested(): void {\n this.refreshRequested.emit();\n // Also trigger an internal refresh\n this.refresh();\n }\n\n /**\n * Handle Delete button click from data grid toolbar\n */\n onGridDeleteRequested(records: Record<string, unknown>[]): void {\n this.deleteRequested.emit({ records });\n }\n\n /**\n * Handle Export button click from data grid toolbar\n */\n onGridExportRequested(): void {\n this.exportRequested.emit({ format: 'excel' });\n }\n\n /**\n * Handle Add to List button click from data grid toolbar.\n * Forwards the event to parent components for list management.\n */\n onGridAddToListRequested(event: { entityInfo: EntityInfo; records: Record<string, unknown>[]; recordIds: string[] }): void {\n this.addToListRequested.emit(event);\n }\n\n /**\n * Handle selection change from data grid.\n * Converts selected keys to records and forwards to parent components.\n */\n onGridSelectionChange(selectedKeys: string[]): void {\n const entity = this.effectiveEntity;\n if (!entity) return;\n\n // Find the actual records from our filtered records\n const records = this.filteredRecords.filter(record => {\n const key = buildPkString(record, entity);\n return selectedKeys.includes(key);\n });\n\n // Get the raw primary key values for list management\n const recordIds = records.map(record =>\n String(record[entity.PrimaryKeys[0].Name])\n );\n\n this.selectionChanged.emit({ records, recordIds });\n }\n\n // ========================================\n // TIMELINE METHODS\n // ========================================\n\n /**\n * Handle timeline event click - emit as record selection\n */\n onTimelineEventClick(event: AfterEventClickArgs): void {\n const record = event.event.entity as Record<string, unknown>;\n const entity = this.effectiveEntity;\n if (record && entity) {\n this.recordSelected.emit({\n record,\n entity: entity,\n compositeKey: buildCompositeKey(record, entity)\n });\n }\n }\n\n /**\n * Update HasGeoCoding based on the current effectiveEntity.\n * Called from entity setter and after data loads (when effectiveEntity may resolve via viewEntity).\n */\n private updateGeoCodingSupport(): void {\n const entity = this.effectiveEntity;\n const newValue = !!(entity && entity.SupportsGeoCoding);\n if (newValue !== this.HasGeoCoding) {\n this.HasGeoCoding = newValue;\n this.fallbackFromMapIfNeeded();\n this.cdr.detectChanges();\n }\n }\n\n /**\n * Handle map marker click — emit the record for the parent to handle (open record, etc.)\n */\n onMapMarkerClick(event: { RecordID: string; Latitude: number; Longitude: number; Record: Record<string, unknown> }): void {\n const entity = this.effectiveEntity;\n if (event.Record && entity) {\n const compositeKey = buildCompositeKey(event.Record, entity);\n // Emit both recordSelected (for detail panels) and recordOpened (for navigation)\n this.recordSelected.emit({\n record: event.Record,\n entity: entity,\n compositeKey\n });\n this.recordOpened.emit({\n record: event.Record,\n entity: entity,\n compositeKey\n });\n }\n }\n\n /** Map display state (zoom, center) — passed from parent for persistence across reloads. */\n @Input() mapDisplayState: Partial<MapDisplayState> | null = null;\n\n /** Map render mode — separate from DisplayState for clear single-source-of-truth. */\n @Input() mapRenderMode: MapRenderMode = 'point';\n\n /** Emitted when the map's display state changes (zoom, center). */\n @Output() mapDisplayStateChange = new EventEmitter<MapDisplayState>();\n\n /** Emitted when the map's render mode changes (user clicks mode buttons). */\n @Output() mapRenderModeChange = new EventEmitter<MapRenderMode>();\n\n /**\n * Handle map display state changes — bubble up to parent for persistence.\n */\n onMapDisplayStateChange(state: MapDisplayState): void {\n this.mapDisplayStateChange.emit(state);\n }\n\n onMapRenderModeChange(mode: MapRenderMode): void {\n this.mapRenderModeChange.emit(mode);\n }\n\n /**\n * Toggle timeline orientation between vertical and horizontal\n */\n toggleTimelineOrientation(): void {\n this.timelineOrientation = this.timelineOrientation === 'vertical' ? 'horizontal' : 'vertical';\n\n // Emit config change so parent can persist the preference\n this.emitTimelineConfigChange();\n this.cdr.detectChanges();\n }\n\n /**\n * Toggle timeline sort order between newest first (desc) and oldest first (asc)\n */\n toggleTimelineSortOrder(): void {\n this.timelineSortOrder = this.timelineSortOrder === 'desc' ? 'asc' : 'desc';\n\n // Emit config change so parent can persist the preference\n this.emitTimelineConfigChange();\n this.cdr.detectChanges();\n }\n\n /**\n * Change the date field used for the timeline\n */\n setTimelineDateField(fieldName: string): void {\n if (this.availableDateFields.some(f => f.Name === fieldName)) {\n this.selectedTimelineDateField = fieldName;\n this.updateTimelineGroups();\n this.emitTimelineConfigChange();\n this.cdr.detectChanges();\n }\n }\n\n /**\n * Get the display name of the currently selected timeline date field\n */\n get selectedDateFieldDisplayName(): string {\n if (!this.selectedTimelineDateField) return '';\n const field = this.availableDateFields.find(f => f.Name === this.selectedTimelineDateField);\n return field?.DisplayNameOrName || this.selectedTimelineDateField;\n }\n\n /**\n * Emit the current timeline configuration for persistence\n */\n private emitTimelineConfigChange(): void {\n if (this.selectedTimelineDateField) {\n this.timelineConfigChange.emit({\n dateFieldName: this.selectedTimelineDateField,\n sortOrder: this.timelineSortOrder,\n segmentGrouping: this.timelineSegmentGrouping as TimelineSegmentGrouping,\n orientation: this.timelineOrientation\n });\n }\n }\n\n /**\n * Detect and configure timeline based on entity's date fields\n * Called when entity changes\n */\n private detectDateFields(): void {\n if (!this.entity) {\n this.hasDateFields = false;\n this.availableDateFields = [];\n this.timelineGroups = [];\n this.fallbackFromTimelineIfNeeded();\n return;\n }\n\n // Find all date fields - include __mj_CreatedAt and __mj_UpdatedAt as they're useful for timelines\n const dateFields = this.entity.Fields.filter(\n f => f.TSType === EntityFieldTSType.Date\n );\n\n if (dateFields.length === 0) {\n this.hasDateFields = false;\n this.availableDateFields = [];\n this.timelineGroups = [];\n this.fallbackFromTimelineIfNeeded();\n return;\n }\n\n // Sort by priority: DefaultInView date fields first (by Sequence), then others (by Sequence)\n this.availableDateFields = this.sortDateFieldsByPriority(dateFields);\n this.hasDateFields = true;\n\n // Configure timeline with the best date field\n this.configureTimeline();\n }\n\n /**\n * If currently on timeline view but timeline is no longer available,\n * fall back to grid view\n */\n private fallbackFromTimelineIfNeeded(): void {\n if (this.effectiveViewMode === 'timeline' && !this.hasDateFields) {\n this.setViewMode('grid');\n }\n }\n\n /**\n * If currently on map view but geocoding is no longer available,\n * fall back to grid view\n */\n private fallbackFromMapIfNeeded(): void {\n if (this.effectiveViewMode === 'map' && !this.HasGeoCoding) {\n this.setViewMode('grid');\n }\n }\n\n /**\n * Sort date fields by priority:\n * 1. DefaultInView=true fields, sorted by Sequence (lowest first)\n * 2. Other date fields, sorted by Sequence (lowest first)\n */\n private sortDateFieldsByPriority(dateFields: EntityFieldInfo[]): EntityFieldInfo[] {\n const defaultInView = dateFields.filter(f => f.DefaultInView).sort((a, b) => a.Sequence - b.Sequence);\n const others = dateFields.filter(f => !f.DefaultInView).sort((a, b) => a.Sequence - b.Sequence);\n return [...defaultInView, ...others];\n }\n\n /**\n * Configure the timeline with the current date field and records\n */\n private configureTimeline(): void {\n if (!this.entity || !this.hasDateFields || this.availableDateFields.length === 0) {\n this.timelineGroups = [];\n return;\n }\n\n // Determine which date field to use\n const dateFieldName = this.getEffectiveTimelineDateField();\n this.selectedTimelineDateField = dateFieldName;\n\n // Apply timeline config if provided\n if (this.timelineConfig) {\n this.timelineSortOrder = (this.timelineConfig.sortOrder || 'desc') as TimelineSortOrder;\n this.timelineSegmentGrouping = (this.timelineConfig.segmentGrouping || 'month') as TimeSegmentGrouping;\n this.timelineOrientation = this.timelineConfig.orientation || 'vertical';\n }\n\n // Create a timeline group for the current entity's data\n this.updateTimelineGroups();\n }\n\n /**\n * Get the effective date field to use for timeline\n * Priority: timelineConfig > first available date field\n */\n private getEffectiveTimelineDateField(): string {\n // If we have a config with a specific date field, use it if valid\n if (this.timelineConfig?.dateFieldName) {\n const configField = this.availableDateFields.find(f => f.Name === this.timelineConfig!.dateFieldName);\n if (configField) {\n return configField.Name;\n }\n }\n\n // Otherwise use the first available date field (already sorted by priority)\n return this.availableDateFields[0].Name;\n }\n\n /**\n * Update timeline groups with current records\n * Called when records change\n */\n private updateTimelineGroups(): void {\n if (!this.entity || !this.selectedTimelineDateField) {\n this.timelineGroups = [];\n return;\n }\n\n // Find title field - prefer NameField, then first string field with DefaultInView\n const titleField = this.findTitleField();\n\n // Create a single group for the current data\n const group = new TimelineGroup<Record<string, unknown>>();\n group.DataSourceType = 'array';\n group.EntityObjects = this.filteredRecords;\n group.TitleFieldName = titleField;\n group.DateFieldName = this.selectedTimelineDateField;\n group.IdFieldName = 'ID';\n group.GroupLabel = this.entity.Name;\n\n // Find a suitable description field\n const descField = this.findDescriptionField();\n if (descField) {\n group.DescriptionFieldName = descField;\n }\n\n // Find a suitable subtitle field\n const subtitleField = this.findSubtitleField(titleField);\n if (subtitleField) {\n group.SubtitleFieldName = subtitleField;\n }\n\n // Configure card display\n group.CardConfig = {\n collapsible: true,\n defaultExpanded: false,\n showDate: true,\n dateFormat: 'MMM d, yyyy h:mm a'\n };\n\n this.timelineGroups = [group];\n }\n\n /**\n * Find the best field to use as the title\n */\n private findTitleField(): string {\n if (!this.entity) return 'ID';\n\n // Prefer the entity's NameField\n if (this.entity.NameField) {\n return this.entity.NameField.Name;\n }\n\n // Look for common name patterns in DefaultInView string fields\n const stringFields = this.entity.Fields.filter(\n f => f.TSType === EntityFieldTSType.String && f.DefaultInView && !f.Name.startsWith('__mj_')\n ).sort((a, b) => a.Sequence - b.Sequence);\n\n const namePatterns = ['name', 'title', 'subject', 'label'];\n for (const pattern of namePatterns) {\n const match = stringFields.find(f => f.Name.toLowerCase().includes(pattern));\n if (match) return match.Name;\n }\n\n // Fall back to first string field\n return stringFields.length > 0 ? stringFields[0].Name : 'ID';\n }\n\n /**\n * Find a suitable description field\n */\n private findDescriptionField(): string | null {\n if (!this.entity) return null;\n\n // Look for common description patterns\n const descPatterns = ['description', 'notes', 'summary', 'content', 'body', 'details'];\n const textFields = this.entity.Fields.filter(\n f => (f.TSType === EntityFieldTSType.String) && !f.Name.startsWith('__mj_')\n );\n\n for (const pattern of descPatterns) {\n const match = textFields.find(f => f.Name.toLowerCase().includes(pattern));\n if (match) return match.Name;\n }\n\n return null;\n }\n\n /**\n * Find a suitable subtitle field (different from title)\n */\n private findSubtitleField(excludeField: string): string | null {\n if (!this.entity) return null;\n\n // Look for status, type, category, or other short classification fields\n const patterns = ['status', 'type', 'category', 'state', 'priority'];\n const fields = this.entity.Fields.filter(\n f => f.TSType === EntityFieldTSType.String &&\n f.DefaultInView &&\n f.Name !== excludeField &&\n !f.Name.startsWith('__mj_')\n ).sort((a, b) => a.Sequence - b.Sequence);\n\n for (const pattern of patterns) {\n const match = fields.find(f => f.Name.toLowerCase().includes(pattern));\n if (match) return match.Name;\n }\n\n // Use the first string field that's not the title field\n const firstOther = fields.find(f => f.Name !== excludeField);\n return firstOther?.Name || null;\n }\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 Mode Toggle -->\n @if (effectiveConfig.showViewModeToggle) {\n <div class=\"view-mode-toggle\">\n <button\n class=\"toggle-btn\"\n [class.active]=\"effectiveViewMode === 'grid'\"\n (click)=\"setViewMode('grid')\"\n title=\"Grid View\">\n <i class=\"fa-solid fa-list\"></i>\n </button>\n <button\n class=\"toggle-btn\"\n [class.active]=\"effectiveViewMode === 'cards'\"\n (click)=\"setViewMode('cards')\"\n title=\"Cards View\">\n <i class=\"fa-solid fa-grip\"></i>\n </button>\n @if (hasDateFields) {\n <button\n class=\"toggle-btn\"\n [class.active]=\"effectiveViewMode === 'timeline'\"\n (click)=\"setViewMode('timeline')\"\n title=\"Timeline View\">\n <i class=\"fa-solid fa-timeline\"></i>\n </button>\n }\n <button\n class=\"toggle-btn\"\n [class.active]=\"effectiveViewMode === 'map'\"\n [class.geo-hidden]=\"!HasGeoCoding\"\n (click)=\"setViewMode('map')\"\n title=\"Map View\">\n <i class=\"fa-solid fa-map-location-dot\"></i>\n </button>\n </div>\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\n <!-- Timeline Controls (only shown when timeline is active) -->\n @if (effectiveViewMode === 'timeline' && hasDateFields) {\n <!-- Date Field Selector -->\n <div class=\"timeline-date-selector\">\n <i class=\"fa-solid fa-calendar-days\"></i>\n @if (availableDateFields.length === 1) {\n <span class=\"date-field-label\">{{ selectedDateFieldDisplayName }}</span>\n } @else {\n <select\n class=\"date-field-select\"\n [value]=\"selectedTimelineDateField\"\n (change)=\"setTimelineDateField($any($event.target).value)\">\n @for (field of availableDateFields; track field.Name) {\n <option [value]=\"field.Name\">{{ field.DisplayNameOrName }}</option>\n }\n </select>\n }\n </div>\n\n <!-- Orientation Toggle -->\n <div class=\"timeline-orientation-toggle\">\n <button\n class=\"toggle-btn\"\n (click)=\"toggleTimelineOrientation()\"\n [title]=\"timelineOrientation === 'vertical' ? 'Switch to Horizontal' : 'Switch to Vertical'\">\n <i [class]=\"timelineOrientation === 'vertical' ? 'fa-solid fa-ellipsis-vertical' : 'fa-solid fa-ellipsis'\"></i>\n </button>\n </div>\n\n <!-- Sort Order Toggle -->\n <div class=\"timeline-sort-toggle\">\n <button\n class=\"toggle-btn\"\n (click)=\"toggleTimelineSortOrder()\"\n [title]=\"timelineSortOrder === 'desc' ? 'Showing Newest First (click for Oldest First)' : 'Showing Oldest First (click for Newest First)'\">\n <i [class]=\"timelineSortOrder === 'desc' ? 'fa-solid fa-arrow-down-wide-short' : 'fa-solid fa-arrow-up-wide-short'\"></i>\n </button>\n </div>\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 -->\n <div class=\"empty-state\" [hidden]=\"!effectiveEntity || filteredRecords.length > 0 || isLoading\">\n <i class=\"fa-solid fa-inbox\"></i>\n <p>{{ debouncedFilterText ? 'No matching records' : 'No records found' }}</p>\n </div>\n\n <!-- Grid View - always rendered, visibility controlled by hidden -->\n <mj-entity-data-grid\n [hidden]=\"effectiveViewMode !== 'grid' || !effectiveEntity\"\n [Data]=\"filteredRecords\"\n [Params]=\"gridParams\"\n [FilterText]=\"debouncedFilterText\"\n [GridState]=\"gridState\"\n [Height]=\"'auto'\"\n [ShowToolbar]=\"showGridToolbar\"\n [ToolbarConfig]=\"effectiveGridToolbarConfig\"\n [SelectionMode]=\"gridSelectionMode\"\n [ShowAddToListButton]=\"showAddToListButton\"\n [AllowLoad]=\"false\"\n [ShowPager]=\"effectiveConfig.showPagination\"\n [PageSize]=\"effectiveConfig.pageSize\"\n [TotalRowCount]=\"pagination.totalRecords\"\n [PagerPageNumber]=\"pagination.currentPage + 1\"\n (AfterRowClick)=\"onDataGridRowClick($event)\"\n (AfterRowDoubleClick)=\"onDataGridRowDoubleClick($event)\"\n (AfterSort)=\"onDataGridSortChanged($event)\"\n (GridStateChanged)=\"onGridStateChanged($event)\"\n (SelectionChange)=\"onGridSelectionChange($event)\"\n (NewButtonClick)=\"onGridAddRequested()\"\n (RefreshButtonClick)=\"onGridRefreshRequested()\"\n (DeleteButtonClick)=\"onGridDeleteRequested($event)\"\n (ExportButtonClick)=\"onGridExportRequested()\"\n (AddToListRequested)=\"onGridAddToListRequested($event)\"\n (ForeignKeyClick)=\"onForeignKeyClick($event)\"\n (PageChange)=\"onGridPageChange($event)\">\n </mj-entity-data-grid>\n\n <!-- Cards View - always rendered, visibility controlled by hidden -->\n <mj-entity-cards\n [hidden]=\"effectiveViewMode !== 'cards' || !effectiveEntity\"\n [entity]=\"effectiveEntity\"\n [records]=\"filteredRecords\"\n [selectedRecordId]=\"selectedRecordId\"\n [cardTemplate]=\"cardTemplate\"\n [hiddenFieldMatches]=\"hiddenFieldMatches\"\n [filterText]=\"debouncedFilterText\"\n (recordSelected)=\"onRecordSelected($event)\"\n (recordOpened)=\"onRecordOpened($event)\">\n </mj-entity-cards>\n\n <!-- Timeline View - always rendered when date fields exist, visibility controlled by hidden -->\n <mj-timeline\n [hidden]=\"effectiveViewMode !== 'timeline' || !hasDateFields\"\n [groups]=\"timelineGroups\"\n [orientation]=\"timelineOrientation\"\n [layout]=\"timelineOrientation === 'vertical' ? 'alternating' : 'single'\"\n [sortOrder]=\"timelineSortOrder\"\n [segmentGrouping]=\"timelineSegmentGrouping\"\n [segmentsCollapsible]=\"true\"\n [segmentsDefaultExpanded]=\"true\"\n [selectedEventId]=\"timelineSelectedEventId\"\n (afterEventClick)=\"onTimelineEventClick($event)\">\n </mj-timeline>\n\n <!-- Map View - rendered when geocoding supported, visibility controlled by hidden -->\n @if (HasGeoCoding) {\n <mj-map-view\n [hidden]=\"effectiveViewMode !== 'map'\"\n [Entity]=\"effectiveEntity!\"\n [Records]=\"filteredRecords\"\n [TotalRecordCount]=\"totalRecordCount\"\n [RenderMode]=\"mapRenderMode\"\n [DisplayState]=\"mapDisplayState\"\n (MarkerClick)=\"onMapMarkerClick($event)\"\n (RenderModeChange)=\"onMapRenderModeChange($event)\"\n (DisplayStateChange)=\"onMapDisplayStateChange($event)\">\n </mj-map-view>\n }\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,EAQtB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAsC,cAAc,EAAgD,MAAM,eAAe,CAAC;;;;;;;;;ICJrH,kCAA8E;IA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;;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"]}
|