@memberjunction/ng-explorer-core 5.38.0 → 5.40.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.
Files changed (46) hide show
  1. package/dist/app-routing.module.d.ts.map +1 -1
  2. package/dist/app-routing.module.js +13 -13
  3. package/dist/app-routing.module.js.map +1 -1
  4. package/dist/generated/lazy-feature-config.d.ts +1 -1
  5. package/dist/generated/lazy-feature-config.d.ts.map +1 -1
  6. package/dist/generated/lazy-feature-config.js +3 -2
  7. package/dist/generated/lazy-feature-config.js.map +1 -1
  8. package/dist/lib/guards/app-lock-guard.service.d.ts +26 -0
  9. package/dist/lib/guards/app-lock-guard.service.d.ts.map +1 -0
  10. package/dist/lib/guards/app-lock-guard.service.js +55 -0
  11. package/dist/lib/guards/app-lock-guard.service.js.map +1 -0
  12. package/dist/lib/resource-wrappers/chat-conversations-resource.component.d.ts.map +1 -1
  13. package/dist/lib/resource-wrappers/chat-conversations-resource.component.js +40 -27
  14. package/dist/lib/resource-wrappers/chat-conversations-resource.component.js.map +1 -1
  15. package/dist/lib/resource-wrappers/view-resource.component.d.ts +6 -5
  16. package/dist/lib/resource-wrappers/view-resource.component.d.ts.map +1 -1
  17. package/dist/lib/resource-wrappers/view-resource.component.js +19 -24
  18. package/dist/lib/resource-wrappers/view-resource.component.js.map +1 -1
  19. package/dist/lib/shell/components/tabs/tab-container.component.d.ts.map +1 -1
  20. package/dist/lib/shell/components/tabs/tab-container.component.js +9 -0
  21. package/dist/lib/shell/components/tabs/tab-container.component.js.map +1 -1
  22. package/dist/lib/shell/shell.component.d.ts +24 -6
  23. package/dist/lib/shell/shell.component.d.ts.map +1 -1
  24. package/dist/lib/shell/shell.component.js +360 -191
  25. package/dist/lib/shell/shell.component.js.map +1 -1
  26. package/dist/lib/single-record/single-record.component.d.ts +31 -75
  27. package/dist/lib/single-record/single-record.component.d.ts.map +1 -1
  28. package/dist/lib/single-record/single-record.component.js +60 -471
  29. package/dist/lib/single-record/single-record.component.js.map +1 -1
  30. package/dist/lib/single-search-result/single-search-result.component.d.ts +3 -8
  31. package/dist/lib/single-search-result/single-search-result.component.d.ts.map +1 -1
  32. package/dist/lib/single-search-result/single-search-result.component.js +19 -68
  33. package/dist/lib/single-search-result/single-search-result.component.js.map +1 -1
  34. package/dist/public-api.d.ts +1 -0
  35. package/dist/public-api.d.ts.map +1 -1
  36. package/dist/public-api.js +1 -0
  37. package/dist/public-api.js.map +1 -1
  38. package/package.json +46 -46
  39. package/dist/lib/__tests__/form-resolver.service.test.d.ts +0 -2
  40. package/dist/lib/__tests__/form-resolver.service.test.d.ts.map +0 -1
  41. package/dist/lib/__tests__/form-resolver.service.test.js +0 -258
  42. package/dist/lib/__tests__/form-resolver.service.test.js.map +0 -1
  43. package/dist/lib/services/form-resolver.service.d.ts +0 -139
  44. package/dist/lib/services/form-resolver.service.d.ts.map +0 -1
  45. package/dist/lib/services/form-resolver.service.js +0 -235
  46. package/dist/lib/services/form-resolver.service.js.map +0 -1
@@ -1,86 +1,42 @@
1
- import { AfterViewInit, EventEmitter, OnDestroy, OnInit } from '@angular/core';
2
- import { ActivatedRoute } from '@angular/router';
1
+ import { EventEmitter } from '@angular/core';
3
2
  import { CompositeKey, BaseEntity } from '@memberjunction/core';
