@acorex-platform/framework-client 0.0.54 → 0.0.57
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/fesm2022/acorex-platform-framework-client-common.mjs +39 -20
- package/fesm2022/acorex-platform-framework-client-common.mjs.map +1 -1
- package/fesm2022/acorex-platform-framework-client-layout-builder.mjs +4 -256
- package/fesm2022/acorex-platform-framework-client-layout-builder.mjs.map +1 -1
- package/fesm2022/acorex-platform-framework-client-layout-components.mjs +146 -53
- package/fesm2022/acorex-platform-framework-client-layout-components.mjs.map +1 -1
- package/fesm2022/acorex-platform-framework-client-layout-designer.mjs +48 -34
- package/fesm2022/acorex-platform-framework-client-layout-designer.mjs.map +1 -1
- package/fesm2022/{acorex-platform-framework-client-layout-entity-acorex-platform-framework-client-layout-entity-bGKRfOH2.mjs → acorex-platform-framework-client-layout-entity-acorex-platform-framework-client-layout-entity-Cmzwhmjw.mjs} +285 -266
- package/fesm2022/acorex-platform-framework-client-layout-entity-acorex-platform-framework-client-layout-entity-Cmzwhmjw.mjs.map +1 -0
- package/fesm2022/{acorex-platform-framework-client-layout-entity-attachments-page.component-9inrzTyH.mjs → acorex-platform-framework-client-layout-entity-attachments-page.component-K9HAtqL6.mjs} +2 -2
- package/fesm2022/{acorex-platform-framework-client-layout-entity-attachments-page.component-9inrzTyH.mjs.map → acorex-platform-framework-client-layout-entity-attachments-page.component-K9HAtqL6.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-framework-client-layout-entity-bulk-entity.command-C4fDZV2N.mjs → acorex-platform-framework-client-layout-entity-bulk-entity.command-BZECKfez.mjs} +2 -2
- package/fesm2022/{acorex-platform-framework-client-layout-entity-bulk-entity.command-C4fDZV2N.mjs.map → acorex-platform-framework-client-layout-entity-bulk-entity.command-BZECKfez.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-framework-client-layout-entity-gallery-page.component-BFdbsR0q.mjs → acorex-platform-framework-client-layout-entity-gallery-page.component-BuDpC58x.mjs} +2 -2
- package/fesm2022/{acorex-platform-framework-client-layout-entity-gallery-page.component-BFdbsR0q.mjs.map → acorex-platform-framework-client-layout-entity-gallery-page.component-BuDpC58x.mjs.map} +1 -1
- package/fesm2022/acorex-platform-framework-client-layout-entity.mjs +1 -1
- package/fesm2022/acorex-platform-framework-client-layout-views.mjs +21 -10
- package/fesm2022/acorex-platform-framework-client-layout-views.mjs.map +1 -1
- package/fesm2022/{acorex-platform-framework-client-layout-widgets-acorex-platform-framework-client-layout-widgets-nVzW1Bka.mjs → acorex-platform-framework-client-layout-widgets-acorex-platform-framework-client-layout-widgets-D5pndfBW.mjs} +376 -556
- package/fesm2022/acorex-platform-framework-client-layout-widgets-acorex-platform-framework-client-layout-widgets-D5pndfBW.mjs.map +1 -0
- package/fesm2022/{acorex-platform-framework-client-layout-widgets-repeater-widget-column.component-DfK7xcSW.mjs → acorex-platform-framework-client-layout-widgets-repeater-widget-column.component-BFgrSnfT.mjs} +2 -2
- package/fesm2022/{acorex-platform-framework-client-layout-widgets-repeater-widget-column.component-DfK7xcSW.mjs.map → acorex-platform-framework-client-layout-widgets-repeater-widget-column.component-BFgrSnfT.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-framework-client-layout-widgets-tabular-data-view-popup.component-D7P08nHH.mjs → acorex-platform-framework-client-layout-widgets-tabular-data-view-popup.component-DP9mP1CR.mjs} +8 -5
- package/fesm2022/acorex-platform-framework-client-layout-widgets-tabular-data-view-popup.component-DP9mP1CR.mjs.map +1 -0
- package/fesm2022/{acorex-platform-framework-client-layout-widgets-text-block-widget-designer.component-DZbHlccx.mjs → acorex-platform-framework-client-layout-widgets-text-block-widget-designer.component-Ctjz1PjP.mjs} +2 -2
- package/fesm2022/{acorex-platform-framework-client-layout-widgets-text-block-widget-designer.component-DZbHlccx.mjs.map → acorex-platform-framework-client-layout-widgets-text-block-widget-designer.component-Ctjz1PjP.mjs.map} +1 -1
- package/fesm2022/acorex-platform-framework-client-layout-widgets.mjs +1 -1
- package/fesm2022/{acorex-platform-framework-client-themes-default-entity-master-create-view.component-Dh_hRxZX.mjs → acorex-platform-framework-client-themes-default-entity-master-create-view.component-DwCoz2Du.mjs} +4 -4
- package/fesm2022/{acorex-platform-framework-client-themes-default-entity-master-create-view.component-Dh_hRxZX.mjs.map → acorex-platform-framework-client-themes-default-entity-master-create-view.component-DwCoz2Du.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-framework-client-themes-default-entity-master-modify-view.component-bC_uPN9l.mjs → acorex-platform-framework-client-themes-default-entity-master-modify-view.component-BCyFK60f.mjs} +4 -4
- package/fesm2022/{acorex-platform-framework-client-themes-default-entity-master-modify-view.component-bC_uPN9l.mjs.map → acorex-platform-framework-client-themes-default-entity-master-modify-view.component-BCyFK60f.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-framework-client-themes-default-entity-master-single-view.component-CDzBgDt7.mjs → acorex-platform-framework-client-themes-default-entity-master-single-view.component-2Re1-MvA.mjs} +4 -4
- package/fesm2022/{acorex-platform-framework-client-themes-default-entity-master-single-view.component-CDzBgDt7.mjs.map → acorex-platform-framework-client-themes-default-entity-master-single-view.component-2Re1-MvA.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-framework-client-themes-default-error-401.component-CaV3MdRr.mjs → acorex-platform-framework-client-themes-default-error-401.component-1lfBpY_d.mjs} +3 -3
- package/fesm2022/{acorex-platform-framework-client-themes-default-error-401.component-CaV3MdRr.mjs.map → acorex-platform-framework-client-themes-default-error-401.component-1lfBpY_d.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-framework-client-themes-default-error-404.component-CTA-lxYp.mjs → acorex-platform-framework-client-themes-default-error-404.component-BeWyRCJr.mjs} +3 -3
- package/fesm2022/{acorex-platform-framework-client-themes-default-error-404.component-CTA-lxYp.mjs.map → acorex-platform-framework-client-themes-default-error-404.component-BeWyRCJr.mjs.map} +1 -1
- package/fesm2022/acorex-platform-framework-client-themes-default-error-offline.component-PvveUj5c.mjs +22 -0
- package/fesm2022/acorex-platform-framework-client-themes-default-error-offline.component-PvveUj5c.mjs.map +1 -0
- package/fesm2022/acorex-platform-framework-client-themes-default.mjs +37 -47
- package/fesm2022/acorex-platform-framework-client-themes-default.mjs.map +1 -1
- package/fesm2022/acorex-platform-framework-client-themes-shared.mjs +4 -4
- package/fesm2022/acorex-platform-framework-client-themes-shared.mjs.map +1 -1
- package/i18n/en-AU/activity-log.json +71 -0
- package/i18n/en-AU/common-plugins.json +96 -0
- package/i18n/en-AU/dynamic-form-designer.json +126 -0
- package/i18n/en-AU/general.json +2294 -0
- package/i18n/en-AU/layout-designer.json +173 -0
- package/i18n/en-AU/layout.json +258 -0
- package/i18n/en-AU/platform-layout-widgets.json +331 -0
- package/i18n/en-US/activity-log.json +71 -0
- package/i18n/en-US/common-plugins.json +96 -0
- package/i18n/en-US/dynamic-form-designer.json +126 -0
- package/i18n/en-US/general.json +2294 -0
- package/i18n/en-US/layout-designer.json +173 -0
- package/i18n/en-US/layout.json +258 -0
- package/i18n/en-US/platform-layout-widgets.json +335 -0
- package/i18n/fa-IR/activity-log.json +71 -0
- package/i18n/fa-IR/common-plugins.json +126 -0
- package/i18n/fa-IR/dynamic-form-designer.json +126 -0
- package/i18n/fa-IR/general.json +2295 -0
- package/i18n/fa-IR/layout-designer.json +173 -0
- package/i18n/fa-IR/layout.json +258 -0
- package/i18n/fa-IR/platform-layout-widgets.json +335 -0
- package/package.json +2 -2
- package/types/acorex-platform-framework-client-common.d.ts +3 -1
- package/types/acorex-platform-framework-client-layout-builder.d.ts +0 -20
- package/types/acorex-platform-framework-client-layout-components.d.ts +5 -1
- package/types/acorex-platform-framework-client-layout-designer.d.ts +1 -0
- package/types/acorex-platform-framework-client-layout-entity.d.ts +11 -9
- package/types/acorex-platform-framework-client-layout-widgets.d.ts +29 -69
- package/fesm2022/acorex-platform-framework-client-layout-entity-acorex-platform-framework-client-layout-entity-bGKRfOH2.mjs.map +0 -1
- package/fesm2022/acorex-platform-framework-client-layout-widgets-acorex-platform-framework-client-layout-widgets-nVzW1Bka.mjs.map +0 -1
- package/fesm2022/acorex-platform-framework-client-layout-widgets-tabular-data-view-popup.component-D7P08nHH.mjs.map +0 -1
- package/fesm2022/acorex-platform-framework-client-themes-default-error-offline.component-B85b0lsa.mjs +0 -19
- package/fesm2022/acorex-platform-framework-client-themes-default-error-offline.component-B85b0lsa.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,
|
|
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';
|
|
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 { toAxpGridItemWidgetOptions, AXP_PREVIEW_WIDGET_FIELD_COMMAND_KEY,
|
|
9
|
+
import { toAxpGridItemWidgetOptions, AXP_PREVIEW_WIDGET_FIELD_COMMAND_KEY, 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,7 +22,6 @@ 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';
|
|
26
25
|
import { AXBasePageComponent } from '@acorex/components/page';
|
|
27
26
|
import { AXToastService } from '@acorex/components/toast';
|
|
28
27
|
import * as i6 from '@acorex/core/translation';
|
|
@@ -376,83 +375,6 @@ function normalizeDialogCloseConfirmation(value) {
|
|
|
376
375
|
}
|
|
377
376
|
//#endregion
|
|
378
377
|
|
|
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
|
-
|
|
456
378
|
//#region ---- Inheritance Utilities ----
|
|
457
379
|
/**
|
|
458
380
|
* Resolves inherited properties from context and local values
|
|
@@ -1795,8 +1717,6 @@ class DialogContainerBuilder {
|
|
|
1795
1717
|
closeButton: this.dialogState.dialogOptions?.closeButton || false,
|
|
1796
1718
|
closeOnBackdropClick: false,
|
|
1797
1719
|
draggable: this.dialogState.dialogOptions?.draggable ?? true,
|
|
1798
|
-
panelClass: [AXP_DIALOG_REVEAL_PANEL_CLASS],
|
|
1799
|
-
animation: AXP_DIALOG_REVEAL_POPUP_ANIMATION,
|
|
1800
1720
|
data: {
|
|
1801
1721
|
config: dialogConfig,
|
|
1802
1722
|
callBack: (result) => {
|
|
@@ -2669,121 +2589,8 @@ function shouldDeferDialogShortcutsToNestedOverlay(document, dialogHost, overlay
|
|
|
2669
2589
|
return shouldDeferEscapeToNestedOverlayFromDom(document, dialogHost);
|
|
2670
2590
|
}
|
|
2671
2591
|
|
|
2672
|
-
//#endregion
|
|
2673
|
-
//#region ----- Constants -----
|
|
2674
|
-
const SHELL_MS = 90;
|
|
2675
|
-
const MIN_MS = 80;
|
|
2676
|
-
const MAX_MS = 5000;
|
|
2677
|
-
const FIELD_MS = 7;
|
|
2678
|
-
const HEAVY_MS = 70;
|
|
2679
|
-
const CONTAINER_MS = 2;
|
|
2680
|
-
const TAB_MS = 3;
|
|
2681
|
-
const NETWORK_FIRST_MS = 200;
|
|
2682
|
-
const NETWORK_EACH_MS = 20;
|
|
2683
|
-
/** Widgets that fetch on init without a `dataSource` option. */
|
|
2684
|
-
const FETCH_WITHOUT_DATASOURCE = new Set([
|
|
2685
|
-
AXPWidgetsList.Editors.LookupBox,
|
|
2686
|
-
AXPWidgetsList.Editors.TagEditor,
|
|
2687
|
-
AXPWidgetsList.Editors.EntityCategory,
|
|
2688
|
-
AXPWidgetsList.Editors.MultiSourceSelector,
|
|
2689
|
-
AXPWidgetsList.Entity.EntityList,
|
|
2690
|
-
]);
|
|
2691
|
-
/** Widgets that are expensive to instantiate even with no network. */
|
|
2692
|
-
const HEAVY_RENDER = new Set([
|
|
2693
|
-
AXPWidgetsList.Editors.RichText,
|
|
2694
|
-
AXPWidgetsList.Advanced.CodeEditor,
|
|
2695
|
-
AXPWidgetsList.Editors.InlineDataTable,
|
|
2696
|
-
AXPWidgetsList.Editors.SignatureBox,
|
|
2697
|
-
AXPWidgetsList.Editors.MapBox,
|
|
2698
|
-
AXPWidgetsList.Editors.FileViewer,
|
|
2699
|
-
AXPWidgetsList.Editors.QueryBuilder,
|
|
2700
|
-
AXPWidgetsList.Editors.SkillMatrix,
|
|
2701
|
-
AXPWidgetsList.Editors.ResponsibilitiesMatrix,
|
|
2702
|
-
AXPWidgetsList.Editors.RiskMatrix,
|
|
2703
|
-
AXPWidgetsList.Editors.ControlHierarchyDiagram,
|
|
2704
|
-
]);
|
|
2705
|
-
//#endregion
|
|
2706
|
-
//#region ----- Estimate -----
|
|
2707
|
-
/**
|
|
2708
|
-
* Static walk of a dialog widget tree. Predicts how long the first paint will take
|
|
2709
|
-
* so the renderer can decide whether to show the loading dialog immediately.
|
|
2710
|
-
*/
|
|
2711
|
-
function estimateDialogRenderMs(node, kindOf) {
|
|
2712
|
-
const acc = { structural: 0, dataBound: 0 };
|
|
2713
|
-
walk(node, acc, kindOf);
|
|
2714
|
-
const network = acc.dataBound === 0 ? 0 : NETWORK_FIRST_MS + (acc.dataBound - 1) * NETWORK_EACH_MS;
|
|
2715
|
-
const raw = SHELL_MS + acc.structural + network;
|
|
2716
|
-
return Math.min(MAX_MS, Math.max(MIN_MS, raw));
|
|
2717
|
-
}
|
|
2718
|
-
//#endregion
|
|
2719
|
-
//#region ----- Walk -----
|
|
2720
|
-
function walk(node, acc, kindOf) {
|
|
2721
|
-
if (!node || node.visible === false) {
|
|
2722
|
-
return;
|
|
2723
|
-
}
|
|
2724
|
-
if (node.type === AXPWidgetsList.Layouts.TabsetLayout) {
|
|
2725
|
-
chargeNode(node, acc, kindOf);
|
|
2726
|
-
const children = node.children ?? [];
|
|
2727
|
-
if (children.length > 0) {
|
|
2728
|
-
walk(children[0], acc, kindOf);
|
|
2729
|
-
}
|
|
2730
|
-
for (let index = 1; index < children.length; index++) {
|
|
2731
|
-
acc.structural += TAB_MS;
|
|
2732
|
-
}
|
|
2733
|
-
return;
|
|
2734
|
-
}
|
|
2735
|
-
if (node.type === AXPWidgetsCatalog.stepWizard) {
|
|
2736
|
-
chargeNode(node, acc, kindOf);
|
|
2737
|
-
for (const content of wizardStepContents(node)) {
|
|
2738
|
-
walk(content, acc, kindOf);
|
|
2739
|
-
}
|
|
2740
|
-
for (const child of node.children ?? []) {
|
|
2741
|
-
walk(child, acc, kindOf);
|
|
2742
|
-
}
|
|
2743
|
-
return;
|
|
2744
|
-
}
|
|
2745
|
-
chargeNode(node, acc, kindOf);
|
|
2746
|
-
for (const child of node.children ?? []) {
|
|
2747
|
-
walk(child, acc, kindOf);
|
|
2748
|
-
}
|
|
2749
|
-
}
|
|
2750
|
-
function chargeNode(node, acc, kindOf) {
|
|
2751
|
-
if (HEAVY_RENDER.has(node.type)) {
|
|
2752
|
-
acc.structural += HEAVY_MS;
|
|
2753
|
-
}
|
|
2754
|
-
else if (kindOf(node.type) === 'container') {
|
|
2755
|
-
acc.structural += CONTAINER_MS;
|
|
2756
|
-
}
|
|
2757
|
-
else {
|
|
2758
|
-
acc.structural += FIELD_MS;
|
|
2759
|
-
}
|
|
2760
|
-
if (isNetworkBound(node)) {
|
|
2761
|
-
acc.dataBound += 1;
|
|
2762
|
-
}
|
|
2763
|
-
}
|
|
2764
|
-
function isNetworkBound(node) {
|
|
2765
|
-
if (FETCH_WITHOUT_DATASOURCE.has(node.type)) {
|
|
2766
|
-
return true;
|
|
2767
|
-
}
|
|
2768
|
-
const raw = node.options?.['dataSource'];
|
|
2769
|
-
return typeof raw === 'string' || (!!raw && typeof raw === 'object' && 'id' in raw);
|
|
2770
|
-
}
|
|
2771
|
-
function wizardStepContents(node) {
|
|
2772
|
-
const steps = node.options
|
|
2773
|
-
?.definition?.steps;
|
|
2774
|
-
if (!Array.isArray(steps)) {
|
|
2775
|
-
return [];
|
|
2776
|
-
}
|
|
2777
|
-
return steps.flatMap((step) => (step.content ? [step.content] : []));
|
|
2778
|
-
}
|
|
2779
|
-
//#endregion
|
|
2780
|
-
|
|
2781
2592
|
/** Debounce after widget count stabilizes before re-evaluating footer actions. */
|
|
2782
2593
|
const DIALOG_WIDGET_COUNT_STABLE_DELAY_MS = 350;
|
|
2783
|
-
/** Safety net so the dialog is never left hidden when the widget debounce does not fire. */
|
|
2784
|
-
const DIALOG_REVEAL_FALLBACK_MS = 3500;
|
|
2785
|
-
/** Fast dialogs skip the loading overlay unless they overrun this wait. */
|
|
2786
|
-
const LOADING_DIALOG_SHOW_THRESHOLD_MS = 400;
|
|
2787
2594
|
class AXPDialogRendererComponent extends AXBasePageComponent {
|
|
2788
2595
|
constructor() {
|
|
2789
2596
|
super(...arguments);
|
|
@@ -2798,21 +2605,12 @@ class AXPDialogRendererComponent extends AXBasePageComponent {
|
|
|
2798
2605
|
this.document = inject(DOCUMENT);
|
|
2799
2606
|
this.host = inject((ElementRef));
|
|
2800
2607
|
this.shortcutRegistry = inject(AXPKeyboardShortcutRegistry);
|
|
2801
|
-
this.loadingDialog = inject(AXLoadingDialogService);
|
|
2802
|
-
this.widgetRegistry = inject(AXPWidgetRegistryService);
|
|
2803
|
-
this.debug = inject(AXPDebugService);
|
|
2804
2608
|
/** Ensures `show()` resolves once when the dialog closes (footer action or header close). */
|
|
2805
2609
|
this.callbackInvoked = false;
|
|
2806
2610
|
/** Skips dirty confirmation on the next {@link onClosing} (successful submit / programmatic close). */
|
|
2807
2611
|
this.skipNextOnClosingDirtyCheck = false;
|
|
2808
2612
|
/** Blocks re-entrant {@link onClosing} while the first close gate is still resolving. */
|
|
2809
2613
|
this.closeGateInProgress = false;
|
|
2810
|
-
/** Predicted first-paint cost from the widget tree, used for the loading decision and debug trace. */
|
|
2811
|
-
this.estimatedRenderMs = 0;
|
|
2812
|
-
/** `performance.now()` at `ngOnInit`, for estimated-vs-measured traces. */
|
|
2813
|
-
this.revealStartedAt = 0;
|
|
2814
|
-
/** Keeps the reveal pipeline to a single run (widget debounce and fallback timer both call it). */
|
|
2815
|
-
this.revealRequested = false;
|
|
2816
2614
|
this.destroyRef = inject(DestroyRef);
|
|
2817
2615
|
this.context = signal({}, /* @ts-ignore */
|
|
2818
2616
|
...(ngDevMode ? [{ debugName: "context" }] : /* istanbul ignore next */ []));
|
|
@@ -2860,9 +2658,8 @@ class AXPDialogRendererComponent extends AXBasePageComponent {
|
|
|
2860
2658
|
if (this.debounceTimer) {
|
|
2861
2659
|
clearTimeout(this.debounceTimer);
|
|
2862
2660
|
}
|
|
2863
|
-
this.debounceTimer = setTimeout(
|
|
2864
|
-
|
|
2865
|
-
void this.revealWhenLayoutStable();
|
|
2661
|
+
this.debounceTimer = setTimeout(() => {
|
|
2662
|
+
void this.aggregateAndEvaluateActions();
|
|
2866
2663
|
}, DIALOG_WIDGET_COUNT_STABLE_DELAY_MS);
|
|
2867
2664
|
}, /* @ts-ignore */
|
|
2868
2665
|
...(ngDevMode ? [{ debugName: "#widgetActionsEffect" }] : /* istanbul ignore next */ []));
|
|
@@ -2877,24 +2674,9 @@ class AXPDialogRendererComponent extends AXBasePageComponent {
|
|
|
2877
2674
|
//#endregion
|
|
2878
2675
|
//#region ---- Lifecycle ----
|
|
2879
2676
|
ngOnInit() {
|
|
2880
|
-
this.revealStartedAt = performance.now();
|
|
2881
|
-
this.estimatedRenderMs = estimateDialogRenderMs(this.config?.definition, (type) => this.widgetRegistry.getOptional(type)?.type);
|
|
2882
|
-
if (this.estimatedRenderMs >= LOADING_DIALOG_SHOW_THRESHOLD_MS) {
|
|
2883
|
-
this.revealLoading = this.openRevealLoading();
|
|
2884
|
-
}
|
|
2885
|
-
else {
|
|
2886
|
-
this.revealLoadingTimer = setTimeout(() => {
|
|
2887
|
-
this.revealLoading = this.openRevealLoading();
|
|
2888
|
-
}, LOADING_DIALOG_SHOW_THRESHOLD_MS);
|
|
2889
|
-
}
|
|
2890
2677
|
const initialContext = this.config?.context || {};
|
|
2891
2678
|
this.context.set(initialContext);
|
|
2892
2679
|
void this.invokeLayoutContextChangedHooks();
|
|
2893
|
-
const revealFallbackTimer = setTimeout(() => void this.revealWhenLayoutStable(), DIALOG_REVEAL_FALLBACK_MS);
|
|
2894
|
-
this.destroyRef.onDestroy(() => {
|
|
2895
|
-
clearTimeout(revealFallbackTimer);
|
|
2896
|
-
void this.closeRevealLoading();
|
|
2897
|
-
});
|
|
2898
2680
|
}
|
|
2899
2681
|
//#endregion
|
|
2900
2682
|
//#region ---- Keyboard Shortcuts ----
|
|
@@ -3394,40 +3176,6 @@ class AXPDialogRendererComponent extends AXBasePageComponent {
|
|
|
3394
3176
|
popFooter.append(footer);
|
|
3395
3177
|
});
|
|
3396
3178
|
}
|
|
3397
|
-
/**
|
|
3398
|
-
* The popup box is on screen before widgets and footer chrome are laid out, so it is held
|
|
3399
|
-
* hidden by the reveal panel class. Wait for the shell to stop resizing, then fade it in.
|
|
3400
|
-
*/
|
|
3401
|
-
async revealWhenLayoutStable() {
|
|
3402
|
-
if (this.revealRequested) {
|
|
3403
|
-
return;
|
|
3404
|
-
}
|
|
3405
|
-
this.revealRequested = true;
|
|
3406
|
-
await waitForDialogPopupLayoutStable(this.host.nativeElement);
|
|
3407
|
-
await this.closeRevealLoading();
|
|
3408
|
-
markDialogRevealReady(this.host.nativeElement);
|
|
3409
|
-
const elapsed = performance.now() - this.revealStartedAt;
|
|
3410
|
-
this.debug.trace('dialog-reveal', 'render-cost', 'estimated vs measured', () => ({
|
|
3411
|
-
estimatedMs: this.estimatedRenderMs,
|
|
3412
|
-
measuredMs: Math.round(elapsed - AXP_DIALOG_REVEAL_RESIZE_STABLE_MS),
|
|
3413
|
-
loadingShown: !!this.revealLoading,
|
|
3414
|
-
}));
|
|
3415
|
-
}
|
|
3416
|
-
async openRevealLoading() {
|
|
3417
|
-
const [title, text] = await Promise.all([
|
|
3418
|
-
this.translationService.translateAsync('@general:state-message.loading.title'),
|
|
3419
|
-
this.translationService.translateAsync('@general:state-message.loading.description'),
|
|
3420
|
-
]);
|
|
3421
|
-
return this.loadingDialog.show({ title, text, mode: 'indeterminate' });
|
|
3422
|
-
}
|
|
3423
|
-
async closeRevealLoading() {
|
|
3424
|
-
if (this.revealLoadingTimer) {
|
|
3425
|
-
clearTimeout(this.revealLoadingTimer);
|
|
3426
|
-
this.revealLoadingTimer = undefined;
|
|
3427
|
-
}
|
|
3428
|
-
const ref = await this.revealLoading?.catch(() => undefined);
|
|
3429
|
-
ref?.close();
|
|
3430
|
-
}
|
|
3431
3179
|
async collectWidgetActions() {
|
|
3432
3180
|
if (!this.widgetCoreService)
|
|
3433
3181
|
return [];
|