@acorex-platform/framework-client 0.0.37 → 0.0.46

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 (104) hide show
  1. package/fesm2022/acorex-platform-framework-client-auth.mjs +212 -44
  2. package/fesm2022/acorex-platform-framework-client-auth.mjs.map +1 -1
  3. package/fesm2022/{acorex-platform-framework-client-common-common-settings.provider-CzBr0cRi.mjs → acorex-platform-framework-client-common-common-settings.provider-ChU2tvyt.mjs} +31 -1
  4. package/fesm2022/acorex-platform-framework-client-common-common-settings.provider-ChU2tvyt.mjs.map +1 -0
  5. package/fesm2022/acorex-platform-framework-client-common.mjs +848 -76
  6. package/fesm2022/acorex-platform-framework-client-common.mjs.map +1 -1
  7. package/fesm2022/acorex-platform-framework-client-core.mjs +273 -96
  8. package/fesm2022/acorex-platform-framework-client-core.mjs.map +1 -1
  9. package/fesm2022/acorex-platform-framework-client-layout-builder.mjs +292 -11
  10. package/fesm2022/acorex-platform-framework-client-layout-builder.mjs.map +1 -1
  11. package/fesm2022/{acorex-platform-framework-client-layout-components-binding-expression-editor-popup.component-Bp2cNCPO.mjs → acorex-platform-framework-client-layout-components-binding-expression-editor-popup.component-BqPaHKPM.mjs} +10 -6
  12. package/fesm2022/acorex-platform-framework-client-layout-components-binding-expression-editor-popup.component-BqPaHKPM.mjs.map +1 -0
  13. package/fesm2022/acorex-platform-framework-client-layout-components-property-viewer-inline-code-editor.component-CcpUTEVQ.mjs +66 -0
  14. package/fesm2022/acorex-platform-framework-client-layout-components-property-viewer-inline-code-editor.component-CcpUTEVQ.mjs.map +1 -0
  15. package/fesm2022/acorex-platform-framework-client-layout-components-resource-appointment-board.component-DCkpgsFH.mjs +195 -0
  16. package/fesm2022/acorex-platform-framework-client-layout-components-resource-appointment-board.component-DCkpgsFH.mjs.map +1 -0
  17. package/fesm2022/acorex-platform-framework-client-layout-components.mjs +3987 -1020
  18. package/fesm2022/acorex-platform-framework-client-layout-components.mjs.map +1 -1
  19. package/fesm2022/acorex-platform-framework-client-layout-designer.mjs +1179 -304
  20. package/fesm2022/acorex-platform-framework-client-layout-designer.mjs.map +1 -1
  21. package/fesm2022/{acorex-platform-framework-client-layout-entity-acorex-platform-framework-client-layout-entity-C74cBc-K.mjs → acorex-platform-framework-client-layout-entity-acorex-platform-framework-client-layout-entity-Dc_NpBx6.mjs} +1697 -323
  22. package/fesm2022/acorex-platform-framework-client-layout-entity-acorex-platform-framework-client-layout-entity-Dc_NpBx6.mjs.map +1 -0
  23. package/fesm2022/{acorex-platform-framework-client-layout-entity-attachments-page.component-B6nG9dIS.mjs → acorex-platform-framework-client-layout-entity-attachments-page.component-Cx-n7ZuA.mjs} +2 -2
  24. package/fesm2022/{acorex-platform-framework-client-layout-entity-attachments-page.component-B6nG9dIS.mjs.map → acorex-platform-framework-client-layout-entity-attachments-page.component-Cx-n7ZuA.mjs.map} +1 -1
  25. package/fesm2022/{acorex-platform-framework-client-layout-entity-bulk-entity.command-DLQA_Q2Y.mjs → acorex-platform-framework-client-layout-entity-bulk-entity.command-BONV249y.mjs} +2 -2
  26. package/fesm2022/{acorex-platform-framework-client-layout-entity-bulk-entity.command-DLQA_Q2Y.mjs.map → acorex-platform-framework-client-layout-entity-bulk-entity.command-BONV249y.mjs.map} +1 -1
  27. package/fesm2022/{acorex-platform-framework-client-layout-entity-gallery-page.component-B4wC1iqZ.mjs → acorex-platform-framework-client-layout-entity-gallery-page.component-uTG2nFly.mjs} +2 -2
  28. package/fesm2022/{acorex-platform-framework-client-layout-entity-gallery-page.component-B4wC1iqZ.mjs.map → acorex-platform-framework-client-layout-entity-gallery-page.component-uTG2nFly.mjs.map} +1 -1
  29. package/fesm2022/acorex-platform-framework-client-layout-entity.mjs +1 -1
  30. package/fesm2022/acorex-platform-framework-client-layout-views.mjs +3 -3
  31. package/fesm2022/acorex-platform-framework-client-layout-views.mjs.map +1 -1
  32. package/fesm2022/acorex-platform-framework-client-layout-widget-core.mjs +3854 -3278
  33. package/fesm2022/acorex-platform-framework-client-layout-widget-core.mjs.map +1 -1
  34. package/fesm2022/acorex-platform-framework-client-layout-widgets-acorex-platform-framework-client-layout-widgets-CDpzvn6z.mjs +33191 -0
  35. package/fesm2022/acorex-platform-framework-client-layout-widgets-acorex-platform-framework-client-layout-widgets-CDpzvn6z.mjs.map +1 -0
  36. package/fesm2022/{acorex-platform-framework-client-layout-widgets-button-widget-designer.component-BDOdcoyN.mjs → acorex-platform-framework-client-layout-widgets-button-widget-designer.component-BkrPu1wO.mjs} +8 -5
  37. package/fesm2022/acorex-platform-framework-client-layout-widgets-button-widget-designer.component-BkrPu1wO.mjs.map +1 -0
  38. package/fesm2022/acorex-platform-framework-client-layout-widgets-code-editor-value.util-Cb7R1qLO.mjs +45 -0
  39. package/fesm2022/acorex-platform-framework-client-layout-widgets-code-editor-value.util-Cb7R1qLO.mjs.map +1 -0
  40. package/fesm2022/acorex-platform-framework-client-layout-widgets-code-editor-widget-column.component-BL621E1r.mjs +68 -0
  41. package/fesm2022/acorex-platform-framework-client-layout-widgets-code-editor-widget-column.component-BL621E1r.mjs.map +1 -0
  42. package/fesm2022/acorex-platform-framework-client-layout-widgets-code-editor-widget-edit.component-CVsPKhNl.mjs +88 -0
  43. package/fesm2022/acorex-platform-framework-client-layout-widgets-code-editor-widget-edit.component-CVsPKhNl.mjs.map +1 -0
  44. package/fesm2022/acorex-platform-framework-client-layout-widgets-code-editor-widget-view.component-BEq4O4al.mjs +71 -0
  45. package/fesm2022/acorex-platform-framework-client-layout-widgets-code-editor-widget-view.component-BEq4O4al.mjs.map +1 -0
  46. package/fesm2022/acorex-platform-framework-client-layout-widgets-condition-builder-edit-popup.component-WpiEHusZ.mjs +81 -0
  47. package/fesm2022/acorex-platform-framework-client-layout-widgets-condition-builder-edit-popup.component-WpiEHusZ.mjs.map +1 -0
  48. package/fesm2022/{acorex-platform-framework-client-layout-widgets-page-widget-designer.component-WzIiwnGC.mjs → acorex-platform-framework-client-layout-widgets-page-widget-designer.component-Cadl6guA.mjs} +41 -23
  49. package/fesm2022/acorex-platform-framework-client-layout-widgets-page-widget-designer.component-Cadl6guA.mjs.map +1 -0
  50. package/fesm2022/{acorex-platform-framework-client-layout-widgets-repeater-widget-column.component-4mX8aYzA.mjs → acorex-platform-framework-client-layout-widgets-repeater-widget-column.component-Cw3NhWL8.mjs} +3 -3
  51. package/fesm2022/{acorex-platform-framework-client-layout-widgets-repeater-widget-column.component-4mX8aYzA.mjs.map → acorex-platform-framework-client-layout-widgets-repeater-widget-column.component-Cw3NhWL8.mjs.map} +1 -1
  52. package/fesm2022/acorex-platform-framework-client-layout-widgets-scheduler-picker-widget-column.component-Clb27Loe.mjs +71 -0
  53. package/fesm2022/acorex-platform-framework-client-layout-widgets-scheduler-picker-widget-column.component-Clb27Loe.mjs.map +1 -0
  54. package/fesm2022/acorex-platform-framework-client-layout-widgets-scheduler-picker-widget-edit.component-l7q8A-D3.mjs +111 -0
  55. package/fesm2022/acorex-platform-framework-client-layout-widgets-scheduler-picker-widget-edit.component-l7q8A-D3.mjs.map +1 -0
  56. package/fesm2022/acorex-platform-framework-client-layout-widgets-scheduler-picker-widget-view.component-Cc1AH09b.mjs +77 -0
  57. package/fesm2022/acorex-platform-framework-client-layout-widgets-scheduler-picker-widget-view.component-Cc1AH09b.mjs.map +1 -0
  58. package/fesm2022/{acorex-platform-framework-client-layout-widgets-tabular-data-edit-popup.component-TWxthl21.mjs → acorex-platform-framework-client-layout-widgets-tabular-data-edit-popup.component-BCLxS3rS.mjs} +3 -3
  59. package/fesm2022/{acorex-platform-framework-client-layout-widgets-tabular-data-edit-popup.component-TWxthl21.mjs.map → acorex-platform-framework-client-layout-widgets-tabular-data-edit-popup.component-BCLxS3rS.mjs.map} +1 -1
  60. package/fesm2022/{acorex-platform-framework-client-layout-widgets-text-block-widget-designer.component-D6HFPmGC.mjs → acorex-platform-framework-client-layout-widgets-text-block-widget-designer.component-BEa-vD6O.mjs} +21 -8
  61. package/fesm2022/acorex-platform-framework-client-layout-widgets-text-block-widget-designer.component-BEa-vD6O.mjs.map +1 -0
  62. package/fesm2022/acorex-platform-framework-client-layout-widgets-trigger-expression-editor-popup.component-C2PGoC7r.mjs +124 -0
  63. package/fesm2022/acorex-platform-framework-client-layout-widgets-trigger-expression-editor-popup.component-C2PGoC7r.mjs.map +1 -0
  64. package/fesm2022/acorex-platform-framework-client-layout-widgets-triggers-widget-editor.component-DDDoPoQa.mjs +345 -0
  65. package/fesm2022/acorex-platform-framework-client-layout-widgets-triggers-widget-editor.component-DDDoPoQa.mjs.map +1 -0
  66. package/fesm2022/acorex-platform-framework-client-layout-widgets.mjs +1 -31985
  67. package/fesm2022/acorex-platform-framework-client-layout-widgets.mjs.map +1 -1
  68. package/fesm2022/acorex-platform-framework-client-realtime.mjs +2 -1
  69. package/fesm2022/acorex-platform-framework-client-realtime.mjs.map +1 -1
  70. package/fesm2022/acorex-platform-framework-client-runtime.mjs +47 -3
  71. package/fesm2022/acorex-platform-framework-client-runtime.mjs.map +1 -1
  72. package/fesm2022/{acorex-platform-framework-client-themes-default-entity-master-single-view.component-DBUwSzvg.mjs → acorex-platform-framework-client-themes-default-entity-master-single-view.component-CHLsBvBE.mjs} +2 -2
  73. package/fesm2022/{acorex-platform-framework-client-themes-default-entity-master-single-view.component-DBUwSzvg.mjs.map → acorex-platform-framework-client-themes-default-entity-master-single-view.component-CHLsBvBE.mjs.map} +1 -1
  74. package/fesm2022/acorex-platform-framework-client-themes-default.mjs +373 -70
  75. package/fesm2022/acorex-platform-framework-client-themes-default.mjs.map +1 -1
  76. package/fesm2022/{acorex-platform-framework-client-themes-shared-settings.provider-CpsAIsxj.mjs → acorex-platform-framework-client-themes-shared-settings.provider-DIkjSTU7.mjs} +102 -1
  77. package/fesm2022/acorex-platform-framework-client-themes-shared-settings.provider-DIkjSTU7.mjs.map +1 -0
  78. package/fesm2022/acorex-platform-framework-client-themes-shared.mjs +174 -22
  79. package/fesm2022/acorex-platform-framework-client-themes-shared.mjs.map +1 -1
  80. package/package.json +2 -2
  81. package/realtime/README.md +1 -1
  82. package/types/acorex-platform-framework-client-auth.d.ts +18 -1
  83. package/types/acorex-platform-framework-client-common.d.ts +209 -8
  84. package/types/acorex-platform-framework-client-core.d.ts +166 -121
  85. package/types/acorex-platform-framework-client-layout-builder.d.ts +29 -0
  86. package/types/acorex-platform-framework-client-layout-components.d.ts +699 -146
  87. package/types/acorex-platform-framework-client-layout-designer.d.ts +192 -14
  88. package/types/acorex-platform-framework-client-layout-entity.d.ts +159 -91
  89. package/types/acorex-platform-framework-client-layout-views.d.ts +16 -0
  90. package/types/acorex-platform-framework-client-layout-widget-core.d.ts +140 -37
  91. package/types/acorex-platform-framework-client-layout-widgets.d.ts +235 -117
  92. package/types/acorex-platform-framework-client-realtime.d.ts +16 -3
  93. package/types/acorex-platform-framework-client-runtime.d.ts +8 -0
  94. package/types/acorex-platform-framework-client-themes-default.d.ts +62 -11
  95. package/types/acorex-platform-framework-client-themes-shared.d.ts +25 -2
  96. package/fesm2022/acorex-platform-framework-client-common-common-settings.provider-CzBr0cRi.mjs.map +0 -1
  97. package/fesm2022/acorex-platform-framework-client-layout-components-binding-expression-editor-popup.component-Bp2cNCPO.mjs.map +0 -1
  98. package/fesm2022/acorex-platform-framework-client-layout-components-file-provider-picker.popup.component-BtLEUWAA.mjs +0 -77
  99. package/fesm2022/acorex-platform-framework-client-layout-components-file-provider-picker.popup.component-BtLEUWAA.mjs.map +0 -1
  100. package/fesm2022/acorex-platform-framework-client-layout-entity-acorex-platform-framework-client-layout-entity-C74cBc-K.mjs.map +0 -1
  101. package/fesm2022/acorex-platform-framework-client-layout-widgets-button-widget-designer.component-BDOdcoyN.mjs.map +0 -1
  102. package/fesm2022/acorex-platform-framework-client-layout-widgets-page-widget-designer.component-WzIiwnGC.mjs.map +0 -1
  103. package/fesm2022/acorex-platform-framework-client-layout-widgets-text-block-widget-designer.component-D6HFPmGC.mjs.map +0 -1
  104. package/fesm2022/acorex-platform-framework-client-themes-shared-settings.provider-CpsAIsxj.mjs.map +0 -1
