@acorex/platform 20.3.0-next.9 → 20.4.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/common/index.d.ts +643 -365
- package/core/index.d.ts +19 -4
- package/fesm2022/acorex-platform-auth.mjs +19 -19
- package/fesm2022/acorex-platform-auth.mjs.map +1 -1
- package/fesm2022/acorex-platform-common-common-settings.provider-9OHien_H.mjs +47 -0
- package/fesm2022/acorex-platform-common-common-settings.provider-9OHien_H.mjs.map +1 -0
- package/fesm2022/acorex-platform-common.mjs +673 -242
- package/fesm2022/acorex-platform-common.mjs.map +1 -1
- package/fesm2022/acorex-platform-core.mjs +58 -46
- package/fesm2022/acorex-platform-core.mjs.map +1 -1
- package/fesm2022/acorex-platform-domain.mjs +16 -16
- package/fesm2022/acorex-platform-domain.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-builder.mjs +1933 -2330
- package/fesm2022/acorex-platform-layout-builder.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-components.mjs +1511 -1626
- package/fesm2022/acorex-platform-layout-components.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-designer.mjs +82 -82
- package/fesm2022/acorex-platform-layout-designer.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-entity-create-entity.command-DyXF9zAh.mjs +52 -0
- package/fesm2022/acorex-platform-layout-entity-create-entity.command-DyXF9zAh.mjs.map +1 -0
- package/fesm2022/acorex-platform-layout-entity.mjs +1371 -917
- package/fesm2022/acorex-platform-layout-entity.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-views.mjs +63 -54
- package/fesm2022/acorex-platform-layout-views.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-widget-core.mjs +2758 -0
- package/fesm2022/acorex-platform-layout-widget-core.mjs.map +1 -0
- package/fesm2022/{acorex-platform-widgets-button-widget-designer.component-C2Qn1YAW.mjs → acorex-platform-layout-widgets-button-widget-designer.component-C_3IWNkj.mjs} +6 -6
- package/fesm2022/acorex-platform-layout-widgets-button-widget-designer.component-C_3IWNkj.mjs.map +1 -0
- package/fesm2022/{acorex-platform-widgets-extra-properties-schema-widget-edit.component-D9mf08rU.mjs → acorex-platform-layout-widgets-extra-properties-schema-widget-edit.component-CJltEgut.mjs} +5 -5
- package/fesm2022/acorex-platform-layout-widgets-extra-properties-schema-widget-edit.component-CJltEgut.mjs.map +1 -0
- package/fesm2022/{acorex-platform-widgets-extra-properties-schema-widget-view.component-D6GQ-eyr.mjs → acorex-platform-layout-widgets-extra-properties-schema-widget-view.component-pM-TIuk0.mjs} +5 -5
- package/fesm2022/acorex-platform-layout-widgets-extra-properties-schema-widget-view.component-pM-TIuk0.mjs.map +1 -0
- package/fesm2022/{acorex-platform-widgets-extra-properties-values-widget-edit.component-DVbIdVZ6.mjs → acorex-platform-layout-widgets-extra-properties-values-widget-edit.component-BqI96-fU.mjs} +5 -5
- package/fesm2022/acorex-platform-layout-widgets-extra-properties-values-widget-edit.component-BqI96-fU.mjs.map +1 -0
- package/fesm2022/{acorex-platform-widgets-extra-properties-values-widget-view.component-D-aM64Hu.mjs → acorex-platform-layout-widgets-extra-properties-values-widget-view.component-C-AhenaM.mjs} +5 -5
- package/fesm2022/acorex-platform-layout-widgets-extra-properties-values-widget-view.component-C-AhenaM.mjs.map +1 -0
- package/fesm2022/{acorex-platform-widgets-extra-properties-widget-edit.component-em2-aU8E.mjs → acorex-platform-layout-widgets-extra-properties-widget-edit.component-DCAya5ne.mjs} +5 -5
- package/fesm2022/acorex-platform-layout-widgets-extra-properties-widget-edit.component-DCAya5ne.mjs.map +1 -0
- package/fesm2022/{acorex-platform-widgets-extra-properties-widget-view.component-BeuIofdr.mjs → acorex-platform-layout-widgets-extra-properties-widget-view.component-D-PnBqLb.mjs} +5 -5
- package/fesm2022/acorex-platform-layout-widgets-extra-properties-widget-view.component-D-PnBqLb.mjs.map +1 -0
- package/fesm2022/{acorex-platform-widgets-file-list-popup.component-Cmtq2bBV.mjs → acorex-platform-layout-widgets-file-list-popup.component-DuuFHWvB.mjs} +9 -9
- package/fesm2022/acorex-platform-layout-widgets-file-list-popup.component-DuuFHWvB.mjs.map +1 -0
- package/fesm2022/{acorex-platform-widgets-page-widget-designer.component-D8ivmxzT.mjs → acorex-platform-layout-widgets-page-widget-designer.component-Bss0xUcu.mjs} +8 -8
- package/fesm2022/acorex-platform-layout-widgets-page-widget-designer.component-Bss0xUcu.mjs.map +1 -0
- package/fesm2022/{acorex-platform-widgets-tabular-data-edit-popup.component-CMqq_iOj.mjs → acorex-platform-layout-widgets-tabular-data-edit-popup.component-Cy9mHnNP.mjs} +8 -8
- package/fesm2022/acorex-platform-layout-widgets-tabular-data-edit-popup.component-Cy9mHnNP.mjs.map +1 -0
- package/fesm2022/{acorex-platform-widgets-tabular-data-view-popup.component-Dmg5DdX8.mjs → acorex-platform-layout-widgets-tabular-data-view-popup.component-DznLtuer.mjs} +6 -5
- package/fesm2022/acorex-platform-layout-widgets-tabular-data-view-popup.component-DznLtuer.mjs.map +1 -0
- package/fesm2022/{acorex-platform-widgets-text-block-widget-designer.component-yADN3Xji.mjs → acorex-platform-layout-widgets-text-block-widget-designer.component-ndOUSFi9.mjs} +6 -7
- package/fesm2022/acorex-platform-layout-widgets-text-block-widget-designer.component-ndOUSFi9.mjs.map +1 -0
- package/fesm2022/{acorex-platform-widgets.mjs → acorex-platform-layout-widgets.mjs} +4153 -3146
- package/fesm2022/acorex-platform-layout-widgets.mjs.map +1 -0
- package/fesm2022/acorex-platform-native.mjs +7 -7
- package/fesm2022/acorex-platform-native.mjs.map +1 -1
- package/fesm2022/acorex-platform-runtime.mjs +40 -40
- package/fesm2022/acorex-platform-runtime.mjs.map +1 -1
- package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-B1PT6FtZ.mjs +115 -0
- package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-B1PT6FtZ.mjs.map +1 -0
- package/fesm2022/{acorex-platform-themes-default-entity-master-list-view.component-7BB4LdjK.mjs → acorex-platform-themes-default-entity-master-list-view.component-rdKxuMC_.mjs} +69 -33
- package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-rdKxuMC_.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-4g19A3eI.mjs +101 -0
- package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-4g19A3eI.mjs.map +1 -0
- package/fesm2022/{acorex-platform-themes-default-entity-master-single-view.component-BExtm1JE.mjs → acorex-platform-themes-default-entity-master-single-view.component-B8gx5cG7.mjs} +17 -17
- package/fesm2022/acorex-platform-themes-default-entity-master-single-view.component-B8gx5cG7.mjs.map +1 -0
- package/fesm2022/{acorex-platform-themes-default-error-401.component-DrO1PEOH.mjs → acorex-platform-themes-default-error-401.component-CcvGfdhu.mjs} +4 -4
- package/fesm2022/{acorex-platform-themes-default-error-401.component-DrO1PEOH.mjs.map → acorex-platform-themes-default-error-401.component-CcvGfdhu.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-themes-default-error-404.component-DqVq0oHX.mjs → acorex-platform-themes-default-error-404.component-4-CaEsnV.mjs} +4 -4
- package/fesm2022/{acorex-platform-themes-default-error-404.component-DqVq0oHX.mjs.map → acorex-platform-themes-default-error-404.component-4-CaEsnV.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-themes-default-error-offline.component-Bt2PTL7_.mjs → acorex-platform-themes-default-error-offline.component-BNecbFEj.mjs} +4 -4
- package/fesm2022/{acorex-platform-themes-default-error-offline.component-Bt2PTL7_.mjs.map → acorex-platform-themes-default-error-offline.component-BNecbFEj.mjs.map} +1 -1
- package/fesm2022/acorex-platform-themes-default.mjs +117 -51
- package/fesm2022/acorex-platform-themes-default.mjs.map +1 -1
- package/fesm2022/{acorex-platform-themes-shared-icon-chooser-view.component-BgEh06Tn.mjs → acorex-platform-themes-shared-icon-chooser-view.component-Dc_Txe32.mjs} +5 -5
- package/fesm2022/acorex-platform-themes-shared-icon-chooser-view.component-Dc_Txe32.mjs.map +1 -0
- package/fesm2022/{acorex-platform-themes-shared-settings.provider-CLUKU4y0.mjs → acorex-platform-themes-shared-settings.provider-DY2xFnrv.mjs} +8 -8
- package/fesm2022/acorex-platform-themes-shared-settings.provider-DY2xFnrv.mjs.map +1 -0
- package/fesm2022/{acorex-platform-themes-shared-theme-color-chooser-column.component-AeOQxjbS.mjs → acorex-platform-themes-shared-theme-color-chooser-column.component-hgWLhhle.mjs} +5 -5
- package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-column.component-hgWLhhle.mjs.map +1 -0
- package/fesm2022/{acorex-platform-themes-shared-theme-color-chooser-view.component-DEVzRd6-.mjs → acorex-platform-themes-shared-theme-color-chooser-view.component-CY3JZK_W.mjs} +5 -5
- package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-view.component-CY3JZK_W.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-shared.mjs +66 -55
- package/fesm2022/acorex-platform-themes-shared.mjs.map +1 -1
- package/fesm2022/acorex-platform-workflow.mjs +27 -39
- package/fesm2022/acorex-platform-workflow.mjs.map +1 -1
- package/layout/builder/README.md +1577 -3
- package/layout/builder/index.d.ts +735 -868
- package/layout/components/index.d.ts +218 -714
- package/layout/designer/index.d.ts +4 -4
- package/layout/entity/index.d.ts +954 -375
- package/layout/views/index.d.ts +13 -14
- package/layout/widget-core/README.md +4 -0
- package/layout/widget-core/index.d.ts +959 -0
- package/layout/widgets/README.md +4 -0
- package/{widgets → layout/widgets}/index.d.ts +426 -365
- package/package.json +18 -14
- package/themes/shared/index.d.ts +2 -2
- package/workflow/index.d.ts +3 -173
- package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-Ct-ri59W.mjs +0 -115
- package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-Ct-ri59W.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-7BB4LdjK.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-BDJR088o.mjs +0 -101
- package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-BDJR088o.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-entity-master-single-view.component-BExtm1JE.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-shared-icon-chooser-view.component-BgEh06Tn.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-shared-settings.provider-CLUKU4y0.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-column.component-AeOQxjbS.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-view.component-DEVzRd6-.mjs.map +0 -1
- package/fesm2022/acorex-platform-widgets-button-widget-designer.component-C2Qn1YAW.mjs.map +0 -1
- package/fesm2022/acorex-platform-widgets-checkbox-widget-column.component-CzEFmKWG.mjs +0 -84
- package/fesm2022/acorex-platform-widgets-checkbox-widget-column.component-CzEFmKWG.mjs.map +0 -1
- package/fesm2022/acorex-platform-widgets-checkbox-widget-designer.component-BXPrXy-h.mjs +0 -55
- package/fesm2022/acorex-platform-widgets-checkbox-widget-designer.component-BXPrXy-h.mjs.map +0 -1
- package/fesm2022/acorex-platform-widgets-checkbox-widget-view.component-KYCQ2qTJ.mjs +0 -92
- package/fesm2022/acorex-platform-widgets-checkbox-widget-view.component-KYCQ2qTJ.mjs.map +0 -1
- package/fesm2022/acorex-platform-widgets-color-box-widget-designer.component-BVZ7lWm9.mjs +0 -55
- package/fesm2022/acorex-platform-widgets-color-box-widget-designer.component-BVZ7lWm9.mjs.map +0 -1
- package/fesm2022/acorex-platform-widgets-extra-properties-schema-widget-edit.component-D9mf08rU.mjs.map +0 -1
- package/fesm2022/acorex-platform-widgets-extra-properties-schema-widget-view.component-D6GQ-eyr.mjs.map +0 -1
- package/fesm2022/acorex-platform-widgets-extra-properties-values-widget-edit.component-DVbIdVZ6.mjs.map +0 -1
- package/fesm2022/acorex-platform-widgets-extra-properties-values-widget-view.component-D-aM64Hu.mjs.map +0 -1
- package/fesm2022/acorex-platform-widgets-extra-properties-widget-edit.component-em2-aU8E.mjs.map +0 -1
- package/fesm2022/acorex-platform-widgets-extra-properties-widget-view.component-BeuIofdr.mjs.map +0 -1
- package/fesm2022/acorex-platform-widgets-file-list-popup.component-Cmtq2bBV.mjs.map +0 -1
- package/fesm2022/acorex-platform-widgets-page-widget-designer.component-D8ivmxzT.mjs.map +0 -1
- package/fesm2022/acorex-platform-widgets-rich-text-popup.component-Cydlpsat.mjs +0 -40
- package/fesm2022/acorex-platform-widgets-rich-text-popup.component-Cydlpsat.mjs.map +0 -1
- package/fesm2022/acorex-platform-widgets-tabular-data-edit-popup.component-CMqq_iOj.mjs.map +0 -1
- package/fesm2022/acorex-platform-widgets-tabular-data-view-popup.component-Dmg5DdX8.mjs.map +0 -1
- package/fesm2022/acorex-platform-widgets-text-block-widget-designer.component-yADN3Xji.mjs.map +0 -1
- package/fesm2022/acorex-platform-widgets.mjs.map +0 -1
- package/widgets/README.md +0 -4
|
@@ -1,57 +1,451 @@
|
|
|
1
|
+
import { AXPSessionService, AXPAuthGuard } from '@acorex/platform/auth';
|
|
1
2
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
3
|
+
import { inject, Injectable, input, viewChild, signal, ElementRef, ChangeDetectionStrategy, Component, ApplicationRef, EnvironmentInjector, createComponent, InjectionToken, computed, Injector, runInInjectionContext, viewChildren, linkedSignal, effect, untracked, HostBinding, ViewChild, NgModule } from '@angular/core';
|
|
4
|
+
import { Router, RouterModule, ROUTES } from '@angular/router';
|
|
5
|
+
import * as i3 from '@acorex/components/button';
|
|
6
|
+
import { AXButtonModule } from '@acorex/components/button';
|
|
7
|
+
import * as i4 from '@acorex/components/loading';
|
|
8
|
+
import { AXLoadingModule } from '@acorex/components/loading';
|
|
9
|
+
import * as i2 from '@acorex/components/popover';
|
|
10
|
+
import { AXPopoverModule } from '@acorex/components/popover';
|
|
11
|
+
import * as i6 from '@acorex/core/translation';
|
|
12
|
+
import { AXTranslationModule, AXTranslationService } from '@acorex/core/translation';
|
|
13
|
+
import * as i3$1 from '@acorex/platform/layout/widget-core';
|
|
14
|
+
import { AXPWidgetsCatalog, AXPWidgetCoreModule, AXPPageStatus, AXPWidgetRegistryService, AXPValueWidgetComponent, AXPWidgetRendererDirective, AXPWidgetGroupEnum, AXPLayoutBaseWidgetComponent, AXPColumnWidgetComponent, AXP_WIDGETS_EDITOR_CATEGORY } from '@acorex/platform/layout/widget-core';
|
|
15
|
+
import { AXPCommandService, AXPQueryService, provideCommandSetups, provideQuerySetups } from '@acorex/platform/runtime';
|
|
16
|
+
import * as i5 from '@angular/common';
|
|
17
|
+
import { CommonModule } from '@angular/common';
|
|
18
|
+
import { castArray, get, cloneDeep, set, merge, isEqual, isNil, isEmpty, sortBy } from 'lodash-es';
|
|
4
19
|
import { AXDataSource } from '@acorex/cdk/common';
|
|
5
20
|
import { AXFormatService } from '@acorex/core/format';
|
|
6
|
-
import
|
|
21
|
+
import * as i4$1 from '@acorex/platform/common';
|
|
22
|
+
import { AXPFilterOperatorMiddlewareService, AXPEntityCommandScope, getEntityInfo, AXPSettingService, AXPRefreshEvent, AXPReloadEvent, AXPCommonSettings, AXPCleanNestedFilters, AXPWorkflowNavigateAction, AXPToastAction, AXP_SEARCH_DEFINITION_PROVIDER } from '@acorex/platform/common';
|
|
7
23
|
import * as i1$2 from '@acorex/platform/core';
|
|
8
|
-
import { resolveActionLook, AXPExpressionEvaluatorService,
|
|
24
|
+
import { resolveActionLook, AXPExpressionEvaluatorService, AXPDistributedEventListenerService, AXPBroadcastEventService, AXPPlatformScope, getChangedPaths, extractValue, setSmart, AXPSystemActionType } from '@acorex/platform/core';
|
|
9
25
|
import * as i2$2 from '@acorex/platform/workflow';
|
|
10
26
|
import { AXPWorkflowService, ofType, createWorkFlowEvent, AXPWorkflowAction, AXPWorkflowModule } from '@acorex/platform/workflow';
|
|
11
|
-
import * as i3$1 from '@acorex/platform/layout/builder';
|
|
12
|
-
import { AXPPageStatus, AXPWidgetRegistryService, AXPWidgetsCatalog, AXPValueWidgetComponent, AXPWidgetRendererDirective, AXPLayoutBuilderModule, AXPWidgetGroupEnum, AXPLayoutBaseWidgetComponent, AXPColumnWidgetComponent, AXP_WIDGETS_EDITOR_CATEGORY } from '@acorex/platform/layout/builder';
|
|
13
27
|
import { AXPLayoutThemeService } from '@acorex/platform/themes/shared';
|
|
14
28
|
import { Subject, takeUntil } from 'rxjs';
|
|
15
|
-
import { AXPSessionService, AXPAuthGuard } from '@acorex/platform/auth';
|
|
16
|
-
import { AXPCommandService, AXPQueryService, provideCommandSetups, provideQuerySetups } from '@acorex/platform/runtime';
|
|
17
29
|
import { moveItemInArray } from '@angular/cdk/drag-drop';
|
|
18
|
-
import * as i6 from '@acorex/core/translation';
|
|
19
|
-
import { AXTranslationService, AXTranslationModule } from '@acorex/core/translation';
|
|
20
30
|
import { AXDialogService } from '@acorex/components/dialog';
|
|
21
31
|
import { AXLoadingDialogService } from '@acorex/components/loading-dialog';
|
|
22
32
|
import { AXPopupService } from '@acorex/components/popup';
|
|
23
33
|
import { AXPlatform } from '@acorex/core/platform';
|
|
24
|
-
import
|
|
25
|
-
import * as i3$2 from '@acorex/components/button';
|
|
26
|
-
import { AXButtonModule } from '@acorex/components/button';
|
|
27
|
-
import * as i3 from '@acorex/components/decorators';
|
|
34
|
+
import * as i3$2 from '@acorex/components/decorators';
|
|
28
35
|
import { AXDecoratorModule } from '@acorex/components/decorators';
|
|
29
|
-
import * as i4 from '@acorex/components/dropdown';
|
|
36
|
+
import * as i4$2 from '@acorex/components/dropdown';
|
|
30
37
|
import { AXDropdownModule } from '@acorex/components/dropdown';
|
|
31
|
-
import
|
|
32
|
-
import { CommonModule } from '@angular/common';
|
|
33
|
-
import { AXP_NAME_PROPERTY, AXP_DATA_PATH_PROPERTY, AXP_DISABLED_PROPERTY, AXP_ALLOW_CLEAR_PROPERTY, AXP_DATA_PROPERTY_GROUP, AXP_ALLOW_MULTIPLE_PROPERTY, AXPFileUploaderWidgetService } from '@acorex/platform/widgets';
|
|
38
|
+
import { AXP_NAME_PROPERTY, AXP_DATA_PATH_PROPERTY, AXP_DISABLED_PROPERTY, AXP_ALLOW_CLEAR_PROPERTY, AXP_DATA_PROPERTY_GROUP, AXP_ALLOW_MULTIPLE_PROPERTY, AXPFileUploaderWidgetService } from '@acorex/platform/layout/widgets';
|
|
34
39
|
import * as i1$1 from '@angular/forms';
|
|
35
40
|
import { FormsModule } from '@angular/forms';
|
|
36
|
-
import * as i4$1 from '@acorex/components/loading';
|
|
37
|
-
import { AXLoadingModule } from '@acorex/components/loading';
|
|
38
|
-
import * as i1 from '@acorex/components/badge';
|
|
39
|
-
import { AXBadgeModule } from '@acorex/components/badge';
|
|
40
41
|
import * as i5$1 from '@acorex/components/form';
|
|
41
42
|
import { AXFormModule } from '@acorex/components/form';
|
|
42
|
-
import * as i6$2 from '@acorex/components/search-box';
|
|
43
|
-
import { AXSearchBoxComponent, AXSearchBoxModule } from '@acorex/components/search-box';
|
|
44
43
|
import * as i7 from '@acorex/components/select-box';
|
|
45
44
|
import { AXSelectBoxModule } from '@acorex/components/select-box';
|
|
45
|
+
import * as i2$1 from '@acorex/components/text-box';
|
|
46
|
+
import { AXTextBoxModule, AXTextBoxComponent } from '@acorex/components/text-box';
|
|
47
|
+
import { AXValidationModule } from '@acorex/core/validation';
|
|
48
|
+
import * as i1 from '@acorex/components/badge';
|
|
49
|
+
import { AXBadgeModule } from '@acorex/components/badge';
|
|
50
|
+
import * as i6$2 from '@acorex/components/search-box';
|
|
51
|
+
import { AXSearchBoxComponent, AXSearchBoxModule } from '@acorex/components/search-box';
|
|
46
52
|
import * as i6$1 from '@acorex/components/tag-box';
|
|
47
53
|
import { AXTagBoxComponent, AXTagBoxModule } from '@acorex/components/tag-box';
|
|
48
|
-
import { AXValidationModule } from '@acorex/core/validation';
|
|
49
54
|
import { AXPDataSelectorService, AXPWidgetPropertyViewerComponent } from '@acorex/platform/layout/components';
|
|
50
|
-
import
|
|
51
|
-
import {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
+
import { AXPLayoutBuilderService } from '@acorex/platform/layout/builder';
|
|
56
|
+
import { transform, isEqual as isEqual$1 } from 'lodash';
|
|
57
|
+
|
|
58
|
+
//#endregion
|
|
59
|
+
//#region ---- Entity Open Details Command ----
|
|
60
|
+
/**
|
|
61
|
+
* Generic command to open entity details view
|
|
62
|
+
* Can be used by any entity to navigate to its detail page
|
|
63
|
+
*/
|
|
64
|
+
class AXPOpenEntityDetailsCommand {
|
|
65
|
+
constructor() {
|
|
66
|
+
//#endregion
|
|
67
|
+
//#region ---- Services & Dependencies ----
|
|
68
|
+
this.router = inject(Router);
|
|
69
|
+
this.sessionService = inject(AXPSessionService);
|
|
70
|
+
}
|
|
71
|
+
//#endregion
|
|
72
|
+
//#region ---- Command Execution ----
|
|
73
|
+
/**
|
|
74
|
+
* Execute the command to navigate to entity details
|
|
75
|
+
* @param input - Command input containing entity and data information
|
|
76
|
+
*/
|
|
77
|
+
async execute(input) {
|
|
78
|
+
const { entity, data } = input;
|
|
79
|
+
if (!entity) {
|
|
80
|
+
throw new Error('Entity name is required for opening details view');
|
|
81
|
+
}
|
|
82
|
+
if (!data?.id) {
|
|
83
|
+
throw new Error('Entity ID is required for opening details view');
|
|
84
|
+
}
|
|
85
|
+
const [module, entityName] = entity.split('.');
|
|
86
|
+
if (!module || !entityName) {
|
|
87
|
+
throw new Error('Entity must be in format "ModuleName.EntityName"');
|
|
88
|
+
}
|
|
89
|
+
const url = `/${this.sessionService.application?.name}/m/${module}/e/${entityName}/${data.id}/new-view`;
|
|
90
|
+
// Navigate to the entity details page
|
|
91
|
+
this.router.navigate([url]);
|
|
92
|
+
return { success: true };
|
|
93
|
+
}
|
|
94
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPOpenEntityDetailsCommand, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
95
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPOpenEntityDetailsCommand, providedIn: 'root' }); }
|
|
96
|
+
}
|
|
97
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPOpenEntityDetailsCommand, decorators: [{
|
|
98
|
+
type: Injectable,
|
|
99
|
+
args: [{ providedIn: 'root' }]
|
|
100
|
+
}] });
|
|
101
|
+
|
|
102
|
+
var openEntityDetails_command = /*#__PURE__*/Object.freeze({
|
|
103
|
+
__proto__: null,
|
|
104
|
+
AXPOpenEntityDetailsCommand: AXPOpenEntityDetailsCommand
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
class AXPEntityDetailPopoverComponent {
|
|
108
|
+
constructor() {
|
|
109
|
+
//#region ---- Dependencies ----
|
|
110
|
+
this.commandService = inject(AXPCommandService);
|
|
111
|
+
this.queryService = inject(AXPQueryService);
|
|
112
|
+
//#endregion
|
|
113
|
+
//#region ---- Inputs ----
|
|
114
|
+
this.entity = input.required(...(ngDevMode ? [{ debugName: "entity" }] : []));
|
|
115
|
+
this.entityId = input.required(...(ngDevMode ? [{ debugName: "entityId" }] : []));
|
|
116
|
+
this.textField = input('title', ...(ngDevMode ? [{ debugName: "textField" }] : []));
|
|
117
|
+
this.valueField = input('id', ...(ngDevMode ? [{ debugName: "valueField" }] : []));
|
|
118
|
+
this.item = input(...(ngDevMode ? [undefined, { debugName: "item" }] : []));
|
|
119
|
+
//#endregion
|
|
120
|
+
//#region ---- View Children ----
|
|
121
|
+
this.detailPopover = viewChild('detailPopover', ...(ngDevMode ? [{ debugName: "detailPopover" }] : []));
|
|
122
|
+
//#endregion
|
|
123
|
+
//#region ---- Signals ----
|
|
124
|
+
this.entityDetails = signal(null, ...(ngDevMode ? [{ debugName: "entityDetails" }] : []));
|
|
125
|
+
this.isLoadingDetails = signal(false, ...(ngDevMode ? [{ debugName: "isLoadingDetails" }] : []));
|
|
126
|
+
this.isDetailPopoverOpen = signal(false, ...(ngDevMode ? [{ debugName: "isDetailPopoverOpen" }] : []));
|
|
127
|
+
}
|
|
128
|
+
//#endregion
|
|
129
|
+
//#region ---- Public Methods ----
|
|
130
|
+
/**
|
|
131
|
+
* Show the entity detail popover
|
|
132
|
+
*/
|
|
133
|
+
async show(target) {
|
|
134
|
+
this.isDetailPopoverOpen.set(true);
|
|
135
|
+
this.isLoadingDetails.set(true);
|
|
136
|
+
this.entityDetails.set(null);
|
|
137
|
+
// Open the popover immediately to display loading state
|
|
138
|
+
if (this.detailPopover()) {
|
|
139
|
+
const targetElement = target instanceof ElementRef ? target.nativeElement : target;
|
|
140
|
+
this.detailPopover().target = targetElement;
|
|
141
|
+
this.detailPopover().open();
|
|
142
|
+
}
|
|
143
|
+
else {
|
|
144
|
+
// In case the view child is not ready yet, schedule an immediate open
|
|
145
|
+
setTimeout(() => {
|
|
146
|
+
if (this.detailPopover()) {
|
|
147
|
+
const targetElement = target instanceof ElementRef ? target.nativeElement : target;
|
|
148
|
+
this.detailPopover().target = targetElement;
|
|
149
|
+
this.detailPopover().open();
|
|
150
|
+
}
|
|
151
|
+
}, 0);
|
|
152
|
+
}
|
|
153
|
+
// Fetch entity details using the query
|
|
154
|
+
try {
|
|
155
|
+
const result = await this.queryService.fetch('Entity:GetDetails', {
|
|
156
|
+
entity: this.entity(),
|
|
157
|
+
id: this.entityId(),
|
|
158
|
+
});
|
|
159
|
+
if (result?.success) {
|
|
160
|
+
this.entityDetails.set(result);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
catch (error) {
|
|
164
|
+
console.error('Failed to fetch entity details:', error);
|
|
165
|
+
}
|
|
166
|
+
finally {
|
|
167
|
+
this.isLoadingDetails.set(false);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Hide the entity detail popover
|
|
172
|
+
*/
|
|
173
|
+
hide() {
|
|
174
|
+
this.isDetailPopoverOpen.set(false);
|
|
175
|
+
this.entityDetails.set(null);
|
|
176
|
+
this.isLoadingDetails.set(false);
|
|
177
|
+
if (this.detailPopover()) {
|
|
178
|
+
this.detailPopover().close();
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
onDetailPopoverOpenChange(event) {
|
|
182
|
+
this.isDetailPopoverOpen.set(event);
|
|
183
|
+
if (!event) {
|
|
184
|
+
this.entityDetails.set(null);
|
|
185
|
+
this.isLoadingDetails.set(false);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
async navigateToDetails() {
|
|
189
|
+
if (this.entityId()) {
|
|
190
|
+
await this.commandService.execute('Entity:OpenDetails', {
|
|
191
|
+
entity: this.entity(),
|
|
192
|
+
data: { id: this.entityId() },
|
|
193
|
+
});
|
|
194
|
+
this.hide();
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
//#endregion
|
|
198
|
+
//#region ---- Helper Methods ----
|
|
199
|
+
/**
|
|
200
|
+
* Returns true if a value is meaningful for display (non-empty/non-null).
|
|
201
|
+
*/
|
|
202
|
+
hasMeaningfulValue(value) {
|
|
203
|
+
if (value === null || value === undefined)
|
|
204
|
+
return false;
|
|
205
|
+
if (typeof value === 'string')
|
|
206
|
+
return value.trim().length > 0;
|
|
207
|
+
if (Array.isArray(value))
|
|
208
|
+
return value.length > 0;
|
|
209
|
+
if (typeof value === 'object')
|
|
210
|
+
return Object.keys(value).length > 0;
|
|
211
|
+
return true;
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* Calculates an importance score for a property based on its widget type,
|
|
215
|
+
* whether it currently has a meaningful value, and metadata like title.
|
|
216
|
+
*/
|
|
217
|
+
getPropertyImportanceScore(prop, data) {
|
|
218
|
+
const schema = prop.showAs?.type ?? prop.schema;
|
|
219
|
+
const importanceMap = {
|
|
220
|
+
[AXPWidgetsCatalog.text]: 100,
|
|
221
|
+
[AXPWidgetsCatalog.select]: 95,
|
|
222
|
+
[AXPWidgetsCatalog.number]: 90,
|
|
223
|
+
[AXPWidgetsCatalog.dateTime]: 85,
|
|
224
|
+
[AXPWidgetsCatalog.richText]: 80,
|
|
225
|
+
[AXPWidgetsCatalog.largeText]: 75,
|
|
226
|
+
[AXPWidgetsCatalog.contact]: 74,
|
|
227
|
+
[AXPWidgetsCatalog.toggle]: 65,
|
|
228
|
+
[AXPWidgetsCatalog.checkbox]: 60,
|
|
229
|
+
[AXPWidgetsCatalog.color]: 40,
|
|
230
|
+
};
|
|
231
|
+
let score = importanceMap[schema] ?? 50;
|
|
232
|
+
// Prefer fields that actually have a value for the current entity
|
|
233
|
+
if (this.hasMeaningfulValue(data?.[prop.name])) {
|
|
234
|
+
score += 20;
|
|
235
|
+
}
|
|
236
|
+
// Slight preference for human-friendly titled fields
|
|
237
|
+
const hasTitle = prop.title && prop.title !== prop.name;
|
|
238
|
+
if (hasTitle) {
|
|
239
|
+
score += 5;
|
|
240
|
+
}
|
|
241
|
+
return score;
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* Calculates a name-based importance score to prioritize common key fields
|
|
245
|
+
* like title, description, status, and important dates.
|
|
246
|
+
* Name priority MUST come before widget-type priority.
|
|
247
|
+
*/
|
|
248
|
+
getNameImportanceScore(prop) {
|
|
249
|
+
const rawName = (prop.options?.dataPath ?? prop.name ?? '').toString();
|
|
250
|
+
const normalized = rawName.toLowerCase();
|
|
251
|
+
const collapsed = normalized.replace(/[^a-z0-9]/g, '');
|
|
252
|
+
const priorities = [
|
|
253
|
+
{ keys: ['title', 'name', 'subject', 'code'], score: 120 },
|
|
254
|
+
{ keys: ['description', 'details', 'summary', 'remark', 'remarks'], score: 110 },
|
|
255
|
+
{ keys: ['status', 'state', 'phase', 'stage'], score: 105 },
|
|
256
|
+
{ keys: ['priority', 'severity', 'rank'], score: 100 },
|
|
257
|
+
{ keys: ['expirydate', 'expirationdate', 'expiredate', 'duedate', 'deadline', 'enddate'], score: 98 },
|
|
258
|
+
{ keys: ['startdate', 'createdat', 'createdon', 'updatedat', 'updatedon'], score: 95 },
|
|
259
|
+
{ keys: ['owner', 'assignee', 'assignedto'], score: 92 },
|
|
260
|
+
{ keys: ['email', 'phone', 'mobile', 'contact'], score: 90 },
|
|
261
|
+
{ keys: ['category', 'type', 'label', 'tag', 'note', 'notes'], score: 85 },
|
|
262
|
+
{ keys: ['primary', 'active', 'active', 'enabled', 'archived', 'deleted', 'locked', 'disabled'], score: -2 }, // send to bottom,
|
|
263
|
+
];
|
|
264
|
+
for (const group of priorities) {
|
|
265
|
+
for (const key of group.keys) {
|
|
266
|
+
if (collapsed === key || collapsed.endsWith(key)) {
|
|
267
|
+
return group.score;
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
// Pattern-based priorities (generic forms like validFrom/validTo, start*/end*)
|
|
272
|
+
if (collapsed.endsWith('from') || collapsed.endsWith('to')) {
|
|
273
|
+
return 97;
|
|
274
|
+
}
|
|
275
|
+
if (collapsed.startsWith('start') || collapsed.startsWith('end')) {
|
|
276
|
+
return 96;
|
|
277
|
+
}
|
|
278
|
+
return 0;
|
|
279
|
+
}
|
|
280
|
+
getEntityPropertiesWithWidgets() {
|
|
281
|
+
const data = this.entityDetails()?.entityData;
|
|
282
|
+
const entityDefinition = this.entityDetails()?.entityDefinition;
|
|
283
|
+
if (!data || !entityDefinition?.properties)
|
|
284
|
+
return [];
|
|
285
|
+
// Get properties from entity definition and filter by importance
|
|
286
|
+
const importantProperties = (entityDefinition.columns ?? [])
|
|
287
|
+
.map((prop, index) => {
|
|
288
|
+
const propName = prop.options?.dataPath ?? prop.name;
|
|
289
|
+
const schema = prop.showAs?.type ?? entityDefinition.properties.find((p) => p.name === propName)?.schema.interface?.type;
|
|
290
|
+
const title = prop.title ?? entityDefinition.properties.find((p) => p.name === propName)?.title ?? prop.name;
|
|
291
|
+
return {
|
|
292
|
+
...prop,
|
|
293
|
+
schema,
|
|
294
|
+
title,
|
|
295
|
+
orderIndex: index,
|
|
296
|
+
};
|
|
297
|
+
})
|
|
298
|
+
.filter((prop) => {
|
|
299
|
+
// Exclude technical fields
|
|
300
|
+
if (prop.name === 'id' || prop.name === this.textField() || prop.name === this.valueField()) {
|
|
301
|
+
return false;
|
|
302
|
+
}
|
|
303
|
+
// Only include properties that exist in the data
|
|
304
|
+
if (!data.hasOwnProperty(prop.name)) {
|
|
305
|
+
return false;
|
|
306
|
+
}
|
|
307
|
+
// Filter by property importance based on schema and options
|
|
308
|
+
const schema = prop.showAs?.type ?? entityDefinition.properties.find((p) => p.name === prop.name)?.schema.interface?.type;
|
|
309
|
+
// Include common important field types
|
|
310
|
+
const importantWidgets = [
|
|
311
|
+
AXPWidgetsCatalog.text,
|
|
312
|
+
AXPWidgetsCatalog.largeText,
|
|
313
|
+
AXPWidgetsCatalog.richText,
|
|
314
|
+
//
|
|
315
|
+
AXPWidgetsCatalog.select,
|
|
316
|
+
//AXPWidgetsCatalog.lookup,
|
|
317
|
+
//
|
|
318
|
+
AXPWidgetsCatalog.number,
|
|
319
|
+
AXPWidgetsCatalog.toggle,
|
|
320
|
+
AXPWidgetsCatalog.checkbox,
|
|
321
|
+
//
|
|
322
|
+
AXPWidgetsCatalog.dateTime,
|
|
323
|
+
AXPWidgetsCatalog.color,
|
|
324
|
+
AXPWidgetsCatalog.contact,
|
|
325
|
+
];
|
|
326
|
+
//
|
|
327
|
+
if (importantWidgets.includes(schema)) {
|
|
328
|
+
return true;
|
|
329
|
+
}
|
|
330
|
+
return false;
|
|
331
|
+
})
|
|
332
|
+
.sort((a, b) => {
|
|
333
|
+
// Primary: name-based importance
|
|
334
|
+
const nameScoreA = this.getNameImportanceScore(a);
|
|
335
|
+
const nameScoreB = this.getNameImportanceScore(b);
|
|
336
|
+
if (nameScoreA !== nameScoreB)
|
|
337
|
+
return nameScoreB - nameScoreA;
|
|
338
|
+
// Secondary: widget/value/title based importance
|
|
339
|
+
const widgetScoreA = this.getPropertyImportanceScore(a, data);
|
|
340
|
+
const widgetScoreB = this.getPropertyImportanceScore(b, data);
|
|
341
|
+
if (widgetScoreA !== widgetScoreB)
|
|
342
|
+
return widgetScoreB - widgetScoreA;
|
|
343
|
+
const aHasValue = this.hasMeaningfulValue(data?.[a.name]);
|
|
344
|
+
const bHasValue = this.hasMeaningfulValue(data?.[b.name]);
|
|
345
|
+
if (aHasValue !== bHasValue)
|
|
346
|
+
return aHasValue ? -1 : 1;
|
|
347
|
+
const aHasTitle = a.title && a.title !== a.name;
|
|
348
|
+
const bHasTitle = b.title && b.title !== b.name;
|
|
349
|
+
if (aHasTitle !== bHasTitle)
|
|
350
|
+
return aHasTitle ? -1 : 1;
|
|
351
|
+
if ((a.orderIndex ?? 0) !== (b.orderIndex ?? 0))
|
|
352
|
+
return (a.orderIndex ?? 0) - (b.orderIndex ?? 0);
|
|
353
|
+
return a.name.localeCompare(b.name);
|
|
354
|
+
})
|
|
355
|
+
.map((prop) => {
|
|
356
|
+
// Create widget node based on property schema
|
|
357
|
+
const widgetNode = {
|
|
358
|
+
type: prop.schema || AXPWidgetsCatalog.text,
|
|
359
|
+
path: prop.options?.dataPath || prop.name,
|
|
360
|
+
options: prop.options ?? {},
|
|
361
|
+
mode: 'view',
|
|
362
|
+
};
|
|
363
|
+
return {
|
|
364
|
+
name: prop.name,
|
|
365
|
+
title: prop.title || prop.name,
|
|
366
|
+
node: widgetNode,
|
|
367
|
+
};
|
|
368
|
+
})
|
|
369
|
+
.slice(0, 7); // Limit to 7 most important fields
|
|
370
|
+
return importantProperties;
|
|
371
|
+
}
|
|
372
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPEntityDetailPopoverComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
373
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.4", type: AXPEntityDetailPopoverComponent, isStandalone: true, selector: "axp-entity-detail-popover", inputs: { entity: { classPropertyName: "entity", publicName: "entity", isSignal: true, isRequired: true, transformFunction: null }, entityId: { classPropertyName: "entityId", publicName: "entityId", isSignal: true, isRequired: true, transformFunction: null }, textField: { classPropertyName: "textField", publicName: "textField", isSignal: true, isRequired: false, transformFunction: null }, valueField: { classPropertyName: "valueField", publicName: "valueField", isSignal: true, isRequired: false, transformFunction: null }, item: { classPropertyName: "item", publicName: "item", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "detailPopover", first: true, predicate: ["detailPopover"], descendants: true, isSignal: true }], ngImport: i0, template: "<ax-popover [openOn]=\"'manual'\" #detailPopover (openChange)=\"onDetailPopoverOpenChange($event)\">\n <div class=\"ax-lightest-surface ax-border ax-rounded-lg ax-shadow-lg ax-p-4 ax-min-w-[400px]\">\n <div class=\"ax-mb-4 ax-border-b ax-pb-2\">\n <h3 class=\"ax-text-base ax-font-semibold ax-text-on-lightest-surface\">\n @if (entityDetails()?.entityData?.[textField()]) {\n {{ entityDetails()?.entityData[textField()] }}\n } @else {\n {{ item()?.[textField()] }}\n }\n </h3>\n </div>\n @if (isLoadingDetails()) {\n <div class=\"ax-flex ax-items-center ax-justify-center ax-py-8\">\n <ax-loading>Loading details...</ax-loading>\n </div>\n } @else if (entityDetails()) {\n <div class=\"ax-space-y-3 ax-mb-4\">\n <!-- Important Entity Data -->\n @if (entityDetails()?.entityData) {\n <axp-widgets-container [context]=\"entityDetails()?.entityData\">\n <div class=\"ax-space-y-2\">\n @for (item of getEntityPropertiesWithWidgets(); track item.name) {\n <div class=\"ax-flex ax-justify-between ax-items-center\">\n <span class=\"ax-text-sm ax-font-medium\">{{ item.title | translate | async }}:</span>\n <div class=\"ax-flex-1 ax-ml-2 ax-max-w-48\">\n <ng-container axp-widget-renderer [node]=\"item.node\" [mode]=\"'view'\"></ng-container>\n </div>\n </div>\n }\n </div>\n </axp-widgets-container>\n }\n </div>\n <div class=\"ax-flex ax-gap-2 ax-justify-end ax-sm\">\n <ax-button [color]=\"'primary'\" [look]=\"'solid'\" text=\"Open Details\" (click)=\"navigateToDetails()\"> </ax-button>\n </div>\n }\n </div>\n</ax-popover>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i3.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "iconOnly", "type", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "loadingTextChange"] }, { kind: "ngmodule", type: AXPopoverModule }, { kind: "component", type: i2.AXPopoverComponent, selector: "ax-popover", inputs: ["width", "disabled", "offsetX", "offsetY", "target", "placement", "content", "openOn", "closeOn", "hasBackdrop", "openAfter", "closeAfter", "backdropClass", "panelClass", "adaptivityEnabled"], outputs: ["onOpened", "onClosed"] }, { kind: "ngmodule", type: AXPWidgetCoreModule }, { kind: "component", type: i3$1.AXPWidgetContainerComponent, selector: "axp-widgets-container", inputs: ["context", "functions"], outputs: ["onContextChanged"] }, { kind: "directive", type: i3$1.AXPWidgetRendererDirective, selector: "[axp-widget-renderer]", inputs: ["parentNode", "index", "mode", "node"], outputs: ["onOptionsChanged", "onValueChanged"], exportAs: ["widgetRenderer"] }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "ngmodule", type: AXLoadingModule }, { kind: "component", type: i4.AXLoadingComponent, selector: "ax-loading", inputs: ["visible", "type", "context"], outputs: ["visibleChange"] }, { kind: "pipe", type: i5.AsyncPipe, name: "async" }, { kind: "pipe", type: i6.AXTranslatorPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
374
|
+
}
|
|
375
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPEntityDetailPopoverComponent, decorators: [{
|
|
376
|
+
type: Component,
|
|
377
|
+
args: [{ selector: 'axp-entity-detail-popover', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
|
378
|
+
CommonModule,
|
|
379
|
+
AXButtonModule,
|
|
380
|
+
AXPopoverModule,
|
|
381
|
+
AXPWidgetCoreModule,
|
|
382
|
+
AXTranslationModule,
|
|
383
|
+
AXLoadingModule,
|
|
384
|
+
], template: "<ax-popover [openOn]=\"'manual'\" #detailPopover (openChange)=\"onDetailPopoverOpenChange($event)\">\n <div class=\"ax-lightest-surface ax-border ax-rounded-lg ax-shadow-lg ax-p-4 ax-min-w-[400px]\">\n <div class=\"ax-mb-4 ax-border-b ax-pb-2\">\n <h3 class=\"ax-text-base ax-font-semibold ax-text-on-lightest-surface\">\n @if (entityDetails()?.entityData?.[textField()]) {\n {{ entityDetails()?.entityData[textField()] }}\n } @else {\n {{ item()?.[textField()] }}\n }\n </h3>\n </div>\n @if (isLoadingDetails()) {\n <div class=\"ax-flex ax-items-center ax-justify-center ax-py-8\">\n <ax-loading>Loading details...</ax-loading>\n </div>\n } @else if (entityDetails()) {\n <div class=\"ax-space-y-3 ax-mb-4\">\n <!-- Important Entity Data -->\n @if (entityDetails()?.entityData) {\n <axp-widgets-container [context]=\"entityDetails()?.entityData\">\n <div class=\"ax-space-y-2\">\n @for (item of getEntityPropertiesWithWidgets(); track item.name) {\n <div class=\"ax-flex ax-justify-between ax-items-center\">\n <span class=\"ax-text-sm ax-font-medium\">{{ item.title | translate | async }}:</span>\n <div class=\"ax-flex-1 ax-ml-2 ax-max-w-48\">\n <ng-container axp-widget-renderer [node]=\"item.node\" [mode]=\"'view'\"></ng-container>\n </div>\n </div>\n }\n </div>\n </axp-widgets-container>\n }\n </div>\n <div class=\"ax-flex ax-gap-2 ax-justify-end ax-sm\">\n <ax-button [color]=\"'primary'\" [look]=\"'solid'\" text=\"Open Details\" (click)=\"navigateToDetails()\"> </ax-button>\n </div>\n }\n </div>\n</ax-popover>\n" }]
|
|
385
|
+
}] });
|
|
386
|
+
|
|
387
|
+
class AXPEntityDetailPopoverService {
|
|
388
|
+
constructor() {
|
|
389
|
+
//#region ---- Dependencies ----
|
|
390
|
+
this.applicationRef = inject(ApplicationRef);
|
|
391
|
+
this.environmentInjector = inject(EnvironmentInjector);
|
|
392
|
+
//#endregion
|
|
393
|
+
//#region ---- Private Properties ----
|
|
394
|
+
this.activePopoverRef = null;
|
|
395
|
+
}
|
|
396
|
+
//#endregion
|
|
397
|
+
//#region ---- Public Methods ----
|
|
398
|
+
/**
|
|
399
|
+
* Show entity detail popover
|
|
400
|
+
* @param target - The target element to position the popover
|
|
401
|
+
* @param options - Configuration options for the popover
|
|
402
|
+
*/
|
|
403
|
+
async show(target, options) {
|
|
404
|
+
// Close any existing popover
|
|
405
|
+
this.hide();
|
|
406
|
+
// Create component dynamically
|
|
407
|
+
this.activePopoverRef = createComponent(AXPEntityDetailPopoverComponent, {
|
|
408
|
+
environmentInjector: this.environmentInjector,
|
|
409
|
+
});
|
|
410
|
+
// Set inputs
|
|
411
|
+
this.activePopoverRef.setInput('entity', options.entity);
|
|
412
|
+
this.activePopoverRef.setInput('entityId', options.id);
|
|
413
|
+
this.activePopoverRef.setInput('textField', options.textField || 'title');
|
|
414
|
+
this.activePopoverRef.setInput('valueField', options.valueField || 'id');
|
|
415
|
+
this.activePopoverRef.setInput('item', options.item);
|
|
416
|
+
// Attach to application
|
|
417
|
+
this.applicationRef.attachView(this.activePopoverRef.hostView);
|
|
418
|
+
// Append to document body
|
|
419
|
+
document.body.appendChild(this.activePopoverRef.location.nativeElement);
|
|
420
|
+
// Show the popover
|
|
421
|
+
await this.activePopoverRef.instance.show(target);
|
|
422
|
+
}
|
|
423
|
+
/**
|
|
424
|
+
* Hide the active popover
|
|
425
|
+
*/
|
|
426
|
+
hide() {
|
|
427
|
+
if (this.activePopoverRef) {
|
|
428
|
+
this.activePopoverRef.instance.hide();
|
|
429
|
+
this.applicationRef.detachView(this.activePopoverRef.hostView);
|
|
430
|
+
this.activePopoverRef.destroy();
|
|
431
|
+
this.activePopoverRef = null;
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
/**
|
|
435
|
+
* Check if a popover is currently active
|
|
436
|
+
*/
|
|
437
|
+
get isActive() {
|
|
438
|
+
return this.activePopoverRef !== null;
|
|
439
|
+
}
|
|
440
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPEntityDetailPopoverService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
441
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPEntityDetailPopoverService, providedIn: 'root' }); }
|
|
442
|
+
}
|
|
443
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPEntityDetailPopoverService, decorators: [{
|
|
444
|
+
type: Injectable,
|
|
445
|
+
args: [{
|
|
446
|
+
providedIn: 'root'
|
|
447
|
+
}]
|
|
448
|
+
}] });
|
|
55
449
|
|
|
56
450
|
const AXP_DATA_SEEDER_TOKEN = new InjectionToken('AXP_DATA_SEEDER_TOKEN');
|
|
57
451
|
class AXPDataSeederService {
|
|
@@ -63,10 +457,10 @@ class AXPDataSeederService {
|
|
|
63
457
|
await loader?.seed();
|
|
64
458
|
}
|
|
65
459
|
}
|
|
66
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
67
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.
|
|
460
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPDataSeederService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
461
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPDataSeederService, providedIn: 'root' }); }
|
|
68
462
|
}
|
|
69
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
463
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPDataSeederService, decorators: [{
|
|
70
464
|
type: Injectable,
|
|
71
465
|
args: [{ providedIn: 'root' }]
|
|
72
466
|
}] });
|
|
@@ -91,10 +485,10 @@ class AXPEntityResolver {
|
|
|
91
485
|
}
|
|
92
486
|
return null;
|
|
93
487
|
}
|
|
94
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
95
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.
|
|
488
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPEntityResolver, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
489
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPEntityResolver, providedIn: 'root' }); }
|
|
96
490
|
}
|
|
97
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
491
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPEntityResolver, decorators: [{
|
|
98
492
|
type: Injectable,
|
|
99
493
|
args: [{ providedIn: 'root' }]
|
|
100
494
|
}] });
|
|
@@ -408,6 +802,83 @@ class AXPEntityDetailListViewModel {
|
|
|
408
802
|
}
|
|
409
803
|
}
|
|
410
804
|
|
|
805
|
+
/**
|
|
806
|
+
* Entity Event Dispatcher - A wrapper for entity-specific events
|
|
807
|
+
* Handles pattern-based dispatching for entity operations with wildcard support
|
|
808
|
+
*/
|
|
809
|
+
class AXPEntityEventDispatcherService {
|
|
810
|
+
constructor() {
|
|
811
|
+
this.eventService = inject(AXPDistributedEventListenerService);
|
|
812
|
+
}
|
|
813
|
+
async dispatchEntityEvent(operation, entityName, data) {
|
|
814
|
+
const enhancedData = {
|
|
815
|
+
...data,
|
|
816
|
+
entityName,
|
|
817
|
+
operation,
|
|
818
|
+
timestamp: new Date(),
|
|
819
|
+
source: 'entity-dispatcher',
|
|
820
|
+
};
|
|
821
|
+
const eventKeysToDispatch = await this.getAllMatchingEventKeys(operation, entityName);
|
|
822
|
+
const dispatchPromises = eventKeysToDispatch.map((key) => this.eventService.dispatch(key, enhancedData));
|
|
823
|
+
await Promise.all(dispatchPromises);
|
|
824
|
+
}
|
|
825
|
+
async getAllMatchingEventKeys(operation, entityName) {
|
|
826
|
+
const eventKeys = new Set();
|
|
827
|
+
const exactKeys = this.generateEventKeys(operation, entityName);
|
|
828
|
+
exactKeys.forEach((key) => eventKeys.add(key));
|
|
829
|
+
const wildcardKeys = await this.findMatchingWildcardKeys(operation, entityName);
|
|
830
|
+
wildcardKeys.forEach((key) => eventKeys.add(key));
|
|
831
|
+
return Array.from(eventKeys);
|
|
832
|
+
}
|
|
833
|
+
async findMatchingWildcardKeys(operation, entityName) {
|
|
834
|
+
const matchingKeys = [];
|
|
835
|
+
const allListenerKeys = await this.eventService.getRegisteredKeys();
|
|
836
|
+
const actualEventKey = `entity.${operation}.${entityName}`;
|
|
837
|
+
for (const listenerKey of allListenerKeys) {
|
|
838
|
+
if (listenerKey.includes('*') && this.matchesEntityPattern(actualEventKey, listenerKey)) {
|
|
839
|
+
matchingKeys.push(listenerKey);
|
|
840
|
+
}
|
|
841
|
+
}
|
|
842
|
+
return matchingKeys;
|
|
843
|
+
}
|
|
844
|
+
matchesEntityPattern(eventKey, pattern) {
|
|
845
|
+
if (!pattern.startsWith('entity.') || !pattern.includes('*')) {
|
|
846
|
+
return false;
|
|
847
|
+
}
|
|
848
|
+
const regexPattern = pattern.replace(/\./g, '\\.').replace(/\*/g, '.*');
|
|
849
|
+
const regex = new RegExp(`^${regexPattern}$`);
|
|
850
|
+
return regex.test(eventKey);
|
|
851
|
+
}
|
|
852
|
+
generateEventKeys(operation, entityName) {
|
|
853
|
+
const keys = [];
|
|
854
|
+
keys.push(`entity.${operation}`);
|
|
855
|
+
keys.push(`entity.${operation}.${entityName}`);
|
|
856
|
+
const entityParts = entityName.split('.');
|
|
857
|
+
if (entityParts.length > 1) {
|
|
858
|
+
const moduleName = entityParts[0];
|
|
859
|
+
keys.push(`entity.${operation}.${moduleName}`);
|
|
860
|
+
}
|
|
861
|
+
return keys;
|
|
862
|
+
}
|
|
863
|
+
async dispatchInserted(entityName, data) {
|
|
864
|
+
await this.dispatchEntityEvent('inserted', entityName, data);
|
|
865
|
+
}
|
|
866
|
+
async dispatchUpdated(entityName, data) {
|
|
867
|
+
await this.dispatchEntityEvent('updated', entityName, data);
|
|
868
|
+
}
|
|
869
|
+
async dispatchDeleted(entityName, data) {
|
|
870
|
+
await this.dispatchEntityEvent('deleted', entityName, data);
|
|
871
|
+
}
|
|
872
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPEntityEventDispatcherService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
873
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPEntityEventDispatcherService, providedIn: 'root' }); }
|
|
874
|
+
}
|
|
875
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPEntityEventDispatcherService, decorators: [{
|
|
876
|
+
type: Injectable,
|
|
877
|
+
args: [{
|
|
878
|
+
providedIn: 'root',
|
|
879
|
+
}]
|
|
880
|
+
}] });
|
|
881
|
+
|
|
411
882
|
function createModifierContext(entity) {
|
|
412
883
|
const ctx = {
|
|
413
884
|
entity,
|
|
@@ -709,10 +1180,10 @@ class AXPEntityMiddleware {
|
|
|
709
1180
|
const flags = rx.flags.replace('g', '');
|
|
710
1181
|
return new RegExp(rx.source, flags);
|
|
711
1182
|
}
|
|
712
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
713
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.
|
|
1183
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPEntityMiddleware, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1184
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPEntityMiddleware, providedIn: 'root' }); }
|
|
714
1185
|
}
|
|
715
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
1186
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPEntityMiddleware, decorators: [{
|
|
716
1187
|
type: Injectable,
|
|
717
1188
|
args: [{ providedIn: 'root' }]
|
|
718
1189
|
}], ctorParameters: () => [] });
|
|
@@ -864,10 +1335,10 @@ class AXPEntityDefinitionRegistryService {
|
|
|
864
1335
|
createEntityKey(moduleName, entityName) {
|
|
865
1336
|
return `${moduleName}.${entityName}`;
|
|
866
1337
|
}
|
|
867
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
868
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.
|
|
1338
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPEntityDefinitionRegistryService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1339
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPEntityDefinitionRegistryService, providedIn: 'root' }); }
|
|
869
1340
|
}
|
|
870
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
1341
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPEntityDefinitionRegistryService, decorators: [{
|
|
871
1342
|
type: Injectable,
|
|
872
1343
|
args: [{
|
|
873
1344
|
providedIn: 'root',
|
|
@@ -1028,10 +1499,10 @@ class AXPEntityCreateViewModelFactory {
|
|
|
1028
1499
|
this.layout.setNavigationLoading(false);
|
|
1029
1500
|
return new AXPEntityMasterCreateViewModel(this.injector, config, initialData, options);
|
|
1030
1501
|
}
|
|
1031
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
1032
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.
|
|
1502
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPEntityCreateViewModelFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1503
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPEntityCreateViewModelFactory, providedIn: 'root' }); }
|
|
1033
1504
|
}
|
|
1034
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
1505
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPEntityCreateViewModelFactory, decorators: [{
|
|
1035
1506
|
type: Injectable,
|
|
1036
1507
|
args: [{ providedIn: 'root' }]
|
|
1037
1508
|
}] });
|
|
@@ -1075,6 +1546,7 @@ class AXPEntityMasterListViewModel {
|
|
|
1075
1546
|
this.widgetResolver = this.injector.get(AXPWidgetRegistryService);
|
|
1076
1547
|
this.expressionEvaluator = this.injector.get(AXPExpressionEvaluatorService);
|
|
1077
1548
|
this.commandService = this.injector.get(AXPCommandService);
|
|
1549
|
+
this.eventService = this.injector.get(AXPBroadcastEventService);
|
|
1078
1550
|
this.filterOperatorMiddleware = this.injector.get(AXPFilterOperatorMiddlewareService);
|
|
1079
1551
|
this.settingEntityKey = `${this.config.module}:${this.config.name}`;
|
|
1080
1552
|
this.destroyed = new Subject();
|
|
@@ -1219,6 +1691,15 @@ class AXPEntityMasterListViewModel {
|
|
|
1219
1691
|
this.events$.next({ action: 'refresh', meta: event.payload.meta });
|
|
1220
1692
|
}
|
|
1221
1693
|
});
|
|
1694
|
+
this.eventService
|
|
1695
|
+
.listen('REFRESH_LAYOUT')
|
|
1696
|
+
.pipe(takeUntil(this.destroyed))
|
|
1697
|
+
.subscribe((e) => {
|
|
1698
|
+
if (e.data.name == getEntityInfo(this.entityDef).source) {
|
|
1699
|
+
this.selectedItems.set([]);
|
|
1700
|
+
this.events$.next({ action: 'refresh' });
|
|
1701
|
+
}
|
|
1702
|
+
});
|
|
1222
1703
|
this.sortedFields.set(this.sortableFields());
|
|
1223
1704
|
}
|
|
1224
1705
|
async applySettings() {
|
|
@@ -1586,10 +2067,10 @@ class AXPEntityListViewModelFactory {
|
|
|
1586
2067
|
this.layout.setNavigationLoading(false);
|
|
1587
2068
|
return new AXPEntityMasterListViewModel(this.injector, config);
|
|
1588
2069
|
}
|
|
1589
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
1590
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.
|
|
2070
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPEntityListViewModelFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2071
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPEntityListViewModelFactory, providedIn: 'root' }); }
|
|
1591
2072
|
}
|
|
1592
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
2073
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPEntityListViewModelFactory, decorators: [{
|
|
1593
2074
|
type: Injectable,
|
|
1594
2075
|
args: [{ providedIn: 'root' }]
|
|
1595
2076
|
}] });
|
|
@@ -1607,10 +2088,10 @@ class AXPEntityService {
|
|
|
1607
2088
|
createPath(module, entity, path = 'list') {
|
|
1608
2089
|
return `/${this.sessionService.application?.name}/m/${module}/e/${entity}/${path}`;
|
|
1609
2090
|
}
|
|
1610
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
1611
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.
|
|
2091
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPEntityService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2092
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPEntityService, providedIn: 'root' }); }
|
|
1612
2093
|
}
|
|
1613
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
2094
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPEntityService, decorators: [{
|
|
1614
2095
|
type: Injectable,
|
|
1615
2096
|
args: [{ providedIn: 'root' }]
|
|
1616
2097
|
}] });
|
|
@@ -1623,14 +2104,13 @@ class AXPEntityPerformDeleteAction extends AXPWorkflowAction {
|
|
|
1623
2104
|
this.dialogService = inject(AXDialogService);
|
|
1624
2105
|
this.loadingDialog = inject(AXLoadingDialogService);
|
|
1625
2106
|
this.translationService = inject(AXTranslationService);
|
|
2107
|
+
this.settingService = inject(AXPSettingService);
|
|
1626
2108
|
}
|
|
1627
2109
|
async execute(context) {
|
|
1628
2110
|
const moduleEntity = context.getVariable('entity');
|
|
1629
2111
|
const data = context.getVariable('data');
|
|
1630
2112
|
const meta = context.getVariable('meta');
|
|
1631
|
-
const
|
|
1632
|
-
const process = options?.['process'];
|
|
1633
|
-
const showResult = process?.showResult ?? true;
|
|
2113
|
+
const showResult = await this.settingService.get(AXPCommonSettings.EnableOperationToasts);
|
|
1634
2114
|
const entities = [];
|
|
1635
2115
|
if (moduleEntity != null) {
|
|
1636
2116
|
const ids = Array.isArray(data) ? data.map((c) => c.id) : [data.id];
|
|
@@ -1764,10 +2244,10 @@ class AXPEntityPerformDeleteAction extends AXPWorkflowAction {
|
|
|
1764
2244
|
}
|
|
1765
2245
|
}
|
|
1766
2246
|
}
|
|
1767
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
1768
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.
|
|
2247
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPEntityPerformDeleteAction, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2248
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPEntityPerformDeleteAction }); }
|
|
1769
2249
|
}
|
|
1770
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
2250
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPEntityPerformDeleteAction, decorators: [{
|
|
1771
2251
|
type: Injectable
|
|
1772
2252
|
}] });
|
|
1773
2253
|
const AXPDeleteEntityWorkflow = {
|
|
@@ -1776,8 +2256,8 @@ const AXPDeleteEntityWorkflow = {
|
|
|
1776
2256
|
'confirm-delete': {
|
|
1777
2257
|
action: 'show-prompt-dialog',
|
|
1778
2258
|
input: {
|
|
1779
|
-
title: 'workflow.warning',
|
|
1780
|
-
message:
|
|
2259
|
+
title: '@general:workflow.warning',
|
|
2260
|
+
message: '@general:workflow.confirm-delete',
|
|
1781
2261
|
type: 'danger',
|
|
1782
2262
|
},
|
|
1783
2263
|
nextSteps: [
|
|
@@ -1946,10 +2426,10 @@ class AXPEntityMasterUpdateViewModelFactory {
|
|
|
1946
2426
|
this.layout.setNavigationLoading(false);
|
|
1947
2427
|
return Promise.reject('cannot fetch ');
|
|
1948
2428
|
}
|
|
1949
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
1950
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.
|
|
2429
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPEntityMasterUpdateViewModelFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2430
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPEntityMasterUpdateViewModelFactory, providedIn: 'root' }); }
|
|
1951
2431
|
}
|
|
1952
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
2432
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPEntityMasterUpdateViewModelFactory, decorators: [{
|
|
1953
2433
|
type: Injectable,
|
|
1954
2434
|
args: [{ providedIn: 'root' }]
|
|
1955
2435
|
}] });
|
|
@@ -1992,10 +2472,10 @@ class AXPEntityModifySectionPopupAction extends AXPWorkflowAction {
|
|
|
1992
2472
|
context.setVariable('data', cloneDeep(popup.data.context));
|
|
1993
2473
|
}
|
|
1994
2474
|
}
|
|
1995
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
1996
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.
|
|
2475
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPEntityModifySectionPopupAction, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2476
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPEntityModifySectionPopupAction }); }
|
|
1997
2477
|
}
|
|
1998
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
2478
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPEntityModifySectionPopupAction, decorators: [{
|
|
1999
2479
|
type: Injectable
|
|
2000
2480
|
}] });
|
|
2001
2481
|
class AXPEntityModifyConfirmedAction extends AXPWorkflowAction {
|
|
@@ -2010,10 +2490,10 @@ class AXPEntityModifyConfirmedAction extends AXPWorkflowAction {
|
|
|
2010
2490
|
},
|
|
2011
2491
|
}));
|
|
2012
2492
|
}
|
|
2013
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
2014
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.
|
|
2493
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPEntityModifyConfirmedAction, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2494
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPEntityModifyConfirmedAction }); }
|
|
2015
2495
|
}
|
|
2016
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
2496
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPEntityModifyConfirmedAction, decorators: [{
|
|
2017
2497
|
type: Injectable
|
|
2018
2498
|
}] });
|
|
2019
2499
|
const AXPModifyEntitySectionWorkflow = {
|
|
@@ -2066,7 +2546,7 @@ class AXPEntityMasterSingleViewGroupViewModel {
|
|
|
2066
2546
|
}, ...(ngDevMode ? [{ debugName: "description" }] : []));
|
|
2067
2547
|
this.layout = computed(() => {
|
|
2068
2548
|
const source = cloneDeep(this.section.layout ?? {});
|
|
2069
|
-
set(source, 'positions.
|
|
2549
|
+
set(source, 'positions.sm.colSpan', 12);
|
|
2070
2550
|
return source;
|
|
2071
2551
|
}, ...(ngDevMode ? [{ debugName: "layout" }] : []));
|
|
2072
2552
|
this.props = computed(() => {
|
|
@@ -2306,10 +2786,10 @@ class AXPEntityDetailViewModelFactory {
|
|
|
2306
2786
|
this.layout.setNavigationLoading(false);
|
|
2307
2787
|
return Promise.reject('cannot fetch ');
|
|
2308
2788
|
}
|
|
2309
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
2310
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.
|
|
2789
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPEntityDetailViewModelFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2790
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPEntityDetailViewModelFactory, providedIn: 'root' }); }
|
|
2311
2791
|
}
|
|
2312
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
2792
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPEntityDetailViewModelFactory, decorators: [{
|
|
2313
2793
|
type: Injectable,
|
|
2314
2794
|
args: [{ providedIn: 'root' }]
|
|
2315
2795
|
}] });
|
|
@@ -2321,37 +2801,6 @@ const AXPEntityDetailViewModelResolver = (route, state, service = inject(AXPEnti
|
|
|
2321
2801
|
return service.create(moduleName, entityName, id);
|
|
2322
2802
|
};
|
|
2323
2803
|
|
|
2324
|
-
/**
|
|
2325
|
-
* Error type that can be thrown by middlewares to abort the chain with a structured payload.
|
|
2326
|
-
*/
|
|
2327
|
-
class AXPMiddlewareAbortError extends Error {
|
|
2328
|
-
constructor(message, options = {}) {
|
|
2329
|
-
super(message);
|
|
2330
|
-
this.message = message;
|
|
2331
|
-
this.options = options;
|
|
2332
|
-
this.name = 'AXPMiddlewareAbortError';
|
|
2333
|
-
}
|
|
2334
|
-
toResponse() {
|
|
2335
|
-
return {
|
|
2336
|
-
success: false,
|
|
2337
|
-
error: {
|
|
2338
|
-
code: this.options.code,
|
|
2339
|
-
message: this.message,
|
|
2340
|
-
status: this.options.status,
|
|
2341
|
-
details: this.options.details,
|
|
2342
|
-
},
|
|
2343
|
-
};
|
|
2344
|
-
}
|
|
2345
|
-
}
|
|
2346
|
-
/** Type guard for AXPMiddlewareAbortError */
|
|
2347
|
-
function isAXPMiddlewareAbortError(error) {
|
|
2348
|
-
return error instanceof AXPMiddlewareAbortError;
|
|
2349
|
-
}
|
|
2350
|
-
//#endregion
|
|
2351
|
-
|
|
2352
|
-
const AXP_ENTITY_STORAGE_BACKEND = new InjectionToken('AXP_ENTITY_STORAGE_BACKEND');
|
|
2353
|
-
const AXP_ENTITY_STORAGE_MIDDLEWARE = new InjectionToken('AXP_ENTITY_STORAGE_MIDDLEWARE');
|
|
2354
|
-
|
|
2355
2804
|
class AXPEntityStorageService {
|
|
2356
2805
|
}
|
|
2357
2806
|
class AXPEntityDataProvider {
|
|
@@ -2407,18 +2856,23 @@ class AXMEntityCrudServiceImpl {
|
|
|
2407
2856
|
}
|
|
2408
2857
|
async query(request = { skip: 0, take: 100 }) {
|
|
2409
2858
|
const [moduleName, entityName] = this._entityDataProvider.entityName.split('.');
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
if (
|
|
2413
|
-
request.filter
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2859
|
+
try {
|
|
2860
|
+
const entityRef = await this.entityRegistery.resolve(moduleName, entityName);
|
|
2861
|
+
if (entityRef.parentKey) {
|
|
2862
|
+
if (!request.filter?.filters?.length && request.filter?.field !== entityRef.parentKey) {
|
|
2863
|
+
request.filter = {
|
|
2864
|
+
value: true,
|
|
2865
|
+
field: entityRef.parentKey,
|
|
2866
|
+
operator: {
|
|
2867
|
+
type: 'isEmpty',
|
|
2868
|
+
},
|
|
2869
|
+
};
|
|
2870
|
+
}
|
|
2420
2871
|
}
|
|
2421
2872
|
}
|
|
2873
|
+
catch (error) {
|
|
2874
|
+
console.error(error);
|
|
2875
|
+
}
|
|
2422
2876
|
return this._entityDataProvider.query(request);
|
|
2423
2877
|
}
|
|
2424
2878
|
async findOne(filter) {
|
|
@@ -2435,7 +2889,7 @@ class AXMEntityCrudServiceImpl {
|
|
|
2435
2889
|
operator: {
|
|
2436
2890
|
type: 'isEmpty',
|
|
2437
2891
|
},
|
|
2438
|
-
}
|
|
2892
|
+
},
|
|
2439
2893
|
};
|
|
2440
2894
|
const result = await this._entityDataProvider.query(queryRequest);
|
|
2441
2895
|
return result;
|
|
@@ -2451,7 +2905,7 @@ class AXMEntityCrudServiceImpl {
|
|
|
2451
2905
|
operator: {
|
|
2452
2906
|
type: 'equal',
|
|
2453
2907
|
},
|
|
2454
|
-
}
|
|
2908
|
+
},
|
|
2455
2909
|
};
|
|
2456
2910
|
const result = await this._entityDataProvider.query(queryRequest);
|
|
2457
2911
|
return result;
|
|
@@ -2466,7 +2920,7 @@ class AXMEntityCrudServiceImpl {
|
|
|
2466
2920
|
operator: {
|
|
2467
2921
|
type: 'contains',
|
|
2468
2922
|
},
|
|
2469
|
-
}
|
|
2923
|
+
},
|
|
2470
2924
|
};
|
|
2471
2925
|
const result = await this._entityDataProvider.query(queryRequest);
|
|
2472
2926
|
return result;
|
|
@@ -2479,177 +2933,6 @@ class AXMEntityCrudServiceImpl {
|
|
|
2479
2933
|
}
|
|
2480
2934
|
}
|
|
2481
2935
|
|
|
2482
|
-
class AXPMiddlewareEntityStorageService extends AXPEntityStorageService {
|
|
2483
|
-
constructor() {
|
|
2484
|
-
super(...arguments);
|
|
2485
|
-
this.backend = inject(AXP_ENTITY_STORAGE_BACKEND);
|
|
2486
|
-
this.allMiddlewares = (inject(AXP_ENTITY_STORAGE_MIDDLEWARE, { optional: true }) || []).slice();
|
|
2487
|
-
this.injector = inject(EnvironmentInjector);
|
|
2488
|
-
}
|
|
2489
|
-
get dbName() {
|
|
2490
|
-
return this.backend.dbName;
|
|
2491
|
-
}
|
|
2492
|
-
filterMiddlewares(ctx) {
|
|
2493
|
-
return this.allMiddlewares
|
|
2494
|
-
.filter((mw) => {
|
|
2495
|
-
const t = mw.target;
|
|
2496
|
-
if (!t)
|
|
2497
|
-
return true;
|
|
2498
|
-
if (t.ops && !t.ops.includes(ctx.op))
|
|
2499
|
-
return false;
|
|
2500
|
-
if (t.entity) {
|
|
2501
|
-
if (typeof t.entity === 'string' && t.entity !== ctx.entityName)
|
|
2502
|
-
return false;
|
|
2503
|
-
if (t.entity instanceof RegExp && !t.entity.test(ctx.entityName))
|
|
2504
|
-
return false;
|
|
2505
|
-
}
|
|
2506
|
-
if (t.predicate && !t.predicate(ctx))
|
|
2507
|
-
return false;
|
|
2508
|
-
return true;
|
|
2509
|
-
})
|
|
2510
|
-
.sort((a, b) => (a.target?.order ?? 0) - (b.target?.order ?? 0));
|
|
2511
|
-
}
|
|
2512
|
-
compose(mws, leaf, ctx) {
|
|
2513
|
-
return mws
|
|
2514
|
-
.slice()
|
|
2515
|
-
.reverse()
|
|
2516
|
-
.reduce((next, mw) => {
|
|
2517
|
-
return async () => runInInjectionContext(this.injector, () => mw.execute(ctx, next));
|
|
2518
|
-
}, leaf);
|
|
2519
|
-
}
|
|
2520
|
-
async run(ctx, delegate) {
|
|
2521
|
-
const chain = this.compose(this.filterMiddlewares(ctx), async () => {
|
|
2522
|
-
ctx.result = await delegate();
|
|
2523
|
-
}, ctx);
|
|
2524
|
-
await chain();
|
|
2525
|
-
return ctx.result;
|
|
2526
|
-
}
|
|
2527
|
-
createCtx(op, entityName, init) {
|
|
2528
|
-
return {
|
|
2529
|
-
op,
|
|
2530
|
-
entityName,
|
|
2531
|
-
locals: new Map(),
|
|
2532
|
-
backend: {
|
|
2533
|
-
getOne: (name, id) => this.backend.getOne(name, id),
|
|
2534
|
-
insertOne: (name, e) => this.backend.insertOne(name, e),
|
|
2535
|
-
query: (name, request) => this.backend.query(name, request),
|
|
2536
|
-
updateOne: (name, id, data) => this.backend.updateOne(name, id, data),
|
|
2537
|
-
},
|
|
2538
|
-
...init,
|
|
2539
|
-
};
|
|
2540
|
-
}
|
|
2541
|
-
async initial(entityName, collection, options) {
|
|
2542
|
-
const ctx = this.createCtx('initial', entityName, { data: collection });
|
|
2543
|
-
return this.run(ctx, () => this.backend.initial(entityName, ctx.data, options));
|
|
2544
|
-
}
|
|
2545
|
-
async getOne(entityName, id) {
|
|
2546
|
-
const ctx = this.createCtx('getOne', entityName, { id });
|
|
2547
|
-
return this.run(ctx, () => this.backend.getOne(entityName, id));
|
|
2548
|
-
}
|
|
2549
|
-
async updateOne(entityName, id, keyValues) {
|
|
2550
|
-
const ctx = this.createCtx('update', entityName, { id, data: keyValues });
|
|
2551
|
-
return this.run(ctx, () => this.backend.updateOne(entityName, id, ctx.data));
|
|
2552
|
-
}
|
|
2553
|
-
async deleteOne(entityName, id) {
|
|
2554
|
-
const ctx = this.createCtx('delete', entityName, { id });
|
|
2555
|
-
return this.run(ctx, () => this.backend.deleteOne(entityName, id));
|
|
2556
|
-
}
|
|
2557
|
-
async insertOne(entityName, entity) {
|
|
2558
|
-
const ctx = this.createCtx('create', entityName, { data: entity });
|
|
2559
|
-
return this.run(ctx, () => this.backend.insertOne(entityName, ctx.data));
|
|
2560
|
-
}
|
|
2561
|
-
async getAll(entityName) {
|
|
2562
|
-
const ctx = this.createCtx('getAll', entityName);
|
|
2563
|
-
return this.run(ctx, () => this.backend.getAll(entityName));
|
|
2564
|
-
}
|
|
2565
|
-
async query(entityName, request) {
|
|
2566
|
-
const ctx = this.createCtx('query', entityName, { request });
|
|
2567
|
-
return this.run(ctx, () => this.backend.query(entityName, request));
|
|
2568
|
-
}
|
|
2569
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPMiddlewareEntityStorageService, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2570
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPMiddlewareEntityStorageService }); }
|
|
2571
|
-
}
|
|
2572
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPMiddlewareEntityStorageService, decorators: [{
|
|
2573
|
-
type: Injectable
|
|
2574
|
-
}] });
|
|
2575
|
-
|
|
2576
|
-
/**
|
|
2577
|
-
* Entity Event Dispatcher - A wrapper for entity-specific events
|
|
2578
|
-
* Handles pattern-based dispatching for entity operations with wildcard support
|
|
2579
|
-
*/
|
|
2580
|
-
class AXPEntityEventDispatcherService {
|
|
2581
|
-
constructor() {
|
|
2582
|
-
this.eventService = inject(AXPDistributedEventListenerService);
|
|
2583
|
-
}
|
|
2584
|
-
async dispatchEntityEvent(operation, entityName, data) {
|
|
2585
|
-
const enhancedData = {
|
|
2586
|
-
...data,
|
|
2587
|
-
entityName,
|
|
2588
|
-
operation,
|
|
2589
|
-
timestamp: new Date(),
|
|
2590
|
-
source: 'entity-dispatcher',
|
|
2591
|
-
};
|
|
2592
|
-
const eventKeysToDispatch = await this.getAllMatchingEventKeys(operation, entityName);
|
|
2593
|
-
const dispatchPromises = eventKeysToDispatch.map((key) => this.eventService.dispatch(key, enhancedData));
|
|
2594
|
-
await Promise.all(dispatchPromises);
|
|
2595
|
-
}
|
|
2596
|
-
async getAllMatchingEventKeys(operation, entityName) {
|
|
2597
|
-
const eventKeys = new Set();
|
|
2598
|
-
const exactKeys = this.generateEventKeys(operation, entityName);
|
|
2599
|
-
exactKeys.forEach((key) => eventKeys.add(key));
|
|
2600
|
-
const wildcardKeys = await this.findMatchingWildcardKeys(operation, entityName);
|
|
2601
|
-
wildcardKeys.forEach((key) => eventKeys.add(key));
|
|
2602
|
-
return Array.from(eventKeys);
|
|
2603
|
-
}
|
|
2604
|
-
async findMatchingWildcardKeys(operation, entityName) {
|
|
2605
|
-
const matchingKeys = [];
|
|
2606
|
-
const allListenerKeys = await this.eventService.getRegisteredKeys();
|
|
2607
|
-
const actualEventKey = `entity.${operation}.${entityName}`;
|
|
2608
|
-
for (const listenerKey of allListenerKeys) {
|
|
2609
|
-
if (listenerKey.includes('*') && this.matchesEntityPattern(actualEventKey, listenerKey)) {
|
|
2610
|
-
matchingKeys.push(listenerKey);
|
|
2611
|
-
}
|
|
2612
|
-
}
|
|
2613
|
-
return matchingKeys;
|
|
2614
|
-
}
|
|
2615
|
-
matchesEntityPattern(eventKey, pattern) {
|
|
2616
|
-
if (!pattern.startsWith('entity.') || !pattern.includes('*')) {
|
|
2617
|
-
return false;
|
|
2618
|
-
}
|
|
2619
|
-
const regexPattern = pattern.replace(/\./g, '\\.').replace(/\*/g, '.*');
|
|
2620
|
-
const regex = new RegExp(`^${regexPattern}$`);
|
|
2621
|
-
return regex.test(eventKey);
|
|
2622
|
-
}
|
|
2623
|
-
generateEventKeys(operation, entityName) {
|
|
2624
|
-
const keys = [];
|
|
2625
|
-
keys.push(`entity.${operation}`);
|
|
2626
|
-
keys.push(`entity.${operation}.${entityName}`);
|
|
2627
|
-
const entityParts = entityName.split('.');
|
|
2628
|
-
if (entityParts.length > 1) {
|
|
2629
|
-
const moduleName = entityParts[0];
|
|
2630
|
-
keys.push(`entity.${operation}.${moduleName}`);
|
|
2631
|
-
}
|
|
2632
|
-
return keys;
|
|
2633
|
-
}
|
|
2634
|
-
async dispatchInserted(entityName, data) {
|
|
2635
|
-
await this.dispatchEntityEvent('inserted', entityName, data);
|
|
2636
|
-
}
|
|
2637
|
-
async dispatchUpdated(entityName, data) {
|
|
2638
|
-
await this.dispatchEntityEvent('updated', entityName, data);
|
|
2639
|
-
}
|
|
2640
|
-
async dispatchDeleted(entityName, data) {
|
|
2641
|
-
await this.dispatchEntityEvent('deleted', entityName, data);
|
|
2642
|
-
}
|
|
2643
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPEntityEventDispatcherService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2644
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPEntityEventDispatcherService, providedIn: 'root' }); }
|
|
2645
|
-
}
|
|
2646
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPEntityEventDispatcherService, decorators: [{
|
|
2647
|
-
type: Injectable,
|
|
2648
|
-
args: [{
|
|
2649
|
-
providedIn: 'root',
|
|
2650
|
-
}]
|
|
2651
|
-
}] });
|
|
2652
|
-
|
|
2653
2936
|
class AXPLayoutAdapterBuilder {
|
|
2654
2937
|
constructor() {
|
|
2655
2938
|
this.adapter = {};
|
|
@@ -2731,10 +3014,10 @@ class AXPLayoutAdapterBuilder {
|
|
|
2731
3014
|
};
|
|
2732
3015
|
};
|
|
2733
3016
|
}
|
|
2734
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
2735
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.
|
|
3017
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPLayoutAdapterBuilder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
3018
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPLayoutAdapterBuilder, providedIn: 'root' }); }
|
|
2736
3019
|
}
|
|
2737
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
3020
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPLayoutAdapterBuilder, decorators: [{
|
|
2738
3021
|
type: Injectable,
|
|
2739
3022
|
args: [{
|
|
2740
3023
|
providedIn: 'root',
|
|
@@ -3027,7 +3310,7 @@ class AXPPageListConverter extends AXPBaseRelatedEntityConverter {
|
|
|
3027
3310
|
return await context.expressionEvaluator.evaluate(actionData, scope);
|
|
3028
3311
|
};
|
|
3029
3312
|
const evaluatedActions = await evaluateExpressions(relatedEntity?.actions);
|
|
3030
|
-
const filters = relatedEntity.conditions?.map(async (c) => {
|
|
3313
|
+
const filters = await Promise.all(relatedEntity.conditions?.map(async (c) => {
|
|
3031
3314
|
const value = await evaluateExpressions(c.value);
|
|
3032
3315
|
return {
|
|
3033
3316
|
field: c.name,
|
|
@@ -3035,7 +3318,8 @@ class AXPPageListConverter extends AXPBaseRelatedEntityConverter {
|
|
|
3035
3318
|
value: value,
|
|
3036
3319
|
hidden: true,
|
|
3037
3320
|
};
|
|
3038
|
-
}) ?? [];
|
|
3321
|
+
}) ?? []);
|
|
3322
|
+
const transformedFilters = await context.filterOperatorMiddleware?.transformFilters(filters);
|
|
3039
3323
|
return {
|
|
3040
3324
|
id: entityDef?.name ?? '',
|
|
3041
3325
|
title: `${context.rootTitle}`,
|
|
@@ -3115,7 +3399,7 @@ class AXPPageListConverter extends AXPBaseRelatedEntityConverter {
|
|
|
3115
3399
|
name: 'page-list',
|
|
3116
3400
|
defaultValue: {
|
|
3117
3401
|
toolbar: {
|
|
3118
|
-
filters: await Promise.all(
|
|
3402
|
+
filters: await Promise.all(transformedFilters),
|
|
3119
3403
|
},
|
|
3120
3404
|
},
|
|
3121
3405
|
options: {
|
|
@@ -3198,7 +3482,7 @@ class AXPTabListConverter extends AXPBaseRelatedEntityConverter {
|
|
|
3198
3482
|
return await context.expressionEvaluator.evaluate(actionData, scope);
|
|
3199
3483
|
};
|
|
3200
3484
|
// console.log({ relatedEntity });
|
|
3201
|
-
const filters = relatedEntity.conditions?.map(async (c) => {
|
|
3485
|
+
const filters = await Promise.all(relatedEntity.conditions?.map(async (c) => {
|
|
3202
3486
|
const value = await evaluateExpressions(c.value);
|
|
3203
3487
|
return {
|
|
3204
3488
|
field: c.name,
|
|
@@ -3206,8 +3490,9 @@ class AXPTabListConverter extends AXPBaseRelatedEntityConverter {
|
|
|
3206
3490
|
value: value,
|
|
3207
3491
|
hidden: true,
|
|
3208
3492
|
};
|
|
3209
|
-
}) ?? [];
|
|
3493
|
+
}) ?? []);
|
|
3210
3494
|
const actions = await evaluateExpressions(relatedEntity.actions);
|
|
3495
|
+
const transformedFilters = await Promise.all(context.filterOperatorMiddleware?.transformFilters(filters));
|
|
3211
3496
|
return {
|
|
3212
3497
|
id: entityDef?.name ?? '',
|
|
3213
3498
|
title: relatedEntity.title ?? entityDef?.title ?? '',
|
|
@@ -3218,7 +3503,7 @@ class AXPTabListConverter extends AXPBaseRelatedEntityConverter {
|
|
|
3218
3503
|
name: `${relatedEntity.entity}-tab-list`,
|
|
3219
3504
|
defaultValue: {
|
|
3220
3505
|
toolbar: {
|
|
3221
|
-
filters:
|
|
3506
|
+
filters: transformedFilters,
|
|
3222
3507
|
},
|
|
3223
3508
|
},
|
|
3224
3509
|
options: {
|
|
@@ -3226,6 +3511,7 @@ class AXPTabListConverter extends AXPBaseRelatedEntityConverter {
|
|
|
3226
3511
|
showEntityActions: true,
|
|
3227
3512
|
showToolbar: false,
|
|
3228
3513
|
actions: actions,
|
|
3514
|
+
maxHeight: '300px',
|
|
3229
3515
|
},
|
|
3230
3516
|
},
|
|
3231
3517
|
],
|
|
@@ -3260,10 +3546,10 @@ class AXPRelatedEntityConverterFactory {
|
|
|
3260
3546
|
createTabListConverter() {
|
|
3261
3547
|
return this.createConverter('tab-list');
|
|
3262
3548
|
}
|
|
3263
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
3264
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.
|
|
3549
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPRelatedEntityConverterFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
3550
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPRelatedEntityConverterFactory, providedIn: 'root' }); }
|
|
3265
3551
|
}
|
|
3266
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
3552
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPRelatedEntityConverterFactory, decorators: [{
|
|
3267
3553
|
type: Injectable,
|
|
3268
3554
|
args: [{
|
|
3269
3555
|
providedIn: 'root',
|
|
@@ -3275,10 +3561,16 @@ class AXPMainEntityContentBuilder {
|
|
|
3275
3561
|
this.relatedEntityConverterFactory = relatedEntityConverterFactory;
|
|
3276
3562
|
this.workflowService = inject(AXPWorkflowService);
|
|
3277
3563
|
this.commandService = inject(AXPCommandService);
|
|
3564
|
+
this.filterOperatorMiddleware = inject(AXPFilterOperatorMiddlewareService);
|
|
3278
3565
|
}
|
|
3279
3566
|
async build(entity, rootContext, dependencies, rootTitle) {
|
|
3280
3567
|
const groups = entity?.groups ?? [];
|
|
3281
3568
|
const singleInterface = entity?.interfaces?.master?.single;
|
|
3569
|
+
const updateInterface = entity?.interfaces?.master?.update;
|
|
3570
|
+
// Get list of visible property names from single interface
|
|
3571
|
+
const visiblePropertyNames = new Set(singleInterface?.properties?.map((p) => p.name) ?? []);
|
|
3572
|
+
// Get list of editable property names from update interface
|
|
3573
|
+
const editablePropertyNames = new Set(updateInterface?.properties?.map((p) => p.name) ?? []);
|
|
3282
3574
|
// Accumulate groups from main and merge-detail related entities for validation/title lookup
|
|
3283
3575
|
const allGroups = [...groups];
|
|
3284
3576
|
// Create expression evaluator for actions
|
|
@@ -3698,9 +3990,15 @@ class AXPMainEntityContentBuilder {
|
|
|
3698
3990
|
},
|
|
3699
3991
|
},
|
|
3700
3992
|
},
|
|
3701
|
-
children: (await getVisiblePropertyByGroupId(s.id))
|
|
3993
|
+
children: (await getVisiblePropertyByGroupId(s.id))
|
|
3994
|
+
.filter((p) => visiblePropertyNames.has(p.name))
|
|
3995
|
+
.map((p) => {
|
|
3702
3996
|
const layout = getPropertyLayout(p.name, p);
|
|
3703
3997
|
const prefixed = p.__dataPath ? `${p.__dataPath}.${p.name}` : p.name;
|
|
3998
|
+
// Check if property is editable (exists in update interface)
|
|
3999
|
+
const isEditable = editablePropertyNames.has(p.name);
|
|
4000
|
+
// Check if property has its own disabled option
|
|
4001
|
+
const hasOwnDisabled = p.schema.interface?.options?.disabled !== undefined;
|
|
3704
4002
|
return {
|
|
3705
4003
|
type: 'grid-item-layout',
|
|
3706
4004
|
name: prefixed,
|
|
@@ -3734,7 +4032,9 @@ class AXPMainEntityContentBuilder {
|
|
|
3734
4032
|
})),
|
|
3735
4033
|
// Attach dataPath for merged properties to be available in widgets/options if needed
|
|
3736
4034
|
dataPath: p.__dataPath,
|
|
3737
|
-
}
|
|
4035
|
+
},
|
|
4036
|
+
// Only set disabled if property doesn't have its own disabled option
|
|
4037
|
+
hasOwnDisabled ? {} : { disabled: !isEditable }),
|
|
3738
4038
|
},
|
|
3739
4039
|
],
|
|
3740
4040
|
},
|
|
@@ -3846,14 +4146,15 @@ class AXPMainEntityContentBuilder {
|
|
|
3846
4146
|
entityResolver: dependencies.entityResolver,
|
|
3847
4147
|
expressionEvaluator: dependencies.expressionEvaluator,
|
|
3848
4148
|
context: rootContext,
|
|
4149
|
+
filterOperatorMiddleware: this.filterOperatorMiddleware,
|
|
3849
4150
|
}));
|
|
3850
4151
|
}
|
|
3851
4152
|
return tabs;
|
|
3852
4153
|
}
|
|
3853
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
3854
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.
|
|
4154
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPMainEntityContentBuilder, deps: [{ token: AXPRelatedEntityConverterFactory }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
4155
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPMainEntityContentBuilder, providedIn: 'root' }); }
|
|
3855
4156
|
}
|
|
3856
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
4157
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPMainEntityContentBuilder, decorators: [{
|
|
3857
4158
|
type: Injectable,
|
|
3858
4159
|
args: [{
|
|
3859
4160
|
providedIn: 'root',
|
|
@@ -3861,10 +4162,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImpor
|
|
|
3861
4162
|
}], ctorParameters: () => [{ type: AXPRelatedEntityConverterFactory }] });
|
|
3862
4163
|
|
|
3863
4164
|
class AXPLayoutAdapterFactory {
|
|
3864
|
-
constructor(relatedEntityConverterFactory, mainEntityContentBuilder, layoutAdapterBuilder) {
|
|
4165
|
+
constructor(relatedEntityConverterFactory, mainEntityContentBuilder, layoutAdapterBuilder, filterOperatorMiddleware) {
|
|
3865
4166
|
this.relatedEntityConverterFactory = relatedEntityConverterFactory;
|
|
3866
4167
|
this.mainEntityContentBuilder = mainEntityContentBuilder;
|
|
3867
4168
|
this.layoutAdapterBuilder = layoutAdapterBuilder;
|
|
4169
|
+
this.filterOperatorMiddleware = filterOperatorMiddleware;
|
|
3868
4170
|
}
|
|
3869
4171
|
async createDetailsViewAdapter(entityResolver, moduleName, entityName, id, dependencies) {
|
|
3870
4172
|
const entity = await entityResolver.resolve(moduleName, entityName);
|
|
@@ -3913,6 +4215,7 @@ class AXPLayoutAdapterFactory {
|
|
|
3913
4215
|
...dependencies,
|
|
3914
4216
|
context: rootContext,
|
|
3915
4217
|
rootTitle: rootTitle,
|
|
4218
|
+
filterOperatorMiddleware: this.filterOperatorMiddleware,
|
|
3916
4219
|
}));
|
|
3917
4220
|
}
|
|
3918
4221
|
// Include nested page-related entities from merge-detail related entities
|
|
@@ -3992,15 +4295,15 @@ class AXPLayoutAdapterFactory {
|
|
|
3992
4295
|
const title = await dependencies.expressionEvaluator.evaluate(entity.interfaces?.master?.single?.title, rootContext);
|
|
3993
4296
|
return title;
|
|
3994
4297
|
}
|
|
3995
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
3996
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.
|
|
4298
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPLayoutAdapterFactory, deps: [{ token: AXPRelatedEntityConverterFactory }, { token: AXPMainEntityContentBuilder }, { token: AXPLayoutAdapterBuilder }, { token: i4$1.AXPFilterOperatorMiddlewareService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
4299
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPLayoutAdapterFactory, providedIn: 'root' }); }
|
|
3997
4300
|
}
|
|
3998
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
4301
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPLayoutAdapterFactory, decorators: [{
|
|
3999
4302
|
type: Injectable,
|
|
4000
4303
|
args: [{
|
|
4001
4304
|
providedIn: 'root',
|
|
4002
4305
|
}]
|
|
4003
|
-
}], ctorParameters: () => [{ type: AXPRelatedEntityConverterFactory }, { type: AXPMainEntityContentBuilder }, { type: AXPLayoutAdapterBuilder }] });
|
|
4306
|
+
}], ctorParameters: () => [{ type: AXPRelatedEntityConverterFactory }, { type: AXPMainEntityContentBuilder }, { type: AXPLayoutAdapterBuilder }, { type: i4$1.AXPFilterOperatorMiddlewareService }] });
|
|
4004
4307
|
|
|
4005
4308
|
const AXPLayoutDetailsViewRouteResolver = async (route, state, entityResolver = inject(AXPEntityDefinitionRegistryService), expressionEvaluator = inject(AXPExpressionEvaluatorService), session = inject(AXPSessionService), formatService = inject(AXFormatService), workflowService = inject(AXPWorkflowService), layoutAdapterFactory = inject(AXPLayoutAdapterFactory)) => {
|
|
4006
4309
|
const moduleName = route.parent?.paramMap.get('module');
|
|
@@ -4188,7 +4491,6 @@ function getVisibleProperties(entity) {
|
|
|
4188
4491
|
class AXPEntityListTableService {
|
|
4189
4492
|
constructor() {
|
|
4190
4493
|
//#region ---- Services & Dependencies ----
|
|
4191
|
-
this.entityResolver = inject(AXPEntityResolver);
|
|
4192
4494
|
this.workflow = inject(AXPWorkflowService);
|
|
4193
4495
|
this.expressionEvaluator = inject(AXPExpressionEvaluatorService);
|
|
4194
4496
|
this.evaluateExpressions = async (options, data) => {
|
|
@@ -4361,10 +4663,10 @@ class AXPEntityListTableService {
|
|
|
4361
4663
|
},
|
|
4362
4664
|
};
|
|
4363
4665
|
}
|
|
4364
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
4365
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.
|
|
4666
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPEntityListTableService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
4667
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPEntityListTableService }); }
|
|
4366
4668
|
}
|
|
4367
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
4669
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPEntityListTableService, decorators: [{
|
|
4368
4670
|
type: Injectable
|
|
4369
4671
|
}] });
|
|
4370
4672
|
|
|
@@ -4383,6 +4685,9 @@ class AXPEntityListToolbarService {
|
|
|
4383
4685
|
filterDefinitions: this.createFilterDefinitions(entity),
|
|
4384
4686
|
columnDefinitions: this.createColumnDefinitions(entity, options),
|
|
4385
4687
|
sortDefinitions: this.createSortDefinitions(entity),
|
|
4688
|
+
canFilter: true,
|
|
4689
|
+
canColumns: true,
|
|
4690
|
+
canSort: true,
|
|
4386
4691
|
};
|
|
4387
4692
|
return toolbarOptions;
|
|
4388
4693
|
}
|
|
@@ -4455,17 +4760,17 @@ class AXPEntityListToolbarService {
|
|
|
4455
4760
|
};
|
|
4456
4761
|
});
|
|
4457
4762
|
}
|
|
4458
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
4459
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.
|
|
4763
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPEntityListToolbarService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
4764
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPEntityListToolbarService }); }
|
|
4460
4765
|
}
|
|
4461
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
4766
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPEntityListToolbarService, decorators: [{
|
|
4462
4767
|
type: Injectable
|
|
4463
4768
|
}] });
|
|
4464
4769
|
|
|
4465
4770
|
class AXPEntityListWidgetViewComponent extends AXPValueWidgetComponent {
|
|
4466
4771
|
constructor() {
|
|
4467
4772
|
super(...arguments);
|
|
4468
|
-
this.
|
|
4773
|
+
this.entityService = inject(AXPEntityDefinitionRegistryService);
|
|
4469
4774
|
this.workflow = inject(AXPWorkflowService);
|
|
4470
4775
|
this.entityListTableService = inject(AXPEntityListTableService);
|
|
4471
4776
|
this.entityListToolbarService = inject(AXPEntityListToolbarService);
|
|
@@ -4475,7 +4780,7 @@ class AXPEntityListWidgetViewComponent extends AXPValueWidgetComponent {
|
|
|
4475
4780
|
this.listNode = signal(null, ...(ngDevMode ? [{ debugName: "listNode" }] : []));
|
|
4476
4781
|
this.list = viewChild('list', ...(ngDevMode ? [{ debugName: "list" }] : []));
|
|
4477
4782
|
this.allWidgets = viewChildren(AXPWidgetRendererDirective, ...(ngDevMode ? [{ debugName: "allWidgets" }] : []));
|
|
4478
|
-
this.listWidget = linkedSignal(() => this.allWidgets().find((widget) => widget.node()?.type === AXPWidgetsCatalog.list));
|
|
4783
|
+
this.listWidget = linkedSignal(() => this.allWidgets().find((widget) => widget.node()?.type === AXPWidgetsCatalog.list), ...(ngDevMode ? [{ debugName: "listWidget" }] : []));
|
|
4479
4784
|
this.toolbarWidget = computed(() => this.allWidgets().find((widget) => widget.node()?.type === AXPWidgetsCatalog.listToolbar), ...(ngDevMode ? [{ debugName: "toolbarWidget" }] : []));
|
|
4480
4785
|
this.selectedItems = signal([], ...(ngDevMode ? [{ debugName: "selectedItems" }] : []));
|
|
4481
4786
|
this.toolbarNode = signal(null, ...(ngDevMode ? [{ debugName: "toolbarNode" }] : []));
|
|
@@ -4485,6 +4790,7 @@ class AXPEntityListWidgetViewComponent extends AXPValueWidgetComponent {
|
|
|
4485
4790
|
this.excludeColumns = computed(() => this.options()['excludeColumns'], ...(ngDevMode ? [{ debugName: "excludeColumns" }] : []));
|
|
4486
4791
|
this.includeColumns = computed(() => this.options()['includeColumns'], ...(ngDevMode ? [{ debugName: "includeColumns" }] : []));
|
|
4487
4792
|
this.externalActions = computed(() => this.options()['actions'], ...(ngDevMode ? [{ debugName: "externalActions" }] : []));
|
|
4793
|
+
this.maxHeight = computed(() => this.options()['maxHeight'], ...(ngDevMode ? [{ debugName: "maxHeight" }] : []));
|
|
4488
4794
|
this.showEntityActions = computed(() => this.options()['showEntityActions'] ?? true, ...(ngDevMode ? [{ debugName: "showEntityActions" }] : []));
|
|
4489
4795
|
this.showToolbar = computed(() => this.options()['showToolbar'] ?? true, ...(ngDevMode ? [{ debugName: "showToolbar" }] : []));
|
|
4490
4796
|
//actions
|
|
@@ -4554,7 +4860,8 @@ class AXPEntityListWidgetViewComponent extends AXPValueWidgetComponent {
|
|
|
4554
4860
|
this.#effect = effect(() => {
|
|
4555
4861
|
const queries = this.getValue()?.toolbar;
|
|
4556
4862
|
const listInstance = this.listWidget()?.instance;
|
|
4557
|
-
const dataSource = this.listWidget()?.options()['dataSource'];
|
|
4863
|
+
// const dataSource = this.listWidget()?.options()['dataSource'] as AXDataSource;
|
|
4864
|
+
const dataSource = listInstance?.options()?.['dataSource'];
|
|
4558
4865
|
const isMounted = this.isMounted();
|
|
4559
4866
|
if (!this.hasRequiredDependencies(dataSource, queries, listInstance)) {
|
|
4560
4867
|
return;
|
|
@@ -4699,7 +5006,7 @@ class AXPEntityListWidgetViewComponent extends AXPValueWidgetComponent {
|
|
|
4699
5006
|
throw new Error('Invalid entity source');
|
|
4700
5007
|
}
|
|
4701
5008
|
// Resolve entity and set it in the signal
|
|
4702
|
-
const resolvedEntity = await this.
|
|
5009
|
+
const resolvedEntity = await this.entityService.resolve(moduleName, entityName);
|
|
4703
5010
|
if (!resolvedEntity) {
|
|
4704
5011
|
throw new Error(`Entity not found: ${this.entitySource()}`);
|
|
4705
5012
|
}
|
|
@@ -4754,8 +5061,8 @@ class AXPEntityListWidgetViewComponent extends AXPValueWidgetComponent {
|
|
|
4754
5061
|
this.destroyed.next();
|
|
4755
5062
|
this.destroyed.complete();
|
|
4756
5063
|
}
|
|
4757
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
4758
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.
|
|
5064
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPEntityListWidgetViewComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
5065
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.4", type: AXPEntityListWidgetViewComponent, isStandalone: true, selector: "ng-component", host: { properties: { "class": "\"ax-h-full\"" } }, providers: [AXPEntityListTableService, AXPEntityListToolbarService], viewQueries: [{ propertyName: "list", first: true, predicate: ["list"], descendants: true, isSignal: true }, { propertyName: "allWidgets", predicate: AXPWidgetRendererDirective, descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: `
|
|
4759
5066
|
@if (showEntityActions()) {
|
|
4760
5067
|
<div class="ax-flex ax-gap-2 ax-justify-end ax-mb-4">
|
|
4761
5068
|
@for (action of primaryActions(); track $index) {
|
|
@@ -4802,7 +5109,7 @@ class AXPEntityListWidgetViewComponent extends AXPValueWidgetComponent {
|
|
|
4802
5109
|
<ax-button
|
|
4803
5110
|
[class.ax-sm]="layoutThemeService.isSmall()"
|
|
4804
5111
|
[iconOnly]="layoutThemeService.isSmall()"
|
|
4805
|
-
[text]="'@general:terms.
|
|
5112
|
+
[text]="'@general:terms.interface.actions' | translate | async"
|
|
4806
5113
|
[look]="layoutThemeService.isSmall() ? 'blank' : 'solid'"
|
|
4807
5114
|
[color]="'default'"
|
|
4808
5115
|
>
|
|
@@ -4834,7 +5141,7 @@ class AXPEntityListWidgetViewComponent extends AXPValueWidgetComponent {
|
|
|
4834
5141
|
}
|
|
4835
5142
|
</div>
|
|
4836
5143
|
}
|
|
4837
|
-
<div class="ax-flex ax-flex-col ax-gap-2 ax-h-full">
|
|
5144
|
+
<div class="ax-flex ax-flex-col ax-gap-2 ax-h-full" [style.max-height]="maxHeight()">
|
|
4838
5145
|
@if (toolbarNode() != null && showToolbar()) {
|
|
4839
5146
|
<ng-container
|
|
4840
5147
|
#toolbar
|
|
@@ -4856,9 +5163,9 @@ class AXPEntityListWidgetViewComponent extends AXPValueWidgetComponent {
|
|
|
4856
5163
|
></ng-container>
|
|
4857
5164
|
}
|
|
4858
5165
|
</div>
|
|
4859
|
-
`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i3.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "component", type: i3.AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-subtitle, ax-placeholder, ax-overlay" }, { kind: "ngmodule", type:
|
|
5166
|
+
`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i3$2.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "component", type: i3$2.AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-subtitle, ax-placeholder, ax-overlay" }, { kind: "ngmodule", type: AXPWidgetCoreModule }, { kind: "directive", type: i3$1.AXPWidgetRendererDirective, selector: "[axp-widget-renderer]", inputs: ["parentNode", "index", "mode", "node"], outputs: ["onOptionsChanged", "onValueChanged"], exportAs: ["widgetRenderer"] }, { kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i3.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "iconOnly", "type", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "loadingTextChange"] }, { kind: "component", type: i3.AXButtonItemComponent, selector: "ax-button-item", inputs: ["color", "disabled", "text", "selected", "divided", "data", "name"], outputs: ["onClick", "onFocus", "onBlur", "disabledChange"] }, { kind: "component", type: i3.AXButtonItemListComponent, selector: "ax-button-item-list", inputs: ["items"], outputs: ["onItemClick"] }, { kind: "ngmodule", type: AXDropdownModule }, { kind: "component", type: i4$2.AXDropdownPanelComponent, selector: "ax-dropdown-panel", inputs: ["isOpen", "fitParent", "dropdownWidth", "position", "placement", "_target", "adaptivityEnabled"], outputs: ["onOpened", "onClosed"] }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "pipe", type: i5.AsyncPipe, name: "async" }, { kind: "pipe", type: i6.AXTranslatorPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
4860
5167
|
}
|
|
4861
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
5168
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPEntityListWidgetViewComponent, decorators: [{
|
|
4862
5169
|
type: Component,
|
|
4863
5170
|
args: [{
|
|
4864
5171
|
template: `
|
|
@@ -4908,7 +5215,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImpor
|
|
|
4908
5215
|
<ax-button
|
|
4909
5216
|
[class.ax-sm]="layoutThemeService.isSmall()"
|
|
4910
5217
|
[iconOnly]="layoutThemeService.isSmall()"
|
|
4911
|
-
[text]="'@general:terms.
|
|
5218
|
+
[text]="'@general:terms.interface.actions' | translate | async"
|
|
4912
5219
|
[look]="layoutThemeService.isSmall() ? 'blank' : 'solid'"
|
|
4913
5220
|
[color]="'default'"
|
|
4914
5221
|
>
|
|
@@ -4940,7 +5247,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImpor
|
|
|
4940
5247
|
}
|
|
4941
5248
|
</div>
|
|
4942
5249
|
}
|
|
4943
|
-
<div class="ax-flex ax-flex-col ax-gap-2 ax-h-full">
|
|
5250
|
+
<div class="ax-flex ax-flex-col ax-gap-2 ax-h-full" [style.max-height]="maxHeight()">
|
|
4944
5251
|
@if (toolbarNode() != null && showToolbar()) {
|
|
4945
5252
|
<ng-container
|
|
4946
5253
|
#toolbar
|
|
@@ -4969,7 +5276,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImpor
|
|
|
4969
5276
|
},
|
|
4970
5277
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
4971
5278
|
providers: [AXPEntityListTableService, AXPEntityListToolbarService],
|
|
4972
|
-
imports: [
|
|
5279
|
+
imports: [
|
|
5280
|
+
CommonModule,
|
|
5281
|
+
AXDecoratorModule,
|
|
5282
|
+
AXPWidgetCoreModule,
|
|
5283
|
+
AXButtonModule,
|
|
5284
|
+
AXDropdownModule,
|
|
5285
|
+
AXTranslationModule,
|
|
5286
|
+
],
|
|
4973
5287
|
}]
|
|
4974
5288
|
}] });
|
|
4975
5289
|
|
|
@@ -5004,10 +5318,10 @@ const AXPEntityListWidget = {
|
|
|
5004
5318
|
};
|
|
5005
5319
|
|
|
5006
5320
|
class AXPEntityReferenceWidgetViewComponent extends AXPLayoutBaseWidgetComponent {
|
|
5007
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
5008
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.
|
|
5321
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPEntityReferenceWidgetViewComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
5322
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.4", type: AXPEntityReferenceWidgetViewComponent, isStandalone: true, selector: "ng-component", usesInheritance: true, ngImport: i0, template: ``, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
5009
5323
|
}
|
|
5010
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
5324
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPEntityReferenceWidgetViewComponent, decorators: [{
|
|
5011
5325
|
type: Component,
|
|
5012
5326
|
args: [{
|
|
5013
5327
|
template: ``,
|
|
@@ -5036,10 +5350,10 @@ class AXPEntityReferenceWidgetEditComponent extends AXPLayoutBaseWidgetComponent
|
|
|
5036
5350
|
}, ...(ngDevMode ? [{ debugName: "#efEntity" }] : []));
|
|
5037
5351
|
}
|
|
5038
5352
|
#efEntity;
|
|
5039
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
5040
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.
|
|
5353
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPEntityReferenceWidgetEditComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
5354
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.4", type: AXPEntityReferenceWidgetEditComponent, isStandalone: true, selector: "ng-component", usesInheritance: true, ngImport: i0, template: ``, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
5041
5355
|
}
|
|
5042
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
5356
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPEntityReferenceWidgetEditComponent, decorators: [{
|
|
5043
5357
|
type: Component,
|
|
5044
5358
|
args: [{
|
|
5045
5359
|
template: ``,
|
|
@@ -5055,10 +5369,10 @@ var entityReferenceWidgetEdit_component = /*#__PURE__*/Object.freeze({
|
|
|
5055
5369
|
});
|
|
5056
5370
|
|
|
5057
5371
|
class AXPEntityReferenceWidgetColumnComponent extends AXPColumnWidgetComponent {
|
|
5058
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
5059
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.
|
|
5372
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPEntityReferenceWidgetColumnComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
5373
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.4", type: AXPEntityReferenceWidgetColumnComponent, isStandalone: true, selector: "ng-component", inputs: { rawValue: "rawValue" }, usesInheritance: true, ngImport: i0, template: `{{rawValue}}`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
5060
5374
|
}
|
|
5061
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
5375
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPEntityReferenceWidgetColumnComponent, decorators: [{
|
|
5062
5376
|
type: Component,
|
|
5063
5377
|
args: [{
|
|
5064
5378
|
template: `{{rawValue}}`,
|
|
@@ -5075,10 +5389,10 @@ var entityReferenceWidgetColumn_component = /*#__PURE__*/Object.freeze({
|
|
|
5075
5389
|
});
|
|
5076
5390
|
|
|
5077
5391
|
class AXPEntityReferenceWidgetPrintComponent extends AXPLayoutBaseWidgetComponent {
|
|
5078
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
5079
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.
|
|
5392
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPEntityReferenceWidgetPrintComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
5393
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.4", type: AXPEntityReferenceWidgetPrintComponent, isStandalone: true, selector: "ng-component", usesInheritance: true, ngImport: i0, template: ``, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
5080
5394
|
}
|
|
5081
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
5395
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPEntityReferenceWidgetPrintComponent, decorators: [{
|
|
5082
5396
|
type: Component,
|
|
5083
5397
|
args: [{
|
|
5084
5398
|
template: ``,
|
|
@@ -5095,10 +5409,10 @@ var entityReferenceWidgetPrint_component = /*#__PURE__*/Object.freeze({
|
|
|
5095
5409
|
});
|
|
5096
5410
|
|
|
5097
5411
|
class AXPEntityReferenceWidgetDesignerComponent extends AXPLayoutBaseWidgetComponent {
|
|
5098
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
5099
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.
|
|
5412
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPEntityReferenceWidgetDesignerComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
5413
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.4", type: AXPEntityReferenceWidgetDesignerComponent, isStandalone: true, selector: "ng-component", usesInheritance: true, ngImport: i0, template: ``, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
5100
5414
|
}
|
|
5101
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
5415
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPEntityReferenceWidgetDesignerComponent, decorators: [{
|
|
5102
5416
|
type: Component,
|
|
5103
5417
|
args: [{
|
|
5104
5418
|
template: ``,
|
|
@@ -5120,23 +5434,138 @@ const AXPEntityReferenceWidget = {
|
|
|
5120
5434
|
type: 'view',
|
|
5121
5435
|
categories: [],
|
|
5122
5436
|
groups: [AXPWidgetGroupEnum.EntityWidget],
|
|
5123
|
-
icon: 'fa-solid fa-square',
|
|
5124
|
-
properties: [AXP_NAME_PROPERTY, AXP_DATA_PATH_PROPERTY],
|
|
5437
|
+
icon: 'fa-solid fa-square',
|
|
5438
|
+
properties: [AXP_NAME_PROPERTY, AXP_DATA_PATH_PROPERTY],
|
|
5439
|
+
components: {
|
|
5440
|
+
view: {
|
|
5441
|
+
component: () => Promise.resolve().then(function () { return entityReferenceWidgetView_component; }).then((c) => c.AXPEntityReferenceWidgetViewComponent),
|
|
5442
|
+
},
|
|
5443
|
+
edit: {
|
|
5444
|
+
component: () => Promise.resolve().then(function () { return entityReferenceWidgetEdit_component; }).then((c) => c.AXPEntityReferenceWidgetEditComponent),
|
|
5445
|
+
},
|
|
5446
|
+
column: {
|
|
5447
|
+
component: () => Promise.resolve().then(function () { return entityReferenceWidgetColumn_component; }).then((c) => c.AXPEntityReferenceWidgetColumnComponent),
|
|
5448
|
+
},
|
|
5449
|
+
print: {
|
|
5450
|
+
component: () => Promise.resolve().then(function () { return entityReferenceWidgetPrint_component; }).then((c) => c.AXPEntityReferenceWidgetPrintComponent),
|
|
5451
|
+
},
|
|
5452
|
+
designer: {
|
|
5453
|
+
component: () => Promise.resolve().then(function () { return entityReferenceWidgetDesigner_component; }).then((c) => c.AXPEntityReferenceWidgetDesignerComponent),
|
|
5454
|
+
},
|
|
5455
|
+
},
|
|
5456
|
+
};
|
|
5457
|
+
|
|
5458
|
+
class AXPLookupFilterWidgetEditComponent extends AXPValueWidgetComponent {
|
|
5459
|
+
constructor() {
|
|
5460
|
+
super(...arguments);
|
|
5461
|
+
//#region ---- Computed Properties ----
|
|
5462
|
+
this.editorPath = `__${this.path}EditorValue`;
|
|
5463
|
+
this.entity = computed(() => this.options()['entity'], ...(ngDevMode ? [{ debugName: "entity" }] : []));
|
|
5464
|
+
this.textField = computed(() => this.options()['textField'] ?? 'title', ...(ngDevMode ? [{ debugName: "textField" }] : []));
|
|
5465
|
+
this.valueField = computed(() => this.options()['valueField'] ?? 'id', ...(ngDevMode ? [{ debugName: "valueField" }] : []));
|
|
5466
|
+
// protected expose = computed<string | undefined | any[]>(() => this.options()['expose'] as string);
|
|
5467
|
+
this.customFilter = computed(() => this.options()['filter'], ...(ngDevMode ? [{ debugName: "customFilter" }] : []));
|
|
5468
|
+
this.multiple = computed(() => (this.options()['multiple'] ?? false), ...(ngDevMode ? [{ debugName: "multiple" }] : []));
|
|
5469
|
+
//#endregion
|
|
5470
|
+
//#region ---- Lookup Node ----
|
|
5471
|
+
this.lookupNode = signal({
|
|
5472
|
+
type: 'lookup-editor',
|
|
5473
|
+
defaultValue: undefined,
|
|
5474
|
+
path: this.path,
|
|
5475
|
+
options: {},
|
|
5476
|
+
}, ...(ngDevMode ? [{ debugName: "lookupNode" }] : []));
|
|
5477
|
+
//#endregion
|
|
5478
|
+
//#region ---- Effects ----
|
|
5479
|
+
this.#efUpdateLookupNode = effect(() => {
|
|
5480
|
+
// console.log('path:', this.path, this.expose());
|
|
5481
|
+
const node = {
|
|
5482
|
+
type: 'lookup-editor',
|
|
5483
|
+
// defaultValue: this.getValue()?.value,
|
|
5484
|
+
path: this.editorPath,
|
|
5485
|
+
options: {
|
|
5486
|
+
entity: this.entity(),
|
|
5487
|
+
expose: [
|
|
5488
|
+
{
|
|
5489
|
+
source: this.textField(),
|
|
5490
|
+
target: `${this.path}EditorObj.title`,
|
|
5491
|
+
},
|
|
5492
|
+
{
|
|
5493
|
+
source: this.valueField(),
|
|
5494
|
+
target: `${this.path}EditorObj.id`,
|
|
5495
|
+
},
|
|
5496
|
+
],
|
|
5497
|
+
look: 'select',
|
|
5498
|
+
multiple: this.multiple(),
|
|
5499
|
+
textField: this.textField(),
|
|
5500
|
+
filter: this.customFilter(),
|
|
5501
|
+
allowClear: true,
|
|
5502
|
+
},
|
|
5503
|
+
};
|
|
5504
|
+
this.lookupNode.set(node);
|
|
5505
|
+
}, ...(ngDevMode ? [{ debugName: "#efUpdateLookupNode" }] : []));
|
|
5506
|
+
this.#efUpdateValue = effect(() => {
|
|
5507
|
+
const newValueObj = this.contextService.getValue(`${this.path}EditorObj`);
|
|
5508
|
+
const prevValue = untracked(() => this.getValue()?.value);
|
|
5509
|
+
if (isEqual(prevValue, newValueObj?.[this.valueField()])) {
|
|
5510
|
+
return;
|
|
5511
|
+
}
|
|
5512
|
+
const value = this.multiple()
|
|
5513
|
+
? newValueObj?.[this.valueField()].map((v) => v[this.valueField()])
|
|
5514
|
+
: newValueObj?.[this.valueField()];
|
|
5515
|
+
const displayText = this.multiple()
|
|
5516
|
+
? newValueObj?.[this.textField()].map((v) => v[this.textField()]).join(',')
|
|
5517
|
+
: newValueObj?.[this.textField()];
|
|
5518
|
+
this.setValue({
|
|
5519
|
+
value: value,
|
|
5520
|
+
operation: {
|
|
5521
|
+
type: this.multiple() ? 'in' : 'equal',
|
|
5522
|
+
},
|
|
5523
|
+
displayText: displayText,
|
|
5524
|
+
});
|
|
5525
|
+
}, ...(ngDevMode ? [{ debugName: "#efUpdateValue" }] : []));
|
|
5526
|
+
}
|
|
5527
|
+
//#endregion
|
|
5528
|
+
//#region ---- Effects ----
|
|
5529
|
+
#efUpdateLookupNode;
|
|
5530
|
+
#efUpdateValue;
|
|
5531
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPLookupFilterWidgetEditComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
5532
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.4", type: AXPLookupFilterWidgetEditComponent, isStandalone: true, selector: "ng-component", usesInheritance: true, ngImport: i0, template: ` <ng-container axp-widget-renderer [node]="lookupNode()" [mode]="'edit'"></ng-container> `, isInline: true, dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "ngmodule", type: AXSelectBoxModule }, { kind: "ngmodule", type: AXTextBoxModule }, { kind: "ngmodule", type: AXButtonModule }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "ngmodule", type: AXLoadingModule }, { kind: "ngmodule", type: AXValidationModule }, { kind: "ngmodule", type: AXFormModule }, { kind: "ngmodule", type: AXPWidgetCoreModule }, { kind: "directive", type: i3$1.AXPWidgetRendererDirective, selector: "[axp-widget-renderer]", inputs: ["parentNode", "index", "mode", "node"], outputs: ["onOptionsChanged", "onValueChanged"], exportAs: ["widgetRenderer"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
5533
|
+
}
|
|
5534
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPLookupFilterWidgetEditComponent, decorators: [{
|
|
5535
|
+
type: Component,
|
|
5536
|
+
args: [{
|
|
5537
|
+
template: ` <ng-container axp-widget-renderer [node]="lookupNode()" [mode]="'edit'"></ng-container> `,
|
|
5538
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
5539
|
+
imports: [
|
|
5540
|
+
FormsModule,
|
|
5541
|
+
AXSelectBoxModule,
|
|
5542
|
+
AXTextBoxModule,
|
|
5543
|
+
AXButtonModule,
|
|
5544
|
+
AXDecoratorModule,
|
|
5545
|
+
AXLoadingModule,
|
|
5546
|
+
AXValidationModule,
|
|
5547
|
+
AXFormModule,
|
|
5548
|
+
AXPWidgetCoreModule,
|
|
5549
|
+
],
|
|
5550
|
+
}]
|
|
5551
|
+
}] });
|
|
5552
|
+
|
|
5553
|
+
var lookupFilterWidgetEdit_component = /*#__PURE__*/Object.freeze({
|
|
5554
|
+
__proto__: null,
|
|
5555
|
+
AXPLookupFilterWidgetEditComponent: AXPLookupFilterWidgetEditComponent
|
|
5556
|
+
});
|
|
5557
|
+
|
|
5558
|
+
const AXPLookupFilterWidget = {
|
|
5559
|
+
name: 'lookup-filter',
|
|
5560
|
+
title: 'Lookup Filter',
|
|
5561
|
+
// categories: AXP_WIDGETS_FILTER_CATEGORY,
|
|
5562
|
+
type: 'filter',
|
|
5563
|
+
groups: [AXPWidgetGroupEnum.EntityWidget],
|
|
5564
|
+
icon: 'fa-light fa-square',
|
|
5565
|
+
properties: [AXP_NAME_PROPERTY, AXP_DATA_PATH_PROPERTY, AXP_DISABLED_PROPERTY],
|
|
5125
5566
|
components: {
|
|
5126
|
-
view: {
|
|
5127
|
-
component: () => Promise.resolve().then(function () { return entityReferenceWidgetView_component; }).then((c) => c.AXPEntityReferenceWidgetViewComponent),
|
|
5128
|
-
},
|
|
5129
5567
|
edit: {
|
|
5130
|
-
component: () => Promise.resolve().then(function () { return
|
|
5131
|
-
},
|
|
5132
|
-
column: {
|
|
5133
|
-
component: () => Promise.resolve().then(function () { return entityReferenceWidgetColumn_component; }).then((c) => c.AXPEntityReferenceWidgetColumnComponent),
|
|
5134
|
-
},
|
|
5135
|
-
print: {
|
|
5136
|
-
component: () => Promise.resolve().then(function () { return entityReferenceWidgetPrint_component; }).then((c) => c.AXPEntityReferenceWidgetPrintComponent),
|
|
5137
|
-
},
|
|
5138
|
-
designer: {
|
|
5139
|
-
component: () => Promise.resolve().then(function () { return entityReferenceWidgetDesigner_component; }).then((c) => c.AXPEntityReferenceWidgetDesignerComponent),
|
|
5568
|
+
component: () => Promise.resolve().then(function () { return lookupFilterWidgetEdit_component; }).then((c) => c.AXPLookupFilterWidgetEditComponent),
|
|
5140
5569
|
},
|
|
5141
5570
|
},
|
|
5142
5571
|
};
|
|
@@ -5203,8 +5632,8 @@ class AXPLookupWidgetViewComponent extends AXPValueWidgetComponent {
|
|
|
5203
5632
|
cls[`ax-gap-1`] = true;
|
|
5204
5633
|
return cls;
|
|
5205
5634
|
}
|
|
5206
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
5207
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.
|
|
5635
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPLookupWidgetViewComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
5636
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.4", type: AXPLookupWidgetViewComponent, isStandalone: true, selector: "axp-lookup-widget-view", host: { properties: { "class": "this.__class" } }, usesInheritance: true, ngImport: i0, template: `
|
|
5208
5637
|
@if(loading())
|
|
5209
5638
|
{
|
|
5210
5639
|
<ax-loading></ax-loading>
|
|
@@ -5222,9 +5651,9 @@ class AXPLookupWidgetViewComponent extends AXPValueWidgetComponent {
|
|
|
5222
5651
|
<span class="ax-text-muted">---</span>
|
|
5223
5652
|
}
|
|
5224
5653
|
}
|
|
5225
|
-
`, isInline: true, dependencies: [{ kind: "ngmodule", type: AXLoadingModule }, { kind: "component", type: i4
|
|
5654
|
+
`, isInline: true, dependencies: [{ kind: "ngmodule", type: AXLoadingModule }, { kind: "component", type: i4.AXLoadingComponent, selector: "ax-loading", inputs: ["visible", "type", "context"], outputs: ["visibleChange"] }, { kind: "ngmodule", type: AXBadgeModule }, { kind: "component", type: i1.AXBadgeComponent, selector: "ax-badge", inputs: ["color", "look", "text"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
5226
5655
|
}
|
|
5227
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
5656
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPLookupWidgetViewComponent, decorators: [{
|
|
5228
5657
|
type: Component,
|
|
5229
5658
|
args: [{
|
|
5230
5659
|
selector: 'axp-lookup-widget-view',
|
|
@@ -5310,6 +5739,7 @@ class AXPEntityDataSelectorService {
|
|
|
5310
5739
|
selectionMode: options.allowMultiple ? 'multiple' : 'single',
|
|
5311
5740
|
searchFields,
|
|
5312
5741
|
parentField: options.entity.parentKey,
|
|
5742
|
+
filters: options.filters || undefined,
|
|
5313
5743
|
allowCreate: options.allowCreate ?? this.canCreate(options.entity),
|
|
5314
5744
|
// Note: Custom filters will be applied to the dataSource in createDataSource
|
|
5315
5745
|
};
|
|
@@ -5318,7 +5748,7 @@ class AXPEntityDataSelectorService {
|
|
|
5318
5748
|
* Create data source from entity definition
|
|
5319
5749
|
*/
|
|
5320
5750
|
createDataSource(options) {
|
|
5321
|
-
const { entity,
|
|
5751
|
+
const { entity, filters, parentFilters } = options;
|
|
5322
5752
|
return new AXDataSource({
|
|
5323
5753
|
byKey: (key) => {
|
|
5324
5754
|
const func = entity.queries.byKey.execute;
|
|
@@ -5326,7 +5756,7 @@ class AXPEntityDataSelectorService {
|
|
|
5326
5756
|
},
|
|
5327
5757
|
load: (e) => {
|
|
5328
5758
|
const func = entity.queries.list?.execute;
|
|
5329
|
-
this.mergeFilters(e,
|
|
5759
|
+
this.mergeFilters(e, filters, parentFilters);
|
|
5330
5760
|
return func(e);
|
|
5331
5761
|
},
|
|
5332
5762
|
pageSize: 10,
|
|
@@ -5376,6 +5806,7 @@ class AXPEntityDataSelectorService {
|
|
|
5376
5806
|
name: column.name,
|
|
5377
5807
|
title: property.title || column.title || column.name,
|
|
5378
5808
|
visible: true,
|
|
5809
|
+
dataPath: column.options?.dataPath,
|
|
5379
5810
|
widget: {
|
|
5380
5811
|
type: widgetType,
|
|
5381
5812
|
options: widgetOptions
|
|
@@ -5438,10 +5869,10 @@ class AXPEntityDataSelectorService {
|
|
|
5438
5869
|
}
|
|
5439
5870
|
return request;
|
|
5440
5871
|
}
|
|
5441
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
5442
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.
|
|
5872
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPEntityDataSelectorService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
5873
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPEntityDataSelectorService, providedIn: 'root' }); }
|
|
5443
5874
|
}
|
|
5444
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
5875
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPEntityDataSelectorService, decorators: [{
|
|
5445
5876
|
type: Injectable,
|
|
5446
5877
|
args: [{
|
|
5447
5878
|
providedIn: 'root'
|
|
@@ -5555,7 +5986,7 @@ class AXPLookupWidgetEditComponent extends AXPValueWidgetComponent {
|
|
|
5555
5986
|
entity: this.entityDef(),
|
|
5556
5987
|
title: `${this.translateService.translateSync('@general:widgets.lookup.search')} ${this.translateService.translateSync(this.entityDef()?.formats.plural ?? '')}`,
|
|
5557
5988
|
allowMultiple: this.multiple(),
|
|
5558
|
-
|
|
5989
|
+
filters: this.customFilter(),
|
|
5559
5990
|
parentFilters: this.filter,
|
|
5560
5991
|
columns: this.columns(),
|
|
5561
5992
|
allowCreate: true
|
|
@@ -5708,8 +6139,8 @@ class AXPLookupWidgetEditComponent extends AXPValueWidgetComponent {
|
|
|
5708
6139
|
singleOrMultiple(values) {
|
|
5709
6140
|
return this.multiple() ? values : values[0];
|
|
5710
6141
|
}
|
|
5711
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
5712
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.
|
|
6142
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPLookupWidgetEditComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
6143
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.4", type: AXPLookupWidgetEditComponent, isStandalone: true, selector: "axp-lookup-widget-edit", viewQueries: [{ propertyName: "textbox", first: true, predicate: AXTagBoxComponent, descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: `
|
|
5713
6144
|
@if(dataSource()) {
|
|
5714
6145
|
@if (look() == 'select') {
|
|
5715
6146
|
<ax-select-box
|
|
@@ -5778,9 +6209,9 @@ class AXPLookupWidgetEditComponent extends AXPValueWidgetComponent {
|
|
|
5778
6209
|
}
|
|
5779
6210
|
`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type:
|
|
5780
6211
|
//
|
|
5781
|
-
AXButtonModule }, { kind: "component", type: i3
|
|
6212
|
+
AXButtonModule }, { kind: "component", type: i3.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "iconOnly", "type", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "loadingTextChange"] }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i3$2.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "component", type: i3$2.AXDecoratorClearButtonComponent, selector: "ax-clear-button", inputs: ["icon"] }, { kind: "component", type: i3$2.AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-subtitle, ax-placeholder, ax-overlay" }, { kind: "ngmodule", type: AXLoadingModule }, { kind: "component", type: i4.AXLoadingComponent, selector: "ax-loading", inputs: ["visible", "type", "context"], outputs: ["visibleChange"] }, { kind: "ngmodule", type: AXValidationModule }, { kind: "ngmodule", type: AXFormModule }, { kind: "directive", type: i5$1.AXValidationRuleDirective, selector: "ax-validation-rule", inputs: ["rule", "options", "message", "disabled"] }, { kind: "ngmodule", type: AXTagBoxModule }, { kind: "component", type: i6$1.AXTagBoxComponent, selector: "ax-tag-box", inputs: ["disabled", "tabIndex", "readonly", "value", "state", "name", "id", "placeholder", "allowNull", "type", "look", "addOnComma", "addOnEnter", "valueField", "textField", "readonlyField", "allowDuplicateValues"], outputs: ["onBlur", "onFocus", "valueChange", "stateChange", "onValueChanged", "readonlyChange", "disabledChange", "onKeyDown", "onKeyUp", "onKeyPress"] }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "ngmodule", type: AXSelectBoxModule }, { kind: "component", type: i7.AXSelectBoxComponent, selector: "ax-select-box", inputs: ["disabled", "readonly", "tabIndex", "placeholder", "minValue", "maxValue", "value", "state", "name", "id", "type", "look", "multiple", "valueField", "textField", "disabledField", "textTemplate", "selectedItems", "isItemTruncated", "showItemTooltip", "dataSource", "minRecordsForSearch", "caption", "itemTemplate", "selectedTemplate", "emptyTemplate", "loadingTemplate", "dropdownWidth", "searchBoxAutoFocus"], outputs: ["valueChange", "stateChange", "onValueChanged", "onBlur", "onFocus", "readonlyChange", "disabledChange", "onOpened", "onClosed", "onItemSelected", "onItemClick"] }, { kind: "component", type: AXSearchBoxComponent, selector: "ax-search-box", inputs: ["disabled", "readonly", "tabIndex", "placeholder", "value", "state", "name", "id", "look", "class", "delayTime", "type"], outputs: ["valueChange", "stateChange", "onValueChanged", "onBlur", "onFocus", "readonlyChange", "disabledChange", "onKeyDown", "onKeyUp", "onKeyPress"] }, { kind: "pipe", type: i5.AsyncPipe, name: "async" }, { kind: "pipe", type: i6.AXTranslatorPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
5782
6213
|
}
|
|
5783
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
6214
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPLookupWidgetEditComponent, decorators: [{
|
|
5784
6215
|
type: Component,
|
|
5785
6216
|
args: [{
|
|
5786
6217
|
selector: 'axp-lookup-widget-edit',
|
|
@@ -5799,425 +6230,82 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImpor
|
|
|
5799
6230
|
<ax-search-box>
|
|
5800
6231
|
<ax-clear-button></ax-clear-button>
|
|
5801
6232
|
</ax-search-box>
|
|
5802
|
-
@for (validation of validationRules(); track $index) {
|
|
5803
|
-
<ax-validation-rule
|
|
5804
|
-
[rule]="validation.rule"
|
|
5805
|
-
[message]="validation.options?.message"
|
|
5806
|
-
[options]="validation.options"
|
|
5807
|
-
></ax-validation-rule>
|
|
5808
|
-
}
|
|
5809
|
-
@if (allowClear()) {
|
|
5810
|
-
<ax-clear-button (click)="handleClearClick()"></ax-clear-button>
|
|
5811
|
-
}
|
|
5812
|
-
</ax-select-box>
|
|
5813
|
-
} @else {
|
|
5814
|
-
<ax-tag-box
|
|
5815
|
-
[ngModel]="selectedItems()"
|
|
5816
|
-
[textField]="displayField()"
|
|
5817
|
-
[valueField]="valueField()"
|
|
5818
|
-
(onValueChanged)="handleValueChange($event)"
|
|
5819
|
-
[placeholder]="placeholder() | translate | async"
|
|
5820
|
-
[addOnEnter]="false"
|
|
5821
|
-
[addOnComma]="false"
|
|
5822
|
-
[disabled]="disabled()"
|
|
5823
|
-
(onKeyUp)="handleKeyUp($event)"
|
|
5824
|
-
(onBlur)="handleOnBlur($event)"
|
|
5825
|
-
>
|
|
5826
|
-
@for (validation of validationRules(); track $index) {
|
|
5827
|
-
<ax-validation-rule
|
|
5828
|
-
[rule]="validation.rule"
|
|
5829
|
-
[message]="validation.options?.message"
|
|
5830
|
-
[options]="validation.options"
|
|
5831
|
-
></ax-validation-rule>
|
|
5832
|
-
}
|
|
5833
|
-
@if (selectedItems().length > 1 || allowClear()) {
|
|
5834
|
-
<ax-clear-button (click)="handleClearClick()"></ax-clear-button>
|
|
5835
|
-
}
|
|
5836
|
-
|
|
5837
|
-
<ax-suffix>
|
|
5838
|
-
<ax-button
|
|
5839
|
-
color="ghost"
|
|
5840
|
-
look="blank"
|
|
5841
|
-
[disabled]="isLoading() || disabled()"
|
|
5842
|
-
(onClick)="handleOnClick($event)"
|
|
5843
|
-
>
|
|
5844
|
-
@if (isLoading()) {
|
|
5845
|
-
<ax-loading></ax-loading>
|
|
5846
|
-
} @else {
|
|
5847
|
-
<ax-icon icon="far fa-search"> </ax-icon>
|
|
5848
|
-
}
|
|
5849
|
-
</ax-button>
|
|
5850
|
-
</ax-suffix>
|
|
5851
|
-
</ax-tag-box>
|
|
5852
|
-
}
|
|
5853
|
-
}
|
|
5854
|
-
`,
|
|
5855
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
5856
|
-
imports: [
|
|
5857
|
-
CommonModule,
|
|
5858
|
-
FormsModule,
|
|
5859
|
-
//
|
|
5860
|
-
AXButtonModule,
|
|
5861
|
-
AXDecoratorModule,
|
|
5862
|
-
AXLoadingModule,
|
|
5863
|
-
AXValidationModule,
|
|
5864
|
-
AXFormModule,
|
|
5865
|
-
AXTagBoxModule,
|
|
5866
|
-
AXTranslationModule,
|
|
5867
|
-
AXSelectBoxModule,
|
|
5868
|
-
AXSearchBoxComponent,
|
|
5869
|
-
],
|
|
5870
|
-
}]
|
|
5871
|
-
}] });
|
|
5872
|
-
|
|
5873
|
-
var lookupWidgetEdit_component = /*#__PURE__*/Object.freeze({
|
|
5874
|
-
__proto__: null,
|
|
5875
|
-
AXPLookupWidgetEditComponent: AXPLookupWidgetEditComponent
|
|
5876
|
-
});
|
|
5877
|
-
|
|
5878
|
-
class AXPEntityDetailPopoverComponent {
|
|
5879
|
-
constructor() {
|
|
5880
|
-
//#region ---- Dependencies ----
|
|
5881
|
-
this.commandService = inject(AXPCommandService);
|
|
5882
|
-
this.queryService = inject(AXPQueryService);
|
|
5883
|
-
//#endregion
|
|
5884
|
-
//#region ---- Inputs ----
|
|
5885
|
-
this.entity = input.required(...(ngDevMode ? [{ debugName: "entity" }] : []));
|
|
5886
|
-
this.entityId = input.required(...(ngDevMode ? [{ debugName: "entityId" }] : []));
|
|
5887
|
-
this.textField = input('title', ...(ngDevMode ? [{ debugName: "textField" }] : []));
|
|
5888
|
-
this.valueField = input('id', ...(ngDevMode ? [{ debugName: "valueField" }] : []));
|
|
5889
|
-
this.item = input(...(ngDevMode ? [undefined, { debugName: "item" }] : []));
|
|
5890
|
-
//#endregion
|
|
5891
|
-
//#region ---- View Children ----
|
|
5892
|
-
this.detailPopover = viewChild('detailPopover', ...(ngDevMode ? [{ debugName: "detailPopover" }] : []));
|
|
5893
|
-
//#endregion
|
|
5894
|
-
//#region ---- Signals ----
|
|
5895
|
-
this.entityDetails = signal(null, ...(ngDevMode ? [{ debugName: "entityDetails" }] : []));
|
|
5896
|
-
this.isLoadingDetails = signal(false, ...(ngDevMode ? [{ debugName: "isLoadingDetails" }] : []));
|
|
5897
|
-
this.isDetailPopoverOpen = signal(false, ...(ngDevMode ? [{ debugName: "isDetailPopoverOpen" }] : []));
|
|
5898
|
-
}
|
|
5899
|
-
//#endregion
|
|
5900
|
-
//#region ---- Public Methods ----
|
|
5901
|
-
/**
|
|
5902
|
-
* Show the entity detail popover
|
|
5903
|
-
*/
|
|
5904
|
-
async show(target) {
|
|
5905
|
-
this.isDetailPopoverOpen.set(true);
|
|
5906
|
-
this.isLoadingDetails.set(true);
|
|
5907
|
-
this.entityDetails.set(null);
|
|
5908
|
-
// Open the popover immediately to display loading state
|
|
5909
|
-
if (this.detailPopover()) {
|
|
5910
|
-
const targetElement = target instanceof ElementRef ? target.nativeElement : target;
|
|
5911
|
-
this.detailPopover().target = targetElement;
|
|
5912
|
-
this.detailPopover().open();
|
|
5913
|
-
}
|
|
5914
|
-
else {
|
|
5915
|
-
// In case the view child is not ready yet, schedule an immediate open
|
|
5916
|
-
setTimeout(() => {
|
|
5917
|
-
if (this.detailPopover()) {
|
|
5918
|
-
const targetElement = target instanceof ElementRef ? target.nativeElement : target;
|
|
5919
|
-
this.detailPopover().target = targetElement;
|
|
5920
|
-
this.detailPopover().open();
|
|
5921
|
-
}
|
|
5922
|
-
}, 0);
|
|
5923
|
-
}
|
|
5924
|
-
// Fetch entity details using the query
|
|
5925
|
-
try {
|
|
5926
|
-
const result = await this.queryService.fetch('Entity:GetDetails', {
|
|
5927
|
-
entity: this.entity(),
|
|
5928
|
-
id: this.entityId(),
|
|
5929
|
-
});
|
|
5930
|
-
if (result?.success) {
|
|
5931
|
-
this.entityDetails.set(result);
|
|
5932
|
-
}
|
|
5933
|
-
}
|
|
5934
|
-
catch (error) {
|
|
5935
|
-
console.error('Failed to fetch entity details:', error);
|
|
5936
|
-
}
|
|
5937
|
-
finally {
|
|
5938
|
-
this.isLoadingDetails.set(false);
|
|
5939
|
-
}
|
|
5940
|
-
}
|
|
5941
|
-
/**
|
|
5942
|
-
* Hide the entity detail popover
|
|
5943
|
-
*/
|
|
5944
|
-
hide() {
|
|
5945
|
-
this.isDetailPopoverOpen.set(false);
|
|
5946
|
-
this.entityDetails.set(null);
|
|
5947
|
-
this.isLoadingDetails.set(false);
|
|
5948
|
-
if (this.detailPopover()) {
|
|
5949
|
-
this.detailPopover().close();
|
|
5950
|
-
}
|
|
5951
|
-
}
|
|
5952
|
-
onDetailPopoverOpenChange(event) {
|
|
5953
|
-
this.isDetailPopoverOpen.set(event);
|
|
5954
|
-
if (!event) {
|
|
5955
|
-
this.entityDetails.set(null);
|
|
5956
|
-
this.isLoadingDetails.set(false);
|
|
5957
|
-
}
|
|
5958
|
-
}
|
|
5959
|
-
async navigateToDetails() {
|
|
5960
|
-
if (this.entityId()) {
|
|
5961
|
-
await this.commandService.execute('Entity:OpenDetails', {
|
|
5962
|
-
entity: this.entity(),
|
|
5963
|
-
data: { id: this.entityId() },
|
|
5964
|
-
});
|
|
5965
|
-
this.hide();
|
|
5966
|
-
}
|
|
5967
|
-
}
|
|
5968
|
-
//#endregion
|
|
5969
|
-
//#region ---- Helper Methods ----
|
|
5970
|
-
/**
|
|
5971
|
-
* Returns true if a value is meaningful for display (non-empty/non-null).
|
|
5972
|
-
*/
|
|
5973
|
-
hasMeaningfulValue(value) {
|
|
5974
|
-
if (value === null || value === undefined)
|
|
5975
|
-
return false;
|
|
5976
|
-
if (typeof value === 'string')
|
|
5977
|
-
return value.trim().length > 0;
|
|
5978
|
-
if (Array.isArray(value))
|
|
5979
|
-
return value.length > 0;
|
|
5980
|
-
if (typeof value === 'object')
|
|
5981
|
-
return Object.keys(value).length > 0;
|
|
5982
|
-
return true;
|
|
5983
|
-
}
|
|
5984
|
-
/**
|
|
5985
|
-
* Calculates an importance score for a property based on its widget type,
|
|
5986
|
-
* whether it currently has a meaningful value, and metadata like title.
|
|
5987
|
-
*/
|
|
5988
|
-
getPropertyImportanceScore(prop, data) {
|
|
5989
|
-
const schema = prop.showAs?.type ?? prop.schema;
|
|
5990
|
-
const importanceMap = {
|
|
5991
|
-
[AXPWidgetsCatalog.text]: 100,
|
|
5992
|
-
[AXPWidgetsCatalog.select]: 95,
|
|
5993
|
-
[AXPWidgetsCatalog.number]: 90,
|
|
5994
|
-
[AXPWidgetsCatalog.dateTime]: 85,
|
|
5995
|
-
[AXPWidgetsCatalog.richText]: 80,
|
|
5996
|
-
[AXPWidgetsCatalog.largeText]: 75,
|
|
5997
|
-
[AXPWidgetsCatalog.contact]: 74,
|
|
5998
|
-
[AXPWidgetsCatalog.toggle]: 65,
|
|
5999
|
-
[AXPWidgetsCatalog.checkbox]: 60,
|
|
6000
|
-
[AXPWidgetsCatalog.color]: 40,
|
|
6001
|
-
};
|
|
6002
|
-
let score = importanceMap[schema] ?? 50;
|
|
6003
|
-
// Prefer fields that actually have a value for the current entity
|
|
6004
|
-
if (this.hasMeaningfulValue(data?.[prop.name])) {
|
|
6005
|
-
score += 20;
|
|
6006
|
-
}
|
|
6007
|
-
// Slight preference for human-friendly titled fields
|
|
6008
|
-
const hasTitle = prop.title && prop.title !== prop.name;
|
|
6009
|
-
if (hasTitle) {
|
|
6010
|
-
score += 5;
|
|
6011
|
-
}
|
|
6012
|
-
return score;
|
|
6013
|
-
}
|
|
6014
|
-
/**
|
|
6015
|
-
* Calculates a name-based importance score to prioritize common key fields
|
|
6016
|
-
* like title, description, status, and important dates.
|
|
6017
|
-
* Name priority MUST come before widget-type priority.
|
|
6018
|
-
*/
|
|
6019
|
-
getNameImportanceScore(prop) {
|
|
6020
|
-
const rawName = (prop.options?.dataPath ?? prop.name ?? '').toString();
|
|
6021
|
-
const normalized = rawName.toLowerCase();
|
|
6022
|
-
const collapsed = normalized.replace(/[^a-z0-9]/g, '');
|
|
6023
|
-
const priorities = [
|
|
6024
|
-
{ keys: ['title', 'name', 'subject', 'code'], score: 120 },
|
|
6025
|
-
{ keys: ['description', 'details', 'summary', 'remark', 'remarks'], score: 110 },
|
|
6026
|
-
{ keys: ['status', 'state', 'phase', 'stage'], score: 105 },
|
|
6027
|
-
{ keys: ['priority', 'severity', 'rank'], score: 100 },
|
|
6028
|
-
{ keys: ['expirydate', 'expirationdate', 'expiredate', 'duedate', 'deadline', 'enddate'], score: 98 },
|
|
6029
|
-
{ keys: ['startdate', 'createdat', 'createdon', 'updatedat', 'updatedon'], score: 95 },
|
|
6030
|
-
{ keys: ['owner', 'assignee', 'assignedto'], score: 92 },
|
|
6031
|
-
{ keys: ['email', 'phone', 'mobile', 'contact'], score: 90 },
|
|
6032
|
-
{ keys: ['category', 'type', 'label', 'tag', 'note', 'notes'], score: 85 },
|
|
6033
|
-
{ keys: ['primary', 'active', 'active', 'enabled', 'archived', 'deleted', 'locked', 'disabled'], score: -2 }, // send to bottom,
|
|
6034
|
-
];
|
|
6035
|
-
for (const group of priorities) {
|
|
6036
|
-
for (const key of group.keys) {
|
|
6037
|
-
if (collapsed === key || collapsed.endsWith(key)) {
|
|
6038
|
-
return group.score;
|
|
6039
|
-
}
|
|
6040
|
-
}
|
|
6233
|
+
@for (validation of validationRules(); track $index) {
|
|
6234
|
+
<ax-validation-rule
|
|
6235
|
+
[rule]="validation.rule"
|
|
6236
|
+
[message]="validation.options?.message"
|
|
6237
|
+
[options]="validation.options"
|
|
6238
|
+
></ax-validation-rule>
|
|
6041
6239
|
}
|
|
6042
|
-
|
|
6043
|
-
|
|
6044
|
-
return 97;
|
|
6240
|
+
@if (allowClear()) {
|
|
6241
|
+
<ax-clear-button (click)="handleClearClick()"></ax-clear-button>
|
|
6045
6242
|
}
|
|
6046
|
-
|
|
6047
|
-
|
|
6243
|
+
</ax-select-box>
|
|
6244
|
+
} @else {
|
|
6245
|
+
<ax-tag-box
|
|
6246
|
+
[ngModel]="selectedItems()"
|
|
6247
|
+
[textField]="displayField()"
|
|
6248
|
+
[valueField]="valueField()"
|
|
6249
|
+
(onValueChanged)="handleValueChange($event)"
|
|
6250
|
+
[placeholder]="placeholder() | translate | async"
|
|
6251
|
+
[addOnEnter]="false"
|
|
6252
|
+
[addOnComma]="false"
|
|
6253
|
+
[disabled]="disabled()"
|
|
6254
|
+
(onKeyUp)="handleKeyUp($event)"
|
|
6255
|
+
(onBlur)="handleOnBlur($event)"
|
|
6256
|
+
>
|
|
6257
|
+
@for (validation of validationRules(); track $index) {
|
|
6258
|
+
<ax-validation-rule
|
|
6259
|
+
[rule]="validation.rule"
|
|
6260
|
+
[message]="validation.options?.message"
|
|
6261
|
+
[options]="validation.options"
|
|
6262
|
+
></ax-validation-rule>
|
|
6048
6263
|
}
|
|
6049
|
-
|
|
6050
|
-
|
|
6051
|
-
|
|
6052
|
-
|
|
6053
|
-
|
|
6054
|
-
|
|
6055
|
-
|
|
6056
|
-
|
|
6057
|
-
|
|
6058
|
-
|
|
6059
|
-
|
|
6060
|
-
|
|
6061
|
-
|
|
6062
|
-
|
|
6063
|
-
|
|
6064
|
-
schema,
|
|
6065
|
-
title,
|
|
6066
|
-
orderIndex: index,
|
|
6067
|
-
};
|
|
6068
|
-
})
|
|
6069
|
-
.filter((prop) => {
|
|
6070
|
-
// Exclude technical fields
|
|
6071
|
-
if (prop.name === 'id' || prop.name === this.textField() || prop.name === this.valueField()) {
|
|
6072
|
-
return false;
|
|
6073
|
-
}
|
|
6074
|
-
// Only include properties that exist in the data
|
|
6075
|
-
if (!data.hasOwnProperty(prop.name)) {
|
|
6076
|
-
return false;
|
|
6077
|
-
}
|
|
6078
|
-
// Filter by property importance based on schema and options
|
|
6079
|
-
const schema = prop.showAs?.type ?? entityDefinition.properties.find((p) => p.name === prop.name)?.schema.interface?.type;
|
|
6080
|
-
// Include common important field types
|
|
6081
|
-
const importantWidgets = [
|
|
6082
|
-
AXPWidgetsCatalog.text,
|
|
6083
|
-
AXPWidgetsCatalog.largeText,
|
|
6084
|
-
AXPWidgetsCatalog.richText,
|
|
6085
|
-
//
|
|
6086
|
-
AXPWidgetsCatalog.select,
|
|
6087
|
-
//AXPWidgetsCatalog.lookup,
|
|
6088
|
-
//
|
|
6089
|
-
AXPWidgetsCatalog.number,
|
|
6090
|
-
AXPWidgetsCatalog.toggle,
|
|
6091
|
-
AXPWidgetsCatalog.checkbox,
|
|
6092
|
-
//
|
|
6093
|
-
AXPWidgetsCatalog.dateTime,
|
|
6094
|
-
AXPWidgetsCatalog.color,
|
|
6095
|
-
AXPWidgetsCatalog.contact,
|
|
6096
|
-
];
|
|
6097
|
-
//
|
|
6098
|
-
if (importantWidgets.includes(schema)) {
|
|
6099
|
-
return true;
|
|
6264
|
+
@if (selectedItems().length > 1 || allowClear()) {
|
|
6265
|
+
<ax-clear-button (click)="handleClearClick()"></ax-clear-button>
|
|
6266
|
+
}
|
|
6267
|
+
|
|
6268
|
+
<ax-suffix>
|
|
6269
|
+
<ax-button
|
|
6270
|
+
color="ghost"
|
|
6271
|
+
look="blank"
|
|
6272
|
+
[disabled]="isLoading() || disabled()"
|
|
6273
|
+
(onClick)="handleOnClick($event)"
|
|
6274
|
+
>
|
|
6275
|
+
@if (isLoading()) {
|
|
6276
|
+
<ax-loading></ax-loading>
|
|
6277
|
+
} @else {
|
|
6278
|
+
<ax-icon icon="far fa-search"> </ax-icon>
|
|
6100
6279
|
}
|
|
6101
|
-
|
|
6102
|
-
|
|
6103
|
-
|
|
6104
|
-
// Primary: name-based importance
|
|
6105
|
-
const nameScoreA = this.getNameImportanceScore(a);
|
|
6106
|
-
const nameScoreB = this.getNameImportanceScore(b);
|
|
6107
|
-
if (nameScoreA !== nameScoreB)
|
|
6108
|
-
return nameScoreB - nameScoreA;
|
|
6109
|
-
// Secondary: widget/value/title based importance
|
|
6110
|
-
const widgetScoreA = this.getPropertyImportanceScore(a, data);
|
|
6111
|
-
const widgetScoreB = this.getPropertyImportanceScore(b, data);
|
|
6112
|
-
if (widgetScoreA !== widgetScoreB)
|
|
6113
|
-
return widgetScoreB - widgetScoreA;
|
|
6114
|
-
const aHasValue = this.hasMeaningfulValue(data?.[a.name]);
|
|
6115
|
-
const bHasValue = this.hasMeaningfulValue(data?.[b.name]);
|
|
6116
|
-
if (aHasValue !== bHasValue)
|
|
6117
|
-
return aHasValue ? -1 : 1;
|
|
6118
|
-
const aHasTitle = a.title && a.title !== a.name;
|
|
6119
|
-
const bHasTitle = b.title && b.title !== b.name;
|
|
6120
|
-
if (aHasTitle !== bHasTitle)
|
|
6121
|
-
return aHasTitle ? -1 : 1;
|
|
6122
|
-
if ((a.orderIndex ?? 0) !== (b.orderIndex ?? 0))
|
|
6123
|
-
return (a.orderIndex ?? 0) - (b.orderIndex ?? 0);
|
|
6124
|
-
return a.name.localeCompare(b.name);
|
|
6125
|
-
})
|
|
6126
|
-
.map((prop) => {
|
|
6127
|
-
// Create widget node based on property schema
|
|
6128
|
-
const widgetNode = {
|
|
6129
|
-
type: prop.schema || AXPWidgetsCatalog.text,
|
|
6130
|
-
path: prop.options?.dataPath || prop.name,
|
|
6131
|
-
options: prop.options ?? {},
|
|
6132
|
-
mode: 'view',
|
|
6133
|
-
};
|
|
6134
|
-
return {
|
|
6135
|
-
name: prop.name,
|
|
6136
|
-
title: prop.title || prop.name,
|
|
6137
|
-
node: widgetNode,
|
|
6138
|
-
};
|
|
6139
|
-
})
|
|
6140
|
-
.slice(0, 7); // Limit to 7 most important fields
|
|
6141
|
-
return importantProperties;
|
|
6280
|
+
</ax-button>
|
|
6281
|
+
</ax-suffix>
|
|
6282
|
+
</ax-tag-box>
|
|
6142
6283
|
}
|
|
6143
|
-
|
|
6144
|
-
|
|
6145
|
-
|
|
6146
|
-
|
|
6147
|
-
type: Component,
|
|
6148
|
-
args: [{ selector: 'axp-entity-detail-popover', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
|
6284
|
+
}
|
|
6285
|
+
`,
|
|
6286
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
6287
|
+
imports: [
|
|
6149
6288
|
CommonModule,
|
|
6289
|
+
FormsModule,
|
|
6290
|
+
//
|
|
6150
6291
|
AXButtonModule,
|
|
6151
|
-
|
|
6152
|
-
AXPLayoutBuilderModule,
|
|
6153
|
-
AXTranslationModule,
|
|
6292
|
+
AXDecoratorModule,
|
|
6154
6293
|
AXLoadingModule,
|
|
6155
|
-
|
|
6156
|
-
|
|
6157
|
-
|
|
6158
|
-
|
|
6159
|
-
|
|
6160
|
-
|
|
6161
|
-
|
|
6162
|
-
this.environmentInjector = inject(EnvironmentInjector);
|
|
6163
|
-
//#endregion
|
|
6164
|
-
//#region ---- Private Properties ----
|
|
6165
|
-
this.activePopoverRef = null;
|
|
6166
|
-
}
|
|
6167
|
-
//#endregion
|
|
6168
|
-
//#region ---- Public Methods ----
|
|
6169
|
-
/**
|
|
6170
|
-
* Show entity detail popover
|
|
6171
|
-
* @param target - The target element to position the popover
|
|
6172
|
-
* @param options - Configuration options for the popover
|
|
6173
|
-
*/
|
|
6174
|
-
async show(target, options) {
|
|
6175
|
-
// Close any existing popover
|
|
6176
|
-
this.hide();
|
|
6177
|
-
// Create component dynamically
|
|
6178
|
-
this.activePopoverRef = createComponent(AXPEntityDetailPopoverComponent, {
|
|
6179
|
-
environmentInjector: this.environmentInjector,
|
|
6180
|
-
});
|
|
6181
|
-
// Set inputs
|
|
6182
|
-
this.activePopoverRef.setInput('entity', options.entity);
|
|
6183
|
-
this.activePopoverRef.setInput('entityId', options.id);
|
|
6184
|
-
this.activePopoverRef.setInput('textField', options.textField || 'title');
|
|
6185
|
-
this.activePopoverRef.setInput('valueField', options.valueField || 'id');
|
|
6186
|
-
this.activePopoverRef.setInput('item', options.item);
|
|
6187
|
-
// Attach to application
|
|
6188
|
-
this.applicationRef.attachView(this.activePopoverRef.hostView);
|
|
6189
|
-
// Append to document body
|
|
6190
|
-
document.body.appendChild(this.activePopoverRef.location.nativeElement);
|
|
6191
|
-
// Show the popover
|
|
6192
|
-
await this.activePopoverRef.instance.show(target);
|
|
6193
|
-
}
|
|
6194
|
-
/**
|
|
6195
|
-
* Hide the active popover
|
|
6196
|
-
*/
|
|
6197
|
-
hide() {
|
|
6198
|
-
if (this.activePopoverRef) {
|
|
6199
|
-
this.activePopoverRef.instance.hide();
|
|
6200
|
-
this.applicationRef.detachView(this.activePopoverRef.hostView);
|
|
6201
|
-
this.activePopoverRef.destroy();
|
|
6202
|
-
this.activePopoverRef = null;
|
|
6203
|
-
}
|
|
6204
|
-
}
|
|
6205
|
-
/**
|
|
6206
|
-
* Check if a popover is currently active
|
|
6207
|
-
*/
|
|
6208
|
-
get isActive() {
|
|
6209
|
-
return this.activePopoverRef !== null;
|
|
6210
|
-
}
|
|
6211
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPEntityDetailPopoverService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
6212
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPEntityDetailPopoverService, providedIn: 'root' }); }
|
|
6213
|
-
}
|
|
6214
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPEntityDetailPopoverService, decorators: [{
|
|
6215
|
-
type: Injectable,
|
|
6216
|
-
args: [{
|
|
6217
|
-
providedIn: 'root'
|
|
6294
|
+
AXValidationModule,
|
|
6295
|
+
AXFormModule,
|
|
6296
|
+
AXTagBoxModule,
|
|
6297
|
+
AXTranslationModule,
|
|
6298
|
+
AXSelectBoxModule,
|
|
6299
|
+
AXSearchBoxComponent,
|
|
6300
|
+
],
|
|
6218
6301
|
}]
|
|
6219
6302
|
}] });
|
|
6220
6303
|
|
|
6304
|
+
var lookupWidgetEdit_component = /*#__PURE__*/Object.freeze({
|
|
6305
|
+
__proto__: null,
|
|
6306
|
+
AXPLookupWidgetEditComponent: AXPLookupWidgetEditComponent
|
|
6307
|
+
});
|
|
6308
|
+
|
|
6221
6309
|
class AXPLookupWidgetColumnComponent extends AXPColumnWidgetComponent {
|
|
6222
6310
|
constructor() {
|
|
6223
6311
|
super(...arguments);
|
|
@@ -6315,10 +6403,10 @@ class AXPLookupWidgetColumnComponent extends AXPColumnWidgetComponent {
|
|
|
6315
6403
|
[this.textField]: item,
|
|
6316
6404
|
};
|
|
6317
6405
|
}
|
|
6318
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
6319
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.
|
|
6406
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPLookupWidgetColumnComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
6407
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.4", type: AXPLookupWidgetColumnComponent, isStandalone: true, selector: "ng-component", inputs: { rawValue: "rawValue", rowData: "rowData" }, viewQueries: [{ propertyName: "moreButton", first: true, predicate: ["moreButton"], descendants: true, isSignal: true }, { propertyName: "morePopover", first: true, predicate: ["morePopover"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"ax-flex ax-gap-1 ax-items-center\">\n @if (visibleItems().length > 0) {\n @for (item of visibleItems(); track $index) {\n <span class=\"ax-cursor-pointer hover:ax-text-primary hover:ax-underline\" (click)=\"handleItemClick($index)\">\n {{ item[this.textField] }}\n </span>\n @if ($index < visibleItems().length - 1) {\n <span class=\"ax-text-muted\">\u2022</span>\n }\n }\n } @else {\n <span class=\"ax-text-muted\">---</span>\n }\n\n @if (hasMoreItems()) {\n <span\n class=\"ax-absolute ax-flex ax-items-center ax-end-0 ax-px-1 ax-cursor-pointer ax-h-full hover:ax-primary-lighter\"\n (click)=\"showMoreItems()\"\n #moreButton\n >\n <i class=\"fa-light fa-ellipsis-vertical\"></i>\n </span>\n }\n</div>\n\n<!-- More Items Popover -->\n<ax-popover [openOn]=\"'manual'\" #morePopover (openChange)=\"onMorePopoverOpenChange($event)\">\n <div class=\"ax-lightest-surface ax-border ax-rounded-lg ax-shadow-lg ax-p-4 ax-min-w-[280px]\">\n <div class=\"ax-mb-4 ax-border-b ax-pb-2\">\n <h3 class=\"ax-text-base ax-font-semibold\">All {{ allItems().length }} Items</h3>\n </div>\n <div class=\"ax-max-h-64 ax-flex ax-flex-col ax-gap-3\">\n @for (item of allItems(); track $index) {\n <span class=\"ax-cursor-pointer hover:ax-text-primary hover:ax-underline\" (click)=\"showItemDetail(item, $index)\">\n {{ item[this.textField] }}\n </span>\n }\n </div>\n </div>\n</ax-popover>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: AXBadgeModule }, { kind: "ngmodule", type: AXButtonModule }, { kind: "ngmodule", type: AXPopoverModule }, { kind: "component", type: i2.AXPopoverComponent, selector: "ax-popover", inputs: ["width", "disabled", "offsetX", "offsetY", "target", "placement", "content", "openOn", "closeOn", "hasBackdrop", "openAfter", "closeAfter", "backdropClass", "panelClass", "adaptivityEnabled"], outputs: ["onOpened", "onClosed"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
6320
6408
|
}
|
|
6321
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
6409
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPLookupWidgetColumnComponent, decorators: [{
|
|
6322
6410
|
type: Component,
|
|
6323
6411
|
args: [{ changeDetection: ChangeDetectionStrategy.OnPush, imports: [CommonModule, AXBadgeModule, AXButtonModule, AXPopoverModule], inputs: ['rawValue', 'rowData'], template: "<div class=\"ax-flex ax-gap-1 ax-items-center\">\n @if (visibleItems().length > 0) {\n @for (item of visibleItems(); track $index) {\n <span class=\"ax-cursor-pointer hover:ax-text-primary hover:ax-underline\" (click)=\"handleItemClick($index)\">\n {{ item[this.textField] }}\n </span>\n @if ($index < visibleItems().length - 1) {\n <span class=\"ax-text-muted\">\u2022</span>\n }\n }\n } @else {\n <span class=\"ax-text-muted\">---</span>\n }\n\n @if (hasMoreItems()) {\n <span\n class=\"ax-absolute ax-flex ax-items-center ax-end-0 ax-px-1 ax-cursor-pointer ax-h-full hover:ax-primary-lighter\"\n (click)=\"showMoreItems()\"\n #moreButton\n >\n <i class=\"fa-light fa-ellipsis-vertical\"></i>\n </span>\n }\n</div>\n\n<!-- More Items Popover -->\n<ax-popover [openOn]=\"'manual'\" #morePopover (openChange)=\"onMorePopoverOpenChange($event)\">\n <div class=\"ax-lightest-surface ax-border ax-rounded-lg ax-shadow-lg ax-p-4 ax-min-w-[280px]\">\n <div class=\"ax-mb-4 ax-border-b ax-pb-2\">\n <h3 class=\"ax-text-base ax-font-semibold\">All {{ allItems().length }} Items</h3>\n </div>\n <div class=\"ax-max-h-64 ax-flex ax-flex-col ax-gap-3\">\n @for (item of allItems(); track $index) {\n <span class=\"ax-cursor-pointer hover:ax-text-primary hover:ax-underline\" (click)=\"showItemDetail(item, $index)\">\n {{ item[this.textField] }}\n </span>\n }\n </div>\n </div>\n</ax-popover>\n" }]
|
|
6324
6412
|
}] });
|
|
@@ -6335,6 +6423,7 @@ const AXPLookupWidget = {
|
|
|
6335
6423
|
groups: [AXPWidgetGroupEnum.EntityWidget],
|
|
6336
6424
|
defaultFilterWidgetName: 'lookup-filter',
|
|
6337
6425
|
type: 'editor',
|
|
6426
|
+
icon: 'fa-light fa-list-radio',
|
|
6338
6427
|
properties: [
|
|
6339
6428
|
AXP_DISABLED_PROPERTY,
|
|
6340
6429
|
AXP_ALLOW_CLEAR_PROPERTY,
|
|
@@ -6367,7 +6456,7 @@ const AXPLookupWidget = {
|
|
|
6367
6456
|
},
|
|
6368
6457
|
visible: true,
|
|
6369
6458
|
},
|
|
6370
|
-
AXP_ALLOW_MULTIPLE_PROPERTY
|
|
6459
|
+
AXP_ALLOW_MULTIPLE_PROPERTY,
|
|
6371
6460
|
],
|
|
6372
6461
|
components: {
|
|
6373
6462
|
view: {
|
|
@@ -6405,8 +6494,8 @@ class AXPTagableBoxWidgetColumnComponent extends AXPValueWidgetComponent {
|
|
|
6405
6494
|
return Array.isArray(value) ? value : [value];
|
|
6406
6495
|
}, ...(ngDevMode ? [{ debugName: "getData" }] : []));
|
|
6407
6496
|
}
|
|
6408
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
6409
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.
|
|
6497
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPTagableBoxWidgetColumnComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
6498
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.4", type: AXPTagableBoxWidgetColumnComponent, isStandalone: true, selector: "ng-component", usesInheritance: true, ngImport: i0, template: `
|
|
6410
6499
|
<div class="ax-flex ax-gap-1 ax-flex-wrap">
|
|
6411
6500
|
@if (useSelectBox() && getData().length > 0) { @for (item of getData(); track $index) {
|
|
6412
6501
|
<ax-badge [look]="'twotone'" [text]="item[textField()]" color="primary"></ax-badge>
|
|
@@ -6418,7 +6507,7 @@ class AXPTagableBoxWidgetColumnComponent extends AXPValueWidgetComponent {
|
|
|
6418
6507
|
</div>
|
|
6419
6508
|
`, isInline: true, dependencies: [{ kind: "ngmodule", type: AXBadgeModule }, { kind: "component", type: i1.AXBadgeComponent, selector: "ax-badge", inputs: ["color", "look", "text"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
6420
6509
|
}
|
|
6421
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
6510
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPTagableBoxWidgetColumnComponent, decorators: [{
|
|
6422
6511
|
type: Component,
|
|
6423
6512
|
args: [{
|
|
6424
6513
|
template: `
|
|
@@ -6481,8 +6570,8 @@ class AXPTagableBoxWidgetEditComponent extends AXPValueWidgetComponent {
|
|
|
6481
6570
|
cls[`ax-flex-1`] = true;
|
|
6482
6571
|
return cls;
|
|
6483
6572
|
}
|
|
6484
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
6485
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.
|
|
6573
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPTagableBoxWidgetEditComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
6574
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.4", type: AXPTagableBoxWidgetEditComponent, isStandalone: true, selector: "axp-tagable-box-widget", host: { properties: { "class": "this.__class" } }, usesInheritance: true, ngImport: i0, template: `
|
|
6486
6575
|
<div class="ax-grid ax-grid-cols-12 ax-gap-4">
|
|
6487
6576
|
<!-- نمایش Select Box با دکمه اضافه کردن آیتم -->
|
|
6488
6577
|
<ax-select-box
|
|
@@ -6521,9 +6610,9 @@ class AXPTagableBoxWidgetEditComponent extends AXPValueWidgetComponent {
|
|
|
6521
6610
|
</ax-prefix>
|
|
6522
6611
|
</ax-button>
|
|
6523
6612
|
</div>
|
|
6524
|
-
`, isInline: true, dependencies: [{ kind: "ngmodule", type: AXTextBoxModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: AXFormModule }, { kind: "directive", type: i5$1.AXValidationRuleDirective, selector: "ax-validation-rule", inputs: ["rule", "options", "message", "disabled"] }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i3.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "component", type: i3.AXDecoratorClearButtonComponent, selector: "ax-clear-button", inputs: ["icon"] }, { kind: "component", type: i3.AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-subtitle, ax-placeholder, ax-overlay" }, { kind: "ngmodule", type: AXValidationModule }, { kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i3
|
|
6613
|
+
`, isInline: true, dependencies: [{ kind: "ngmodule", type: AXTextBoxModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: AXFormModule }, { kind: "directive", type: i5$1.AXValidationRuleDirective, selector: "ax-validation-rule", inputs: ["rule", "options", "message", "disabled"] }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i3$2.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "component", type: i3$2.AXDecoratorClearButtonComponent, selector: "ax-clear-button", inputs: ["icon"] }, { kind: "component", type: i3$2.AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-subtitle, ax-placeholder, ax-overlay" }, { kind: "ngmodule", type: AXValidationModule }, { kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i3.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "iconOnly", "type", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "loadingTextChange"] }, { kind: "ngmodule", type: AXSelectBoxModule }, { kind: "component", type: i7.AXSelectBoxComponent, selector: "ax-select-box", inputs: ["disabled", "readonly", "tabIndex", "placeholder", "minValue", "maxValue", "value", "state", "name", "id", "type", "look", "multiple", "valueField", "textField", "disabledField", "textTemplate", "selectedItems", "isItemTruncated", "showItemTooltip", "dataSource", "minRecordsForSearch", "caption", "itemTemplate", "selectedTemplate", "emptyTemplate", "loadingTemplate", "dropdownWidth", "searchBoxAutoFocus"], outputs: ["valueChange", "stateChange", "onValueChanged", "onBlur", "onFocus", "readonlyChange", "disabledChange", "onOpened", "onClosed", "onItemSelected", "onItemClick"] }, { kind: "ngmodule", type: AXSearchBoxModule }, { kind: "component", type: i6$2.AXSearchBoxComponent, selector: "ax-search-box", inputs: ["disabled", "readonly", "tabIndex", "placeholder", "value", "state", "name", "id", "look", "class", "delayTime", "type"], outputs: ["valueChange", "stateChange", "onValueChanged", "onBlur", "onFocus", "readonlyChange", "disabledChange", "onKeyDown", "onKeyUp", "onKeyPress"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
6525
6614
|
}
|
|
6526
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
6615
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPTagableBoxWidgetEditComponent, decorators: [{
|
|
6527
6616
|
type: Component,
|
|
6528
6617
|
args: [{
|
|
6529
6618
|
selector: 'axp-tagable-box-widget',
|
|
@@ -6591,10 +6680,10 @@ var tagableBoxWidgetEdit_component = /*#__PURE__*/Object.freeze({
|
|
|
6591
6680
|
});
|
|
6592
6681
|
|
|
6593
6682
|
class AXPTagableBoxWidgetFilterComponent extends AXPValueWidgetComponent {
|
|
6594
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
6595
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.
|
|
6683
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPTagableBoxWidgetFilterComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
6684
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.4", type: AXPTagableBoxWidgetFilterComponent, isStandalone: true, selector: "ng-component", usesInheritance: true, ngImport: i0, template: ``, isInline: true, dependencies: [{ kind: "ngmodule", type: FormsModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
6596
6685
|
}
|
|
6597
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
6686
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPTagableBoxWidgetFilterComponent, decorators: [{
|
|
6598
6687
|
type: Component,
|
|
6599
6688
|
args: [{
|
|
6600
6689
|
template: ``,
|
|
@@ -6629,8 +6718,8 @@ class AXPTagableBoxWidgetPrintComponent extends AXPValueWidgetComponent {
|
|
|
6629
6718
|
return Array.isArray(value) ? value : [value];
|
|
6630
6719
|
}, ...(ngDevMode ? [{ debugName: "getData" }] : []));
|
|
6631
6720
|
}
|
|
6632
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
6633
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.
|
|
6721
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPTagableBoxWidgetPrintComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
6722
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.4", type: AXPTagableBoxWidgetPrintComponent, isStandalone: true, selector: "ng-component", usesInheritance: true, ngImport: i0, template: `
|
|
6634
6723
|
<div>
|
|
6635
6724
|
@if (useSelectBox() && getData().length > 0) { @for (item of getData(); track $index) {
|
|
6636
6725
|
<span class="ax-bg-slate-100 ax-px-2 ax-py-1 ax-rounded ax-mr-2 ax-mb-2 ax-inline-block">{{
|
|
@@ -6646,7 +6735,7 @@ class AXPTagableBoxWidgetPrintComponent extends AXPValueWidgetComponent {
|
|
|
6646
6735
|
</div>
|
|
6647
6736
|
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
6648
6737
|
}
|
|
6649
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
6738
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPTagableBoxWidgetPrintComponent, decorators: [{
|
|
6650
6739
|
type: Component,
|
|
6651
6740
|
args: [{
|
|
6652
6741
|
template: `
|
|
@@ -6695,14 +6784,14 @@ class AXPTagableBoxWidgetViewComponent extends AXPValueWidgetComponent {
|
|
|
6695
6784
|
return Array.isArray(value) ? value : [value];
|
|
6696
6785
|
}, ...(ngDevMode ? [{ debugName: "getData" }] : []));
|
|
6697
6786
|
}
|
|
6698
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
6699
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.
|
|
6787
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPTagableBoxWidgetViewComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
6788
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.4", type: AXPTagableBoxWidgetViewComponent, isStandalone: true, selector: "axp-tagable-box-widget", usesInheritance: true, ngImport: i0, template: `
|
|
6700
6789
|
@for (item of internalValue(); track $index) {
|
|
6701
6790
|
<ax-badge [look]="'twotone'" [text]="item" color="primary"></ax-badge>
|
|
6702
6791
|
}
|
|
6703
6792
|
`, isInline: true, dependencies: [{ kind: "ngmodule", type: AXBadgeModule }, { kind: "component", type: i1.AXBadgeComponent, selector: "ax-badge", inputs: ["color", "look", "text"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
6704
6793
|
}
|
|
6705
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
6794
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPTagableBoxWidgetViewComponent, decorators: [{
|
|
6706
6795
|
type: Component,
|
|
6707
6796
|
args: [{
|
|
6708
6797
|
selector: 'axp-tagable-box-widget',
|
|
@@ -6798,8 +6887,8 @@ class AXPWidgetSelectorWidgetEditComponent extends AXPValueWidgetComponent {
|
|
|
6798
6887
|
const widget = this.widgetRegisteryService.resolve(e.values.type);
|
|
6799
6888
|
this.setValue({ title: widget?.title, ...e.values });
|
|
6800
6889
|
}
|
|
6801
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
6802
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.
|
|
6890
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPWidgetSelectorWidgetEditComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
6891
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.4", type: AXPWidgetSelectorWidgetEditComponent, isStandalone: true, selector: "ng-component", viewQueries: [{ propertyName: "textbox", first: true, predicate: AXTextBoxComponent, descendants: true }], usesInheritance: true, ngImport: i0, template: `
|
|
6803
6892
|
<ax-text-box [ngModel]="displayText()" [placeholder]="placeholder()" [readonly]="true">
|
|
6804
6893
|
@for (validation of validationRules(); track $index) {
|
|
6805
6894
|
<ax-validation-rule
|
|
@@ -6818,9 +6907,9 @@ class AXPWidgetSelectorWidgetEditComponent extends AXPValueWidgetComponent {
|
|
|
6818
6907
|
<axp-widget-property-viewer [widget]="selectedWidgetNode()!" (onChanged)="handleChangeWidget($event)">
|
|
6819
6908
|
</axp-widget-property-viewer>
|
|
6820
6909
|
}
|
|
6821
|
-
`, isInline: true, dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: AXSelectBoxModule }, { kind: "ngmodule", type: AXTextBoxModule }, { kind: "component", type: i2$1.AXTextBoxComponent, selector: "ax-text-box", inputs: ["disabled", "tabIndex", "readonly", "value", "state", "name", "id", "placeholder", "maxLength", "allowNull", "type", "autoComplete", "look", "mask-options", "class"], outputs: ["onBlur", "onFocus", "valueChange", "stateChange", "onValueChanged", "readonlyChange", "disabledChange", "onKeyDown", "onKeyUp", "onKeyPress"] }, { kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i3
|
|
6910
|
+
`, isInline: true, dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: AXSelectBoxModule }, { kind: "ngmodule", type: AXTextBoxModule }, { kind: "component", type: i2$1.AXTextBoxComponent, selector: "ax-text-box", inputs: ["disabled", "tabIndex", "readonly", "value", "state", "name", "id", "placeholder", "maxLength", "allowNull", "type", "autoComplete", "look", "mask-options", "class"], outputs: ["onBlur", "onFocus", "valueChange", "stateChange", "onValueChanged", "readonlyChange", "disabledChange", "onKeyDown", "onKeyUp", "onKeyPress"] }, { kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i3.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "iconOnly", "type", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "loadingTextChange"] }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i3$2.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "component", type: i3$2.AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-subtitle, ax-placeholder, ax-overlay" }, { kind: "ngmodule", type: AXLoadingModule }, { kind: "ngmodule", type: AXValidationModule }, { kind: "ngmodule", type: AXFormModule }, { kind: "directive", type: i5$1.AXValidationRuleDirective, selector: "ax-validation-rule", inputs: ["rule", "options", "message", "disabled"] }, { kind: "component", type: AXPWidgetPropertyViewerComponent, selector: "axp-widget-property-viewer", inputs: ["widget", "mode"], outputs: ["onChanged"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
6822
6911
|
}
|
|
6823
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
6912
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPWidgetSelectorWidgetEditComponent, decorators: [{
|
|
6824
6913
|
type: Component,
|
|
6825
6914
|
args: [{
|
|
6826
6915
|
template: `
|
|
@@ -6867,10 +6956,10 @@ var widgetSelectorWidgetEdit_component = /*#__PURE__*/Object.freeze({
|
|
|
6867
6956
|
});
|
|
6868
6957
|
|
|
6869
6958
|
class AXPWidgetSelectorWidgetViewComponent extends AXPValueWidgetComponent {
|
|
6870
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
6871
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.
|
|
6959
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPWidgetSelectorWidgetViewComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
6960
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.4", type: AXPWidgetSelectorWidgetViewComponent, isStandalone: true, selector: "ng-component", usesInheritance: true, ngImport: i0, template: `{{ getValue()?.title }}`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
6872
6961
|
}
|
|
6873
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
6962
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPWidgetSelectorWidgetViewComponent, decorators: [{
|
|
6874
6963
|
type: Component,
|
|
6875
6964
|
args: [{
|
|
6876
6965
|
template: `{{ getValue()?.title }}`,
|
|
@@ -6947,10 +7036,10 @@ class AXPEntityCreatePopupAction extends AXPWorkflowAction {
|
|
|
6947
7036
|
}
|
|
6948
7037
|
}
|
|
6949
7038
|
}
|
|
6950
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
6951
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.
|
|
7039
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPEntityCreatePopupAction, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
7040
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPEntityCreatePopupAction }); }
|
|
6952
7041
|
}
|
|
6953
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
7042
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPEntityCreatePopupAction, decorators: [{
|
|
6954
7043
|
type: Injectable
|
|
6955
7044
|
}] });
|
|
6956
7045
|
class AXPEntityCreateSubmittedAction extends AXPWorkflowAction {
|
|
@@ -6958,10 +7047,10 @@ class AXPEntityCreateSubmittedAction extends AXPWorkflowAction {
|
|
|
6958
7047
|
this.dispatch(AXPEntityCreateEvent({ entity: context.getVariable('entity'), meta: context.getVariable('meta') }));
|
|
6959
7048
|
this.dispatch(AXPRefreshEvent({ entity: context.getVariable('entity'), meta: context.getVariable('meta') }));
|
|
6960
7049
|
}
|
|
6961
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
6962
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.
|
|
7050
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPEntityCreateSubmittedAction, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
7051
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPEntityCreateSubmittedAction }); }
|
|
6963
7052
|
}
|
|
6964
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
7053
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPEntityCreateSubmittedAction, decorators: [{
|
|
6965
7054
|
type: Injectable
|
|
6966
7055
|
}] });
|
|
6967
7056
|
const AXPCreateEntityWorkflow = {
|
|
@@ -7033,12 +7122,12 @@ class AXPQuickEntityModifyPopupAction extends AXPWorkflowAction {
|
|
|
7033
7122
|
if (parentKey) {
|
|
7034
7123
|
context.setVariable('parentKey', parentKey);
|
|
7035
7124
|
}
|
|
7125
|
+
console.log(`${this.translateService.translateSync('entity.modify')}`);
|
|
7036
7126
|
const com = await this.config.viewers.master.modify();
|
|
7037
7127
|
const popup = await this.popupService.open(com, {
|
|
7038
7128
|
title: headerTitle
|
|
7039
7129
|
? headerTitle
|
|
7040
|
-
: (title
|
|
7041
|
-
`${this.translateService.translateSync('entity.modify')} ${this.translateService.translateSync(entityRef.formats.individual)}`),
|
|
7130
|
+
: `${this.translateService.translateSync('@general:actions.modify.title')} ${this.translateService.translateSync(entityRef.formats.individual)}`,
|
|
7042
7131
|
size: this.platform.is('Mobile') || this.platform.is('SM') ? 'full' : size ? size : 'md',
|
|
7043
7132
|
data: {
|
|
7044
7133
|
vm,
|
|
@@ -7052,10 +7141,10 @@ class AXPQuickEntityModifyPopupAction extends AXPWorkflowAction {
|
|
|
7052
7141
|
context.setVariable('data', cloneDeep(popup.data.context));
|
|
7053
7142
|
}
|
|
7054
7143
|
}
|
|
7055
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
7056
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.
|
|
7144
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPQuickEntityModifyPopupAction, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
7145
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPQuickEntityModifyPopupAction }); }
|
|
7057
7146
|
}
|
|
7058
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
7147
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPQuickEntityModifyPopupAction, decorators: [{
|
|
7059
7148
|
type: Injectable
|
|
7060
7149
|
}] });
|
|
7061
7150
|
const AXPQuickModifyEntityWorkflow = {
|
|
@@ -7112,10 +7201,10 @@ class AXPEntityApplyUpdatesAction extends AXPWorkflowAction {
|
|
|
7112
7201
|
context.setOutput('error', error);
|
|
7113
7202
|
}
|
|
7114
7203
|
}
|
|
7115
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
7116
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.
|
|
7204
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPEntityApplyUpdatesAction, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
7205
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPEntityApplyUpdatesAction }); }
|
|
7117
7206
|
}
|
|
7118
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
7207
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPEntityApplyUpdatesAction, decorators: [{
|
|
7119
7208
|
type: Injectable
|
|
7120
7209
|
}] });
|
|
7121
7210
|
|
|
@@ -7134,10 +7223,10 @@ class AXPShowDetailViewAction extends AXPWorkflowAction {
|
|
|
7134
7223
|
context.setVariable('payload', newPayload);
|
|
7135
7224
|
this.navigation.execute(context);
|
|
7136
7225
|
}
|
|
7137
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
7138
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.
|
|
7226
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPShowDetailViewAction, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
7227
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPShowDetailViewAction }); }
|
|
7139
7228
|
}
|
|
7140
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
7229
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPShowDetailViewAction, decorators: [{
|
|
7141
7230
|
type: Injectable
|
|
7142
7231
|
}] });
|
|
7143
7232
|
const AXPShowDetailsViewWorkflow = {
|
|
@@ -7191,10 +7280,10 @@ class AXPShowFileUploaderPopupAction extends AXPWorkflowAction {
|
|
|
7191
7280
|
context.setVariable('data', cloneDeep(entityData));
|
|
7192
7281
|
}
|
|
7193
7282
|
}
|
|
7194
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
7195
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.
|
|
7283
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPShowFileUploaderPopupAction, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
7284
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPShowFileUploaderPopupAction }); }
|
|
7196
7285
|
}
|
|
7197
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
7286
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPShowFileUploaderPopupAction, decorators: [{
|
|
7198
7287
|
type: Injectable
|
|
7199
7288
|
}] });
|
|
7200
7289
|
const AXPShowFileUploaderPopupWorkflow = {
|
|
@@ -7245,10 +7334,10 @@ class AXPShowListViewAction extends AXPWorkflowAction {
|
|
|
7245
7334
|
context.setVariable('payload', newPayload);
|
|
7246
7335
|
this.navigation.execute(context);
|
|
7247
7336
|
}
|
|
7248
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
7249
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.
|
|
7337
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPShowListViewAction, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
7338
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPShowListViewAction }); }
|
|
7250
7339
|
}
|
|
7251
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
7340
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPShowListViewAction, decorators: [{
|
|
7252
7341
|
type: Injectable
|
|
7253
7342
|
}] });
|
|
7254
7343
|
const AXPShowListViewWorkflow = {
|
|
@@ -7283,7 +7372,7 @@ function routesFacory() {
|
|
|
7283
7372
|
resolve: {
|
|
7284
7373
|
vm: AXPEntityListViewModelResolver,
|
|
7285
7374
|
},
|
|
7286
|
-
data: { reuse:
|
|
7375
|
+
data: { reuse: 'queryParamsChange' },
|
|
7287
7376
|
},
|
|
7288
7377
|
{
|
|
7289
7378
|
path: 'e/:entity/:id/view',
|
|
@@ -7337,9 +7426,9 @@ class AXPEntityModule {
|
|
|
7337
7426
|
},
|
|
7338
7427
|
});
|
|
7339
7428
|
}
|
|
7340
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
7341
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.
|
|
7342
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.
|
|
7429
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPEntityModule, deps: [{ token: i1$2.AXPAppStartUpService }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
7430
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.4", ngImport: i0, type: AXPEntityModule, imports: [RouterModule, i2$2.AXPWorkflowModule, i3$1.AXPWidgetCoreModule] }); }
|
|
7431
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPEntityModule, providers: [
|
|
7343
7432
|
{
|
|
7344
7433
|
provide: ROUTES,
|
|
7345
7434
|
multi: true,
|
|
@@ -7363,13 +7452,17 @@ class AXPEntityModule {
|
|
|
7363
7452
|
provideCommandSetups([
|
|
7364
7453
|
{
|
|
7365
7454
|
key: 'Entity:OpenDetails',
|
|
7366
|
-
command: () => Promise.resolve().then(function () { return openEntityDetails_command; }).then((c) => c.AXPOpenEntityDetailsCommand)
|
|
7455
|
+
command: () => Promise.resolve().then(function () { return openEntityDetails_command; }).then((c) => c.AXPOpenEntityDetailsCommand),
|
|
7456
|
+
},
|
|
7457
|
+
{
|
|
7458
|
+
key: 'Entity:Create',
|
|
7459
|
+
command: () => import('./acorex-platform-layout-entity-create-entity.command-DyXF9zAh.mjs').then((c) => c.AXPCreateEntityCommand),
|
|
7367
7460
|
},
|
|
7368
7461
|
]),
|
|
7369
7462
|
provideQuerySetups([
|
|
7370
7463
|
{
|
|
7371
7464
|
key: 'Entity:GetDetails',
|
|
7372
|
-
loader: () => Promise.resolve().then(function () { return getEntityDetails_query; }).then((c) => c.AXPGetEntityDetailsQuery)
|
|
7465
|
+
loader: () => Promise.resolve().then(function () { return getEntityDetails_query; }).then((c) => c.AXPGetEntityDetailsQuery),
|
|
7373
7466
|
},
|
|
7374
7467
|
]),
|
|
7375
7468
|
], imports: [RouterModule,
|
|
@@ -7400,9 +7493,10 @@ class AXPEntityModule {
|
|
|
7400
7493
|
},
|
|
7401
7494
|
functions: {},
|
|
7402
7495
|
}),
|
|
7403
|
-
|
|
7496
|
+
AXPWidgetCoreModule.forChild({
|
|
7404
7497
|
widgets: [
|
|
7405
7498
|
AXPLookupWidget,
|
|
7499
|
+
AXPLookupFilterWidget,
|
|
7406
7500
|
AXPWidgetSelectorWidget,
|
|
7407
7501
|
AXPTagableBoxWidget,
|
|
7408
7502
|
AXPEntityListWidget,
|
|
@@ -7410,7 +7504,7 @@ class AXPEntityModule {
|
|
|
7410
7504
|
],
|
|
7411
7505
|
})] }); }
|
|
7412
7506
|
}
|
|
7413
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
7507
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPEntityModule, decorators: [{
|
|
7414
7508
|
type: NgModule,
|
|
7415
7509
|
args: [{
|
|
7416
7510
|
imports: [
|
|
@@ -7442,9 +7536,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImpor
|
|
|
7442
7536
|
},
|
|
7443
7537
|
functions: {},
|
|
7444
7538
|
}),
|
|
7445
|
-
|
|
7539
|
+
AXPWidgetCoreModule.forChild({
|
|
7446
7540
|
widgets: [
|
|
7447
7541
|
AXPLookupWidget,
|
|
7542
|
+
AXPLookupFilterWidget,
|
|
7448
7543
|
AXPWidgetSelectorWidget,
|
|
7449
7544
|
AXPTagableBoxWidget,
|
|
7450
7545
|
AXPEntityListWidget,
|
|
@@ -7478,67 +7573,45 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImpor
|
|
|
7478
7573
|
provideCommandSetups([
|
|
7479
7574
|
{
|
|
7480
7575
|
key: 'Entity:OpenDetails',
|
|
7481
|
-
command: () => Promise.resolve().then(function () { return openEntityDetails_command; }).then((c) => c.AXPOpenEntityDetailsCommand)
|
|
7576
|
+
command: () => Promise.resolve().then(function () { return openEntityDetails_command; }).then((c) => c.AXPOpenEntityDetailsCommand),
|
|
7577
|
+
},
|
|
7578
|
+
{
|
|
7579
|
+
key: 'Entity:Create',
|
|
7580
|
+
command: () => import('./acorex-platform-layout-entity-create-entity.command-DyXF9zAh.mjs').then((c) => c.AXPCreateEntityCommand),
|
|
7482
7581
|
},
|
|
7483
7582
|
]),
|
|
7484
7583
|
provideQuerySetups([
|
|
7485
7584
|
{
|
|
7486
7585
|
key: 'Entity:GetDetails',
|
|
7487
|
-
loader: () => Promise.resolve().then(function () { return getEntityDetails_query; }).then((c) => c.AXPGetEntityDetailsQuery)
|
|
7586
|
+
loader: () => Promise.resolve().then(function () { return getEntityDetails_query; }).then((c) => c.AXPGetEntityDetailsQuery),
|
|
7488
7587
|
},
|
|
7489
7588
|
]),
|
|
7490
7589
|
],
|
|
7491
7590
|
}]
|
|
7492
7591
|
}], ctorParameters: () => [{ type: i1$2.AXPAppStartUpService }, { type: i0.Injector }] });
|
|
7493
7592
|
|
|
7494
|
-
|
|
7495
|
-
|
|
7496
|
-
|
|
7497
|
-
|
|
7498
|
-
|
|
7499
|
-
|
|
7500
|
-
|
|
7501
|
-
|
|
7502
|
-
//#endregion
|
|
7503
|
-
//#region ---- Services & Dependencies ----
|
|
7504
|
-
this.router = inject(Router);
|
|
7505
|
-
this.sessionService = inject(AXPSessionService);
|
|
7506
|
-
}
|
|
7507
|
-
//#endregion
|
|
7508
|
-
//#region ---- Command Execution ----
|
|
7509
|
-
/**
|
|
7510
|
-
* Execute the command to navigate to entity details
|
|
7511
|
-
* @param input - Command input containing entity and data information
|
|
7512
|
-
*/
|
|
7513
|
-
async execute(input) {
|
|
7514
|
-
const { entity, data } = input;
|
|
7515
|
-
if (!entity) {
|
|
7516
|
-
throw new Error('Entity name is required for opening details view');
|
|
7593
|
+
const eventDispatchMiddleware = {
|
|
7594
|
+
target: { ops: ['create', 'update', 'delete'], order: 90 },
|
|
7595
|
+
execute: async (ctx, next) => {
|
|
7596
|
+
const dispatcher = inject(AXPEntityEventDispatcherService);
|
|
7597
|
+
await next();
|
|
7598
|
+
if (ctx.op === 'create') {
|
|
7599
|
+
const createdData = ctx.result ? { ...ctx.data, id: ctx.result } : ctx.data;
|
|
7600
|
+
await dispatcher.dispatchInserted(ctx.entityName, { refType: ctx.entityName, data: createdData });
|
|
7517
7601
|
}
|
|
7518
|
-
if (
|
|
7519
|
-
|
|
7602
|
+
else if (ctx.op === 'update') {
|
|
7603
|
+
await dispatcher.dispatchUpdated(ctx.entityName, {
|
|
7604
|
+
refType: ctx.entityName,
|
|
7605
|
+
data: ctx.result,
|
|
7606
|
+
changes: ctx.locals.get('changes'),
|
|
7607
|
+
});
|
|
7520
7608
|
}
|
|
7521
|
-
|
|
7522
|
-
|
|
7523
|
-
|
|
7609
|
+
else if (ctx.op === 'delete') {
|
|
7610
|
+
// For delete, prefer previous entity if available
|
|
7611
|
+
await dispatcher.dispatchDeleted(ctx.entityName, { refType: ctx.entityName, data: ctx.result ?? ctx.previous });
|
|
7524
7612
|
}
|
|
7525
|
-
|
|
7526
|
-
|
|
7527
|
-
this.router.navigate([url]);
|
|
7528
|
-
return { success: true };
|
|
7529
|
-
}
|
|
7530
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPOpenEntityDetailsCommand, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
7531
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPOpenEntityDetailsCommand, providedIn: 'root' }); }
|
|
7532
|
-
}
|
|
7533
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPOpenEntityDetailsCommand, decorators: [{
|
|
7534
|
-
type: Injectable,
|
|
7535
|
-
args: [{ providedIn: 'root' }]
|
|
7536
|
-
}] });
|
|
7537
|
-
|
|
7538
|
-
var openEntityDetails_command = /*#__PURE__*/Object.freeze({
|
|
7539
|
-
__proto__: null,
|
|
7540
|
-
AXPOpenEntityDetailsCommand: AXPOpenEntityDetailsCommand
|
|
7541
|
-
});
|
|
7613
|
+
},
|
|
7614
|
+
};
|
|
7542
7615
|
|
|
7543
7616
|
//#endregion
|
|
7544
7617
|
//#region ---- Get Entity Details Query ----
|
|
@@ -7605,10 +7678,10 @@ class AXPGetEntityDetailsQuery {
|
|
|
7605
7678
|
throw new Error(`Failed to fetch entity data: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
7606
7679
|
}
|
|
7607
7680
|
}
|
|
7608
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.
|
|
7609
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.
|
|
7681
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPGetEntityDetailsQuery, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
7682
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPGetEntityDetailsQuery, providedIn: 'root' }); }
|
|
7610
7683
|
}
|
|
7611
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.
|
|
7684
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPGetEntityDetailsQuery, decorators: [{
|
|
7612
7685
|
type: Injectable,
|
|
7613
7686
|
args: [{ providedIn: 'root' }]
|
|
7614
7687
|
}] });
|
|
@@ -7618,6 +7691,410 @@ var getEntityDetails_query = /*#__PURE__*/Object.freeze({
|
|
|
7618
7691
|
AXPGetEntityDetailsQuery: AXPGetEntityDetailsQuery
|
|
7619
7692
|
});
|
|
7620
7693
|
|
|
7694
|
+
//#endregion
|
|
7695
|
+
class AXPEntityDynamicDialogService {
|
|
7696
|
+
constructor() {
|
|
7697
|
+
//#region ---- Services & Dependencies ----
|
|
7698
|
+
this.entityRegistry = inject(AXPEntityDefinitionRegistryService);
|
|
7699
|
+
this.layoutBuilder = inject(AXPLayoutBuilderService);
|
|
7700
|
+
this.layoutTheme = inject(AXPLayoutThemeService);
|
|
7701
|
+
}
|
|
7702
|
+
//#endregion
|
|
7703
|
+
//#region ---- Public API ----
|
|
7704
|
+
entity(fullName) {
|
|
7705
|
+
return new InterfaceSelector(this.entityRegistry, this.layoutBuilder, this.layoutTheme, fullName);
|
|
7706
|
+
}
|
|
7707
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPEntityDynamicDialogService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
7708
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPEntityDynamicDialogService, providedIn: 'root' }); }
|
|
7709
|
+
}
|
|
7710
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPEntityDynamicDialogService, decorators: [{
|
|
7711
|
+
type: Injectable,
|
|
7712
|
+
args: [{ providedIn: 'root' }]
|
|
7713
|
+
}] });
|
|
7714
|
+
//#region ---- Builders ----
|
|
7715
|
+
class InterfaceSelector {
|
|
7716
|
+
constructor(entityRegistry, layoutBuilder, layoutTheme, fullName) {
|
|
7717
|
+
this.entityRegistry = entityRegistry;
|
|
7718
|
+
this.layoutBuilder = layoutBuilder;
|
|
7719
|
+
this.layoutTheme = layoutTheme;
|
|
7720
|
+
this.fullName = fullName;
|
|
7721
|
+
}
|
|
7722
|
+
create() {
|
|
7723
|
+
return new PropertyFilter(this.entityRegistry, this.layoutBuilder, this.layoutTheme, this.fullName, 'create');
|
|
7724
|
+
}
|
|
7725
|
+
update(id) {
|
|
7726
|
+
return new PropertyFilter(this.entityRegistry, this.layoutBuilder, this.layoutTheme, this.fullName, 'update', id);
|
|
7727
|
+
}
|
|
7728
|
+
}
|
|
7729
|
+
class PropertyFilter {
|
|
7730
|
+
constructor(entityRegistry, layoutBuilder, layoutTheme, fullName, kind, recordId) {
|
|
7731
|
+
this.entityRegistry = entityRegistry;
|
|
7732
|
+
this.layoutBuilder = layoutBuilder;
|
|
7733
|
+
this.layoutTheme = layoutTheme;
|
|
7734
|
+
this.fullName = fullName;
|
|
7735
|
+
this.kind = kind;
|
|
7736
|
+
this.includeList = null;
|
|
7737
|
+
this.excludeList = null;
|
|
7738
|
+
this.initialContext = {};
|
|
7739
|
+
this.extraFieldsByGroup = new Map();
|
|
7740
|
+
this.recordId = recordId;
|
|
7741
|
+
}
|
|
7742
|
+
include(...propertyNames) {
|
|
7743
|
+
this.includeList = new Set(propertyNames.filter(Boolean));
|
|
7744
|
+
return this;
|
|
7745
|
+
}
|
|
7746
|
+
exclude(...propertyNames) {
|
|
7747
|
+
// Ignored when include list is present
|
|
7748
|
+
if (!this.includeList) {
|
|
7749
|
+
this.excludeList = new Set(propertyNames.filter(Boolean));
|
|
7750
|
+
}
|
|
7751
|
+
return this;
|
|
7752
|
+
}
|
|
7753
|
+
title(text) {
|
|
7754
|
+
this.overrideTitle = text;
|
|
7755
|
+
return this;
|
|
7756
|
+
}
|
|
7757
|
+
context(context) {
|
|
7758
|
+
this.initialContext = context ?? {};
|
|
7759
|
+
return this;
|
|
7760
|
+
}
|
|
7761
|
+
size(size) {
|
|
7762
|
+
this.externalSize = size;
|
|
7763
|
+
return this;
|
|
7764
|
+
}
|
|
7765
|
+
actions(delegate) {
|
|
7766
|
+
this.externalActionsDelegate = delegate;
|
|
7767
|
+
return this;
|
|
7768
|
+
}
|
|
7769
|
+
field(groupId, path, delegate) {
|
|
7770
|
+
const list = this.extraFieldsByGroup.get(groupId) ?? [];
|
|
7771
|
+
list.push({ path, delegate });
|
|
7772
|
+
this.extraFieldsByGroup.set(groupId, list);
|
|
7773
|
+
return this;
|
|
7774
|
+
}
|
|
7775
|
+
mode(mode) {
|
|
7776
|
+
this.externalMode = mode;
|
|
7777
|
+
return this;
|
|
7778
|
+
}
|
|
7779
|
+
async show() {
|
|
7780
|
+
const { moduleName, entityName } = parseEntityFullName(this.fullName);
|
|
7781
|
+
const entity = await this.entityRegistry.resolve(moduleName, entityName);
|
|
7782
|
+
const iface = this.kind === 'create' ? entity?.interfaces?.master?.create : entity?.interfaces?.master?.update;
|
|
7783
|
+
if (!iface) {
|
|
7784
|
+
throw new Error(`Entity interface not found: ${entity.module}.${entity.name}.interfaces.master.${this.kind}`);
|
|
7785
|
+
}
|
|
7786
|
+
// Title and size
|
|
7787
|
+
const title = this.overrideTitle || entity.formats?.individual || entity.title || `${entity.module}.${entity.name}`;
|
|
7788
|
+
// Build content using LayoutBuilder
|
|
7789
|
+
const sections = (iface.sections ?? []).slice();
|
|
7790
|
+
const entityProps = (entity.properties ?? []).slice();
|
|
7791
|
+
const nameToViewLayout = buildViewLayoutMap(iface.properties ?? []);
|
|
7792
|
+
const allowedNames = this.computeAllowedNames(entityProps.map((p) => p.name));
|
|
7793
|
+
const dialog = this.layoutBuilder.create().dialog((d) => {
|
|
7794
|
+
d.setTitle(title);
|
|
7795
|
+
d.setSize(this.externalSize ?? (this.layoutTheme.isMobileDevice() ? 'full' : 'md'));
|
|
7796
|
+
d.setCloseButton(true);
|
|
7797
|
+
d.content((layout) => {
|
|
7798
|
+
layout.mode(this.externalMode ?? 'edit');
|
|
7799
|
+
for (const section of sections) {
|
|
7800
|
+
const groupId = section.id;
|
|
7801
|
+
const groupProps = entityProps.filter((p) => p.groupId === groupId && allowedNames.has(p.name));
|
|
7802
|
+
const extraFields = this.extraFieldsByGroup.get(groupId) ?? [];
|
|
7803
|
+
if (groupProps.length === 0 && extraFields.length === 0) {
|
|
7804
|
+
continue;
|
|
7805
|
+
}
|
|
7806
|
+
layout.fieldset((fs) => {
|
|
7807
|
+
fs.setTitle((getGroupTitle(entity, groupId) || groupId));
|
|
7808
|
+
// Preserve properties order as defined in interface.properties (if present), otherwise entity.properties order
|
|
7809
|
+
const orderedProps = orderProperties(groupProps, iface.properties ?? []);
|
|
7810
|
+
for (const prop of orderedProps) {
|
|
7811
|
+
const viewLayout = nameToViewLayout.get(prop.name);
|
|
7812
|
+
const fieldPath = buildFieldPath(prop, iface.properties ?? []);
|
|
7813
|
+
fs.formField(prop.title, (field) => {
|
|
7814
|
+
// Path & field-level visibility/readonly
|
|
7815
|
+
field.path(fieldPath);
|
|
7816
|
+
if (prop.schema?.hidden) {
|
|
7817
|
+
field.visible(false);
|
|
7818
|
+
}
|
|
7819
|
+
if (prop.schema?.readonly) {
|
|
7820
|
+
field.readonly(true);
|
|
7821
|
+
}
|
|
7822
|
+
// Layout mapping (per-field). Only colSpan is supported by dynamic-form per breakpoint.
|
|
7823
|
+
const fieldLayout = toFieldLayout(viewLayout?.layout);
|
|
7824
|
+
if (fieldLayout) {
|
|
7825
|
+
field.layout(fieldLayout);
|
|
7826
|
+
}
|
|
7827
|
+
// Widget mapping (generic to allow all widget types)
|
|
7828
|
+
const widgetType = prop.schema?.interface?.type || '';
|
|
7829
|
+
const widgetOptions = buildWidgetOptions(prop);
|
|
7830
|
+
field.customWidget(widgetType, widgetOptions);
|
|
7831
|
+
});
|
|
7832
|
+
}
|
|
7833
|
+
// Append any extra fields requested by the caller for this group
|
|
7834
|
+
for (const extra of extraFields) {
|
|
7835
|
+
const label = extra.path?.split('.').slice(-1)[0] || extra.path;
|
|
7836
|
+
fs.formField(label, (f) => {
|
|
7837
|
+
const legacy = toCompatFormFieldBuilder(f);
|
|
7838
|
+
legacy.path(extra.path);
|
|
7839
|
+
extra.delegate?.(legacy);
|
|
7840
|
+
});
|
|
7841
|
+
}
|
|
7842
|
+
});
|
|
7843
|
+
}
|
|
7844
|
+
});
|
|
7845
|
+
// Actions: external if provided, otherwise default cancel/submit
|
|
7846
|
+
d.setActions(this.externalActionsDelegate ?? ((a) => a.cancel().submit()));
|
|
7847
|
+
});
|
|
7848
|
+
// Context: load record by id for update and merge with provided context (context overrides)
|
|
7849
|
+
let baseContext = {};
|
|
7850
|
+
if (this.kind === 'update') {
|
|
7851
|
+
if (!this.recordId && typeof this['recordId'] === 'undefined') {
|
|
7852
|
+
// Preserve back-compat if constructor arg wasn't captured
|
|
7853
|
+
this['recordId'] = undefined;
|
|
7854
|
+
}
|
|
7855
|
+
}
|
|
7856
|
+
try {
|
|
7857
|
+
if (this.kind === 'update') {
|
|
7858
|
+
const id = this['recordId'];
|
|
7859
|
+
if (!id) {
|
|
7860
|
+
throw new Error('Record id is required for update().');
|
|
7861
|
+
}
|
|
7862
|
+
const byKeyFn = entity?.queries?.byKey?.execute;
|
|
7863
|
+
if (typeof byKeyFn === 'function') {
|
|
7864
|
+
baseContext = (await byKeyFn(id)) ?? {};
|
|
7865
|
+
}
|
|
7866
|
+
}
|
|
7867
|
+
}
|
|
7868
|
+
catch {
|
|
7869
|
+
baseContext = baseContext ?? {};
|
|
7870
|
+
}
|
|
7871
|
+
console.log(this['recordId']);
|
|
7872
|
+
const effectiveContext = merge({}, baseContext ?? {}, this.initialContext ?? {});
|
|
7873
|
+
dialog.setContext(effectiveContext);
|
|
7874
|
+
return await dialog.show();
|
|
7875
|
+
}
|
|
7876
|
+
computeAllowedNames(allNames) {
|
|
7877
|
+
if (this.includeList && this.includeList.size > 0) {
|
|
7878
|
+
return new Set(allNames.filter((n) => this.includeList.has(n)));
|
|
7879
|
+
}
|
|
7880
|
+
if (this.excludeList && this.excludeList.size > 0) {
|
|
7881
|
+
return new Set(allNames.filter((n) => !this.excludeList.has(n)));
|
|
7882
|
+
}
|
|
7883
|
+
return new Set(allNames);
|
|
7884
|
+
}
|
|
7885
|
+
}
|
|
7886
|
+
//#endregion
|
|
7887
|
+
//#region ---- Helpers ----
|
|
7888
|
+
// No extra action builders to keep API identical to dynamic-form-builder
|
|
7889
|
+
function parseEntityFullName(fullName) {
|
|
7890
|
+
const [moduleName, entityName] = (fullName || '').split('.');
|
|
7891
|
+
if (!moduleName || !entityName) {
|
|
7892
|
+
throw new Error(`Invalid entity full name: "${fullName}"`);
|
|
7893
|
+
}
|
|
7894
|
+
return { moduleName, entityName };
|
|
7895
|
+
}
|
|
7896
|
+
function buildViewLayoutMap(views) {
|
|
7897
|
+
const map = new Map();
|
|
7898
|
+
for (const v of views || []) {
|
|
7899
|
+
if (v?.name) {
|
|
7900
|
+
map.set(v.name, v);
|
|
7901
|
+
}
|
|
7902
|
+
}
|
|
7903
|
+
return map;
|
|
7904
|
+
}
|
|
7905
|
+
function orderProperties(props, viewProps) {
|
|
7906
|
+
if (!viewProps || viewProps.length === 0) {
|
|
7907
|
+
return props;
|
|
7908
|
+
}
|
|
7909
|
+
const orderIndex = new Map();
|
|
7910
|
+
viewProps.forEach((vp, idx) => orderIndex.set(vp.name, idx));
|
|
7911
|
+
return [...props].sort((a, b) => {
|
|
7912
|
+
const ai = orderIndex.has(a.name) ? orderIndex.get(a.name) : Number.MAX_SAFE_INTEGER;
|
|
7913
|
+
const bi = orderIndex.has(b.name) ? orderIndex.get(b.name) : Number.MAX_SAFE_INTEGER;
|
|
7914
|
+
if (ai !== bi)
|
|
7915
|
+
return ai - bi;
|
|
7916
|
+
return 0;
|
|
7917
|
+
});
|
|
7918
|
+
}
|
|
7919
|
+
function buildFieldPath(prop, viewProps) {
|
|
7920
|
+
const vp = (viewProps || []).find((x) => x.name === prop.name);
|
|
7921
|
+
const prefix = vp?.dataPath ? `${vp.dataPath}.` : '';
|
|
7922
|
+
return `${prefix}${prop.name}`;
|
|
7923
|
+
}
|
|
7924
|
+
function toFieldLayout(layout) {
|
|
7925
|
+
const positions = layout?.positions;
|
|
7926
|
+
if (!positions)
|
|
7927
|
+
return undefined;
|
|
7928
|
+
// Map AXPGridLayoutOptions -> AXPDynamicFormFieldDefinition['layout']
|
|
7929
|
+
const getSpan = (key) => positions?.[key]?.colSpan;
|
|
7930
|
+
const d = getSpan('sm');
|
|
7931
|
+
const md = getSpan('md');
|
|
7932
|
+
const lg = getSpan('lg');
|
|
7933
|
+
const xl = getSpan('xl');
|
|
7934
|
+
const xxl = getSpan('xxl');
|
|
7935
|
+
if (d == null && md == null && lg == null && xl == null && xxl == null)
|
|
7936
|
+
return undefined;
|
|
7937
|
+
return {
|
|
7938
|
+
default: d,
|
|
7939
|
+
md,
|
|
7940
|
+
lg,
|
|
7941
|
+
xl,
|
|
7942
|
+
xxl,
|
|
7943
|
+
};
|
|
7944
|
+
}
|
|
7945
|
+
function buildWidgetOptions(prop) {
|
|
7946
|
+
const base = prop.schema?.interface?.options || {};
|
|
7947
|
+
const validations = (prop.validations || []).map((c) => ({
|
|
7948
|
+
rule: c.rule,
|
|
7949
|
+
message: c.message,
|
|
7950
|
+
options: c.options,
|
|
7951
|
+
}));
|
|
7952
|
+
return {
|
|
7953
|
+
...base,
|
|
7954
|
+
validations,
|
|
7955
|
+
};
|
|
7956
|
+
}
|
|
7957
|
+
function getGroupTitle(entity, groupId) {
|
|
7958
|
+
const g = (entity.groups || []).find((x) => x.id === groupId);
|
|
7959
|
+
return g?.title;
|
|
7960
|
+
}
|
|
7961
|
+
function toCompatFormFieldBuilder(field) {
|
|
7962
|
+
return {
|
|
7963
|
+
...field,
|
|
7964
|
+
path: (p) => field.path(p),
|
|
7965
|
+
layout: (c) => field.layout(c),
|
|
7966
|
+
visible: (cond) => field.visible(cond),
|
|
7967
|
+
readonly: (cond) => field.readonly(cond),
|
|
7968
|
+
customWidget: (type, options) => field.customWidget(type, options),
|
|
7969
|
+
mode: (mode) => field.mode(mode),
|
|
7970
|
+
};
|
|
7971
|
+
}
|
|
7972
|
+
|
|
7973
|
+
/**
|
|
7974
|
+
* Error type that can be thrown by middlewares to abort the chain with a structured payload.
|
|
7975
|
+
*/
|
|
7976
|
+
class AXPMiddlewareAbortError extends Error {
|
|
7977
|
+
constructor(message, options = {}) {
|
|
7978
|
+
super(message);
|
|
7979
|
+
this.message = message;
|
|
7980
|
+
this.options = options;
|
|
7981
|
+
this.name = 'AXPMiddlewareAbortError';
|
|
7982
|
+
}
|
|
7983
|
+
toResponse() {
|
|
7984
|
+
return {
|
|
7985
|
+
success: false,
|
|
7986
|
+
error: {
|
|
7987
|
+
code: this.options.code,
|
|
7988
|
+
message: this.message,
|
|
7989
|
+
status: this.options.status,
|
|
7990
|
+
details: this.options.details,
|
|
7991
|
+
},
|
|
7992
|
+
};
|
|
7993
|
+
}
|
|
7994
|
+
}
|
|
7995
|
+
/** Type guard for AXPMiddlewareAbortError */
|
|
7996
|
+
function isAXPMiddlewareAbortError(error) {
|
|
7997
|
+
return error instanceof AXPMiddlewareAbortError;
|
|
7998
|
+
}
|
|
7999
|
+
//#endregion
|
|
8000
|
+
|
|
8001
|
+
const AXP_ENTITY_STORAGE_BACKEND = new InjectionToken('AXP_ENTITY_STORAGE_BACKEND');
|
|
8002
|
+
const AXP_ENTITY_STORAGE_MIDDLEWARE = new InjectionToken('AXP_ENTITY_STORAGE_MIDDLEWARE');
|
|
8003
|
+
|
|
8004
|
+
class AXPMiddlewareEntityStorageService extends AXPEntityStorageService {
|
|
8005
|
+
constructor() {
|
|
8006
|
+
super(...arguments);
|
|
8007
|
+
this.backend = inject(AXP_ENTITY_STORAGE_BACKEND);
|
|
8008
|
+
this.allMiddlewares = (inject(AXP_ENTITY_STORAGE_MIDDLEWARE, { optional: true }) || []).slice();
|
|
8009
|
+
this.injector = inject(EnvironmentInjector);
|
|
8010
|
+
}
|
|
8011
|
+
get dbName() {
|
|
8012
|
+
return this.backend.dbName;
|
|
8013
|
+
}
|
|
8014
|
+
filterMiddlewares(ctx) {
|
|
8015
|
+
return this.allMiddlewares
|
|
8016
|
+
.filter((mw) => {
|
|
8017
|
+
const t = mw.target;
|
|
8018
|
+
if (!t)
|
|
8019
|
+
return true;
|
|
8020
|
+
if (t.ops && !t.ops.includes(ctx.op))
|
|
8021
|
+
return false;
|
|
8022
|
+
if (t.entity) {
|
|
8023
|
+
if (typeof t.entity === 'string' && t.entity !== ctx.entityName)
|
|
8024
|
+
return false;
|
|
8025
|
+
if (t.entity instanceof RegExp && !t.entity.test(ctx.entityName))
|
|
8026
|
+
return false;
|
|
8027
|
+
}
|
|
8028
|
+
if (t.predicate && !t.predicate(ctx))
|
|
8029
|
+
return false;
|
|
8030
|
+
return true;
|
|
8031
|
+
})
|
|
8032
|
+
.sort((a, b) => (a.target?.order ?? 0) - (b.target?.order ?? 0));
|
|
8033
|
+
}
|
|
8034
|
+
compose(mws, leaf, ctx) {
|
|
8035
|
+
return mws
|
|
8036
|
+
.slice()
|
|
8037
|
+
.reverse()
|
|
8038
|
+
.reduce((next, mw) => {
|
|
8039
|
+
return async () => runInInjectionContext(this.injector, () => mw.execute(ctx, next));
|
|
8040
|
+
}, leaf);
|
|
8041
|
+
}
|
|
8042
|
+
async run(ctx, delegate) {
|
|
8043
|
+
const chain = this.compose(this.filterMiddlewares(ctx), async () => {
|
|
8044
|
+
ctx.result = await delegate();
|
|
8045
|
+
}, ctx);
|
|
8046
|
+
await chain();
|
|
8047
|
+
return ctx.result;
|
|
8048
|
+
}
|
|
8049
|
+
createCtx(op, entityName, init) {
|
|
8050
|
+
return {
|
|
8051
|
+
op,
|
|
8052
|
+
entityName,
|
|
8053
|
+
locals: new Map(),
|
|
8054
|
+
backend: {
|
|
8055
|
+
getOne: (name, id) => this.backend.getOne(name, id),
|
|
8056
|
+
insertOne: (name, e) => this.backend.insertOne(name, e),
|
|
8057
|
+
query: (name, request) => this.backend.query(name, request),
|
|
8058
|
+
updateOne: (name, id, data) => this.backend.updateOne(name, id, data),
|
|
8059
|
+
},
|
|
8060
|
+
...init,
|
|
8061
|
+
};
|
|
8062
|
+
}
|
|
8063
|
+
async initial(entityName, collection, options) {
|
|
8064
|
+
const ctx = this.createCtx('initial', entityName, { data: collection });
|
|
8065
|
+
return this.run(ctx, () => this.backend.initial(entityName, ctx.data, options));
|
|
8066
|
+
}
|
|
8067
|
+
async getOne(entityName, id) {
|
|
8068
|
+
const ctx = this.createCtx('getOne', entityName, { id });
|
|
8069
|
+
return this.run(ctx, () => this.backend.getOne(entityName, id));
|
|
8070
|
+
}
|
|
8071
|
+
async updateOne(entityName, id, keyValues) {
|
|
8072
|
+
const ctx = this.createCtx('update', entityName, { id, data: keyValues });
|
|
8073
|
+
return this.run(ctx, () => this.backend.updateOne(entityName, id, ctx.data));
|
|
8074
|
+
}
|
|
8075
|
+
async deleteOne(entityName, id) {
|
|
8076
|
+
const ctx = this.createCtx('delete', entityName, { id });
|
|
8077
|
+
return this.run(ctx, () => this.backend.deleteOne(entityName, id));
|
|
8078
|
+
}
|
|
8079
|
+
async insertOne(entityName, entity) {
|
|
8080
|
+
const ctx = this.createCtx('create', entityName, { data: entity });
|
|
8081
|
+
return this.run(ctx, () => this.backend.insertOne(entityName, ctx.data));
|
|
8082
|
+
}
|
|
8083
|
+
async getAll(entityName) {
|
|
8084
|
+
const ctx = this.createCtx('getAll', entityName);
|
|
8085
|
+
return this.run(ctx, () => this.backend.getAll(entityName));
|
|
8086
|
+
}
|
|
8087
|
+
async query(entityName, request) {
|
|
8088
|
+
const ctx = this.createCtx('query', entityName, { request });
|
|
8089
|
+
return this.run(ctx, () => this.backend.query(entityName, request));
|
|
8090
|
+
}
|
|
8091
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPMiddlewareEntityStorageService, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
8092
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPMiddlewareEntityStorageService }); }
|
|
8093
|
+
}
|
|
8094
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.4", ngImport: i0, type: AXPMiddlewareEntityStorageService, decorators: [{
|
|
8095
|
+
type: Injectable
|
|
8096
|
+
}] });
|
|
8097
|
+
|
|
7621
8098
|
// #region Master
|
|
7622
8099
|
function entityMasterCreateAction() {
|
|
7623
8100
|
return {
|
|
@@ -7783,7 +8260,7 @@ function entityDetailsReferenceCreateActions(type) {
|
|
|
7783
8260
|
*/
|
|
7784
8261
|
function detectEntityChanges(oldObj, newObj) {
|
|
7785
8262
|
return transform(newObj, (result, value, key) => {
|
|
7786
|
-
if (!isEqual(value, oldObj[key])) {
|
|
8263
|
+
if (!isEqual$1(value, oldObj[key])) {
|
|
7787
8264
|
const oldValue = oldObj[key];
|
|
7788
8265
|
if (Array.isArray(value) || Array.isArray(oldValue)) {
|
|
7789
8266
|
const oldArray = Array.isArray(oldValue) ? oldValue : [];
|
|
@@ -7795,8 +8272,8 @@ function detectEntityChanges(oldObj, newObj) {
|
|
|
7795
8272
|
result[key] = { oldValue, newValue: value, added, removed };
|
|
7796
8273
|
}
|
|
7797
8274
|
else {
|
|
7798
|
-
const added = newArray.filter((item) => !oldArray.some((oldItem) => isEqual(item, oldItem)));
|
|
7799
|
-
const removed = oldArray.filter((item) => !newArray.some((newItem) => isEqual(item, newItem)));
|
|
8275
|
+
const added = newArray.filter((item) => !oldArray.some((oldItem) => isEqual$1(item, oldItem)));
|
|
8276
|
+
const removed = oldArray.filter((item) => !newArray.some((newItem) => isEqual$1(item, newItem)));
|
|
7800
8277
|
result[key] = { oldValue, newValue: value, added, removed };
|
|
7801
8278
|
}
|
|
7802
8279
|
}
|
|
@@ -7808,32 +8285,9 @@ function detectEntityChanges(oldObj, newObj) {
|
|
|
7808
8285
|
}
|
|
7809
8286
|
//#endregion
|
|
7810
8287
|
|
|
7811
|
-
const eventDispatchMiddleware = {
|
|
7812
|
-
target: { ops: ['create', 'update', 'delete'], order: 90 },
|
|
7813
|
-
execute: async (ctx, next) => {
|
|
7814
|
-
const dispatcher = inject(AXPEntityEventDispatcherService);
|
|
7815
|
-
await next();
|
|
7816
|
-
if (ctx.op === 'create') {
|
|
7817
|
-
const createdData = ctx.result ? { ...ctx.data, id: ctx.result } : ctx.data;
|
|
7818
|
-
await dispatcher.dispatchInserted(ctx.entityName, { refType: ctx.entityName, data: createdData });
|
|
7819
|
-
}
|
|
7820
|
-
else if (ctx.op === 'update') {
|
|
7821
|
-
await dispatcher.dispatchUpdated(ctx.entityName, {
|
|
7822
|
-
refType: ctx.entityName,
|
|
7823
|
-
data: ctx.result,
|
|
7824
|
-
changes: ctx.locals.get('changes'),
|
|
7825
|
-
});
|
|
7826
|
-
}
|
|
7827
|
-
else if (ctx.op === 'delete') {
|
|
7828
|
-
// For delete, prefer previous entity if available
|
|
7829
|
-
await dispatcher.dispatchDeleted(ctx.entityName, { refType: ctx.entityName, data: ctx.result ?? ctx.previous });
|
|
7830
|
-
}
|
|
7831
|
-
},
|
|
7832
|
-
};
|
|
7833
|
-
|
|
7834
8288
|
/**
|
|
7835
8289
|
* Generated bundle index. Do not edit.
|
|
7836
8290
|
*/
|
|
7837
8291
|
|
|
7838
|
-
export { AXMEntityCrudService, AXMEntityCrudServiceImpl, AXPCreateEntityWorkflow, AXPDataSeederService, AXPDeleteEntityWorkflow, AXPEntityApplyUpdatesAction, AXPEntityCommandTriggerViewModel, AXPEntityCreateEvent, AXPEntityCreatePopupAction, AXPEntityCreateSubmittedAction, AXPEntityCreateViewElementViewModel, AXPEntityCreateViewModelFactory, AXPEntityCreateViewSectionViewModel, AXPEntityDataProvider, AXPEntityDataProviderImpl, AXPEntityDefinitionRegistryService, AXPEntityDeletedEvent, AXPEntityDetailListViewModel, AXPEntityDetailPopoverComponent, AXPEntityDetailPopoverService, AXPEntityDetailViewModelFactory, AXPEntityDetailViewModelResolver, AXPEntityEventDispatcherService, AXPEntityListViewColumnViewModel, AXPEntityListViewModelFactory, AXPEntityListViewModelResolver, AXPEntityMasterCreateViewModel, AXPEntityMasterListViewModel, AXPEntityMasterListViewQueryViewModel, AXPEntityMasterSingleElementViewModel, AXPEntityMasterSingleViewGroupViewModel, AXPEntityMasterSingleViewModel, AXPEntityMasterUpdateElementViewModel, AXPEntityMasterUpdateViewModel, AXPEntityMasterUpdateViewModelFactory, AXPEntityMiddleware, AXPEntityModifyConfirmedAction, AXPEntityModifyEvent, AXPEntityModifySectionPopupAction, AXPEntityModule, AXPEntityPerformDeleteAction, AXPEntityResolver, AXPEntityService, AXPEntityStorageService, AXPEntityUpdateViewSectionViewModel, AXPGetEntityDetailsQuery, AXPMiddlewareAbortError, AXPMiddlewareEntityStorageService, AXPModifyEntitySectionWorkflow, AXPOpenEntityDetailsCommand, AXPQuickEntityModifyPopupAction, AXPQuickModifyEntityWorkflow, AXPShowDetailViewAction, AXPShowDetailsViewWorkflow, AXPShowListViewAction, AXPShowListViewWorkflow, AXP_DATA_SEEDER_TOKEN, AXP_ENTITY_ACTION_PLUGIN, AXP_ENTITY_CONFIG_TOKEN, AXP_ENTITY_DEFINITION_LOADER, AXP_ENTITY_MODIFIER, AXP_ENTITY_STORAGE_BACKEND, AXP_ENTITY_STORAGE_MIDDLEWARE, DEFAULT_COLUMN_WIDTHS, actionExists, columnWidthMiddlewareFactory, columnWidthMiddlewareProvider, createColumnWidthMiddlewareProvider, createModifierContext, detectEntityChanges, ensureListActions, entityDetailsCreateActions, entityDetailsCrudActions, entityDetailsEditAction, entityDetailsReferenceCondition, entityDetailsReferenceCreateActions, entityDetailsSimpleCondition, entityMasterBulkDeleteAction, entityMasterCreateAction, entityMasterCrudActions, entityMasterDeleteAction, entityMasterRecordActions, entityMasterViewAction, entityOverrideDetailsViewAction, eventDispatchMiddleware, isAXPMiddlewareAbortError };
|
|
8292
|
+
export { AXMEntityCrudService, AXMEntityCrudServiceImpl, AXPCreateEntityWorkflow, AXPDataSeederService, AXPDeleteEntityWorkflow, AXPEntityApplyUpdatesAction, AXPEntityCommandTriggerViewModel, AXPEntityCreateEvent, AXPEntityCreatePopupAction, AXPEntityCreateSubmittedAction, AXPEntityCreateViewElementViewModel, AXPEntityCreateViewModelFactory, AXPEntityCreateViewSectionViewModel, AXPEntityDataProvider, AXPEntityDataProviderImpl, AXPEntityDataSelectorService, AXPEntityDefinitionRegistryService, AXPEntityDeletedEvent, AXPEntityDetailListViewModel, AXPEntityDetailPopoverComponent, AXPEntityDetailPopoverService, AXPEntityDetailViewModelFactory, AXPEntityDetailViewModelResolver, AXPEntityDynamicDialogService, AXPEntityEventDispatcherService, AXPEntityListTableService, AXPEntityListViewColumnViewModel, AXPEntityListViewModelFactory, AXPEntityListViewModelResolver, AXPEntityListWidget, AXPEntityListWidgetViewComponent, AXPEntityMasterCreateViewModel, AXPEntityMasterListViewModel, AXPEntityMasterListViewQueryViewModel, AXPEntityMasterSingleElementViewModel, AXPEntityMasterSingleViewGroupViewModel, AXPEntityMasterSingleViewModel, AXPEntityMasterUpdateElementViewModel, AXPEntityMasterUpdateViewModel, AXPEntityMasterUpdateViewModelFactory, AXPEntityMiddleware, AXPEntityModifyConfirmedAction, AXPEntityModifyEvent, AXPEntityModifySectionPopupAction, AXPEntityModule, AXPEntityPerformDeleteAction, AXPEntityReferenceWidget, AXPEntityReferenceWidgetColumnComponent, AXPEntityReferenceWidgetDesignerComponent, AXPEntityReferenceWidgetEditComponent, AXPEntityReferenceWidgetPrintComponent, AXPEntityReferenceWidgetViewComponent, AXPEntityResolver, AXPEntityService, AXPEntityStorageService, AXPEntityUpdateViewSectionViewModel, AXPGetEntityDetailsQuery, AXPLookupFilterWidget, AXPLookupFilterWidgetEditComponent, AXPLookupWidget, AXPLookupWidgetColumnComponent, AXPLookupWidgetEditComponent, AXPLookupWidgetViewComponent, AXPMiddlewareAbortError, AXPMiddlewareEntityStorageService, AXPModifyEntitySectionWorkflow, AXPOpenEntityDetailsCommand, AXPQuickEntityModifyPopupAction, AXPQuickModifyEntityWorkflow, AXPShowDetailViewAction, AXPShowDetailsViewWorkflow, AXPShowListViewAction, AXPShowListViewWorkflow, AXPTagableBoxWidget, AXPTagableBoxWidgetColumnComponent, AXPTagableBoxWidgetEditComponent, AXPTagableBoxWidgetFilterComponent, AXPTagableBoxWidgetPrintComponent, AXPTagableBoxWidgetViewComponent, AXPWidgetSelectorWidget, AXPWidgetSelectorWidgetEditComponent, AXPWidgetSelectorWidgetViewComponent, AXP_DATA_SEEDER_TOKEN, AXP_ENTITY_ACTION_PLUGIN, AXP_ENTITY_CONFIG_TOKEN, AXP_ENTITY_DEFINITION_LOADER, AXP_ENTITY_MODIFIER, AXP_ENTITY_STORAGE_BACKEND, AXP_ENTITY_STORAGE_MIDDLEWARE, DEFAULT_COLUMN_WIDTHS, actionExists, columnWidthMiddlewareFactory, columnWidthMiddlewareProvider, createColumnWidthMiddlewareProvider, createModifierContext, detectEntityChanges, ensureListActions, entityDetailsCreateActions, entityDetailsCrudActions, entityDetailsEditAction, entityDetailsReferenceCondition, entityDetailsReferenceCreateActions, entityDetailsSimpleCondition, entityMasterBulkDeleteAction, entityMasterCreateAction, entityMasterCrudActions, entityMasterDeleteAction, entityMasterRecordActions, entityMasterViewAction, entityOverrideDetailsViewAction, eventDispatchMiddleware, isAXPMiddlewareAbortError };
|
|
7839
8293
|
//# sourceMappingURL=acorex-platform-layout-entity.mjs.map
|