@acorex/platform 21.0.0-next.89 → 21.0.0-next.91

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 (58) hide show
  1. package/fesm2022/acorex-platform-auth.mjs +1 -1
  2. package/fesm2022/acorex-platform-auth.mjs.map +1 -1
  3. package/fesm2022/acorex-platform-common-common-settings.provider-DilV4dql.mjs.map +1 -1
  4. package/fesm2022/acorex-platform-common.mjs +3 -10
  5. package/fesm2022/acorex-platform-common.mjs.map +1 -1
  6. package/fesm2022/acorex-platform-contracts.mjs +1737 -27
  7. package/fesm2022/acorex-platform-contracts.mjs.map +1 -1
  8. package/fesm2022/acorex-platform-core.mjs +28 -1712
  9. package/fesm2022/acorex-platform-core.mjs.map +1 -1
  10. package/fesm2022/acorex-platform-domain-contracts.mjs.map +1 -1
  11. package/fesm2022/acorex-platform-layout-builder.mjs.map +1 -1
  12. package/fesm2022/acorex-platform-layout-components.mjs +3 -3
  13. package/fesm2022/acorex-platform-layout-components.mjs.map +1 -1
  14. package/fesm2022/acorex-platform-layout-designer.mjs.map +1 -1
  15. package/fesm2022/acorex-platform-layout-entity-attachments-page.component-CwG6n_Yb.mjs.map +1 -1
  16. package/fesm2022/acorex-platform-layout-entity-contracts.mjs +27 -1
  17. package/fesm2022/acorex-platform-layout-entity-contracts.mjs.map +1 -1
  18. package/fesm2022/acorex-platform-layout-entity-file-list-popup.component--IeMZLIr.mjs.map +1 -1
  19. package/fesm2022/acorex-platform-layout-entity.mjs +355 -122
  20. package/fesm2022/acorex-platform-layout-entity.mjs.map +1 -1
  21. package/fesm2022/acorex-platform-layout-views.mjs +77 -16
  22. package/fesm2022/acorex-platform-layout-views.mjs.map +1 -1
  23. package/fesm2022/acorex-platform-layout-widget-core.mjs +89 -11
  24. package/fesm2022/acorex-platform-layout-widget-core.mjs.map +1 -1
  25. package/fesm2022/acorex-platform-layout-widgets-page-widget-designer.component-D10yO28c.mjs.map +1 -1
  26. package/fesm2022/acorex-platform-layout-widgets-repeater-widget-column.component-CFyfix31.mjs.map +1 -1
  27. package/fesm2022/{acorex-platform-layout-widgets-tabular-data-edit-popup.component-CZc2zFlg.mjs → acorex-platform-layout-widgets-tabular-data-edit-popup.component-BvFykMTH.mjs} +2 -2
  28. package/fesm2022/acorex-platform-layout-widgets-tabular-data-edit-popup.component-BvFykMTH.mjs.map +1 -0
  29. package/fesm2022/{acorex-platform-layout-widgets-tabular-data-view-popup.component-XWRUVoL4.mjs → acorex-platform-layout-widgets-tabular-data-view-popup.component-CntopmDS.mjs} +2 -2
  30. package/fesm2022/{acorex-platform-layout-widgets-tabular-data-view-popup.component-XWRUVoL4.mjs.map → acorex-platform-layout-widgets-tabular-data-view-popup.component-CntopmDS.mjs.map} +1 -1
  31. package/fesm2022/acorex-platform-layout-widgets.mjs +5 -7
  32. package/fesm2022/acorex-platform-layout-widgets.mjs.map +1 -1
  33. package/fesm2022/acorex-platform-runtime.mjs.map +1 -1
  34. package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-CWLfNqV0.mjs.map +1 -1
  35. package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-C7cT82K2.mjs.map +1 -1
  36. package/fesm2022/acorex-platform-themes-default-entity-master-single-view.component-DrUwqKKA.mjs.map +1 -1
  37. package/fesm2022/acorex-platform-themes-default.mjs +15 -5
  38. package/fesm2022/acorex-platform-themes-default.mjs.map +1 -1
  39. package/fesm2022/{acorex-platform-themes-shared-settings.provider-UyKdkeyk.mjs → acorex-platform-themes-shared-settings.provider-DxtfyNGS.mjs} +2 -2
  40. package/fesm2022/acorex-platform-themes-shared-settings.provider-DxtfyNGS.mjs.map +1 -0
  41. package/fesm2022/acorex-platform-themes-shared.mjs +2 -2
  42. package/fesm2022/acorex-platform-workflow.mjs +2 -2
  43. package/fesm2022/acorex-platform-workflow.mjs.map +1 -1
  44. package/package.json +1 -1
  45. package/types/acorex-platform-common.d.ts +3 -5
  46. package/types/acorex-platform-contracts.d.ts +863 -7
  47. package/types/acorex-platform-core.d.ts +65 -922
  48. package/types/acorex-platform-layout-builder.d.ts +3 -3
  49. package/types/acorex-platform-layout-components.d.ts +6 -6
  50. package/types/acorex-platform-layout-designer.d.ts +4 -5
  51. package/types/acorex-platform-layout-entity-contracts.d.ts +94 -3
  52. package/types/acorex-platform-layout-entity.d.ts +72 -103
  53. package/types/acorex-platform-layout-views.d.ts +19 -12
  54. package/types/acorex-platform-layout-widget-core.d.ts +89 -77
  55. package/types/acorex-platform-layout-widgets.d.ts +9 -8
  56. package/types/acorex-platform-themes-default.d.ts +4 -1
  57. package/fesm2022/acorex-platform-layout-widgets-tabular-data-edit-popup.component-CZc2zFlg.mjs.map +0 -1
  58. package/fesm2022/acorex-platform-themes-shared-settings.provider-UyKdkeyk.mjs.map +0 -1
