@memberjunction/ng-base-forms 6.2.0-edge.2 → 6.2.0-edge.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/apply/form-placement-dialog.component.d.ts +266 -0
- package/dist/lib/apply/form-placement-dialog.component.d.ts.map +1 -0
- package/dist/lib/apply/form-placement-dialog.component.js +1522 -0
- package/dist/lib/apply/form-placement-dialog.component.js.map +1 -0
- package/dist/lib/apply/form-placement-order.d.ts +37 -0
- package/dist/lib/apply/form-placement-order.d.ts.map +1 -0
- package/dist/lib/apply/form-placement-order.js +111 -0
- package/dist/lib/apply/form-placement-order.js.map +1 -0
- package/dist/lib/apply/form-placement-preview.component.d.ts +112 -0
- package/dist/lib/apply/form-placement-preview.component.d.ts.map +1 -0
- package/dist/lib/apply/form-placement-preview.component.js +346 -0
- package/dist/lib/apply/form-placement-preview.component.js.map +1 -0
- package/dist/lib/apply/form-placement-text.d.ts +61 -0
- package/dist/lib/apply/form-placement-text.d.ts.map +1 -0
- package/dist/lib/apply/form-placement-text.js +279 -0
- package/dist/lib/apply/form-placement-text.js.map +1 -0
- package/dist/lib/apply/form-placement.d.ts +320 -0
- package/dist/lib/apply/form-placement.d.ts.map +1 -0
- package/dist/lib/apply/form-placement.js +432 -0
- package/dist/lib/apply/form-placement.js.map +1 -0
- package/dist/lib/apply/form-slot-probe.service.d.ts +121 -0
- package/dist/lib/apply/form-slot-probe.service.d.ts.map +1 -0
- package/dist/lib/apply/form-slot-probe.service.js +264 -0
- package/dist/lib/apply/form-slot-probe.service.js.map +1 -0
- package/dist/lib/base-form-component-internals.d.ts +11 -0
- package/dist/lib/base-form-component-internals.d.ts.map +1 -0
- package/dist/lib/base-form-component-internals.js +33 -0
- package/dist/lib/base-form-component-internals.js.map +1 -0
- package/dist/lib/base-form-component.d.ts +132 -1
- package/dist/lib/base-form-component.d.ts.map +1 -1
- package/dist/lib/base-form-component.js +228 -19
- package/dist/lib/base-form-component.js.map +1 -1
- package/dist/lib/chrome/form-chrome.d.ts +78 -0
- package/dist/lib/chrome/form-chrome.d.ts.map +1 -1
- package/dist/lib/chrome/form-chrome.js +128 -2
- package/dist/lib/chrome/form-chrome.js.map +1 -1
- package/dist/lib/chrome/form-composition-registry.d.ts +34 -0
- package/dist/lib/chrome/form-composition-registry.d.ts.map +1 -0
- package/dist/lib/chrome/form-composition-registry.js +56 -0
- package/dist/lib/chrome/form-composition-registry.js.map +1 -0
- package/dist/lib/chrome/form-composition-snapshot.d.ts +151 -0
- package/dist/lib/chrome/form-composition-snapshot.d.ts.map +1 -0
- package/dist/lib/chrome/form-composition-snapshot.js +137 -0
- package/dist/lib/chrome/form-composition-snapshot.js.map +1 -0
- package/dist/lib/chrome/resolve-form-chrome.d.ts +15 -0
- package/dist/lib/chrome/resolve-form-chrome.d.ts.map +1 -1
- package/dist/lib/chrome/resolve-form-chrome.js +31 -2
- package/dist/lib/chrome/resolve-form-chrome.js.map +1 -1
- package/dist/lib/container/record-form-container.component.d.ts +240 -5
- package/dist/lib/container/record-form-container.component.d.ts.map +1 -1
- package/dist/lib/container/record-form-container.component.js +976 -249
- package/dist/lib/container/record-form-container.component.js.map +1 -1
- package/dist/lib/field/form-field.component.d.ts +17 -0
- package/dist/lib/field/form-field.component.d.ts.map +1 -1
- package/dist/lib/field/form-field.component.js +41 -5
- package/dist/lib/field/form-field.component.js.map +1 -1
- package/dist/lib/form-state.service.d.ts +5 -0
- package/dist/lib/form-state.service.d.ts.map +1 -1
- package/dist/lib/form-state.service.js +6 -1
- package/dist/lib/form-state.service.js.map +1 -1
- package/dist/lib/host/entity-form-host.component.d.ts +16 -1
- package/dist/lib/host/entity-form-host.component.d.ts.map +1 -1
- package/dist/lib/host/entity-form-host.component.js +27 -6
- package/dist/lib/host/entity-form-host.component.js.map +1 -1
- package/dist/lib/interactive-form/form-panel-host-props.builder.d.ts +24 -0
- package/dist/lib/interactive-form/form-panel-host-props.builder.d.ts.map +1 -0
- package/dist/lib/interactive-form/form-panel-host-props.builder.js +99 -0
- package/dist/lib/interactive-form/form-panel-host-props.builder.js.map +1 -0
- package/dist/lib/interactive-form/interactive-form-panel.component.d.ts +109 -0
- package/dist/lib/interactive-form/interactive-form-panel.component.d.ts.map +1 -0
- package/dist/lib/interactive-form/interactive-form-panel.component.js +424 -0
- package/dist/lib/interactive-form/interactive-form-panel.component.js.map +1 -0
- package/dist/lib/interactive-form/interactive-form.component.d.ts +2 -0
- package/dist/lib/interactive-form/interactive-form.component.d.ts.map +1 -1
- package/dist/lib/interactive-form/interactive-form.component.js +4 -5
- package/dist/lib/interactive-form/interactive-form.component.js.map +1 -1
- package/dist/lib/panel/collapsible-panel.component.d.ts +69 -1
- package/dist/lib/panel/collapsible-panel.component.d.ts.map +1 -1
- package/dist/lib/panel/collapsible-panel.component.js +148 -12
- package/dist/lib/panel/collapsible-panel.component.js.map +1 -1
- package/dist/lib/panel-manager/form-audience.d.ts +46 -0
- package/dist/lib/panel-manager/form-audience.d.ts.map +1 -0
- package/dist/lib/panel-manager/form-audience.js +34 -0
- package/dist/lib/panel-manager/form-audience.js.map +1 -0
- package/dist/lib/panel-manager/form-panel-admin.service.d.ts +150 -0
- package/dist/lib/panel-manager/form-panel-admin.service.d.ts.map +1 -0
- package/dist/lib/panel-manager/form-panel-admin.service.js +433 -0
- package/dist/lib/panel-manager/form-panel-admin.service.js.map +1 -0
- package/dist/lib/panel-manager/form-panel-inventory.d.ts +255 -0
- package/dist/lib/panel-manager/form-panel-inventory.d.ts.map +1 -0
- package/dist/lib/panel-manager/form-panel-inventory.js +293 -0
- package/dist/lib/panel-manager/form-panel-inventory.js.map +1 -0
- package/dist/lib/panel-manager/panel-manager.component.d.ts +232 -0
- package/dist/lib/panel-manager/panel-manager.component.d.ts.map +1 -0
- package/dist/lib/panel-manager/panel-manager.component.js +1112 -0
- package/dist/lib/panel-manager/panel-manager.component.js.map +1 -0
- package/dist/lib/panel-slot/base-contribution-panel.d.ts +40 -0
- package/dist/lib/panel-slot/base-contribution-panel.d.ts.map +1 -0
- package/dist/lib/panel-slot/base-contribution-panel.js +55 -0
- package/dist/lib/panel-slot/base-contribution-panel.js.map +1 -0
- package/dist/lib/panel-slot/base-form-panel.d.ts +116 -8
- package/dist/lib/panel-slot/base-form-panel.d.ts.map +1 -1
- package/dist/lib/panel-slot/base-form-panel.js +76 -5
- package/dist/lib/panel-slot/base-form-panel.js.map +1 -1
- package/dist/lib/panel-slot/collect-form-contribution-registrations.d.ts +29 -0
- package/dist/lib/panel-slot/collect-form-contribution-registrations.d.ts.map +1 -0
- package/dist/lib/panel-slot/collect-form-contribution-registrations.js +214 -0
- package/dist/lib/panel-slot/collect-form-contribution-registrations.js.map +1 -0
- package/dist/lib/panel-slot/collect-form-panel-registrations.d.ts +6 -3
- package/dist/lib/panel-slot/collect-form-panel-registrations.d.ts.map +1 -1
- package/dist/lib/panel-slot/collect-form-panel-registrations.js +8 -14
- package/dist/lib/panel-slot/collect-form-panel-registrations.js.map +1 -1
- package/dist/lib/panel-slot/form-contribution.d.ts +170 -7
- package/dist/lib/panel-slot/form-contribution.d.ts.map +1 -1
- package/dist/lib/panel-slot/form-contribution.js +242 -64
- package/dist/lib/panel-slot/form-contribution.js.map +1 -1
- package/dist/lib/panel-slot/form-contributions.component.d.ts +16 -5
- package/dist/lib/panel-slot/form-contributions.component.d.ts.map +1 -1
- package/dist/lib/panel-slot/form-contributions.component.js +43 -7
- package/dist/lib/panel-slot/form-contributions.component.js.map +1 -1
- package/dist/lib/panel-slot/form-field-panel-slot.component.d.ts +66 -0
- package/dist/lib/panel-slot/form-field-panel-slot.component.d.ts.map +1 -0
- package/dist/lib/panel-slot/form-field-panel-slot.component.js +190 -0
- package/dist/lib/panel-slot/form-field-panel-slot.component.js.map +1 -0
- package/dist/lib/panel-slot/form-panel-slot.component.d.ts +52 -16
- package/dist/lib/panel-slot/form-panel-slot.component.d.ts.map +1 -1
- package/dist/lib/panel-slot/form-panel-slot.component.js +190 -66
- package/dist/lib/panel-slot/form-panel-slot.component.js.map +1 -1
- package/dist/lib/panel-slot/form-slot-coordinator.service.d.ts +11 -0
- package/dist/lib/panel-slot/form-slot-coordinator.service.d.ts.map +1 -1
- package/dist/lib/panel-slot/form-slot-coordinator.service.js +17 -0
- package/dist/lib/panel-slot/form-slot-coordinator.service.js.map +1 -1
- package/dist/lib/panel-slot/merge-panel-validation.d.ts +7 -0
- package/dist/lib/panel-slot/merge-panel-validation.d.ts.map +1 -0
- package/dist/lib/panel-slot/merge-panel-validation.js +16 -0
- package/dist/lib/panel-slot/merge-panel-validation.js.map +1 -0
- package/dist/lib/panel-slot/mount-form-contribution.d.ts +15 -0
- package/dist/lib/panel-slot/mount-form-contribution.d.ts.map +1 -0
- package/dist/lib/panel-slot/mount-form-contribution.js +37 -0
- package/dist/lib/panel-slot/mount-form-contribution.js.map +1 -0
- package/dist/lib/panel-slot/panel-hides.d.ts +35 -0
- package/dist/lib/panel-slot/panel-hides.d.ts.map +1 -0
- package/dist/lib/panel-slot/panel-hides.js +111 -0
- package/dist/lib/panel-slot/panel-hides.js.map +1 -0
- package/dist/lib/panel-slot/placement-preview-panel.component.d.ts +16 -0
- package/dist/lib/panel-slot/placement-preview-panel.component.d.ts.map +1 -0
- package/dist/lib/panel-slot/placement-preview-panel.component.js +112 -0
- package/dist/lib/panel-slot/placement-preview-panel.component.js.map +1 -0
- package/dist/lib/panel-slot/placement-preview.d.ts +57 -0
- package/dist/lib/panel-slot/placement-preview.d.ts.map +1 -0
- package/dist/lib/panel-slot/placement-preview.js +86 -0
- package/dist/lib/panel-slot/placement-preview.js.map +1 -0
- package/dist/lib/panel-slot/related-entity-grid-panel.component.d.ts +2 -0
- package/dist/lib/panel-slot/related-entity-grid-panel.component.d.ts.map +1 -1
- package/dist/lib/panel-slot/related-entity-grid-panel.component.js +10 -3
- package/dist/lib/panel-slot/related-entity-grid-panel.component.js.map +1 -1
- package/dist/lib/panel-slot/slot-order.d.ts +19 -0
- package/dist/lib/panel-slot/slot-order.d.ts.map +1 -0
- package/dist/lib/panel-slot/slot-order.js +53 -0
- package/dist/lib/panel-slot/slot-order.js.map +1 -0
- package/dist/lib/resolver/form-resolver.service.d.ts +4 -2
- package/dist/lib/resolver/form-resolver.service.d.ts.map +1 -1
- package/dist/lib/resolver/form-resolver.service.js +18 -8
- package/dist/lib/resolver/form-resolver.service.js.map +1 -1
- package/dist/lib/resolver/form-variants.d.ts +28 -0
- package/dist/lib/resolver/form-variants.d.ts.map +1 -0
- package/dist/lib/resolver/form-variants.js +40 -0
- package/dist/lib/resolver/form-variants.js.map +1 -0
- package/dist/lib/section-counts/form-section-counts.d.ts +99 -0
- package/dist/lib/section-counts/form-section-counts.d.ts.map +1 -0
- package/dist/lib/section-counts/form-section-counts.js +223 -0
- package/dist/lib/section-counts/form-section-counts.js.map +1 -0
- package/dist/lib/toolbar/form-toolbar.component.d.ts +7 -0
- package/dist/lib/toolbar/form-toolbar.component.d.ts.map +1 -1
- package/dist/lib/toolbar/form-toolbar.component.js +194 -128
- package/dist/lib/toolbar/form-toolbar.component.js.map +1 -1
- package/dist/lib/types/form-types.d.ts +8 -0
- package/dist/lib/types/form-types.d.ts.map +1 -1
- package/dist/lib/types/form-types.js.map +1 -1
- package/dist/module.d.ts +29 -23
- package/dist/module.d.ts.map +1 -1
- package/dist/module.js +43 -5
- package/dist/module.js.map +1 -1
- package/dist/public-api.d.ts +20 -0
- package/dist/public-api.d.ts.map +1 -1
- package/dist/public-api.js +21 -0
- package/dist/public-api.js.map +1 -1
- package/package.json +20 -20
|
@@ -4,6 +4,8 @@ import { FormEditingCompleteEvent, PendingRecordItem, BaseFormComponentEventCode
|
|
|
4
4
|
import { MJListEntity } from '@memberjunction/core-entities';
|
|
5
5
|
import type { DuplicateEntryCandidate, DuplicateEntryCheckResult } from '@memberjunction/graphql-dataprovider';
|
|
6
6
|
import { BaseRecordComponent } from './base-record-component';
|
|
7
|
+
import type { BaseFormPanel } from './panel-slot/base-form-panel';
|
|
8
|
+
import type { FormCompositionSnapshot } from './chrome/form-composition-snapshot';
|
|
7
9
|
import { BaseFormSectionInfo } from './base-form-section-info';
|
|
8
10
|
import { MjCollapsiblePanelComponent } from './panel/collapsible-panel.component';
|
|
9
11
|
import { FormNavigationEvent } from './types/navigation-events';
|
|
@@ -150,6 +152,8 @@ export declare abstract class BaseFormComponent extends BaseRecordComponent impl
|
|
|
150
152
|
protected elementRef: ElementRef<any>;
|
|
151
153
|
cdr: ChangeDetectorRef;
|
|
152
154
|
protected formStateService: FormStateService;
|
|
155
|
+
/** The placement dialog's unsaved panel, when this form is the dialog's preview. */
|
|
156
|
+
protected placementPreview: import("./panel-slot/placement-preview").FormPlacementPreview | null;
|
|
153
157
|
/** Emitted when navigation is requested (record link, external link, email, new record, etc.) */
|
|
154
158
|
Navigate: EventEmitter<FormNavigationEvent>;
|
|
155
159
|
/** Emitted when a user-facing notification should be shown */
|
|
@@ -172,6 +176,54 @@ export declare abstract class BaseFormComponent extends BaseRecordComponent impl
|
|
|
172
176
|
* the container to start loading badge counts and other record-dependent data.
|
|
173
177
|
*/
|
|
174
178
|
RecordReady: EventEmitter<BaseEntity<unknown>>;
|
|
179
|
+
/**
|
|
180
|
+
* Emitted whenever edit mode starts (`true`) or ends (`false`). The Explorer
|
|
181
|
+
* shell uses the `true` edge to PROMOTE a records preview tab — pin it — the
|
|
182
|
+
* moment the user starts editing (VS Code's promote-on-modify), so a record
|
|
183
|
+
* being edited is neither replaceable by the next plain open nor italic.
|
|
184
|
+
* Fires on every call, not only on transitions: a new record's ngOnInit
|
|
185
|
+
* re-asserts edit mode and the shell's pin is idempotent.
|
|
186
|
+
*/
|
|
187
|
+
EditModeChanged: EventEmitter<boolean>;
|
|
188
|
+
/** Layout the container resolved for this form. Set by `<mj-record-form-container>`; read by panel hosts. */
|
|
189
|
+
ChromeLayout: 'accordion' | 'left-nav';
|
|
190
|
+
/**
|
|
191
|
+
* Whether this form renders its own body in full.
|
|
192
|
+
*
|
|
193
|
+
* A form that returns true accepts nothing the container would otherwise compose into
|
|
194
|
+
* it: no `BaseFormPanel` mounts, no contribution claims a section, and no stock grid is
|
|
195
|
+
* filled in for a `DisplayInForm` relationship. The composition snapshot reports none of
|
|
196
|
+
* them either. Container chrome that belongs to the *record* rather than to the body —
|
|
197
|
+
* the toolbar, Save/Delete, History, Record Changes — is unaffected.
|
|
198
|
+
*
|
|
199
|
+
* The fill-in reads an unbaked relationship as stale CodeGen and supplies the missing
|
|
200
|
+
* grid. A form that replaced the body bakes nothing by design, so without this flag
|
|
201
|
+
* every relationship reads as missing and the container composes a form the author
|
|
202
|
+
* never asked for.
|
|
203
|
+
*/
|
|
204
|
+
get OwnsEntireFormBody(): boolean;
|
|
205
|
+
/**
|
|
206
|
+
* Last composition snapshot the container published — what is actually on this form:
|
|
207
|
+
* sections, related grids, contributions and slots. Consumers: agent context (so Skip
|
|
208
|
+
* can target a real slot and section key) and Form Studio.
|
|
209
|
+
*/
|
|
210
|
+
CompositionSnapshot: FormCompositionSnapshot | null;
|
|
211
|
+
CompositionChanged: EventEmitter<FormCompositionSnapshot>;
|
|
212
|
+
private readonly _formPanels;
|
|
213
|
+
/** Slot hosts register every mounted panel so validation can include panel-owned checks. */
|
|
214
|
+
RegisterFormPanel(panel: BaseFormPanel): void;
|
|
215
|
+
UnregisterFormPanel(panel: BaseFormPanel): void;
|
|
216
|
+
/**
|
|
217
|
+
* Fires when a section's known row count changes — from the container's batched
|
|
218
|
+
* count prefetch, a related grid load (including a manual grid refresh), or a
|
|
219
|
+
* contribution reporting its own count. The container re-resolves empty-section
|
|
220
|
+
* chrome (`whenEmpty`) when a count crosses zero.
|
|
221
|
+
*/
|
|
222
|
+
SectionRowCountChanged: EventEmitter<{
|
|
223
|
+
SectionKey: string;
|
|
224
|
+
RowCount: number;
|
|
225
|
+
Previous: number | undefined;
|
|
226
|
+
}>;
|
|
175
227
|
/** Subscription to form state changes */
|
|
176
228
|
private formStateSubscription?;
|
|
177
229
|
collapsiblePanels: QueryList<MjCollapsiblePanelComponent>;
|
|
@@ -198,7 +250,31 @@ export declare abstract class BaseFormComponent extends BaseRecordComponent impl
|
|
|
198
250
|
EndEditMode(): void;
|
|
199
251
|
handleHistoryDialog(): void;
|
|
200
252
|
HandleTagsPanel(): void;
|
|
253
|
+
/**
|
|
254
|
+
* Record + pending-record validation, merged with whatever panel validity is
|
|
255
|
+
* already known.
|
|
256
|
+
*
|
|
257
|
+
* Synchronous, and therefore blind to a panel validator that has not reported yet —
|
|
258
|
+
* any path that gates a save must use {@link ValidateAsync}. The signature stays
|
|
259
|
+
* synchronous because this is published API with external callers.
|
|
260
|
+
*/
|
|
201
261
|
Validate(): ValidationResult;
|
|
262
|
+
/** True only while {@link ValidateAsync} calls {@link Validate}: the awaited panel results take the place of the last-known ones. */
|
|
263
|
+
private _omitLastKnownPanelValidation;
|
|
264
|
+
/**
|
|
265
|
+
* {@link Validate}, merged with every mounted panel's validator, awaited. This is what
|
|
266
|
+
* `SaveRecord()` calls.
|
|
267
|
+
*
|
|
268
|
+
* It starts from `Validate()`, so a subclass that overrides `Validate()` still gates the
|
|
269
|
+
* save; the panels' last-known state is left out of that call, because their awaited
|
|
270
|
+
* results replace it.
|
|
271
|
+
*
|
|
272
|
+
* A panel's `Validate()` may be async — anything checking server state will be — and
|
|
273
|
+
* reading such a result synchronously yields a Promise, which tests as "no opinion"
|
|
274
|
+
* and lets an invalid record save with no error and no log.
|
|
275
|
+
*/
|
|
276
|
+
ValidateAsync(): Promise<ValidationResult>;
|
|
277
|
+
private validateRecordAndPending;
|
|
202
278
|
protected RaiseEvent(eventCode: BaseFormComponentEventCodes): FormEditingCompleteEvent;
|
|
203
279
|
SaveRecord(StopEditModeAfterSave: boolean): Promise<boolean>;
|
|
204
280
|
CancelEdit(): void;
|
|
@@ -318,12 +394,47 @@ export declare abstract class BaseFormComponent extends BaseRecordComponent impl
|
|
|
318
394
|
private _showValidation;
|
|
319
395
|
/** Validation errors from the most recent failed save attempt */
|
|
320
396
|
private _validationErrors;
|
|
397
|
+
private _formContextMemo;
|
|
398
|
+
/**
|
|
399
|
+
* Context handed to every field, panel and slot in the form.
|
|
400
|
+
*
|
|
401
|
+
* Returns the SAME object while nothing in it has changed. Templates bind this getter in
|
|
402
|
+
* dozens of places per form, and Angular evaluates each binding on every change-detection
|
|
403
|
+
* pass — so allocating a fresh object per access handed every child a new reference each
|
|
404
|
+
* pass, defeating input-identity checks and cascading re-renders through the whole form.
|
|
405
|
+
* Building the candidate is cheap (the expensive part, hidden section keys, is memoized);
|
|
406
|
+
* the identity comparison below is what stops the cascade.
|
|
407
|
+
*/
|
|
321
408
|
get formContext(): FormContext;
|
|
409
|
+
/** Memo for {@link resolveHiddenSectionKeys}. */
|
|
410
|
+
private _resolvedHiddenKeysMemo;
|
|
322
411
|
/**
|
|
323
412
|
* Config HiddenSectionKeys plus section keys winning contributions asked
|
|
324
413
|
* to hide (related-entity claims and `replacesSectionKey` field panels).
|
|
325
414
|
*/
|
|
326
415
|
private resolveHiddenSectionKeys;
|
|
416
|
+
/** Memo for {@link contributionClaimedFieldNames} — same reasoning as the hidden-keys memo. */
|
|
417
|
+
private _claimedFieldsMemo;
|
|
418
|
+
/**
|
|
419
|
+
* Field names a winning contribution stands in for, so no section draws them.
|
|
420
|
+
*
|
|
421
|
+
* Empty stays `undefined` rather than `[]`: `formContext` is compared by value on every
|
|
422
|
+
* change-detection pass, and a fresh empty array per pass would make every context look
|
|
423
|
+
* different from the last one.
|
|
424
|
+
*/
|
|
425
|
+
private contributionClaimedFieldNames;
|
|
426
|
+
/** Memo for {@link contributionHiddenSectionKeys} — see the comment there. */
|
|
427
|
+
private _hiddenKeysMemo;
|
|
428
|
+
/**
|
|
429
|
+
* Section keys hidden because a contribution claimed them.
|
|
430
|
+
*
|
|
431
|
+
* Memoized on the identity of the merged registration list, which the collector returns as
|
|
432
|
+
* a stable reference until something actually changes. That matters because this sits under
|
|
433
|
+
* the `formContext` getter, which is bound in dozens of places per form and re-evaluated on
|
|
434
|
+
* every change-detection pass — and `ContributionHiddenSectionKeys` runs the WHOLE composer
|
|
435
|
+
* (collapse, relationship walk, section-key construction) on each call. Running that per
|
|
436
|
+
* binding per pass is what made forms lag.
|
|
437
|
+
*/
|
|
327
438
|
private contributionHiddenSectionKeys;
|
|
328
439
|
/**
|
|
329
440
|
* Resolves whether section drag-reorder is allowed for the current Config.
|
|
@@ -369,8 +480,19 @@ export declare abstract class BaseFormComponent extends BaseRecordComponent impl
|
|
|
369
480
|
protected getSection(sectionKey: string): BaseFormSectionInfo | undefined;
|
|
370
481
|
IsSectionExpanded(sectionKey: string, defaultExpanded?: boolean): boolean;
|
|
371
482
|
SetSectionExpanded(sectionKey: string, isExpanded: boolean): void;
|
|
483
|
+
/**
|
|
484
|
+
* The row count shown as a section's badge. `undefined` until known, and always
|
|
485
|
+
* `undefined` for a section whose badge is turned off (`showCount: false`) — use
|
|
486
|
+
* {@link PeekSectionRowCount} for the underlying number.
|
|
487
|
+
*/
|
|
372
488
|
GetSectionRowCount(sectionKey: string): number | undefined;
|
|
489
|
+
/** The last known row count for a section, regardless of whether its badge shows. */
|
|
490
|
+
PeekSectionRowCount(sectionKey: string): number | undefined;
|
|
491
|
+
private suppressedBadgeSectionKeys;
|
|
492
|
+
/** Show or hide a section's row-count badge (metadata `showCount`). The count itself is still tracked. */
|
|
493
|
+
SetSectionBadgeVisible(sectionKey: string, visible: boolean): void;
|
|
373
494
|
SetSectionRowCount(sectionKey: string, rowCount: number): void;
|
|
495
|
+
private applySectionRowCount;
|
|
374
496
|
GetSectionPanelHeight(sectionKey: string): number | undefined;
|
|
375
497
|
SetSectionPanelHeight(sectionKey: string, height: number): void;
|
|
376
498
|
toggleSection(sectionKey: string): void;
|
|
@@ -409,6 +531,15 @@ export declare abstract class BaseFormComponent extends BaseRecordComponent impl
|
|
|
409
531
|
getFirstClassSectionKeys(): string[];
|
|
410
532
|
setChromeMembership(moreSectionKeys: string[], firstClassSectionKeys: string[]): void;
|
|
411
533
|
getSectionDisplayOrder(sectionKey: string): number;
|
|
534
|
+
/**
|
|
535
|
+
* Where this key sits in the section order, or null when it is not in it at all.
|
|
536
|
+
*
|
|
537
|
+
* {@link getSectionDisplayOrder} cannot answer that: it returns the section count for
|
|
538
|
+
* an unknown key, which is indistinguishable from a real last position. A contribution
|
|
539
|
+
* panel is not in the form's declared sections, so a caller has to be able to tell
|
|
540
|
+
* "the user placed this here" from "nobody has said where this goes".
|
|
541
|
+
*/
|
|
542
|
+
getSectionOrderIndex(sectionKey: string): number | null;
|
|
412
543
|
/**
|
|
413
544
|
* Handles navigation events from the form container and related entity grids.
|
|
414
545
|
* Relays the event upward via the Navigate @Output for the host application to handle.
|
|
@@ -437,6 +568,6 @@ export declare abstract class BaseFormComponent extends BaseRecordComponent impl
|
|
|
437
568
|
*/
|
|
438
569
|
OnListManagementRequested(): void;
|
|
439
570
|
static ɵfac: i0.ɵɵFactoryDeclaration<BaseFormComponent, never>;
|
|
440
|
-
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"; }, never, never, true, 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>;
|
|
441
572
|
}
|
|
442
573
|
//# 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;AAE/G,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,2BAA2B,EAAE,MAAM,qCAAqC,CAAC;AAClF,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EACL,WAAW,EACX,qBAAqB,EACrB,gBAAgB,EAChB,oBAAoB,EACpB,kBAAkB,EAClB,qBAAqB,EACrB,uBAAuB,EACvB,qBAAqB,EACtB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,6BAA6B,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"base-form-component.d.ts","sourceRoot":"","sources":["../../src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gBAAgB,IAAI,UAAU,GAAG,YAAY;IAQ7C,gBAAgB,CAAC,SAAS,EAAE,UAAU,GAAG,YAAY,GAAG,IAAI;IAO5D,mBAAmB,IAAI,IAAI;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;yCAzlDpB,iBAAiB;2CAAjB,iBAAiB;CA+lDtC"}
|
|
@@ -5,11 +5,14 @@ import { DeserializeValidationErrors, MJEventType, MJGlobal } from '@memberjunct
|
|
|
5
5
|
import { FormEditingCompleteEvent, BaseFormComponentEventCodes } from '@memberjunction/ng-base-types';
|
|
6
6
|
import { GraphQLAIClient, GraphQLDataProvider } from '@memberjunction/graphql-dataprovider';
|
|
7
7
|
import { BaseRecordComponent } from './base-record-component';
|
|
8
|
+
import { MergePanelValidation } from './panel-slot/merge-panel-validation';
|
|
8
9
|
import { BaseFormSectionInfo } from './base-form-section-info';
|
|
9
10
|
import { MjCollapsiblePanelComponent } from './panel/collapsible-panel.component';
|
|
10
11
|
import { FormStateService } from './form-state.service';
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
12
|
+
import { CollectFormContributionRegistrations } from './panel-slot/collect-form-contribution-registrations';
|
|
13
|
+
import { FORM_PLACEMENT_PREVIEW } from './panel-slot/placement-preview';
|
|
14
|
+
import { FormContextsEqual } from './base-form-component-internals';
|
|
15
|
+
import { ContributionClaimedFieldNames, ContributionHiddenSectionKeys } from './panel-slot/form-contribution';
|
|
13
16
|
import { DuplicateEntryCheckController } from './duplicate-entry-check/duplicate-entry-check';
|
|
14
17
|
import * as i0 from "@angular/core";
|
|
15
18
|
/**
|
|
@@ -176,6 +179,8 @@ export class BaseFormComponent extends BaseRecordComponent {
|
|
|
176
179
|
elementRef = inject(ElementRef);
|
|
177
180
|
cdr = inject(ChangeDetectorRef);
|
|
178
181
|
formStateService = inject(FormStateService);
|
|
182
|
+
/** The placement dialog's unsaved panel, when this form is the dialog's preview. */
|
|
183
|
+
placementPreview = inject(FORM_PLACEMENT_PREVIEW, { optional: true });
|
|
179
184
|
// #endregion
|
|
180
185
|
// #region @Output Events
|
|
181
186
|
/** Emitted when navigation is requested (record link, external link, email, new record, etc.) */
|
|
@@ -200,6 +205,54 @@ export class BaseFormComponent extends BaseRecordComponent {
|
|
|
200
205
|
* the container to start loading badge counts and other record-dependent data.
|
|
201
206
|
*/
|
|
202
207
|
RecordReady = new EventEmitter();
|
|
208
|
+
/**
|
|
209
|
+
* Emitted whenever edit mode starts (`true`) or ends (`false`). The Explorer
|
|
210
|
+
* shell uses the `true` edge to PROMOTE a records preview tab — pin it — the
|
|
211
|
+
* moment the user starts editing (VS Code's promote-on-modify), so a record
|
|
212
|
+
* being edited is neither replaceable by the next plain open nor italic.
|
|
213
|
+
* Fires on every call, not only on transitions: a new record's ngOnInit
|
|
214
|
+
* re-asserts edit mode and the shell's pin is idempotent.
|
|
215
|
+
*/
|
|
216
|
+
EditModeChanged = new EventEmitter();
|
|
217
|
+
/** Layout the container resolved for this form. Set by `<mj-record-form-container>`; read by panel hosts. */
|
|
218
|
+
ChromeLayout = 'accordion';
|
|
219
|
+
/**
|
|
220
|
+
* Whether this form renders its own body in full.
|
|
221
|
+
*
|
|
222
|
+
* A form that returns true accepts nothing the container would otherwise compose into
|
|
223
|
+
* it: no `BaseFormPanel` mounts, no contribution claims a section, and no stock grid is
|
|
224
|
+
* filled in for a `DisplayInForm` relationship. The composition snapshot reports none of
|
|
225
|
+
* them either. Container chrome that belongs to the *record* rather than to the body —
|
|
226
|
+
* the toolbar, Save/Delete, History, Record Changes — is unaffected.
|
|
227
|
+
*
|
|
228
|
+
* The fill-in reads an unbaked relationship as stale CodeGen and supplies the missing
|
|
229
|
+
* grid. A form that replaced the body bakes nothing by design, so without this flag
|
|
230
|
+
* every relationship reads as missing and the container composes a form the author
|
|
231
|
+
* never asked for.
|
|
232
|
+
*/
|
|
233
|
+
get OwnsEntireFormBody() { return false; }
|
|
234
|
+
/**
|
|
235
|
+
* Last composition snapshot the container published — what is actually on this form:
|
|
236
|
+
* sections, related grids, contributions and slots. Consumers: agent context (so Skip
|
|
237
|
+
* can target a real slot and section key) and Form Studio.
|
|
238
|
+
*/
|
|
239
|
+
CompositionSnapshot = null;
|
|
240
|
+
CompositionChanged = new EventEmitter();
|
|
241
|
+
_formPanels = new Set();
|
|
242
|
+
/** Slot hosts register every mounted panel so validation can include panel-owned checks. */
|
|
243
|
+
RegisterFormPanel(panel) {
|
|
244
|
+
this._formPanels.add(panel);
|
|
245
|
+
}
|
|
246
|
+
UnregisterFormPanel(panel) {
|
|
247
|
+
this._formPanels.delete(panel);
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* Fires when a section's known row count changes — from the container's batched
|
|
251
|
+
* count prefetch, a related grid load (including a manual grid refresh), or a
|
|
252
|
+
* contribution reporting its own count. The container re-resolves empty-section
|
|
253
|
+
* chrome (`whenEmpty`) when a count crosses zero.
|
|
254
|
+
*/
|
|
255
|
+
SectionRowCountChanged = new EventEmitter();
|
|
203
256
|
// #endregion
|
|
204
257
|
/** Subscription to form state changes */
|
|
205
258
|
formStateSubscription;
|
|
@@ -308,6 +361,7 @@ export class BaseFormComponent extends BaseRecordComponent {
|
|
|
308
361
|
if (entityName) {
|
|
309
362
|
this.formStateService.setEditMode(entityName, true);
|
|
310
363
|
}
|
|
364
|
+
this.EditModeChanged.emit(true);
|
|
311
365
|
}
|
|
312
366
|
EndEditMode() {
|
|
313
367
|
this.EditMode = false;
|
|
@@ -316,6 +370,7 @@ export class BaseFormComponent extends BaseRecordComponent {
|
|
|
316
370
|
if (entityName) {
|
|
317
371
|
this.formStateService.setEditMode(entityName, false);
|
|
318
372
|
}
|
|
373
|
+
this.EditModeChanged.emit(false);
|
|
319
374
|
}
|
|
320
375
|
handleHistoryDialog() {
|
|
321
376
|
this.isHistoryDialogOpen = !this.isHistoryDialogOpen;
|
|
@@ -325,7 +380,48 @@ export class BaseFormComponent extends BaseRecordComponent {
|
|
|
325
380
|
}
|
|
326
381
|
// #endregion
|
|
327
382
|
// #region Core Form Operations
|
|
383
|
+
/**
|
|
384
|
+
* Record + pending-record validation, merged with whatever panel validity is
|
|
385
|
+
* already known.
|
|
386
|
+
*
|
|
387
|
+
* Synchronous, and therefore blind to a panel validator that has not reported yet —
|
|
388
|
+
* any path that gates a save must use {@link ValidateAsync}. The signature stays
|
|
389
|
+
* synchronous because this is published API with external callers.
|
|
390
|
+
*/
|
|
328
391
|
Validate() {
|
|
392
|
+
const valResults = this.validateRecordAndPending();
|
|
393
|
+
if (this._omitLastKnownPanelValidation) {
|
|
394
|
+
return valResults;
|
|
395
|
+
}
|
|
396
|
+
return MergePanelValidation(valResults, [...this._formPanels].map((panel) => panel.LastKnownValidation()));
|
|
397
|
+
}
|
|
398
|
+
/** True only while {@link ValidateAsync} calls {@link Validate}: the awaited panel results take the place of the last-known ones. */
|
|
399
|
+
_omitLastKnownPanelValidation = false;
|
|
400
|
+
/**
|
|
401
|
+
* {@link Validate}, merged with every mounted panel's validator, awaited. This is what
|
|
402
|
+
* `SaveRecord()` calls.
|
|
403
|
+
*
|
|
404
|
+
* It starts from `Validate()`, so a subclass that overrides `Validate()` still gates the
|
|
405
|
+
* save; the panels' last-known state is left out of that call, because their awaited
|
|
406
|
+
* results replace it.
|
|
407
|
+
*
|
|
408
|
+
* A panel's `Validate()` may be async — anything checking server state will be — and
|
|
409
|
+
* reading such a result synchronously yields a Promise, which tests as "no opinion"
|
|
410
|
+
* and lets an invalid record save with no error and no log.
|
|
411
|
+
*/
|
|
412
|
+
async ValidateAsync() {
|
|
413
|
+
let base;
|
|
414
|
+
this._omitLastKnownPanelValidation = true;
|
|
415
|
+
try {
|
|
416
|
+
base = this.Validate();
|
|
417
|
+
}
|
|
418
|
+
finally {
|
|
419
|
+
this._omitLastKnownPanelValidation = false;
|
|
420
|
+
}
|
|
421
|
+
const panelResults = await Promise.all([...this._formPanels].map((panel) => panel.Validate()));
|
|
422
|
+
return MergePanelValidation(base, panelResults);
|
|
423
|
+
}
|
|
424
|
+
validateRecordAndPending() {
|
|
329
425
|
const valResults = this.record.Validate();
|
|
330
426
|
const pendingValResults = this.ValidatePendingRecords();
|
|
331
427
|
for (let i = 0; i < pendingValResults.length; i++) {
|
|
@@ -368,7 +464,7 @@ export class BaseFormComponent extends BaseRecordComponent {
|
|
|
368
464
|
return false;
|
|
369
465
|
}
|
|
370
466
|
this.PopulatePendingRecords();
|
|
371
|
-
const valResults = this.
|
|
467
|
+
const valResults = await this.ValidateAsync();
|
|
372
468
|
if (!valResults.Success) {
|
|
373
469
|
this.publishValidationFailure(valResults.Errors);
|
|
374
470
|
return false;
|
|
@@ -868,8 +964,24 @@ export class BaseFormComponent extends BaseRecordComponent {
|
|
|
868
964
|
_showValidation = false;
|
|
869
965
|
/** Validation errors from the most recent failed save attempt */
|
|
870
966
|
_validationErrors = [];
|
|
967
|
+
_formContextMemo = null;
|
|
968
|
+
/**
|
|
969
|
+
* Context handed to every field, panel and slot in the form.
|
|
970
|
+
*
|
|
971
|
+
* Returns the SAME object while nothing in it has changed. Templates bind this getter in
|
|
972
|
+
* dozens of places per form, and Angular evaluates each binding on every change-detection
|
|
973
|
+
* pass — so allocating a fresh object per access handed every child a new reference each
|
|
974
|
+
* pass, defeating input-identity checks and cascading re-renders through the whole form.
|
|
975
|
+
* Building the candidate is cheap (the expensive part, hidden section keys, is memoized);
|
|
976
|
+
* the identity comparison below is what stops the cascade.
|
|
977
|
+
*/
|
|
871
978
|
get formContext() {
|
|
872
|
-
|
|
979
|
+
// One collector read per access; both contribution-derived values come from it.
|
|
980
|
+
const entity = this.record?.EntityInfo;
|
|
981
|
+
const regs = entity
|
|
982
|
+
? CollectFormContributionRegistrations(entity, this.ProviderToUse, { Preview: this.placementPreview })
|
|
983
|
+
: null;
|
|
984
|
+
const next = {
|
|
873
985
|
sectionFilter: this.searchFilter,
|
|
874
986
|
showEmptyFields: this.showEmptyFields,
|
|
875
987
|
showValidation: this._showValidation,
|
|
@@ -878,27 +990,79 @@ export class BaseFormComponent extends BaseRecordComponent {
|
|
|
878
990
|
collapsibleSections: this.Config?.CollapsibleSections,
|
|
879
991
|
enableRecordLinks: this.Config?.EnableRecordLinks,
|
|
880
992
|
showRelatedEntities: this.Config?.ShowRelatedEntities,
|
|
881
|
-
hiddenSectionKeys: this.resolveHiddenSectionKeys(),
|
|
993
|
+
hiddenSectionKeys: this.resolveHiddenSectionKeys(entity, regs),
|
|
994
|
+
claimedFieldNames: this.contributionClaimedFieldNames(entity, regs),
|
|
882
995
|
visibleSectionKeys: this.Config?.VisibleSectionKeys,
|
|
883
996
|
allowSectionReorder: this.resolveAllowSectionReorder()
|
|
884
997
|
};
|
|
885
|
-
|
|
998
|
+
const prev = this._formContextMemo;
|
|
999
|
+
if (prev && FormContextsEqual(prev, next))
|
|
1000
|
+
return prev;
|
|
1001
|
+
this._formContextMemo = next;
|
|
1002
|
+
return next;
|
|
1003
|
+
}
|
|
1004
|
+
/** Memo for {@link resolveHiddenSectionKeys}. */
|
|
1005
|
+
_resolvedHiddenKeysMemo = null;
|
|
886
1006
|
/**
|
|
887
1007
|
* Config HiddenSectionKeys plus section keys winning contributions asked
|
|
888
1008
|
* to hide (related-entity claims and `replacesSectionKey` field panels).
|
|
889
1009
|
*/
|
|
890
|
-
resolveHiddenSectionKeys() {
|
|
891
|
-
const claimed = this.contributionHiddenSectionKeys();
|
|
1010
|
+
resolveHiddenSectionKeys(entity, regs) {
|
|
1011
|
+
const claimed = this.contributionHiddenSectionKeys(entity, regs);
|
|
892
1012
|
const configured = this.Config?.HiddenSectionKeys;
|
|
893
1013
|
if (claimed.length === 0)
|
|
894
1014
|
return configured;
|
|
895
|
-
|
|
1015
|
+
// Memoized on the identity of both inputs: without it this concatenation returns a new
|
|
1016
|
+
// array per access, which alone would make every formContext look changed.
|
|
1017
|
+
const memo = this._resolvedHiddenKeysMemo;
|
|
1018
|
+
if (memo && memo.claimed === claimed && memo.configured === configured)
|
|
1019
|
+
return memo.merged;
|
|
1020
|
+
const merged = [...(configured ?? []), ...claimed];
|
|
1021
|
+
this._resolvedHiddenKeysMemo = { claimed, configured, merged };
|
|
1022
|
+
return merged;
|
|
1023
|
+
}
|
|
1024
|
+
/** Memo for {@link contributionClaimedFieldNames} — same reasoning as the hidden-keys memo. */
|
|
1025
|
+
_claimedFieldsMemo = null;
|
|
1026
|
+
/**
|
|
1027
|
+
* Field names a winning contribution stands in for, so no section draws them.
|
|
1028
|
+
*
|
|
1029
|
+
* Empty stays `undefined` rather than `[]`: `formContext` is compared by value on every
|
|
1030
|
+
* change-detection pass, and a fresh empty array per pass would make every context look
|
|
1031
|
+
* different from the last one.
|
|
1032
|
+
*/
|
|
1033
|
+
contributionClaimedFieldNames(entity, regs) {
|
|
1034
|
+
if (!entity || !regs)
|
|
1035
|
+
return undefined;
|
|
1036
|
+
const memo = this._claimedFieldsMemo;
|
|
1037
|
+
if (!(memo && memo.entity === entity && memo.regs === regs)) {
|
|
1038
|
+
const names = ContributionClaimedFieldNames(entity.Name, entity.RelatedEntities, entity.ChildEntities.map((child) => child.ID), regs);
|
|
1039
|
+
this._claimedFieldsMemo = { entity, regs, names };
|
|
1040
|
+
}
|
|
1041
|
+
const names = this._claimedFieldsMemo.names;
|
|
1042
|
+
return names.length > 0 ? names : undefined;
|
|
896
1043
|
}
|
|
897
|
-
contributionHiddenSectionKeys
|
|
898
|
-
|
|
899
|
-
|
|
1044
|
+
/** Memo for {@link contributionHiddenSectionKeys} — see the comment there. */
|
|
1045
|
+
_hiddenKeysMemo = null;
|
|
1046
|
+
/**
|
|
1047
|
+
* Section keys hidden because a contribution claimed them.
|
|
1048
|
+
*
|
|
1049
|
+
* Memoized on the identity of the merged registration list, which the collector returns as
|
|
1050
|
+
* a stable reference until something actually changes. That matters because this sits under
|
|
1051
|
+
* the `formContext` getter, which is bound in dozens of places per form and re-evaluated on
|
|
1052
|
+
* every change-detection pass — and `ContributionHiddenSectionKeys` runs the WHOLE composer
|
|
1053
|
+
* (collapse, relationship walk, section-key construction) on each call. Running that per
|
|
1054
|
+
* binding per pass is what made forms lag.
|
|
1055
|
+
*/
|
|
1056
|
+
contributionHiddenSectionKeys(entity, regs) {
|
|
1057
|
+
// `regs` is merged: compiled registrations plus the rows that apply to this user.
|
|
1058
|
+
if (!entity || !regs)
|
|
900
1059
|
return [];
|
|
901
|
-
|
|
1060
|
+
const memo = this._hiddenKeysMemo;
|
|
1061
|
+
if (memo && memo.entity === entity && memo.regs === regs)
|
|
1062
|
+
return memo.keys;
|
|
1063
|
+
const keys = ContributionHiddenSectionKeys(entity.Name, entity.RelatedEntities, entity.ChildEntities.map((child) => child.ID), regs);
|
|
1064
|
+
this._hiddenKeysMemo = { entity, regs, keys };
|
|
1065
|
+
return keys;
|
|
902
1066
|
}
|
|
903
1067
|
/**
|
|
904
1068
|
* Resolves whether section drag-reorder is allowed for the current Config.
|
|
@@ -1004,18 +1168,45 @@ export class BaseFormComponent extends BaseRecordComponent {
|
|
|
1004
1168
|
section.isExpanded = isExpanded;
|
|
1005
1169
|
}
|
|
1006
1170
|
}
|
|
1171
|
+
/**
|
|
1172
|
+
* The row count shown as a section's badge. `undefined` until known, and always
|
|
1173
|
+
* `undefined` for a section whose badge is turned off (`showCount: false`) — use
|
|
1174
|
+
* {@link PeekSectionRowCount} for the underlying number.
|
|
1175
|
+
*/
|
|
1007
1176
|
GetSectionRowCount(sectionKey) {
|
|
1008
|
-
|
|
1009
|
-
|
|
1177
|
+
if (this.suppressedBadgeSectionKeys.has(sectionKey))
|
|
1178
|
+
return undefined;
|
|
1179
|
+
return this.PeekSectionRowCount(sectionKey);
|
|
1180
|
+
}
|
|
1181
|
+
/** The last known row count for a section, regardless of whether its badge shows. */
|
|
1182
|
+
PeekSectionRowCount(sectionKey) {
|
|
1183
|
+
return this.sectionMap.get(sectionKey)?.rowCount;
|
|
1184
|
+
}
|
|
1185
|
+
suppressedBadgeSectionKeys = new Set();
|
|
1186
|
+
/** Show or hide a section's row-count badge (metadata `showCount`). The count itself is still tracked. */
|
|
1187
|
+
SetSectionBadgeVisible(sectionKey, visible) {
|
|
1188
|
+
const changed = visible ? this.suppressedBadgeSectionKeys.delete(sectionKey) : !this.suppressedBadgeSectionKeys.has(sectionKey);
|
|
1189
|
+
if (!visible)
|
|
1190
|
+
this.suppressedBadgeSectionKeys.add(sectionKey);
|
|
1191
|
+
if (changed)
|
|
1192
|
+
this.cdr.markForCheck();
|
|
1010
1193
|
}
|
|
1011
1194
|
SetSectionRowCount(sectionKey, rowCount) {
|
|
1195
|
+
const previous = this.PeekSectionRowCount(sectionKey);
|
|
1196
|
+
this.applySectionRowCount(sectionKey, rowCount);
|
|
1197
|
+
if (previous !== rowCount) {
|
|
1198
|
+
this.SectionRowCountChanged.emit({ SectionKey: sectionKey, RowCount: rowCount, Previous: previous });
|
|
1199
|
+
}
|
|
1200
|
+
}
|
|
1201
|
+
applySectionRowCount(sectionKey, rowCount) {
|
|
1012
1202
|
let section = this.sectionMap.get(sectionKey);
|
|
1013
1203
|
if (!section) {
|
|
1014
1204
|
// Contribution panels use their own SectionKey (e.g. 'orders') which
|
|
1015
|
-
// is never seeded by generated initSections().
|
|
1016
|
-
// rail badge
|
|
1205
|
+
// is never seeded by generated initSections(). Kept in the map only, so the
|
|
1206
|
+
// left-nav rail badge reads the count the same way baked grids do. It stays out
|
|
1207
|
+
// of `sections`: that list is the form's declared order, and a key in it is drawn
|
|
1208
|
+
// at its index instead of at the slot the panel was placed in.
|
|
1017
1209
|
section = new BaseFormSectionInfo(sectionKey, sectionKey, false, rowCount);
|
|
1018
|
-
this.sections.push(section);
|
|
1019
1210
|
this.sectionMap.set(sectionKey, section);
|
|
1020
1211
|
}
|
|
1021
1212
|
else {
|
|
@@ -1189,6 +1380,18 @@ export class BaseFormComponent extends BaseRecordComponent {
|
|
|
1189
1380
|
const index = order.indexOf(sectionKey);
|
|
1190
1381
|
return index >= 0 ? index : this.sections.length;
|
|
1191
1382
|
}
|
|
1383
|
+
/**
|
|
1384
|
+
* Where this key sits in the section order, or null when it is not in it at all.
|
|
1385
|
+
*
|
|
1386
|
+
* {@link getSectionDisplayOrder} cannot answer that: it returns the section count for
|
|
1387
|
+
* an unknown key, which is indistinguishable from a real last position. A contribution
|
|
1388
|
+
* panel is not in the form's declared sections, so a caller has to be able to tell
|
|
1389
|
+
* "the user placed this here" from "nobody has said where this goes".
|
|
1390
|
+
*/
|
|
1391
|
+
getSectionOrderIndex(sectionKey) {
|
|
1392
|
+
const index = this.getSectionOrder().indexOf(sectionKey);
|
|
1393
|
+
return index >= 0 ? index : null;
|
|
1394
|
+
}
|
|
1192
1395
|
// #endregion
|
|
1193
1396
|
// #region Form Container Event Handlers
|
|
1194
1397
|
/**
|
|
@@ -1256,7 +1459,7 @@ export class BaseFormComponent extends BaseRecordComponent {
|
|
|
1256
1459
|
} if (rf & 2) {
|
|
1257
1460
|
let _t;
|
|
1258
1461
|
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.collapsiblePanels = _t);
|
|
1259
|
-
} }, outputs: { Navigate: "Navigate", Notification: "Notification", RecordSaved: "RecordSaved", RecordRefreshed: "RecordRefreshed", RecordDeleted: "RecordDeleted", RecordSaveFailed: "RecordSaveFailed", RecordDeleteFailed: "RecordDeleteFailed", ValidationFailed: "ValidationFailed", RecordReady: "RecordReady" }, features: [i0.ɵɵInheritDefinitionFeature] });
|
|
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] });
|
|
1260
1463
|
}
|
|
1261
1464
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(BaseFormComponent, [{
|
|
1262
1465
|
type: Directive
|
|
@@ -1278,6 +1481,12 @@ export class BaseFormComponent extends BaseRecordComponent {
|
|
|
1278
1481
|
type: Output
|
|
1279
1482
|
}], RecordReady: [{
|
|
1280
1483
|
type: Output
|
|
1484
|
+
}], EditModeChanged: [{
|
|
1485
|
+
type: Output
|
|
1486
|
+
}], CompositionChanged: [{
|
|
1487
|
+
type: Output
|
|
1488
|
+
}], SectionRowCountChanged: [{
|
|
1489
|
+
type: Output
|
|
1281
1490
|
}], collapsiblePanels: [{
|
|
1282
1491
|
type: ViewChildren,
|
|
1283
1492
|
args: [MjCollapsiblePanelComponent]
|