Member Junction
    Preparing search index...

    MJEntityCardComponent — A generic, metadata-driven entity record card.

    Renders a single entity record as a visual card with automatically prioritized fields based on MemberJunction entity metadata (IsNameField, DefaultInView, Sequence). Designed to work with both full entity records and sparse vector metadata from the Knowledge Hub.

    • compact — Tooltip-sized. Title + 2-3 key fields. No avatar.
    • card — Grid card. Avatar + title + subtitle + display fields + badge.
    • detail — Full panel. All available fields with labels.
    1. Title: All IsNameField fields combined in Sequence order
    2. Primary fields: DefaultInView=true sorted by Sequence
    3. Fallback: First 5 non-PK/FK fields when no metadata flags are set

    All interactions follow the BeforeXXX / AfterXXX cancelable event pattern. Set event.Cancel = true in a BeforeXXX handler to prevent the default action.

    <!-- From entity name + vector metadata -->
    <mj-entity-card
    [EntityName]="'Members'"
    [Record]="vectorMetadata"
    Variant="card"
    (CardClicked)="onCardClick($event)">
    </mj-entity-card>

    <!-- From EntityInfo + full record -->
    <mj-entity-card
    [Entity]="entityInfo"
    [Record]="record.GetAll()"
    Variant="detail"
    [ShowOpenButton]="true"
    (OpenRequested)="onOpen($event)">
    </mj-entity-card>

    mj-entity-card

    Hierarchy (View Summary)

    Implements

    • OnChanges
    Index

    Constructors

    Properties

    BeforeCardClick: EventEmitter<CancelableCardEvent<CardRecordEvent>> = ...

    Fires before the card is clicked. Set Cancel = true to prevent the CardClicked event from firing.

    BeforeOpen: EventEmitter<CancelableCardEvent<CardRecordEvent>> = ...

    Fires before the "Open Record" button is clicked. Set Cancel = true to prevent the OpenRequested event from firing.

    CardClicked: EventEmitter<CardRecordEvent> = ...

    Fires after the card is clicked (if not canceled).

    CssClass: string = ''

    CSS class to apply to the outer container for custom styling.

    EffectiveTemplate: CardTemplate | null = null

    The effective card template (custom or auto-generated)

    Entity: EntityInfo | null = null

    Pre-resolved EntityInfo object. Takes precedence over EntityName. Use this when you already have the EntityInfo to avoid a redundant lookup.

    EntityDisplayName: string = ''

    Resolved entity display name

    EntityIcon: string = ''

    The entity icon class (from vector metadata or entity info)

    EntityName: string | null = null

    The entity name (e.g., "Members"). Used to look up EntityInfo from the MJ Metadata cache. Mutually exclusive with Entity — if both are provided, Entity takes precedence.

    MaxDisplayFields: number | null = null

    Maximum number of display fields in the card body. Only applies when using the auto-generated template.

    4 for 'card', 2 for 'compact', unlimited for 'detail'
    
    OpenRequested: EventEmitter<CardRecordEvent> = ...

    Fires when the "Open Record" button is clicked (if not canceled).

    Provider: IMetadataProvider | null

    If specified, this provider will be used for communication and for all metadata purposes. By default, if not provided, the Metadata and RunView classes are used for this and the default GraphQLDataProvider is used which is connected to the same back-end MJAPI instance as the Metadata and RunView classes. If you want to have this component connect to a different MJAPI back-end, create an instance of a ProviderBase sub-class like GraphQLDataProvider/etc, and configure it as appropriate to connect to the MJAPI back-end you want to use, and then pass it in here.

    Record: Record<string, unknown> = {}

    The record data as a plain key-value object. Works with both full entity records (record.GetAll()) and sparse vector metadata.

    Fields not present in the record are gracefully skipped in the display.

    ResolvedEntity: EntityInfo | null = null

    The resolved EntityInfo (from Entity input or EntityName lookup)

    ShowAvatar: boolean | null = null

    Whether to show the entity icon/avatar.

    true for 'card', false for 'compact', true for 'detail'
    
    ShowFieldLabels: boolean | null = null

    Whether to show field labels alongside values.

    true for 'detail', false for 'compact', true for 'card'
    
    ShowOpenButton: boolean = false

    Whether to show the "Open Record" button.

    false
    
    Template: CardTemplate | null = null

    Custom card template. When provided, overrides the auto-generated template. Use GenerateCardTemplate() from the types module to build one programmatically.

    Title: string = ''

    The combined title string

    Variant: EntityCardVariant = 'card'

    Visual variant controlling size, layout, and detail level.

    'card'
    
    "ɵdir": unknown
    "ɵfac": unknown

    Accessors

    • get ProviderToUse(): IMetadataProvider

      Returns either the default Metadata provider or the one specified in the Provider property, if it was specified

      Returns IMetadataProvider

    • get RunQueryToUse(): IRunQueryProvider

      Returns either the default RunQuery provider or the one specified in the Provider property, if it was specified

      Returns IRunQueryProvider

    • get RunReportToUse(): IRunReportProvider

      Returns either the default RunReport provider or the one specified in the Provider property, if it was specified

      Returns IRunReportProvider

    • get RunViewToUse(): IRunViewProvider

      Returns either the default RunView provider or the one specified in the Provider property, if it was specified

      Returns IRunViewProvider

    Methods

    • A callback method that is invoked immediately after the default change detector has checked data-bound properties if at least one has changed, and before the view and content children are checked.

      Parameters

      • changes: { [propName: string]: SimpleChange<any> }

        The changed properties.

      Returns void