@@ -12,9 +12,9 @@ import { AXDecoratorModule } from '@acorex/components/decorators';
12
12
  import * as i5 from '@acorex/components/dropdown';
13
13
  import { AXDropdownModule } from '@acorex/components/dropdown';
14
14
  import { AXDropdownButtonModule } from '@acorex/components/dropdown-button';
15
- import { AXPTabNavigationService, AXPStickyDirective, AXPCommonSettings, AXPHomePageService, AXPSettingsService, AXPTabPreviewService, AXPUnsavedChangesConfirmService, AXPBrowserTitleService, axpJoinTabTitleSegments, normalizeRouterUrl, AXP_HOME_TAB_KEY, axpResolveTabKey, axpIsEntityDetailsViewRoute, axpNavigateAppPath, AXPEntityCommandScope, AXPNotFoundError, AXP_NOT_FOUND_ROUTE, AXPUnsavedChangesPopstateService, AXP_ENTITY_DELETED_WORKFLOW_EVENT_TYPE, createUnsavedChangesCanDeactivateGuard } from '@acorex/platform/common';
15
+ import { AXPTabNavigationService, AXPStickyDirective, AXPCommonSettings, AXPHomePageService, AXPSettingsService, AXPTabPreviewService, AXPUnsavedChangesConfirmService, AXPBrowserTitleService, axpJoinTabTitleSegments, normalizeRouterUrl, AXP_HOME_TAB_KEY, axpResolveTabKey, axpIsEntityDetailsViewRoute, axpNavigateAppPath, AXPNotFoundError, AXP_NOT_FOUND_ROUTE, AXPUnsavedChangesPopstateService, AXP_ENTITY_DELETED_WORKFLOW_EVENT_TYPE, createUnsavedChangesCanDeactivateGuard } from '@acorex/platform/common';
16
16
  import * as i8 from '@acorex/platform/core';
17
- import { AXPDeviceService, AXPComponentSlotModule, getSmart, AXPDebugService, OVERLAY_DETAILS_VIEW_TRACE_NS, AXPExpressionEvaluatorService, AXPContextEvalFactory, normalizeKeyboardShortcuts, AXPContextStore, AXPBroadcastEventService, AXPKeyboardShortcutRegistry, FORM_DIRTY_TRACE_NS, summarizeFormContextDirtyDiff, AXPKeyboardShortcutPriority } from '@acorex/platform/core';
17
+ import { AXPDeviceService, AXPComponentSlotModule, AXPDebugService, OVERLAY_DETAILS_VIEW_TRACE_NS, AXPExpressionEvaluatorService, AXPContextEvalFactory, normalizeKeyboardShortcuts, AXPContextStore, AXPBroadcastEventService, AXPKeyboardShortcutRegistry, FORM_DIRTY_TRACE_NS, AXPKeyboardShortcutPriority } from '@acorex/platform/core';
18
18
  import * as i1 from '@acorex/cdk/drawer';
19
19
  import { AXDrawerDirectiveModule, AXDrawerContainerDirective } from '@acorex/cdk/drawer';
20
20
  import { AXDrawerModule } from '@acorex/components/drawer';
@@ -33,6 +33,8 @@ import { Router, NavigationEnd, ActivatedRoute } from '@angular/router';
33
33
  import { isEmpty, cloneDeep, get } from 'lodash-es';
34
34
  import { filter } from 'rxjs/operators';
35
35
  import { AXBasePageComponent } from '@acorex/components/page';