@@ -3,10 +3,10 @@ import { CommonModule, DOCUMENT } from '@angular/common';
3
3
  import * as i0 from '@angular/core';
4
4
  import { Injectable, inject, input, model, signal, computed, effect, output, viewChild, ChangeDetectionStrategy, Component, NgModule, EventEmitter, ElementRef, DestroyRef, untracked, Output } from '@angular/core';
5
5
  import * as i4 from '@acorex-platform/framework-client/core';
6
- import { AXPHookService, resolveDialogActionShortcuts, DEFAULT_CANCEL_DIALOG_ACTION_SHORTCUTS, DEFAULT_SUBMIT_DIALOG_ACTION_SHORTCUTS, AXP_SETTINGS_DEFINITION_DIALOG_OPENER, findOverlayContainerAncestor, getNestedVisibleOverlayPanes, getTopVisibleOverlayContainer, AXPExpressionEvaluatorService, AXPKeyboardShortcutRegistry, normalizeDialogActionShortcutChord, isDialogShortcutAllowedInEditableField, resolveConfiguredFooterActionShortcuts, AXPComponentSlotModule, AXPContextStore } from '@acorex-platform/framework-client/core';
6
+ import { AXPHookService, resolveDialogActionShortcuts, DEFAULT_CANCEL_DIALOG_ACTION_SHORTCUTS, DEFAULT_SUBMIT_DIALOG_ACTION_SHORTCUTS, AXP_SETTINGS_DEFINITION_DIALOG_OPENER, findOverlayContainerAncestor, getNestedVisibleOverlayPanes, getTopVisibleOverlayContainer, AXPExpressionEvaluatorService, AXPKeyboardShortcutRegistry, AXPDebugService, normalizeDialogActionShortcutChord, isDialogShortcutAllowedInEditableField, resolveConfiguredFooterActionShortcuts, AXPComponentSlotModule, AXPContextStore } from '@acorex-platform/framework-client/core';
7
7
  export { DEFAULT_CANCEL_DIALOG_ACTION_SHORTCUTS, DEFAULT_SUBMIT_DIALOG_ACTION_SHORTCUTS } from '@acorex-platform/framework-client/core';