4
- import { Container } from '@memberjunction/ng-container-directives';
3
+ import { FormNavigationEvent, FormNotificationEvent } from '@memberjunction/ng-base-forms';
5
4
  import { BaseAngularComponent } from '@memberjunction/ng-base-types';
6
5
  import * as i0 from "@angular/core";
7
- export declare class SingleRecordComponent extends BaseAngularComponent implements OnInit, AfterViewInit, OnDestroy {
8
- private route;
9
- formContainer: Container;
10
- private _primaryKey;
11
- set PrimaryKey(value: CompositeKey);
12
- get PrimaryKey(): CompositeKey;
13
- private _entityName;
14
- set entityName(value: string | null);
15
- get entityName(): string | null;
6
+ /**
7
+ * Explorer-side host for a single entity record in the main tab area.
8
+ *
9
+ * This is now a **thin wrapper** around the Generic `<mj-entity-form-host>`
10
+ * (in `@memberjunction/ng-base-forms`), which owns all the mechanics: resolving
11
+ * the form (class / custom / interactive override + variants), loading the
12
+ * record, dynamically creating the form, binding it, and tearing it down.
13
+ *
14
+ * SingleRecordComponent's only remaining job is the **Explorer mapping**:
15
+ * translating the host's framework-agnostic events into Explorer services —
16
+ * `Navigate` → {@link NavigationService}, `Notification` → {@link SharedService},
17
+ * record loads → {@link RecentAccessService} — none of which belong in a Generic
18
+ * component.
19
+ */
20
+ export declare class SingleRecordComponent extends BaseAngularComponent {
21
+ PrimaryKey: CompositeKey;
22
+ entityName: string | null;
16
23
  newRecordValues: string | Record<string, unknown> | null;
17
- loadComplete: EventEmitter<any>;
24
+ loadComplete: EventEmitter<void>;
18
25
  recordSaved: EventEmitter<BaseEntity>;
19
- /**
20
- * Emitted when the hosted form asks to be dismissed (e.g., user clicked Discard on
21
- * a brand-new record). Parent components should close the tab / route the user back.
22
- */
26
+ /** Emitted when the hosted form asks to be dismissed (e.g. Discard on a new record). */
23
27
  recordDismissed: EventEmitter<void>;
24
- private recentAccessService;
25
28
  private navigationService;
26
29
  private sharedService;
27
- private cdr;
28
- private formResolver;
29
- constructor(route: ActivatedRoute);
30
- appDescription: string;
31
- useGenericForm: boolean;
32
- loading: boolean;
33
- errorTitle: string | null;
34
- errorDetail: string | null;
35
- private _formComponentRef;
36
- private _currentRecord;
37
- private _eventHandlerSubscription;
38
- private _formEventSubscriptions;
39
- private _viewInitialized;
40
- ngOnInit(): void;
41
- ngAfterViewInit(): void;
42
- /**
43
- * Re-run LoadForm when an @Input changes after initial view init.
44
- *
45
- * Defense-in-depth: the tab/cache rekey on save (in TabContainerComponent) is the
46
- * primary fix that prevents stale-form bugs after creating a new record. This setter
47
- * path ensures we self-heal if a host ever swaps the bound inputs without recreating
48
- * the component — without it, LoadForm only ever runs once per component instance.
49
- *
50
- * Tears down the previous form (component, record, event handlers) before loading the
51
- * new one so we don't leak references or stack multiple forms in the container.
52
- */
53
- private reloadCurrentForm;
54
- /**
55
- * Compare two CompositeKey instances by their key/value contents.
56
- * Two different instances representing the same key should NOT count as a change.
57
- *
58
- * Filters out KVPs with empty Values before comparing. Different callers represent
59
- * "no key" differently — some use an empty KeyValuePairs list, others use a single
60
- * KVP with an empty Value (e.g. `LoadFromURLSegment(entity, '')`). Both mean the
61
- * same thing semantically and must not trigger a change.
62
- */
63
- private compositeKeysEqual;
64
- /**
65
- * Tear down the currently rendered form so a new one can be loaded in its place.
66
- * Mirrors the cleanup done in ngOnDestroy, minus the final state reset.
67
- */
68
- private teardownActiveForm;
69
- LoadForm(primaryKey: CompositeKey, entityName: string): Promise<void>;
70
- /**
71
- * Render a user-visible error state inside the record pane AND log a structured
72
- * console.error for developers. Always emits `loadComplete` so the Explorer shell
73
- * does not hang on its first-resource-load gate.
74
- */
75
- private failWithUserError;
76
- protected SetNewRecordValues(record: BaseEntity): void;
77
- /**
78
- * Subscribe to BaseFormComponent @Output events and map them to Explorer services.
79
- */
80
- private subscribeToFormEvents;
81
- private handleNavigation;
82
- private cleanupFormSubscriptions;
83
- ngOnDestroy(): void;
30
+ private formPresenter;
31
+ private recentAccessService;
32
+ /** Unblock the shell's first-resource-load gate (success or error). */
33
+ onLoadComplete(): void;
34
+ /** Log access for existing records once the form's record is ready. */
35
+ onRecordReady(record: BaseEntity): void;
36
+ onSaved(record: BaseEntity): void;
37
+ onNotification(event: FormNotificationEvent): void;
38
+ /** Map the form's navigation requests onto Explorer's NavigationService. */
39
+ handleNavigation(event: FormNavigationEvent): void;
84
40
  static ɵfac: i0.ɵɵFactoryDeclaration<SingleRecordComponent, never>;
85
41
  static ɵcmp: i0.ɵɵComponentDeclaration<SingleRecordComponent, "mj-single-record", never, { "PrimaryKey": { "alias": "PrimaryKey"; "required": false; }; "entityName": { "alias": "entityName"; "required": false; }; "newRecordValues": { "alias": "newRecordValues"; "required": false; }; }, { "loadComplete": "loadComplete"; "recordSaved": "recordSaved"; "recordDismissed": "recordDismissed"; }, never, never, false, never>;
86
42
  }
@@ -1 +1 @@
1
- {"version":3,"file":"single-record.component.d.ts","sourceRoot":"","sources":["../../../src/lib/single-record/single-record.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAA8C,YAAY,EAAiB,SAAS,EAAE,MAAM,EAAqB,MAAM,eAAe,CAAC;AAC7J,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAChD,OAAO,EAA0B,YAAY,EAAE,UAAU,EAA4D,MAAM,sBAAsB,CAAC;AAElJ,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAMpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;;AACrE,qBAMa,qBAAsB,SAAQ,oBAAqB,YAAW,MAAM,EAAE,aAAa,EAAE,SAAS;IAwD5F,OAAO,CAAC,KAAK;IAvDY,aAAa,EAAG,SAAS,CAAC;IAEhE,OAAO,CAAC,WAAW,CAAoC;IACvD,IACW,UAAU,CAAC,KAAK,EAAE,YAAY,EAiBxC;IACD,IAAW,UAAU,IAAI,YAAY,CAEpC;IAED,OAAO,CAAC,WAAW,CAAqB;IACxC,IACW,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,EAMzC;IACD,IAAW,UAAU,IAAI,MAAM,GAAG,IAAI,CAErC;IAEe,eAAe,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAM;IAE7D,YAAY,EAAE,YAAY,CAAC,GAAG,CAAC,CAA2B;IAC1D,WAAW,EAAE,YAAY,CAAC,UAAU,CAAC,CAAkC;IACxF;;;OAGG;IACc,eAAe,EAAE,YAAY,CAAC,IAAI,CAAC,CAA4B;IAEhF,OAAO,CAAC,mBAAmB,CAAsB;IACjD,OAAO,CAAC,iBAAiB,CAA6B;IACtD,OAAO,CAAC,aAAa,CAAyB;IAC9C,OAAO,CAAC,GAAG,CAA6B;IACxC,OAAO,CAAC,YAAY,CAA+B;gBAE9B,KAAK,EAAE,cAAc;IAKnC,cAAc,EAAE,MAAM,CAAK;IAC3B,cAAc,EAAE,OAAO,CAAS;IAChC,OAAO,EAAE,OAAO,CAAQ;IACxB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAQ;IACjC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAQ;IAGzC,OAAO,CAAC,iBAAiB,CAAgD;IACzE,OAAO,CAAC,cAAc,CAA2B;IACjD,OAAO,CAAC,yBAAyB,CAA6B;IAC9D,OAAO,CAAC,uBAAuB,CAAsB;IACrD,OAAO,CAAC,gBAAgB,CAAS;IAEjC,QAAQ,IAAI,IAAI;IAGhB,eAAe;IAKf;;;;;;;;;;OAUG;IACH,OAAO,CAAC,iBAAiB;IASzB;;;;;;;;OAQG;IACH,OAAO,CAAC,kBAAkB;IAa1B;;;OAGG;IACH,OAAO,CAAC,kBAAkB;IAoBb,QAAQ,CAAC,UAAU,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM;IAoKlE;;;;OAIG;IACH,OAAO,CAAC,iBAAiB;IAyBzB,SAAS,CAAC,kBAAkB,CAAC,MAAM,EAAE,UAAU;IA8E/C;;OAEG;IACH,OAAO,CAAC,qBAAqB;IAW7B,OAAO,CAAC,gBAAgB;IAkCxB,OAAO,CAAC,wBAAwB;IAOhC,WAAW,IAAI,IAAI;yCA3dR,qBAAqB;2CAArB,qBAAqB;CAyfjC"}
1
+ {"version":3,"file":"single-record.component.d.ts","sourceRoot":"","sources":["../../../src/lib/single-record/single-record.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,YAAY,EAAyB,MAAM,eAAe,CAAC;AAC/E,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,qBAAqB,EAA0B,MAAM,+BAA+B,CAAC;AAEnH,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;;AAErE;;;;;;;;;;;;;GAaG;AACH,qBAMa,qBAAsB,SAAQ,oBAAoB;IAC7C,UAAU,EAAE,YAAY,CAAsB;IAC9C,UAAU,EAAE,MAAM,GAAG,IAAI,CAAM;IAC/B,eAAe,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAM;IAE7D,YAAY,EAAE,YAAY,CAAC,IAAI,CAAC,CAA4B;IAC5D,WAAW,EAAE,YAAY,CAAC,UAAU,CAAC,CAAkC;IACxF,wFAAwF;IACvE,eAAe,EAAE,YAAY,CAAC,IAAI,CAAC,CAA4B;IAEhF,OAAO,CAAC,iBAAiB,CAA6B;IACtD,OAAO,CAAC,aAAa,CAAyB;IAC9C,OAAO,CAAC,aAAa,CAAkC;IACvD,OAAO,CAAC,mBAAmB,CAA6B;IAExD,uEAAuE;IACvE,cAAc,IAAI,IAAI;IAItB,uEAAuE;IACvE,aAAa,CAAC,MAAM,EAAE,UAAU,GAAG,IAAI;IAMvC,OAAO,CAAC,MAAM,EAAE,UAAU,GAAG,IAAI;IAIjC,cAAc,CAAC,KAAK,EAAE,qBAAqB,GAAG,IAAI;IAIlD,4EAA4E;IAC5E,gBAAgB,CAAC,KAAK,EAAE,mBAAmB,GAAG,IAAI;yCApCvC,qBAAqB;2CAArB,qBAAqB;CA4EjC"}