36
+ import { AXPEntityCommandScope } from '@acorex/platform/layout/entity-contracts';
37
+ import { getSmart, summarizeFormContextDirtyDiff } from '@acorex/platform/contracts';
36
38
  import * as i6$1 from '@acorex/platform/layout/widget-core';
37
39
  import { AXPPageStatus, AXPWidgetContainerComponent, AXPWidgetCoreModule } from '@acorex/platform/layout/widget-core';
38
40
  import { signalStore, withState, withComputed, withMethods, patchState } from '@ngrx/signals';
@@ -1051,6 +1053,7 @@ const AXPLayoutDetailsViewViewModel = signalStore(withState(() => {
1051
1053
  evaluatedPageContent,
1052
1054
  evaluatedTabContentsById,
1053
1055
  formDirty: false,
1056
+ pageSelectedRows: [],
1054
1057
  });
1055
1058
  AXPDebugService.instance?.trace(OVERLAY_DETAILS_VIEW_TRACE_NS, 'viewmodel', 'activatePage VM ready (Rendered)', () => ({
1056
1059
  pageId: currentPage?.id,
@@ -1864,6 +1867,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
1864
1867
  }]
1865
1868
  }], propDecorators: { componentKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "componentKey", required: true }] }], rootContext: [{ type: i0.Input, args: [{ isSignal: true, alias: "rootContext", required: false }] }], pageConfig: [{ type: i0.Input, args: [{ isSignal: true, alias: "pageConfig", required: false }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], componentReady: [{ type: i0.Output, args: ["componentReady"] }] } });
1866
1869
 
1870
+ /** Registered id of the data-list inside related-entity `page-list` sidebar pages. */
1871
+ const PAGE_LIST_TABLE_WIDGET_ID = 'page-list_table';
1867
1872
  class AXPLayoutDetailsViewComponent extends AXPPageLayoutBaseComponent {
1868
1873
  constructor() {
1869
1874
  super(...arguments);
@@ -1879,6 +1884,8 @@ class AXPLayoutDetailsViewComponent extends AXPPageLayoutBaseComponent {
1879
1884
  this.destroyRef = inject(DestroyRef);
1880
1885
  this.elementRef = inject((ElementRef));
1881
1886
  this.debug = inject(AXPDebugService);
1887
+ /** Cancels in-flight list selection bind when the sidebar page or widget tree changes. */
1888
+ this.pageListSelectionBindGeneration = 0;
1882
1889
  /** Prevents sidebar tab init events from pushing history before the first page activation completes. */
1883
1890
  this.detailsLayoutReady = signal(false, ...(ngDevMode ? [{ debugName: "detailsLayoutReady" }] : /* istanbul ignore next */ []));
1884
1891
  this.destroyed$ = new Subject();
@@ -1922,6 +1929,42 @@ class AXPLayoutDetailsViewComponent extends AXPPageLayoutBaseComponent {
1922
1929
  }
1923
1930
  }));
1924
1931
  }, ...(ngDevMode ? [{ debugName: "#sidebarTabsIndicatorEffect" }] : /* istanbul ignore next */ []));
1932
+ /**
1933
+ * Binds list selection whenever `page-list_table` registers (including after remount).
1934
+ * `find()` / `waitForWidget()` can return a destroyed instance; registration always carries the live widget.
1935
+ */
1936
+ this.#pageListSelectionBindEffect = effect((onCleanup) => {
1937
+ const pageId = this.vm.currentPage()?.id;
1938
+ const isPageReady = this.vm.isPageReady();
1939
+ if (!pageId || this.vm.showPages() || !isPageReady || this.getActivePageComponentKey()) {
1940
+ return;
1941
+ }
1942
+ this.vm.currentPageContent();
1943
+ if (!this.pageHasEntityListWidget()) {
1944
+ return;
1945
+ }
1946
+ const generation = ++this.pageListSelectionBindGeneration;
1947
+ const container = this.widgetContainer();
1948
+ if (!container) {
1949
+ return;
1950
+ }
1951
+ const builder = container.builderService;
1952
+ onCleanup(() => {
1953
+ this.onSelectionChangeSubscription?.unsubscribe();
1954
+ this.onSelectionChangeSubscription = undefined;
1955
+ });
1956
+ const registrationSub = builder.widgetRegistered$.subscribe(({ id, widget }) => {
1957
+ if (id !== PAGE_LIST_TABLE_WIDGET_ID) {
1958
+ return;
1959
+ }
1960
+ this.attachSelectionToListWidget(pageId, generation, widget);
1961
+ });
1962
+ onCleanup(() => registrationSub.unsubscribe());
1963
+ const existing = builder.getWidget(PAGE_LIST_TABLE_WIDGET_ID);
1964
+ if (existing) {
1965
+ untracked(() => this.attachSelectionToListWidget(pageId, generation, existing));
1966
+ }
1967
+ }, ...(ngDevMode ? [{ debugName: "#pageListSelectionBindEffect" }] : /* istanbul ignore next */ []));
1925
1968
  /** Clears the page overlay reactively once VM + widget hydration are both idle. */