8
8
  import { provideCommandSetups, AXPCommandService } from '@acorex-platform/framework-client/runtime';
9
- import { AXP_PREVIEW_WIDGET_FIELD_COMMAND_KEY, createRandomUuid, AXPKeyboardShortcutPriority } from '@acorex-platform/framework-shared/core';
9
+ import { AXP_PREVIEW_WIDGET_FIELD_COMMAND_KEY, AXPWidgetsList, AXPWidgetsCatalog, createRandomUuid, AXPKeyboardShortcutPriority } from '@acorex-platform/framework-shared/core';
10
10
  import { AXPopupService } from '@acorex/components/popup';
11
11
  import * as i1 from '@acorex-platform/framework-client/layout/widget-core';
12
12
  import { AXPWidgetSerializationHelper, AXPWidgetContainerComponent, AXPWidgetCoreModule, AXPWidgetRegistryService } from '@acorex-platform/framework-client/layout/widget-core';
@@ -22,6 +22,7 @@ import * as i2$1 from '@acorex/components/decorators';
22
22
  import { AXDecoratorModule } from '@acorex/components/decorators';
23
23
  import * as i3 from '@acorex/components/loading';
24
24
  import { AXLoadingModule } from '@acorex/components/loading';
25
+ import { AXLoadingDialogService } from '@acorex/components/loading-dialog';
25
26
  import { AXBasePageComponent } from '@acorex/components/page';
