@memberjunction/ng-base-forms 6.2.0-edge.4 → 6.2.0-edge.6
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/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-chrome-coordinator.service.d.ts +9 -0
- package/dist/lib/chrome/form-chrome-coordinator.service.d.ts.map +1 -1
- package/dist/lib/chrome/form-chrome-coordinator.service.js +11 -0
- package/dist/lib/chrome/form-chrome-coordinator.service.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 +1500 -316
- package/dist/lib/container/record-form-container.component.js.map +1 -1
- package/dist/lib/field/form-field.component.d.ts +167 -14
- package/dist/lib/field/form-field.component.d.ts.map +1 -1
- package/dist/lib/field/form-field.component.js +1374 -470
- 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/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 +249 -0
- package/dist/lib/links/record-links.component.d.ts.map +1 -0
- package/dist/lib/links/record-links.component.js +1523 -0
- package/dist/lib/links/record-links.component.js.map +1 -0
- package/dist/lib/panel/collapsible-panel.component.d.ts.map +1 -1
- package/dist/lib/panel/collapsible-panel.component.js +5 -0
- package/dist/lib/panel/collapsible-panel.component.js.map +1 -1
- 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 +187 -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 +1060 -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
package/README.md
CHANGED
|
@@ -20,13 +20,16 @@ per-surface code and no regeneration.
|
|
|
20
20
|
| Area | Key exports | Notes |
|
|
21
21
|
|------|-------------|-------|
|
|
22
22
|
| **Form base** | `BaseFormComponent`, `BaseFormSectionComponent`, `MjRecordFormContainerComponent`, `MjCollapsiblePanelComponent`, `MjFormFieldComponent` | The form itself + its toolbar/section container. Generated forms extend `BaseFormComponent`. |
|
|
23
|
-
| **Form host** | `MjEntityFormHostComponent` (`<mj-entity-form-host>`) | Presentation-agnostic: resolve → load → create → bind → re-emit → teardown. Supports full forms and single sections (`SectionName`). |
|
|
23
|
+
| **Form host** | `MjEntityFormHostComponent` (`<mj-entity-form-host>`) | Presentation-agnostic: resolve → load → create → bind → re-emit → teardown. Supports full forms and single sections (`SectionName`). Standard-form switch: `FormMode`, `ShowFormModeSwitch`, `FormModeChange`, `SwitchFormMode()` — see [Standard-form switch](#standard-form-switch). |
|
|
24
24
|
| **Overlay shells** | `MjFormDialogComponent`, `MjFormSlideInComponent`, `MjFormWindowComponent` (standalone) | Declarative dialog / slide-in / floating-window around the host. |
|
|
25
25
|
| **Imperative API** | `MJFormPresenterService.Open(...)` → `MJFormRef` | One call to open any form on any surface. |
|
|
26
26
|
| **Per-instance config** | `EntityFormConfig` + `TAB_/DIALOG_/SLIDEIN_FORM_CONFIG` | Toolbar / related sections / collapsibility / width / record-links. Applied via the form reference — **no regeneration**. |
|
|
27
|
-
| **Form resolution** | `FormResolverService` | Picks generated / custom / interactive-override form + variants (cached via `InteractiveFormsEngine`). |
|
|
27
|
+
| **Form resolution** | `FormResolverService` | Picks generated / custom / interactive-override form + variants (cached via `InteractiveFormsEngine`). `FormResolution.standard`, `ResolveStandardForm()` and `HasStandardFormAlternative()` expose the generated form a custom one hides. |
|
|
28
28
|
| **Form extension** | `BaseFormPanel` + `<mj-form-panel-slot>` + `<mj-form-contributions>` | Inject custom sections; claim a related-entity grid; fill in unbaked `DisplayInForm` relationships. See [PANELS.md](./PANELS.md) and [`/plans/form-contributions.md`](../../../../plans/form-contributions.md). |
|
|
29
29
|
| **Form chrome** | `ResolveFormChrome`, `BaseFormPolicy`, `MJ: Form Chrome Rules` | L0–L4 stack: inclusion, Auto ranker, install overlay, user order. Policy is cosmetics only. Left-nav related grids fill leftover column height (`display: contents` on slot hosts; no accordion pixel pin). `SetSectionRowCount` upserts so contribution badges appear. Section search matches title/`MatchesSearch`, not `IsVisible`. See [Forms Architecture §7d](../../../../guides/FORMS_ARCHITECTURE_GUIDE.md#7d-form-chrome--accordion-left-nav-and-more). |
|
|
30
|
+
| **Pluggable toolbar actions** | `BaseFormToolbarAction`, `@RegisterFormToolbarAction`, `RecordLinksToolbarAction`, `ResolveFormToolbarActionsForEntity` | Register toolbar buttons with `EntityScope` (`'*'`, exact entity, glob wildcard, `schema:*`, or array) and lifecycle hooks (`IsApplicable`, `OnInit`, `OnPrewarm`, `OnPinStateChanged`, `OnRecordSaved`, `OnRecordRefreshed`, `OnExecute`, `OnDestroy`). Supports subclassing & prototype-chain metadata inheritance. See [Pluggable toolbar actions](#pluggable-toolbar-actions) and [Forms Architecture §7e](../../../../guides/FORMS_ARCHITECTURE_GUIDE.md#7e-pluggable-form-toolbar-actions-baseformtoolbaraction--registerformtoolbaraction). |
|
|
31
|
+
| **Record links & hover cards** | `MjRecordLinksComponent` (`<mj-record-links>`), `MjRecordPreviewPopoverComponent` (`<mj-record-preview-popover>`), `MjRecordPreviewDirective` (`[mjRecordPreview]`) | Bidirectional record links drawer (outbound FKs, inbound related entities, polymorphic links) with pin-aware pre-warming and Sage `LinksSummary` context; hover preview cards on read-mode FK links. See [Forms Architecture §7f](../../../../guides/FORMS_ARCHITECTURE_GUIDE.md#7f-bidirectional-record-links-mj-record-links--hover-preview-cards-mj-record-preview-popover). |
|
|
32
|
+
| **Time-travel version preview** | `MjRecordFormContainerComponent` (`ActiveVersionPreview`, `OnPreviewVersionSelected`, `OnStepVersionPreview`, `OnExitVersionPreview`), `FormSlotCoordinator.VersionPreviewChanged$` | Rehydrates historical `FullRecordJSON` + `ChangesJSON` snapshots directly inside the form with a top Time-Travel Scrubber Bar and changed-field jump chips. See [Forms Architecture §7g](../../../../guides/FORMS_ARCHITECTURE_GUIDE.md#7g-in-form-time-travel-version-preview--record-changes-activity-sparkline). |
|
|
30
33
|
| **New-record defaults** | `BaseFormComponent.NewRecordValues` / `NewRecordValuesForJoinFields` | Related grids copy every join field onto the child. Explorer persists them as `/record/:entity/new?NewRecordValues=...`. |
|
|
31
34
|
|
|
32
35
|
## Quick start
|
|
@@ -48,9 +51,199 @@ const saved = await ref.AfterSaved(); // BaseEntity | null
|
|
|
48
51
|
[(Visible)]="show" (Saved)="onSaved($event)"></mj-form-dialog>
|
|
49
52
|
```
|
|
50
53
|
|
|
54
|
+
## Standard-form switch
|
|
55
|
+
|
|
56
|
+
A custom class form registered at a higher priority, or an active interactive
|
|
57
|
+
override (`EntityFormOverride`), hides the CodeGen-generated form for its
|
|
58
|
+
entity. Before MJ#4755 the generated form was unreachable — even a hand-built
|
|
59
|
+
record URL resolved to the custom form — and an entity whose custom form only
|
|
60
|
+
handles existing records had no way to create one.
|
|
61
|
+
|
|
62
|
+
`<mj-entity-form-host>` now shows a slim "Open standard form" / "Back to custom
|
|
63
|
+
view" strip whenever a custom form hides the generated one. Entities whose only
|
|
64
|
+
registration is the generated form (the common case) get no strip.
|
|
65
|
+
|
|
66
|
+
| Member | Kind | Purpose |
|
|
67
|
+
|---|---|---|
|
|
68
|
+
| `FormMode: EntityFormMode` | `@Input` | `'default'` (the resolver's normal pick) or `'standard'` (the generated form). A change after the view initializes reloads the form and does **not** emit `FormModeChange`. If the entity has no standard form, the host falls back to the default and logs. |
|
|
69
|
+
| `ShowFormModeSwitch = true` | `@Input` | Set `false` to hide the strip; `FormMode` is still honoured. |
|
|
70
|
+
| `FormModeChange: EventEmitter<EntityFormMode>` | `@Output` | Emits when the mode changes from inside the host — the strip, `SwitchFormMode()`, or picking an interactive variant (which returns to `'default'`) — so the surface can persist it. |
|
|
71
|
+
| `SwitchFormMode(mode): boolean` | method | Switch programmatically. Returns `false` when refused (see below), `true` otherwise (including when already in `mode`). |
|
|
72
|
+
|
|
73
|
+
**What "standard" means.** The standard form is the **lowest-priority**
|
|
74
|
+
`BaseFormComponent` registration for the entity
|
|
75
|
+
(`FormResolverService.ResolveStandardForm`). CodeGen registers its form with no
|
|
76
|
+
explicit priority, and a custom form either declares a higher one or extends the
|
|
77
|
+
generated class (so it registers later and gets a higher auto priority).
|
|
78
|
+
`HasStandardFormAlternative(resolution)` is true only when that form exists and
|
|
79
|
+
is not the one already mounted.
|
|
80
|
+
|
|
81
|
+
**Unsaved work is never discarded.** A switch remounts the form, so the host
|
|
82
|
+
refuses it — returning `false` and emitting a `warning` `Notification` — when:
|
|
83
|
+
|
|
84
|
+
- a **saved** record is dirty (`record.IsSaved && record.Dirty`), or
|
|
85
|
+
- the form holds unsaved work outside the record's own fields
|
|
86
|
+
(`BaseFormComponent.HasUnsavedChangesBeyondRecord`: pending related-record
|
|
87
|
+
edits/deletes or `HasAdditionalUnsavedChanges`), for new and saved records alike.
|
|
88
|
+
|
|
89
|
+
**A new record keeps its values.** An unsaved new record (with no other pending
|
|
90
|
+
work) switches freely: the live record instance is carried into the other form,
|
|
91
|
+
so fields already typed survive the switch.
|
|
92
|
+
|
|
93
|
+
**Permissions are unchanged.** The standard form enforces the same entity
|
|
94
|
+
permissions as any other form; switching grants nothing.
|
|
95
|
+
|
|
96
|
+
**In Explorer** the mode lives in the record tab's `form` query param
|
|
97
|
+
(`?form=standard`), which is the source of truth. `NavigationOptions.formMode`,
|
|
98
|
+
a `?form=standard` deep link, back/forward and tab re-focus all reach the
|
|
99
|
+
mounted record through `OnQueryParamsChanged`, which switches via
|
|
100
|
+
`SwitchFormMode` (so the unsaved-work guard still applies; a refused switch
|
|
101
|
+
writes the on-screen mode back to the URL). A strip switch writes the param
|
|
102
|
+
back, so the URL records the requested mode, and a record URL without `form`
|
|
103
|
+
means the default form. (When the entity has no standard form, the host falls
|
|
104
|
+
back to the default form even if `form=standard` is requested.)
|
|
105
|
+
|
|
106
|
+
## Pluggable toolbar actions
|
|
107
|
+
|
|
108
|
+
Toolbar buttons in `<mj-form-toolbar>` are extensible through **`BaseFormToolbarAction`** and **`@RegisterFormToolbarAction(metadata, priority?)`**.
|
|
109
|
+
|
|
110
|
+
### 1. Registering a new toolbar action
|
|
111
|
+
|
|
112
|
+
```typescript
|
|
113
|
+
import {
|
|
114
|
+
BaseFormToolbarAction,
|
|
115
|
+
RegisterFormToolbarAction,
|
|
116
|
+
type FormToolbarActionLifecycleContext,
|
|
117
|
+
} from '@memberjunction/ng-base-forms';
|
|
118
|
+
|
|
119
|
+
@RegisterFormToolbarAction({
|
|
120
|
+
Key: 'audit-verify',
|
|
121
|
+
MenuLabel: 'Verify Record',
|
|
122
|
+
Tooltip: 'Run verification checks',
|
|
123
|
+
Icon: 'fa-solid fa-circle-check',
|
|
124
|
+
EntityScope: ['MJ_BizApps_Common: People', 'MJ_BizApps_Orders:*'], // '*', exact name, glob, 'schema:x', or string[]
|
|
125
|
+
Order: 50,
|
|
126
|
+
Pinnable: true,
|
|
127
|
+
Mode: 'action', // 'action' | 'toggle-drawer'
|
|
128
|
+
})
|
|
129
|
+
export class VerifyRecordToolbarAction extends BaseFormToolbarAction {
|
|
130
|
+
public override async OnPrewarm(ctx: FormToolbarActionLifecycleContext): Promise<void> {
|
|
131
|
+
if (!ctx.IsPinned) return; // Avoid background queries unless pinned to the toolbar
|
|
132
|
+
ctx.SetBadge('✓');
|
|
133
|
+
ctx.RequestChangeDetection();
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
public override async OnExecute(ctx: FormToolbarActionLifecycleContext): Promise<void> {
|
|
137
|
+
// Handle button click
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### 2. Subclassing & overriding an existing toolbar button
|
|
143
|
+
|
|
144
|
+
You can subclass an existing toolbar action plugin (such as `RecordLinksToolbarAction`) to override it either globally (`EntityScope: '*'`) or for specific entities.
|
|
145
|
+
|
|
146
|
+
- **Prototype metadata inheritance**: `ResolveFormToolbarActionsForEntity` walks the prototype chain and merges ancestor registration metadata (`{ ...ancestorMetadata, ...childMetadata }`). You only need to declare the properties you are overriding (`Key`, `Icon`, `Order`, `Pinnable`, and `Mode` are inherited automatically).
|
|
147
|
+
- **3-tier winner resolution per `Key`**:
|
|
148
|
+
1. A subclass (`Sub.prototype instanceof Super`) always overrides its superclass.
|
|
149
|
+
2. An entity-specific `EntityScope` overrides a global (`'*'`) scope of equal priority.
|
|
150
|
+
3. Higher ClassFactory `Priority` wins.
|
|
151
|
+
|
|
152
|
+
```typescript
|
|
153
|
+
import {
|
|
154
|
+
RecordLinksToolbarAction,
|
|
155
|
+
RegisterFormToolbarAction,
|
|
156
|
+
} from '@memberjunction/ng-base-forms';
|
|
157
|
+
|
|
158
|
+
@RegisterFormToolbarAction({
|
|
159
|
+
EntityScope: 'MJ_BizApps_Common: People',
|
|
160
|
+
MenuLabel: 'Person Graph',
|
|
161
|
+
})
|
|
162
|
+
export class PersonLinksToolbarAction extends RecordLinksToolbarAction {
|
|
163
|
+
// Inherits Key: 'links', Icon, Order, Pinnable, and Mode from RecordLinksToolbarAction
|
|
164
|
+
}
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
## Declarative Record Links (`[mjRecordLink]` & `<mj-record-link>`)
|
|
168
|
+
|
|
169
|
+
Any custom form header, `BaseFormPanel`, or dashboard widget can attach MemberJunction's full record-linking UX (hover-intent `<mj-record-preview-popover>`, inline Quick Edit with live propagation back to virtual display fields on `Record`, standard + polymorphic FK resolution, and click/Ctrl+Click `FormNavigationEvent` navigation) using `[mjRecordLink]` or `<mj-record-link>`:
|
|
170
|
+
|
|
171
|
+
### 1. Field-Driven Mode (`[mjRecordLink]="Record" FieldName="..."`)
|
|
172
|
+
|
|
173
|
+
Resolves the target entity, primary key, and companion virtual display column (e.g., `CurrentOrganizationName`) directly from `Record.EntityInfo.Fields` metadata (supporting both standard `RelatedEntity` FKs and polymorphic `EntityIDFieldName` pairs):
|
|
174
|
+
|
|
175
|
+
```html
|
|
176
|
+
<button
|
|
177
|
+
type="button"
|
|
178
|
+
class="biz-hero__stat-val"
|
|
179
|
+
[mjRecordLink]="Record"
|
|
180
|
+
FieldName="CurrentOrganizationID"
|
|
181
|
+
(Navigate)="Navigate.emit($event)">
|
|
182
|
+
{{ Record.CurrentOrganizationName }}
|
|
183
|
+
</button>
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
### 2. Direct Mode (`mjRecordLink [EntityName]="..." [RecordID]="..."`)
|
|
187
|
+
|
|
188
|
+
Use when linking from a custom projection, DTO, or list row where no `BaseEntity` field metadata is involved:
|
|
189
|
+
|
|
190
|
+
```html
|
|
191
|
+
<button
|
|
192
|
+
type="button"
|
|
193
|
+
mjRecordLink
|
|
194
|
+
[EntityName]="'MJ_BizApps_Common: People'"
|
|
195
|
+
[RecordID]="row.PersonID"
|
|
196
|
+
[DisplayName]="row.PersonName"
|
|
197
|
+
(Navigate)="Navigate.emit($event)">
|
|
198
|
+
{{ row.PersonName }}
|
|
199
|
+
</button>
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
### 3. Ready-Made `<mj-record-link>` Component
|
|
203
|
+
|
|
204
|
+
Renders an inline hyperlink, pill chip (`Variant="chip"`), or link box (`Variant="box"`) and automatically resolves the target record's display name via `GetEntityRecordName` when `DisplayName` is omitted:
|
|
205
|
+
|
|
206
|
+
```html
|
|
207
|
+
<mj-record-link
|
|
208
|
+
[Record]="Record"
|
|
209
|
+
FieldName="CurrentOrganizationID"
|
|
210
|
+
Variant="chip"
|
|
211
|
+
(Navigate)="Navigate.emit($event)">
|
|
212
|
+
</mj-record-link>
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
### 4. Pluggable Hover Preview Card (`MjRecordPreviewPopoverComponent` & `@RegisterClass`)
|
|
216
|
+
|
|
217
|
+
The singleton `MjRecordPreviewPopoverService` mounts a single `<mj-record-preview-popover>` at `document.body` featuring the **Option A** UX:
|
|
218
|
+
- **Header action micro-cluster**: Copyable compact Record ID (`9FAF60…C577`), Quick Edit (`[✎]`), and Open in New Tab (`[↗]`) sit in the top-right header.
|
|
219
|
+
- **Clickable record title**: Clicking the record title (`Mathieu Grantham →`) navigates directly to the record (`Ctrl`/`Cmd`-click or middle-click opens in a new tab), eliminating redundant bottom buttons in Read mode.
|
|
220
|
+
- **Auto-spanning wide fields**: Wide values (`Email`, `URL`, `Title`, or values `> 22` characters) automatically span both columns (`grid-column: 1 / -1`) so they never truncate prematurely.
|
|
221
|
+
- **Contextual Quick Edit footer & cancellable save event**: Entering Quick Edit reveals a slim `Cancel` / `Save` footer bar and emits `BeforeQuickEditSave` (cancellable via `args.Cancel = true`) and `AfterQuickEditSaved` / `RecordUpdated`.
|
|
222
|
+
|
|
223
|
+
You can subclass `MjRecordPreviewPopoverComponent` and register your custom preview card with `@RegisterClass` so `MjRecordPreviewPopoverService` instantiates your subclass dynamically via `MJGlobal.Instance.ClassFactory`:
|
|
224
|
+
|
|
225
|
+
- **Global override (all entities)**: `@RegisterClass(MjRecordPreviewPopoverComponent)`
|
|
226
|
+
- **Schema or wildcard override**: `@RegisterClass(MjRecordPreviewPopoverComponent, 'MJ_BizApps_Common:*')` or `@RegisterClass(MjRecordPreviewPopoverComponent, 'schema:mj_bizapps_common')`
|
|
227
|
+
- **Entity-specific override**: `@RegisterClass(MjRecordPreviewPopoverComponent, 'MJ_BizApps_Common: People')`
|
|
228
|
+
|
|
229
|
+
```typescript
|
|
230
|
+
import { RegisterClass } from '@memberjunction/global';
|
|
231
|
+
import { EntityFieldInfo, EntityInfo } from '@memberjunction/core';
|
|
232
|
+
import { MjRecordPreviewPopoverComponent } from '@memberjunction/ng-base-forms';
|
|
233
|
+
|
|
234
|
+
@RegisterClass(MjRecordPreviewPopoverComponent, 'MJ_BizApps_Common: People')
|
|
235
|
+
export class CustomPersonPreviewPopoverComponent extends MjRecordPreviewPopoverComponent {
|
|
236
|
+
protected override selectPreviewFields(entityInfo: EntityInfo): EntityFieldInfo[] {
|
|
237
|
+
// Customize which summary fields appear on the People hover card
|
|
238
|
+
return super.selectPreviewFields(entityInfo);
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
```
|
|
242
|
+
|
|
51
243
|
## Related docs
|
|
52
244
|
|
|
53
245
|
- **Architecture (read first):** [/guides/FORMS_ARCHITECTURE_GUIDE.md](../../../../guides/FORMS_ARCHITECTURE_GUIDE.md)
|
|
54
246
|
- **Inject custom sections into a form:** [PANELS.md](./PANELS.md)
|
|
55
247
|
- **Form chrome (rail / More / inclusion):** [Forms Architecture §7d](../../../../guides/FORMS_ARCHITECTURE_GUIDE.md#7d-form-chrome--accordion-left-nav-and-more)
|
|
248
|
+
- **Pluggable toolbar actions & Record Links:** [Forms Architecture §7e–§7g](../../../../guides/FORMS_ARCHITECTURE_GUIDE.md#7e-pluggable-form-toolbar-actions-baseformtoolbaraction--registerformtoolbaraction)
|
|
56
249
|
- **Custom-form override + toolbar pattern:** [packages/Angular/CLAUDE.md](../../CLAUDE.md)
|
|
@@ -209,6 +209,11 @@ export declare abstract class BaseFormComponent extends BaseRecordComponent impl
|
|
|
209
209
|
*/
|
|
210
210
|
CompositionSnapshot: FormCompositionSnapshot | null;
|
|
211
211
|
CompositionChanged: EventEmitter<FormCompositionSnapshot>;
|
|
212
|
+
/**
|
|
213
|
+
* Emitted when the user clicks the "Ask AI" action in the form toolbar to open the
|
|
214
|
+
* AI chat overlay with this record's live context.
|
|
215
|
+
*/
|
|
216
|
+
AskAIRequested: EventEmitter<void>;
|
|
212
217
|
private readonly _formPanels;
|
|
213
218
|
/** Slot hosts register every mounted panel so validation can include panel-owned checks. */
|
|
214
219
|
RegisterFormPanel(panel: BaseFormPanel): void;
|
|
@@ -243,6 +248,23 @@ export declare abstract class BaseFormComponent extends BaseRecordComponent impl
|
|
|
243
248
|
* extra state.
|
|
244
249
|
*/
|
|
245
250
|
get HasAdditionalUnsavedChanges(): boolean;
|
|
251
|
+
/**
|
|
252
|
+
* Whether the form holds unsaved work that its record's own fields don't show: pending related
|
|
253
|
+
* records (a child grid's edits or deletes) or {@link HasAdditionalUnsavedChanges}. Hosts consult
|
|
254
|
+
* it before tearing the form down (e.g. the standard-form switch); combine with `record.Dirty`
|
|
255
|
+
* for the full picture.
|
|
256
|
+
*
|
|
257
|
+
* A pure read, unlike {@link PendingRecordsDirty}: that path raises EDITING_COMPLETE (child grids
|
|
258
|
+
* commit in-progress cell edits on it) and rebuilds `_pendingRecords`, which the save pipeline
|
|
259
|
+
* owns. Here descendants only report their pending changes into a throwaway event, so asking
|
|
260
|
+
* changes nothing. An edit still open in a grid cell (not yet committed to its entity) is not seen.
|
|
261
|
+
*
|
|
262
|
+
* Entries the form itself already holds in `PendingRecords` count too, but only while editing:
|
|
263
|
+
* some forms add related-record changes there directly instead of reporting them on the event
|
|
264
|
+
* (the AI Agent form's "Remove action", added actions and prompts), and `CancelEdit` reverts
|
|
265
|
+
* saves but leaves delete entries in the list, so outside edit mode they are stale.
|
|
266
|
+
*/
|
|
267
|
+
get HasUnsavedChangesBeyondRecord(): boolean;
|
|
246
268
|
protected PendingRecordsDirty(): boolean;
|
|
247
269
|
protected PopulatePendingRecords(): void;
|
|
248
270
|
protected ValidatePendingRecords(): ValidationResult[];
|
|
@@ -568,6 +590,6 @@ export declare abstract class BaseFormComponent extends BaseRecordComponent impl
|
|
|
568
590
|
*/
|
|
569
591
|
OnListManagementRequested(): void;
|
|
570
592
|
static ɵfac: i0.ɵɵFactoryDeclaration<BaseFormComponent, never>;
|
|
571
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<BaseFormComponent, never, never, {}, { "Navigate": "Navigate"; "Notification": "Notification"; "RecordSaved": "RecordSaved"; "RecordRefreshed": "RecordRefreshed"; "RecordDeleted": "RecordDeleted"; "RecordSaveFailed": "RecordSaveFailed"; "RecordDeleteFailed": "RecordDeleteFailed"; "ValidationFailed": "ValidationFailed"; "RecordReady": "RecordReady"; "EditModeChanged": "EditModeChanged"; "CompositionChanged": "CompositionChanged"; "SectionRowCountChanged": "SectionRowCountChanged"; }, never, never, true, never>;
|
|
593
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<BaseFormComponent, never, never, {}, { "Navigate": "Navigate"; "Notification": "Notification"; "RecordSaved": "RecordSaved"; "RecordRefreshed": "RecordRefreshed"; "RecordDeleted": "RecordDeleted"; "RecordSaveFailed": "RecordSaveFailed"; "RecordDeleteFailed": "RecordDeleteFailed"; "ValidationFailed": "ValidationFailed"; "RecordReady": "RecordReady"; "EditModeChanged": "EditModeChanged"; "CompositionChanged": "CompositionChanged"; "AskAIRequested": "AskAIRequested"; "SectionRowCountChanged": "SectionRowCountChanged"; }, never, never, true, never>;
|
|
572
594
|
}
|
|
573
595
|
//# sourceMappingURL=base-form-component.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-form-component.d.ts","sourceRoot":"","sources":["../../src/lib/base-form-component.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EAAE,MAAM,EAAE,SAAS,EAClB,SAAS,EAAE,UAAU,EAAE,iBAAiB,EAC9C,YAAY,EACrB,MAAM,eAAe,CAAC;AAGvB,OAAO,EACL,UAAU,EAAE,gBAAgB,EAAE,UAAU,EAAE,oBAAoB,EAC9D,sBAAsB,EAAE,oBAAoB,EAAE,iCAAiC,EACrE,aAAa,EACvB,gBAAgB,EACjB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,wBAAwB,EAAE,iBAAiB,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AACzH,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAE7D,OAAO,KAAK,EAAE,uBAAuB,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAC;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IAW3B,eAAe,IAAI,MAAM,EAAE;IAW3B,eAAe,CAAC,YAAY,EAAE,MAAM,EAAE,GAAG,IAAI;IAO7C,iBAAiB,IAAI,IAAI;IAOzB,qBAAqB,IAAI,OAAO;IAQhC,kBAAkB,IAAI,MAAM,EAAE;IAM9B,wBAAwB,IAAI,MAAM,EAAE;IAMpC,mBAAmB,CAAC,eAAe,EAAE,MAAM,EAAE,EAAE,qBAAqB,EAAE,MAAM,EAAE,GAAG,IAAI;IAOrF,sBAAsB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM;IAMzD;;;;;;;OAOG;IACI,oBAAoB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;IAS9D;;;;OAIG;IACI,cAAc,CAAC,KAAK,EAAE,mBAAmB,GAAG,IAAI;IAIvD;;;;OAIG;IACU,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC;IAsB/C;;;OAGG;IACU,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC;IAI/C;;;OAGG;IACI,kBAAkB,IAAI,IAAI;IAIjC;;;OAGG;IACI,yBAAyB,IAAI,IAAI;yCAloDpB,iBAAiB;2CAAjB,iBAAiB;CAwoDtC"}
|
|
@@ -238,6 +238,11 @@ export class BaseFormComponent extends BaseRecordComponent {
|
|
|
238
238
|
*/
|
|
239
239
|
CompositionSnapshot = null;
|
|
240
240
|
CompositionChanged = new EventEmitter();
|
|
241
|
+
/**
|
|
242
|
+
* Emitted when the user clicks the "Ask AI" action in the form toolbar to open the
|
|
243
|
+
* AI chat overlay with this record's live context.
|
|
244
|
+
*/
|
|
245
|
+
AskAIRequested = new EventEmitter();
|
|
241
246
|
_formPanels = new Set();
|
|
242
247
|
/** Slot hosts register every mounted panel so validation can include panel-owned checks. */
|
|
243
248
|
RegisterFormPanel(panel) {
|
|
@@ -323,6 +328,31 @@ export class BaseFormComponent extends BaseRecordComponent {
|
|
|
323
328
|
get HasAdditionalUnsavedChanges() {
|
|
324
329
|
return false;
|
|
325
330
|
}
|
|
331
|
+
/**
|
|
332
|
+
* Whether the form holds unsaved work that its record's own fields don't show: pending related
|
|
333
|
+
* records (a child grid's edits or deletes) or {@link HasAdditionalUnsavedChanges}. Hosts consult
|
|
334
|
+
* it before tearing the form down (e.g. the standard-form switch); combine with `record.Dirty`
|
|
335
|
+
* for the full picture.
|
|
336
|
+
*
|
|
337
|
+
* A pure read, unlike {@link PendingRecordsDirty}: that path raises EDITING_COMPLETE (child grids
|
|
338
|
+
* commit in-progress cell edits on it) and rebuilds `_pendingRecords`, which the save pipeline
|
|
339
|
+
* owns. Here descendants only report their pending changes into a throwaway event, so asking
|
|
340
|
+
* changes nothing. An edit still open in a grid cell (not yet committed to its entity) is not seen.
|
|
341
|
+
*
|
|
342
|
+
* Entries the form itself already holds in `PendingRecords` count too, but only while editing:
|
|
343
|
+
* some forms add related-record changes there directly instead of reporting them on the event
|
|
344
|
+
* (the AI Agent form's "Remove action", added actions and prompts), and `CancelEdit` reverts
|
|
345
|
+
* saves but leaves delete entries in the list, so outside edit mode they are stale.
|
|
346
|
+
*/
|
|
347
|
+
get HasUnsavedChangesBeyondRecord() {
|
|
348
|
+
if (this.HasAdditionalUnsavedChanges)
|
|
349
|
+
return true;
|
|
350
|
+
const isUnsaved = (p) => p.action === 'delete' || p.entityObject.Dirty;
|
|
351
|
+
if (this.EditMode && this._pendingRecords.some(isUnsaved))
|
|
352
|
+
return true;
|
|
353
|
+
const reported = this.RaiseEvent(BaseFormComponentEventCodes.POPULATE_PENDING_RECORDS).pendingChanges;
|
|
354
|
+
return reported.some(isUnsaved);
|
|
355
|
+
}
|
|
326
356
|
PendingRecordsDirty() {
|
|
327
357
|
this.PopulatePendingRecords();
|
|
328
358
|
const pendingRecords = this.PendingRecords;
|
|
@@ -616,18 +646,30 @@ export class BaseFormComponent extends BaseRecordComponent {
|
|
|
616
646
|
if (this._pendingRecords.length > 0) {
|
|
617
647
|
const md = this.ProviderToUse;
|
|
618
648
|
const tg = await md.CreateTransactionGroup();
|
|
619
|
-
this.record.
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
649
|
+
const members = [this.record, ...this._pendingRecords.map(x => x.entityObject)];
|
|
650
|
+
try {
|
|
651
|
+
this.record.TransactionGroup = tg;
|
|
652
|
+
await this.record.Save();
|
|
653
|
+
for (const x of this._pendingRecords) {
|
|
654
|
+
x.entityObject.TransactionGroup = tg;
|
|
655
|
+
if (x.action === 'save') {
|
|
656
|
+
await x.entityObject.Save();
|
|
657
|
+
}
|
|
658
|
+
else {
|
|
659
|
+
await x.entityObject.Delete();
|
|
660
|
+
}
|
|
625
661
|
}
|
|
626
|
-
|
|
627
|
-
|
|
662
|
+
return await tg.Submit();
|
|
663
|
+
}
|
|
664
|
+
finally {
|
|
665
|
+
// A member that keeps this group after Submit would queue its next Save()/Delete() into a
|
|
666
|
+
// group that is already complete, and that call would report success without sending anything.
|
|
667
|
+
for (const member of members) {
|
|
668
|
+
if (member.TransactionGroup === tg) {
|
|
669
|
+
member.TransactionGroup = null;
|
|
670
|
+
}
|
|
628
671
|
}
|
|
629
672
|
}
|
|
630
|
-
return await tg.Submit();
|
|
631
673
|
}
|
|
632
674
|
else {
|
|
633
675
|
return await this.record.Save();
|
|
@@ -1459,7 +1501,7 @@ export class BaseFormComponent extends BaseRecordComponent {
|
|
|
1459
1501
|
} if (rf & 2) {
|
|
1460
1502
|
let _t;
|
|
1461
1503
|
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.collapsiblePanels = _t);
|
|
1462
|
-
} }, outputs: { Navigate: "Navigate", Notification: "Notification", RecordSaved: "RecordSaved", RecordRefreshed: "RecordRefreshed", RecordDeleted: "RecordDeleted", RecordSaveFailed: "RecordSaveFailed", RecordDeleteFailed: "RecordDeleteFailed", ValidationFailed: "ValidationFailed", RecordReady: "RecordReady", EditModeChanged: "EditModeChanged", CompositionChanged: "CompositionChanged", SectionRowCountChanged: "SectionRowCountChanged" }, features: [i0.ɵɵInheritDefinitionFeature] });
|
|
1504
|
+
} }, outputs: { Navigate: "Navigate", Notification: "Notification", RecordSaved: "RecordSaved", RecordRefreshed: "RecordRefreshed", RecordDeleted: "RecordDeleted", RecordSaveFailed: "RecordSaveFailed", RecordDeleteFailed: "RecordDeleteFailed", ValidationFailed: "ValidationFailed", RecordReady: "RecordReady", EditModeChanged: "EditModeChanged", CompositionChanged: "CompositionChanged", AskAIRequested: "AskAIRequested", SectionRowCountChanged: "SectionRowCountChanged" }, features: [i0.ɵɵInheritDefinitionFeature] });
|
|
1463
1505
|
}
|
|
1464
1506
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(BaseFormComponent, [{
|
|
1465
1507
|
type: Directive
|
|
@@ -1485,6 +1527,8 @@ export class BaseFormComponent extends BaseRecordComponent {
|
|
|
1485
1527
|
type: Output
|
|
1486
1528
|
}], CompositionChanged: [{
|
|
1487
1529
|
type: Output
|
|
1530
|
+
}], AskAIRequested: [{
|
|
1531
|
+
type: Output
|
|
1488
1532
|
}], SectionRowCountChanged: [{
|
|
1489
1533
|
type: Output
|
|
1490
1534
|
}], collapsiblePanels: [{
|