@memberjunction/ng-base-forms 6.2.0-edge.1 → 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 +166 -1
- package/dist/lib/base-form-component.d.ts.map +1 -1
- package/dist/lib/base-form-component.js +296 -20
- 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 +261 -5
- package/dist/lib/container/record-form-container.component.d.ts.map +1 -1
- package/dist/lib/container/record-form-container.component.js +1180 -371
- package/dist/lib/container/record-form-container.component.js.map +1 -1
- package/dist/lib/duplicate-entry-check/duplicate-entry-check.d.ts +150 -0
- package/dist/lib/duplicate-entry-check/duplicate-entry-check.d.ts.map +1 -0
- package/dist/lib/duplicate-entry-check/duplicate-entry-check.js +263 -0
- package/dist/lib/duplicate-entry-check/duplicate-entry-check.js.map +1 -0
- package/dist/lib/field/form-field.component.d.ts +22 -0
- package/dist/lib/field/form-field.component.d.ts.map +1 -1
- package/dist/lib/field/form-field.component.js +51 -6
- package/dist/lib/field/form-field.component.js.map +1 -1
- package/dist/lib/form-field-edit.coordinator.d.ts +25 -0
- package/dist/lib/form-field-edit.coordinator.d.ts.map +1 -0
- package/dist/lib/form-field-edit.coordinator.js +27 -0
- package/dist/lib/form-field-edit.coordinator.js.map +1 -0
- 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 +129 -2
- package/dist/lib/toolbar/form-toolbar.component.d.ts.map +1 -1
- package/dist/lib/toolbar/form-toolbar.component.js +974 -307
- package/dist/lib/toolbar/form-toolbar.component.js.map +1 -1
- package/dist/lib/types/form-events.d.ts +6 -0
- package/dist/lib/types/form-events.d.ts.map +1 -1
- package/dist/lib/types/form-events.js +6 -0
- package/dist/lib/types/form-events.js.map +1 -1
- package/dist/lib/types/form-toolbar-item.d.ts +20 -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/form-types.d.ts +13 -0
- package/dist/lib/types/form-types.d.ts.map +1 -1
- package/dist/lib/types/form-types.js.map +1 -1
- package/dist/lib/types/toolbar-config.d.ts +16 -0
- package/dist/lib/types/toolbar-config.d.ts.map +1 -1
- package/dist/lib/types/toolbar-config.js +3 -0
- package/dist/lib/types/toolbar-config.js.map +1 -1
- package/dist/module.d.ts +29 -22
- package/dist/module.d.ts.map +1 -1
- package/dist/module.js +50 -8
- package/dist/module.js.map +1 -1
- package/dist/public-api.d.ts +22 -0
- package/dist/public-api.d.ts.map +1 -1
- package/dist/public-api.js +24 -0
- package/dist/public-api.js.map +1 -1
- package/package.json +20 -18
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Form section counts — one round trip for every badge on a record form.
|
|
3
|
+
*
|
|
4
|
+
* When a saved record opens, the container asks for the row count of every
|
|
5
|
+
* related section (baked grids, stock fill-in grids, contributions) plus the
|
|
6
|
+
* toolbar's tag / attachment / version badges in ONE `RunViews` call of
|
|
7
|
+
* `count_only` views. The database provider runs an all-`count_only` batch as a
|
|
8
|
+
* single `UNION ALL` statement, and every view keeps the normal RunView security
|
|
9
|
+
* path (CanRead, row-level security, saved-view filters).
|
|
10
|
+
*
|
|
11
|
+
* The counts drive two things:
|
|
12
|
+
* - badges (`showCount`, default on), and
|
|
13
|
+
* - empty-section chrome (`whenEmpty`: `'show'` default | `'hide'` | `'more'`).
|
|
14
|
+
*
|
|
15
|
+
* Everything here is pure (no Angular, no I/O) so it can be unit tested; the
|
|
16
|
+
* container owns the call and the state.
|
|
17
|
+
*/
|
|
18
|
+
import { BaseEntity, EntityInfo, FormWhenEmpty, RunViewParams, RunViewResult } from '@memberjunction/core';
|
|
19
|
+
import { FormPanelRegistrationMetadata } from '../panel-slot/base-form-panel';
|
|
20
|
+
/** One form section (related grid or contribution) whose rows are counted. */
|
|
21
|
+
export interface FormSectionCountTarget {
|
|
22
|
+
SectionKey: string;
|
|
23
|
+
WhenEmpty: FormWhenEmpty;
|
|
24
|
+
ShowCount: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* The count query, or `null` when the section has no count source the form
|
|
27
|
+
* can build (a contribution that reports its own count after it mounts).
|
|
28
|
+
*/
|
|
29
|
+
Params: RunViewParams | null;
|
|
30
|
+
}
|
|
31
|
+
/** Toolbar badges counted in the same round trip. */
|
|
32
|
+
export type FormSystemCountKey = 'tags' | 'attachments' | 'versions';
|
|
33
|
+
export interface FormSystemCountTarget {
|
|
34
|
+
Key: FormSystemCountKey;
|
|
35
|
+
Params: RunViewParams;
|
|
36
|
+
}
|
|
37
|
+
export interface FormCountPlan {
|
|
38
|
+
Sections: FormSectionCountTarget[];
|
|
39
|
+
System: FormSystemCountTarget[];
|
|
40
|
+
/**
|
|
41
|
+
* Section keys whose badge is turned off (`showCount: false`), including
|
|
42
|
+
* ones not fetched at all because they are also `whenEmpty: 'show'`. A grid
|
|
43
|
+
* load still records their count; the form just does not badge it.
|
|
44
|
+
*/
|
|
45
|
+
SuppressedBadgeKeys: string[];
|
|
46
|
+
}
|
|
47
|
+
/** A winning contribution registration, keyed by its rail / section key. */
|
|
48
|
+
export interface FormCountContribution {
|
|
49
|
+
SectionKey: string;
|
|
50
|
+
Metadata: FormPanelRegistrationMetadata;
|
|
51
|
+
}
|
|
52
|
+
export interface BuildFormCountPlanInput {
|
|
53
|
+
Record: BaseEntity;
|
|
54
|
+
Entity: EntityInfo;
|
|
55
|
+
/** IS-A child entity IDs (their relationships are not related sections). */
|
|
56
|
+
IsaChildEntityIDs: readonly string[];
|
|
57
|
+
/** Section keys already hidden by a claim / replacement / chrome — never counted as grids. */
|
|
58
|
+
HiddenSectionKeys: ReadonlySet<string>;
|
|
59
|
+
/** Winning contribution registrations for this entity (header excluded). */
|
|
60
|
+
Contributions: readonly FormCountContribution[];
|
|
61
|
+
/** Include the attachment badge (entity allows attachments). */
|
|
62
|
+
IncludeAttachments: boolean;
|
|
63
|
+
}
|
|
64
|
+
/** Counts that came back; a section / badge whose query failed is absent. */
|
|
65
|
+
export interface FormCountResults {
|
|
66
|
+
Sections: Map<string, number>;
|
|
67
|
+
System: Map<FormSystemCountKey, number>;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Build the list of counts a saved record's form needs. Returns an empty plan
|
|
71
|
+
* for an unsaved record (nothing to count).
|
|
72
|
+
*/
|
|
73
|
+
export declare function BuildFormCountPlan(input: BuildFormCountPlanInput): FormCountPlan;
|
|
74
|
+
/** The `RunViews` params for a plan, in a fixed order {@link ApplyFormCountResults} understands. */
|
|
75
|
+
export declare function FormCountPlanParams(plan: FormCountPlan): RunViewParams[];
|
|
76
|
+
/** Map `RunViews` results (same order as {@link FormCountPlanParams}) back to keys. */
|
|
77
|
+
export declare function ApplyFormCountResults(plan: FormCountPlan, results: readonly (RunViewResult | null | undefined)[]): FormCountResults;
|
|
78
|
+
/** Where a form is in its count lifecycle for the current record. */
|
|
79
|
+
export type FormCountPhase = 'none' | 'loading' | 'loaded' | 'failed';
|
|
80
|
+
export interface ResolveEmptySectionBehaviorInput {
|
|
81
|
+
Targets: readonly FormSectionCountTarget[];
|
|
82
|
+
/** Latest known count per section key (prefetch or a grid load). */
|
|
83
|
+
CountOf: (sectionKey: string) => number | undefined;
|
|
84
|
+
Phase: FormCountPhase;
|
|
85
|
+
/** The toolbar's "show empty fields" toggle — reveals everything. */
|
|
86
|
+
ShowEmptyFields: boolean;
|
|
87
|
+
/** Sections that must not be hidden or moved (had rows this session, or are open). */
|
|
88
|
+
StickyKeys: ReadonlySet<string>;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Which sections the chrome should hide or move to More right now.
|
|
92
|
+
*
|
|
93
|
+
* - Only a section known to have 0 rows is affected.
|
|
94
|
+
* - While the prefetch is in flight, a `'hide'` section with a count query is
|
|
95
|
+
* held back so it does not appear and then vanish.
|
|
96
|
+
* - Fail open: no counts (unsaved, failed call, failed item) → nothing hidden.
|
|
97
|
+
*/
|
|
98
|
+
export declare function ResolveEmptySectionBehavior(input: ResolveEmptySectionBehaviorInput): Map<string, 'hide' | 'more'>;
|
|
99
|
+
//# sourceMappingURL=form-section-counts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-section-counts.d.ts","sourceRoot":"","sources":["../../../src/lib/section-counts/form-section-counts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EACH,UAAU,EACV,UAAU,EAEV,aAAa,EAOb,aAAa,EACb,aAAa,EAChB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,6BAA6B,EAAE,MAAM,+BAA+B,CAAC;AAO9E,8EAA8E;AAC9E,MAAM,WAAW,sBAAsB;IACnC,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,aAAa,CAAC;IACzB,SAAS,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,MAAM,EAAE,aAAa,GAAG,IAAI,CAAC;CAChC;AAED,qDAAqD;AACrD,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG,aAAa,GAAG,UAAU,CAAC;AAErE,MAAM,WAAW,qBAAqB;IAClC,GAAG,EAAE,kBAAkB,CAAC;IACxB,MAAM,EAAE,aAAa,CAAC;CACzB;AAED,MAAM,WAAW,aAAa;IAC1B,QAAQ,EAAE,sBAAsB,EAAE,CAAC;IACnC,MAAM,EAAE,qBAAqB,EAAE,CAAC;IAChC;;;;OAIG;IACH,mBAAmB,EAAE,MAAM,EAAE,CAAC;CACjC;AAED,4EAA4E;AAC5E,MAAM,WAAW,qBAAqB;IAClC,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,6BAA6B,CAAC;CAC3C;AAED,MAAM,WAAW,uBAAuB;IACpC,MAAM,EAAE,UAAU,CAAC;IACnB,MAAM,EAAE,UAAU,CAAC;IACnB,4EAA4E;IAC5E,iBAAiB,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC,8FAA8F;IAC9F,iBAAiB,EAAE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trip for every badge on a record form.
|
|
3
|
+
*
|
|
4
|
+
* When a saved record opens, the container asks for the row count of every
|
|
5
|
+
* related section (baked grids, stock fill-in grids, contributions) plus the
|
|
6
|
+
* toolbar's tag / attachment / version badges in ONE `RunViews` call of
|
|
7
|
+
* `count_only` views. The database provider runs an all-`count_only` batch as a
|
|
8
|
+
* single `UNION ALL` statement, and every view keeps the normal RunView security
|
|
9
|
+
* path (CanRead, row-level security, saved-view filters).
|
|
10
|
+
*
|
|
11
|
+
* The counts drive two things:
|
|
12
|
+
* - badges (`showCount`, default on), and
|
|
13
|
+
* - empty-section chrome (`whenEmpty`: `'show'` default | `'hide'` | `'more'`).
|
|
14
|
+
*
|
|
15
|
+
* Everything here is pure (no Angular, no I/O) so it can be unit tested; the
|
|
16
|
+
* container owns the call and the state.
|
|
17
|
+
*/
|
|
18
|
+
import { EntityInfo, ReadRelationshipInclusion, ReadRelationshipJoinFields, ReadRelationshipShowCount, ReadRelationshipWhenEmpty, ResolveContributionShowCount, ResolveContributionWhenEmpty, } from '@memberjunction/core';
|
|
19
|
+
import { EscapeSQLString, NormalizeUUID } from '@memberjunction/global';
|
|
20
|
+
import { CreateRelatedEntitySectionKeyResolver, StripJoinFieldBrackets, VisibleFormRelationships, } from '../panel-slot/form-contribution';
|
|
21
|
+
const TAGGED_ITEMS_ENTITY = 'MJ: Tagged Items';
|
|
22
|
+
const FILE_LINKS_ENTITY = 'MJ: File Entity Record Links';
|
|
23
|
+
const RECORD_CHANGES_ENTITY = 'MJ: Record Changes';
|
|
24
|
+
/**
|
|
25
|
+
* Build the list of counts a saved record's form needs. Returns an empty plan
|
|
26
|
+
* for an unsaved record (nothing to count).
|
|
27
|
+
*/
|
|
28
|
+
export function BuildFormCountPlan(input) {
|
|
29
|
+
const { Record: record, Entity: entity } = input;
|
|
30
|
+
if (!record?.IsSaved)
|
|
31
|
+
return { Sections: [], System: [], SuppressedBadgeKeys: [] };
|
|
32
|
+
// Relationship joins assume a single-column parent key — skip sections
|
|
33
|
+
// (fail open: shown, no badge) for composite-key parents.
|
|
34
|
+
const singleKey = record.PrimaryKeys.length === 1;
|
|
35
|
+
const suppressed = new Set();
|
|
36
|
+
const sections = singleKey
|
|
37
|
+
? [...buildRelationshipTargets(input, suppressed), ...buildContributionTargets(input, suppressed)]
|
|
38
|
+
: [];
|
|
39
|
+
return { Sections: dedupeByKey(sections), System: buildSystemTargets(input), SuppressedBadgeKeys: [...suppressed] };
|
|
40
|
+
}
|
|
41
|
+
/** The `RunViews` params for a plan, in a fixed order {@link ApplyFormCountResults} understands. */
|
|
42
|
+
export function FormCountPlanParams(plan) {
|
|
43
|
+
const sectionParams = plan.Sections.filter((s) => s.Params !== null).map((s) => s.Params);
|
|
44
|
+
return [...sectionParams, ...plan.System.map((s) => s.Params)];
|
|
45
|
+
}
|
|
46
|
+
/** Map `RunViews` results (same order as {@link FormCountPlanParams}) back to keys. */
|
|
47
|
+
export function ApplyFormCountResults(plan, results) {
|
|
48
|
+
const out = { Sections: new Map(), System: new Map() };
|
|
49
|
+
let index = 0;
|
|
50
|
+
for (const section of plan.Sections) {
|
|
51
|
+
if (section.Params === null)
|
|
52
|
+
continue;
|
|
53
|
+
const count = readCount(results[index++]);
|
|
54
|
+
if (count !== null)
|
|
55
|
+
out.Sections.set(section.SectionKey, count);
|
|
56
|
+
}
|
|
57
|
+
for (const system of plan.System) {
|
|
58
|
+
const count = readCount(results[index++]);
|
|
59
|
+
if (count !== null)
|
|
60
|
+
out.System.set(system.Key, count);
|
|
61
|
+
}
|
|
62
|
+
return out;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Which sections the chrome should hide or move to More right now.
|
|
66
|
+
*
|
|
67
|
+
* - Only a section known to have 0 rows is affected.
|
|
68
|
+
* - While the prefetch is in flight, a `'hide'` section with a count query is
|
|
69
|
+
* held back so it does not appear and then vanish.
|
|
70
|
+
* - Fail open: no counts (unsaved, failed call, failed item) → nothing hidden.
|
|
71
|
+
*/
|
|
72
|
+
export function ResolveEmptySectionBehavior(input) {
|
|
73
|
+
const out = new Map();
|
|
74
|
+
if (input.ShowEmptyFields || input.Phase === 'none' || input.Phase === 'failed')
|
|
75
|
+
return out;
|
|
76
|
+
for (const target of input.Targets) {
|
|
77
|
+
if (target.WhenEmpty === 'show' || input.StickyKeys.has(target.SectionKey))
|
|
78
|
+
continue;
|
|
79
|
+
const count = input.CountOf(target.SectionKey);
|
|
80
|
+
if (count === 0) {
|
|
81
|
+
out.set(target.SectionKey, target.WhenEmpty);
|
|
82
|
+
}
|
|
83
|
+
else if (count === undefined && input.Phase === 'loading' && target.WhenEmpty === 'hide' && target.Params !== null) {
|
|
84
|
+
out.set(target.SectionKey, 'hide');
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
return out;
|
|
88
|
+
}
|
|
89
|
+
// ---- relationships ---------------------------------------------------------
|
|
90
|
+
function buildRelationshipTargets(input, suppressed) {
|
|
91
|
+
const { Record: record, Entity: entity } = input;
|
|
92
|
+
const peers = VisibleFormRelationships(entity.RelatedEntities ?? [], input.IsaChildEntityIDs);
|
|
93
|
+
const sectionKeyOf = CreateRelatedEntitySectionKeyResolver(peers);
|
|
94
|
+
const targets = [];
|
|
95
|
+
for (const rel of peers) {
|
|
96
|
+
const sectionKey = sectionKeyOf(rel);
|
|
97
|
+
if (input.HiddenSectionKeys.has(sectionKey))
|
|
98
|
+
continue;
|
|
99
|
+
if (ReadRelationshipInclusion(rel.Configuration) === 'None')
|
|
100
|
+
continue;
|
|
101
|
+
if (isImpliedJoinSibling(rel, peers))
|
|
102
|
+
continue;
|
|
103
|
+
const whenEmpty = ReadRelationshipWhenEmpty(rel.Configuration, entity.Configuration);
|
|
104
|
+
const showCount = ReadRelationshipShowCount(rel.Configuration, entity.Configuration);
|
|
105
|
+
if (!showCount)
|
|
106
|
+
suppressed.add(sectionKey);
|
|
107
|
+
if (!showCount && whenEmpty === 'show')
|
|
108
|
+
continue;
|
|
109
|
+
targets.push({
|
|
110
|
+
SectionKey: sectionKey,
|
|
111
|
+
WhenEmpty: whenEmpty,
|
|
112
|
+
ShowCount: showCount,
|
|
113
|
+
Params: countOnly(EntityInfo.BuildRelationshipViewParams(record, rel)),
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
return targets;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* A sibling FK folded into another relationship's `join.fields` OR (Bill-To +
|
|
120
|
+
* Ship-To on one section) is not its own section — mirrors the chrome ranker.
|
|
121
|
+
*/
|
|
122
|
+
function isImpliedJoinSibling(rel, peers) {
|
|
123
|
+
if (ReadRelationshipInclusion(rel.Configuration) !== null)
|
|
124
|
+
return false;
|
|
125
|
+
if (ReadRelationshipJoinFields(rel.Configuration))
|
|
126
|
+
return false;
|
|
127
|
+
const target = NormalizeUUID(rel.RelatedEntityID);
|
|
128
|
+
const joinField = StripJoinFieldBrackets(rel.RelatedEntityJoinField)?.toLowerCase();
|
|
129
|
+
return peers.some((peer) => {
|
|
130
|
+
if (peer === rel || NormalizeUUID(peer.RelatedEntityID) !== target)
|
|
131
|
+
return false;
|
|
132
|
+
const fields = ReadRelationshipJoinFields(peer.Configuration);
|
|
133
|
+
return !!fields && fields.some((f) => f.toLowerCase() === joinField);
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
// ---- contributions ---------------------------------------------------------
|
|
137
|
+
function buildContributionTargets(input, suppressed) {
|
|
138
|
+
const targets = [];
|
|
139
|
+
for (const contribution of input.Contributions) {
|
|
140
|
+
const meta = contribution.Metadata;
|
|
141
|
+
const whenEmpty = ResolveContributionWhenEmpty(meta.whenEmpty, input.Entity.Configuration);
|
|
142
|
+
const showCount = ResolveContributionShowCount(meta.showCount, input.Entity.Configuration);
|
|
143
|
+
if (!showCount)
|
|
144
|
+
suppressed.add(contribution.SectionKey);
|
|
145
|
+
if (!showCount && whenEmpty === 'show')
|
|
146
|
+
continue;
|
|
147
|
+
const params = contributionCountParams(meta, input.Record, input.Entity);
|
|
148
|
+
targets.push({
|
|
149
|
+
SectionKey: contribution.SectionKey,
|
|
150
|
+
WhenEmpty: whenEmpty,
|
|
151
|
+
ShowCount: showCount,
|
|
152
|
+
Params: params ? countOnly(params) : null,
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
return targets;
|
|
156
|
+
}
|
|
157
|
+
function contributionCountParams(meta, record, entity) {
|
|
158
|
+
if (meta.count === false)
|
|
159
|
+
return null;
|
|
160
|
+
const countEntity = meta.count ? meta.count.entity : meta.relatedEntity;
|
|
161
|
+
if (!countEntity?.trim())
|
|
162
|
+
return null;
|
|
163
|
+
const explicitFields = meta.count
|
|
164
|
+
? (meta.count.joinFields ?? []).map((f) => StripJoinFieldBrackets(f)).filter((f) => !!f)
|
|
165
|
+
: [StripJoinFieldBrackets(meta.relatedJoinField)].filter((f) => !!f);
|
|
166
|
+
const matches = relationshipsTo(entity, countEntity);
|
|
167
|
+
if (explicitFields.length === 1) {
|
|
168
|
+
const rel = matches.find((m) => StripJoinFieldBrackets(m.RelatedEntityJoinField)?.toLowerCase() === explicitFields[0].toLowerCase());
|
|
169
|
+
if (rel)
|
|
170
|
+
return EntityInfo.BuildRelationshipViewParams(record, rel);
|
|
171
|
+
}
|
|
172
|
+
if (explicitFields.length > 0) {
|
|
173
|
+
return EntityInfo.BuildRelationshipViewParamsForJoinFields(record, countEntity, explicitFields);
|
|
174
|
+
}
|
|
175
|
+
if (matches.length === 1)
|
|
176
|
+
return EntityInfo.BuildRelationshipViewParams(record, matches[0]);
|
|
177
|
+
if (matches.length > 1) {
|
|
178
|
+
// A claim without a join field covers every FK to that entity.
|
|
179
|
+
return EntityInfo.BuildRelationshipViewParamsForJoinFields(record, countEntity, matches.map((m) => m.RelatedEntityJoinField));
|
|
180
|
+
}
|
|
181
|
+
return null;
|
|
182
|
+
}
|
|
183
|
+
function relationshipsTo(entity, relatedEntityName) {
|
|
184
|
+
const wanted = relatedEntityName.trim().toLowerCase();
|
|
185
|
+
return (entity.RelatedEntities ?? []).filter((r) => r.RelatedEntity.trim().toLowerCase() === wanted);
|
|
186
|
+
}
|
|
187
|
+
// ---- system badges ---------------------------------------------------------
|
|
188
|
+
function buildSystemTargets(input) {
|
|
189
|
+
const { Record: record, Entity: entity } = input;
|
|
190
|
+
const entityID = EscapeSQLString(entity.ID);
|
|
191
|
+
const recordValues = EscapeSQLString(record.PrimaryKey.Values());
|
|
192
|
+
const targets = [
|
|
193
|
+
{ Key: 'tags', Params: countOnly({ EntityName: TAGGED_ITEMS_ENTITY, ExtraFilter: `EntityID='${entityID}' AND RecordID='${recordValues}'` }) },
|
|
194
|
+
];
|
|
195
|
+
if (input.IncludeAttachments) {
|
|
196
|
+
targets.push({ Key: 'attachments', Params: countOnly({ EntityName: FILE_LINKS_ENTITY, ExtraFilter: `EntityID='${entityID}' AND RecordID='${recordValues}'` }) });
|
|
197
|
+
}
|
|
198
|
+
if (entity.TrackRecordChanges) {
|
|
199
|
+
const recordKey = EscapeSQLString(record.PrimaryKey.ToConcatenatedString());
|
|
200
|
+
targets.push({ Key: 'versions', Params: countOnly({ EntityName: RECORD_CHANGES_ENTITY, ExtraFilter: `EntityID='${entityID}' AND RecordID='${recordKey}'` }) });
|
|
201
|
+
}
|
|
202
|
+
return targets;
|
|
203
|
+
}
|
|
204
|
+
// ---- helpers ---------------------------------------------------------------
|
|
205
|
+
function countOnly(params) {
|
|
206
|
+
return { ...params, ResultType: 'count_only', MaxRows: undefined };
|
|
207
|
+
}
|
|
208
|
+
function readCount(result) {
|
|
209
|
+
if (!result?.Success)
|
|
210
|
+
return null;
|
|
211
|
+
const count = Number(result.TotalRowCount ?? result.RowCount);
|
|
212
|
+
return Number.isFinite(count) && count >= 0 ? count : null;
|
|
213
|
+
}
|
|
214
|
+
function dedupeByKey(targets) {
|
|
215
|
+
const seen = new Map();
|
|
216
|
+
for (const target of targets) {
|
|
217
|
+
// A contribution registered under the same key as a grid wins (it is
|
|
218
|
+
// what renders there).
|
|
219
|
+
seen.set(target.SectionKey, target);
|
|
220
|
+
}
|
|
221
|
+
return [...seen.values()];
|
|
222
|
+
}
|
|
223
|
+
//# sourceMappingURL=form-section-counts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-section-counts.js","sourceRoot":"","sources":["../../../src/lib/section-counts/form-section-counts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAEH,UAAU,EAGV,yBAAyB,EACzB,0BAA0B,EAC1B,yBAAyB,EACzB,yBAAyB,EACzB,4BAA4B,EAC5B,4BAA4B,GAG/B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAExE,OAAO,EACH,qCAAqC,EACrC,sBAAsB,EACtB,wBAAwB,GAC3B,MAAM,iCAAiC,CAAC;AA0DzC,MAAM,mBAAmB,GAAG,kBAAkB,CAAC;AAC/C,MAAM,iBAAiB,GAAG,8BAA8B,CAAC;AACzD,MAAM,qBAAqB,GAAG,oBAAoB,CAAC;AAEnD;;;GAGG;AACH,MAAM,UAAU,kBAAkB,CAAC,KAA8B;IAC7D,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;IACjD,IAAI,CAAC,MAAM,EAAE,OAAO;QAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,mBAAmB,EAAE,EAAE,EAAE,CAAC;IAEnF,uEAAuE;IACvE,0DAA0D;IAC1D,MAAM,SAAS,GAAG,MAAM,CAAC,WAAW,CAAC,MAAM,KAAK,CAAC,CAAC;IAClD,MAAM,UAAU,GAAG,IAAI,GAAG,EAAU,CAAC;IACrC,MAAM,QAAQ,GAAG,SAAS;QACtB,CAAC,CAAC,CAAC,GAAG,wBAAwB,CAAC,KAAK,EAAE,UAAU,CAAC,EAAE,GAAG,wBAAwB,CAAC,KAAK,EAAE,UAAU,CAAC,CAAC;QAClG,CAA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AAI,CAAC,MAAM,EAAE,OAAO;QAAE,OAAO,IAAI,CAAC;IAClC,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC,aAAa,IAAI,MAAM,CAAC,QAAQ,CAAC,CAAC;IAC9D,OAAO,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;AAC/D,CAAC;AAED,SAAS,WAAW,CAAC,OAAiC;IAClD,MAAM,IAAI,GAAG,IAAI,GAAG,EAAkC,CAAC;IACvD,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;QAC3B,qEAAqE;QACrE,uBAAuB;QACvB,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;IACxC,CAAC;IACD,OAAO,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC;AAC9B,CAAC","sourcesContent":["/**\n * Form section counts — one round trip for every badge on a record form.\n *\n * When a saved record opens, the container asks for the row count of every\n * related section (baked grids, stock fill-in grids, contributions) plus the\n * toolbar's tag / attachment / version badges in ONE `RunViews` call of\n * `count_only` views. The database provider runs an all-`count_only` batch as a\n * single `UNION ALL` statement, and every view keeps the normal RunView security\n * path (CanRead, row-level security, saved-view filters).\n *\n * The counts drive two things:\n * - badges (`showCount`, default on), and\n * - empty-section chrome (`whenEmpty`: `'show'` default | `'hide'` | `'more'`).\n *\n * Everything here is pure (no Angular, no I/O) so it can be unit tested; the\n * container owns the call and the state.\n */\nimport {\n BaseEntity,\n EntityInfo,\n EntityRelationshipInfo,\n FormWhenEmpty,\n ReadRelationshipInclusion,\n ReadRelationshipJoinFields,\n ReadRelationshipShowCount,\n ReadRelationshipWhenEmpty,\n ResolveContributionShowCount,\n ResolveContributionWhenEmpty,\n RunViewParams,\n RunViewResult,\n} from '@memberjunction/core';\nimport { EscapeSQLString, NormalizeUUID } from '@memberjunction/global';\nimport { FormPanelRegistrationMetadata } from '../panel-slot/base-form-panel';\nimport {\n CreateRelatedEntitySectionKeyResolver,\n StripJoinFieldBrackets,\n VisibleFormRelationships,\n} from '../panel-slot/form-contribution';\n\n/** One form section (related grid or contribution) whose rows are counted. */\nexport interface FormSectionCountTarget {\n SectionKey: string;\n WhenEmpty: FormWhenEmpty;\n ShowCount: boolean;\n /**\n * The count query, or `null` when the section has no count source the form\n * can build (a contribution that reports its own count after it mounts).\n */\n Params: RunViewParams | null;\n}\n\n/** Toolbar badges counted in the same round trip. */\nexport type FormSystemCountKey = 'tags' | 'attachments' | 'versions';\n\nexport interface FormSystemCountTarget {\n Key: FormSystemCountKey;\n Params: RunViewParams;\n}\n\nexport interface FormCountPlan {\n Sections: FormSectionCountTarget[];\n System: FormSystemCountTarget[];\n /**\n * Section keys whose badge is turned off (`showCount: false`), including\n * ones not fetched at all because they are also `whenEmpty: 'show'`. A grid\n * load still records their count; the form just does not badge it.\n */\n SuppressedBadgeKeys: string[];\n}\n\n/** A winning contribution registration, keyed by its rail / section key. */\nexport interface FormCountContribution {\n SectionKey: string;\n Metadata: FormPanelRegistrationMetadata;\n}\n\nexport interface BuildFormCountPlanInput {\n Record: BaseEntity;\n Entity: EntityInfo;\n /** IS-A child entity IDs (their relationships are not related sections). */\n IsaChildEntityIDs: readonly string[];\n /** Section keys already hidden by a claim / replacement / chrome — never counted as grids. */\n HiddenSectionKeys: ReadonlySet<string>;\n /** Winning contribution registrations for this entity (header excluded). */\n Contributions: readonly FormCountContribution[];\n /** Include the attachment badge (entity allows attachments). */\n IncludeAttachments: boolean;\n}\n\n/** Counts that came back; a section / badge whose query failed is absent. */\nexport interface FormCountResults {\n Sections: Map<string, number>;\n System: Map<FormSystemCountKey, number>;\n}\n\nconst TAGGED_ITEMS_ENTITY = 'MJ: Tagged Items';\nconst FILE_LINKS_ENTITY = 'MJ: File Entity Record Links';\nconst RECORD_CHANGES_ENTITY = 'MJ: Record Changes';\n\n/**\n * Build the list of counts a saved record's form needs. Returns an empty plan\n * for an unsaved record (nothing to count).\n */\nexport function BuildFormCountPlan(input: BuildFormCountPlanInput): FormCountPlan {\n const { Record: record, Entity: entity } = input;\n if (!record?.IsSaved) return { Sections: [], System: [], SuppressedBadgeKeys: [] };\n\n // Relationship joins assume a single-column parent key — skip sections\n // (fail open: shown, no badge) for composite-key parents.\n const singleKey = record.PrimaryKeys.length === 1;\n const suppressed = new Set<string>();\n const sections = singleKey\n ? [...buildRelationshipTargets(input, suppressed), ...buildContributionTargets(input, suppressed)]\n : [];\n return { Sections: dedupeByKey(sections), System: buildSystemTargets(input), SuppressedBadgeKeys: [...suppressed] };\n}\n\n/** The `RunViews` params for a plan, in a fixed order {@link ApplyFormCountResults} understands. */\nexport function FormCountPlanParams(plan: FormCountPlan): RunViewParams[] {\n const sectionParams = plan.Sections.filter((s) => s.Params !== null).map((s) => s.Params as RunViewParams);\n return [...sectionParams, ...plan.System.map((s) => s.Params)];\n}\n\n/** Map `RunViews` results (same order as {@link FormCountPlanParams}) back to keys. */\nexport function ApplyFormCountResults(plan: FormCountPlan, results: readonly (RunViewResult | null | undefined)[]): FormCountResults {\n const out: FormCountResults = { Sections: new Map(), System: new Map() };\n let index = 0;\n for (const section of plan.Sections) {\n if (section.Params === null) continue;\n const count = readCount(results[index++]);\n if (count !== null) out.Sections.set(section.SectionKey, count);\n }\n for (const system of plan.System) {\n const count = readCount(results[index++]);\n if (count !== null) out.System.set(system.Key, count);\n }\n return out;\n}\n\n/** Where a form is in its count lifecycle for the current record. */\nexport type FormCountPhase = 'none' | 'loading' | 'loaded' | 'failed';\n\nexport interface ResolveEmptySectionBehaviorInput {\n Targets: readonly FormSectionCountTarget[];\n /** Latest known count per section key (prefetch or a grid load). */\n CountOf: (sectionKey: string) => number | undefined;\n Phase: FormCountPhase;\n /** The toolbar's \"show empty fields\" toggle — reveals everything. */\n ShowEmptyFields: boolean;\n /** Sections that must not be hidden or moved (had rows this session, or are open). */\n StickyKeys: ReadonlySet<string>;\n}\n\n/**\n * Which sections the chrome should hide or move to More right now.\n *\n * - Only a section known to have 0 rows is affected.\n * - While the prefetch is in flight, a `'hide'` section with a count query is\n * held back so it does not appear and then vanish.\n * - Fail open: no counts (unsaved, failed call, failed item) → nothing hidden.\n */\nexport function ResolveEmptySectionBehavior(input: ResolveEmptySectionBehaviorInput): Map<string, 'hide' | 'more'> {\n const out = new Map<string, 'hide' | 'more'>();\n if (input.ShowEmptyFields || input.Phase === 'none' || input.Phase === 'failed') return out;\n for (const target of input.Targets) {\n if (target.WhenEmpty === 'show' || input.StickyKeys.has(target.SectionKey)) continue;\n const count = input.CountOf(target.SectionKey);\n if (count === 0) {\n out.set(target.SectionKey, target.WhenEmpty);\n } else if (count === undefined && input.Phase === 'loading' && target.WhenEmpty === 'hide' && target.Params !== null) {\n out.set(target.SectionKey, 'hide');\n }\n }\n return out;\n}\n\n// ---- relationships ---------------------------------------------------------\n\nfunction buildRelationshipTargets(input: BuildFormCountPlanInput, suppressed: Set<string>): FormSectionCountTarget[] {\n const { Record: record, Entity: entity } = input;\n const peers = VisibleFormRelationships(entity.RelatedEntities ?? [], input.IsaChildEntityIDs);\n const sectionKeyOf = CreateRelatedEntitySectionKeyResolver(peers);\n const targets: FormSectionCountTarget[] = [];\n for (const rel of peers) {\n const sectionKey = sectionKeyOf(rel);\n if (input.HiddenSectionKeys.has(sectionKey)) continue;\n if (ReadRelationshipInclusion(rel.Configuration) === 'None') continue;\n if (isImpliedJoinSibling(rel, peers)) continue;\n const whenEmpty = ReadRelationshipWhenEmpty(rel.Configuration, entity.Configuration);\n const showCount = ReadRelationshipShowCount(rel.Configuration, entity.Configuration);\n if (!showCount) suppressed.add(sectionKey);\n if (!showCount && whenEmpty === 'show') continue;\n targets.push({\n SectionKey: sectionKey,\n WhenEmpty: whenEmpty,\n ShowCount: showCount,\n Params: countOnly(EntityInfo.BuildRelationshipViewParams(record, rel)),\n });\n }\n return targets;\n}\n\n/**\n * A sibling FK folded into another relationship's `join.fields` OR (Bill-To +\n * Ship-To on one section) is not its own section — mirrors the chrome ranker.\n */\nfunction isImpliedJoinSibling(rel: EntityRelationshipInfo, peers: readonly EntityRelationshipInfo[]): boolean {\n if (ReadRelationshipInclusion(rel.Configuration) !== null) return false;\n if (ReadRelationshipJoinFields(rel.Configuration)) return false;\n const target = NormalizeUUID(rel.RelatedEntityID);\n const joinField = StripJoinFieldBrackets(rel.RelatedEntityJoinField)?.toLowerCase();\n return peers.some((peer) => {\n if (peer === rel || NormalizeUUID(peer.RelatedEntityID) !== target) return false;\n const fields = ReadRelationshipJoinFields(peer.Configuration);\n return !!fields && fields.some((f) => f.toLowerCase() === joinField);\n });\n}\n\n// ---- contributions ---------------------------------------------------------\n\nfunction buildContributionTargets(input: BuildFormCountPlanInput, suppressed: Set<string>): FormSectionCountTarget[] {\n const targets: FormSectionCountTarget[] = [];\n for (const contribution of input.Contributions) {\n const meta = contribution.Metadata;\n const whenEmpty = ResolveContributionWhenEmpty(meta.whenEmpty, input.Entity.Configuration);\n const showCount = ResolveContributionShowCount(meta.showCount, input.Entity.Configuration);\n if (!showCount) suppressed.add(contribution.SectionKey);\n if (!showCount && whenEmpty === 'show') continue;\n const params = contributionCountParams(meta, input.Record, input.Entity);\n targets.push({\n SectionKey: contribution.SectionKey,\n WhenEmpty: whenEmpty,\n ShowCount: showCount,\n Params: params ? countOnly(params) : null,\n });\n }\n return targets;\n}\n\nfunction contributionCountParams(meta: FormPanelRegistrationMetadata, record: BaseEntity, entity: EntityInfo): RunViewParams | null {\n if (meta.count === false) return null;\n const countEntity = meta.count ? meta.count.entity : meta.relatedEntity;\n if (!countEntity?.trim()) return null;\n const explicitFields = meta.count\n ? (meta.count.joinFields ?? []).map((f) => StripJoinFieldBrackets(f)).filter((f): f is string => !!f)\n : [StripJoinFieldBrackets(meta.relatedJoinField)].filter((f): f is string => !!f);\n const matches = relationshipsTo(entity, countEntity);\n if (explicitFields.length === 1) {\n const rel = matches.find((m) => StripJoinFieldBrackets(m.RelatedEntityJoinField)?.toLowerCase() === explicitFields[0].toLowerCase());\n if (rel) return EntityInfo.BuildRelationshipViewParams(record, rel);\n }\n if (explicitFields.length > 0) {\n return EntityInfo.BuildRelationshipViewParamsForJoinFields(record, countEntity, explicitFields);\n }\n if (matches.length === 1) return EntityInfo.BuildRelationshipViewParams(record, matches[0]);\n if (matches.length > 1) {\n // A claim without a join field covers every FK to that entity.\n return EntityInfo.BuildRelationshipViewParamsForJoinFields(record, countEntity, matches.map((m) => m.RelatedEntityJoinField));\n }\n return null;\n}\n\nfunction relationshipsTo(entity: EntityInfo, relatedEntityName: string): EntityRelationshipInfo[] {\n const wanted = relatedEntityName.trim().toLowerCase();\n return (entity.RelatedEntities ?? []).filter((r) => r.RelatedEntity.trim().toLowerCase() === wanted);\n}\n\n// ---- system badges ---------------------------------------------------------\n\nfunction buildSystemTargets(input: BuildFormCountPlanInput): FormSystemCountTarget[] {\n const { Record: record, Entity: entity } = input;\n const entityID = EscapeSQLString(entity.ID);\n const recordValues = EscapeSQLString(record.PrimaryKey.Values());\n const targets: FormSystemCountTarget[] = [\n { Key: 'tags', Params: countOnly({ EntityName: TAGGED_ITEMS_ENTITY, ExtraFilter: `EntityID='${entityID}' AND RecordID='${recordValues}'` }) },\n ];\n if (input.IncludeAttachments) {\n targets.push({ Key: 'attachments', Params: countOnly({ EntityName: FILE_LINKS_ENTITY, ExtraFilter: `EntityID='${entityID}' AND RecordID='${recordValues}'` }) });\n }\n if (entity.TrackRecordChanges) {\n const recordKey = EscapeSQLString(record.PrimaryKey.ToConcatenatedString());\n targets.push({ Key: 'versions', Params: countOnly({ EntityName: RECORD_CHANGES_ENTITY, ExtraFilter: `EntityID='${entityID}' AND RecordID='${recordKey}'` }) });\n }\n return targets;\n}\n\n// ---- helpers ---------------------------------------------------------------\n\nfunction countOnly(params: RunViewParams): RunViewParams {\n return { ...params, ResultType: 'count_only', MaxRows: undefined };\n}\n\nfunction readCount(result: RunViewResult | null | undefined): number | null {\n if (!result?.Success) return null;\n const count = Number(result.TotalRowCount ?? result.RowCount);\n return Number.isFinite(count) && count >= 0 ? count : null;\n}\n\nfunction dedupeByKey(targets: FormSectionCountTarget[]): FormSectionCountTarget[] {\n const seen = new Map<string, FormSectionCountTarget>();\n for (const target of targets) {\n // A contribution registered under the same key as a grid wins (it is\n // what renders there).\n seen.set(target.SectionKey, target);\n }\n return [...seen.values()];\n}\n"]}
|
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
import { EventEmitter, TemplateRef, DoCheck, OnInit, OnDestroy } from '@angular/core';
|
|
2
2
|
import { BaseAngularComponent } from '@memberjunction/ng-base-types';
|
|
3
3
|
import { BaseEntity, EntityInfo } from '@memberjunction/core';
|
|
4
|
+
import { type CloneCompletedEvent, type CloneNavigationEvent } from '@memberjunction/ng-record-clone';
|
|
4
5
|
import { FormToolbarConfig } from '../types/toolbar-config';
|
|
5
6
|
import { FormToolbarItemConfig, FormToolbarItemClickEventArgs, ResolvedToolbarItem } from '../types/form-toolbar-item';
|
|
6
7
|
import { FormNavigationEvent } from '../types/navigation-events';
|
|
7
8
|
import { IsaRelatedItem } from '../isa-related-panel/isa-hierarchy-utils';
|
|
8
9
|
import { FormWidthMode } from '../types/form-types';
|
|
9
|
-
import { BeforeSaveEventArgs, BeforeDeleteEventArgs, BeforeRefreshEventArgs, BeforeCancelEventArgs, BeforeHistoryViewEventArgs, BeforeListManagementEventArgs, CustomToolbarButtonClickEventArgs, CustomToolbarButton } from '../types/form-events';
|
|
10
|
+
import { BeforeSaveEventArgs, BeforeDeleteEventArgs, BeforeRefreshEventArgs, BeforeCancelEventArgs, BeforeHistoryViewEventArgs, BeforeListManagementEventArgs, BeforeCloneEventArgs, CustomToolbarButtonClickEventArgs, CustomToolbarButton } from '../types/form-events';
|
|
10
11
|
import * as i0 from "@angular/core";
|
|
12
|
+
/** User setting that stores the toolbar actions a user pinned, shared across every form. */
|
|
13
|
+
export declare const TOOLBAR_PINS_SETTING_KEY = "mj.form.toolbar.pinnedActions";
|
|
14
|
+
/** Built-in actions that start pinned for a user who has not chosen pins. */
|
|
15
|
+
export declare const DEFAULT_PINNED_TOOLBAR_ACTIONS: readonly string[];
|
|
11
16
|
/**
|
|
12
17
|
* Configurable form toolbar component.
|
|
13
18
|
*
|
|
@@ -33,6 +38,9 @@ import * as i0 from "@angular/core";
|
|
|
33
38
|
export declare class MjFormToolbarComponent extends BaseAngularComponent implements DoCheck, OnInit, OnDestroy {
|
|
34
39
|
private cdr;
|
|
35
40
|
private recordRefresh;
|
|
41
|
+
private cloneService;
|
|
42
|
+
private host;
|
|
43
|
+
private renderer;
|
|
36
44
|
private destroy$;
|
|
37
45
|
private _formRef;
|
|
38
46
|
/**
|
|
@@ -175,6 +183,10 @@ export declare class MjFormToolbarComponent extends BaseAngularComponent impleme
|
|
|
175
183
|
WidthModeChange: EventEmitter<FormWidthMode>;
|
|
176
184
|
ResetSectionOrderRequested: EventEmitter<void>;
|
|
177
185
|
ManageSectionsRequested: EventEmitter<void>;
|
|
186
|
+
/** Emitted before the clone slide-in opens. Set `Cancel` to handle cloning yourself. */
|
|
187
|
+
BeforeClone: EventEmitter<BeforeCloneEventArgs>;
|
|
188
|
+
/** Emitted after the clone slide-in commits a clone of this record. */
|
|
189
|
+
CloneCompleted: EventEmitter<CloneCompletedEvent>;
|
|
178
190
|
ShowDeleteDialog: boolean;
|
|
179
191
|
ShowDiscardDialog: boolean;
|
|
180
192
|
/** Computed descendant tree for breadcrumb display */
|
|
@@ -184,6 +196,8 @@ export declare class MjFormToolbarComponent extends BaseAngularComponent impleme
|
|
|
184
196
|
ngOnInit(): void;
|
|
185
197
|
ngOnDestroy(): void;
|
|
186
198
|
ngDoCheck(): void;
|
|
199
|
+
/** Redraws when the saved pins changed elsewhere (another open form, another tab). */
|
|
200
|
+
private checkPinsChanged;
|
|
187
201
|
/**
|
|
188
202
|
* Sync toolbar state from the legacy form reference.
|
|
189
203
|
* Only active when [Form] is set (backward-compat mode).
|
|
@@ -276,11 +290,120 @@ export declare class MjFormToolbarComponent extends BaseAngularComponent impleme
|
|
|
276
290
|
* evaluated against the current Record and EditMode.
|
|
277
291
|
*/
|
|
278
292
|
get ResolvedToolbarItems(): ResolvedToolbarItem[];
|
|
293
|
+
/** The resolved items for the current change-detection pass; cleared in ngDoCheck. */
|
|
294
|
+
private _resolvedItems;
|
|
295
|
+
private resolveToolbarItems;
|
|
279
296
|
get ResolvedActionItems(): ResolvedToolbarItem[];
|
|
280
297
|
get ResolvedEditBeforeSaveItems(): ResolvedToolbarItem[];
|
|
281
298
|
get ResolvedEditAfterSaveItems(): ResolvedToolbarItem[];
|
|
299
|
+
/**
|
|
300
|
+
* Items drawn on the right, beside the View menu.
|
|
301
|
+
*
|
|
302
|
+
* `overflow` is folded in: the placement is part of the public type but the More menu
|
|
303
|
+
* lists only `actions` items, so without this an item registered for `overflow` would
|
|
304
|
+
* render nowhere and the caller would have no way to tell.
|
|
305
|
+
*/
|
|
282
306
|
get ResolvedRightItems(): ResolvedToolbarItem[];
|
|
307
|
+
/** Whether the More menu is open. */
|
|
308
|
+
MoreMenuOpen: boolean;
|
|
309
|
+
/** Whether the View menu (section and layout controls) is open. */
|
|
310
|
+
ViewMenuOpen: boolean;
|
|
311
|
+
/** Last raw pins setting read from UserInfoEngine, and its parse, so each change detection pass doesn't re-parse. */
|
|
312
|
+
private _pinsRaw;
|
|
313
|
+
private _pinsParsed;
|
|
314
|
+
/** Pins set in this session when no user settings are available (tests, anonymous hosts). */
|
|
315
|
+
private _localPins;
|
|
316
|
+
/** The maximum number of pinned buttons, the same for every user. */
|
|
317
|
+
get MaxPinnedActions(): number;
|
|
318
|
+
/**
|
|
319
|
+
* Keys the user pinned, in their order, or the configured defaults until they choose. Read from
|
|
320
|
+
* UserInfoEngine on every pass (pending debounced writes included), so every open form agrees.
|
|
321
|
+
* May include actions this form doesn't offer; those neither render nor use a slot here.
|
|
322
|
+
*/
|
|
323
|
+
get PinnedKeys(): string[];
|
|
324
|
+
/** Read-mode actions that always render as buttons: Edit and custom items that are not pinnable. */
|
|
325
|
+
get InlineActionItems(): ResolvedToolbarItem[];
|
|
326
|
+
/** Pinned actions this form offers, in pin order, up to MaxPinnedActions. Computed once per pass. */
|
|
327
|
+
get PinnedActionItems(): ResolvedToolbarItem[];
|
|
328
|
+
/**
|
|
329
|
+
* The pinned items for the current change-detection pass (cleared in ngDoCheck): those shown as
|
|
330
|
+
* buttons, and every pinned key this form offers, including ones past the cap.
|
|
331
|
+
*/
|
|
332
|
+
private _pinnedItems;
|
|
333
|
+
private resolvePinnedItems;
|
|
334
|
+
/** Pinnable actions listed in the More menu, Delete excluded (it has its own row). */
|
|
335
|
+
get MoreMenuItems(): ResolvedToolbarItem[];
|
|
336
|
+
/** The Delete action, shown last in the More menu, unless a host made it an inline button. */
|
|
337
|
+
get DeleteMenuItem(): ResolvedToolbarItem | undefined;
|
|
338
|
+
get ShowMoreMenu(): boolean;
|
|
339
|
+
/** Whether the action is pinned for this user and offered on this form (shown as a button, or waiting past the cap). */
|
|
340
|
+
IsPinned(key: string): boolean;
|
|
341
|
+
/**
|
|
342
|
+
* Pinned (in the user's list) but not shown on this form, because the pins before it filled every
|
|
343
|
+
* slot. Pins count per form, so one saved on a form without some of the others can land here.
|
|
344
|
+
*/
|
|
345
|
+
IsPinnedOverCap(key: string): boolean;
|
|
346
|
+
/** Whether another action can be pinned here; counts only the pinned buttons this form shows. */
|
|
347
|
+
get CanPinMore(): boolean;
|
|
348
|
+
/**
|
|
349
|
+
* Pins or unpins an action for this user and saves the choice. Pins for actions this form
|
|
350
|
+
* doesn't offer are kept, so they come back on forms that do.
|
|
351
|
+
*/
|
|
352
|
+
TogglePin(key: string): void;
|
|
353
|
+
private static nextMenuId;
|
|
354
|
+
/** Prefix for the More and View panels' ids, unique per toolbar, for the triggers' aria-controls. */
|
|
355
|
+
readonly MenuIdPrefix: string;
|
|
356
|
+
ToggleMoreMenu(): void;
|
|
357
|
+
ToggleViewMenu(): void;
|
|
358
|
+
/** Puts focus back on a panel's trigger, for when the control that had focus goes away with the panel. */
|
|
359
|
+
private focusTrigger;
|
|
360
|
+
/** Moves focus into a just-opened panel, once it has rendered, so keyboard users land in it. */
|
|
361
|
+
private focusFirstIn;
|
|
362
|
+
/**
|
|
363
|
+
* Runs a More-menu item and closes the menu. Focus goes back to the More button first, so a
|
|
364
|
+
* keyboard user isn't left on <body>; an item that opens its own drawer or dialog then takes it.
|
|
365
|
+
*/
|
|
366
|
+
OnMenuItemClick(item: ResolvedToolbarItem, event: MouseEvent): void;
|
|
367
|
+
CloseMenus(): void;
|
|
368
|
+
/** Document listeners run only while a panel is open, so a click elsewhere in the app costs closed toolbars nothing. */
|
|
369
|
+
private _unlistenDocument;
|
|
370
|
+
private syncDocumentListeners;
|
|
371
|
+
private stopDocumentListeners;
|
|
372
|
+
/** Whether the View menu has anything to show. */
|
|
373
|
+
get ShowViewMenu(): boolean;
|
|
374
|
+
OnDocumentClick(event: MouseEvent): void;
|
|
375
|
+
OnEscape(event?: Event): void;
|
|
376
|
+
/**
|
|
377
|
+
* The engine for this component's provider (a multi-provider host has one per connection), else
|
|
378
|
+
* the global one. Resolved once per change-detection pass (cleared in ngDoCheck).
|
|
379
|
+
*/
|
|
380
|
+
private get userInfoEngine();
|
|
381
|
+
private _userInfoEngine;
|
|
382
|
+
private resolveUserInfoEngine;
|
|
383
|
+
private readPins;
|
|
384
|
+
private writePins;
|
|
283
385
|
OnToolbarItemClick(item: ResolvedToolbarItem, event: MouseEvent): Promise<void>;
|
|
386
|
+
/** Whether the clone slide-in is open. */
|
|
387
|
+
IsClonePanelOpen: boolean;
|
|
388
|
+
/** Whether the server said this user may clone records of the current entity. */
|
|
389
|
+
CanCloneEntity: boolean;
|
|
390
|
+
/** The entity name the last clone capability check ran for. */
|
|
391
|
+
private _cloneCheckedEntity;
|
|
392
|
+
private _cloneRecordKey;
|
|
393
|
+
/** True when the Clone action should render for the current record. */
|
|
394
|
+
get ShowCloneAction(): boolean;
|
|
395
|
+
/** Opens the clone slide-in, unless a `BeforeClone` handler cancels. */
|
|
396
|
+
OnClone(): void;
|
|
397
|
+
OnClonePanelVisibleChange(visible: boolean): void;
|
|
398
|
+
OnCloneCompleted(event: CloneCompletedEvent): void;
|
|
399
|
+
/** Turns the clone widget's navigation request into the toolbar's own `Navigate` event. */
|
|
400
|
+
OnCloneNavigate(event: CloneNavigationEvent): void;
|
|
401
|
+
/**
|
|
402
|
+
* Asks `RecordClone.Describe` (cached per entity per session) once per entity whether the
|
|
403
|
+
* user may clone it. Entities whose `Configuration.Clone.Enabled` is not true are skipped
|
|
404
|
+
* without a server call.
|
|
405
|
+
*/
|
|
406
|
+
private checkCloneCapability;
|
|
284
407
|
OnShowChanges(): void;
|
|
285
408
|
/** Whether the variant-picker dropdown is currently open. */
|
|
286
409
|
VariantMenuOpen: boolean;
|
|
@@ -304,7 +427,9 @@ export declare class MjFormToolbarComponent extends BaseAngularComponent impleme
|
|
|
304
427
|
Scope: string;
|
|
305
428
|
Status: string;
|
|
306
429
|
}): string;
|
|
430
|
+
/** @deprecated The variant list lives in the View panel; nothing opens a separate variant menu. */
|
|
307
431
|
ToggleVariantMenu(): void;
|
|
432
|
+
/** @deprecated The variant list lives in the View panel; use {@link CloseMenus}. */
|
|
308
433
|
CloseVariantMenu(): void;
|
|
309
434
|
/**
|
|
310
435
|
* User picked a row in the variant menu. Closes the menu and emits
|
|
@@ -343,8 +468,10 @@ export declare class MjFormToolbarComponent extends BaseAngularComponent impleme
|
|
|
343
468
|
OnToggleEmptyFields(): void;
|
|
344
469
|
OnToggleWidthMode(): void;
|
|
345
470
|
OnResetSectionOrder(): void;
|
|
471
|
+
/** "Reorder sections" in the View panel: close it properly (listeners, focus on View), then open the manager. */
|
|
472
|
+
OnReorderSectionsFromView(): void;
|
|
346
473
|
OnManageSections(): void;
|
|
347
474
|
static ɵfac: i0.ɵɵFactoryDeclaration<MjFormToolbarComponent, never>;
|
|
348
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<MjFormToolbarComponent, "mj-form-toolbar", never, { "Form": { "alias": "Form"; "required": false; }; "_deprecatedForm": { "alias": "form"; "required": false; }; "Record": { "alias": "Record"; "required": false; }; "EditMode": { "alias": "EditMode"; "required": false; }; "UserCanEdit": { "alias": "UserCanEdit"; "required": false; }; "UserCanDelete": { "alias": "UserCanDelete"; "required": false; }; "IsFavorite": { "alias": "IsFavorite"; "required": false; }; "FavoriteInitDone": { "alias": "FavoriteInitDone"; "required": false; }; "IsDirty": { "alias": "IsDirty"; "required": false; }; "DirtyFieldNames": { "alias": "DirtyFieldNames"; "required": false; }; "ListCount": { "alias": "ListCount"; "required": false; }; "TagCount": { "alias": "TagCount"; "required": false; }; "IsTagsPanelOpen": { "alias": "IsTagsPanelOpen"; "required": false; }; "AttachmentCount": { "alias": "AttachmentCount"; "required": false; }; "AttachmentsAvailable": { "alias": "AttachmentsAvailable"; "required": false; }; "IsAttachmentsPanelOpen": { "alias": "IsAttachmentsPanelOpen"; "required": false; }; "VersionCount": { "alias": "VersionCount"; "required": false; }; "EntityInfo": { "alias": "EntityInfo"; "required": false; }; "Config": { "alias": "Config"; "required": false; }; "IsSaving": { "alias": "IsSaving"; "required": false; }; "IsRefreshing": { "alias": "IsRefreshing"; "required": false; }; "VisibleSectionCount": { "alias": "VisibleSectionCount"; "required": false; }; "TotalSectionCount": { "alias": "TotalSectionCount"; "required": false; }; "ExpandedSectionCount": { "alias": "ExpandedSectionCount"; "required": false; }; "SearchFilter": { "alias": "SearchFilter"; "required": false; }; "ShowEmptyFields": { "alias": "ShowEmptyFields"; "required": false; }; "WidthMode": { "alias": "WidthMode"; "required": false; }; "HasCustomSectionOrder": { "alias": "HasCustomSectionOrder"; "required": false; }; "ChromeLayout": { "alias": "ChromeLayout"; "required": false; }; "AdditionalActionsTemplate": { "alias": "AdditionalActionsTemplate"; "required": false; }; "Variants": { "alias": "Variants"; "required": false; }; "RegisteredItems": { "alias": "RegisteredItems"; "required": false; }; "ItemOverrides": { "alias": "ItemOverrides"; "required": false; }; "FormComponent": { "alias": "FormComponent"; "required": false; }; "CurrentVariantID": { "alias": "CurrentVariantID"; "required": false; }; }, { "ToolbarItemClick": "ToolbarItemClick"; "Navigate": "Navigate"; "EditModeChange": "EditModeChange"; "BeforeSave": "BeforeSave"; "SaveRequested": "SaveRequested"; "BeforeCancel": "BeforeCancel"; "CancelRequested": "CancelRequested"; "BeforeDelete": "BeforeDelete"; "DeleteRequested": "DeleteRequested"; "BeforeRefresh": "BeforeRefresh"; "RefreshRequested": "RefreshRequested"; "FavoriteToggled": "FavoriteToggled"; "BeforeHistoryView": "BeforeHistoryView"; "HistoryRequested": "HistoryRequested"; "BeforeListManagement": "BeforeListManagement"; "ListManagementRequested": "ListManagementRequested"; "TagsPanelToggled": "TagsPanelToggled"; "AttachmentsPanelToggled": "AttachmentsPanelToggled"; "ShowChangesRequested": "ShowChangesRequested"; "VariantPicked": "VariantPicked"; "CustomButtonClick": "CustomButtonClick"; "FilterChange": "FilterChange"; "ExpandAllRequested": "ExpandAllRequested"; "CollapseAllRequested": "CollapseAllRequested"; "ShowEmptyFieldsChange": "ShowEmptyFieldsChange"; "WidthModeChange": "WidthModeChange"; "ResetSectionOrderRequested": "ResetSectionOrderRequested"; "ManageSectionsRequested": "ManageSectionsRequested"; }, never, ["[toolbar-additional-controls]"], false, never>;
|
|
475
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MjFormToolbarComponent, "mj-form-toolbar", never, { "Form": { "alias": "Form"; "required": false; }; "_deprecatedForm": { "alias": "form"; "required": false; }; "Record": { "alias": "Record"; "required": false; }; "EditMode": { "alias": "EditMode"; "required": false; }; "UserCanEdit": { "alias": "UserCanEdit"; "required": false; }; "UserCanDelete": { "alias": "UserCanDelete"; "required": false; }; "IsFavorite": { "alias": "IsFavorite"; "required": false; }; "FavoriteInitDone": { "alias": "FavoriteInitDone"; "required": false; }; "IsDirty": { "alias": "IsDirty"; "required": false; }; "DirtyFieldNames": { "alias": "DirtyFieldNames"; "required": false; }; "ListCount": { "alias": "ListCount"; "required": false; }; "TagCount": { "alias": "TagCount"; "required": false; }; "IsTagsPanelOpen": { "alias": "IsTagsPanelOpen"; "required": false; }; "AttachmentCount": { "alias": "AttachmentCount"; "required": false; }; "AttachmentsAvailable": { "alias": "AttachmentsAvailable"; "required": false; }; "IsAttachmentsPanelOpen": { "alias": "IsAttachmentsPanelOpen"; "required": false; }; "VersionCount": { "alias": "VersionCount"; "required": false; }; "EntityInfo": { "alias": "EntityInfo"; "required": false; }; "Config": { "alias": "Config"; "required": false; }; "IsSaving": { "alias": "IsSaving"; "required": false; }; "IsRefreshing": { "alias": "IsRefreshing"; "required": false; }; "VisibleSectionCount": { "alias": "VisibleSectionCount"; "required": false; }; "TotalSectionCount": { "alias": "TotalSectionCount"; "required": false; }; "ExpandedSectionCount": { "alias": "ExpandedSectionCount"; "required": false; }; "SearchFilter": { "alias": "SearchFilter"; "required": false; }; "ShowEmptyFields": { "alias": "ShowEmptyFields"; "required": false; }; "WidthMode": { "alias": "WidthMode"; "required": false; }; "HasCustomSectionOrder": { "alias": "HasCustomSectionOrder"; "required": false; }; "ChromeLayout": { "alias": "ChromeLayout"; "required": false; }; "AdditionalActionsTemplate": { "alias": "AdditionalActionsTemplate"; "required": false; }; "Variants": { "alias": "Variants"; "required": false; }; "RegisteredItems": { "alias": "RegisteredItems"; "required": false; }; "ItemOverrides": { "alias": "ItemOverrides"; "required": false; }; "FormComponent": { "alias": "FormComponent"; "required": false; }; "CurrentVariantID": { "alias": "CurrentVariantID"; "required": false; }; }, { "ToolbarItemClick": "ToolbarItemClick"; "Navigate": "Navigate"; "EditModeChange": "EditModeChange"; "BeforeSave": "BeforeSave"; "SaveRequested": "SaveRequested"; "BeforeCancel": "BeforeCancel"; "CancelRequested": "CancelRequested"; "BeforeDelete": "BeforeDelete"; "DeleteRequested": "DeleteRequested"; "BeforeRefresh": "BeforeRefresh"; "RefreshRequested": "RefreshRequested"; "FavoriteToggled": "FavoriteToggled"; "BeforeHistoryView": "BeforeHistoryView"; "HistoryRequested": "HistoryRequested"; "BeforeListManagement": "BeforeListManagement"; "ListManagementRequested": "ListManagementRequested"; "TagsPanelToggled": "TagsPanelToggled"; "AttachmentsPanelToggled": "AttachmentsPanelToggled"; "ShowChangesRequested": "ShowChangesRequested"; "VariantPicked": "VariantPicked"; "CustomButtonClick": "CustomButtonClick"; "FilterChange": "FilterChange"; "ExpandAllRequested": "ExpandAllRequested"; "CollapseAllRequested": "CollapseAllRequested"; "ShowEmptyFieldsChange": "ShowEmptyFieldsChange"; "WidthModeChange": "WidthModeChange"; "ResetSectionOrderRequested": "ResetSectionOrderRequested"; "ManageSectionsRequested": "ManageSectionsRequested"; "BeforeClone": "BeforeClone"; "CloneCompleted": "CloneCompleted"; }, never, ["[toolbar-additional-controls]"], false, never>;
|
|
349
476
|
}
|
|
350
477
|
//# sourceMappingURL=form-toolbar.component.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-toolbar.component.d.ts","sourceRoot":"","sources":["../../../src/lib/toolbar/form-toolbar.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,YAAY,EAA2B,WAAW,EAA6B,OAAO,EAAE,MAAM,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"form-toolbar.component.d.ts","sourceRoot":"","sources":["../../../src/lib/toolbar/form-toolbar.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,YAAY,EAA2B,WAAW,EAA6B,OAAO,EAAE,MAAM,EAAE,SAAS,EAAyB,MAAM,eAAe,CAAC;AAG3L,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,UAAU,EAAE,UAAU,EAA0B,MAAM,sBAAsB,CAAC;AAGtF,OAAO,EAAsB,KAAK,mBAAmB,EAAE,KAAK,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAC1H,OAAO,EAAE,iBAAiB,EAA0B,MAAM,yBAAyB,CAAC;AACpF,OAAO,EAAE,qBAAqB,EAAs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