26
27
  import { AXToastService } from '@acorex/components/toast';
27
28
  import * as i6 from '@acorex/core/translation';
@@ -375,6 +376,83 @@ function normalizeDialogCloseConfirmation(value) {
375
376
  }
376
377
  //#endregion
377
378
 
379
+ /** Panel class on the popup overlay container; the reveal styles live in the host app. */
380
+ const AXP_DIALOG_REVEAL_PANEL_CLASS = 'axp-dialog-reveal';
381
+ /** Entry is owned by the panel class, so the overlay must not add its own fade-in. */
382
+ const AXP_DIALOG_REVEAL_POPUP_ANIMATION = { enter: [] };
383
+ /** Added once layout has settled so the reveal animation can play. */
384
+ const READY_CLASS = 'axp-dialog-reveal-ready';
385
+ /** The popup must keep the same size for this long before it counts as settled. */
386
+ const AXP_DIALOG_REVEAL_RESIZE_STABLE_MS = 320;
387
+ /** Upper bound for the stability wait (heavy entity step wizards). */
388
+ const RESIZE_WAIT_MAX_MS = 2800;
389
+ /** Resolves once the popup shell stops resizing (widgets, footer chrome, step content). */
390
+ function waitForDialogPopupLayoutStable(from) {
391
+ const popup = from.closest('.ax-popup');
392
+ if (!(popup instanceof HTMLElement)) {
393
+ return Promise.resolve();
394
+ }
395
+ return new Promise((resolve) => {
396
+ let quietTimer;
397
+ const finish = () => {
398
+ clearTimeout(quietTimer);
399
+ clearTimeout(maxWaitTimer);
400
+ observer.disconnect();
401
+ resolve();
402
+ };
403
+ const restartQuietWindow = () => {
404
+ clearTimeout(quietTimer);
405
+ quietTimer = setTimeout(finish, AXP_DIALOG_REVEAL_RESIZE_STABLE_MS);
406
+ };
407
+ const maxWaitTimer = setTimeout(finish, RESIZE_WAIT_MAX_MS);
408
+ const observer = new ResizeObserver(restartQuietWindow);
409
+ observer.observe(popup);
410
+ restartQuietWindow();
411
+ });
412
+ }
413
+ const FIRST_FOCUSABLE_FIELD_SELECTOR = [
414
+ 'input:not([type="hidden"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([disabled]):not([tabindex="-1"])',
415
+ 'textarea:not([disabled]):not([tabindex="-1"])',
416
+ 'select:not([disabled]):not([tabindex="-1"])',
417
+ '[contenteditable="true"]:not([tabindex="-1"])',
418
+ ].join(', ');
419
+ /** Reveals the popup shell that the panel class kept hidden, then focuses the first field. */
420
+ function markDialogRevealReady(from) {
421
+ from.closest(`.${AXP_DIALOG_REVEAL_PANEL_CLASS}`)?.classList.add(READY_CLASS);
422
+ focusFirstPopupField(from);
423
+ }
424
+ /**
425
+ * Focuses the first visible field in the popup body.
426
+ * Runs after reveal: the shell focus from the popup library happens while the overlay is still hidden.
427
+ */
428
+ function focusFirstPopupField(from) {
429
+ const popup = from.closest('.ax-popup');
430
+ if (!(popup instanceof HTMLElement)) {
431
+ return;
432
+ }
433
+ setTimeout(() => {
434
+ const body = popup.querySelector('.ax-popup-body-container');
435
+ if (!(body instanceof HTMLElement)) {
436
+ return;
437
+ }
438
+ const field = Array.from(body.querySelectorAll(FIRST_FOCUSABLE_FIELD_SELECTOR)).find(isVisibleFocusTarget);
439
+ (field ?? popup).focus();
440
+ });
441
+ }
442
+ function isVisibleFocusTarget(element) {
443
+ if (element.closest('[hidden], [aria-hidden="true"]')) {
444
+ return false;
445
+ }
446
+ if (element.getAttribute('aria-disabled') === 'true') {
447
+ return false;
448
+ }
449
+ const style = getComputedStyle(element);
450
+ if (style.display === 'none' || style.visibility === 'hidden' || Number(style.opacity) === 0) {
451
+ return false;
452
+ }
453
+ return element.getClientRects().length > 0;
454
+ }
455
+
378
456
  //#region ---- Inheritance Utilities ----