1926
1969
  this.#overlayReleaseEffect = effect(() => {
1927
1970
  const showPages = this.vm.showPages();
@@ -2152,6 +2195,11 @@ class AXPLayoutDetailsViewComponent extends AXPPageLayoutBaseComponent {
2152
2195
  }
2153
2196
  /** Syncs the line indicator when the active page changes programmatically. */
2154
2197
  #sidebarTabsIndicatorEffect;
2198
+ /**
2199
+ * Binds list selection whenever `page-list_table` registers (including after remount).
2200
+ * `find()` / `waitForWidget()` can return a destroyed instance; registration always carries the live widget.
2201
+ */
2202
+ #pageListSelectionBindEffect;
2155
2203
  /** Clears the page overlay reactively once VM + widget hydration are both idle. */
2156
2204
  #overlayReleaseEffect;
2157
2205
  isSaveDiscardFooterAction(action) {
@@ -2251,18 +2299,6 @@ class AXPLayoutDetailsViewComponent extends AXPPageLayoutBaseComponent {
2251
2299
  }
2252
2300
  await this.vm.goToListPage();
2253
2301
  }
2254
- async ngAfterViewInit() {
2255
- const listWidget = (await this.widgetContainer()?.find('page-list_table'));
2256
- if (listWidget?.api && typeof listWidget.api === 'function') {
2257
- const onSelectionChange = listWidget.api()['onSelectionChange'];
2258
- if (onSelectionChange) {
2259
- this.onSelectionChangeSubscription = onSelectionChange.subscribe((e) => {
2260
- this.vm.updatePageSelectedRows(e);
2261
- this.recompute();
2262
- });
2263
- }
2264
- }
2265
- }
2266
2302
  ngOnDestroy() {
2267
2303
  this.onSelectionChangeSubscription?.unsubscribe();
2268
2304
  ++this.keyboardShortcutRegistrationGeneration;
@@ -2289,6 +2325,30 @@ class AXPLayoutDetailsViewComponent extends AXPPageLayoutBaseComponent {
2289
2325
  this.footerPrimaryActions.set(footerPrimaryActions);
2290
2326
  this.footerSecondaryActions.set(footerSecondaryActions);
2291
2327
  }
2328
+ /** Whether the active page hosts a related-entity list (`page-list` widget). */
2329
+ pageHasEntityListWidget() {
2330
+ return this.vm.currentPageContent().some((item) => {
2331
+ if ('type' in item && item.type === 'component') {
2332
+ return false;
2333
+ }
2334
+ return item.name === 'page-list';
2335
+ });
2336
+ }
2337
+ /** Subscribes to the live data-list selection stream for Selected-scope header actions. */
2338
+ attachSelectionToListWidget(pageId, generation, widget) {
2339
+ if (generation !== this.pageListSelectionBindGeneration || this.vm.currentPage()?.id !== pageId) {
2340
+ return;
2341
+ }
2342
+ const selectionStream = widget.api()['onSelectionChange'];
2343
+ if (!selectionStream || typeof selectionStream.subscribe !== 'function') {
2344
+ return;
2345
+ }
2346
+ this.onSelectionChangeSubscription?.unsubscribe();
2347
+ this.onSelectionChangeSubscription = selectionStream.subscribe((rows) => {
2348
+ this.vm.updatePageSelectedRows(rows);
2349
+ this.recompute();
2350
+ });
2351
+ }
2292
2352
  handleOnContextChanged(e) {
2293
2353
  if (!this.vm.currentPage()?.isReadonly &&
2294
2354
  !this.getActivePageComponentKey() &&
@@ -2645,10 +2705,11 @@ class AXPLayoutDetailsViewComponent extends AXPPageLayoutBaseComponent {
2645
2705
  return 'type' in item && item.type === 'component';
2646
2706
  }
2647
2707
  pageContentTrackKey(item, index) {
2708
+ const pageId = this.vm.currentPage()?.id ?? 'unknown';
2648
2709
  if (AXPLayoutDetailsViewComponent.isComponentPageContent(item)) {
2649
- return `component:${item.componentKey}`;
2710
+ return `${pageId}:component:${item.componentKey}`;
2650
2711
  }
2651
- return item.name ?? `widget:${index}`;
2712
+ return `${pageId}:${item.name ?? `widget:${index}`}`;
2652
2713
  }
2653
2714
  /** Whether the active component-based entity page has unsaved edits. */
2654
2715
  isActivePageComponentDirty() {