@memberjunction/ng-base-forms 6.2.0-edge.5 → 6.2.0-edge.7
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/README.md +195 -2
- package/dist/lib/apply/form-placement-preview.component.d.ts.map +1 -1
- package/dist/lib/apply/form-placement-preview.component.js +1 -0
- package/dist/lib/apply/form-placement-preview.component.js.map +1 -1
- package/dist/lib/base-form-component.d.ts +23 -1
- package/dist/lib/base-form-component.d.ts.map +1 -1
- package/dist/lib/base-form-component.js +54 -10
- package/dist/lib/base-form-component.js.map +1 -1
- package/dist/lib/chrome/form-composition-snapshot.d.ts +52 -0
- package/dist/lib/chrome/form-composition-snapshot.d.ts.map +1 -1
- package/dist/lib/chrome/form-composition-snapshot.js +4 -0
- package/dist/lib/chrome/form-composition-snapshot.js.map +1 -1
- package/dist/lib/container/record-form-container.component.d.ts +107 -1
- package/dist/lib/container/record-form-container.component.d.ts.map +1 -1
- package/dist/lib/container/record-form-container.component.js +1495 -316
- package/dist/lib/container/record-form-container.component.js.map +1 -1
- package/dist/lib/field/form-field.component.d.ts +159 -14
- package/dist/lib/field/form-field.component.d.ts.map +1 -1
- package/dist/lib/field/form-field.component.js +1360 -469
- package/dist/lib/field/form-field.component.js.map +1 -1
- package/dist/lib/form-record-refresh.coordinator.d.ts +124 -0
- package/dist/lib/form-record-refresh.coordinator.d.ts.map +1 -1
- package/dist/lib/form-record-refresh.coordinator.js +93 -13
- package/dist/lib/form-record-refresh.coordinator.js.map +1 -1
- package/dist/lib/host/entity-form-host.component.d.ts +104 -2
- package/dist/lib/host/entity-form-host.component.d.ts.map +1 -1
- package/dist/lib/host/entity-form-host.component.js +272 -34
- package/dist/lib/host/entity-form-host.component.js.map +1 -1
- package/dist/lib/interactive-form/interactive-form.component.d.ts.map +1 -1
- package/dist/lib/interactive-form/interactive-form.component.js +1 -0
- package/dist/lib/interactive-form/interactive-form.component.js.map +1 -1
- package/dist/lib/isa-related-panel/isa-related-card.component.js +7 -4
- package/dist/lib/isa-related-panel/isa-related-card.component.js.map +1 -1
- package/dist/lib/isa-related-panel/isa-related-panel.component.js +1 -2
- package/dist/lib/isa-related-panel/isa-related-panel.component.js.map +1 -1
- package/dist/lib/links/record-link-utils.d.ts +83 -0
- package/dist/lib/links/record-link-utils.d.ts.map +1 -0
- package/dist/lib/links/record-link-utils.js +232 -0
- package/dist/lib/links/record-link-utils.js.map +1 -0
- package/dist/lib/links/record-link.component.d.ts +50 -0
- package/dist/lib/links/record-link.component.d.ts.map +1 -0
- package/dist/lib/links/record-link.component.js +319 -0
- package/dist/lib/links/record-link.component.js.map +1 -0
- package/dist/lib/links/record-link.directive.d.ts +94 -0
- package/dist/lib/links/record-link.directive.d.ts.map +1 -0
- package/dist/lib/links/record-link.directive.js +277 -0
- package/dist/lib/links/record-link.directive.js.map +1 -0
- package/dist/lib/links/record-links-drawer.component.d.ts +21 -0
- package/dist/lib/links/record-links-drawer.component.d.ts.map +1 -0
- package/dist/lib/links/record-links-drawer.component.js +61 -0
- package/dist/lib/links/record-links-drawer.component.js.map +1 -0
- package/dist/lib/links/record-links.component.d.ts +255 -0
- package/dist/lib/links/record-links.component.d.ts.map +1 -0
- package/dist/lib/links/record-links.component.js +1546 -0
- package/dist/lib/links/record-links.component.js.map +1 -0
- package/dist/lib/panel-slot/form-field-panel-slot.component.d.ts.map +1 -1
- package/dist/lib/panel-slot/form-field-panel-slot.component.js +3 -1
- package/dist/lib/panel-slot/form-field-panel-slot.component.js.map +1 -1
- package/dist/lib/panel-slot/form-panel-slot.component.d.ts.map +1 -1
- package/dist/lib/panel-slot/form-panel-slot.component.js +6 -0
- package/dist/lib/panel-slot/form-panel-slot.component.js.map +1 -1
- package/dist/lib/preview-popover/record-preview-popover.component.d.ts +194 -0
- package/dist/lib/preview-popover/record-preview-popover.component.d.ts.map +1 -0
- package/dist/lib/preview-popover/record-preview-popover.component.js +1084 -0
- package/dist/lib/preview-popover/record-preview-popover.component.js.map +1 -0
- package/dist/lib/preview-popover/record-preview-popover.service.d.ts +105 -0
- package/dist/lib/preview-popover/record-preview-popover.service.d.ts.map +1 -0
- package/dist/lib/preview-popover/record-preview-popover.service.js +278 -0
- package/dist/lib/preview-popover/record-preview-popover.service.js.map +1 -0
- package/dist/lib/resolver/form-resolver.service.d.ts +44 -1
- package/dist/lib/resolver/form-resolver.service.d.ts.map +1 -1
- package/dist/lib/resolver/form-resolver.service.js +51 -3
- package/dist/lib/resolver/form-resolver.service.js.map +1 -1
- package/dist/lib/toolbar/actions/record-links-toolbar-action.d.ts +21 -0
- package/dist/lib/toolbar/actions/record-links-toolbar-action.d.ts.map +1 -0
- package/dist/lib/toolbar/actions/record-links-toolbar-action.js +90 -0
- package/dist/lib/toolbar/actions/record-links-toolbar-action.js.map +1 -0
- package/dist/lib/toolbar/base-form-toolbar-action.d.ts +189 -0
- package/dist/lib/toolbar/base-form-toolbar-action.d.ts.map +1 -0
- package/dist/lib/toolbar/base-form-toolbar-action.js +274 -0
- package/dist/lib/toolbar/base-form-toolbar-action.js.map +1 -0
- package/dist/lib/toolbar/form-toolbar.component.d.ts +21 -1
- package/dist/lib/toolbar/form-toolbar.component.d.ts.map +1 -1
- package/dist/lib/toolbar/form-toolbar.component.js +295 -195
- package/dist/lib/toolbar/form-toolbar.component.js.map +1 -1
- package/dist/lib/types/form-toolbar-item.d.ts +1 -1
- package/dist/lib/types/form-toolbar-item.d.ts.map +1 -1
- package/dist/lib/types/form-toolbar-item.js.map +1 -1
- package/dist/lib/types/toolbar-config.d.ts +4 -0
- package/dist/lib/types/toolbar-config.d.ts.map +1 -1
- package/dist/lib/types/toolbar-config.js +6 -0
- package/dist/lib/types/toolbar-config.js.map +1 -1
- package/dist/module.d.ts +19 -14
- package/dist/module.d.ts.map +1 -1
- package/dist/module.js +39 -6
- package/dist/module.js.map +1 -1
- package/dist/public-api.d.ts +9 -0
- package/dist/public-api.d.ts.map +1 -1
- package/dist/public-api.js +9 -0
- package/dist/public-api.js.map +1 -1
- package/package.json +20 -20
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"record-links.component.js","sourceRoot":"","sources":["../../../src/lib/links/record-links.component.ts","../../../src/lib/links/record-links.component.html"],"names":[],"mappings":"AAAA,OAAO,EACH,SAAS,EACT,KAAK,EACL,MAAM,EACN,YAAY,EACZ,uBAAuB,EACvB,iBAAiB,EAGjB,MAAM,EACT,MAAM,eAAe,CAAC;AACvB,OAAO,EAEH,YAAY,EAIZ,YAAY,EAEZ,OAAO,EAEV,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;;0DCyIlC,SAAS;;;;IAnJZ,gCAAqC;IAAA,YAAoB;IAAA,iBAAO;;;IAA3B,cAAoB;IAApB,2CAAoB;;;IA2BzE,wBAAiE;;;;IAtCzE,8BAAmD;IAApB,sMAAS,gBAAS,KAAC;IAAC,iBAAM;IAI7C,AADJ,AADJ,AADJ,gCAAgE,aACvB,aACS,cACF;IAChC,uBAAgC;IACpC,iBAAO;IAEH,AADJ,8BAAqC,YACE;IAC/B,uBACA;IAAA,sHAA0B;IAG9B,iBAAK;IACL,iCAAwC;IAAA,wDAAuC;IAEvF,AADI,AADmF,iBAAO,EACpF,EACJ;IAEF,AADJ,gCAA6C,kBAOX;IAA1B,0MAAS,iBAAU,IAAI,CAAC,KAAC;IACzB,yBAAqE;IACzE,iBAAS;IACT,mCAKwB;IAApB,0MAAS,gBAAS,KAAC;IACnB,yBAAiC;IAG7C,AADI,AADI,iBAAS,EACP,EACJ;IACN,gCAAmC;IAC/B,wHAAkD;IAE1D,AADI,iBAAM,EACF;;;;IA9BY,eAEC;IAFD,oDAEC;IAWL,eAAsB;IAAtB,2CAAsB;IAEe,cAA2B;IAA3B,2CAA2B;IAazD,eAAiC;IAAjC,qDAAiC;;;IAvC5D,6FAAc;;;IAAd,wCA0CC;;;IAGG,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,UAAU,CAAC,CAAC;IACxE,CAAC;qQA3wCQ,sBAAsB,yBAAtB,sBAAsB;6DAAtB,sBAAsB;YClGjC,AA5CF,8EAAyB,kEA4ChB;YAMT,0HAA8B;;YAlD9B,+CAgDC;;;iFD8FY,sBAAsB;cAPlC,SAAS;6BACM,KAAK,YACP,iBAAiB,mBAGV,uBAAuB,CAAC,MAAM;;kBAkB9C,KAAK;;kBAiBL,KAAK;;kBAeL,KAAK;;kBAGL,KAAK;;kBAGL,KAAK;;kBAGL,MAAM;;kBAGN,MAAM;;kBAGN,MAAM;;kBAGN,MAAM;;kBAGN,MAAM;;kFArEE,sBAAsB","sourcesContent":["import {\n Component,\n Input,\n Output,\n EventEmitter,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n OnInit,\n OnDestroy,\n inject\n} from '@angular/core';\nimport {\n BaseEntity,\n CompositeKey,\n EntityFieldInfo,\n EntityInfo,\n IMetadataProvider,\n KeyValuePair,\n RecordDependency,\n RunView,\n RunViewParams\n} from '@memberjunction/core';\nimport { MJLruCache } from '@memberjunction/global';\nimport { BaseAngularComponent } from '@memberjunction/ng-base-types';\nimport { FormNavigationEvent } from '../types/navigation-events';\nimport {\n type RecordPreviewAnchorRect,\n type RecordPreviewUpdatedEvent\n} from '../preview-popover/record-preview-popover.component';\n\n/**\n * System telemetry/audit entities that should never appear in the business-facing Links panel.\n */\nconst EXCLUDED_SYSTEM_ENTITIES = new Set<string>([\n 'MJ: Record Changes',\n 'MJ: Audit Logs',\n 'MJ: User Record Logs',\n 'MJ: Entity Record Documents'\n]);\n\nexport type RecordLinkFilterType = 'both' | 'soft' | 'hard';\nexport type RecordLinkDirectionFilter = 'all' | 'outgoing' | 'incoming';\n\n/**\n * Compact summary of record links published to the form toolbar badge and AI agent context.\n */\nexport interface RecordLinksSummary {\n TotalCount: number;\n OutgoingCount: number;\n IncomingCount: number;\n ByEntity: Array<{\n EntityName: string;\n EntityDisplayName: string;\n Direction: 'outgoing' | 'incoming' | 'both';\n Count: number;\n SampleNames: string[];\n }>;\n}\n\ninterface OutgoingCandidate {\n EntityName: string;\n RelatedEntity: EntityInfo | undefined;\n FieldInfo: EntityFieldInfo;\n PrimaryKey: CompositeKey;\n PreResolvedDisplayName: string | null;\n IsSoftLink: boolean;\n}\n\n/**\n * Enriched representation of a single linked record item.\n */\nexport interface RecordLinkItem {\n /** Unique key for @for tracking */\n TrackKey: string;\n /** Name of the related entity */\n EntityName: string;\n /** Business-friendly display name of the related entity */\n EntityDisplayName: string;\n /** Font Awesome icon class for the related entity */\n EntityIcon: string;\n /** Primary key of the linked record */\n PrimaryKey: CompositeKey;\n /** Resolved display name / title of the linked record */\n DisplayName: string;\n /** Business-friendly label describing how the record is linked (e.g. \"Primary Record\", \"Customer\") */\n RelationshipLabel: string;\n /** Optional status, type, or role badge text from the linked record */\n StatusLabel: string;\n /** Formatted or relative timestamp if available */\n FormattedDate: string;\n /** True for Cross-App Links (soft/entity+record links), false for Direct Relationships (hard FK) */\n IsSoftLink: boolean;\n /** Human-readable link category label (\"Cross-App Link\" or \"Direct Relationship\") */\n LinkTypeLabel: 'Cross-App Link' | 'Direct Relationship';\n /** Whether the link originates from a field on this record ('outgoing') or from another record referencing this one ('incoming') */\n Direction: 'outgoing' | 'incoming';\n /** Human-readable direction label (\"On This Record\" or \"Linked To This\") */\n DirectionLabel: 'On This Record' | 'Linked To This';\n /** Field name on this record when Direction === 'outgoing' */\n SourceFieldName?: string;\n /** Companion EntityID discriminator field name on this record for outgoing polymorphic links */\n SourceEntityIDFieldName?: string | null;\n /** True when this outgoing link field is nullable and editable so the user can unlink it inline */\n CanUnlink?: boolean;\n}\n\n/**\n * Group of linked records belonging to the same entity.\n */\nexport interface RecordLinkGroup {\n EntityName: string;\n EntityDisplayName: string;\n EntityIcon: string;\n Items: RecordLinkItem[];\n}\n\n/**\n * Top category filter chip model.\n */\nexport interface RecordLinkCategoryChip {\n EntityName: string | null;\n Label: string;\n Icon: string;\n Count: number;\n}\n\n/**\n * Reusable `<mj-record-links>` widget that displays all records linked to the current `Record`\n * in both directions:\n * - **Outgoing (\"On This Record\")**: foreign-key (`RelatedEntity`) and polymorphic-FK (`EntityIDFieldName`) fields populated on this record.\n * - **Incoming (\"Linked To This\")**: records across the workspace referencing this record via hard FKs or polymorphic/soft links (`GetRecordDependencies`).\n *\n * Can be embedded inline inside any form section/dashboard (`[Mode]=\"'inline'\"`) or rendered as a\n * slide-in drawer (`[Mode]=\"'drawer'\"`).\n */\n@Component({\n standalone: false,\n selector: 'mj-record-links',\n templateUrl: './record-links.component.html',\n styleUrls: ['./record-links.component.css'],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class MjRecordLinksComponent extends BaseAngularComponent implements OnInit, OnDestroy {\n private static readonly DEP_CACHE_MAX_ENTRIES = 200;\n private static readonly DEP_CACHE_TTL_MS = 30_000;\n /** Bounded: one entry per opened record would otherwise accumulate for the whole session. */\n private static readonly depCache = new MJLruCache<string, { LoadedAt: number; Deps: RecordDependency[] }>({\n maxSize: MjRecordLinksComponent.DEP_CACHE_MAX_ENTRIES,\n ttlMs: MjRecordLinksComponent.DEP_CACHE_TTL_MS\n });\n private static providerScopeIds = new WeakMap<object, number>();\n private static nextProviderScopeId = 1;\n\n private cdr = inject(ChangeDetectorRef);\n\n private _record: BaseEntity | null = null;\n private _lastRecordSignature = '';\n\n @Input()\n set Record(value: BaseEntity | null) {\n const prev = this._record;\n this._record = value;\n const nextSig = this.computeRecordSignature(value);\n if (nextSig !== this._lastRecordSignature || prev !== value) {\n this._lastRecordSignature = nextSig;\n if (this.isInitialized) {\n void this.LoadLinks();\n }\n }\n }\n get Record(): BaseEntity | null {\n return this._record;\n }\n\n private _initialLinkFilter: RecordLinkFilterType = 'both';\n @Input()\n set InitialLinkFilter(value: RecordLinkFilterType) {\n this._initialLinkFilter = value || 'both';\n this.LinkFilter = this._initialLinkFilter;\n this.cdr.markForCheck();\n }\n get InitialLinkFilter(): RecordLinkFilterType {\n return this._initialLinkFilter;\n }\n\n /**\n * Rendering mode:\n * - `'inline'`: embedded widget for custom form sections or dashboards\n * - `'drawer'`: slide-in drawer with backdrop and close header\n */\n @Input() Mode: 'inline' | 'drawer' = 'inline';\n\n /** Whether the drawer is open when `Mode === 'drawer'`. */\n @Input() IsOpen = true;\n\n /** Whether nullable outgoing links can be unlinked directly from the card list. */\n @Input() AllowQuickUnlink = true;\n\n /** Emitted when the user clicks a linked record card to navigate to it. */\n @Output() Navigate = new EventEmitter<FormNavigationEvent>();\n\n /** Emitted when the slide-in drawer requests to close. */\n @Output() Close = new EventEmitter<void>();\n\n /** Emitted whenever the total loaded link count changes. */\n @Output() LinkCountChange = new EventEmitter<number>();\n\n /** Emitted whenever the enriched links summary changes. */\n @Output() LinksSummaryChange = new EventEmitter<RecordLinksSummary>();\n\n /** Emitted when an outgoing link is unlinked or a target record is updated via Quick Edit. */\n @Output() RecordLinkModified = new EventEmitter<{ Action: 'unlinked' | 'updated'; Item: RecordLinkItem }>();\n\n /** Loading state */\n public IsLoading = false;\n\n /** TrackKey of the outgoing link currently being unlinked */\n public UnlinkingTrackKey: string | null = null;\n\n /** Error message if loading fails */\n public ErrorMessage: string | null = null;\n\n /** Current search query */\n public SearchText = '';\n\n /** Whether the collapsible Link Type filter panel is expanded */\n public ShowFilterPanel = false;\n\n /** Active link type filter: 'both' (All Links), 'soft' (Cross-App Links), or 'hard' (Direct Relationships) */\n public LinkFilter: RecordLinkFilterType = 'both';\n\n /** Active direction filter: 'all', 'outgoing' (On This Record), or 'incoming' (Linked To This) */\n public DirectionFilter: RecordLinkDirectionFilter = 'all';\n\n /** Currently selected entity filter chip (`null` means All) */\n public SelectedEntityName: string | null = null;\n\n /** All loaded and enriched link items for the current record */\n public AllItems: RecordLinkItem[] = [];\n\n /** Hover preview card state */\n public HoveredItem: RecordLinkItem | null = null;\n public HoverAnchorRect: RecordPreviewAnchorRect | null = null;\n\n private isInitialized = false;\n private isDestroyed = false;\n private loadVersion = 0;\n private hoverOpenTimer: ReturnType<typeof setTimeout> | null = null;\n private hoverCloseTimer: ReturnType<typeof setTimeout> | null = null;\n\n /** Clear the static dependency cache (useful in unit tests). */\n public static ClearDependencyCache(): void {\n MjRecordLinksComponent.depCache.Clear();\n }\n\n /**\n * Synchronously computes the outgoing links summary from the record's in-memory FK and\n * polymorphic-FK fields without making any network calls.\n */\n public static BuildOutgoingLinksSummary(\n record: BaseEntity,\n provider: IMetadataProvider | null | undefined\n ): RecordLinksSummary {\n if (!record || !record.IsSaved || !record.EntityInfo) {\n return { TotalCount: 0, OutgoingCount: 0, IncomingCount: 0, ByEntity: [] };\n }\n const entities = provider?.Entities ?? [];\n const outgoing = MjRecordLinksComponent.extractOutgoingCandidates(record, provider, entities);\n const byEntityMap = new Map<string, {\n EntityName: string;\n EntityDisplayName: string;\n Count: number;\n SampleNames: string[];\n }>();\n\n for (const out of outgoing) {\n const displayName = out.RelatedEntity?.DisplayNameOrName || out.EntityName;\n let entry = byEntityMap.get(out.EntityName);\n if (!entry) {\n entry = {\n EntityName: out.EntityName,\n EntityDisplayName: displayName,\n Count: 0,\n SampleNames: []\n };\n byEntityMap.set(out.EntityName, entry);\n }\n entry.Count += 1;\n if (out.PreResolvedDisplayName && entry.SampleNames.length < 3) {\n entry.SampleNames.push(out.PreResolvedDisplayName);\n }\n }\n\n return {\n TotalCount: outgoing.length,\n OutgoingCount: outgoing.length,\n IncomingCount: 0,\n ByEntity: Array.from(byEntityMap.values()).map(e => ({\n EntityName: e.EntityName,\n EntityDisplayName: e.EntityDisplayName,\n Direction: 'outgoing' as const,\n Count: e.Count,\n SampleNames: e.SampleNames\n }))\n };\n }\n\n /**\n * Pre-warms the total bidirectional link count (outgoing FK/polymorphic fields on the record\n * + incoming `GetRecordDependencies`) and caches the incoming dependencies so opening the\n * `<mj-record-links>` drawer reuses them without a duplicate network request.\n */\n public static async PrewarmRecordLinkCount(\n record: BaseEntity,\n provider: IMetadataProvider | null | undefined\n ): Promise<RecordLinksSummary> {\n if (!record || !record.IsSaved || !record.EntityInfo || !provider) {\n return { TotalCount: 0, OutgoingCount: 0, IncomingCount: 0, ByEntity: [] };\n }\n const entities = provider.Entities ?? [];\n const outgoing = MjRecordLinksComponent.extractOutgoingCandidates(record, provider, entities);\n const rawDeps = await MjRecordLinksComponent.fetchDependenciesWithCache(record, provider, false);\n const incoming = MjRecordLinksComponent.filterIncomingDependencies(rawDeps, entities);\n\n const byEntityMap = new Map<string, {\n EntityName: string;\n EntityDisplayName: string;\n HasOutgoing: boolean;\n HasIncoming: boolean;\n Count: number;\n SampleNames: string[];\n }>();\n\n for (const out of outgoing) {\n const displayName = out.RelatedEntity?.DisplayNameOrName || out.EntityName;\n let entry = byEntityMap.get(out.EntityName);\n if (!entry) {\n entry = {\n EntityName: out.EntityName,\n EntityDisplayName: displayName,\n HasOutgoing: true,\n HasIncoming: false,\n Count: 0,\n SampleNames: []\n };\n byEntityMap.set(out.EntityName, entry);\n }\n entry.HasOutgoing = true;\n entry.Count += 1;\n if (out.PreResolvedDisplayName && entry.SampleNames.length < 3) {\n entry.SampleNames.push(out.PreResolvedDisplayName);\n }\n }\n\n for (const dep of incoming) {\n const entityInfo = MjRecordLinksComponent.findEntityInfoStatic(entities, dep.RelatedEntityName);\n const displayName = entityInfo?.DisplayNameOrName || dep.RelatedEntityName;\n let entry = byEntityMap.get(dep.RelatedEntityName);\n if (!entry) {\n entry = {\n EntityName: dep.RelatedEntityName,\n EntityDisplayName: displayName,\n HasOutgoing: false,\n HasIncoming: true,\n Count: 0,\n SampleNames: []\n };\n byEntityMap.set(dep.RelatedEntityName, entry);\n }\n entry.HasIncoming = true;\n entry.Count += 1;\n }\n\n return {\n TotalCount: outgoing.length + incoming.length,\n OutgoingCount: outgoing.length,\n IncomingCount: incoming.length,\n ByEntity: Array.from(byEntityMap.values()).map(e => ({\n EntityName: e.EntityName,\n EntityDisplayName: e.EntityDisplayName,\n Direction: e.HasOutgoing && e.HasIncoming ? 'both' : e.HasOutgoing ? 'outgoing' : 'incoming',\n Count: e.Count,\n SampleNames: e.SampleNames\n }))\n };\n }\n\n private static getProviderScopeId(provider: IMetadataProvider | null | undefined): number {\n if (!provider || (typeof provider !== 'object' && typeof provider !== 'function')) {\n return 0;\n }\n let scopeId = MjRecordLinksComponent.providerScopeIds.get(provider);\n if (scopeId === undefined) {\n scopeId = MjRecordLinksComponent.nextProviderScopeId++;\n MjRecordLinksComponent.providerScopeIds.set(provider, scopeId);\n }\n return scopeId;\n }\n\n private static buildDependencyCacheKey(\n entityName: string,\n primaryKey: CompositeKey | undefined | null,\n provider: IMetadataProvider | null | undefined\n ): string {\n const providerScope = MjRecordLinksComponent.getProviderScopeId(provider);\n const pkStr = MjRecordLinksComponent.getPrimaryKeyStringStatic(primaryKey).trim().toLowerCase();\n return `p${providerScope}::${entityName.trim().toLowerCase()}::${pkStr}`;\n }\n\n private static async fetchDependenciesWithCache(\n record: BaseEntity,\n provider: IMetadataProvider,\n forceRefresh: boolean\n ): Promise<RecordDependency[]> {\n const cacheKey = MjRecordLinksComponent.buildDependencyCacheKey(\n record.EntityInfo.Name,\n record.PrimaryKey,\n provider\n );\n if (!forceRefresh) {\n const cached = MjRecordLinksComponent.depCache.Get(cacheKey);\n if (cached && Date.now() - cached.LoadedAt < MjRecordLinksComponent.DEP_CACHE_TTL_MS) {\n return cached.Deps;\n }\n }\n const deps = await provider.GetRecordDependencies(record.EntityInfo.Name, record.PrimaryKey, {\n IncludeSystemEntities: false\n });\n const safeDeps = deps ?? [];\n MjRecordLinksComponent.depCache.Set(cacheKey, {\n LoadedAt: Date.now(),\n Deps: safeDeps\n });\n return safeDeps;\n }\n\n private static filterIncomingDependencies(\n deps: RecordDependency[],\n entities: EntityInfo[]\n ): RecordDependency[] {\n return (deps ?? []).filter(dep => {\n if (!dep || !dep.RelatedEntityName) {\n return false;\n }\n if (EXCLUDED_SYSTEM_ENTITIES.has(dep.RelatedEntityName.trim())) {\n return false;\n }\n const entityInfo = MjRecordLinksComponent.findEntityInfoStatic(entities, dep.RelatedEntityName);\n const entityWithPerm = entityInfo as (EntityInfo & { CanRead?: boolean }) | null;\n if (entityWithPerm && (entityWithPerm.CanRead === false || entityWithPerm.IncludeInAPI === false)) {\n return false;\n }\n return true;\n });\n }\n\n private static extractOutgoingCandidates(\n record: BaseEntity,\n provider: IMetadataProvider | null | undefined,\n entities: EntityInfo[]\n ): OutgoingCandidate[] {\n const candidates: OutgoingCandidate[] = [];\n const fields = record.EntityInfo?.Fields ?? [];\n const seenKeys = new Set<string>();\n\n for (const field of fields) {\n if (field.IsPrimaryKey || field.Name.startsWith('__mj_')) {\n continue;\n }\n if (field.Status === 'Deprecated' || field.Status === 'Disabled') {\n continue;\n }\n\n // 1. Polymorphic FK configured via EntityField.EntityIDFieldName (Rule 2e)\n const entityIdFieldName = field.EntityIDFieldName?.trim();\n if (entityIdFieldName) {\n const rawRecordId = record.Get(field.Name);\n const rawEntityRef = record.Get(entityIdFieldName);\n if (rawRecordId == null || String(rawRecordId).trim() === '' || rawEntityRef == null || String(rawEntityRef).trim() === '') {\n continue;\n }\n const entityRefStr = String(rawEntityRef).trim();\n const targetEntity = provider?.EntityByID?.(entityRefStr) ?? MjRecordLinksComponent.findEntityInfoStatic(entities, entityRefStr);\n if (!targetEntity || EXCLUDED_SYSTEM_ENTITIES.has(targetEntity.Name.trim())) {\n continue;\n }\n const entityWithPerm = targetEntity as (EntityInfo & { CanRead?: boolean });\n if (entityWithPerm.CanRead === false || entityWithPerm.IncludeInAPI === false) {\n continue;\n }\n const pk = CompositeKey.FromURLSegment(targetEntity, String(rawRecordId).trim());\n const dedupeKey = `poly:${targetEntity.Name}:${field.Name}:${MjRecordLinksComponent.getPrimaryKeyStringStatic(pk)}`;\n if (seenKeys.has(dedupeKey)) {\n continue;\n }\n seenKeys.add(dedupeKey);\n candidates.push({\n EntityName: targetEntity.Name,\n RelatedEntity: targetEntity,\n FieldInfo: field,\n PrimaryKey: pk,\n PreResolvedDisplayName: null,\n IsSoftLink: true\n });\n continue;\n }\n\n // 2. Standard hard Foreign Key via EntityField.RelatedEntity\n const relatedEntityName = field.RelatedEntity?.trim();\n if (!relatedEntityName || EXCLUDED_SYSTEM_ENTITIES.has(relatedEntityName)) {\n continue;\n }\n const fkValue = record.Get(field.Name);\n if (fkValue == null || String(fkValue).trim() === '') {\n continue;\n }\n const targetEntity = MjRecordLinksComponent.findEntityInfoStatic(entities, relatedEntityName);\n const entityWithPerm = targetEntity as (EntityInfo & { CanRead?: boolean }) | undefined;\n if (entityWithPerm && (entityWithPerm.CanRead === false || entityWithPerm.IncludeInAPI === false)) {\n continue;\n }\n const pkFieldName = field.RelatedEntityFieldName || targetEntity?.FirstPrimaryKey?.Name || 'ID'; // first-pk-ok: a foreign key targets a single column\n const pk = new CompositeKey([new KeyValuePair(pkFieldName, fkValue)]);\n const dedupeKey = `fk:${relatedEntityName}:${field.Name}:${MjRecordLinksComponent.getPrimaryKeyStringStatic(pk)}`;\n if (seenKeys.has(dedupeKey)) {\n continue;\n }\n seenKeys.add(dedupeKey);\n\n let preResolvedName: string | null = null;\n if (field.RelatedEntityNameFieldMap) {\n const joinedVal = record.Get(field.RelatedEntityNameFieldMap);\n if (joinedVal != null && String(joinedVal).trim() !== '') {\n preResolvedName = String(joinedVal).trim();\n }\n }\n\n candidates.push({\n EntityName: targetEntity?.Name || relatedEntityName,\n RelatedEntity: targetEntity,\n FieldInfo: field,\n PrimaryKey: pk,\n PreResolvedDisplayName: preResolvedName,\n IsSoftLink: false\n });\n }\n\n return candidates;\n }\n\n private static findEntityInfoStatic(entities: EntityInfo[], entityName: string): EntityInfo | undefined {\n const normalized = entityName.trim().toLowerCase();\n return entities.find(e => e.Name.trim().toLowerCase() === normalized);\n }\n\n private static getPrimaryKeyStringStatic(primaryKey: CompositeKey | undefined | null): string {\n if (!primaryKey) {\n return '';\n }\n if (typeof primaryKey.ToConcatenatedString === 'function') {\n return primaryKey.ToConcatenatedString();\n }\n if (Array.isArray(primaryKey.KeyValuePairs)) {\n return primaryKey.KeyValuePairs.map(kv => `${kv.FieldName}|${kv.Value}`).join('||');\n }\n return '';\n }\n\n ngOnInit(): void {\n this.isInitialized = true;\n this.LinkFilter = this._initialLinkFilter;\n if (this._record) {\n void this.LoadLinks();\n }\n }\n\n ngOnDestroy(): void {\n this.isDestroyed = true;\n this.clearHoverTimers();\n }\n\n /** Total number of links loaded for this record */\n public get TotalLinkCount(): number {\n return this.AllItems.length;\n }\n\n /** Count of Outgoing links (\"On This Record\") */\n public get OutgoingLinkCount(): number {\n return this.AllItems.filter(i => i.Direction === 'outgoing').length;\n }\n\n /** Count of Incoming links (\"Linked To This\") */\n public get IncomingLinkCount(): number {\n return this.AllItems.filter(i => i.Direction === 'incoming').length;\n }\n\n /** Count of Cross-App Links (`IsSoftLink === true`) */\n public get CrossAppLinkCount(): number {\n return this.AllItems.filter(i => i.IsSoftLink).length;\n }\n\n /** Count of Direct Relationships (`IsSoftLink === false`) */\n public get DirectRelationshipCount(): number {\n return this.AllItems.filter(i => !i.IsSoftLink).length;\n }\n\n /** Items matching the active Direction, Link Type, and Search filters (prior to entity chip selection) */\n public get ItemsMatchingTypeAndSearch(): RecordLinkItem[] {\n const search = this.SearchText.trim().toLowerCase();\n return this.AllItems.filter(item => {\n if (this.DirectionFilter !== 'all' && item.Direction !== this.DirectionFilter) {\n return false;\n }\n if (this.LinkFilter === 'soft' && !item.IsSoftLink) {\n return false;\n }\n if (this.LinkFilter === 'hard' && item.IsSoftLink) {\n return false;\n }\n if (search.length > 0) {\n const matchesTitle = item.DisplayName.toLowerCase().includes(search);\n const matchesEntity = item.EntityDisplayName.toLowerCase().includes(search);\n const matchesRel = item.RelationshipLabel.toLowerCase().includes(search);\n const matchesStatus = item.StatusLabel.toLowerCase().includes(search);\n if (!matchesTitle && !matchesEntity && !matchesRel && !matchesStatus) {\n return false;\n }\n }\n return true;\n });\n }\n\n /** Category chips for the top bar (\"All (N)\" + one chip per entity) */\n public get CategoryChips(): RecordLinkCategoryChip[] {\n const items = this.ItemsMatchingTypeAndSearch;\n const chips: RecordLinkCategoryChip[] = [\n {\n EntityName: null,\n Label: 'All',\n Icon: 'fa-solid fa-layer-group',\n Count: items.length\n }\n ];\n\n const byEntity = new Map<string, { displayName: string; icon: string; count: number }>();\n for (const item of items) {\n const existing = byEntity.get(item.EntityName);\n if (existing) {\n existing.count += 1;\n } else {\n byEntity.set(item.EntityName, {\n displayName: item.EntityDisplayName,\n icon: item.EntityIcon,\n count: 1\n });\n }\n }\n\n for (const [entityName, info] of byEntity.entries()) {\n chips.push({\n EntityName: entityName,\n Label: info.displayName,\n Icon: info.icon,\n Count: info.count\n });\n }\n\n return chips;\n }\n\n /** Final grouped items after applying DirectionFilter, LinkType, SearchText, and SelectedEntityName filters */\n public get FilteredGroups(): RecordLinkGroup[] {\n const items = this.ItemsMatchingTypeAndSearch.filter(item =>\n this.SelectedEntityName === null || item.EntityName === this.SelectedEntityName\n );\n\n const groupMap = new Map<string, RecordLinkGroup>();\n for (const item of items) {\n let group = groupMap.get(item.EntityName);\n if (!group) {\n group = {\n EntityName: item.EntityName,\n EntityDisplayName: item.EntityDisplayName,\n EntityIcon: item.EntityIcon,\n Items: []\n };\n groupMap.set(item.EntityName, group);\n }\n group.Items.push(item);\n }\n\n return Array.from(groupMap.values());\n }\n\n /** Total count of currently visible items */\n public get FilteredLinkCount(): number {\n return this.FilteredGroups.reduce((sum, g) => sum + g.Items.length, 0);\n }\n\n /** Human-readable label for the active LinkFilter */\n public get ActiveLinkFilterLabel(): string {\n switch (this.LinkFilter) {\n case 'soft':\n return 'Cross-App Links';\n case 'hard':\n return 'Direct Relationships';\n default:\n return 'All Links';\n }\n }\n\n /** Toggle the collapsible filter panel */\n public ToggleFilterPanel(): void {\n this.ShowFilterPanel = !this.ShowFilterPanel;\n this.cdr.markForCheck();\n }\n\n /** Select a Direction filter ('all' | 'outgoing' | 'incoming') */\n public SetDirectionFilter(direction: RecordLinkDirectionFilter): void {\n this.DirectionFilter = direction;\n this.pruneSelectedEntityChipIfNeeded();\n this.cdr.markForCheck();\n }\n\n /** Select a Link Type filter ('both' | 'soft' | 'hard') */\n public SetLinkFilter(filter: RecordLinkFilterType): void {\n this.LinkFilter = filter;\n this.pruneSelectedEntityChipIfNeeded();\n this.cdr.markForCheck();\n }\n\n private pruneSelectedEntityChipIfNeeded(): void {\n if (this.SelectedEntityName !== null) {\n const stillHasEntity = this.ItemsMatchingTypeAndSearch.some(\n i => i.EntityName === this.SelectedEntityName\n );\n if (!stillHasEntity) {\n this.SelectedEntityName = null;\n }\n }\n }\n\n /** Select a category chip by entity name (`null` for All) */\n public SelectCategoryChip(entityName: string | null): void {\n this.SelectedEntityName = entityName;\n this.cdr.markForCheck();\n }\n\n /** Update search filter text from DOM input event */\n public OnSearchInput(event: Event): void {\n const target = event.target as HTMLInputElement | null;\n this.OnSearchChange(target?.value ?? '');\n }\n\n /** Update search filter text */\n public OnSearchChange(value: string): void {\n this.SearchText = value;\n this.cdr.markForCheck();\n }\n\n /** Clear search text */\n public ClearSearch(): void {\n this.SearchText = '';\n this.cdr.markForCheck();\n }\n\n /** Reset all active filters back to defaults */\n public ResetFilters(): void {\n this.SearchText = '';\n this.LinkFilter = 'both';\n this.DirectionFilter = 'all';\n this.SelectedEntityName = null;\n this.cdr.markForCheck();\n }\n\n /** Handle navigation emitted by `[mjRecordLink]` on a linked record card */\n public OnItemNavigate(_item: RecordLinkItem, navEvent: FormNavigationEvent): void {\n this.clearHoverTimers();\n this.HoveredItem = null;\n this.Navigate.emit(navEvent);\n }\n\n /** Handle inline Quick Edit save emitted by `[mjRecordLink]` on a linked record card */\n public OnItemQuickEdited(item: RecordLinkItem, _event: RecordPreviewUpdatedEvent): void {\n this.RecordLinkModified.emit({ Action: 'updated', Item: item });\n void this.LoadLinks(true);\n }\n\n /** Handle clicking a linked record card */\n public OnItemClick(item: RecordLinkItem, event?: MouseEvent): void {\n this.clearHoverTimers();\n this.HoveredItem = null;\n const navEvent: FormNavigationEvent = event && (event.metaKey || event.ctrlKey)\n ? {\n Kind: 'record',\n EntityName: item.EntityName,\n PrimaryKey: item.PrimaryKey,\n OpenInNewTab: true\n }\n : {\n Kind: 'record',\n EntityName: item.EntityName,\n PrimaryKey: item.PrimaryKey\n };\n this.Navigate.emit(navEvent);\n }\n\n /** Open `<mj-record-preview-popover>` when hovering over a link card */\n public OnCardMouseEnter(item: RecordLinkItem, event: MouseEvent): void {\n const anchorEl = event.currentTarget as HTMLElement | null;\n if (!anchorEl) return;\n\n if (this.hoverCloseTimer) {\n clearTimeout(this.hoverCloseTimer);\n this.hoverCloseTimer = null;\n }\n if (this.hoverOpenTimer) {\n clearTimeout(this.hoverOpenTimer);\n }\n\n this.hoverOpenTimer = setTimeout(() => {\n this.hoverOpenTimer = null;\n if (this.isDestroyed) return;\n const r = anchorEl.getBoundingClientRect();\n this.HoverAnchorRect = {\n top: r.top,\n bottom: r.bottom,\n left: r.left,\n right: r.right,\n width: r.width,\n height: r.height\n };\n this.HoveredItem = item;\n this.cdr.markForCheck();\n }, 280);\n }\n\n /** Schedule closing the hover preview popover when the pointer leaves a card */\n public OnCardMouseLeave(): void {\n if (this.hoverOpenTimer) {\n clearTimeout(this.hoverOpenTimer);\n this.hoverOpenTimer = null;\n }\n if (this.hoverCloseTimer) {\n clearTimeout(this.hoverCloseTimer);\n }\n this.hoverCloseTimer = setTimeout(() => {\n this.hoverCloseTimer = null;\n if (!this.isDestroyed) {\n this.HoveredItem = null;\n this.cdr.markForCheck();\n }\n }, 180);\n }\n\n public OnPreviewCardMouseEnter(): void {\n if (this.hoverCloseTimer) {\n clearTimeout(this.hoverCloseTimer);\n this.hoverCloseTimer = null;\n }\n }\n\n public OnPreviewCardMouseLeave(): void {\n this.OnCardMouseLeave();\n }\n\n public OnPreviewCardNavigate(navEvent: FormNavigationEvent): void {\n this.clearHoverTimers();\n this.HoveredItem = null;\n this.Navigate.emit(navEvent);\n this.cdr.markForCheck();\n }\n\n public OnPreviewRecordUpdated(_event: RecordPreviewUpdatedEvent): void {\n const currentHovered = this.HoveredItem;\n if (currentHovered) {\n this.RecordLinkModified.emit({ Action: 'updated', Item: currentHovered });\n }\n void this.LoadLinks(true);\n }\n\n /**\n * Unlinks a nullable outgoing foreign-key or polymorphic-FK field on `this.Record`\n * and saves the record if it was already saved.\n */\n public async OnUnlinkItem(item: RecordLinkItem, event: MouseEvent): Promise<void> {\n event.preventDefault();\n event.stopPropagation();\n const record = this._record;\n if (\n !record ||\n !this.AllowQuickUnlink ||\n item.Direction !== 'outgoing' ||\n !item.CanUnlink ||\n !item.SourceFieldName ||\n this.UnlinkingTrackKey\n ) {\n return;\n }\n\n this.clearHoverTimers();\n if (this.HoveredItem?.TrackKey === item.TrackKey) {\n this.HoveredItem = null;\n }\n\n this.UnlinkingTrackKey = item.TrackKey;\n this.ErrorMessage = null;\n this.cdr.markForCheck();\n\n try {\n record.Set(item.SourceFieldName, null);\n if (item.SourceEntityIDFieldName) {\n const entityIdCol = item.SourceEntityIDFieldName;\n const sharedByAnotherActiveField = (record.EntityInfo?.Fields ?? []).some(f => {\n if (f.Name === item.SourceFieldName) return false;\n if (f.EntityIDFieldName?.trim() !== entityIdCol) return false;\n const val = record.Get(f.Name);\n return val != null && String(val).trim() !== '';\n });\n const entityIdFieldInfo = record.EntityInfo?.Fields?.find(f => f.Name === entityIdCol);\n if (!sharedByAnotherActiveField && entityIdFieldInfo?.AllowsNull) {\n record.Set(entityIdCol, null);\n }\n }\n\n if (record.IsSaved && typeof record.Save === 'function') {\n const saved = await record.Save();\n if (!saved) {\n const latestMsg = (record as BaseEntity & { LatestResult?: { Message?: string } }).LatestResult?.Message;\n this.ErrorMessage = latestMsg || 'Unable to unlink record.';\n this.UnlinkingTrackKey = null;\n this.cdr.markForCheck();\n return;\n }\n }\n\n this.AllItems = this.AllItems.filter(existing => existing.TrackKey !== item.TrackKey);\n this.UnlinkingTrackKey = null;\n this.emitCountAndSummary();\n this.RecordLinkModified.emit({ Action: 'unlinked', Item: item });\n this.cdr.markForCheck();\n } catch (err: unknown) {\n this.ErrorMessage = err instanceof Error ? err.message : 'Unable to unlink record.';\n this.UnlinkingTrackKey = null;\n this.cdr.markForCheck();\n }\n }\n\n private clearHoverTimers(): void {\n if (this.hoverOpenTimer) {\n clearTimeout(this.hoverOpenTimer);\n this.hoverOpenTimer = null;\n }\n if (this.hoverCloseTimer) {\n clearTimeout(this.hoverCloseTimer);\n this.hoverCloseTimer = null;\n }\n }\n\n /** Request to close the drawer */\n public OnClose(): void {\n this.Close.emit();\n }\n\n /**\n * Load bidirectional links for `this.Record` (both outgoing FK / polymorphic FK fields on\n * this record and incoming dependencies via `GetRecordDependencies`), filter out system\n * telemetry entities and unreadable entities, and batch-enrich record names/dates via `RunViews`.\n */\n public async LoadLinks(forceRefresh = false): Promise<void> {\n const record = this._record;\n if (!record || !record.IsSaved || !record.EntityInfo) {\n this.AllItems = [];\n this.IsLoading = false;\n this.ErrorMessage = null;\n this.emitCountAndSummary();\n this.cdr.markForCheck();\n return;\n }\n\n const currentVersion = ++this.loadVersion;\n this.IsLoading = true;\n this.ErrorMessage = null;\n this.cdr.markForCheck();\n\n try {\n const provider = this.ProviderToUse;\n const entities: EntityInfo[] = provider.Entities ?? [];\n\n // 1. Outgoing candidates from this record's own FK and polymorphic FK fields\n const outgoingCandidates = MjRecordLinksComponent.extractOutgoingCandidates(record, provider, entities);\n\n // 2. Incoming dependencies from GetRecordDependencies (reusing pre-warmed cache when fresh)\n const deps = await MjRecordLinksComponent.fetchDependenciesWithCache(record, provider, forceRefresh);\n\n if (this.isDestroyed || currentVersion !== this.loadVersion) {\n return;\n }\n\n const filteredDeps = MjRecordLinksComponent.filterIncomingDependencies(deps, entities);\n\n if (outgoingCandidates.length === 0 && filteredDeps.length === 0) {\n this.AllItems = [];\n this.IsLoading = false;\n this.emitCountAndSummary();\n this.cdr.markForCheck();\n return;\n }\n\n // Combine target primary keys per related entity so we batch-enrich both outgoing and incoming in a single RunViews call\n const keysByEntity = new Map<string, CompositeKey[]>();\n for (const out of outgoingCandidates) {\n const list = keysByEntity.get(out.EntityName) ?? [];\n list.push(out.PrimaryKey);\n keysByEntity.set(out.EntityName, list);\n }\n for (const dep of filteredDeps) {\n const list = keysByEntity.get(dep.RelatedEntityName) ?? [];\n list.push(dep.PrimaryKey);\n keysByEntity.set(dep.RelatedEntityName, list);\n }\n\n const groupEntries = Array.from(keysByEntity.entries());\n const viewParamsList: RunViewParams[] = [];\n\n for (const [relatedEntityName, pks] of groupEntries) {\n const relatedEntity = this.findEntityInfo(entities, relatedEntityName);\n const fieldsToRequest = this.buildFieldsToRequestForKeys(relatedEntity, pks);\n const extraFilter = this.buildBatchWhereClauseForKeys(pks.slice(0, 50));\n\n viewParamsList.push({\n EntityName: relatedEntityName,\n ExtraFilter: extraFilter,\n Fields: fieldsToRequest,\n ResultType: 'simple',\n MaxRows: 50\n });\n }\n\n const rowsByEntity = new Map<string, Record<string, unknown>[]>();\n if (viewParamsList.length > 0) {\n try {\n const rv = RunView.FromMetadataProvider(provider);\n const viewResults = await rv.RunViews(viewParamsList);\n if (Array.isArray(viewResults)) {\n for (let i = 0; i < groupEntries.length; i++) {\n const [relatedEntityName] = groupEntries[i];\n const res = viewResults[i];\n if (res && res.Success && Array.isArray(res.Results)) {\n rowsByEntity.set(\n relatedEntityName,\n res.Results as Record<string, unknown>[]\n );\n }\n }\n }\n } catch {\n // Fallback gracefully to primary-key display labels if batch view enrichment fails\n }\n }\n\n if (this.isDestroyed || currentVersion !== this.loadVersion) {\n return;\n }\n\n const enrichedItems: RecordLinkItem[] = [];\n let index = 0;\n\n // Build Outgoing items first (\"On This Record\")\n for (const out of outgoingCandidates) {\n const relatedEntity = out.RelatedEntity ?? this.findEntityInfo(entities, out.EntityName);\n const entityDisplayName = relatedEntity?.DisplayNameOrName || out.EntityName;\n const entityIcon = relatedEntity?.Icon || 'fa-solid fa-link';\n const entityRows = rowsByEntity.get(out.EntityName) ?? [];\n const matchedRow = this.findMatchingRow(entityRows, out.PrimaryKey);\n const displayName = out.PreResolvedDisplayName || this.resolveRecordDisplayName(\n matchedRow,\n relatedEntity,\n entityDisplayName,\n out.PrimaryKey\n );\n const relationshipLabel = this.humanizeFieldName(out.FieldInfo.DisplayNameOrName || out.FieldInfo.Name);\n const statusLabel = this.resolveStatusLabel(matchedRow, relatedEntity);\n const formattedDate = this.resolveFormattedDate(matchedRow);\n const pkConcat = this.getPrimaryKeyString(out.PrimaryKey);\n const canUnlink = Boolean(\n out.FieldInfo.AllowsNull &&\n !out.FieldInfo.ReadOnly &&\n out.FieldInfo.AllowUpdateAPI !== false\n );\n\n enrichedItems.push({\n TrackKey: `out:${out.EntityName}:${out.FieldInfo.Name}:${pkConcat}:${index++}`,\n EntityName: out.EntityName,\n EntityDisplayName: entityDisplayName,\n EntityIcon: entityIcon,\n PrimaryKey: out.PrimaryKey,\n DisplayName: displayName,\n RelationshipLabel: relationshipLabel,\n StatusLabel: statusLabel,\n FormattedDate: formattedDate,\n IsSoftLink: out.IsSoftLink,\n LinkTypeLabel: out.IsSoftLink ? 'Cross-App Link' : 'Direct Relationship',\n Direction: 'outgoing',\n DirectionLabel: 'On This Record',\n SourceFieldName: out.FieldInfo.Name,\n SourceEntityIDFieldName: out.FieldInfo.EntityIDFieldName?.trim() || null,\n CanUnlink: canUnlink\n });\n }\n\n // Build Incoming items (\"Linked To This\")\n for (const dep of filteredDeps) {\n const relatedEntity = this.findEntityInfo(entities, dep.RelatedEntityName);\n const entityDisplayName = relatedEntity?.DisplayNameOrName || dep.RelatedEntityName;\n const entityIcon = relatedEntity?.Icon || 'fa-solid fa-link';\n const entityRows = rowsByEntity.get(dep.RelatedEntityName) ?? [];\n const matchedRow = this.findMatchingRow(entityRows, dep.PrimaryKey);\n const displayName = this.resolveRecordDisplayName(\n matchedRow,\n relatedEntity,\n entityDisplayName,\n dep.PrimaryKey\n );\n const relationshipLabel = this.resolveRelationshipLabel(dep, relatedEntity);\n const statusLabel = this.resolveStatusLabel(matchedRow, relatedEntity);\n const formattedDate = this.resolveFormattedDate(matchedRow);\n const isSoft = Boolean(dep.IsSoftLink);\n const pkConcat = this.getPrimaryKeyString(dep.PrimaryKey);\n\n enrichedItems.push({\n TrackKey: `in:${dep.RelatedEntityName}:${dep.FieldName}:${pkConcat}:${index++}`,\n EntityName: dep.RelatedEntityName,\n EntityDisplayName: entityDisplayName,\n EntityIcon: entityIcon,\n PrimaryKey: dep.PrimaryKey,\n DisplayName: displayName,\n RelationshipLabel: relationshipLabel,\n StatusLabel: statusLabel,\n FormattedDate: formattedDate,\n IsSoftLink: isSoft,\n LinkTypeLabel: isSoft ? 'Cross-App Link' : 'Direct Relationship',\n Direction: 'incoming',\n DirectionLabel: 'Linked To This'\n });\n }\n\n this.AllItems = enrichedItems;\n this.IsLoading = false;\n this.emitCountAndSummary();\n this.cdr.markForCheck();\n } catch (err: unknown) {\n if (this.isDestroyed || currentVersion !== this.loadVersion) {\n return;\n }\n this.AllItems = [];\n this.IsLoading = false;\n this.ErrorMessage = err instanceof Error ? err.message : 'Unable to load linked records.';\n this.emitCountAndSummary();\n this.cdr.markForCheck();\n }\n }\n\n private emitCountAndSummary(): void {\n this.LinkCountChange.emit(this.AllItems.length);\n const byEntityMap = new Map<string, {\n EntityName: string;\n EntityDisplayName: string;\n HasOutgoing: boolean;\n HasIncoming: boolean;\n Count: number;\n SampleNames: string[];\n }>();\n\n for (const item of this.AllItems) {\n let entry = byEntityMap.get(item.EntityName);\n if (!entry) {\n entry = {\n EntityName: item.EntityName,\n EntityDisplayName: item.EntityDisplayName,\n HasOutgoing: false,\n HasIncoming: false,\n Count: 0,\n SampleNames: []\n };\n byEntityMap.set(item.EntityName, entry);\n }\n if (item.Direction === 'outgoing') entry.HasOutgoing = true;\n if (item.Direction === 'incoming') entry.HasIncoming = true;\n entry.Count += 1;\n if (item.DisplayName && entry.SampleNames.length < 3) {\n entry.SampleNames.push(item.DisplayName);\n }\n }\n\n this.LinksSummaryChange.emit({\n TotalCount: this.AllItems.length,\n OutgoingCount: this.OutgoingLinkCount,\n IncomingCount: this.IncomingLinkCount,\n ByEntity: Array.from(byEntityMap.values()).map(e => ({\n EntityName: e.EntityName,\n EntityDisplayName: e.EntityDisplayName,\n Direction: e.HasOutgoing && e.HasIncoming ? 'both' : e.HasOutgoing ? 'outgoing' : 'incoming',\n Count: e.Count,\n SampleNames: e.SampleNames\n }))\n });\n }\n\n private computeRecordSignature(record: BaseEntity | null): string {\n if (!record || !record.EntityInfo) {\n return '';\n }\n const pk = this.getPrimaryKeyString(record.PrimaryKey);\n return `${record.EntityInfo.Name}:${pk}:${record.IsSaved}`;\n }\n\n private findEntityInfo(entities: EntityInfo[], entityName: string): EntityInfo | undefined {\n return MjRecordLinksComponent.findEntityInfoStatic(entities, entityName);\n }\n\n private buildFieldsToRequestForKeys(\n relatedEntity: EntityInfo | undefined,\n pks: CompositeKey[]\n ): string[] {\n const fieldSet = new Set<string>();\n\n if (relatedEntity?.PrimaryKeys?.length) {\n for (const pk of relatedEntity.PrimaryKeys) {\n fieldSet.add(pk.Name);\n }\n }\n for (const pk of pks) {\n for (const kv of pk?.KeyValuePairs ?? []) {\n if (kv.FieldName) {\n fieldSet.add(kv.FieldName);\n }\n }\n }\n if (fieldSet.size === 0) {\n fieldSet.add('ID');\n }\n\n if (relatedEntity?.NameField?.Name) {\n fieldSet.add(relatedEntity.NameField.Name);\n } else if (relatedEntity?.Fields?.length) {\n for (const candidate of ['Name', 'Title', 'Subject']) {\n const found = relatedEntity.Fields.find(\n f => f.Name.toLowerCase() === candidate.toLowerCase()\n );\n if (found) {\n fieldSet.add(found.Name);\n }\n }\n }\n\n if (!relatedEntity?.Fields?.length || relatedEntity.Fields.some(f => f.Name === '__mj_UpdatedAt')) {\n fieldSet.add('__mj_UpdatedAt');\n }\n\n if (relatedEntity?.Fields?.length) {\n for (const candidate of ['Status', 'Type', 'Role']) {\n const found = relatedEntity.Fields.find(\n f => f.Name.toLowerCase() === candidate.toLowerCase()\n );\n if (found) {\n fieldSet.add(found.Name);\n }\n }\n }\n\n return Array.from(fieldSet);\n }\n\n private buildBatchWhereClauseForKeys(pks: CompositeKey[]): string {\n const clauses: string[] = [];\n for (const pkRaw of pks) {\n const pk = pkRaw as (CompositeKey & { WhereClause?: () => string }) | undefined;\n if (!pk) {\n continue;\n }\n const wc =\n typeof pk.ToWhereClause === 'function'\n ? pk.ToWhereClause()\n : typeof pk.WhereClause === 'function'\n ? pk.WhereClause()\n : '';\n if (wc && wc.trim().length > 0) {\n clauses.push(`(${wc})`);\n continue;\n }\n if (Array.isArray(pk.KeyValuePairs) && pk.KeyValuePairs.length > 0) {\n const parts = pk.KeyValuePairs.map(\n kv => `[${kv.FieldName}] = '${String(kv.Value).replace(/'/g, \"''\")}'`\n );\n clauses.push(`(${parts.join(' AND ')})`);\n }\n }\n return clauses.join(' OR ');\n }\n\n private findMatchingRow(\n rows: Record<string, unknown>[],\n primaryKey: CompositeKey\n ): Record<string, unknown> | undefined {\n const kvPairs = primaryKey?.KeyValuePairs ?? [];\n if (kvPairs.length === 0 || rows.length === 0) {\n return undefined;\n }\n return rows.find(row =>\n kvPairs.every(kv => {\n const rowVal = row[kv.FieldName];\n if (rowVal === undefined || rowVal === null) {\n return false;\n }\n return String(rowVal).trim().toLowerCase() === String(kv.Value).trim().toLowerCase();\n })\n );\n }\n\n private resolveRecordDisplayName(\n row: Record<string, unknown> | undefined,\n relatedEntity: EntityInfo | undefined,\n entityDisplayName: string,\n primaryKey: CompositeKey\n ): string {\n if (row) {\n const nameFieldName = relatedEntity?.NameField?.Name;\n if (nameFieldName && row[nameFieldName] !== undefined && row[nameFieldName] !== null && String(row[nameFieldName]).trim() !== '') {\n const candidateName = String(row[nameFieldName]).trim();\n if (!this.isRawUuid(candidateName)) {\n return candidateName;\n }\n }\n for (const candidate of ['Name', 'Title', 'Subject', 'DisplayName']) {\n const val = row[candidate];\n if (val !== undefined && val !== null && String(val).trim() !== '') {\n const candidateName = String(val).trim();\n if (!this.isRawUuid(candidateName)) {\n return candidateName;\n }\n }\n }\n }\n const pkValue = primaryKey?.KeyValuePairs?.[0]?.Value;\n if (pkValue !== undefined && pkValue !== null && String(pkValue).trim() !== '') {\n const rawPk = String(pkValue).trim();\n if (this.isRawUuid(rawPk)) {\n return `${entityDisplayName} · ${rawPk.slice(0, 6)}…${rawPk.slice(-4)}`;\n }\n return `${entityDisplayName} #${rawPk}`;\n }\n return entityDisplayName;\n }\n\n private isRawUuid(value: string): boolean {\n return /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(value.trim());\n }\n\n private resolveRelationshipLabel(\n dep: RecordDependency,\n relatedEntity: EntityInfo | undefined\n ): string {\n const depWithDisplay = dep as RecordDependency & { FieldDisplayName?: string };\n if (depWithDisplay.FieldDisplayName && depWithDisplay.FieldDisplayName.trim().length > 0) {\n return depWithDisplay.FieldDisplayName.trim();\n }\n const fieldInfo = relatedEntity?.Fields?.find(\n f => f.Name.trim().toLowerCase() === dep.FieldName.trim().toLowerCase()\n );\n if (fieldInfo?.DisplayNameOrName && fieldInfo.DisplayNameOrName.trim().length > 0) {\n const label = fieldInfo.DisplayNameOrName.trim();\n if (label.toLowerCase() !== 'record id' && label.toLowerCase() !== 'recordid') {\n return label;\n }\n return 'Linked Record';\n }\n return this.humanizeFieldName(dep.FieldName);\n }\n\n private humanizeFieldName(fieldName: string): string {\n if (!fieldName) {\n return 'Linked Record';\n }\n const trimmed = fieldName.trim();\n if (trimmed.toLowerCase() === 'recordid' || trimmed.toLowerCase() === 'record id') {\n return 'Linked Record';\n }\n const withoutId = trimmed.replace(/\\s*ID$/i, '');\n const spaced = withoutId.replace(/([a-z0-9])([A-Z])/g, '$1 $2').trim();\n return spaced.length > 0 ? spaced : 'Linked Record';\n }\n\n private resolveStatusLabel(\n row: Record<string, unknown> | undefined,\n relatedEntity: EntityInfo | undefined\n ): string {\n if (!row) {\n return '';\n }\n for (const candidate of ['Status', 'Type', 'Role']) {\n const fieldName =\n relatedEntity?.Fields?.find(f => f.Name.toLowerCase() === candidate.toLowerCase())?.Name ??\n candidate;\n const val = row[fieldName];\n if (val !== undefined && val !== null && String(val).trim() !== '') {\n return String(val).trim();\n }\n }\n return '';\n }\n\n private resolveFormattedDate(row: Record<string, unknown> | undefined): string {\n if (!row) {\n return '';\n }\n const raw = row['__mj_UpdatedAt'];\n if (!raw) {\n return '';\n }\n const date = raw instanceof Date ? raw : new Date(String(raw));\n if (isNaN(date.getTime())) {\n return '';\n }\n return date.toLocaleDateString(undefined, {\n month: 'short',\n day: 'numeric',\n year: 'numeric'\n });\n }\n\n private getPrimaryKeyString(primaryKey: CompositeKey | undefined | null): string {\n return MjRecordLinksComponent.getPrimaryKeyStringStatic(primaryKey);\n }\n}\n","@if (Mode === 'drawer') {\n @if (IsOpen) {\n <div class=\"mj-links-backdrop\" (click)=\"OnClose()\"></div>\n <aside class=\"mj-links-drawer\" role=\"dialog\" aria-label=\"Links\">\n <div class=\"mj-links-drawer__header\">\n <div class=\"mj-links-drawer__title-group\">\n <span class=\"mj-links-drawer__icon\">\n <i class=\"fa-solid fa-link\"></i>\n </span>\n <div class=\"mj-links-drawer__titles\">\n <h3 class=\"mj-links-drawer__title\">\n Links\n @if (TotalLinkCount > 0) {\n <span class=\"mj-links-drawer__count\">{{ TotalLinkCount }}</span>\n }\n </h3>\n <span class=\"mj-links-drawer__subtitle\">Connected records across your workspace</span>\n </div>\n </div>\n <div class=\"mj-links-drawer__header-actions\">\n <button\n type=\"button\"\n class=\"mj-links-icon-btn\"\n title=\"Refresh links\"\n aria-label=\"Refresh links\"\n [disabled]=\"IsLoading\"\n (click)=\"LoadLinks(true)\">\n <i class=\"fa-solid fa-arrows-rotate\" [class.fa-spin]=\"IsLoading\"></i>\n </button>\n <button\n type=\"button\"\n class=\"mj-links-icon-btn\"\n title=\"Close Links panel\"\n aria-label=\"Close Links panel\"\n (click)=\"OnClose()\">\n <i class=\"fa-solid fa-xmark\"></i>\n </button>\n </div>\n </div>\n <div class=\"mj-links-drawer__body\">\n <ng-container *ngTemplateOutlet=\"linksContentTpl\"></ng-container>\n </div>\n </aside>\n }\n} @else {\n <div class=\"mj-links-widget\">\n <ng-container *ngTemplateOutlet=\"linksContentTpl\"></ng-container>\n </div>\n}\n\n<ng-template #linksContentTpl>\n <!-- Search, Direction Tabs & Collapsible Filter Bar -->\n <div class=\"mj-links-controls\">\n @if (!IsLoading && TotalLinkCount > 0) {\n <div class=\"mj-links-direction-tabs\" role=\"tablist\" aria-label=\"Link direction filter\">\n <button\n type=\"button\"\n class=\"mj-links-direction-tab\"\n [class.mj-links-direction-tab--active]=\"DirectionFilter === 'all'\"\n (click)=\"SetDirectionFilter('all')\">\n <span>All</span>\n <span class=\"mj-links-direction-tab__count\">{{ TotalLinkCount }}</span>\n </button>\n <button\n type=\"button\"\n class=\"mj-links-direction-tab\"\n [class.mj-links-direction-tab--active]=\"DirectionFilter === 'outgoing'\"\n (click)=\"SetDirectionFilter('outgoing')\"\n title=\"Records referenced by fields on this record\">\n <i class=\"fa-solid fa-arrow-up-right-from-square\" aria-hidden=\"true\"></i>\n <span>On This Record</span>\n <span class=\"mj-links-direction-tab__count\">{{ OutgoingLinkCount }}</span>\n </button>\n <button\n type=\"button\"\n class=\"mj-links-direction-tab\"\n [class.mj-links-direction-tab--active]=\"DirectionFilter === 'incoming'\"\n (click)=\"SetDirectionFilter('incoming')\"\n title=\"Other records that reference this record\">\n <i class=\"fa-solid fa-arrow-turn-up\" aria-hidden=\"true\"></i>\n <span>Linked To This</span>\n <span class=\"mj-links-direction-tab__count\">{{ IncomingLinkCount }}</span>\n </button>\n </div>\n }\n\n <div class=\"mj-links-search-row\">\n <div class=\"mj-links-search\">\n <i class=\"fa-solid fa-magnifying-glass mj-links-search__icon\"></i>\n <input\n type=\"text\"\n class=\"mj-links-search__input\"\n placeholder=\"Search linked records...\"\n aria-label=\"Search linked records\"\n [value]=\"SearchText\"\n (input)=\"OnSearchInput($event)\" />\n @if (SearchText) {\n <button\n type=\"button\"\n class=\"mj-links-search__clear\"\n title=\"Clear search\"\n aria-label=\"Clear search\"\n (click)=\"ClearSearch()\">\n <i class=\"fa-solid fa-xmark\"></i>\n </button>\n }\n </div>\n <button\n type=\"button\"\n class=\"mj-links-filter-toggle\"\n [class.mj-links-filter-toggle--active]=\"ShowFilterPanel || LinkFilter !== 'both'\"\n [attr.aria-expanded]=\"ShowFilterPanel\"\n title=\"Filter by link type\"\n (click)=\"ToggleFilterPanel()\">\n <i class=\"fa-solid fa-sliders\"></i>\n <span>Filter</span>\n @if (LinkFilter !== 'both') {\n <span class=\"mj-links-filter-toggle__dot\"></span>\n }\n </button>\n </div>\n\n <!-- Collapsible Link Type Filter Panel -->\n @if (ShowFilterPanel) {\n <div class=\"mj-links-filter-panel\">\n <div class=\"mj-links-filter-panel__label\">Link Type</div>\n <div class=\"mj-links-filter-options\" role=\"radiogroup\" aria-label=\"Link Type\">\n <button\n type=\"button\"\n class=\"mj-links-filter-option\"\n [class.mj-links-filter-option--active]=\"LinkFilter === 'both'\"\n (click)=\"SetLinkFilter('both')\">\n <span>All Links</span>\n <span class=\"mj-links-filter-option__count\">{{ TotalLinkCount }}</span>\n </button>\n <button\n type=\"button\"\n class=\"mj-links-filter-option\"\n [class.mj-links-filter-option--active]=\"LinkFilter === 'soft'\"\n (click)=\"SetLinkFilter('soft')\">\n <i class=\"fa-solid fa-diagram-project\"></i>\n <span>Cross-App Links</span>\n <span class=\"mj-links-filter-option__count\">{{ CrossAppLinkCount }}</span>\n </button>\n <button\n type=\"button\"\n class=\"mj-links-filter-option\"\n [class.mj-links-filter-option--active]=\"LinkFilter === 'hard'\"\n (click)=\"SetLinkFilter('hard')\">\n <i class=\"fa-solid fa-link\"></i>\n <span>Direct Relationships</span>\n <span class=\"mj-links-filter-option__count\">{{ DirectRelationshipCount }}</span>\n </button>\n </div>\n </div>\n }\n\n <!-- Top Category Chips -->\n @if (!IsLoading && TotalLinkCount > 0) {\n <div class=\"mj-links-chips\" role=\"tablist\" aria-label=\"Linked record categories\">\n @for (chip of CategoryChips; track chip.EntityName ?? '__all__') {\n <button\n type=\"button\"\n class=\"mj-links-chip\"\n [class.mj-links-chip--active]=\"SelectedEntityName === chip.EntityName\"\n (click)=\"SelectCategoryChip(chip.EntityName)\">\n <i [class]=\"chip.Icon\"></i>\n <span class=\"mj-links-chip__label\">{{ chip.Label }}</span>\n <span class=\"mj-links-chip__count\">({{ chip.Count }})</span>\n </button>\n }\n </div>\n }\n </div>\n\n <!-- Main Content States -->\n @if (IsLoading) {\n <div class=\"mj-links-state\">\n <i class=\"fa-solid fa-spinner fa-spin mj-links-state__spinner\"></i>\n <span>Loading linked records...</span>\n </div>\n } @else if (ErrorMessage) {\n <div class=\"mj-links-state mj-links-state--error\">\n <i class=\"fa-solid fa-circle-exclamation\"></i>\n <span>{{ ErrorMessage }}</span>\n </div>\n } @else if (TotalLinkCount === 0) {\n <div class=\"mj-links-state mj-links-state--empty\">\n <div class=\"mj-links-state__icon\">\n <i class=\"fa-solid fa-link-slash\"></i>\n </div>\n <div class=\"mj-links-state__title\">No linked records yet</div>\n <div class=\"mj-links-state__desc\">\n Records across your workspace that reference this item or are linked on this record will appear here automatically.\n </div>\n </div>\n } @else if (FilteredGroups.length === 0) {\n <div class=\"mj-links-state mj-links-state--empty\">\n <div class=\"mj-links-state__icon\">\n <i class=\"fa-solid fa-filter-circle-xmark\"></i>\n </div>\n <div class=\"mj-links-state__title\">No matching links</div>\n <div class=\"mj-links-state__desc\">\n No linked records match \"{{ SearchText || ActiveLinkFilterLabel }}\".\n </div>\n <button type=\"button\" class=\"mj-links-reset-btn\" (click)=\"ResetFilters()\">\n Reset filters\n </button>\n </div>\n } @else {\n <div class=\"mj-links-groups\">\n @for (group of FilteredGroups; track group.EntityName) {\n <section class=\"mj-links-group\">\n <header class=\"mj-links-group__header\">\n <div class=\"mj-links-group__title\">\n <i [class]=\"group.EntityIcon + ' mj-links-group__icon'\"></i>\n <span>{{ group.EntityDisplayName }}</span>\n </div>\n <span class=\"mj-links-group__badge\">{{ group.Items.length }}</span>\n </header>\n <div class=\"mj-links-group__items\">\n @for (item of group.Items; track item.TrackKey) {\n <div class=\"mj-links-card-row\">\n <button\n type=\"button\"\n class=\"mj-links-card\"\n [mjRecordLink]=\"Record\"\n [FieldName]=\"item.Direction === 'outgoing' ? (item.SourceFieldName ?? null) : null\"\n [EntityName]=\"item.EntityName\"\n [PrimaryKey]=\"item.PrimaryKey\"\n [DisplayName]=\"item.DisplayName\"\n [Provider]=\"ProviderToUse\"\n (Navigate)=\"OnItemNavigate(item, $event)\"\n (RecordUpdated)=\"OnItemQuickEdited(item, $event)\">\n <div class=\"mj-links-card__main\">\n <div class=\"mj-links-card__title-row\">\n <span class=\"mj-links-card__title\">{{ item.DisplayName }}</span>\n @if (item.StatusLabel) {\n <span class=\"mj-links-card__status\">{{ item.StatusLabel }}</span>\n }\n </div>\n <div class=\"mj-links-card__meta\">\n <span class=\"mj-links-card__direction-pill\" [class.mj-links-card__direction-pill--outgoing]=\"item.Direction === 'outgoing'\">\n <i [class]=\"item.Direction === 'outgoing' ? 'fa-solid fa-arrow-up-right-from-square' : 'fa-solid fa-arrow-turn-up'\" aria-hidden=\"true\"></i>\n {{ item.DirectionLabel }}\n </span>\n <span class=\"mj-links-card__relationship\">\n <i [class]=\"item.IsSoftLink ? 'fa-solid fa-diagram-project' : 'fa-solid fa-link'\"></i>\n {{ item.RelationshipLabel }}\n </span>\n <span class=\"mj-links-card__type-pill\" [class.mj-links-card__type-pill--soft]=\"item.IsSoftLink\">\n {{ item.LinkTypeLabel }}\n </span>\n @if (item.FormattedDate) {\n <span class=\"mj-links-card__date\">{{ item.FormattedDate }}</span>\n }\n </div>\n </div>\n <i class=\"fa-solid fa-chevron-right mj-links-card__chevron\"></i>\n </button>\n @if (AllowQuickUnlink && item.CanUnlink) {\n <button\n type=\"button\"\n class=\"mj-links-card__unlink-btn\"\n [disabled]=\"UnlinkingTrackKey === item.TrackKey\"\n [attr.aria-label]=\"'Unlink ' + item.DisplayName\"\n (click)=\"OnUnlinkItem(item, $event)\">\n <i [class]=\"UnlinkingTrackKey === item.TrackKey ? 'fa-solid fa-circle-notch fa-spin' : 'fa-solid fa-link-slash'\" aria-hidden=\"true\"></i>\n </button>\n }\n </div>\n }\n </div>\n </section>\n }\n </div>\n }\n</ng-template>\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-field-panel-slot.component.d.ts","sourceRoot":"","sources":["../../../src/lib/panel-slot/form-field-panel-slot.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAIH,SAAS,EACT,SAAS,EACT,MAAM,EACN,aAAa,EAIhB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,UAAU,EAAY,MAAM,sBAAsB,CAAC;AAE5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;;AAclD;;;;;;;;;;;;;;GAcG;AACH,qBAMa,2BAA4B,YAAW,MAAM,EAAE,SAAS,EAAE,SAAS;IAC5E,oCAAoC;IAC3B,MAAM,EAAG,MAAM,CAAC;IACzB,6EAA6E;IACpE,UAAU,EAAE,SAAS,MAAM,EAAE,CAAM;IAC5C,2EAA2E;IAClE,UAAU,SAAM;IACzB,mDAAmD;IAC1C,QAAQ,EAAE,OAAO,GAAG,KAAK,CAAW;IAC7C,wEAAwE;IAC/D,MAAM,EAAG,UAAU,CAAC;IAC7B,+BAA+B;IACtB,aAAa,EAAG,iBAAiB,CAAC;IAC3C,6BAA6B;IACpB,WAAW,CAAC,EAAE,WAAW,CAAC;IAGnC,OAAO,CAAC,MAAM,CAAoB;IAElC,OAAO,CAAC,OAAO,CAAqC;IACpD,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAuB;IAChD,OAAO,CAAC,QAAQ,CAAC,aAAa,CAA4D;IAC1F,4FAA4F;IAC5F,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAsD;IAC9E,mFAAmF;IACnF,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAmD;IAElE,QAAQ,IAAI,IAAI;
|
|
1
|
+
{"version":3,"file":"form-field-panel-slot.component.d.ts","sourceRoot":"","sources":["../../../src/lib/panel-slot/form-field-panel-slot.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAIH,SAAS,EACT,SAAS,EACT,MAAM,EACN,aAAa,EAIhB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,UAAU,EAAY,MAAM,sBAAsB,CAAC;AAE5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;;AAclD;;;;;;;;;;;;;;GAcG;AACH,qBAMa,2BAA4B,YAAW,MAAM,EAAE,SAAS,EAAE,SAAS;IAC5E,oCAAoC;IAC3B,MAAM,EAAG,MAAM,CAAC;IACzB,6EAA6E;IACpE,UAAU,EAAE,SAAS,MAAM,EAAE,CAAM;IAC5C,2EAA2E;IAClE,UAAU,SAAM;IACzB,mDAAmD;IAC1C,QAAQ,EAAE,OAAO,GAAG,KAAK,CAAW;IAC7C,wEAAwE;IAC/D,MAAM,EAAG,UAAU,CAAC;IAC7B,+BAA+B;IACtB,aAAa,EAAG,iBAAiB,CAAC;IAC3C,6BAA6B;IACpB,WAAW,CAAC,EAAE,WAAW,CAAC;IAGnC,OAAO,CAAC,MAAM,CAAoB;IAElC,OAAO,CAAC,OAAO,CAAqC;IACpD,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAuB;IAChD,OAAO,CAAC,QAAQ,CAAC,aAAa,CAA4D;IAC1F,4FAA4F;IAC5F,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAsD;IAC9E,mFAAmF;IACnF,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAmD;IAElE,QAAQ,IAAI,IAAI;IAoBhB,WAAW,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI;IAazC,WAAW,IAAI,IAAI;IAM1B;;;;;OAKG;IACH,OAAO,CAAC,OAAO;IAsBf;;;;;;OAMG;IACH,OAAO,CAAC,eAAe;IAwBvB,OAAO,CAAC,UAAU;yCA7HT,2BAA2B;2CAA3B,2BAA2B;CAkIvC"}
|
|
@@ -50,8 +50,10 @@ export class FormFieldPanelSlotComponent {
|
|
|
50
50
|
slots = inject(FormSlotCoordinator, { optional: true });
|
|
51
51
|
ngOnInit() {
|
|
52
52
|
this.recordRefresh?.Refreshed$.pipe(takeUntil(this.destroy$)).subscribe((record) => {
|
|
53
|
-
for (const ref of this.mounted)
|
|
53
|
+
for (const ref of this.mounted) {
|
|
54
54
|
ref.instance.OnRecordRefreshed(record);
|
|
55
|
+
ref.changeDetectorRef.detectChanges();
|
|
56
|
+
}
|
|
55
57
|
});
|
|
56
58
|
// The engine's subject replays the current rows on subscribe, which ngOnChanges has
|
|
57
59
|
// already mounted.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-field-panel-slot.component.js","sourceRoot":"","sources":["../../../src/lib/panel-slot/form-field-panel-slot.component.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,SAAS,EAET,KAAK,EAKL,SAAS,EACT,gBAAgB,EAChB,MAAM,GACT,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAChD,OAAO,EAAc,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAIvE,OAAO,EACH,2BAA2B,EAC3B,kBAAkB,EAClB,8BAA8B,GAEjC,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,oCAAoC,EAAE,MAAM,2CAA2C,CAAC;AACjG,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,4BAA4B,EAAE,MAAM,oCAAoC,CAAC;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O,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;YAC1B,MAAM,KAAK,GAAG,CAAC,CAAC,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;YACtC,MAAM,KAAK,GAAG,CAAC,CAAC,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;YACtC,IAAI,KAAK,KAAK,KAAK;gBAAE,OAAO,KAAK,GAAG,KAAK,CAAC;YAC1C,OAAO,CAAC,CAAC,QAAQ,GAAG,CAAC,CAAC,QAAQ,CAAC;QACnC,CAAC,CAAC,CAAC;IACP,CAAC;IAEO,UAAU;QACd,KAAK,MAAM,GAAG,IAAI,IAAI,CAAC,OAAO;YAAE,IAAI,CAAC,aAAa,EAAE,mBAAmB,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QACxF,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;QACpB,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;IACtB,CAAC;qHA9HQ,2BAA2B;6DAA3B,2BAA2B;mCAgBP,gBAAgB;;;;;YAnBlC,iCAAqC;;;iFAGvC,2BAA2B;cANvC,SAAS;6BACM,KAAK,YACP,0BAA0B,YAC1B,uCAAuC;;kBAKhD,KAAK;;kBAEL,KAAK;;kBAEL,KAAK;;kBAEL,KAAK;;kBAEL,KAAK;;kBAEL,KAAK;;kBAEL,KAAK;;kBAEL,SAAS;mBAAC,QAAQ,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE,MAAM,EAAE,IAAI,EAAE;;kFAhBpD,2BAA2B","sourcesContent":["import {\n Component,\n ComponentRef,\n Input,\n OnChanges,\n OnDestroy,\n OnInit,\n SimpleChanges,\n ViewChild,\n ViewContainerRef,\n inject,\n} from '@angular/core';\nimport { Subject, skip, takeUntil } from 'rxjs';\nimport { BaseEntity, LogError } from '@memberjunction/core';\nimport { InteractiveFormsEngine } from '@memberjunction/core-entities';\nimport { BaseFormComponent } from '../base-form-component';\nimport { FormContext } from '../types/form-types';\nimport { BaseFormPanel } from './base-form-panel';\nimport {\n ContributionSectionPosition,\n PlacedInSectionKey,\n ResolveFormContributionWinners,\n type FormContributionRegistration,\n} from './form-contribution';\nimport { CollectFormContributionRegistrations } from './collect-form-contribution-registrations';\nimport { FORM_PLACEMENT_PREVIEW } from './placement-preview';\nimport { MountFormContribution } from './mount-form-contribution';\nimport { FormRecordRefreshCoordinator } from '../form-record-refresh.coordinator';\nimport { FormSlotCoordinator } from './form-slot-coordinator.service';\n\n/**\n * `<mj-form-field-panel-slot>` — mounts the contributions drawn inside a section.\n *\n * Two kinds: a contribution that stands in for some of the section's fields, and one placed in\n * the section by its key without replacing anything. Either belongs inside the section, so it\n * reads as part of it rather than as a separate card elsewhere on the form.\n * `<mj-collapsible-panel>` renders two of these, one above its projected content and one below,\n * and each mounts the contributions whose `sectionPosition` matches it. A claimed field stops\n * drawing, which `FormContext.claimedFieldNames` handles.\n *\n * Distinct from `<mj-form-panel-slot>`, which selects by slot position. This one selects by\n * field, and its position is wherever the section is — there is no slot involved and no\n * fallback chain, because a claim on a field the form does not draw is simply not matched\n * by any section.\n */\n@Component({\n standalone: false,\n selector: 'mj-form-field-panel-slot',\n template: `<ng-container #anchor></ng-container>`,\n styles: [`:host { display: contents; }`],\n})\nexport class FormFieldPanelSlotComponent implements OnInit, OnChanges, OnDestroy {\n /** The entity name being edited. */\n @Input() Entity!: string;\n /** The fields this section draws — the set a contribution may claim from. */\n @Input() FieldNames: readonly string[] = [];\n /** The section's key, which a contribution placed in the section names. */\n @Input() SectionKey = '';\n /** Which end of the section this host draws at. */\n @Input() Position: 'start' | 'end' = 'start';\n /** The record being edited, threaded through to every mounted panel. */\n @Input() Record!: BaseEntity;\n /** The host form component. */\n @Input() FormComponent!: BaseFormComponent;\n /** Optional form context. */\n @Input() FormContext?: FormContext;\n\n @ViewChild('anchor', { read: ViewContainerRef, static: true })\n private anchor!: ViewContainerRef;\n\n private mounted: ComponentRef<BaseFormPanel>[] = [];\n private readonly destroy$ = new Subject<void>();\n private readonly recordRefresh = inject(FormRecordRefreshCoordinator, { optional: true });\n /** The placement dialog's unsaved panel, when this slot is on the dialog's preview form. */\n private readonly preview = inject(FORM_PLACEMENT_PREVIEW, { optional: true });\n /** The form's slot coordinator, which says when the user hid or showed a panel. */\n private readonly slots = inject(FormSlotCoordinator, { optional: true });\n\n public ngOnInit(): void {\n this.recordRefresh?.Refreshed$.pipe(takeUntil(this.destroy$)).subscribe((record) => {\n for (const ref of this.mounted) ref.instance.OnRecordRefreshed(record);\n });\n // The engine's subject replays the current rows on subscribe, which ngOnChanges has\n // already mounted.\n try {\n InteractiveFormsEngine.Instance.Contributions$\n .pipe(skip(1), takeUntil(this.destroy$))\n .subscribe(() => this.remount());\n } catch {\n // No engine here — compiled registrations are the only source.\n }\n this.preview?.Changed$.pipe(takeUntil(this.destroy$)).subscribe(() => this.remount());\n this.slots?.PanelsChanged.pipe(takeUntil(this.destroy$)).subscribe(() => this.remount());\n }\n\n public ngOnChanges(changes: SimpleChanges): void {\n if (!this.Entity || !this.Record || !this.FormComponent) return;\n const structural = ['Entity', 'FieldNames', 'SectionKey', 'Position', 'Record', 'FormComponent'];\n const changed = structural.some((k) => changes[k] && changes[k].currentValue !== changes[k].previousValue);\n if (!changed && this.mounted.length > 0) {\n if (changes['FormContext']) {\n for (const ref of this.mounted) ref.instance.FormContext = this.FormContext;\n }\n return;\n }\n this.remount();\n }\n\n public ngOnDestroy(): void {\n this.destroy$.next();\n this.destroy$.complete();\n this.unmountAll();\n }\n\n /**\n * Registrations claiming one of this section's fields, mounted in place.\n *\n * A form that renders its own body composes nothing, so the check the slot host makes\n * applies here for the same reason.\n */\n private remount(): void {\n this.unmountAll();\n if (this.FormComponent?.OwnsEntireFormBody) return;\n const claims = this.claimsForFields();\n if (claims.length === 0) return;\n\n for (const reg of claims) {\n try {\n const ref = MountFormContribution(this.anchor, reg);\n if (!ref) continue;\n ref.instance.Record = this.Record;\n ref.instance.FormComponent = this.FormComponent;\n ref.instance.RegistrationMetadata = reg.Metadata;\n if (this.FormContext) ref.instance.FormContext = this.FormContext;\n this.FormComponent?.RegisterFormPanel?.(ref.instance);\n this.mounted.push(ref);\n } catch (e) {\n LogError(`[mj-form-field-panel-slot] Failed to mount a panel on ${this.Entity}: ${e instanceof Error ? e.message : String(e)}`);\n }\n }\n }\n\n /**\n * The form's winning registrations drawn at this end of this section, highest sort first:\n * those standing in for a field the section draws, and those placed in the section by its\n * key ({@link PlacedInSectionKey}, which ignores a wildcard's place). The collapse runs once\n * over every registration on the form, so a key a row took from a compiled panel draws where\n * the row says.\n */\n private claimsForFields(): FormContributionRegistration[] {\n const fields = new Set(this.FieldNames.filter((name) => !!name));\n const sectionKey = this.SectionKey.trim();\n if (fields.size === 0 && !sectionKey) return [];\n const all = CollectFormContributionRegistrations(\n this.Record?.EntityInfo ?? null, this.FormComponent?.ProviderToUse ?? null, { Preview: this.preview });\n // A field claim belongs to this section when any of its fields is one this section draws.\n // Any, not every: a claim naming a field the form stopped drawing still belongs where its\n // remaining fields are, and dropping it there would leave the panel nowhere while its\n // other fields stayed hidden.\n const matching = ResolveFormContributionWinners(this.Entity, all).Winners.filter((reg) => {\n if (ContributionSectionPosition(reg.Metadata) !== this.Position) return false;\n if (sectionKey && PlacedInSectionKey(reg.Metadata) === sectionKey) return true;\n const claimed = reg.Metadata.replacesFieldNames ?? [];\n return claimed.some((name) => fields.has(name.trim()));\n });\n return matching.sort((a, b) => {\n const aSort = a.Metadata.sortKey ?? 0;\n const bSort = b.Metadata.sortKey ?? 0;\n if (aSort !== bSort) return bSort - aSort;\n return b.Priority - a.Priority;\n });\n }\n\n private unmountAll(): void {\n for (const ref of this.mounted) this.FormComponent?.UnregisterFormPanel?.(ref.instance);\n this.anchor.clear();\n this.mounted = [];\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"form-field-panel-slot.component.js","sourceRoot":"","sources":["../../../src/lib/panel-slot/form-field-panel-slot.component.ts"],"names":[],"mappings":"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AAO,GAAG,EAAE,CAAC;IACtB,CAAC;qHAjIQ,2BAA2B;6DAA3B,2BAA2B;mCAgBP,gBAAgB;;;;;YAnBlC,iCAAqC;;;iFAGvC,2BAA2B;cANvC,SAAS;6BACM,KAAK,YACP,0BAA0B,YAC1B,uCAAuC;;kBAKhD,KAAK;;kBAEL,KAAK;;kBAEL,KAAK;;kBAEL,KAAK;;kBAEL,KAAK;;kBAEL,KAAK;;kBAEL,KAAK;;kBAEL,SAAS;mBAAC,QAAQ,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE,MAAM,EAAE,IAAI,EAAE;;kFAhBpD,2BAA2B","sourcesContent":["import {\n Component,\n ComponentRef,\n Input,\n OnChanges,\n OnDestroy,\n OnInit,\n SimpleChanges,\n ViewChild,\n ViewContainerRef,\n inject,\n} from '@angular/core';\nimport { Subject, skip, takeUntil } from 'rxjs';\nimport { BaseEntity, LogError } from '@memberjunction/core';\nimport { InteractiveFormsEngine } from '@memberjunction/core-entities';\nimport { BaseFormComponent } from '../base-form-component';\nimport { FormContext } from '../types/form-types';\nimport { BaseFormPanel } from './base-form-panel';\nimport {\n ContributionSectionPosition,\n PlacedInSectionKey,\n ResolveFormContributionWinners,\n type FormContributionRegistration,\n} from './form-contribution';\nimport { CollectFormContributionRegistrations } from './collect-form-contribution-registrations';\nimport { FORM_PLACEMENT_PREVIEW } from './placement-preview';\nimport { MountFormContribution } from './mount-form-contribution';\nimport { FormRecordRefreshCoordinator } from '../form-record-refresh.coordinator';\nimport { FormSlotCoordinator } from './form-slot-coordinator.service';\n\n/**\n * `<mj-form-field-panel-slot>` — mounts the contributions drawn inside a section.\n *\n * Two kinds: a contribution that stands in for some of the section's fields, and one placed in\n * the section by its key without replacing anything. Either belongs inside the section, so it\n * reads as part of it rather than as a separate card elsewhere on the form.\n * `<mj-collapsible-panel>` renders two of these, one above its projected content and one below,\n * and each mounts the contributions whose `sectionPosition` matches it. A claimed field stops\n * drawing, which `FormContext.claimedFieldNames` handles.\n *\n * Distinct from `<mj-form-panel-slot>`, which selects by slot position. This one selects by\n * field, and its position is wherever the section is — there is no slot involved and no\n * fallback chain, because a claim on a field the form does not draw is simply not matched\n * by any section.\n */\n@Component({\n standalone: false,\n selector: 'mj-form-field-panel-slot',\n template: `<ng-container #anchor></ng-container>`,\n styles: [`:host { display: contents; }`],\n})\nexport class FormFieldPanelSlotComponent implements OnInit, OnChanges, OnDestroy {\n /** The entity name being edited. */\n @Input() Entity!: string;\n /** The fields this section draws — the set a contribution may claim from. */\n @Input() FieldNames: readonly string[] = [];\n /** The section's key, which a contribution placed in the section names. */\n @Input() SectionKey = '';\n /** Which end of the section this host draws at. */\n @Input() Position: 'start' | 'end' = 'start';\n /** The record being edited, threaded through to every mounted panel. */\n @Input() Record!: BaseEntity;\n /** The host form component. */\n @Input() FormComponent!: BaseFormComponent;\n /** Optional form context. */\n @Input() FormContext?: FormContext;\n\n @ViewChild('anchor', { read: ViewContainerRef, static: true })\n private anchor!: ViewContainerRef;\n\n private mounted: ComponentRef<BaseFormPanel>[] = [];\n private readonly destroy$ = new Subject<void>();\n private readonly recordRefresh = inject(FormRecordRefreshCoordinator, { optional: true });\n /** The placement dialog's unsaved panel, when this slot is on the dialog's preview form. */\n private readonly preview = inject(FORM_PLACEMENT_PREVIEW, { optional: true });\n /** The form's slot coordinator, which says when the user hid or showed a panel. */\n private readonly slots = inject(FormSlotCoordinator, { optional: true });\n\n public ngOnInit(): void {\n this.recordRefresh?.Refreshed$.pipe(takeUntil(this.destroy$)).subscribe((record) => {\n for (const ref of this.mounted) {\n ref.instance.OnRecordRefreshed(record);\n ref.changeDetectorRef.detectChanges();\n }\n });\n // The engine's subject replays the current rows on subscribe, which ngOnChanges has\n // already mounted.\n try {\n InteractiveFormsEngine.Instance.Contributions$\n .pipe(skip(1), takeUntil(this.destroy$))\n .subscribe(() => this.remount());\n } catch {\n // No engine here — compiled registrations are the only source.\n }\n this.preview?.Changed$.pipe(takeUntil(this.destroy$)).subscribe(() => this.remount());\n this.slots?.PanelsChanged.pipe(takeUntil(this.destroy$)).subscribe(() => this.remount());\n }\n\n public ngOnChanges(changes: SimpleChanges): void {\n if (!this.Entity || !this.Record || !this.FormComponent) return;\n const structural = ['Entity', 'FieldNames', 'SectionKey', 'Position', 'Record', 'FormComponent'];\n const changed = structural.some((k) => changes[k] && changes[k].currentValue !== changes[k].previousValue);\n if (!changed && this.mounted.length > 0) {\n if (changes['FormContext']) {\n for (const ref of this.mounted) ref.instance.FormContext = this.FormContext;\n }\n return;\n }\n this.remount();\n }\n\n public ngOnDestroy(): void {\n this.destroy$.next();\n this.destroy$.complete();\n this.unmountAll();\n }\n\n /**\n * Registrations claiming one of this section's fields, mounted in place.\n *\n * A form that renders its own body composes nothing, so the check the slot host makes\n * applies here for the same reason.\n */\n private remount(): void {\n this.unmountAll();\n if (this.FormComponent?.OwnsEntireFormBody) return;\n const claims = this.claimsForFields();\n if (claims.length === 0) return;\n\n for (const reg of claims) {\n try {\n const ref = MountFormContribution(this.anchor, reg);\n if (!ref) continue;\n ref.instance.Record = this.Record;\n ref.instance.FormComponent = this.FormComponent;\n ref.instance.RegistrationMetadata = reg.Metadata;\n if (this.FormContext) ref.instance.FormContext = this.FormContext;\n this.FormComponent?.RegisterFormPanel?.(ref.instance);\n this.mounted.push(ref);\n } catch (e) {\n LogError(`[mj-form-field-panel-slot] Failed to mount a panel on ${this.Entity}: ${e instanceof Error ? e.message : String(e)}`);\n }\n }\n }\n\n /**\n * The form's winning registrations drawn at this end of this section, highest sort first:\n * those standing in for a field the section draws, and those placed in the section by its\n * key ({@link PlacedInSectionKey}, which ignores a wildcard's place). The collapse runs once\n * over every registration on the form, so a key a row took from a compiled panel draws where\n * the row says.\n */\n private claimsForFields(): FormContributionRegistration[] {\n const fields = new Set(this.FieldNames.filter((name) => !!name));\n const sectionKey = this.SectionKey.trim();\n if (fields.size === 0 && !sectionKey) return [];\n const all = CollectFormContributionRegistrations(\n this.Record?.EntityInfo ?? null, this.FormComponent?.ProviderToUse ?? null, { Preview: this.preview });\n // A field claim belongs to this section when any of its fields is one this section draws.\n // Any, not every: a claim naming a field the form stopped drawing still belongs where its\n // remaining fields are, and dropping it there would leave the panel nowhere while its\n // other fields stayed hidden.\n const matching = ResolveFormContributionWinners(this.Entity, all).Winners.filter((reg) => {\n if (ContributionSectionPosition(reg.Metadata) !== this.Position) return false;\n if (sectionKey && PlacedInSectionKey(reg.Metadata) === sectionKey) return true;\n const claimed = reg.Metadata.replacesFieldNames ?? [];\n return claimed.some((name) => fields.has(name.trim()));\n });\n return matching.sort((a, b) => {\n const aSort = a.Metadata.sortKey ?? 0;\n const bSort = b.Metadata.sortKey ?? 0;\n if (aSort !== bSort) return bSort - aSort;\n return b.Priority - a.Priority;\n });\n }\n\n private unmountAll(): void {\n for (const ref of this.mounted) this.FormComponent?.UnregisterFormPanel?.(ref.instance);\n this.anchor.clear();\n this.mounted = [];\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-panel-slot.component.d.ts","sourceRoot":"","sources":["../../../src/lib/panel-slot/form-panel-slot.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAMH,SAAS,EACT,SAAS,EACT,MAAM,EAEN,aAAa,EAIhB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,UAAU,EAAY,MAAM,sBAAsB,CAAC;AAE5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAiB,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;;AAatE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,qBAWa,sBAAuB,YAAW,MAAM,EAAE,SAAS,EAAE,SAAS;IA6C/C,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC;IA5CrD,oEAAoE;IAC3D,MAAM,EAAG,M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;IAUnB,OAAO,CAAC,mBAAmB;IAO3B,OAAO,CAAC,OAAO;IAsEf;;;;;;;;;OASG;IACH,OAAO,CAAC,kBAAkB;IAc1B;;;;;;;;OAQG;IACH,OAAO,CAAC,wBAAwB;IAgBhC;;;;;;;;OAQG;IACH,OAAO,CAAC,kBAAkB;IAoB1B;;;;OAIG;YACW,6BAA6B;IAuB3C,+FAA+F;IAC/F,OAAO,CAAC,MAAM,CAAC,qBAAqB;IAcpC,OAAO,CAAC,UAAU;yCA/TT,sBAAsB;2CAAtB,sBAAsB;CAoUlC"}
|
|
@@ -101,6 +101,11 @@ export class FormPanelSlotComponent {
|
|
|
101
101
|
this.recordRefresh?.Refreshed$.pipe(takeUntil(this.destroy$)).subscribe((record) => {
|
|
102
102
|
this.notifyMountedPanels(record);
|
|
103
103
|
});
|
|
104
|
+
this.recordRefresh?.VersionPreviewChanged$.pipe(takeUntil(this.destroy$)).subscribe(() => {
|
|
105
|
+
for (const ref of this.mounted) {
|
|
106
|
+
ref.changeDetectorRef.detectChanges();
|
|
107
|
+
}
|
|
108
|
+
});
|
|
104
109
|
// Rows can arrive after the first paint (cold engine, a contribution saved in another
|
|
105
110
|
// tab). Without this the slot would keep showing whatever it mounted first. The engine's
|
|
106
111
|
// subject replays the current rows on subscribe, which ngOnChanges has already mounted.
|
|
@@ -152,6 +157,7 @@ export class FormPanelSlotComponent {
|
|
|
152
157
|
notifyMountedPanels(record) {
|
|
153
158
|
for (const ref of this.mounted) {
|
|
154
159
|
ref.instance.OnRecordRefreshed(record);
|
|
160
|
+
ref.changeDetectorRef.detectChanges();
|
|
155
161
|
}
|
|
156
162
|
}
|
|
157
163
|
remount() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-panel-slot.component.js","sourceRoot":"","sources":["../../../src/lib/panel-slot/form-panel-slot.component.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,SAAS,EAET,UAAU,EACV,WAAW,EACX,KAAK,EAIL,QAAQ,EAER,SA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,CAAC,CAAC,SAAS,CAAC,GAAG,EAAE;gBACzE,YAAY,CAAC,KAAK,CAAC,CAAC;gBACpB,OAAO,CAAC,QAAQ,CAAC,CAAC;YACtB,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC;IAEO,UAAU;QACd,KAAK,MAAM,GAAG,IAAI,IAAI,CAAC,OAAO;YAAE,IAAI,CAAC,aAAa,EAAE,mBAAmB,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QACxF,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;QACpB,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;IACtB,CAAC;gHA7TQ,sBAAsB;6DAAtB,sBAAsB;mCAkBF,gBAAgB;;;;;;;YA1BlC,iCAAqC;;;iFAQvC,sBAAsB;cAXlC,SAAS;6BACM,KAAK,YACP,oBAAoB,YACpB,uCAAuC;;sBAqDpC,QAAQ;;kBA3CpB,KAAK;;kBAEL,KAAK;;kBAEL,KAAK;;kBAEL,KAAK;;kBAEL,KAAK;;kBAGL,WAAW;mBAAC,qBAAqB;;kBAKjC,SAAS;mBAAC,QAAQ,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE,MAAM,EAAE,IAAI,EAAE;;kFAlBpD,sBAAsB","sourcesContent":["import {\n Component,\n ComponentRef,\n ElementRef,\n HostBinding,\n Input,\n OnChanges,\n OnDestroy,\n OnInit,\n Optional,\n SimpleChanges,\n ViewChild,\n ViewContainerRef,\n inject,\n} from '@angular/core';\nimport { Subject, filter, skip, take, takeUntil, type Observable, type Subscription } from 'rxjs';\nimport { BaseEntity, LogError } from '@memberjunction/core';\nimport { InteractiveFormsEngine } from '@memberjunction/core-entities';\nimport { BaseFormComponent } from '../base-form-component';\nimport { FormContext } from '../types/form-types';\nimport { BaseFormPanel, FormPanelSlot } from './base-form-panel';\nimport { FormSlotCoordinator } from './form-slot-coordinator.service';\nimport {\n ContributionDrawsInSection,\n FormContributionEntityMatches,\n ResolveFormContributionWinners,\n type FormContributionRegistration,\n} from './form-contribution';\nimport { CollectFormContributionRegistrations } from './collect-form-contribution-registrations';\nimport { MountFormContribution } from './mount-form-contribution';\nimport { PanelHideKey } from './panel-hides';\nimport { FORM_PLACEMENT_PREVIEW } from './placement-preview';\nimport { FormRecordRefreshCoordinator } from '../form-record-refresh.coordinator';\n\n/**\n * `<mj-form-panel-slot>` — dynamic slot host that discovers and mounts every\n * registered `BaseFormPanel` whose metadata matches the slot's `Entity` +\n * `Slot` inputs. Generated entity-form HTML emits one of these at each\n * well-known slot position so consumers can extend the form WITHOUT replacing\n * it via the custom-form override pattern.\n *\n * **Discovery**: uses `ClassFactory.GetAllRegistrationsByMetadata(BaseFormPanel, ...)`\n * to find every panel registered with metadata `{ entity, slot }` matching this\n * slot. Registrations without a metadata bag (or without these required keys)\n * are silently ignored so legacy registrations don't accidentally bind.\n *\n * **Ordering**: registrations are sorted by `metadata.sortKey` descending —\n * higher number renders first within the slot. Use ranges (100/50/10) so future\n * panels can wedge in without renumbering. Ties fall back to the\n * `ClassRegistration.Priority` field (also descending), and finally to\n * registration order.\n *\n * **Fallback chain** (see `FormSlotCoordinator`): each slot host registers\n * with the per-form coordinator and additionally renders panels whose\n * REGISTERED slot is missing in the current form, when this host happens to\n * be the next-existing slot down the chain. The container template guarantees\n * an `after-everything` slot host, so fallback always terminates somewhere.\n * Downstream consumers running an older form template (no CodeGen rerun\n * yet) get every panel rendered at the bottom; consumers on the new template\n * get them in the preferred position.\n *\n * **Re-mount**: any input change OR a coordinator change (another slot\n * registers/deregisters, or the form's panel set changed) triggers a re-render\n * so fallback assignments and hidden panels stay correct.\n */\n@Component({\n standalone: false,\n selector: 'mj-form-panel-slot',\n template: `<ng-container #anchor></ng-container>`,\n // `display: contents` makes the host element disappear from the layout\n // tree so the mounted panels (children) participate directly in the\n // parent's flex/grid layout. Without this, the parent's gap/spacing\n // rules treat all mounted panels as a SINGLE child (the slot host),\n // collapsing the spacing between them.\n styles: [`:host { display: contents; }`],\n})\nexport class FormPanelSlotComponent implements OnInit, OnChanges, OnDestroy {\n /** The entity name (e.g., `\"MJ: Content Sources\"`) being edited. */\n @Input() Entity!: string;\n /** Which slot position this host represents. */\n @Input() Slot!: FormPanelSlot;\n /** The record being edited — threaded through to every mounted panel. */\n @Input() Record!: BaseEntity;\n /** The host form component — used by panels for EditMode + dirty notifications. */\n @Input() FormComponent!: BaseFormComponent;\n /** Optional form context — same shape collapsible-panel chrome expects. */\n @Input() FormContext?: FormContext;\n\n /** The position, on the element, so a form's slot set can be read without its injector. */\n @HostBinding('attr.data-form-slot')\n get HostSlot(): string {\n return this.Slot ?? '';\n }\n\n @ViewChild('anchor', { read: ViewContainerRef, static: true })\n private anchor!: ViewContainerRef;\n\n private mounted: ComponentRef<BaseFormPanel>[] = [];\n private readonly destroy$ = new Subject<void>();\n private registeredSlot: FormPanelSlot | null = null;\n private readonly recordRefresh = inject(FormRecordRefreshCoordinator, { optional: true });\n /** The placement dialog's unsaved panel, when this slot is on the dialog's preview form. */\n private readonly preview = inject(FORM_PLACEMENT_PREVIEW, { optional: true });\n private readonly element = inject<ElementRef<HTMLElement>>(ElementRef);\n /** Tracks synchronous re-entry depth into remount() so a future refactor\n * that reintroduces a remount loop surfaces loudly instead of freezing. */\n private remountDepth = 0;\n private readonly warnedLooseEntities = new Set<string>();\n private awaitingContributions = false;\n\n /**\n * Process-wide, not per-instance. The readiness wait is a one-time courtesy so the first\n * paint shows both sources together; once it has resolved — ready OR timed out — no slot\n * host anywhere should pay it again. Per-instance state made a failing engine cost every\n * slot on every form 1.5s apiece, which is far worse than the pop-in it was avoiding.\n */\n private static contributionGateResolved = false;\n\n /** Bounded: a slow or unreachable engine must not leave the form blank. */\n private static readonly READINESS_TIMEOUT_MS = 1500;\n\n constructor(@Optional() private readonly coordinator?: FormSlotCoordinator) {}\n\n ngOnInit(): void {\n if (this.Slot && this.coordinator) {\n this.coordinator.registerSlot(this.Slot);\n this.registeredSlot = this.Slot;\n // Re-mount whenever the coordinator's known-slot set changes —\n // a panel that was previously orphaned to us might now have a\n // better slot available (or vice versa).\n this.coordinator.changes\n .pipe(takeUntil(this.destroy$))\n .subscribe(() => this.remount());\n }\n // A hide or show changes which panels win without any slot coming or going.\n this.coordinator?.PanelsChanged\n .pipe(takeUntil(this.destroy$))\n .subscribe(() => this.remount());\n this.recordRefresh?.Refreshed$.pipe(takeUntil(this.destroy$)).subscribe((record) => {\n this.notifyMountedPanels(record);\n });\n // Rows can arrive after the first paint (cold engine, a contribution saved in another\n // tab). Without this the slot would keep showing whatever it mounted first. The engine's\n // subject replays the current rows on subscribe, which ngOnChanges has already mounted.\n try {\n InteractiveFormsEngine.Instance.Contributions$\n .pipe(skip(1), takeUntil(this.destroy$))\n .subscribe(() => this.remount());\n } catch {\n // No engine here — compiled registrations are the only source.\n }\n this.preview?.Changed$.pipe(takeUntil(this.destroy$)).subscribe(() => this.remount());\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (!this.Entity || !this.Slot || !this.Record || !this.FormComponent) {\n // Inputs still being wired — wait for the next pass.\n return;\n }\n\n // Only remount when something that affects WHICH panels to mount has\n // changed. FormContext only flows through to mounted panels — pushing\n // it to the existing panels avoids an unmount/remount cycle.\n //\n // Critical for performance: the host form often reconstructs\n // formContext on every CD pass. Treating that as a structural change\n // would loop (remount → detectChanges → another CD → new FormContext\n // → remount again).\n const meaningfulKeys = ['Entity', 'Slot', 'Record', 'FormComponent'];\n const meaningfulChange = meaningfulKeys.some(k => changes[k]?.currentValue !== changes[k]?.previousValue);\n if (!meaningfulChange && changes['FormContext'] && this.mounted.length > 0) {\n for (const ref of this.mounted) {\n ref.instance.FormContext = this.FormContext;\n }\n return;\n }\n if (!meaningfulChange && this.mounted.length > 0) {\n return;\n }\n this.remount();\n }\n\n ngOnDestroy(): void {\n this.destroy$.next();\n this.destroy$.complete();\n if (this.coordinator && this.registeredSlot) {\n this.coordinator.deregisterSlot(this.registeredSlot);\n this.registeredSlot = null;\n }\n this.unmountAll();\n }\n\n private notifyMountedPanels(record: BaseEntity): void {\n for (const ref of this.mounted) {\n ref.instance.OnRecordRefreshed(record);\n }\n }\n\n private remount(): void {\n // A form that renders its own body bars every panel. Checked before the readiness\n // gate so a barred slot never waits on the engine.\n if (this.FormComponent?.OwnsEntireFormBody) {\n this.unmountAll();\n return;\n }\n // Compiled panels and rows mount together or not at all. Mounting compiled panels\n // first and adding rows a tick later is visible — and for a `bare` hero that replaces\n // a baked section, the user watches that section render and then vanish.\n if (!this.contributionsReady()) {\n void this.awaitContributionsThenRemount();\n return;\n }\n this.remountDepth++;\n if (this.remountDepth > 5) {\n console.error(`[mj-form-panel-slot] LOOP DETECTED — remount depth ${this.remountDepth} on slot=${this.Slot}. Bailing.`);\n this.remountDepth--;\n return;\n }\n this.unmountAll();\n\n const all = this.winnersForThisSlot();\n if (all.length === 0) {\n this.remountDepth--;\n return;\n }\n\n // Sort: higher sortKey first, then higher Priority, then registration order.\n all.sort((a, b) => {\n const aSort = a.Metadata?.sortKey ?? 0;\n const bSort = b.Metadata?.sortKey ?? 0;\n if (aSort !== bSort) return bSort - aSort;\n return b.Priority - a.Priority;\n });\n\n for (const reg of all) {\n try {\n const ref = MountFormContribution(this.anchor, reg);\n if (!ref) continue;\n ref.instance.Record = this.Record;\n ref.instance.FormComponent = this.FormComponent;\n ref.instance.RegistrationMetadata = reg.Metadata;\n ref.instance.SlotElement = this.element.nativeElement;\n if (this.FormContext) ref.instance.FormContext = this.FormContext;\n // Left-nav leftover height targets mj-collapsible-panel as a\n // flex child of .mj-forms-all-panels. The slot is already\n // display:contents; the mounted host must be too.\n const host = ref.location.nativeElement as HTMLElement | null;\n if (host) {\n host.style.display = 'contents';\n // Lets the drawer tell a panel that drew something from one that self-hid,\n // by reading the DOM the way the form probe does.\n const hideKey = PanelHideKey(reg);\n if (hideKey) host.setAttribute('data-panel-key', hideKey);\n }\n this.FormComponent?.RegisterFormPanel?.(ref.instance);\n // No detectChanges() — Angular's normal CD pass picks the new\n // component up. Calling detectChanges() synchronously inside\n // an ongoing CD cycle (which is when ngOnChanges → remount\n // fires) can re-enter and cause an infinite loop if anything\n // upstream is reconstructing inputs on each CD pass.\n this.mounted.push(ref);\n } catch (e) {\n LogError(`[mj-form-panel-slot] Failed to mount panel for ${this.Entity}:${this.Slot}: ${e instanceof Error ? e.message : String(e)}`);\n }\n }\n this.remountDepth--;\n }\n\n /**\n * The form's winning registrations that this slot mounts.\n *\n * The collapse runs once over every registration on the form (see\n * `ResolveFormContributionWinners`), then this slot keeps the winners it hosts: those\n * registered for this slot, and those whose slot is missing from the form when the\n * coordinator resolves them to this one. A winner drawn inside a section is mounted by that\n * section, not by a slot. A wildcard (`entity: '*'`) panel mounts on every form and is\n * expected to hide itself where it does not apply.\n */\n private winnersForThisSlot(): FormContributionRegistration[] {\n const entity = this.Record?.EntityInfo ?? null;\n const provider = this.FormComponent?.ProviderToUse ?? null;\n const all = CollectFormContributionRegistrations(entity, provider, { Preview: this.preview });\n this.warnOnLooseRegistrations(all);\n return ResolveFormContributionWinners(this.Entity, all).Winners.filter((reg) => {\n if (ContributionDrawsInSection(reg.Metadata)) return false;\n const slot = reg.Metadata.slot;\n if (slot === this.Slot) return true;\n // Without a coordinator (no parent container) a panel binds to its literal slot only.\n return !!slot && !!this.coordinator && this.coordinator.resolveSlot(slot) === this.Slot;\n });\n }\n\n /**\n * Diagnostic for the old prefix-insensitive match. A loosely named registration no\n * longer mounts here — and never hid its baked grid on the container side, which has\n * always matched strictly.\n *\n * This runs on every resolve, not only when nothing matched strictly. Keying it on\n * \"nothing matched\" would miss the likeliest case: a form where some panels are named\n * correctly and one is not, where the broken one would vanish with no warning at all.\n */\n private warnOnLooseRegistrations(all: readonly FormContributionRegistration[]): void {\n if (this.warnedLooseEntities.has(this.Entity)) return;\n const strip = (v: string) => v.replace(/^mj[:_\\s]+/i, '').replace(/[\\s_]+/g, '').toLowerCase();\n const loose = all.filter((reg) => {\n const name = reg.Metadata?.entity;\n return !!name && !FormContributionEntityMatches(name, this.Entity) && strip(name) === strip(this.Entity);\n });\n if (loose.length === 0) return;\n this.warnedLooseEntities.add(this.Entity);\n const names = [...new Set(loose.map((reg) => reg.Metadata.entity))].join(', ');\n console.warn(\n `[mj-form-panel-slot] ${loose.length} BaseFormPanel registration(s) name \"${names}\" but the form entity is ` +\n `\"${this.Entity}\". Entity names must match exactly; these panels will not mount.`,\n );\n }\n\n /**\n * Whether the slot can mount now, or should wait for contribution rows.\n *\n * It waits only while a load is actually in flight. An engine nobody has configured\n * is not \"about to be ready\" — blocking on it would delay every host that does not\n * use metadata contributions at all. Those hosts mount immediately and self-heal:\n * the collector kicks `Config`, and the `Contributions$` subscription below remounts\n * when rows arrive.\n */\n private contributionsReady(): boolean {\n if (FormPanelSlotComponent.contributionGateResolved) return true;\n try {\n const engine = InteractiveFormsEngine.Instance;\n if (engine.ContributionsReady) {\n FormPanelSlotComponent.contributionGateResolved = true;\n return true;\n }\n if (!engine.LoadingSubject.value) {\n // Nothing in flight — mount now rather than waiting on a load that may never start.\n return true;\n }\n return false;\n } catch {\n // No engine in this context (a panel composed outside a form host).\n FormPanelSlotComponent.contributionGateResolved = true;\n return true;\n }\n }\n\n /**\n * Wait for the engine's load to finish, then remount once. Falls through on a timeout so a\n * slow or unreachable engine degrades to compiled panels only rather than leaving the slot\n * empty.\n */\n private async awaitContributionsThenRemount(): Promise<void> {\n if (this.awaitingContributions) return;\n this.awaitingContributions = true;\n try {\n const engine = InteractiveFormsEngine.Instance;\n const outcome = await FormPanelSlotComponent.loadFinishedOrTimeout(engine.LoadingSubject);\n if (!engine.ContributionsReady && !FormPanelSlotComponent.contributionGateResolved) {\n // Once: the first slot to finish waiting closes the gate process-wide below.\n LogError(outcome === 'timeout'\n ? `[mj-form-panel-slot] contribution cache not ready after ${FormPanelSlotComponent.READINESS_TIMEOUT_MS}ms; mounting compiled panels only from here on.`\n : '[mj-form-panel-slot] contribution cache failed to load; mounting compiled panels only from here on.');\n }\n } catch (e) {\n LogError(`[mj-form-panel-slot] waiting on contributions failed: ${e instanceof Error ? e.message : String(e)}`);\n } finally {\n this.awaitingContributions = false;\n // Ready or timed out, the gate is spent process-wide: from here every slot mounts\n // whatever the collector returns rather than waiting again.\n FormPanelSlotComponent.contributionGateResolved = true;\n }\n this.remount();\n }\n\n /** Resolves when `loading` emits false, or after the readiness timeout, whichever is first. */\n private static loadFinishedOrTimeout(loading: Observable<boolean>): Promise<'loaded' | 'timeout'> {\n return new Promise((resolve) => {\n let subscription: Subscription | null = null;\n const timer = setTimeout(() => {\n subscription?.unsubscribe();\n resolve('timeout');\n }, FormPanelSlotComponent.READINESS_TIMEOUT_MS);\n subscription = loading.pipe(filter((busy) => !busy), take(1)).subscribe(() => {\n clearTimeout(timer);\n resolve('loaded');\n });\n });\n }\n\n private unmountAll(): void {\n for (const ref of this.mounted) this.FormComponent?.UnregisterFormPanel?.(ref.instance);\n this.anchor.clear();\n this.mounted = [];\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"form-panel-slot.component.js","sourceRoot":"","sources":["../../../src/lib/panel-slot/form-panel-slot.component.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,SAAS,EAET,UAAU,EACV,WAAW,EACX,KAAK,EAIL,QAAQ,EAER,SAAS,EACT,gBAAgB,EAChB,MAAM,GACT,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,SAAS,EAAsC,MAAM,MAAM,CAAC;AAClG,OAAO,EAAc,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAKvE,OAAO,EACH,0BAA0B,EAC1B,6BAA6B,EAC7B,8BAA8B,GAEjC,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,oCAAoC,EAAE,MAAM,2CAA2C,CAAC;AACjG,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EA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AC;QACP,CAAC,CAAC,CAAC;IACP,CAAC;IAEO,UAAU;QACd,KAAK,MAAM,GAAG,IAAI,IAAI,CAAC,OAAO;YAAE,IAAI,CAAC,aAAa,EAAE,mBAAmB,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QACxF,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;QACpB,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;IACtB,CAAC;gHAnUQ,sBAAsB;6DAAtB,sBAAsB;mCAkBF,gBAAgB;;;;;;;YA1BlC,iCAAqC;;;iFAQvC,sBAAsB;cAXlC,SAAS;6BACM,KAAK,YACP,oBAAoB,YACpB,uCAAuC;;sBAqDpC,QAAQ;;kBA3CpB,KAAK;;kBAEL,KAAK;;kBAEL,KAAK;;kBAEL,KAAK;;kBAEL,KAAK;;kBAGL,WAAW;mBAAC,qBAAqB;;kBAKjC,SAAS;mBAAC,QAAQ,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE,MAAM,EAAE,IAAI,EAAE;;kFAlBpD,sBAAsB","sourcesContent":["import {\n Component,\n ComponentRef,\n ElementRef,\n HostBinding,\n Input,\n OnChanges,\n OnDestroy,\n OnInit,\n Optional,\n SimpleChanges,\n ViewChild,\n ViewContainerRef,\n inject,\n} from '@angular/core';\nimport { Subject, filter, skip, take, takeUntil, type Observable, type Subscription } from 'rxjs';\nimport { BaseEntity, LogError } from '@memberjunction/core';\nimport { InteractiveFormsEngine } from '@memberjunction/core-entities';\nimport { BaseFormComponent } from '../base-form-component';\nimport { FormContext } from '../types/form-types';\nimport { BaseFormPanel, FormPanelSlot } from './base-form-panel';\nimport { FormSlotCoordinator } from './form-slot-coordinator.service';\nimport {\n ContributionDrawsInSection,\n FormContributionEntityMatches,\n ResolveFormContributionWinners,\n type FormContributionRegistration,\n} from './form-contribution';\nimport { CollectFormContributionRegistrations } from './collect-form-contribution-registrations';\nimport { MountFormContribution } from './mount-form-contribution';\nimport { PanelHideKey } from './panel-hides';\nimport { FORM_PLACEMENT_PREVIEW } from './placement-preview';\nimport { FormRecordRefreshCoordinator } from '../form-record-refresh.coordinator';\n\n/**\n * `<mj-form-panel-slot>` — dynamic slot host that discovers and mounts every\n * registered `BaseFormPanel` whose metadata matches the slot's `Entity` +\n * `Slot` inputs. Generated entity-form HTML emits one of these at each\n * well-known slot position so consumers can extend the form WITHOUT replacing\n * it via the custom-form override pattern.\n *\n * **Discovery**: uses `ClassFactory.GetAllRegistrationsByMetadata(BaseFormPanel, ...)`\n * to find every panel registered with metadata `{ entity, slot }` matching this\n * slot. Registrations without a metadata bag (or without these required keys)\n * are silently ignored so legacy registrations don't accidentally bind.\n *\n * **Ordering**: registrations are sorted by `metadata.sortKey` descending —\n * higher number renders first within the slot. Use ranges (100/50/10) so future\n * panels can wedge in without renumbering. Ties fall back to the\n * `ClassRegistration.Priority` field (also descending), and finally to\n * registration order.\n *\n * **Fallback chain** (see `FormSlotCoordinator`): each slot host registers\n * with the per-form coordinator and additionally renders panels whose\n * REGISTERED slot is missing in the current form, when this host happens to\n * be the next-existing slot down the chain. The container template guarantees\n * an `after-everything` slot host, so fallback always terminates somewhere.\n * Downstream consumers running an older form template (no CodeGen rerun\n * yet) get every panel rendered at the bottom; consumers on the new template\n * get them in the preferred position.\n *\n * **Re-mount**: any input change OR a coordinator change (another slot\n * registers/deregisters, or the form's panel set changed) triggers a re-render\n * so fallback assignments and hidden panels stay correct.\n */\n@Component({\n standalone: false,\n selector: 'mj-form-panel-slot',\n template: `<ng-container #anchor></ng-container>`,\n // `display: contents` makes the host element disappear from the layout\n // tree so the mounted panels (children) participate directly in the\n // parent's flex/grid layout. Without this, the parent's gap/spacing\n // rules treat all mounted panels as a SINGLE child (the slot host),\n // collapsing the spacing between them.\n styles: [`:host { display: contents; }`],\n})\nexport class FormPanelSlotComponent implements OnInit, OnChanges, OnDestroy {\n /** The entity name (e.g., `\"MJ: Content Sources\"`) being edited. */\n @Input() Entity!: string;\n /** Which slot position this host represents. */\n @Input() Slot!: FormPanelSlot;\n /** The record being edited — threaded through to every mounted panel. */\n @Input() Record!: BaseEntity;\n /** The host form component — used by panels for EditMode + dirty notifications. */\n @Input() FormComponent!: BaseFormComponent;\n /** Optional form context — same shape collapsible-panel chrome expects. */\n @Input() FormContext?: FormContext;\n\n /** The position, on the element, so a form's slot set can be read without its injector. */\n @HostBinding('attr.data-form-slot')\n get HostSlot(): string {\n return this.Slot ?? '';\n }\n\n @ViewChild('anchor', { read: ViewContainerRef, static: true })\n private anchor!: ViewContainerRef;\n\n private mounted: ComponentRef<BaseFormPanel>[] = [];\n private readonly destroy$ = new Subject<void>();\n private registeredSlot: FormPanelSlot | null = null;\n private readonly recordRefresh = inject(FormRecordRefreshCoordinator, { optional: true });\n /** The placement dialog's unsaved panel, when this slot is on the dialog's preview form. */\n private readonly preview = inject(FORM_PLACEMENT_PREVIEW, { optional: true });\n private readonly element = inject<ElementRef<HTMLElement>>(ElementRef);\n /** Tracks synchronous re-entry depth into remount() so a future refactor\n * that reintroduces a remount loop surfaces loudly instead of freezing. */\n private remountDepth = 0;\n private readonly warnedLooseEntities = new Set<string>();\n private awaitingContributions = false;\n\n /**\n * Process-wide, not per-instance. The readiness wait is a one-time courtesy so the first\n * paint shows both sources together; once it has resolved — ready OR timed out — no slot\n * host anywhere should pay it again. Per-instance state made a failing engine cost every\n * slot on every form 1.5s apiece, which is far worse than the pop-in it was avoiding.\n */\n private static contributionGateResolved = false;\n\n /** Bounded: a slow or unreachable engine must not leave the form blank. */\n private static readonly READINESS_TIMEOUT_MS = 1500;\n\n constructor(@Optional() private readonly coordinator?: FormSlotCoordinator) {}\n\n ngOnInit(): void {\n if (this.Slot && this.coordinator) {\n this.coordinator.registerSlot(this.Slot);\n this.registeredSlot = this.Slot;\n // Re-mount whenever the coordinator's known-slot set changes —\n // a panel that was previously orphaned to us might now have a\n // better slot available (or vice versa).\n this.coordinator.changes\n .pipe(takeUntil(this.destroy$))\n .subscribe(() => this.remount());\n }\n // A hide or show changes which panels win without any slot coming or going.\n this.coordinator?.PanelsChanged\n .pipe(takeUntil(this.destroy$))\n .subscribe(() => this.remount());\n this.recordRefresh?.Refreshed$.pipe(takeUntil(this.destroy$)).subscribe((record) => {\n this.notifyMountedPanels(record);\n });\n this.recordRefresh?.VersionPreviewChanged$.pipe(takeUntil(this.destroy$)).subscribe(() => {\n for (const ref of this.mounted) {\n ref.changeDetectorRef.detectChanges();\n }\n });\n // Rows can arrive after the first paint (cold engine, a contribution saved in another\n // tab). Without this the slot would keep showing whatever it mounted first. The engine's\n // subject replays the current rows on subscribe, which ngOnChanges has already mounted.\n try {\n InteractiveFormsEngine.Instance.Contributions$\n .pipe(skip(1), takeUntil(this.destroy$))\n .subscribe(() => this.remount());\n } catch {\n // No engine here — compiled registrations are the only source.\n }\n this.preview?.Changed$.pipe(takeUntil(this.destroy$)).subscribe(() => this.remount());\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (!this.Entity || !this.Slot || !this.Record || !this.FormComponent) {\n // Inputs still being wired — wait for the next pass.\n return;\n }\n\n // Only remount when something that affects WHICH panels to mount has\n // changed. FormContext only flows through to mounted panels — pushing\n // it to the existing panels avoids an unmount/remount cycle.\n //\n // Critical for performance: the host form often reconstructs\n // formContext on every CD pass. Treating that as a structural change\n // would loop (remount → detectChanges → another CD → new FormContext\n // → remount again).\n const meaningfulKeys = ['Entity', 'Slot', 'Record', 'FormComponent'];\n const meaningfulChange = meaningfulKeys.some(k => changes[k]?.currentValue !== changes[k]?.previousValue);\n if (!meaningfulChange && changes['FormContext'] && this.mounted.length > 0) {\n for (const ref of this.mounted) {\n ref.instance.FormContext = this.FormContext;\n }\n return;\n }\n if (!meaningfulChange && this.mounted.length > 0) {\n return;\n }\n this.remount();\n }\n\n ngOnDestroy(): void {\n this.destroy$.next();\n this.destroy$.complete();\n if (this.coordinator && this.registeredSlot) {\n this.coordinator.deregisterSlot(this.registeredSlot);\n this.registeredSlot = null;\n }\n this.unmountAll();\n }\n\n private notifyMountedPanels(record: BaseEntity): void {\n for (const ref of this.mounted) {\n ref.instance.OnRecordRefreshed(record);\n ref.changeDetectorRef.detectChanges();\n }\n }\n\n private remount(): void {\n // A form that renders its own body bars every panel. Checked before the readiness\n // gate so a barred slot never waits on the engine.\n if (this.FormComponent?.OwnsEntireFormBody) {\n this.unmountAll();\n return;\n }\n // Compiled panels and rows mount together or not at all. Mounting compiled panels\n // first and adding rows a tick later is visible — and for a `bare` hero that replaces\n // a baked section, the user watches that section render and then vanish.\n if (!this.contributionsReady()) {\n void this.awaitContributionsThenRemount();\n return;\n }\n this.remountDepth++;\n if (this.remountDepth > 5) {\n console.error(`[mj-form-panel-slot] LOOP DETECTED — remount depth ${this.remountDepth} on slot=${this.Slot}. Bailing.`);\n this.remountDepth--;\n return;\n }\n this.unmountAll();\n\n const all = this.winnersForThisSlot();\n if (all.length === 0) {\n this.remountDepth--;\n return;\n }\n\n // Sort: higher sortKey first, then higher Priority, then registration order.\n all.sort((a, b) => {\n const aSort = a.Metadata?.sortKey ?? 0;\n const bSort = b.Metadata?.sortKey ?? 0;\n if (aSort !== bSort) return bSort - aSort;\n return b.Priority - a.Priority;\n });\n\n for (const reg of all) {\n try {\n const ref = MountFormContribution(this.anchor, reg);\n if (!ref) continue;\n ref.instance.Record = this.Record;\n ref.instance.FormComponent = this.FormComponent;\n ref.instance.RegistrationMetadata = reg.Metadata;\n ref.instance.SlotElement = this.element.nativeElement;\n if (this.FormContext) ref.instance.FormContext = this.FormContext;\n // Left-nav leftover height targets mj-collapsible-panel as a\n // flex child of .mj-forms-all-panels. The slot is already\n // display:contents; the mounted host must be too.\n const host = ref.location.nativeElement as HTMLElement | null;\n if (host) {\n host.style.display = 'contents';\n // Lets the drawer tell a panel that drew something from one that self-hid,\n // by reading the DOM the way the form probe does.\n const hideKey = PanelHideKey(reg);\n if (hideKey) host.setAttribute('data-panel-key', hideKey);\n }\n this.FormComponent?.RegisterFormPanel?.(ref.instance);\n // No detectChanges() — Angular's normal CD pass picks the new\n // component up. Calling detectChanges() synchronously inside\n // an ongoing CD cycle (which is when ngOnChanges → remount\n // fires) can re-enter and cause an infinite loop if anything\n // upstream is reconstructing inputs on each CD pass.\n this.mounted.push(ref);\n } catch (e) {\n LogError(`[mj-form-panel-slot] Failed to mount panel for ${this.Entity}:${this.Slot}: ${e instanceof Error ? e.message : String(e)}`);\n }\n }\n this.remountDepth--;\n }\n\n /**\n * The form's winning registrations that this slot mounts.\n *\n * The collapse runs once over every registration on the form (see\n * `ResolveFormContributionWinners`), then this slot keeps the winners it hosts: those\n * registered for this slot, and those whose slot is missing from the form when the\n * coordinator resolves them to this one. A winner drawn inside a section is mounted by that\n * section, not by a slot. A wildcard (`entity: '*'`) panel mounts on every form and is\n * expected to hide itself where it does not apply.\n */\n private winnersForThisSlot(): FormContributionRegistration[] {\n const entity = this.Record?.EntityInfo ?? null;\n const provider = this.FormComponent?.ProviderToUse ?? null;\n const all = CollectFormContributionRegistrations(entity, provider, { Preview: this.preview });\n this.warnOnLooseRegistrations(all);\n return ResolveFormContributionWinners(this.Entity, all).Winners.filter((reg) => {\n if (ContributionDrawsInSection(reg.Metadata)) return false;\n const slot = reg.Metadata.slot;\n if (slot === this.Slot) return true;\n // Without a coordinator (no parent container) a panel binds to its literal slot only.\n return !!slot && !!this.coordinator && this.coordinator.resolveSlot(slot) === this.Slot;\n });\n }\n\n /**\n * Diagnostic for the old prefix-insensitive match. A loosely named registration no\n * longer mounts here — and never hid its baked grid on the container side, which has\n * always matched strictly.\n *\n * This runs on every resolve, not only when nothing matched strictly. Keying it on\n * \"nothing matched\" would miss the likeliest case: a form where some panels are named\n * correctly and one is not, where the broken one would vanish with no warning at all.\n */\n private warnOnLooseRegistrations(all: readonly FormContributionRegistration[]): void {\n if (this.warnedLooseEntities.has(this.Entity)) return;\n const strip = (v: string) => v.replace(/^mj[:_\\s]+/i, '').replace(/[\\s_]+/g, '').toLowerCase();\n const loose = all.filter((reg) => {\n const name = reg.Metadata?.entity;\n return !!name && !FormContributionEntityMatches(name, this.Entity) && strip(name) === strip(this.Entity);\n });\n if (loose.length === 0) return;\n this.warnedLooseEntities.add(this.Entity);\n const names = [...new Set(loose.map((reg) => reg.Metadata.entity))].join(', ');\n console.warn(\n `[mj-form-panel-slot] ${loose.length} BaseFormPanel registration(s) name \"${names}\" but the form entity is ` +\n `\"${this.Entity}\". Entity names must match exactly; these panels will not mount.`,\n );\n }\n\n /**\n * Whether the slot can mount now, or should wait for contribution rows.\n *\n * It waits only while a load is actually in flight. An engine nobody has configured\n * is not \"about to be ready\" — blocking on it would delay every host that does not\n * use metadata contributions at all. Those hosts mount immediately and self-heal:\n * the collector kicks `Config`, and the `Contributions$` subscription below remounts\n * when rows arrive.\n */\n private contributionsReady(): boolean {\n if (FormPanelSlotComponent.contributionGateResolved) return true;\n try {\n const engine = InteractiveFormsEngine.Instance;\n if (engine.ContributionsReady) {\n FormPanelSlotComponent.contributionGateResolved = true;\n return true;\n }\n if (!engine.LoadingSubject.value) {\n // Nothing in flight — mount now rather than waiting on a load that may never start.\n return true;\n }\n return false;\n } catch {\n // No engine in this context (a panel composed outside a form host).\n FormPanelSlotComponent.contributionGateResolved = true;\n return true;\n }\n }\n\n /**\n * Wait for the engine's load to finish, then remount once. Falls through on a timeout so a\n * slow or unreachable engine degrades to compiled panels only rather than leaving the slot\n * empty.\n */\n private async awaitContributionsThenRemount(): Promise<void> {\n if (this.awaitingContributions) return;\n this.awaitingContributions = true;\n try {\n const engine = InteractiveFormsEngine.Instance;\n const outcome = await FormPanelSlotComponent.loadFinishedOrTimeout(engine.LoadingSubject);\n if (!engine.ContributionsReady && !FormPanelSlotComponent.contributionGateResolved) {\n // Once: the first slot to finish waiting closes the gate process-wide below.\n LogError(outcome === 'timeout'\n ? `[mj-form-panel-slot] contribution cache not ready after ${FormPanelSlotComponent.READINESS_TIMEOUT_MS}ms; mounting compiled panels only from here on.`\n : '[mj-form-panel-slot] contribution cache failed to load; mounting compiled panels only from here on.');\n }\n } catch (e) {\n LogError(`[mj-form-panel-slot] waiting on contributions failed: ${e instanceof Error ? e.message : String(e)}`);\n } finally {\n this.awaitingContributions = false;\n // Ready or timed out, the gate is spent process-wide: from here every slot mounts\n // whatever the collector returns rather than waiting again.\n FormPanelSlotComponent.contributionGateResolved = true;\n }\n this.remount();\n }\n\n /** Resolves when `loading` emits false, or after the readiness timeout, whichever is first. */\n private static loadFinishedOrTimeout(loading: Observable<boolean>): Promise<'loaded' | 'timeout'> {\n return new Promise((resolve) => {\n let subscription: Subscription | null = null;\n const timer = setTimeout(() => {\n subscription?.unsubscribe();\n resolve('timeout');\n }, FormPanelSlotComponent.READINESS_TIMEOUT_MS);\n subscription = loading.pipe(filter((busy) => !busy), take(1)).subscribe(() => {\n clearTimeout(timer);\n resolve('loaded');\n });\n });\n }\n\n private unmountAll(): void {\n for (const ref of this.mounted) this.FormComponent?.UnregisterFormPanel?.(ref.instance);\n this.anchor.clear();\n this.mounted = [];\n }\n}\n"]}
|