379
457
  /**
380
458
  * Resolves inherited properties from context and local values
@@ -1640,6 +1718,9 @@ class DialogContainerBuilder {
1640
1718
  setCloseButton(closeButton) {
1641
1719
  return this.setOptions({ closeButton });
1642
1720
  }
1721
+ setDraggable(draggable) {
1722
+ return this.setOptions({ draggable });
1723
+ }
1643
1724
  setContext(context) {
1644
1725
  return this.setOptions({ context });
1645
1726
  }
@@ -1761,7 +1842,9 @@ class DialogContainerBuilder {
1761
1842
  size: this.dialogState.dialogOptions?.size || 'md',
1762
1843
  closeButton: this.dialogState.dialogOptions?.closeButton || false,
1763
1844
  closeOnBackdropClick: false,
1764
- draggable: false,
1845
+ draggable: this.dialogState.dialogOptions?.draggable ?? true,
1846
+ panelClass: [AXP_DIALOG_REVEAL_PANEL_CLASS],
1847
+ animation: AXP_DIALOG_REVEAL_POPUP_ANIMATION,
1765
1848
  data: {
1766
1849
  config: dialogConfig,
1767
1850
  callBack: (result) => {
@@ -2634,8 +2717,121 @@ function shouldDeferDialogShortcutsToNestedOverlay(document, dialogHost, overlay
2634
2717
  return shouldDeferEscapeToNestedOverlayFromDom(document, dialogHost);
2635
2718
  }
2636
2719
 
2720
+ //#endregion
2721
+ //#region ----- Constants -----
2722
+ const SHELL_MS = 90;
2723
+ const MIN_MS = 80;
2724
+ const MAX_MS = 5000;
2725
+ const FIELD_MS = 7;
2726
+ const HEAVY_MS = 70;
2727
+ const CONTAINER_MS = 2;
2728
+ const TAB_MS = 3;
2729
+ const NETWORK_FIRST_MS = 200;
2730
+ const NETWORK_EACH_MS = 20;
2731
+ /** Widgets that fetch on init without a `dataSource` option. */
2732
+ const FETCH_WITHOUT_DATASOURCE = new Set([
2733
+ AXPWidgetsList.Editors.LookupBox,
2734
+ AXPWidgetsList.Editors.TagEditor,
2735
+ AXPWidgetsList.Editors.EntityCategory,
2736
+ AXPWidgetsList.Editors.MultiSourceSelector,
2737
+ AXPWidgetsList.Entity.EntityList,
2738
+ ]);
2739
+ /** Widgets that are expensive to instantiate even with no network. */
2740
+ const HEAVY_RENDER = new Set([
2741
+ AXPWidgetsList.Editors.RichText,
2742
+ AXPWidgetsList.Advanced.CodeEditor,
2743
+ AXPWidgetsList.Editors.InlineDataTable,
2744
+ AXPWidgetsList.Editors.SignatureBox,
2745
+ AXPWidgetsList.Editors.MapBox,
2746
+ AXPWidgetsList.Editors.FileViewer,
2747
+ AXPWidgetsList.Editors.QueryBuilder,
2748
+ AXPWidgetsList.Editors.SkillMatrix,
2749
+ AXPWidgetsList.Editors.ResponsibilitiesMatrix,
2750
+ AXPWidgetsList.Editors.RiskMatrix,
2751
+ AXPWidgetsList.Editors.ControlHierarchyDiagram,
2752
+ ]);
2753
+ //#endregion
2754
+ //#region ----- Estimate -----
2755
+ /**
2756
+ * Static walk of a dialog widget tree. Predicts how long the first paint will take
2757
+ * so the renderer can decide whether to show the loading dialog immediately.
2758
+ */
2759
+ function estimateDialogRenderMs(node, kindOf) {
2760
+ const acc = { structural: 0, dataBound: 0 };
2761
+ walk(node, acc, kindOf);
2762
+ const network = acc.dataBound === 0 ? 0 : NETWORK_FIRST_MS + (acc.dataBound - 1) * NETWORK_EACH_MS;
2763
+ const raw = SHELL_MS + acc.structural + network;
2764
+ return Math.min(MAX_MS, Math.max(MIN_MS, raw));
2765
+ }
2766
+ //#endregion
2767
+ //#region ----- Walk -----
2768
+ function walk(node, acc, kindOf) {
2769
+ if (!node || node.visible === false) {
2770
+ return;
2771
+ }
2772
+ if (node.type === AXPWidgetsList.Layouts.TabsetLayout) {
2773
+ chargeNode(node, acc, kindOf);
2774
+ const children = node.children ?? [];
2775
+ if (children.length > 0) {
2776
+ walk(children[0], acc, kindOf);
2777
+ }
2778
+ for (let index = 1; index < children.length; index++) {
2779
+ acc.structural += TAB_MS;
2780
+ }
2781
+ return;
2782
+ }
2783
+ if (node.type === AXPWidgetsCatalog.stepWizard) {
2784
+ chargeNode(node, acc, kindOf);
2785
+ for (const content of wizardStepContents(node)) {
2786
+ walk(content, acc, kindOf);
2787
+ }
2788
+ for (const child of node.children ?? []) {
2789
+ walk(child, acc, kindOf);
2790
+ }
2791
+ return;
2792
+ }
2793
+ chargeNode(node, acc, kindOf);
2794
+ for (const child of node.children ?? []) {
2795
+ walk(child, acc, kindOf);
2796
+ }
2797
+ }
2798
+ function chargeNode(node, acc, kindOf) {
2799
+ if (HEAVY_RENDER.has(node.type)) {
2800
+ acc.structural += HEAVY_MS;
2801
+ }
2802
+ else if (kindOf(node.type) === 'container') {
2803
+ acc.structural += CONTAINER_MS;
2804
+ }
2805
+ else {
2806
+ acc.structural += FIELD_MS;
2807
+ }
2808
+ if (isNetworkBound(node)) {
2809
+ acc.dataBound += 1;
2810
+ }
2811
+ }
2812
+ function isNetworkBound(node) {
2813
+ if (FETCH_WITHOUT_DATASOURCE.has(node.type)) {
2814
+ return true;
2815
+ }
2816
+ const raw = node.options?.['dataSource'];
2817
+ return typeof raw === 'string' || (!!raw && typeof raw === 'object' && 'id' in raw);
2818
+ }
2819
+ function wizardStepContents(node) {
2820
+ const steps = node.options
2821
+ ?.definition?.steps;
2822
+ if (!Array.isArray(steps)) {
2823
+ return [];
2824
+ }
2825
+ return steps.flatMap((step) => (step.content ? [step.content] : []));
2826
+ }
2827
+ //#endregion
2828
+
2637
2829
  /** Debounce after widget count stabilizes before re-evaluating footer actions. */
