@memberjunction/ng-base-forms 5.38.0 → 5.39.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +53 -0
- package/dist/lib/base-form-component.d.ts +18 -0
- package/dist/lib/base-form-component.d.ts.map +1 -1
- package/dist/lib/base-form-component.js +31 -2
- package/dist/lib/base-form-component.js.map +1 -1
- package/dist/lib/container/record-form-container.component.d.ts +14 -0
- package/dist/lib/container/record-form-container.component.d.ts.map +1 -1
- package/dist/lib/container/record-form-container.component.js +59 -33
- package/dist/lib/container/record-form-container.component.js.map +1 -1
- package/dist/lib/field/fk-search-utils.d.ts +31 -0
- package/dist/lib/field/fk-search-utils.d.ts.map +1 -0
- package/dist/lib/field/fk-search-utils.js +47 -0
- package/dist/lib/field/fk-search-utils.js.map +1 -0
- package/dist/lib/field/form-field.component.d.ts +401 -6
- package/dist/lib/field/form-field.component.d.ts.map +1 -1
- package/dist/lib/field/form-field.component.js +1646 -214
- package/dist/lib/field/form-field.component.js.map +1 -1
- package/dist/lib/field/linked-field-options.d.ts +76 -0
- package/dist/lib/field/linked-field-options.d.ts.map +1 -0
- package/dist/lib/field/linked-field-options.js +80 -0
- package/dist/lib/field/linked-field-options.js.map +1 -0
- package/dist/lib/host/entity-form-host.component.d.ts +159 -0
- package/dist/lib/host/entity-form-host.component.d.ts.map +1 -0
- package/dist/lib/host/entity-form-host.component.js +539 -0
- package/dist/lib/host/entity-form-host.component.js.map +1 -0
- package/dist/lib/isa-related-panel/isa-related-card.component.js +2 -2
- package/dist/lib/overlays/base-form-overlay.d.ts +114 -0
- package/dist/lib/overlays/base-form-overlay.d.ts.map +1 -0
- package/dist/lib/overlays/base-form-overlay.js +227 -0
- package/dist/lib/overlays/base-form-overlay.js.map +1 -0
- package/dist/lib/overlays/form-dialog.component.d.ts +35 -0
- package/dist/lib/overlays/form-dialog.component.d.ts.map +1 -0
- package/dist/lib/overlays/form-dialog.component.js +92 -0
- package/dist/lib/overlays/form-dialog.component.js.map +1 -0
- package/dist/lib/overlays/form-presenter.service.d.ts +37 -0
- package/dist/lib/overlays/form-presenter.service.d.ts.map +1 -0
- package/dist/lib/overlays/form-presenter.service.js +130 -0
- package/dist/lib/overlays/form-presenter.service.js.map +1 -0
- package/dist/lib/overlays/form-presenter.types.d.ts +65 -0
- package/dist/lib/overlays/form-presenter.types.d.ts.map +1 -0
- package/dist/lib/overlays/form-presenter.types.js +25 -0
- package/dist/lib/overlays/form-presenter.types.js.map +1 -0
- package/dist/lib/overlays/form-slide-in.component.d.ts +38 -0
- package/dist/lib/overlays/form-slide-in.component.d.ts.map +1 -0
- package/dist/lib/overlays/form-slide-in.component.js +106 -0
- package/dist/lib/overlays/form-slide-in.component.js.map +1 -0
- package/dist/lib/overlays/form-window.component.d.ts +32 -0
- package/dist/lib/overlays/form-window.component.d.ts.map +1 -0
- package/dist/lib/overlays/form-window.component.js +93 -0
- package/dist/lib/overlays/form-window.component.js.map +1 -0
- package/dist/lib/panel/collapsible-panel.component.d.ts +19 -2
- package/dist/lib/panel/collapsible-panel.component.d.ts.map +1 -1
- package/dist/lib/panel/collapsible-panel.component.js +70 -13
- package/dist/lib/panel/collapsible-panel.component.js.map +1 -1
- package/dist/lib/resolver/form-resolver.service.d.ts +139 -0
- package/dist/lib/resolver/form-resolver.service.d.ts.map +1 -0
- package/dist/lib/resolver/form-resolver.service.js +235 -0
- package/dist/lib/resolver/form-resolver.service.js.map +1 -0
- package/dist/lib/section-manager/section-manager.component.js +2 -2
- package/dist/lib/toolbar/form-toolbar.component.js +2 -2
- package/dist/lib/types/entity-form-config.d.ts +125 -0
- package/dist/lib/types/entity-form-config.d.ts.map +1 -0
- package/dist/lib/types/entity-form-config.js +75 -0
- package/dist/lib/types/entity-form-config.js.map +1 -0
- package/dist/lib/types/form-types.d.ts +24 -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/navigation-events.d.ts +46 -2
- package/dist/lib/types/navigation-events.d.ts.map +1 -1
- package/dist/lib/types/navigation-events.js.map +1 -1
- package/dist/module.d.ts +12 -8
- package/dist/module.d.ts.map +1 -1
- package/dist/module.js +26 -7
- package/dist/module.js.map +1 -1
- package/dist/public-api.d.ts +11 -0
- package/dist/public-api.d.ts.map +1 -1
- package/dist/public-api.js +14 -0
- package/dist/public-api.js.map +1 -1
- package/package.json +17 -13
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { FormToolbarConfig } from './toolbar-config';
|
|
2
|
+
import { FormWidthMode } from './form-types';
|
|
3
|
+
/**
|
|
4
|
+
* Per-instance configuration for an MemberJunction entity form, independent of
|
|
5
|
+
* how it is presented (full-page tab, modal dialog, or slide-in panel).
|
|
6
|
+
*
|
|
7
|
+
* Set on {@link BaseFormComponent.Config}. The record-form container and the
|
|
8
|
+
* collapsible panels read it back through the `FormComponent` reference, so it
|
|
9
|
+
* takes effect **without regenerating** the CodeGen-produced form template.
|
|
10
|
+
*
|
|
11
|
+
* Every field is optional; an omitted field falls back to the value the host
|
|
12
|
+
* surface seeds (see {@link TAB_FORM_CONFIG}, {@link DIALOG_FORM_CONFIG},
|
|
13
|
+
* {@link SLIDEIN_FORM_CONFIG}).
|
|
14
|
+
*
|
|
15
|
+
* This interface is intentionally additive — new optional knobs can be added
|
|
16
|
+
* over time without breaking existing consumers or presets.
|
|
17
|
+
*
|
|
18
|
+
* @example Hide related grids + lock sections open in a dialog
|
|
19
|
+
* ```typescript
|
|
20
|
+
* host.Config = {
|
|
21
|
+
* ...DIALOG_FORM_CONFIG,
|
|
22
|
+
* ShowRelatedEntities: false,
|
|
23
|
+
* CollapsibleSections: false,
|
|
24
|
+
* Toolbar: { ShowDeleteButton: false },
|
|
25
|
+
* };
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
export interface EntityFormConfig {
|
|
29
|
+
/**
|
|
30
|
+
* Toolbar configuration.
|
|
31
|
+
* - `undefined` → use the surface default (full toolbar on tabs).
|
|
32
|
+
* - `null` → render **no toolbar at all** (default for dialog & slide-in,
|
|
33
|
+
* where the chrome owns the title and Save/Cancel buttons).
|
|
34
|
+
* - `Partial<FormToolbarConfig>` → merged over the surface default config.
|
|
35
|
+
*/
|
|
36
|
+
Toolbar?: Partial<FormToolbarConfig> | null;
|
|
37
|
+
/**
|
|
38
|
+
* Whether related-entity grid sections (panels with `Variant="related-entity"`)
|
|
39
|
+
* are shown. Default: `true` on tabs, `false` in dialog/slide-in.
|
|
40
|
+
*/
|
|
41
|
+
ShowRelatedEntities?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Whether section headers can collapse/expand. When `false`, every section
|
|
44
|
+
* renders always-expanded with no toggle chevron. Default: `true`.
|
|
45
|
+
*/
|
|
46
|
+
CollapsibleSections?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Hide specific sections by their `sectionKey` (field OR related-entity).
|
|
49
|
+
* Mutually exclusive with {@link VisibleSectionKeys}; if both are set,
|
|
50
|
+
* `VisibleSectionKeys` wins.
|
|
51
|
+
*/
|
|
52
|
+
HiddenSectionKeys?: string[];
|
|
53
|
+
/**
|
|
54
|
+
* Allow-list of `sectionKey`s to render — every other section is hidden.
|
|
55
|
+
* Mutually exclusive with {@link HiddenSectionKeys}.
|
|
56
|
+
*/
|
|
57
|
+
VisibleSectionKeys?: string[];
|
|
58
|
+
/**
|
|
59
|
+
* Initial width mode for the form body. Default: `'centered'` on tabs,
|
|
60
|
+
* `'full-width'` in a slide-in.
|
|
61
|
+
*/
|
|
62
|
+
WidthMode?: FormWidthMode;
|
|
63
|
+
/**
|
|
64
|
+
* Whether in-form record links emit `Navigate` events. The form host NEVER
|
|
65
|
+
* routes; it only emits, and the consumer decides what to do. Default:
|
|
66
|
+
* `true` on tabs, `false` in dialog/slide-in (links render inert so a modal
|
|
67
|
+
* context doesn't teleport the user away).
|
|
68
|
+
*/
|
|
69
|
+
EnableRecordLinks?: boolean;
|
|
70
|
+
/**
|
|
71
|
+
* Force the form to start in edit mode. When omitted, the host starts new
|
|
72
|
+
* records in edit mode and existing records in read mode.
|
|
73
|
+
*/
|
|
74
|
+
StartInEditMode?: boolean;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Default config for a full-page (tab) form: full toolbar, related grids
|
|
78
|
+
* visible, collapsible sections, in-form links live. Equivalent to passing no
|
|
79
|
+
* config at all — provided for explicitness and as a merge base.
|
|
80
|
+
*/
|
|
81
|
+
export declare const TAB_FORM_CONFIG: EntityFormConfig;
|
|
82
|
+
/**
|
|
83
|
+
* Default config for an entity form presented in a modal dialog: no in-form
|
|
84
|
+
* toolbar (the dialog footer owns Save/Cancel), related grids hidden to keep
|
|
85
|
+
* the dialog focused, sections collapsible, in-form links inert.
|
|
86
|
+
*/
|
|
87
|
+
export declare const DIALOG_FORM_CONFIG: EntityFormConfig;
|
|
88
|
+
/**
|
|
89
|
+
* Default config for an entity form presented in a slide-in panel: same as the
|
|
90
|
+
* dialog default but full-width to use the panel's vertical real estate.
|
|
91
|
+
*/
|
|
92
|
+
export declare const SLIDEIN_FORM_CONFIG: EntityFormConfig;
|
|
93
|
+
/**
|
|
94
|
+
* Whether the in-form toolbar should render for the given config. An explicit
|
|
95
|
+
* `Toolbar: null` (dialog/slide-in default) hides it entirely; anything else
|
|
96
|
+
* (undefined or a partial config) keeps it.
|
|
97
|
+
*/
|
|
98
|
+
export declare function ResolveFormShowToolbar(config: EntityFormConfig | null | undefined): boolean;
|
|
99
|
+
/**
|
|
100
|
+
* Merge a config's `Toolbar` partial over a base toolbar config. Returns `base`
|
|
101
|
+
* unchanged when there's no override (or it's `null`).
|
|
102
|
+
*/
|
|
103
|
+
export declare function ResolveFormToolbarConfig(base: FormToolbarConfig, config: EntityFormConfig | null | undefined): FormToolbarConfig;
|
|
104
|
+
/**
|
|
105
|
+
* Minimal structural shape of the section-visibility rules. Both
|
|
106
|
+
* {@link EntityFormConfig} and `FormContext` satisfy this, so the same helper
|
|
107
|
+
* works whether driven by config directly or via the form context that reaches
|
|
108
|
+
* every panel (including slot-injected `BaseFormPanel`s).
|
|
109
|
+
*
|
|
110
|
+
* Note: these property names stay camelCase to match the structural
|
|
111
|
+
* {@link FormContext} interface that panels actually receive at runtime.
|
|
112
|
+
*/
|
|
113
|
+
export interface SectionVisibilityRules {
|
|
114
|
+
showRelatedEntities?: boolean;
|
|
115
|
+
hiddenSectionKeys?: string[];
|
|
116
|
+
visibleSectionKeys?: string[];
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Whether a section should be hidden given the visibility rules:
|
|
120
|
+
* - `visibleSectionKeys` (allow-list) hides anything not listed;
|
|
121
|
+
* - else `hiddenSectionKeys` hides the listed keys;
|
|
122
|
+
* - `showRelatedEntities === false` additionally hides related-entity panels.
|
|
123
|
+
*/
|
|
124
|
+
export declare function IsFormSectionHidden(config: SectionVisibilityRules | null | undefined, sectionKey: string, variant: string | undefined): boolean;
|
|
125
|
+
//# sourceMappingURL=entity-form-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entity-form-config.d.ts","sourceRoot":"","sources":["../../../src/lib/types/entity-form-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,GAAG,IAAI,CAAC;IAE5C;;;OAGG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAE9B;;;OAGG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAE9B;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;IAE7B;;;OAGG;IACH,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;IAE9B;;;OAGG;IACH,SAAS,CAAC,EAAE,aAAa,CAAC;IAE1B;;;;;OAKG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAE5B;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED;;;;GAIG;AACH,eAAO,MAAM,eAAe,EAAE,gBAM7B,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,EAAE,gBAMhC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,mBAAmB,EAAE,gBAMjC,CAAC;AAIF;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,gBAAgB,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAE3F;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CACtC,IAAI,EAAE,iBAAiB,EACvB,MAAM,EAAE,gBAAgB,GAAG,IAAI,GAAG,SAAS,GAC1C,iBAAiB,CAGnB;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,sBAAsB;IACrC,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC7B,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC/B;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,sBAAsB,GAAG,IAAI,GAAG,SAAS,EACjD,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,MAAM,GAAG,SAAS,GAC1B,OAAO,CAWT"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Default config for a full-page (tab) form: full toolbar, related grids
|
|
3
|
+
* visible, collapsible sections, in-form links live. Equivalent to passing no
|
|
4
|
+
* config at all — provided for explicitness and as a merge base.
|
|
5
|
+
*/
|
|
6
|
+
export const TAB_FORM_CONFIG = {
|
|
7
|
+
Toolbar: undefined,
|
|
8
|
+
ShowRelatedEntities: true,
|
|
9
|
+
CollapsibleSections: true,
|
|
10
|
+
WidthMode: 'centered',
|
|
11
|
+
EnableRecordLinks: true,
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Default config for an entity form presented in a modal dialog: no in-form
|
|
15
|
+
* toolbar (the dialog footer owns Save/Cancel), related grids hidden to keep
|
|
16
|
+
* the dialog focused, sections collapsible, in-form links inert.
|
|
17
|
+
*/
|
|
18
|
+
export const DIALOG_FORM_CONFIG = {
|
|
19
|
+
Toolbar: null,
|
|
20
|
+
ShowRelatedEntities: false,
|
|
21
|
+
CollapsibleSections: true,
|
|
22
|
+
WidthMode: 'centered',
|
|
23
|
+
EnableRecordLinks: false,
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Default config for an entity form presented in a slide-in panel: same as the
|
|
27
|
+
* dialog default but full-width to use the panel's vertical real estate.
|
|
28
|
+
*/
|
|
29
|
+
export const SLIDEIN_FORM_CONFIG = {
|
|
30
|
+
Toolbar: null,
|
|
31
|
+
ShowRelatedEntities: false,
|
|
32
|
+
CollapsibleSections: true,
|
|
33
|
+
WidthMode: 'full-width',
|
|
34
|
+
EnableRecordLinks: false,
|
|
35
|
+
};
|
|
36
|
+
// ── Pure resolution helpers (used by the record-form container; unit-tested) ──
|
|
37
|
+
/**
|
|
38
|
+
* Whether the in-form toolbar should render for the given config. An explicit
|
|
39
|
+
* `Toolbar: null` (dialog/slide-in default) hides it entirely; anything else
|
|
40
|
+
* (undefined or a partial config) keeps it.
|
|
41
|
+
*/
|
|
42
|
+
export function ResolveFormShowToolbar(config) {
|
|
43
|
+
return config?.Toolbar !== null;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Merge a config's `Toolbar` partial over a base toolbar config. Returns `base`
|
|
47
|
+
* unchanged when there's no override (or it's `null`).
|
|
48
|
+
*/
|
|
49
|
+
export function ResolveFormToolbarConfig(base, config) {
|
|
50
|
+
const override = config?.Toolbar;
|
|
51
|
+
return override ? { ...base, ...override } : base;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Whether a section should be hidden given the visibility rules:
|
|
55
|
+
* - `visibleSectionKeys` (allow-list) hides anything not listed;
|
|
56
|
+
* - else `hiddenSectionKeys` hides the listed keys;
|
|
57
|
+
* - `showRelatedEntities === false` additionally hides related-entity panels.
|
|
58
|
+
*/
|
|
59
|
+
export function IsFormSectionHidden(config, sectionKey, variant) {
|
|
60
|
+
if (!config)
|
|
61
|
+
return false;
|
|
62
|
+
const allow = config.visibleSectionKeys;
|
|
63
|
+
const hide = config.hiddenSectionKeys;
|
|
64
|
+
if (allow && allow.length > 0) {
|
|
65
|
+
if (!allow.includes(sectionKey))
|
|
66
|
+
return true;
|
|
67
|
+
}
|
|
68
|
+
else if (hide && hide.includes(sectionKey)) {
|
|
69
|
+
return true;
|
|
70
|
+
}
|
|
71
|
+
if (config.showRelatedEntities === false && variant === 'related-entity')
|
|
72
|
+
return true;
|
|
73
|
+
return false;
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=entity-form-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entity-form-config.js","sourceRoot":"","sources":["../../../src/lib/types/entity-form-config.ts"],"names":[],"mappings":"AAoFA;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAAqB;IAC/C,OAAO,EAAE,SAAS;IAClB,mBAAmB,EAAE,IAAI;IACzB,mBAAmB,EAAE,IAAI;IACzB,SAAS,EAAE,UAAU;IACrB,iBAAiB,EAAE,IAAI;CACxB,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAqB;IAClD,OAAO,EAAE,IAAI;IACb,mBAAmB,EAAE,KAAK;IAC1B,mBAAmB,EAAE,IAAI;IACzB,SAAS,EAAE,UAAU;IACrB,iBAAiB,EAAE,KAAK;CACzB,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAqB;IACnD,OAAO,EAAE,IAAI;IACb,mBAAmB,EAAE,KAAK;IAC1B,mBAAmB,EAAE,IAAI;IACzB,SAAS,EAAE,YAAY;IACvB,iBAAiB,EAAE,KAAK;CACzB,CAAC;AAEF,iFAAiF;AAEjF;;;;GAIG;AACH,MAAM,UAAU,sBAAsB,CAAC,MAA2C;IAChF,OAAO,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;AAClC,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,wBAAwB,CACtC,IAAuB,EACvB,MAA2C;IAE3C,MAAM,QAAQ,GAAG,MAAM,EAAE,OAAO,CAAC;IACjC,OAAO,QAAQ,CAAC,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,GAAG,QAAQ,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;AACpD,CAAC;AAiBD;;;;;GAKG;AACH,MAAM,UAAU,mBAAmB,CACjC,MAAiD,EACjD,UAAkB,EAClB,OAA2B;IAE3B,IAAI,CAAC,MAAM;QAAE,OAAO,KAAK,CAAC;IAC1B,MAAM,KAAK,GAAG,MAAM,CAAC,kBAAkB,CAAC;IACxC,MAAM,IAAI,GAAG,MAAM,CAAC,iBAAiB,CAAC;IACtC,IAAI,KAAK,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC9B,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,UAAU,CAAC;YAAE,OAAO,IAAI,CAAC;IAC/C,CAAC;SAAM,IAAI,IAAI,IAAI,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC;QAC7C,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IAAI,MAAM,CAAC,mBAAmB,KAAK,KAAK,IAAI,OAAO,KAAK,gBAAgB;QAAE,OAAO,IAAI,CAAC;IACtF,OAAO,KAAK,CAAC;AACf,CAAC","sourcesContent":["import { FormToolbarConfig } from './toolbar-config';\nimport { FormWidthMode } from './form-types';\n\n/**\n * Per-instance configuration for an MemberJunction entity form, independent of\n * how it is presented (full-page tab, modal dialog, or slide-in panel).\n *\n * Set on {@link BaseFormComponent.Config}. The record-form container and the\n * collapsible panels read it back through the `FormComponent` reference, so it\n * takes effect **without regenerating** the CodeGen-produced form template.\n *\n * Every field is optional; an omitted field falls back to the value the host\n * surface seeds (see {@link TAB_FORM_CONFIG}, {@link DIALOG_FORM_CONFIG},\n * {@link SLIDEIN_FORM_CONFIG}).\n *\n * This interface is intentionally additive — new optional knobs can be added\n * over time without breaking existing consumers or presets.\n *\n * @example Hide related grids + lock sections open in a dialog\n * ```typescript\n * host.Config = {\n * ...DIALOG_FORM_CONFIG,\n * ShowRelatedEntities: false,\n * CollapsibleSections: false,\n * Toolbar: { ShowDeleteButton: false },\n * };\n * ```\n */\nexport interface EntityFormConfig {\n /**\n * Toolbar configuration.\n * - `undefined` → use the surface default (full toolbar on tabs).\n * - `null` → render **no toolbar at all** (default for dialog & slide-in,\n * where the chrome owns the title and Save/Cancel buttons).\n * - `Partial<FormToolbarConfig>` → merged over the surface default config.\n */\n Toolbar?: Partial<FormToolbarConfig> | null;\n\n /**\n * Whether related-entity grid sections (panels with `Variant=\"related-entity\"`)\n * are shown. Default: `true` on tabs, `false` in dialog/slide-in.\n */\n ShowRelatedEntities?: boolean;\n\n /**\n * Whether section headers can collapse/expand. When `false`, every section\n * renders always-expanded with no toggle chevron. Default: `true`.\n */\n CollapsibleSections?: boolean;\n\n /**\n * Hide specific sections by their `sectionKey` (field OR related-entity).\n * Mutually exclusive with {@link VisibleSectionKeys}; if both are set,\n * `VisibleSectionKeys` wins.\n */\n HiddenSectionKeys?: string[];\n\n /**\n * Allow-list of `sectionKey`s to render — every other section is hidden.\n * Mutually exclusive with {@link HiddenSectionKeys}.\n */\n VisibleSectionKeys?: string[];\n\n /**\n * Initial width mode for the form body. Default: `'centered'` on tabs,\n * `'full-width'` in a slide-in.\n */\n WidthMode?: FormWidthMode;\n\n /**\n * Whether in-form record links emit `Navigate` events. The form host NEVER\n * routes; it only emits, and the consumer decides what to do. Default:\n * `true` on tabs, `false` in dialog/slide-in (links render inert so a modal\n * context doesn't teleport the user away).\n */\n EnableRecordLinks?: boolean;\n\n /**\n * Force the form to start in edit mode. When omitted, the host starts new\n * records in edit mode and existing records in read mode.\n */\n StartInEditMode?: boolean;\n}\n\n/**\n * Default config for a full-page (tab) form: full toolbar, related grids\n * visible, collapsible sections, in-form links live. Equivalent to passing no\n * config at all — provided for explicitness and as a merge base.\n */\nexport const TAB_FORM_CONFIG: EntityFormConfig = {\n Toolbar: undefined,\n ShowRelatedEntities: true,\n CollapsibleSections: true,\n WidthMode: 'centered',\n EnableRecordLinks: true,\n};\n\n/**\n * Default config for an entity form presented in a modal dialog: no in-form\n * toolbar (the dialog footer owns Save/Cancel), related grids hidden to keep\n * the dialog focused, sections collapsible, in-form links inert.\n */\nexport const DIALOG_FORM_CONFIG: EntityFormConfig = {\n Toolbar: null,\n ShowRelatedEntities: false,\n CollapsibleSections: true,\n WidthMode: 'centered',\n EnableRecordLinks: false,\n};\n\n/**\n * Default config for an entity form presented in a slide-in panel: same as the\n * dialog default but full-width to use the panel's vertical real estate.\n */\nexport const SLIDEIN_FORM_CONFIG: EntityFormConfig = {\n Toolbar: null,\n ShowRelatedEntities: false,\n CollapsibleSections: true,\n WidthMode: 'full-width',\n EnableRecordLinks: false,\n};\n\n// ── Pure resolution helpers (used by the record-form container; unit-tested) ──\n\n/**\n * Whether the in-form toolbar should render for the given config. An explicit\n * `Toolbar: null` (dialog/slide-in default) hides it entirely; anything else\n * (undefined or a partial config) keeps it.\n */\nexport function ResolveFormShowToolbar(config: EntityFormConfig | null | undefined): boolean {\n return config?.Toolbar !== null;\n}\n\n/**\n * Merge a config's `Toolbar` partial over a base toolbar config. Returns `base`\n * unchanged when there's no override (or it's `null`).\n */\nexport function ResolveFormToolbarConfig(\n base: FormToolbarConfig,\n config: EntityFormConfig | null | undefined,\n): FormToolbarConfig {\n const override = config?.Toolbar;\n return override ? { ...base, ...override } : base;\n}\n\n/**\n * Minimal structural shape of the section-visibility rules. Both\n * {@link EntityFormConfig} and `FormContext` satisfy this, so the same helper\n * works whether driven by config directly or via the form context that reaches\n * every panel (including slot-injected `BaseFormPanel`s).\n *\n * Note: these property names stay camelCase to match the structural\n * {@link FormContext} interface that panels actually receive at runtime.\n */\nexport interface SectionVisibilityRules {\n showRelatedEntities?: boolean;\n hiddenSectionKeys?: string[];\n visibleSectionKeys?: string[];\n}\n\n/**\n * Whether a section should be hidden given the visibility rules:\n * - `visibleSectionKeys` (allow-list) hides anything not listed;\n * - else `hiddenSectionKeys` hides the listed keys;\n * - `showRelatedEntities === false` additionally hides related-entity panels.\n */\nexport function IsFormSectionHidden(\n config: SectionVisibilityRules | null | undefined,\n sectionKey: string,\n variant: string | undefined,\n): boolean {\n if (!config) return false;\n const allow = config.visibleSectionKeys;\n const hide = config.hiddenSectionKeys;\n if (allow && allow.length > 0) {\n if (!allow.includes(sectionKey)) return true;\n } else if (hide && hide.includes(sectionKey)) {\n return true;\n }\n if (config.showRelatedEntities === false && variant === 'related-entity') return true;\n return false;\n}\n"]}
|
|
@@ -78,6 +78,30 @@ export interface FormContext {
|
|
|
78
78
|
validationErrors?: ValidationErrorInfo[];
|
|
79
79
|
/** Whether drag-and-drop section reordering is allowed. Read by panels to show/hide drag handles. */
|
|
80
80
|
allowSectionReorder?: boolean;
|
|
81
|
+
/**
|
|
82
|
+
* Whether section headers may collapse/expand. When false, panels render
|
|
83
|
+
* always-expanded with no toggle chevron. Read by collapsible panels.
|
|
84
|
+
* Undefined / true means collapsible (the default).
|
|
85
|
+
*/
|
|
86
|
+
collapsibleSections?: boolean;
|
|
87
|
+
/**
|
|
88
|
+
* Whether in-form record (FK) links are interactive. When false, FK values
|
|
89
|
+
* render as plain text instead of clickable links — used by dialog/slide-in
|
|
90
|
+
* surfaces so a modal context doesn't navigate the user away. Undefined /
|
|
91
|
+
* true means links are live (the default).
|
|
92
|
+
*/
|
|
93
|
+
enableRecordLinks?: boolean;
|
|
94
|
+
/**
|
|
95
|
+
* Section-visibility rules, propagated from {@link EntityFormConfig}. Read by
|
|
96
|
+
* every collapsible panel — including slot-injected `BaseFormPanel`s — so
|
|
97
|
+
* per-instance show/hide applies uniformly across generated, custom, and
|
|
98
|
+
* injected sections. `showRelatedEntities === false` hides related-entity
|
|
99
|
+
* panels; `hiddenSectionKeys` / `visibleSectionKeys` (allow-list) target
|
|
100
|
+
* specific section keys.
|
|
101
|
+
*/
|
|
102
|
+
showRelatedEntities?: boolean;
|
|
103
|
+
hiddenSectionKeys?: string[];
|
|
104
|
+
visibleSectionKeys?: string[];
|
|
81
105
|
}
|
|
82
106
|
/**
|
|
83
107
|
* Result of a form save operation.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-types.d.ts","sourceRoot":"","sources":["../../../src/lib/types/form-types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAE7D;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG,UAAU,GAAG,YAAY,CAAC;AAEtD;;;;;GAKG;AACH,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,gBAAgB,GAAG,WAAW,CAAC;AAEtE;;;;;GAKG;AACH,MAAM,WAAW,eAAe,CAAC,CAAC,GAAG,OAAO;IAC1C,8DAA8D;IAC9D,UAAU,EAAE,MAAM,CAAC;IACnB,6CAA6C;IAC7C,WAAW,EAAE,MAAM,CAAC;IACpB,wGAAwG;IACxG,UAAU,EAAE,OAAO,CAAC;IACpB,6DAA6D;IAC7D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,+CAA+C;IAC/C,QAAQ,CAAC,EAAE,CAAC,CAAC;IACb,gCAAgC;IAChC,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,qDAAqD;IACrD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,SAAS,CAAC;C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AEG;AACH,MAAM,WAAW,uBAAuB;IACtC,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAED;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC,oCAAoC;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,4BAA4B;IAC5B,IAAI,EAAE,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC;IAC/C,+DAA+D;IAC/D,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG,WAAW,CAAC;AAE1C;;GAEG;AACH,wBAAgB,wBAAwB,IAAI,WAAW,CAOtD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-types.js","sourceRoot":"","sources":["../../../src/lib/types/form-types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"form-types.js","sourceRoot":"","sources":["../../../src/lib/types/form-types.ts"],"names":[],"mappings":"AA0LA;;GAEG;AACH,MAAM,UAAU,wBAAwB;IACtC,OAAO;QACL,aAAa,EAAE,EAAE;QACjB,eAAe,EAAE,KAAK;QACtB,cAAc,EAAE,KAAK;QACrB,gBAAgB,EAAE,EAAE;KACrB,CAAC;AACJ,CAAC","sourcesContent":["import { ValidationErrorInfo } from '@memberjunction/global';\n\n/**\n * Width mode for the form panels container.\n * - 'centered': Max-width constrained and centered (default, good for readability)\n * - 'full-width': No max-width constraint, uses full available width\n */\nexport type FormWidthMode = 'centered' | 'full-width';\n\n/**\n * Variant for collapsible panel styling.\n * - 'default': Standard white card with accent border\n * - 'related-entity': Blue-accented card for related entity grid sections\n * - 'inherited': Purple-accented card for IS-A inherited field sections\n */\nexport type PanelVariant = 'default' | 'related-entity' | 'inherited';\n\n/**\n * Information about a section within the form.\n * Used to initialize and track section state.\n *\n * @template M Optional metadata type for custom per-section data\n */\nexport interface FormSectionInfo<M = unknown> {\n /** Unique key for this section (used in state persistence) */\n SectionKey: string;\n /** Display name shown in the panel header */\n SectionName: string;\n /** Whether the section starts expanded. Default: true for field sections, false for related entities */\n IsExpanded: boolean;\n /** Row count for related entity sections (shown as badge) */\n RowCount?: number;\n /** Custom metadata attached to this section */\n Metadata?: M;\n /** Panel variant for styling */\n Variant?: PanelVariant;\n /** Font Awesome icon class for the section header */\n Icon?: string;\n /**\n * If set, indicates this section contains fields inherited from a parent entity.\n * The value is the parent entity name (e.g., \"Products\" for a Meeting IS-A Product).\n */\n InheritedFromEntity?: string;\n}\n\n/**\n * Event emitted when a panel drag-to-reorder operation starts.\n */\nexport interface PanelDragStartEvent {\n SectionKey: string;\n Event: DragEvent;\n}\n\n/**\n * Event emitted when a panel is dropped onto another panel for reordering.\n */\nexport interface PanelDropEvent {\n SourceSectionKey: string;\n TargetSectionKey: string;\n}\n\n/**\n * Context object passed from the form to all child components (panels, fields).\n * Eliminates the need for many individual @Input properties.\n *\n * Property names use camelCase to maintain structural compatibility with\n * {@link BaseFormContext} from `@memberjunction/ng-base-forms`. This allows\n * BaseFormComponent.formContext to be passed directly to ng-forms components.\n */\nexport interface FormContext {\n /** Current search filter string for highlighting/filtering sections and fields */\n sectionFilter?: string;\n /** Whether to show fields that have empty values in read-only mode */\n showEmptyFields?: boolean;\n /**\n * When true, all fields show their validation errors regardless of touched state.\n * Set to true after a failed save attempt; reset on successful save or cancel.\n */\n showValidation?: boolean;\n /**\n * Validation errors from the most recent full-record Validate() call.\n * Fields filter by `ValidationErrorInfo.Source === FieldName` to find their errors.\n */\n validationErrors?: ValidationErrorInfo[];\n /** Whether drag-and-drop section reordering is allowed. Read by panels to show/hide drag handles. */\n allowSectionReorder?: boolean;\n /**\n * Whether section headers may collapse/expand. When false, panels render\n * always-expanded with no toggle chevron. Read by collapsible panels.\n * Undefined / true means collapsible (the default).\n */\n collapsibleSections?: boolean;\n /**\n * Whether in-form record (FK) links are interactive. When false, FK values\n * render as plain text instead of clickable links — used by dialog/slide-in\n * surfaces so a modal context doesn't navigate the user away. Undefined /\n * true means links are live (the default).\n */\n enableRecordLinks?: boolean;\n /**\n * Section-visibility rules, propagated from {@link EntityFormConfig}. Read by\n * every collapsible panel — including slot-injected `BaseFormPanel`s — so\n * per-instance show/hide applies uniformly across generated, custom, and\n * injected sections. `showRelatedEntities === false` hides related-entity\n * panels; `hiddenSectionKeys` / `visibleSectionKeys` (allow-list) target\n * specific section keys.\n */\n showRelatedEntities?: boolean;\n hiddenSectionKeys?: string[];\n visibleSectionKeys?: string[];\n}\n\n/**\n * Result of a form save operation.\n */\nexport interface FormSaveResult {\n /** Whether the save was successful */\n Success: boolean;\n /** Error message if save failed */\n ErrorMessage?: string;\n /** Number of milliseconds the save took */\n DurationMs?: number;\n}\n\n/**\n * Event emitted after a record is saved.\n */\nexport interface RecordSavedEvent {\n EntityName: string;\n RecordId: string;\n /** The display name of the saved record (for tab title updates, etc.) */\n RecordDisplayName?: string;\n Result: FormSaveResult;\n}\n\n/**\n * Event emitted after a record is deleted.\n */\nexport interface RecordDeletedEvent {\n EntityName: string;\n RecordId: string;\n}\n\n/**\n * Event emitted when a record save fails.\n */\nexport interface RecordSaveFailedEvent {\n EntityName: string;\n ErrorMessage: string;\n}\n\n/**\n * Event emitted when a record delete fails.\n */\nexport interface RecordDeleteFailedEvent {\n EntityName: string;\n ErrorMessage: string;\n}\n\n/**\n * Event emitted when validation fails before save.\n */\nexport interface ValidationFailedEvent {\n EntityName: string;\n Errors: string[];\n}\n\n/**\n * Notification event emitted by BaseFormComponent.\n * The host application subscribes and maps to its own notification system (toasts, snackbars, etc.).\n */\nexport interface FormNotificationEvent {\n /** The notification message text */\n Message: string;\n /** Notification severity */\n Type: 'success' | 'error' | 'warning' | 'info';\n /** Duration in milliseconds the notification should display */\n Duration: number;\n}\n\n/**\n * Backward-compatible alias for FormContext.\n * Explorer's BaseFormComponent used this name; new code should use FormContext.\n */\nexport type BaseFormContext = FormContext;\n\n/**\n * Creates a default FormContext with sensible defaults.\n */\nexport function createDefaultFormContext(): FormContext {\n return {\n sectionFilter: '',\n showEmptyFields: false,\n showValidation: false,\n validationErrors: []\n };\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CompositeKey } from '@memberjunction/core';
|
|
1
|
+
import { BaseEntity, CompositeKey, IMetadataProvider } from '@memberjunction/core';
|
|
2
2
|
/**
|
|
3
3
|
* Union type for all navigation event kinds emitted by the forms package.
|
|
4
4
|
* The host application subscribes to these and maps them to its own routing system.
|
|
@@ -17,7 +17,7 @@ import { CompositeKey } from '@memberjunction/core';
|
|
|
17
17
|
* }
|
|
18
18
|
* ```
|
|
19
19
|
*/
|
|
20
|
-
export type FormNavigationEvent = RecordNavigationEvent | ExternalLinkNavigationEvent | EmailLinkNavigationEvent | EntityHierarchyNavigationEvent | ChildEntityTypeNavigationEvent | NewRecordNavigationEvent | DismissFormNavigationEvent;
|
|
20
|
+
export type FormNavigationEvent = RecordNavigationEvent | ExternalLinkNavigationEvent | EmailLinkNavigationEvent | EntityHierarchyNavigationEvent | ChildEntityTypeNavigationEvent | NewRecordNavigationEvent | CreateRelatedNavigationEvent | DismissFormNavigationEvent;
|
|
21
21
|
/**
|
|
22
22
|
* User clicked a foreign key link to view a related record.
|
|
23
23
|
* Emitted by mj-form-field when a record link is clicked.
|
|
@@ -103,4 +103,48 @@ export interface DismissFormNavigationEvent {
|
|
|
103
103
|
/** Reason for the dismiss request — useful for analytics / different host behaviors. */
|
|
104
104
|
Reason: 'new-record-discarded';
|
|
105
105
|
}
|
|
106
|
+
/**
|
|
107
|
+
* A field (e.g. a foreign-key dropdown) is asking the host to create a NEW record of a
|
|
108
|
+
* related entity — typically because the user searched for one that doesn't exist yet.
|
|
109
|
+
*
|
|
110
|
+
* The Generic forms layer only *emits* this; it deliberately does not open the create
|
|
111
|
+
* form itself (that would couple a generic component to the app-layer form presenter).
|
|
112
|
+
* The host application opens the related entity's form (e.g. via `MJFormPresenterService`
|
|
113
|
+
* as a dialog or slide-in), prefilled with {@link NewRecordValues}, and — when the user
|
|
114
|
+
* saves — calls {@link Complete} with the new record so the requesting field can select it.
|
|
115
|
+
*
|
|
116
|
+
* @example Explorer handler:
|
|
117
|
+
* ```typescript
|
|
118
|
+
* case 'create-related': {
|
|
119
|
+
* const ref = this.forms.Open({
|
|
120
|
+
* EntityName: event.EntityName,
|
|
121
|
+
* Presentation: event.Presentation ?? 'dialog',
|
|
122
|
+
* NewRecordValues: event.NewRecordValues,
|
|
123
|
+
* Provider: event.Provider,
|
|
124
|
+
* });
|
|
125
|
+
* event.Complete(await ref.AfterSaved());
|
|
126
|
+
* break;
|
|
127
|
+
* }
|
|
128
|
+
* ```
|
|
129
|
+
*/
|
|
130
|
+
export interface CreateRelatedNavigationEvent {
|
|
131
|
+
Kind: 'create-related';
|
|
132
|
+
/** Entity to create a new record of (the FK field's related entity). */
|
|
133
|
+
EntityName: string;
|
|
134
|
+
/**
|
|
135
|
+
* Default field values to prefill on the new record — lets the requester seed any
|
|
136
|
+
* fields (e.g. `{ Name: 'Marketing' }` from the typed search text), not just the name.
|
|
137
|
+
*/
|
|
138
|
+
NewRecordValues?: Record<string, unknown>;
|
|
139
|
+
/** Preferred surface for the create form. The host may honor or override it. */
|
|
140
|
+
Presentation?: 'dialog' | 'slide-in';
|
|
141
|
+
/** Metadata provider to use (multi-provider apps). */
|
|
142
|
+
Provider?: IMetadataProvider;
|
|
143
|
+
/**
|
|
144
|
+
* Host callback: invoke with the saved record (or `null` if the user cancelled) so the
|
|
145
|
+
* requesting field can select it. Optional for the host to call — a host with no create
|
|
146
|
+
* surface can ignore the whole event.
|
|
147
|
+
*/
|
|
148
|
+
Complete: (created: BaseEntity | null) => void;
|
|
149
|
+
}
|
|
106
150
|
//# sourceMappingURL=navigation-events.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navigation-events.d.ts","sourceRoot":"","sources":["../../../src/lib/types/navigation-events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"navigation-events.d.ts","sourceRoot":"","sources":["../../../src/lib/types/navigation-events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEnF;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,MAAM,mBAAmB,GAC3B,qBAAqB,GACrB,2BAA2B,GAC3B,wBAAwB,GACxB,8BAA8B,GAC9B,8BAA8B,GAC9B,wBAAwB,GACxB,4BAA4B,GAC5B,0BAA0B,CAAC;AAE/B;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,QAAQ,CAAC;IACf,2CAA2C;IAC3C,UAAU,EAAE,MAAM,CAAC;IACnB,2CAA2C;IAC3C,UAAU,EAAE,YAAY,CAAC;IACzB,8HAA8H;IAC9H,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAC1C,IAAI,EAAE,eAAe,CAAC;IACtB,6BAA6B;IAC7B,GAAG,EAAE,MAAM,CAAC;IACZ,sEAAsE;IACtE,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,OAAO,CAAC;IACd,gDAAgD;IAChD,YAAY,EAAE,MAAM,CAAC;CACtB;AAED;;;GAGG;AACH,MAAM,WAAW,8BAA8B;IAC7C,IAAI,EAAE,kBAAkB,CAAC;IACzB,4CAA4C;IAC5C,UAAU,EAAE,MAAM,CAAC;IACnB,0DAA0D;IAC1D,UAAU,EAAE,YAAY,CAAC;IACzB,qGAAqG;IACrG,SAAS,EAAE,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAC;CACxC;AAED;;;GAGG;AACH,MAAM,WAAW,8BAA8B;IAC7C,IAAI,EAAE,mBAAmB,CAAC;IAC1B,qCAAqC;IACrC,eAAe,EAAE,MAAM,CAAC;IACxB,uCAAuC;IACvC,gBAAgB,EAAE,MAAM,CAAC;IACzB,mDAAmD;IACnD,cAAc,EAAE,MAAM,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,YAAY,CAAC;IACnB,iDAAiD;IACjD,UAAU,EAAE,MAAM,CAAC;IACnB,+EAA+E;IAC/E,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACxC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,0BAA0B;IACzC,IAAI,EAAE,SAAS,CAAC;IAChB,wFAAwF;IACxF,MAAM,EAAE,sBAAsB,CAAC;CAChC;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,WAAW,4BAA4B;IAC3C,IAAI,EAAE,gBAAgB,CAAC;IACvB,wEAAwE;IACxE,UAAU,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC1C,gFAAgF;IAChF,YAAY,CAAC,EAAE,QAAQ,GAAG,UAAU,CAAC;IACrC,sDAAsD;IACtD,QAAQ,CAAC,EAAE,iBAAiB,CAAC;IAC7B;;;;OAIG;IACH,QAAQ,EAAE,CAAC,OAAO,EAAE,UAAU,GAAG,IAAI,KAAK,IAAI,CAAC;CAChD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navigation-events.js","sourceRoot":"","sources":["../../../src/lib/types/navigation-events.ts"],"names":[],"mappings":"","sourcesContent":["import { CompositeKey } from '@memberjunction/core';\n\n/**\n * Union type for all navigation event kinds emitted by the forms package.\n * The host application subscribes to these and maps them to its own routing system.\n *\n * @example Explorer integration:\n * ```typescript\n * HandleNavigation(event: FormNavigationEvent): void {\n * switch (event.Kind) {\n * case 'record':\n * this.navigationService.NavigateToRecord(event.EntityName, event.PrimaryKey);\n * break;\n * case 'external-link':\n * window.open(event.Url, '_blank');\n * break;\n * }\n * }\n * ```\n */\nexport type FormNavigationEvent =\n | RecordNavigationEvent\n | ExternalLinkNavigationEvent\n | EmailLinkNavigationEvent\n | EntityHierarchyNavigationEvent\n | ChildEntityTypeNavigationEvent\n | NewRecordNavigationEvent\n | DismissFormNavigationEvent;\n\n/**\n * User clicked a foreign key link to view a related record.\n * Emitted by mj-form-field when a record link is clicked.\n */\nexport interface RecordNavigationEvent {\n Kind: 'record';\n /** The entity name of the target record */\n EntityName: string;\n /** The primary key of the target record */\n PrimaryKey: CompositeKey;\n /** Whether to force opening in a new tab. When omitted, NavigationService uses its default behavior (shift-key detection). */\n OpenInNewTab?: boolean;\n}\n\n/**\n * User clicked an external URL (web link field value).\n */\nexport interface ExternalLinkNavigationEvent {\n Kind: 'external-link';\n /** The URL to navigate to */\n Url: string;\n /** Whether to open in a new tab (default: true for external links) */\n OpenInNewTab?: boolean;\n}\n\n/**\n * User clicked an email link.\n */\nexport interface EmailLinkNavigationEvent {\n Kind: 'email';\n /** The email address to compose a message to */\n EmailAddress: string;\n}\n\n/**\n * User clicked an IS-A parent entity badge in the hierarchy breadcrumb\n * or an \"Inherited from X\" badge in a section header.\n */\nexport interface EntityHierarchyNavigationEvent {\n Kind: 'entity-hierarchy';\n /** The parent entity name to navigate to */\n EntityName: string;\n /** The parent record's primary key (shared PK in IS-A) */\n PrimaryKey: CompositeKey;\n /** 'parent' = navigating up the chain, 'child' = navigating down, 'self' = current entity clicked */\n Direction: 'parent' | 'child' | 'self';\n}\n\n/**\n * User selected a child entity type from the subtypes dropdown.\n * The host app should navigate to a filtered list of those child records.\n */\nexport interface ChildEntityTypeNavigationEvent {\n Kind: 'child-entity-type';\n /** The child entity name selected */\n ChildEntityName: string;\n /** The current (parent) entity name */\n ParentEntityName: string;\n /** The current (parent) record ID for filtering */\n ParentRecordId: string;\n}\n\n/**\n * User wants to create a new related record (from a related entity section).\n */\nexport interface NewRecordNavigationEvent {\n Kind: 'new-record';\n /** The entity name to create a new record for */\n EntityName: string;\n /** Default field values (e.g., foreign key pointing back to current record) */\n DefaultValues: Record<string, unknown>;\n}\n\n/**\n * Form is asking the host to close/dismiss it.\n *\n * Emitted by `BaseFormComponent.CancelEdit` when the discarded record was never\n * saved (`!record.IsSaved`) — there's no actual record to view, so leaving the\n * form open in view mode shows blank fields and confuses users. The host\n * application should close the tab/dialog/route that contained the form and\n * return the user to whatever surface they came from (typically a list view).\n *\n * Hosts that don't have a meaningful \"close\" semantic (e.g., a form embedded\n * inline on a dashboard) can safely ignore this — the form has already\n * reverted state and returned to view mode.\n */\nexport interface DismissFormNavigationEvent {\n Kind: 'dismiss';\n /** Reason for the dismiss request — useful for analytics / different host behaviors. */\n Reason: 'new-record-discarded';\n}\n"]}
|
|
1
|
+
{"version":3,"file":"navigation-events.js","sourceRoot":"","sources":["../../../src/lib/types/navigation-events.ts"],"names":[],"mappings":"","sourcesContent":["import { BaseEntity, CompositeKey, IMetadataProvider } from '@memberjunction/core';\n\n/**\n * Union type for all navigation event kinds emitted by the forms package.\n * The host application subscribes to these and maps them to its own routing system.\n *\n * @example Explorer integration:\n * ```typescript\n * HandleNavigation(event: FormNavigationEvent): void {\n * switch (event.Kind) {\n * case 'record':\n * this.navigationService.NavigateToRecord(event.EntityName, event.PrimaryKey);\n * break;\n * case 'external-link':\n * window.open(event.Url, '_blank');\n * break;\n * }\n * }\n * ```\n */\nexport type FormNavigationEvent =\n | RecordNavigationEvent\n | ExternalLinkNavigationEvent\n | EmailLinkNavigationEvent\n | EntityHierarchyNavigationEvent\n | ChildEntityTypeNavigationEvent\n | NewRecordNavigationEvent\n | CreateRelatedNavigationEvent\n | DismissFormNavigationEvent;\n\n/**\n * User clicked a foreign key link to view a related record.\n * Emitted by mj-form-field when a record link is clicked.\n */\nexport interface RecordNavigationEvent {\n Kind: 'record';\n /** The entity name of the target record */\n EntityName: string;\n /** The primary key of the target record */\n PrimaryKey: CompositeKey;\n /** Whether to force opening in a new tab. When omitted, NavigationService uses its default behavior (shift-key detection). */\n OpenInNewTab?: boolean;\n}\n\n/**\n * User clicked an external URL (web link field value).\n */\nexport interface ExternalLinkNavigationEvent {\n Kind: 'external-link';\n /** The URL to navigate to */\n Url: string;\n /** Whether to open in a new tab (default: true for external links) */\n OpenInNewTab?: boolean;\n}\n\n/**\n * User clicked an email link.\n */\nexport interface EmailLinkNavigationEvent {\n Kind: 'email';\n /** The email address to compose a message to */\n EmailAddress: string;\n}\n\n/**\n * User clicked an IS-A parent entity badge in the hierarchy breadcrumb\n * or an \"Inherited from X\" badge in a section header.\n */\nexport interface EntityHierarchyNavigationEvent {\n Kind: 'entity-hierarchy';\n /** The parent entity name to navigate to */\n EntityName: string;\n /** The parent record's primary key (shared PK in IS-A) */\n PrimaryKey: CompositeKey;\n /** 'parent' = navigating up the chain, 'child' = navigating down, 'self' = current entity clicked */\n Direction: 'parent' | 'child' | 'self';\n}\n\n/**\n * User selected a child entity type from the subtypes dropdown.\n * The host app should navigate to a filtered list of those child records.\n */\nexport interface ChildEntityTypeNavigationEvent {\n Kind: 'child-entity-type';\n /** The child entity name selected */\n ChildEntityName: string;\n /** The current (parent) entity name */\n ParentEntityName: string;\n /** The current (parent) record ID for filtering */\n ParentRecordId: string;\n}\n\n/**\n * User wants to create a new related record (from a related entity section).\n */\nexport interface NewRecordNavigationEvent {\n Kind: 'new-record';\n /** The entity name to create a new record for */\n EntityName: string;\n /** Default field values (e.g., foreign key pointing back to current record) */\n DefaultValues: Record<string, unknown>;\n}\n\n/**\n * Form is asking the host to close/dismiss it.\n *\n * Emitted by `BaseFormComponent.CancelEdit` when the discarded record was never\n * saved (`!record.IsSaved`) — there's no actual record to view, so leaving the\n * form open in view mode shows blank fields and confuses users. The host\n * application should close the tab/dialog/route that contained the form and\n * return the user to whatever surface they came from (typically a list view).\n *\n * Hosts that don't have a meaningful \"close\" semantic (e.g., a form embedded\n * inline on a dashboard) can safely ignore this — the form has already\n * reverted state and returned to view mode.\n */\nexport interface DismissFormNavigationEvent {\n Kind: 'dismiss';\n /** Reason for the dismiss request — useful for analytics / different host behaviors. */\n Reason: 'new-record-discarded';\n}\n\n/**\n * A field (e.g. a foreign-key dropdown) is asking the host to create a NEW record of a\n * related entity — typically because the user searched for one that doesn't exist yet.\n *\n * The Generic forms layer only *emits* this; it deliberately does not open the create\n * form itself (that would couple a generic component to the app-layer form presenter).\n * The host application opens the related entity's form (e.g. via `MJFormPresenterService`\n * as a dialog or slide-in), prefilled with {@link NewRecordValues}, and — when the user\n * saves — calls {@link Complete} with the new record so the requesting field can select it.\n *\n * @example Explorer handler:\n * ```typescript\n * case 'create-related': {\n * const ref = this.forms.Open({\n * EntityName: event.EntityName,\n * Presentation: event.Presentation ?? 'dialog',\n * NewRecordValues: event.NewRecordValues,\n * Provider: event.Provider,\n * });\n * event.Complete(await ref.AfterSaved());\n * break;\n * }\n * ```\n */\nexport interface CreateRelatedNavigationEvent {\n Kind: 'create-related';\n /** Entity to create a new record of (the FK field's related entity). */\n EntityName: string;\n /**\n * Default field values to prefill on the new record — lets the requester seed any\n * fields (e.g. `{ Name: 'Marketing' }` from the typed search text), not just the name.\n */\n NewRecordValues?: Record<string, unknown>;\n /** Preferred surface for the create form. The host may honor or override it. */\n Presentation?: 'dialog' | 'slide-in';\n /** Metadata provider to use (multi-provider apps). */\n Provider?: IMetadataProvider;\n /**\n * Host callback: invoke with the saved record (or `null` if the user cancelled) so the\n * requesting field can select it. Optional for the host to call — a host with no create\n * surface can ignore the whole event.\n */\n Complete: (created: BaseEntity | null) => void;\n}\n"]}
|
package/dist/module.d.ts
CHANGED
|
@@ -10,13 +10,17 @@ import * as i8 from "./lib/isa-related-panel/isa-related-card.component";
|
|
|
10
10
|
import * as i9 from "./lib/isa-related-panel/isa-related-panel.component";
|
|
11
11
|
import * as i10 from "./lib/panel-slot/form-panel-slot.component";
|
|
12
12
|
import * as i11 from "./lib/interactive-form/interactive-form.component";
|
|
13
|
-
import * as i12 from "
|
|
14
|
-
import * as i13 from "@angular/
|
|
15
|
-
import * as i14 from "@
|
|
16
|
-
import * as i15 from "@memberjunction/ng-
|
|
17
|
-
import * as i16 from "@memberjunction/ng-
|
|
18
|
-
import * as i17 from "@memberjunction/ng-
|
|
19
|
-
import * as i18 from "@memberjunction/ng-
|
|
13
|
+
import * as i12 from "./lib/host/entity-form-host.component";
|
|
14
|
+
import * as i13 from "@angular/common";
|
|
15
|
+
import * as i14 from "@angular/forms";
|
|
16
|
+
import * as i15 from "@memberjunction/ng-record-changes";
|
|
17
|
+
import * as i16 from "@memberjunction/ng-list-management";
|
|
18
|
+
import * as i17 from "@memberjunction/ng-entity-viewer";
|
|
19
|
+
import * as i18 from "@memberjunction/ng-record-tags";
|
|
20
|
+
import * as i19 from "@memberjunction/ng-react";
|
|
21
|
+
import * as i20 from "@memberjunction/ng-markdown";
|
|
22
|
+
import * as i21 from "@memberjunction/ng-code-editor";
|
|
23
|
+
import * as i22 from "@memberjunction/ng-shared-generic";
|
|
20
24
|
/**
|
|
21
25
|
* BaseFormsModule - Form components and base classes for rendering and editing MemberJunction entity records.
|
|
22
26
|
*
|
|
@@ -38,7 +42,7 @@ import * as i18 from "@memberjunction/ng-react";
|
|
|
38
42
|
*/
|
|
39
43
|
export declare class BaseFormsModule {
|
|
40
44
|
static ɵfac: i0.ɵɵFactoryDeclaration<BaseFormsModule, never>;
|
|
41
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<BaseFormsModule, [typeof i1.MjFormToolbarComponent, typeof i2.MjFormFieldComponent, typeof i3.MjCollapsiblePanelComponent, typeof i4.MjRecordFormContainerComponent, typeof i5.MjSectionManagerComponent, typeof i6.SectionLoaderComponent, typeof i7.ExplorerEntityDataGridComponent, typeof i8.MjIsaRelatedCardComponent, typeof i9.MjIsaRelatedPanelComponent, typeof i10.FormPanelSlotComponent, typeof i11.InteractiveFormComponent], [typeof
|
|
45
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<BaseFormsModule, [typeof i1.MjFormToolbarComponent, typeof i2.MjFormFieldComponent, typeof i3.MjCollapsiblePanelComponent, typeof i4.MjRecordFormContainerComponent, typeof i5.MjSectionManagerComponent, typeof i6.SectionLoaderComponent, typeof i7.ExplorerEntityDataGridComponent, typeof i8.MjIsaRelatedCardComponent, typeof i9.MjIsaRelatedPanelComponent, typeof i10.FormPanelSlotComponent, typeof i11.InteractiveFormComponent, typeof i12.MjEntityFormHostComponent], [typeof i13.CommonModule, typeof i14.FormsModule, typeof i15.RecordChangesModule, typeof i16.ListManagementModule, typeof i17.EntityViewerModule, typeof i18.RecordTagsModule, typeof i19.MJReactModule, typeof i20.MarkdownModule, typeof i21.CodeEditorModule, typeof i22.MJSafeRichHtmlPipe, typeof i22.SharedGenericModule], [typeof i1.MjFormToolbarComponent, typeof i2.MjFormFieldComponent, typeof i3.MjCollapsiblePanelComponent, typeof i4.MjRecordFormContainerComponent, typeof i5.MjSectionManagerComponent, typeof i6.SectionLoaderComponent, typeof i7.ExplorerEntityDataGridComponent, typeof i8.MjIsaRelatedCardComponent, typeof i9.MjIsaRelatedPanelComponent, typeof i10.FormPanelSlotComponent, typeof i11.InteractiveFormComponent, typeof i12.MjEntityFormHostComponent]>;
|
|
42
46
|
static ɵinj: i0.ɵɵInjectorDeclaration<BaseFormsModule>;
|
|
43
47
|
}
|
|
44
48
|
//# sourceMappingURL=module.d.ts.map
|
package/dist/module.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../src/module.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../src/module.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAyBA;;;;;;;;;;;;;;;;;;GAkBG;AACH,qBA2Ca,eAAe;yCAAf,eAAe;0CAAf,eAAe;0CAAf,eAAe;CAAI"}
|
package/dist/module.js
CHANGED
|
@@ -16,7 +16,11 @@ import { ListManagementModule } from '@memberjunction/ng-list-management';
|
|
|
16
16
|
import { EntityViewerModule } from '@memberjunction/ng-entity-viewer';
|
|
17
17
|
import { RecordTagsModule } from '@memberjunction/ng-record-tags';
|
|
18
18
|
import { MJReactModule } from '@memberjunction/ng-react';
|
|
19
|
+
import { MarkdownModule } from '@memberjunction/ng-markdown';
|
|
20
|
+
import { CodeEditorModule } from '@memberjunction/ng-code-editor';
|
|
21
|
+
import { MJSafeRichHtmlPipe, SharedGenericModule } from '@memberjunction/ng-shared-generic';
|
|
19
22
|
import { InteractiveFormComponent } from './lib/interactive-form/interactive-form.component';
|
|
23
|
+
import { MjEntityFormHostComponent } from './lib/host/entity-form-host.component';
|
|
20
24
|
import * as i0 from "@angular/core";
|
|
21
25
|
/**
|
|
22
26
|
* BaseFormsModule - Form components and base classes for rendering and editing MemberJunction entity records.
|
|
@@ -46,7 +50,10 @@ export class BaseFormsModule {
|
|
|
46
50
|
ListManagementModule,
|
|
47
51
|
EntityViewerModule,
|
|
48
52
|
RecordTagsModule,
|
|
49
|
-
MJReactModule
|
|
53
|
+
MJReactModule,
|
|
54
|
+
MarkdownModule,
|
|
55
|
+
CodeEditorModule,
|
|
56
|
+
SharedGenericModule] });
|
|
50
57
|
}
|
|
51
58
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(BaseFormsModule, [{
|
|
52
59
|
type: NgModule,
|
|
@@ -62,7 +69,8 @@ export class BaseFormsModule {
|
|
|
62
69
|
MjIsaRelatedCardComponent,
|
|
63
70
|
MjIsaRelatedPanelComponent,
|
|
64
71
|
FormPanelSlotComponent,
|
|
65
|
-
InteractiveFormComponent
|
|
72
|
+
InteractiveFormComponent,
|
|
73
|
+
MjEntityFormHostComponent
|
|
66
74
|
],
|
|
67
75
|
imports: [
|
|
68
76
|
CommonModule,
|
|
@@ -71,7 +79,11 @@ export class BaseFormsModule {
|
|
|
71
79
|
ListManagementModule,
|
|
72
80
|
EntityViewerModule,
|
|
73
81
|
RecordTagsModule,
|
|
74
|
-
MJReactModule
|
|
82
|
+
MJReactModule,
|
|
83
|
+
MarkdownModule,
|
|
84
|
+
CodeEditorModule,
|
|
85
|
+
MJSafeRichHtmlPipe,
|
|
86
|
+
SharedGenericModule
|
|
75
87
|
],
|
|
76
88
|
exports: [
|
|
77
89
|
MjFormToolbarComponent,
|
|
@@ -84,7 +96,8 @@ export class BaseFormsModule {
|
|
|
84
96
|
MjIsaRelatedCardComponent,
|
|
85
97
|
MjIsaRelatedPanelComponent,
|
|
86
98
|
FormPanelSlotComponent,
|
|
87
|
-
InteractiveFormComponent
|
|
99
|
+
InteractiveFormComponent,
|
|
100
|
+
MjEntityFormHostComponent
|
|
88
101
|
]
|
|
89
102
|
}]
|
|
90
103
|
}], null, null); })();
|
|
@@ -98,13 +111,18 @@ export class BaseFormsModule {
|
|
|
98
111
|
MjIsaRelatedCardComponent,
|
|
99
112
|
MjIsaRelatedPanelComponent,
|
|
100
113
|
FormPanelSlotComponent,
|
|
101
|
-
InteractiveFormComponent
|
|
114
|
+
InteractiveFormComponent,
|
|
115
|
+
MjEntityFormHostComponent], imports: [CommonModule,
|
|
102
116
|
FormsModule,
|
|
103
117
|
RecordChangesModule,
|
|
104
118
|
ListManagementModule,
|
|
105
119
|
EntityViewerModule,
|
|
106
120
|
RecordTagsModule,
|
|
107
|
-
MJReactModule
|
|
121
|
+
MJReactModule,
|
|
122
|
+
MarkdownModule,
|
|
123
|
+
CodeEditorModule,
|
|
124
|
+
MJSafeRichHtmlPipe,
|
|
125
|
+
SharedGenericModule], exports: [MjFormToolbarComponent,
|
|
108
126
|
MjFormFieldComponent,
|
|
109
127
|
MjCollapsiblePanelComponent,
|
|
110
128
|
MjRecordFormContainerComponent,
|
|
@@ -114,5 +132,6 @@ export class BaseFormsModule {
|
|
|
114
132
|
MjIsaRelatedCardComponent,
|
|
115
133
|
MjIsaRelatedPanelComponent,
|
|
116
134
|
FormPanelSlotComponent,
|
|
117
|
-
InteractiveFormComponent
|
|
135
|
+
InteractiveFormComponent,
|
|
136
|
+
MjEntityFormHostComponent] }); })();
|
|
118
137
|
//# sourceMappingURL=module.js.map
|
package/dist/module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.js","sourceRoot":"","sources":["../src/module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAC9E,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,EAAE,2BAA2B,EAAE,MAAM,yCAAyC,CAAC;AACtF,OAAO,EAAE,8BAA8B,EAAE,MAAM,iDAAiD,CAAC;AACjG,OAAO,EAAE,yBAAyB,EAAE,MAAM,iDAAiD,CAAC;AAC5F,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,EAAE,+BAA+B,EAAE,MAAM,2CAA2C,CAAC;AAC5F,OAAO,EAAE,yBAAyB,EAAE,MAAM,oDAAoD,CAAC;AAC/F,OAAO,EAAE,0BAA0B,EAAE,MAAM,qDAAqD,CAAC;AACjG,OAAO,EAAE,sBAAsB,EAAE,MAAM,4CAA4C,CAAC;AACpF,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,wBAAwB,EAAE,MAA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;QAClB,gBAAgB;QAChB,aAAa;QACb,cAAc;QACd,gBAAgB;QAChB,kBAAkB;QAClB,mBAAmB,aAGnB,sBAAsB;QACtB,oBAAoB;QACpB,2BAA2B;QAC3B,8BAA8B;QAC9B,yBAAyB;QACzB,sBAAsB;QACtB,+BAA+B;QAC/B,yBAAyB;QACzB,0BAA0B;QAC1B,sBAAsB;QACtB,wBAAwB;QACxB,yBAAyB","sourcesContent":["import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormsModule } from '@angular/forms';\n\nimport { MjFormToolbarComponent } from './lib/toolbar/form-toolbar.component';\nimport { MjFormFieldComponent } from './lib/field/form-field.component';\nimport { MjCollapsiblePanelComponent } from './lib/panel/collapsible-panel.component';\nimport { MjRecordFormContainerComponent } from './lib/container/record-form-container.component';\nimport { MjSectionManagerComponent } from './lib/section-manager/section-manager.component';\nimport { SectionLoaderComponent } from './lib/section-loader-component';\nimport { ExplorerEntityDataGridComponent } from './lib/explorer-entity-data-grid.component';\nimport { MjIsaRelatedCardComponent } from './lib/isa-related-panel/isa-related-card.component';\nimport { MjIsaRelatedPanelComponent } from './lib/isa-related-panel/isa-related-panel.component';\nimport { FormPanelSlotComponent } from './lib/panel-slot/form-panel-slot.component';\nimport { RecordChangesModule } from '@memberjunction/ng-record-changes';\nimport { ListManagementModule } from '@memberjunction/ng-list-management';\nimport { EntityViewerModule } from '@memberjunction/ng-entity-viewer';\nimport { RecordTagsModule } from '@memberjunction/ng-record-tags';\nimport { MJReactModule } from '@memberjunction/ng-react';\nimport { MarkdownModule } from '@memberjunction/ng-markdown';\nimport { CodeEditorModule } from '@memberjunction/ng-code-editor';\nimport { MJSafeRichHtmlPipe, SharedGenericModule } from '@memberjunction/ng-shared-generic';\nimport { InteractiveFormComponent } from './lib/interactive-form/interactive-form.component';\nimport { MjEntityFormHostComponent } from './lib/host/entity-form-host.component';\n\n/**\n * BaseFormsModule - Form components and base classes for rendering and editing MemberJunction entity records.\n *\n * Provides:\n * - **MjRecordFormContainerComponent** (`<mj-record-form-container>`): Top-level container\n * with sticky toolbar, section state management, and content slots.\n * - **MjFormToolbarComponent** (`<mj-form-toolbar>`): Configurable toolbar with read/edit mode\n * actions, IS-A hierarchy breadcrumb, section controls, and inline delete dialog.\n * - **MjCollapsiblePanelComponent** (`<mj-collapsible-panel>`): Collapsible section with\n * drag-to-reorder, search filtering, and inherited/related variants.\n * - **MjFormFieldComponent** (`<mj-form-field>`): Entity field renderer with clean read-only\n * display and modern edit-mode inputs (native HTML with custom select and autocomplete).\n * - **SectionLoaderComponent** (`<mj-form-section>`): Dynamic section loader via ClassFactory.\n * - **ExplorerEntityDataGridComponent** (`<mj-explorer-entity-data-grid>`): Data grid wrapper\n * for related entity sections with Navigate event support.\n *\n * All navigation actions are emitted as events via {@link FormNavigationEvent}.\n * The host application subscribes and maps to its own routing system.\n */\n@NgModule({\n declarations: [\n MjFormToolbarComponent,\n MjFormFieldComponent,\n MjCollapsiblePanelComponent,\n MjRecordFormContainerComponent,\n MjSectionManagerComponent,\n SectionLoaderComponent,\n ExplorerEntityDataGridComponent,\n MjIsaRelatedCardComponent,\n MjIsaRelatedPanelComponent,\n FormPanelSlotComponent,\n InteractiveFormComponent,\n MjEntityFormHostComponent\n ],\n imports: [\n CommonModule,\n FormsModule,\n RecordChangesModule,\n ListManagementModule,\n EntityViewerModule,\n RecordTagsModule,\n MJReactModule,\n MarkdownModule,\n CodeEditorModule,\n MJSafeRichHtmlPipe,\n SharedGenericModule\n ],\n exports: [\n MjFormToolbarComponent,\n MjFormFieldComponent,\n MjCollapsiblePanelComponent,\n MjRecordFormContainerComponent,\n MjSectionManagerComponent,\n SectionLoaderComponent,\n ExplorerEntityDataGridComponent,\n MjIsaRelatedCardComponent,\n MjIsaRelatedPanelComponent,\n FormPanelSlotComponent,\n InteractiveFormComponent,\n MjEntityFormHostComponent\n ]\n})\nexport class BaseFormsModule { }\n"]}
|
package/dist/public-api.d.ts
CHANGED
|
@@ -13,6 +13,15 @@ export * from './lib/types/form-types';
|
|
|
13
13
|
export * from './lib/types/navigation-events';
|
|
14
14
|
export * from './lib/types/toolbar-config';
|
|
15
15
|
export * from './lib/types/form-events';
|
|
16
|
+
export * from './lib/types/entity-form-config';
|
|
17
|
+
export * from './lib/resolver/form-resolver.service';
|
|
18
|
+
export * from './lib/host/entity-form-host.component';
|
|
19
|
+
export * from './lib/overlays/base-form-overlay';
|
|
20
|
+
export * from './lib/overlays/form-dialog.component';
|
|
21
|
+
export * from './lib/overlays/form-slide-in.component';
|
|
22
|
+
export * from './lib/overlays/form-window.component';
|
|
23
|
+
export * from './lib/overlays/form-presenter.types';
|
|
24
|
+
export * from './lib/overlays/form-presenter.service';
|
|
16
25
|
export * from './lib/base-record-component';
|
|
17
26
|
export * from './lib/base-form-component';
|
|
18
27
|
export * from './lib/base-form-section-component';
|
|
@@ -21,6 +30,8 @@ export * from './lib/form-state.interface';
|
|
|
21
30
|
export * from './lib/form-state.service';
|
|
22
31
|
export * from './lib/toolbar/form-toolbar.component';
|
|
23
32
|
export * from './lib/field/form-field.component';
|
|
33
|
+
export * from './lib/field/fk-search-utils';
|
|
34
|
+
export * from './lib/field/linked-field-options';
|
|
24
35
|
export * from './lib/panel/collapsible-panel.component';
|
|
25
36
|
export * from './lib/container/record-form-container.component';
|
|
26
37
|
export * from './lib/section-manager/section-manager.component';
|
package/dist/public-api.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"public-api.d.ts","sourceRoot":"","sources":["../src/public-api.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,cAAc,UAAU,CAAC;AAGzB,cAAc,wBAAwB,CAAC;AACvC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"public-api.d.ts","sourceRoot":"","sources":["../src/public-api.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,cAAc,UAA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