2638
2830
  const DIALOG_WIDGET_COUNT_STABLE_DELAY_MS = 350;
2831
+ /** Safety net so the dialog is never left hidden when the widget debounce does not fire. */
2832
+ const DIALOG_REVEAL_FALLBACK_MS = 3500;
2833
+ /** Fast dialogs skip the loading overlay unless they overrun this wait. */
2834
+ const LOADING_DIALOG_SHOW_THRESHOLD_MS = 400;
2639
2835
  class AXPDialogRendererComponent extends AXBasePageComponent {
2640
2836
  constructor() {
2641
2837
  super(...arguments);
@@ -2650,12 +2846,21 @@ class AXPDialogRendererComponent extends AXBasePageComponent {
2650
2846
  this.document = inject(DOCUMENT);
2651
2847
  this.host = inject((ElementRef));
2652
2848
  this.shortcutRegistry = inject(AXPKeyboardShortcutRegistry);
2849
+ this.loadingDialog = inject(AXLoadingDialogService);
2850
+ this.widgetRegistry = inject(AXPWidgetRegistryService);
2851
+ this.debug = inject(AXPDebugService);
2653
2852
  /** Ensures `show()` resolves once when the dialog closes (footer action or header close). */
2654
2853
  this.callbackInvoked = false;
2655
2854
  /** Skips dirty confirmation on the next {@link onClosing} (successful submit / programmatic close). */
2656
2855
  this.skipNextOnClosingDirtyCheck = false;
2657
2856
  /** Blocks re-entrant {@link onClosing} while the first close gate is still resolving. */
2658
2857
  this.closeGateInProgress = false;
2858
+ /** Predicted first-paint cost from the widget tree, used for the loading decision and debug trace. */
2859
+ this.estimatedRenderMs = 0;
2860
+ /** `performance.now()` at `ngOnInit`, for estimated-vs-measured traces. */
2861
+ this.revealStartedAt = 0;
2862
+ /** Keeps the reveal pipeline to a single run (widget debounce and fallback timer both call it). */
2863
+ this.revealRequested = false;
2659
2864
  this.destroyRef = inject(DestroyRef);
2660
2865
  this.context = signal({}, /* @ts-ignore */
2661
2866
  ...(ngDevMode ? [{ debugName: "context" }] : /* istanbul ignore next */ []));
@@ -2668,6 +2873,8 @@ class AXPDialogRendererComponent extends AXBasePageComponent {
2668
2873
  ...(ngDevMode ? [{ debugName: "footerPrefix" }] : /* istanbul ignore next */ []));
2669
2874
  this.footerSuffix = signal([], /* @ts-ignore */
2670
2875
  ...(ngDevMode ? [{ debugName: "footerSuffix" }] : /* istanbul ignore next */ []));
2876
+ this.hasDefaultFooterActions = computed(() => this.footerPrefix().length > 0 || this.footerSuffix().length > 0, /* @ts-ignore */
2877
+ ...(ngDevMode ? [{ debugName: "hasDefaultFooterActions" }] : /* istanbul ignore next */ []));
2671
2878
  /**
2672
2879
  * Correlate layout context snapshots for distributed hooks (`layout-builder.dialog.context-changed`).
2673
2880
  */
@@ -2694,14 +2901,16 @@ class AXPDialogRendererComponent extends AXBasePageComponent {
2694
2901
  const renderer = this.layoutRenderer();
2695
2902
  const container = renderer?.getContainer();
2696
2903
  this.widgetCoreService = container?.builderService ?? null;
2697
- return;
2698
2904
  }
2699
- this.widgetCoreService.registeredWidgetsCount();
2905
+ else {
2906
+ this.widgetCoreService.registeredWidgetsCount();
2907
+ }
2700
2908
  if (this.debounceTimer) {
2701
2909
  clearTimeout(this.debounceTimer);
2702
2910
  }
2703
- this.debounceTimer = setTimeout(() => {
2704
- this.aggregateAndEvaluateActions();
2911
+ this.debounceTimer = setTimeout(async () => {
2912
+ await this.aggregateAndEvaluateActions();
2913
+ void this.revealWhenLayoutStable();
2705
2914
  }, DIALOG_WIDGET_COUNT_STABLE_DELAY_MS);
2706
2915
  }, /* @ts-ignore */
2707
2916
  ...(ngDevMode ? [{ debugName: "#widgetActionsEffect" }] : /* istanbul ignore next */ []));
@@ -2716,9 +2925,24 @@ class AXPDialogRendererComponent extends AXBasePageComponent {
2716
2925
  //#endregion
2717
2926
  //#region ---- Lifecycle ----
2718
2927
  ngOnInit() {
2928
+ this.revealStartedAt = performance.now();
2929
+ this.estimatedRenderMs = estimateDialogRenderMs(this.config?.definition, (type) => this.widgetRegistry.getOptional(type)?.type);
2930
+ if (this.estimatedRenderMs >= LOADING_DIALOG_SHOW_THRESHOLD_MS) {
2931
+ this.revealLoading = this.openRevealLoading();
2932
+ }
2933
+ else {
2934
+ this.revealLoadingTimer = setTimeout(() => {
2935
+ this.revealLoading = this.openRevealLoading();
2936
+ }, LOADING_DIALOG_SHOW_THRESHOLD_MS);
2937
+ }
2719
2938
  const initialContext = this.config?.context || {};
2720
2939
  this.context.set(initialContext);
2721
2940
  void this.invokeLayoutContextChangedHooks();
2941
+ const revealFallbackTimer = setTimeout(() => void this.revealWhenLayoutStable(), DIALOG_REVEAL_FALLBACK_MS);
2942
+ this.destroyRef.onDestroy(() => {
2943
+ clearTimeout(revealFallbackTimer);
2944
+ void this.closeRevealLoading();
2945
+ });
2722
2946
  }
2723
2947
  //#endregion
2724
2948
  //#region ---- Keyboard Shortcuts ----
@@ -3196,6 +3420,61 @@ class AXPDialogRendererComponent extends AXBasePageComponent {
3196
3420
  const suffix = visible.filter((a) => (a.zone ?? 'footer') === 'footer' && (a.placement ?? 'suffix') === 'suffix');
3197
3421
  this.footerPrefix.set(prefix);
3198
3422
  this.footerSuffix.set(suffix);
3423
+ if (prefix.length > 0 || suffix.length > 0) {
3424
+ this.scheduleRelocateFooterToPopupChrome();
3425
+ }
3426
+ }
3427
+ /**
3428
+ * AX popup lifts `:scope > ax-footer` once after first paint. Widget footer
3429
+ * actions can appear later — move the footer into chrome when it is created.
3430
+ */
3431
+ scheduleRelocateFooterToPopupChrome() {
3432
+ setTimeout(() => {
3433
+ const host = this.host.nativeElement;
3434
+ const footer = host.querySelector(':scope > ax-footer');
3435
+ if (!(footer instanceof HTMLElement)) {
3436
+ return;
3437
+ }
3438
+ const popFooter = host.closest('.ax-popup')?.querySelector('.ax-popup-footer-container');
3439
+ if (!(popFooter instanceof HTMLElement) || popFooter.contains(footer)) {
3440
+ return;
3441
+ }
3442
+ popFooter.append(footer);
3443
+ });
3444
+ }
3445
+ /**
3446
+ * The popup box is on screen before widgets and footer chrome are laid out, so it is held
3447
+ * hidden by the reveal panel class. Wait for the shell to stop resizing, then fade it in.
3448
+ */
3449
+ async revealWhenLayoutStable() {
3450
+ if (this.revealRequested) {
3451
+ return;
3452
+ }
3453
+ this.revealRequested = true;
3454
+ await waitForDialogPopupLayoutStable(this.host.nativeElement);
3455
+ await this.closeRevealLoading();
3456
+ markDialogRevealReady(this.host.nativeElement);
3457
+ const elapsed = performance.now() - this.revealStartedAt;
3458
+ this.debug.trace('dialog-reveal', 'render-cost', 'estimated vs measured', () => ({
3459
+ estimatedMs: this.estimatedRenderMs,
3460
+ measuredMs: Math.round(elapsed - AXP_DIALOG_REVEAL_RESIZE_STABLE_MS),
3461
+ loadingShown: !!this.revealLoading,
3462
+ }));
3463
+ }
3464
+ async openRevealLoading() {
3465
+ const [title, text] = await Promise.all([
3466
+ this.translationService.translateAsync('@general:state-message.loading.title'),
3467
+ this.translationService.translateAsync('@general:state-message.loading.description'),
3468
+ ]);
3469
+ return this.loadingDialog.show({ title, text, mode: 'indeterminate' });
3470
+ }
3471
+ async closeRevealLoading() {
3472
+ if (this.revealLoadingTimer) {
3473
+ clearTimeout(this.revealLoadingTimer);
3474
+ this.revealLoadingTimer = undefined;
3475
+ }
3476
+ const ref = await this.revealLoading?.catch(() => undefined);
3477
+ ref?.close();
3199
3478
  }
3200
3479
  async collectWidgetActions() {
3201
3480
  if (!this.widgetCoreService)
@@ -3323,9 +3602,10 @@ class AXPDialogRendererComponent extends AXBasePageComponent {
3323
3602
  </axp-layout-renderer>
3324
3603
  </div>
3325
3604
 
3326
- <!-- Custom footer slot: if it has content, default footer is hidden -->
3605
+ <!-- Custom footer slot: if it has content, default footer is not rendered -->
3327
3606
  <axp-component-slot name="dialog-footer" #footerSlot="slot" [context]="context()"></axp-component-slot>
3328
- @if (footerSlot.isEmpty()) {
3607
+ <!-- ----- Default popup footer only when there is at least one action ----- -->
3608
+ @if (footerSlot.isEmpty() && hasDefaultFooterActions()) {
3329
3609
  <ax-footer>
3330
3610
  <ax-prefix>
3331
3611
  <axp-component-slot name="dialog-footer-prefix" [context]="context()"></axp-component-slot>
@@ -3406,9 +3686,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
3406
3686
  </axp-layout-renderer>
3407
3687
  </div>
3408
3688
 
3409
- <!-- Custom footer slot: if it has content, default footer is hidden -->
3689
+ <!-- Custom footer slot: if it has content, default footer is not rendered -->
3410
3690
  <axp-component-slot name="dialog-footer" #footerSlot="slot" [context]="context()"></axp-component-slot>
3411
- @if (footerSlot.isEmpty()) {
3691
+ <!-- ----- Default popup footer only when there is at least one action ----- -->
3692
+ @if (footerSlot.isEmpty() && hasDefaultFooterActions()) {
3412
3693
  <ax-footer>
3413
3694
  <ax-prefix>
3414
3695
  <axp-component-slot name="dialog-footer-prefix" [context]="context()"></axp-component-slot>