@acorex/platform 20.3.0-next.0 → 20.3.0-next.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (112) hide show
  1. package/common/index.d.ts +8 -9
  2. package/core/index.d.ts +597 -46
  3. package/fesm2022/acorex-platform-auth.mjs +19 -19
  4. package/fesm2022/acorex-platform-auth.mjs.map +1 -1
  5. package/fesm2022/acorex-platform-common.mjs +111 -163
  6. package/fesm2022/acorex-platform-common.mjs.map +1 -1
  7. package/fesm2022/acorex-platform-core.mjs +759 -113
  8. package/fesm2022/acorex-platform-core.mjs.map +1 -1
  9. package/fesm2022/acorex-platform-domain.mjs +16 -16
  10. package/fesm2022/acorex-platform-domain.mjs.map +1 -1
  11. package/fesm2022/acorex-platform-layout-builder.mjs +518 -95
  12. package/fesm2022/acorex-platform-layout-builder.mjs.map +1 -1
  13. package/fesm2022/acorex-platform-layout-components.mjs +1997 -215
  14. package/fesm2022/acorex-platform-layout-components.mjs.map +1 -1
  15. package/fesm2022/acorex-platform-layout-designer.mjs +86 -79
  16. package/fesm2022/acorex-platform-layout-designer.mjs.map +1 -1
  17. package/fesm2022/acorex-platform-layout-entity-create-entity.command-764ie8R8.mjs +52 -0
  18. package/fesm2022/acorex-platform-layout-entity-create-entity.command-764ie8R8.mjs.map +1 -0
  19. package/fesm2022/acorex-platform-layout-entity.mjs +1650 -916
  20. package/fesm2022/acorex-platform-layout-entity.mjs.map +1 -1
  21. package/fesm2022/acorex-platform-layout-views.mjs +37 -29
  22. package/fesm2022/acorex-platform-layout-views.mjs.map +1 -1
  23. package/fesm2022/acorex-platform-native.mjs +7 -7
  24. package/fesm2022/acorex-platform-native.mjs.map +1 -1
  25. package/fesm2022/acorex-platform-runtime.mjs +40 -40
  26. package/fesm2022/acorex-platform-runtime.mjs.map +1 -1
  27. package/fesm2022/{acorex-platform-themes-default-entity-master-create-view.component-I7Eq8Nti.mjs → acorex-platform-themes-default-entity-master-create-view.component-Ct-ri59W.mjs} +5 -5
  28. package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-Ct-ri59W.mjs.map +1 -0
  29. package/fesm2022/{acorex-platform-themes-default-entity-master-list-view.component-D3VUh8K8.mjs → acorex-platform-themes-default-entity-master-list-view.component-7BB4LdjK.mjs} +30 -31
  30. package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-7BB4LdjK.mjs.map +1 -0
  31. package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-BDJR088o.mjs +101 -0
  32. package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-BDJR088o.mjs.map +1 -0
  33. package/fesm2022/{acorex-platform-themes-default-entity-master-single-view.component-BMkhNfF4.mjs → acorex-platform-themes-default-entity-master-single-view.component-BExtm1JE.mjs} +7 -7
  34. package/fesm2022/{acorex-platform-themes-default-entity-master-single-view.component-BMkhNfF4.mjs.map → acorex-platform-themes-default-entity-master-single-view.component-BExtm1JE.mjs.map} +1 -1
  35. package/fesm2022/{acorex-platform-themes-default-error-401.component-D4glpFvU.mjs → acorex-platform-themes-default-error-401.component-DrO1PEOH.mjs} +4 -4
  36. package/fesm2022/{acorex-platform-themes-default-error-401.component-D4glpFvU.mjs.map → acorex-platform-themes-default-error-401.component-DrO1PEOH.mjs.map} +1 -1
  37. package/fesm2022/{acorex-platform-themes-default-error-404.component-BvGeDMjo.mjs → acorex-platform-themes-default-error-404.component-DqVq0oHX.mjs} +4 -4
  38. package/fesm2022/{acorex-platform-themes-default-error-404.component-BvGeDMjo.mjs.map → acorex-platform-themes-default-error-404.component-DqVq0oHX.mjs.map} +1 -1
  39. package/fesm2022/{acorex-platform-themes-default-error-offline.component-BINy-Zo3.mjs → acorex-platform-themes-default-error-offline.component-Bt2PTL7_.mjs} +4 -4
  40. package/fesm2022/{acorex-platform-themes-default-error-offline.component-BINy-Zo3.mjs.map → acorex-platform-themes-default-error-offline.component-Bt2PTL7_.mjs.map} +1 -1
  41. package/fesm2022/acorex-platform-themes-default.mjs +40 -40
  42. package/fesm2022/acorex-platform-themes-default.mjs.map +1 -1
  43. package/fesm2022/{acorex-platform-themes-shared-icon-chooser-view.component-C833prGO.mjs → acorex-platform-themes-shared-icon-chooser-view.component-BgEh06Tn.mjs} +24 -14
  44. package/fesm2022/acorex-platform-themes-shared-icon-chooser-view.component-BgEh06Tn.mjs.map +1 -0
  45. package/fesm2022/{acorex-platform-themes-shared-settings.provider-CXiRmniv.mjs → acorex-platform-themes-shared-settings.provider-CLUKU4y0.mjs} +2 -2
  46. package/fesm2022/acorex-platform-themes-shared-settings.provider-CLUKU4y0.mjs.map +1 -0
  47. package/fesm2022/{acorex-platform-themes-shared-theme-color-chooser-column.component-DjKLg513.mjs → acorex-platform-themes-shared-theme-color-chooser-column.component-AeOQxjbS.mjs} +23 -8
  48. package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-column.component-AeOQxjbS.mjs.map +1 -0
  49. package/fesm2022/{acorex-platform-themes-shared-theme-color-chooser-view.component-DE0wO98F.mjs → acorex-platform-themes-shared-theme-color-chooser-view.component-DEVzRd6-.mjs} +23 -8
  50. package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-view.component-DEVzRd6-.mjs.map +1 -0
  51. package/fesm2022/acorex-platform-themes-shared.mjs +241 -74
  52. package/fesm2022/acorex-platform-themes-shared.mjs.map +1 -1
  53. package/fesm2022/{acorex-platform-widgets-button-widget-designer.component-BJtkWusr.mjs → acorex-platform-widgets-button-widget-designer.component-DSaD9Fwc.mjs} +5 -5
  54. package/fesm2022/acorex-platform-widgets-button-widget-designer.component-DSaD9Fwc.mjs.map +1 -0
  55. package/fesm2022/{acorex-platform-widgets-extra-properties-schema-widget-edit.component-B3SJUnGQ.mjs → acorex-platform-widgets-extra-properties-schema-widget-edit.component-D9mf08rU.mjs} +4 -4
  56. package/fesm2022/{acorex-platform-widgets-extra-properties-schema-widget-edit.component-B3SJUnGQ.mjs.map → acorex-platform-widgets-extra-properties-schema-widget-edit.component-D9mf08rU.mjs.map} +1 -1
  57. package/fesm2022/{acorex-platform-widgets-extra-properties-schema-widget-view.component-BLR0JkRt.mjs → acorex-platform-widgets-extra-properties-schema-widget-view.component-D6GQ-eyr.mjs} +4 -4
  58. package/fesm2022/{acorex-platform-widgets-extra-properties-schema-widget-view.component-BLR0JkRt.mjs.map → acorex-platform-widgets-extra-properties-schema-widget-view.component-D6GQ-eyr.mjs.map} +1 -1
  59. package/fesm2022/{acorex-platform-widgets-extra-properties-values-widget-edit.component-hzR2FgOm.mjs → acorex-platform-widgets-extra-properties-values-widget-edit.component-DVbIdVZ6.mjs} +4 -4
  60. package/fesm2022/{acorex-platform-widgets-extra-properties-values-widget-edit.component-hzR2FgOm.mjs.map → acorex-platform-widgets-extra-properties-values-widget-edit.component-DVbIdVZ6.mjs.map} +1 -1
  61. package/fesm2022/{acorex-platform-widgets-extra-properties-values-widget-view.component-IDm6Clua.mjs → acorex-platform-widgets-extra-properties-values-widget-view.component-D-aM64Hu.mjs} +4 -4
  62. package/fesm2022/{acorex-platform-widgets-extra-properties-values-widget-view.component-IDm6Clua.mjs.map → acorex-platform-widgets-extra-properties-values-widget-view.component-D-aM64Hu.mjs.map} +1 -1
  63. package/fesm2022/{acorex-platform-widgets-extra-properties-widget-edit.component-BRO9tYDa.mjs → acorex-platform-widgets-extra-properties-widget-edit.component-em2-aU8E.mjs} +4 -4
  64. package/fesm2022/{acorex-platform-widgets-extra-properties-widget-edit.component-BRO9tYDa.mjs.map → acorex-platform-widgets-extra-properties-widget-edit.component-em2-aU8E.mjs.map} +1 -1
  65. package/fesm2022/{acorex-platform-widgets-extra-properties-widget-view.component-CkpLimyW.mjs → acorex-platform-widgets-extra-properties-widget-view.component-BeuIofdr.mjs} +4 -4
  66. package/fesm2022/{acorex-platform-widgets-extra-properties-widget-view.component-CkpLimyW.mjs.map → acorex-platform-widgets-extra-properties-widget-view.component-BeuIofdr.mjs.map} +1 -1
  67. package/fesm2022/{acorex-platform-widgets-file-list-popup.component-BafU5Lfl.mjs → acorex-platform-widgets-file-list-popup.component-Cmtq2bBV.mjs} +5 -5
  68. package/fesm2022/acorex-platform-widgets-file-list-popup.component-Cmtq2bBV.mjs.map +1 -0
  69. package/fesm2022/{acorex-platform-widgets-page-widget-designer.component-Cw9WcZze.mjs → acorex-platform-widgets-page-widget-designer.component-B-ZEi2yd.mjs} +6 -6
  70. package/fesm2022/acorex-platform-widgets-page-widget-designer.component-B-ZEi2yd.mjs.map +1 -0
  71. package/fesm2022/{acorex-platform-widgets-tabular-data-edit-popup.component-BDQIfr0g.mjs → acorex-platform-widgets-tabular-data-edit-popup.component-CMqq_iOj.mjs} +11 -11
  72. package/fesm2022/acorex-platform-widgets-tabular-data-edit-popup.component-CMqq_iOj.mjs.map +1 -0
  73. package/fesm2022/{acorex-platform-widgets-tabular-data-view-popup.component-CmPqtt0G.mjs → acorex-platform-widgets-tabular-data-view-popup.component-CRpjdiNz.mjs} +6 -5
  74. package/fesm2022/acorex-platform-widgets-tabular-data-view-popup.component-CRpjdiNz.mjs.map +1 -0
  75. package/fesm2022/{acorex-platform-widgets-text-block-widget-designer.component-DaR4Nkv4.mjs → acorex-platform-widgets-text-block-widget-designer.component-DeSmBqMa.mjs} +5 -6
  76. package/fesm2022/acorex-platform-widgets-text-block-widget-designer.component-DeSmBqMa.mjs.map +1 -0
  77. package/fesm2022/acorex-platform-widgets.mjs +9725 -8964
  78. package/fesm2022/acorex-platform-widgets.mjs.map +1 -1
  79. package/fesm2022/acorex-platform-workflow.mjs +25 -25
  80. package/fesm2022/acorex-platform-workflow.mjs.map +1 -1
  81. package/layout/builder/index.d.ts +69 -21
  82. package/layout/components/index.d.ts +816 -58
  83. package/layout/designer/index.d.ts +4 -2
  84. package/layout/entity/index.d.ts +437 -231
  85. package/package.json +8 -8
  86. package/widgets/index.d.ts +1806 -732
  87. package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-I7Eq8Nti.mjs.map +0 -1
  88. package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-D3VUh8K8.mjs.map +0 -1
  89. package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-16sdMBvH.mjs +0 -101
  90. package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-16sdMBvH.mjs.map +0 -1
  91. package/fesm2022/acorex-platform-themes-shared-icon-chooser-view.component-C833prGO.mjs.map +0 -1
  92. package/fesm2022/acorex-platform-themes-shared-settings.provider-CXiRmniv.mjs.map +0 -1
  93. package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-column.component-DjKLg513.mjs.map +0 -1
  94. package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-view.component-DE0wO98F.mjs.map +0 -1
  95. package/fesm2022/acorex-platform-widgets-button-widget-designer.component-BJtkWusr.mjs.map +0 -1
  96. package/fesm2022/acorex-platform-widgets-checkbox-widget-column.component-DeKpl0uK.mjs +0 -84
  97. package/fesm2022/acorex-platform-widgets-checkbox-widget-column.component-DeKpl0uK.mjs.map +0 -1
  98. package/fesm2022/acorex-platform-widgets-checkbox-widget-designer.component-Cv7dEMCm.mjs +0 -55
  99. package/fesm2022/acorex-platform-widgets-checkbox-widget-designer.component-Cv7dEMCm.mjs.map +0 -1
  100. package/fesm2022/acorex-platform-widgets-checkbox-widget-view.component-C6-QPsnb.mjs +0 -76
  101. package/fesm2022/acorex-platform-widgets-checkbox-widget-view.component-C6-QPsnb.mjs.map +0 -1
  102. package/fesm2022/acorex-platform-widgets-color-box-widget-designer.component-CohkI1w1.mjs +0 -55
  103. package/fesm2022/acorex-platform-widgets-color-box-widget-designer.component-CohkI1w1.mjs.map +0 -1
  104. package/fesm2022/acorex-platform-widgets-file-list-popup.component-BafU5Lfl.mjs.map +0 -1
  105. package/fesm2022/acorex-platform-widgets-file-rename-popup.component-DA_CgIvm.mjs +0 -211
  106. package/fesm2022/acorex-platform-widgets-file-rename-popup.component-DA_CgIvm.mjs.map +0 -1
  107. package/fesm2022/acorex-platform-widgets-page-widget-designer.component-Cw9WcZze.mjs.map +0 -1
  108. package/fesm2022/acorex-platform-widgets-rich-text-popup.component-CM_v-cL4.mjs +0 -40
  109. package/fesm2022/acorex-platform-widgets-rich-text-popup.component-CM_v-cL4.mjs.map +0 -1
  110. package/fesm2022/acorex-platform-widgets-tabular-data-edit-popup.component-BDQIfr0g.mjs.map +0 -1
  111. package/fesm2022/acorex-platform-widgets-tabular-data-view-popup.component-CmPqtt0G.mjs.map +0 -1
  112. package/fesm2022/acorex-platform-widgets-text-block-widget-designer.component-DaR4Nkv4.mjs.map +0 -1
@@ -1,60 +1,450 @@
1
+ import { AXPSessionService, AXPAuthGuard } from '@acorex/platform/auth';
1
2
  import * as i0 from '@angular/core';
2
- import { InjectionToken, inject, Injectable, computed, signal, Injector, runInInjectionContext, EnvironmentInjector, viewChild, viewChildren, linkedSignal, effect, untracked, ChangeDetectionStrategy, Component, HostBinding, ViewChild, NgModule } from '@angular/core';
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/builder';
14
+ import { AXPWidgetsCatalog, AXPLayoutBuilderModule, AXPPageStatus, AXPWidgetRegistryService, AXPValueWidgetComponent, AXPWidgetRendererDirective, AXPWidgetGroupEnum, AXPLayoutBaseWidgetComponent, AXPColumnWidgetComponent, AXP_WIDGETS_EDITOR_CATEGORY } from '@acorex/platform/layout/builder';
15
+ import { AXPCommandService, AXPQueryService, provideCommandSetups, provideQuerySetups } from '@acorex/platform/runtime';
16
+ import * as i5 from '@angular/common';
17
+ import { CommonModule } from '@angular/common';
3
18
  import { castArray, get, cloneDeep, set, merge, isNil, isEmpty, sortBy } from 'lodash-es';
4
- import * as i1$2 from '@acorex/cdk/common';
5
- import { AXDataSource, AXCommonModule } from '@acorex/cdk/common';
19
+ import { AXDataSource } from '@acorex/cdk/common';
6
20
  import { AXFormatService } from '@acorex/core/format';
7
- import { resolveActionLook, AXPFilterOperatorMiddlewareService, AXPEntityCommandScope, getEntityInfo, AXPSettingService, AXPRefreshEvent, AXPReloadEvent, AXPCleanNestedFilters, AXPWorkflowNavigateAction, AXPToastAction, AXP_SEARCH_DEFINITION_PROVIDER } from '@acorex/platform/common';
8
- import * as i1$4 from '@acorex/platform/core';
9
- import { AXPExpressionEvaluatorService, AXPPlatformScope, AXPDistributedEventListenerService, getChangedPaths, extractValue, setSmart } from '@acorex/platform/core';
21
+ import { AXPFilterOperatorMiddlewareService, AXPEntityCommandScope, getEntityInfo, AXPSettingService, AXPRefreshEvent, AXPReloadEvent, AXPCleanNestedFilters, AXPWorkflowNavigateAction, AXPToastAction, AXP_SEARCH_DEFINITION_PROVIDER } from '@acorex/platform/common';
22
+ import * as i1$2 from '@acorex/platform/core';
23
+ import { resolveActionLook, AXPExpressionEvaluatorService, AXPDistributedEventListenerService, AXPPlatformScope, getChangedPaths, extractValue, setSmart, AXPSystemActionType } from '@acorex/platform/core';
10
24
  import * as i2$2 from '@acorex/platform/workflow';
11
25
  import { AXPWorkflowService, ofType, createWorkFlowEvent, AXPWorkflowAction, AXPWorkflowModule } from '@acorex/platform/workflow';
12
- import * as i2 from '@acorex/platform/layout/builder';
13
- import { AXPPageStatus, AXPWidgetRegistryService, AXPWidgetsCatalog, AXPValueWidgetComponent, AXPWidgetRendererDirective, AXPLayoutBuilderModule, AXPWidgetGroupEnum, AXPLayoutBaseWidgetComponent, AXPColumnWidgetComponent, AXP_WIDGETS_EDITOR_CATEGORY } from '@acorex/platform/layout/builder';
14
26
  import { AXPLayoutThemeService } from '@acorex/platform/themes/shared';
15
27
  import { Subject, takeUntil } from 'rxjs';
16
- import { AXPSessionService, AXPAuthGuard } from '@acorex/platform/auth';
17
- import { AXPCommandService, provideCommandSetups } from '@acorex/platform/runtime';
18
- import * as i8 from '@acorex/core/translation';
19
- import { AXTranslationService, AXTranslationModule } from '@acorex/core/translation';
28
+ import { moveItemInArray } from '@angular/cdk/drag-drop';
20
29
  import { AXDialogService } from '@acorex/components/dialog';
21
30
  import { AXLoadingDialogService } from '@acorex/components/loading-dialog';
22
31
  import { AXPopupService } from '@acorex/components/popup';
23
32
  import { AXPlatform } from '@acorex/core/platform';
24
- import { RouterModule, ROUTES } from '@angular/router';
25
- import * as i3$1 from '@acorex/components/button';
26
- import { AXButtonModule } from '@acorex/components/button';
27
- import * as i3 from '@acorex/components/decorators';
33
+ import * as i3$2 from '@acorex/components/decorators';
28
34
  import { AXDecoratorModule } from '@acorex/components/decorators';
29
- import * as i4 from '@acorex/components/dropdown';
35
+ import * as i4$1 from '@acorex/components/dropdown';
30
36
  import { AXDropdownModule } from '@acorex/components/dropdown';
31
- import * as i7 from '@angular/common';
32
- import { CommonModule } from '@angular/common';
33
37
  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';
34
- import * as i1$3 from '@angular/forms';
38
+ import * as i1$1 from '@angular/forms';
35
39
  import { FormsModule } from '@angular/forms';
36
- import * as i1 from '@acorex/components/loading';
37
- import { AXLoadingModule } from '@acorex/components/loading';
38
- import * as i1$1 from '@acorex/components/badge';
40
+ import * as i1 from '@acorex/components/badge';
39
41
  import { AXBadgeModule } from '@acorex/components/badge';
40
42
  import * as i5$1 from '@acorex/components/form';
41
43
  import { AXFormModule } from '@acorex/components/form';
42
- import * as i5 from '@acorex/components/search-box';
43
- import { AXSearchBoxModule, AXSearchBoxComponent } from '@acorex/components/search-box';
44
- import * as i7$1 from '@acorex/components/select-box';
44
+ import * as i6$2 from '@acorex/components/search-box';
45
+ import { AXSearchBoxComponent, AXSearchBoxModule } from '@acorex/components/search-box';
46
+ import * as i7 from '@acorex/components/select-box';
45
47
  import { AXSelectBoxModule } from '@acorex/components/select-box';
46
- import * as i6 from '@acorex/components/tag-box';
48
+ import * as i6$1 from '@acorex/components/tag-box';
47
49
  import { AXTagBoxComponent, AXTagBoxModule } from '@acorex/components/tag-box';
48
50
  import { AXValidationModule } from '@acorex/core/validation';
49
- import * as i4$1 from '@acorex/components/data-table';
50
- import { AXDataTableModule } from '@acorex/components/data-table';
51
- import { AXDropdownButtonModule } from '@acorex/components/dropdown-button';
52
- import { AXBasePageComponent } from '@acorex/components/page';
51
+ import { AXPDataSelectorService, AXPWidgetPropertyViewerComponent, AXPDynamicFormBuilderService } from '@acorex/platform/layout/components';
53
52
  import * as i2$1 from '@acorex/components/text-box';
54
53
  import { AXTextBoxModule, AXTextBoxComponent } from '@acorex/components/text-box';
55
- import { AXPWidgetPropertyViewerComponent } from '@acorex/platform/layout/components';
56
54
  import { transform, isEqual } from 'lodash';
57
55
 
56
+ //#endregion
57
+ //#region ---- Entity Open Details Command ----
58
+ /**
59
+ * Generic command to open entity details view
60
+ * Can be used by any entity to navigate to its detail page
61
+ */
62
+ class AXPOpenEntityDetailsCommand {
63
+ constructor() {
64
+ //#endregion
65
+ //#region ---- Services & Dependencies ----
66
+ this.router = inject(Router);
67
+ this.sessionService = inject(AXPSessionService);
68
+ }
69
+ //#endregion
70
+ //#region ---- Command Execution ----
71
+ /**
72
+ * Execute the command to navigate to entity details
73
+ * @param input - Command input containing entity and data information
74
+ */
75
+ async execute(input) {
76
+ const { entity, data } = input;
77
+ if (!entity) {
78
+ throw new Error('Entity name is required for opening details view');
79
+ }
80
+ if (!data?.id) {
81
+ throw new Error('Entity ID is required for opening details view');
82
+ }
83
+ const [module, entityName] = entity.split('.');
84
+ if (!module || !entityName) {
85
+ throw new Error('Entity must be in format "ModuleName.EntityName"');
86
+ }
87
+ const url = `/${this.sessionService.application?.name}/m/${module}/e/${entityName}/${data.id}/new-view`;
88
+ // Navigate to the entity details page
89
+ this.router.navigate([url]);
90
+ return { success: true };
91
+ }
92
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPOpenEntityDetailsCommand, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
93
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPOpenEntityDetailsCommand, providedIn: 'root' }); }
94
+ }
95
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPOpenEntityDetailsCommand, decorators: [{
96
+ type: Injectable,
97
+ args: [{ providedIn: 'root' }]
98
+ }] });
99
+
100
+ var openEntityDetails_command = /*#__PURE__*/Object.freeze({
101
+ __proto__: null,
102
+ AXPOpenEntityDetailsCommand: AXPOpenEntityDetailsCommand
103
+ });
104
+
105
+ class AXPEntityDetailPopoverComponent {
106
+ constructor() {
107
+ //#region ---- Dependencies ----
108
+ this.commandService = inject(AXPCommandService);
109
+ this.queryService = inject(AXPQueryService);
110
+ //#endregion
111
+ //#region ---- Inputs ----
112
+ this.entity = input.required(...(ngDevMode ? [{ debugName: "entity" }] : []));
113
+ this.entityId = input.required(...(ngDevMode ? [{ debugName: "entityId" }] : []));
114
+ this.textField = input('title', ...(ngDevMode ? [{ debugName: "textField" }] : []));
115
+ this.valueField = input('id', ...(ngDevMode ? [{ debugName: "valueField" }] : []));
116
+ this.item = input(...(ngDevMode ? [undefined, { debugName: "item" }] : []));
117
+ //#endregion
118
+ //#region ---- View Children ----
119
+ this.detailPopover = viewChild('detailPopover', ...(ngDevMode ? [{ debugName: "detailPopover" }] : []));
120
+ //#endregion
121
+ //#region ---- Signals ----
122
+ this.entityDetails = signal(null, ...(ngDevMode ? [{ debugName: "entityDetails" }] : []));
123
+ this.isLoadingDetails = signal(false, ...(ngDevMode ? [{ debugName: "isLoadingDetails" }] : []));
124
+ this.isDetailPopoverOpen = signal(false, ...(ngDevMode ? [{ debugName: "isDetailPopoverOpen" }] : []));
125
+ }
126
+ //#endregion
127
+ //#region ---- Public Methods ----
128
+ /**
129
+ * Show the entity detail popover
130
+ */
131
+ async show(target) {
132
+ this.isDetailPopoverOpen.set(true);
133
+ this.isLoadingDetails.set(true);
134
+ this.entityDetails.set(null);
135
+ // Open the popover immediately to display loading state
136
+ if (this.detailPopover()) {
137
+ const targetElement = target instanceof ElementRef ? target.nativeElement : target;
138
+ this.detailPopover().target = targetElement;
139
+ this.detailPopover().open();
140
+ }
141
+ else {
142
+ // In case the view child is not ready yet, schedule an immediate open
143
+ setTimeout(() => {
144
+ if (this.detailPopover()) {
145
+ const targetElement = target instanceof ElementRef ? target.nativeElement : target;
146
+ this.detailPopover().target = targetElement;
147
+ this.detailPopover().open();
148
+ }
149
+ }, 0);
150
+ }
151
+ // Fetch entity details using the query
152
+ try {
153
+ const result = await this.queryService.fetch('Entity:GetDetails', {
154
+ entity: this.entity(),
155
+ id: this.entityId(),
156
+ });
157
+ if (result?.success) {
158
+ this.entityDetails.set(result);
159
+ }
160
+ }
161
+ catch (error) {
162
+ console.error('Failed to fetch entity details:', error);
163
+ }
164
+ finally {
165
+ this.isLoadingDetails.set(false);
166
+ }
167
+ }
168
+ /**
169
+ * Hide the entity detail popover
170
+ */
171
+ hide() {
172
+ this.isDetailPopoverOpen.set(false);
173
+ this.entityDetails.set(null);
174
+ this.isLoadingDetails.set(false);
175
+ if (this.detailPopover()) {
176
+ this.detailPopover().close();
177
+ }
178
+ }
179
+ onDetailPopoverOpenChange(event) {
180
+ this.isDetailPopoverOpen.set(event);
181
+ if (!event) {
182
+ this.entityDetails.set(null);
183
+ this.isLoadingDetails.set(false);
184
+ }
185
+ }
186
+ async navigateToDetails() {
187
+ if (this.entityId()) {
188
+ await this.commandService.execute('Entity:OpenDetails', {
189
+ entity: this.entity(),
190
+ data: { id: this.entityId() },
191
+ });
192
+ this.hide();
193
+ }
194
+ }
195
+ //#endregion
196
+ //#region ---- Helper Methods ----
197
+ /**
198
+ * Returns true if a value is meaningful for display (non-empty/non-null).
199
+ */
200
+ hasMeaningfulValue(value) {
201
+ if (value === null || value === undefined)
202
+ return false;
203
+ if (typeof value === 'string')
204
+ return value.trim().length > 0;
205
+ if (Array.isArray(value))
206
+ return value.length > 0;
207
+ if (typeof value === 'object')
208
+ return Object.keys(value).length > 0;
209
+ return true;
210
+ }
211
+ /**
212
+ * Calculates an importance score for a property based on its widget type,
213
+ * whether it currently has a meaningful value, and metadata like title.
214
+ */
215
+ getPropertyImportanceScore(prop, data) {
216
+ const schema = prop.showAs?.type ?? prop.schema;
217
+ const importanceMap = {
218
+ [AXPWidgetsCatalog.text]: 100,
219
+ [AXPWidgetsCatalog.select]: 95,
220
+ [AXPWidgetsCatalog.number]: 90,
221
+ [AXPWidgetsCatalog.dateTime]: 85,
222
+ [AXPWidgetsCatalog.richText]: 80,
223
+ [AXPWidgetsCatalog.largeText]: 75,
224
+ [AXPWidgetsCatalog.contact]: 74,
225
+ [AXPWidgetsCatalog.toggle]: 65,
226
+ [AXPWidgetsCatalog.checkbox]: 60,
227
+ [AXPWidgetsCatalog.color]: 40,
228
+ };
229
+ let score = importanceMap[schema] ?? 50;
230
+ // Prefer fields that actually have a value for the current entity
231
+ if (this.hasMeaningfulValue(data?.[prop.name])) {
232
+ score += 20;
233
+ }
234
+ // Slight preference for human-friendly titled fields
235
+ const hasTitle = prop.title && prop.title !== prop.name;
236
+ if (hasTitle) {
237
+ score += 5;
238
+ }
239
+ return score;
240
+ }
241
+ /**
242
+ * Calculates a name-based importance score to prioritize common key fields
243
+ * like title, description, status, and important dates.
244
+ * Name priority MUST come before widget-type priority.
245
+ */
246
+ getNameImportanceScore(prop) {
247
+ const rawName = (prop.options?.dataPath ?? prop.name ?? '').toString();
248
+ const normalized = rawName.toLowerCase();
249
+ const collapsed = normalized.replace(/[^a-z0-9]/g, '');
250
+ const priorities = [
251
+ { keys: ['title', 'name', 'subject', 'code'], score: 120 },
252
+ { keys: ['description', 'details', 'summary', 'remark', 'remarks'], score: 110 },
253
+ { keys: ['status', 'state', 'phase', 'stage'], score: 105 },
254
+ { keys: ['priority', 'severity', 'rank'], score: 100 },
255
+ { keys: ['expirydate', 'expirationdate', 'expiredate', 'duedate', 'deadline', 'enddate'], score: 98 },
256
+ { keys: ['startdate', 'createdat', 'createdon', 'updatedat', 'updatedon'], score: 95 },
257
+ { keys: ['owner', 'assignee', 'assignedto'], score: 92 },
258
+ { keys: ['email', 'phone', 'mobile', 'contact'], score: 90 },
259
+ { keys: ['category', 'type', 'label', 'tag', 'note', 'notes'], score: 85 },
260
+ { keys: ['primary', 'active', 'active', 'enabled', 'archived', 'deleted', 'locked', 'disabled'], score: -2 }, // send to bottom,
261
+ ];
262
+ for (const group of priorities) {
263
+ for (const key of group.keys) {
264
+ if (collapsed === key || collapsed.endsWith(key)) {
265
+ return group.score;
266
+ }
267
+ }
268
+ }
269
+ // Pattern-based priorities (generic forms like validFrom/validTo, start*/end*)
270
+ if (collapsed.endsWith('from') || collapsed.endsWith('to')) {
271
+ return 97;
272
+ }
273
+ if (collapsed.startsWith('start') || collapsed.startsWith('end')) {
274
+ return 96;
275
+ }
276
+ return 0;
277
+ }
278
+ getEntityPropertiesWithWidgets() {
279
+ const data = this.entityDetails()?.entityData;
280
+ const entityDefinition = this.entityDetails()?.entityDefinition;
281
+ if (!data || !entityDefinition?.properties)
282
+ return [];
283
+ // Get properties from entity definition and filter by importance
284
+ const importantProperties = (entityDefinition.columns ?? [])
285
+ .map((prop, index) => {
286
+ const propName = prop.options?.dataPath ?? prop.name;
287
+ const schema = prop.showAs?.type ?? entityDefinition.properties.find((p) => p.name === propName)?.schema.interface?.type;
288
+ const title = prop.title ?? entityDefinition.properties.find((p) => p.name === propName)?.title ?? prop.name;
289
+ return {
290
+ ...prop,
291
+ schema,
292
+ title,
293
+ orderIndex: index,
294
+ };
295
+ })
296
+ .filter((prop) => {
297
+ // Exclude technical fields
298
+ if (prop.name === 'id' || prop.name === this.textField() || prop.name === this.valueField()) {
299
+ return false;
300
+ }
301
+ // Only include properties that exist in the data
302
+ if (!data.hasOwnProperty(prop.name)) {
303
+ return false;
304
+ }
305
+ // Filter by property importance based on schema and options
306
+ const schema = prop.showAs?.type ?? entityDefinition.properties.find((p) => p.name === prop.name)?.schema.interface?.type;
307
+ // Include common important field types
308
+ const importantWidgets = [
309
+ AXPWidgetsCatalog.text,
310
+ AXPWidgetsCatalog.largeText,
311
+ AXPWidgetsCatalog.richText,
312
+ //
313
+ AXPWidgetsCatalog.select,
314
+ //AXPWidgetsCatalog.lookup,
315
+ //
316
+ AXPWidgetsCatalog.number,
317
+ AXPWidgetsCatalog.toggle,
318
+ AXPWidgetsCatalog.checkbox,
319
+ //
320
+ AXPWidgetsCatalog.dateTime,
321
+ AXPWidgetsCatalog.color,
322
+ AXPWidgetsCatalog.contact,
323
+ ];
324
+ //
325
+ if (importantWidgets.includes(schema)) {
326
+ return true;
327
+ }
328
+ return false;
329
+ })
330
+ .sort((a, b) => {
331
+ // Primary: name-based importance
332
+ const nameScoreA = this.getNameImportanceScore(a);
333
+ const nameScoreB = this.getNameImportanceScore(b);
334
+ if (nameScoreA !== nameScoreB)
335
+ return nameScoreB - nameScoreA;
336
+ // Secondary: widget/value/title based importance
337
+ const widgetScoreA = this.getPropertyImportanceScore(a, data);
338
+ const widgetScoreB = this.getPropertyImportanceScore(b, data);
339
+ if (widgetScoreA !== widgetScoreB)
340
+ return widgetScoreB - widgetScoreA;
341
+ const aHasValue = this.hasMeaningfulValue(data?.[a.name]);
342
+ const bHasValue = this.hasMeaningfulValue(data?.[b.name]);
343
+ if (aHasValue !== bHasValue)
344
+ return aHasValue ? -1 : 1;
345
+ const aHasTitle = a.title && a.title !== a.name;
346
+ const bHasTitle = b.title && b.title !== b.name;
347
+ if (aHasTitle !== bHasTitle)
348
+ return aHasTitle ? -1 : 1;
349
+ if ((a.orderIndex ?? 0) !== (b.orderIndex ?? 0))
350
+ return (a.orderIndex ?? 0) - (b.orderIndex ?? 0);
351
+ return a.name.localeCompare(b.name);
352
+ })
353
+ .map((prop) => {
354
+ // Create widget node based on property schema
355
+ const widgetNode = {
356
+ type: prop.schema || AXPWidgetsCatalog.text,
357
+ path: prop.options?.dataPath || prop.name,
358
+ options: prop.options ?? {},
359
+ mode: 'view',
360
+ };
361
+ return {
362
+ name: prop.name,
363
+ title: prop.title || prop.name,
364
+ node: widgetNode,
365
+ };
366
+ })
367
+ .slice(0, 7); // Limit to 7 most important fields
368
+ return importantProperties;
369
+ }
370
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPEntityDetailPopoverComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
371
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.8", 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: AXPLayoutBuilderModule }, { 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 }); }
372
+ }
373
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPEntityDetailPopoverComponent, decorators: [{
374
+ type: Component,
375
+ args: [{ selector: 'axp-entity-detail-popover', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
376
+ CommonModule,
377
+ AXButtonModule,
378
+ AXPopoverModule,
379
+ AXPLayoutBuilderModule,
380
+ AXTranslationModule,
381
+ AXLoadingModule,
382
+ ], 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" }]
383
+ }] });
384
+
385
+ class AXPEntityDetailPopoverService {
386
+ constructor() {
387
+ //#region ---- Dependencies ----
388
+ this.applicationRef = inject(ApplicationRef);
389
+ this.environmentInjector = inject(EnvironmentInjector);
390
+ //#endregion
391
+ //#region ---- Private Properties ----
392
+ this.activePopoverRef = null;
393
+ }
394
+ //#endregion
395
+ //#region ---- Public Methods ----
396
+ /**
397
+ * Show entity detail popover
398
+ * @param target - The target element to position the popover
399
+ * @param options - Configuration options for the popover
400
+ */
401
+ async show(target, options) {
402
+ // Close any existing popover
403
+ this.hide();
404
+ // Create component dynamically
405
+ this.activePopoverRef = createComponent(AXPEntityDetailPopoverComponent, {
406
+ environmentInjector: this.environmentInjector,
407
+ });
408
+ // Set inputs
409
+ this.activePopoverRef.setInput('entity', options.entity);
410
+ this.activePopoverRef.setInput('entityId', options.id);
411
+ this.activePopoverRef.setInput('textField', options.textField || 'title');
412
+ this.activePopoverRef.setInput('valueField', options.valueField || 'id');
413
+ this.activePopoverRef.setInput('item', options.item);
414
+ // Attach to application
415
+ this.applicationRef.attachView(this.activePopoverRef.hostView);
416
+ // Append to document body
417
+ document.body.appendChild(this.activePopoverRef.location.nativeElement);
418
+ // Show the popover
419
+ await this.activePopoverRef.instance.show(target);
420
+ }
421
+ /**
422
+ * Hide the active popover
423
+ */
424
+ hide() {
425
+ if (this.activePopoverRef) {
426
+ this.activePopoverRef.instance.hide();
427
+ this.applicationRef.detachView(this.activePopoverRef.hostView);
428
+ this.activePopoverRef.destroy();
429
+ this.activePopoverRef = null;
430
+ }
431
+ }
432
+ /**
433
+ * Check if a popover is currently active
434
+ */
435
+ get isActive() {
436
+ return this.activePopoverRef !== null;
437
+ }
438
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPEntityDetailPopoverService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
439
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPEntityDetailPopoverService, providedIn: 'root' }); }
440
+ }
441
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPEntityDetailPopoverService, decorators: [{
442
+ type: Injectable,
443
+ args: [{
444
+ providedIn: 'root'
445
+ }]
446
+ }] });
447
+
58
448
  const AXP_DATA_SEEDER_TOKEN = new InjectionToken('AXP_DATA_SEEDER_TOKEN');
59
449
  class AXPDataSeederService {
60
450
  constructor() {
@@ -65,10 +455,10 @@ class AXPDataSeederService {
65
455
  await loader?.seed();
66
456
  }
67
457
  }
68
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPDataSeederService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
69
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPDataSeederService, providedIn: 'root' }); }
458
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPDataSeederService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
459
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPDataSeederService, providedIn: 'root' }); }
70
460
  }
71
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPDataSeederService, decorators: [{
461
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPDataSeederService, decorators: [{
72
462
  type: Injectable,
73
463
  args: [{ providedIn: 'root' }]
74
464
  }] });
@@ -93,10 +483,10 @@ class AXPEntityResolver {
93
483
  }
94
484
  return null;
95
485
  }
96
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPEntityResolver, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
97
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPEntityResolver, providedIn: 'root' }); }
486
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPEntityResolver, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
487
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPEntityResolver, providedIn: 'root' }); }
98
488
  }
99
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPEntityResolver, decorators: [{
489
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPEntityResolver, decorators: [{
100
490
  type: Injectable,
101
491
  args: [{ providedIn: 'root' }]
102
492
  }] });
@@ -106,7 +496,7 @@ class AXPEntityCommandTriggerViewModel {
106
496
  this.name = `${typeof action.command === 'string' ? action.command : action.command.name}&${action.name}`;
107
497
  this.options = typeof action.command === 'object' ? action.command.options : undefined;
108
498
  this.metadata = typeof action.command === 'object' ? action.command.metadata : undefined;
109
- const resolvedLook = resolveActionLook(action);
499
+ const resolvedLook = resolveActionLook(action.type);
110
500
  this.priority = action.priority;
111
501
  this.title = action.title;
112
502
  this.separated = action.separated ?? false;
@@ -132,7 +522,7 @@ class AXPEntityListViewColumnViewModel {
132
522
  return {
133
523
  path: this.column.options?.dataPath ?? this.name,
134
524
  type: widget.type,
135
- options: { ...widget?.options, ...this.column?.options },
525
+ options: { ...widget?.options, ...this.column?.options, columnName: this.name },
136
526
  };
137
527
  }, ...(ngDevMode ? [{ debugName: "node" }] : []));
138
528
  }
@@ -366,7 +756,7 @@ class AXPEntityDetailListViewModel {
366
756
  module: this.detailEntity()?.module,
367
757
  title: this.detailEntity()?.title,
368
758
  parentKey: this.detailEntity()?.parentKey,
369
- source: this.detailEntity()?.source,
759
+ source: `${this.detailEntity()?.module}.${this.detailEntity()?.name}`,
370
760
  },
371
761
  options,
372
762
  });
@@ -410,6 +800,83 @@ class AXPEntityDetailListViewModel {
410
800
  }
411
801
  }
412
802
 
803
+ /**
804
+ * Entity Event Dispatcher - A wrapper for entity-specific events
805
+ * Handles pattern-based dispatching for entity operations with wildcard support
806
+ */
807
+ class AXPEntityEventDispatcherService {
808
+ constructor() {
809
+ this.eventService = inject(AXPDistributedEventListenerService);
810
+ }
811
+ async dispatchEntityEvent(operation, entityName, data) {
812
+ const enhancedData = {
813
+ ...data,
814
+ entityName,
815
+ operation,
816
+ timestamp: new Date(),
817
+ source: 'entity-dispatcher',
818
+ };
819
+ const eventKeysToDispatch = await this.getAllMatchingEventKeys(operation, entityName);
820
+ const dispatchPromises = eventKeysToDispatch.map((key) => this.eventService.dispatch(key, enhancedData));
821
+ await Promise.all(dispatchPromises);
822
+ }
823
+ async getAllMatchingEventKeys(operation, entityName) {
824
+ const eventKeys = new Set();
825
+ const exactKeys = this.generateEventKeys(operation, entityName);
826
+ exactKeys.forEach((key) => eventKeys.add(key));
827
+ const wildcardKeys = await this.findMatchingWildcardKeys(operation, entityName);
828
+ wildcardKeys.forEach((key) => eventKeys.add(key));
829
+ return Array.from(eventKeys);
830
+ }
831
+ async findMatchingWildcardKeys(operation, entityName) {
832
+ const matchingKeys = [];
833
+ const allListenerKeys = await this.eventService.getRegisteredKeys();
834
+ const actualEventKey = `entity.${operation}.${entityName}`;
835
+ for (const listenerKey of allListenerKeys) {
836
+ if (listenerKey.includes('*') && this.matchesEntityPattern(actualEventKey, listenerKey)) {
837
+ matchingKeys.push(listenerKey);
838
+ }
839
+ }
840
+ return matchingKeys;
841
+ }
842
+ matchesEntityPattern(eventKey, pattern) {
843
+ if (!pattern.startsWith('entity.') || !pattern.includes('*')) {
844
+ return false;
845
+ }
846
+ const regexPattern = pattern.replace(/\./g, '\\.').replace(/\*/g, '.*');
847
+ const regex = new RegExp(`^${regexPattern}$`);
848
+ return regex.test(eventKey);
849
+ }
850
+ generateEventKeys(operation, entityName) {
851
+ const keys = [];
852
+ keys.push(`entity.${operation}`);
853
+ keys.push(`entity.${operation}.${entityName}`);
854
+ const entityParts = entityName.split('.');
855
+ if (entityParts.length > 1) {
856
+ const moduleName = entityParts[0];
857
+ keys.push(`entity.${operation}.${moduleName}`);
858
+ }
859
+ return keys;
860
+ }
861
+ async dispatchInserted(entityName, data) {
862
+ await this.dispatchEntityEvent('inserted', entityName, data);
863
+ }
864
+ async dispatchUpdated(entityName, data) {
865
+ await this.dispatchEntityEvent('updated', entityName, data);
866
+ }
867
+ async dispatchDeleted(entityName, data) {
868
+ await this.dispatchEntityEvent('deleted', entityName, data);
869
+ }
870
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPEntityEventDispatcherService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
871
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPEntityEventDispatcherService, providedIn: 'root' }); }
872
+ }
873
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPEntityEventDispatcherService, decorators: [{
874
+ type: Injectable,
875
+ args: [{
876
+ providedIn: 'root',
877
+ }]
878
+ }] });
879
+
413
880
  function createModifierContext(entity) {
414
881
  const ctx = {
415
882
  entity,
@@ -434,13 +901,6 @@ function createModifierContext(entity) {
434
901
  return ctx;
435
902
  },
436
903
  },
437
- source: {
438
- get: () => entity.source,
439
- set: (newValue) => {
440
- entity.source = newValue;
441
- return ctx;
442
- },
443
- },
444
904
  parentKey: {
445
905
  get: () => entity.parentKey,
446
906
  set: (newValue) => {
@@ -718,10 +1178,10 @@ class AXPEntityMiddleware {
718
1178
  const flags = rx.flags.replace('g', '');
719
1179
  return new RegExp(rx.source, flags);
720
1180
  }
721
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPEntityMiddleware, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
722
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPEntityMiddleware, providedIn: 'root' }); }
1181
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPEntityMiddleware, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1182
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPEntityMiddleware, providedIn: 'root' }); }
723
1183
  }
724
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPEntityMiddleware, decorators: [{
1184
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPEntityMiddleware, decorators: [{
725
1185
  type: Injectable,
726
1186
  args: [{ providedIn: 'root' }]
727
1187
  }], ctorParameters: () => [] });
@@ -873,10 +1333,10 @@ class AXPEntityDefinitionRegistryService {
873
1333
  createEntityKey(moduleName, entityName) {
874
1334
  return `${moduleName}.${entityName}`;
875
1335
  }
876
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPEntityDefinitionRegistryService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
877
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPEntityDefinitionRegistryService, providedIn: 'root' }); }
1336
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPEntityDefinitionRegistryService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1337
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPEntityDefinitionRegistryService, providedIn: 'root' }); }
878
1338
  }
879
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPEntityDefinitionRegistryService, decorators: [{
1339
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPEntityDefinitionRegistryService, decorators: [{
880
1340
  type: Injectable,
881
1341
  args: [{
882
1342
  providedIn: 'root',
@@ -1037,10 +1497,10 @@ class AXPEntityCreateViewModelFactory {
1037
1497
  this.layout.setNavigationLoading(false);
1038
1498
  return new AXPEntityMasterCreateViewModel(this.injector, config, initialData, options);
1039
1499
  }
1040
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPEntityCreateViewModelFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1041
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPEntityCreateViewModelFactory, providedIn: 'root' }); }
1500
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPEntityCreateViewModelFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1501
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPEntityCreateViewModelFactory, providedIn: 'root' }); }
1042
1502
  }
1043
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPEntityCreateViewModelFactory, decorators: [{
1503
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPEntityCreateViewModelFactory, decorators: [{
1044
1504
  type: Injectable,
1045
1505
  args: [{ providedIn: 'root' }]
1046
1506
  }] });
@@ -1154,10 +1614,10 @@ class AXPEntityMasterListViewModel {
1154
1614
  //****************** Columns ******************//
1155
1615
  this.allAvailableColumns = () => {
1156
1616
  const { columns = [], properties } = this.entityDef;
1157
- const visibleProperties = properties.filter(({ schema }) => !schema?.hidden);
1158
- const visiblePropNames = new Set(visibleProperties.map(({ name }) => name));
1617
+ // const visibleProperties = properties.filter(({ schema }) => !schema?.hidden);
1618
+ const propNames = new Set(properties.map(({ name }) => name));
1159
1619
  return columns
1160
- .filter(({ name, showAs }) => visiblePropNames.has(name) || showAs)
1620
+ .filter(({ name, showAs, hidden }) => (propNames.has(name) || showAs) && !hidden)
1161
1621
  .map((column) => {
1162
1622
  if (column.showAs) {
1163
1623
  const widgetConfig = this.widgetResolver.resolve(column.showAs.type);
@@ -1176,7 +1636,7 @@ class AXPEntityMasterListViewModel {
1176
1636
  return new AXPEntityListViewColumnViewModel(property, column);
1177
1637
  }
1178
1638
  else {
1179
- const property = visibleProperties.find(({ name }) => name === column.name);
1639
+ const property = properties.find(({ name }) => name === column.name);
1180
1640
  return new AXPEntityListViewColumnViewModel(property, column);
1181
1641
  }
1182
1642
  });
@@ -1250,12 +1710,12 @@ class AXPEntityMasterListViewModel {
1250
1710
  .map((c) => {
1251
1711
  return {
1252
1712
  ...c,
1253
- width: columnWidthsMap.get(c.name),
1254
- visible: columnVisibilityMap.get(c.name) ?? c.visible,
1713
+ width: columnWidthsMap.get(c.column?.options?.dataPath ?? c.name),
1714
+ visible: columnVisibilityMap.get(c.column?.options?.dataPath ?? c.name) ?? c.visible,
1255
1715
  };
1256
1716
  }) // Update visibility
1257
- .sort((a, b) => columns.findIndex((col) => col.name === a.name) -
1258
- columns.findIndex((col) => col.name === b.name)));
1717
+ .sort((a, b) => columns.findIndex((col) => col.name === (a.column?.options?.dataPath ?? a.name)) -
1718
+ columns.findIndex((col) => col.name === (b.column?.options?.dataPath ?? b.name))));
1259
1719
  }
1260
1720
  if (Array.isArray(sorts)) {
1261
1721
  // sorts are AXPSortQuery[]; ensure we map by name
@@ -1276,10 +1736,25 @@ class AXPEntityMasterListViewModel {
1276
1736
  updateSettings((prev) => {
1277
1737
  const field = data.dataField.split('-')[1];
1278
1738
  const newSettings = { ...prev };
1279
- set(newSettings, `list.views.${this.view().name}.columns`, prev?.list?.views?.[this.view().name]?.columns?.map((c) => ({
1739
+ const existingColumns = prev?.list?.views?.[this.view().name]?.columns;
1740
+ const baseColumns = Array.isArray(existingColumns) && existingColumns.length
1741
+ ? existingColumns
1742
+ : this.allAvailableColumns().map((c) => ({
1743
+ name: c.column?.options?.dataPath ?? c.name,
1744
+ visible: c.visible,
1745
+ width: c.width,
1746
+ }));
1747
+ const updatedColumns = baseColumns.map((c) => ({
1280
1748
  ...c,
1281
1749
  width: c.name === field ? data.width : c.width,
1282
- })));
1750
+ }));
1751
+ const x = this.allAvailableColumns().map((c) => ({
1752
+ name: c.column?.options?.dataPath ?? c.name,
1753
+ visible: c.visible,
1754
+ width: c.width,
1755
+ }));
1756
+ set(newSettings, `list.views.${this.view().name}.columns`, updatedColumns);
1757
+ console.log(newSettings, `list.views.${this.view().name}.columns`);
1283
1758
  return newSettings;
1284
1759
  });
1285
1760
  break;
@@ -1287,7 +1762,7 @@ class AXPEntityMasterListViewModel {
1287
1762
  updateSettings((prev) => {
1288
1763
  const newSettings = { ...prev };
1289
1764
  set(newSettings, `list.views.${this.view().name}.columns`, data.map((c) => ({
1290
- name: c.name,
1765
+ name: c.column?.options?.dataPath ?? c.name,
1291
1766
  visible: c.visible,
1292
1767
  width: c.width,
1293
1768
  })));
@@ -1483,6 +1958,12 @@ class AXPEntityMasterListViewModel {
1483
1958
  });
1484
1959
  this.columns.set(cloned);
1485
1960
  }
1961
+ onColumnsOrderChanged(event) {
1962
+ const columns = [...this.columns()];
1963
+ moveItemInArray(columns, event.previousIndex - 1, event.currentIndex - 1);
1964
+ this.columns.set(columns);
1965
+ this.saveSettings('columnOrders', columns);
1966
+ }
1486
1967
  resetSorts() {
1487
1968
  this.applyViewSorts();
1488
1969
  }
@@ -1518,7 +1999,7 @@ class AXPEntityMasterListViewModel {
1518
1999
  module: this.entityDef.module,
1519
2000
  title: this.entityDef.title,
1520
2001
  parentKey: this.entityDef.parentKey,
1521
- source: this.entityDef.source,
2002
+ source: `${this.entityDef.module}.${this.entityDef.name}`,
1522
2003
  },
1523
2004
  data: action?.scope == AXPEntityCommandScope.Selected ? this.selectedItems() : data,
1524
2005
  options: options,
@@ -1526,7 +2007,20 @@ class AXPEntityMasterListViewModel {
1526
2007
  });
1527
2008
  }
1528
2009
  else {
1529
- this.commandService.execute(command, options);
2010
+ // this.commandService.execute(command, options);
2011
+ this.commandService.execute(command, {
2012
+ entity: getEntityInfo(this.entityDef).source,
2013
+ entityInfo: {
2014
+ name: this.entityDef.name,
2015
+ module: this.entityDef.module,
2016
+ title: this.entityDef.title,
2017
+ parentKey: this.entityDef.parentKey,
2018
+ source: `${this.entityDef.module}.${this.entityDef.name}`,
2019
+ },
2020
+ data: action?.scope == AXPEntityCommandScope.Selected ? this.selectedItems() : data,
2021
+ options: options,
2022
+ metadata: action?.metadata,
2023
+ });
1530
2024
  }
1531
2025
  }
1532
2026
  async execute(command) {
@@ -1561,10 +2055,10 @@ class AXPEntityListViewModelFactory {
1561
2055
  this.layout.setNavigationLoading(false);
1562
2056
  return new AXPEntityMasterListViewModel(this.injector, config);
1563
2057
  }
1564
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPEntityListViewModelFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1565
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPEntityListViewModelFactory, providedIn: 'root' }); }
2058
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPEntityListViewModelFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
2059
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPEntityListViewModelFactory, providedIn: 'root' }); }
1566
2060
  }
1567
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPEntityListViewModelFactory, decorators: [{
2061
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPEntityListViewModelFactory, decorators: [{
1568
2062
  type: Injectable,
1569
2063
  args: [{ providedIn: 'root' }]
1570
2064
  }] });
@@ -1582,10 +2076,10 @@ class AXPEntityService {
1582
2076
  createPath(module, entity, path = 'list') {
1583
2077
  return `/${this.sessionService.application?.name}/m/${module}/e/${entity}/${path}`;
1584
2078
  }
1585
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPEntityService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1586
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPEntityService, providedIn: 'root' }); }
2079
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPEntityService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
2080
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPEntityService, providedIn: 'root' }); }
1587
2081
  }
1588
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPEntityService, decorators: [{
2082
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPEntityService, decorators: [{
1589
2083
  type: Injectable,
1590
2084
  args: [{ providedIn: 'root' }]
1591
2085
  }] });
@@ -1637,14 +2131,14 @@ class AXPEntityPerformDeleteAction extends AXPWorkflowAction {
1637
2131
  // Create dialog config but don't show it yet
1638
2132
  const createDialog = async () => {
1639
2133
  dialog = this.loadingDialog.show({
1640
- title: await this.translationService.translateAsync('workflow.deleting'),
2134
+ title: await this.translationService.translateAsync('@general:workflow.deleting'),
1641
2135
  mode: 'determinate',
1642
2136
  status: 'Deleting...',
1643
2137
  progressValue: 0,
1644
2138
  text: `0/${idLength}`,
1645
2139
  buttons: [
1646
2140
  {
1647
- text: await this.translationService.translateAsync('cancel'),
2141
+ text: await this.translationService.translateAsync('@general:actions.cancel.title'),
1648
2142
  color: 'danger',
1649
2143
  onClick: () => {
1650
2144
  if (dialog) {
@@ -1705,7 +2199,7 @@ class AXPEntityPerformDeleteAction extends AXPWorkflowAction {
1705
2199
  if (successfulPromises > 0 && failedPromises === 0) {
1706
2200
  // All items deleted successfully
1707
2201
  if (showResult) {
1708
- await this.dialogService.alert(await this.translationService.translateAsync('workflow.success-delete-title'), await this.translationService.translateAsync('workflow.success-delete-body', {
2202
+ await this.dialogService.alert(await this.translationService.translateAsync('@general:workflow.success-delete-title'), await this.translationService.translateAsync('@general:workflow.success-delete-body', {
1709
2203
  params: { item: successfulPromises },
1710
2204
  }), //TODO test translation
1711
2205
  'success');
@@ -1717,7 +2211,7 @@ class AXPEntityPerformDeleteAction extends AXPWorkflowAction {
1717
2211
  else if (successfulPromises > 0 && failedPromises > 0) {
1718
2212
  // Some items deleted successfully, some failed
1719
2213
  if (showResult) {
1720
- await this.dialogService.alert(await this.translationService.translateAsync('workflow.success-partial-delete-title'), await this.translationService.translateAsync('workflow.partial-delete-body', {
2214
+ await this.dialogService.alert(await this.translationService.translateAsync('@general:workflow.success-partial-delete-title'), await this.translationService.translateAsync('@general:workflow.partial-delete-body', {
1721
2215
  params: { success: successfulPromises, fail: failedPromises },
1722
2216
  }), 'warning');
1723
2217
  }
@@ -1727,7 +2221,7 @@ class AXPEntityPerformDeleteAction extends AXPWorkflowAction {
1727
2221
  else if (successfulPromises === 0 && failedPromises > 0) {
1728
2222
  // No items deleted, all failed
1729
2223
  if (showResult) {
1730
- await this.dialogService.alert(await this.translationService.translateAsync('workflow.fail-delete-title'), await this.translationService.translateAsync('workflow.fail-delete-body', {
2224
+ await this.dialogService.alert(await this.translationService.translateAsync('@general:workflow.fail-delete-title'), await this.translationService.translateAsync('@general:workflow.fail-delete-body', {
1731
2225
  params: { item: failedPromises },
1732
2226
  }), 'danger');
1733
2227
  }
@@ -1735,14 +2229,14 @@ class AXPEntityPerformDeleteAction extends AXPWorkflowAction {
1735
2229
  else {
1736
2230
  // No items to delete (no successful or failed promises)
1737
2231
  if (showResult) {
1738
- await this.dialogService.alert(await this.translationService.translateAsync('workflow.no-need'), await this.translationService.translateAsync('workflow.no-item'), 'primary');
2232
+ await this.dialogService.alert(await this.translationService.translateAsync('@general:workflow.no-need'), await this.translationService.translateAsync('@general:workflow.no-item'), 'primary');
1739
2233
  }
1740
2234
  }
1741
2235
  }
1742
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPEntityPerformDeleteAction, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
1743
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPEntityPerformDeleteAction }); }
2236
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPEntityPerformDeleteAction, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
2237
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPEntityPerformDeleteAction }); }
1744
2238
  }
1745
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPEntityPerformDeleteAction, decorators: [{
2239
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPEntityPerformDeleteAction, decorators: [{
1746
2240
  type: Injectable
1747
2241
  }] });
1748
2242
  const AXPDeleteEntityWorkflow = {
@@ -1751,8 +2245,8 @@ const AXPDeleteEntityWorkflow = {
1751
2245
  'confirm-delete': {
1752
2246
  action: 'show-prompt-dialog',
1753
2247
  input: {
1754
- title: 'workflow.warning',
1755
- message: `workflow.confirm-delete`,
2248
+ title: '@general:workflow.warning',
2249
+ message: '@general:workflow.confirm-delete',
1756
2250
  type: 'danger',
1757
2251
  },
1758
2252
  nextSteps: [
@@ -1773,8 +2267,37 @@ const AXPDeleteEntityWorkflow = {
1773
2267
  },
1774
2268
  };
1775
2269
 
1776
- class AXPEntityMasterUpdateElementViewModel {
1777
- constructor(entity, property) {
2270
+ class AXPEntityUpdateViewSectionViewModel {
2271
+ constructor(entity, section) {
2272
+ this.entity = entity;
2273
+ this.section = section;
2274
+ this.group = this.entity.groups?.find((c) => c.id == this.section.id);
2275
+ this.name = signal(this.group.id, ...(ngDevMode ? [{ debugName: "name" }] : []));
2276
+ this.title = computed(() => {
2277
+ return this.group.title ?? this.group.id;
2278
+ }, ...(ngDevMode ? [{ debugName: "title" }] : []));
2279
+ this.description = computed(() => {
2280
+ return this.group.description;
2281
+ }, ...(ngDevMode ? [{ debugName: "description" }] : []));
2282
+ this.layout = computed(() => {
2283
+ const source = cloneDeep(this.section.layout ?? {});
2284
+ set(source, 'positions.default.colSpan', 12);
2285
+ return source;
2286
+ }, ...(ngDevMode ? [{ debugName: "layout" }] : []));
2287
+ this.elements = computed(() => {
2288
+ const { interfaces, properties } = this.entity;
2289
+ const updateProps = interfaces?.master?.update?.properties ?? [];
2290
+ const updatePropNames = new Set(updateProps.map(({ name }) => name));
2291
+ const filteredProperties = properties.filter(({ groupId, schema, name }) => groupId === this.group.id && !schema.hidden && updatePropNames.has(name));
2292
+ return filteredProperties.map((property) => {
2293
+ const updateProp = updateProps.find(({ name }) => name === property.name);
2294
+ return new AXPEntityMasterUpdateElementViewModel(this.entity, property);
2295
+ });
2296
+ }, ...(ngDevMode ? [{ debugName: "elements" }] : []));
2297
+ }
2298
+ }
2299
+ class AXPEntityMasterUpdateElementViewModel {
2300
+ constructor(entity, property) {
1778
2301
  this.entity = entity;
1779
2302
  this.property = property;
1780
2303
  this.name = signal(this.property.name, ...(ngDevMode ? [{ debugName: "name" }] : []));
@@ -1838,6 +2361,13 @@ class AXPEntityMasterUpdateViewModel {
1838
2361
  return new AXPEntityMasterUpdateElementViewModel(this.entityDef, e);
1839
2362
  });
1840
2363
  }, ...(ngDevMode ? [{ debugName: "elements" }] : []));
2364
+ this.sections = computed(() => {
2365
+ const { interfaces, properties } = this.entityDef;
2366
+ const updateProps = interfaces?.master?.update?.properties?.map(({ name }) => name) ?? [];
2367
+ const visibleProperties = properties.filter(({ groupId, schema, name }) => groupId && !schema.hidden && updateProps.includes(name));
2368
+ const sections = interfaces?.master?.update?.sections?.filter(({ id }) => visibleProperties.some(({ groupId }) => groupId === id)) ?? [];
2369
+ return sections.map((section) => new AXPEntityUpdateViewSectionViewModel(this.entityDef, section));
2370
+ }, ...(ngDevMode ? [{ debugName: "sections" }] : []));
1841
2371
  }
1842
2372
  async save() {
1843
2373
  this.isInProgress.set(true);
@@ -1845,10 +2375,14 @@ class AXPEntityMasterUpdateViewModel {
1845
2375
  try {
1846
2376
  const com = this.entityDef.commands?.update;
1847
2377
  if (com) {
1848
- const exec = com.execute;
1849
- const result = await exec(this.context());
1850
- this.builder.setStatus(AXPPageStatus.Submitted);
1851
- return result;
2378
+ return new Promise((resolve) => {
2379
+ setTimeout(async () => {
2380
+ const exec = com.execute;
2381
+ const result = await exec(this.context());
2382
+ this.builder.setStatus(AXPPageStatus.Submitted);
2383
+ resolve(result);
2384
+ });
2385
+ });
1852
2386
  }
1853
2387
  }
1854
2388
  catch (error) {
@@ -1881,10 +2415,10 @@ class AXPEntityMasterUpdateViewModelFactory {
1881
2415
  this.layout.setNavigationLoading(false);
1882
2416
  return Promise.reject('cannot fetch ');
1883
2417
  }
1884
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPEntityMasterUpdateViewModelFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1885
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPEntityMasterUpdateViewModelFactory, providedIn: 'root' }); }
2418
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPEntityMasterUpdateViewModelFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
2419
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPEntityMasterUpdateViewModelFactory, providedIn: 'root' }); }
1886
2420
  }
1887
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPEntityMasterUpdateViewModelFactory, decorators: [{
2421
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPEntityMasterUpdateViewModelFactory, decorators: [{
1888
2422
  type: Injectable,
1889
2423
  args: [{ providedIn: 'root' }]
1890
2424
  }] });
@@ -1927,10 +2461,10 @@ class AXPEntityModifySectionPopupAction extends AXPWorkflowAction {
1927
2461
  context.setVariable('data', cloneDeep(popup.data.context));
1928
2462
  }
1929
2463
  }
1930
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPEntityModifySectionPopupAction, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
1931
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPEntityModifySectionPopupAction }); }
2464
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPEntityModifySectionPopupAction, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
2465
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPEntityModifySectionPopupAction }); }
1932
2466
  }
1933
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPEntityModifySectionPopupAction, decorators: [{
2467
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPEntityModifySectionPopupAction, decorators: [{
1934
2468
  type: Injectable
1935
2469
  }] });
1936
2470
  class AXPEntityModifyConfirmedAction extends AXPWorkflowAction {
@@ -1945,10 +2479,10 @@ class AXPEntityModifyConfirmedAction extends AXPWorkflowAction {
1945
2479
  },
1946
2480
  }));
1947
2481
  }
1948
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPEntityModifyConfirmedAction, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
1949
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPEntityModifyConfirmedAction }); }
2482
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPEntityModifyConfirmedAction, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
2483
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPEntityModifyConfirmedAction }); }
1950
2484
  }
1951
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPEntityModifyConfirmedAction, decorators: [{
2485
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPEntityModifyConfirmedAction, decorators: [{
1952
2486
  type: Injectable
1953
2487
  }] });
1954
2488
  const AXPModifyEntitySectionWorkflow = {
@@ -2241,10 +2775,10 @@ class AXPEntityDetailViewModelFactory {
2241
2775
  this.layout.setNavigationLoading(false);
2242
2776
  return Promise.reject('cannot fetch ');
2243
2777
  }
2244
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPEntityDetailViewModelFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
2245
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPEntityDetailViewModelFactory, providedIn: 'root' }); }
2778
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPEntityDetailViewModelFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
2779
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPEntityDetailViewModelFactory, providedIn: 'root' }); }
2246
2780
  }
2247
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPEntityDetailViewModelFactory, decorators: [{
2781
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPEntityDetailViewModelFactory, decorators: [{
2248
2782
  type: Injectable,
2249
2783
  args: [{ providedIn: 'root' }]
2250
2784
  }] });
@@ -2256,9 +2790,6 @@ const AXPEntityDetailViewModelResolver = (route, state, service = inject(AXPEnti
2256
2790
  return service.create(moduleName, entityName, id);
2257
2791
  };
2258
2792
 
2259
- const AXP_ENTITY_STORAGE_BACKEND = new InjectionToken('AXP_ENTITY_STORAGE_BACKEND');
2260
- const AXP_ENTITY_STORAGE_MIDDLEWARE = new InjectionToken('AXP_ENTITY_STORAGE_MIDDLEWARE');
2261
-
2262
2793
  class AXPEntityStorageService {
2263
2794
  }
2264
2795
  class AXPEntityDataProvider {
@@ -2298,6 +2829,7 @@ class AXMEntityCrudServiceImpl {
2298
2829
  this._storageService = inject(AXPEntityStorageService);
2299
2830
  this.entityRegistery = inject(AXPEntityDefinitionRegistryService);
2300
2831
  this._entityDataProvider = new AXPEntityDataProviderImpl(this._storageService, this.entityName);
2832
+ this._entityCategoryDataProvider = new AXPEntityDataProviderImpl(this._storageService, `${this.entityName}Category`);
2301
2833
  }
2302
2834
  async insertOne(request) {
2303
2835
  return this._entityDataProvider.insertOne(request);
@@ -2377,180 +2909,14 @@ class AXMEntityCrudServiceImpl {
2377
2909
  const result = await this._entityDataProvider.query(queryRequest);
2378
2910
  return result;
2379
2911
  }
2912
+ async getCategoriesList(request = { skip: 0, take: 1000 }) {
2913
+ return this._entityCategoryDataProvider.query(request);
2914
+ }
2380
2915
  get storageService() {
2381
2916
  return this._storageService;
2382
2917
  }
2383
2918
  }
2384
2919
 
2385
- class AXPMiddlewareEntityStorageService extends AXPEntityStorageService {
2386
- constructor() {
2387
- super(...arguments);
2388
- this.backend = inject(AXP_ENTITY_STORAGE_BACKEND);
2389
- this.allMiddlewares = (inject(AXP_ENTITY_STORAGE_MIDDLEWARE, { optional: true }) || []).slice();
2390
- this.injector = inject(EnvironmentInjector);
2391
- }
2392
- get dbName() {
2393
- return this.backend.dbName;
2394
- }
2395
- filterMiddlewares(ctx) {
2396
- return this.allMiddlewares
2397
- .filter((mw) => {
2398
- const t = mw.target;
2399
- if (!t)
2400
- return true;
2401
- if (t.ops && !t.ops.includes(ctx.op))
2402
- return false;
2403
- if (t.entity) {
2404
- if (typeof t.entity === 'string' && t.entity !== ctx.entityName)
2405
- return false;
2406
- if (t.entity instanceof RegExp && !t.entity.test(ctx.entityName))
2407
- return false;
2408
- }
2409
- if (t.predicate && !t.predicate(ctx))
2410
- return false;
2411
- return true;
2412
- })
2413
- .sort((a, b) => (a.target?.order ?? 0) - (b.target?.order ?? 0));
2414
- }
2415
- compose(mws, leaf, ctx) {
2416
- return mws
2417
- .slice()
2418
- .reverse()
2419
- .reduce((next, mw) => {
2420
- return async () => runInInjectionContext(this.injector, () => mw.execute(ctx, next));
2421
- }, leaf);
2422
- }
2423
- async run(ctx, delegate) {
2424
- const chain = this.compose(this.filterMiddlewares(ctx), async () => {
2425
- ctx.result = await delegate();
2426
- }, ctx);
2427
- await chain();
2428
- return ctx.result;
2429
- }
2430
- createCtx(op, entityName, init) {
2431
- return {
2432
- op,
2433
- entityName,
2434
- locals: new Map(),
2435
- backend: {
2436
- getOneRaw: (name, id) => this.backend.getOne(name, id),
2437
- insertOneRaw: (name, e) => this.backend.insertOne(name, e),
2438
- },
2439
- ...init,
2440
- };
2441
- }
2442
- async initial(entityName, collection, options) {
2443
- const ctx = this.createCtx('initial', entityName, { data: collection });
2444
- return this.run(ctx, () => this.backend.initial(entityName, ctx.data, options));
2445
- }
2446
- async getOne(entityName, id) {
2447
- const ctx = this.createCtx('getOne', entityName, { id });
2448
- return this.run(ctx, () => this.backend.getOne(entityName, id));
2449
- }
2450
- async updateOne(entityName, id, keyValues) {
2451
- const ctx = this.createCtx('update', entityName, { id, data: keyValues });
2452
- return this.run(ctx, () => this.backend.updateOne(entityName, id, ctx.data));
2453
- }
2454
- async deleteOne(entityName, id) {
2455
- const ctx = this.createCtx('delete', entityName, { id });
2456
- return this.run(ctx, () => this.backend.deleteOne(entityName, id));
2457
- }
2458
- async insertOne(entityName, entity) {
2459
- const ctx = this.createCtx('create', entityName, { data: entity });
2460
- return this.run(ctx, () => this.backend.insertOne(entityName, ctx.data));
2461
- }
2462
- async getAll(entityName) {
2463
- const ctx = this.createCtx('getAll', entityName);
2464
- return this.run(ctx, () => this.backend.getAll(entityName));
2465
- }
2466
- async query(entityName, request) {
2467
- const ctx = this.createCtx('query', entityName, { request });
2468
- return this.run(ctx, () => this.backend.query(entityName, request));
2469
- }
2470
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPMiddlewareEntityStorageService, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
2471
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPMiddlewareEntityStorageService }); }
2472
- }
2473
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPMiddlewareEntityStorageService, decorators: [{
2474
- type: Injectable
2475
- }] });
2476
-
2477
- /**
2478
- * Entity Event Dispatcher - A wrapper for entity-specific events
2479
- * Handles pattern-based dispatching for entity operations with wildcard support
2480
- */
2481
- class AXPEntityEventDispatcherService {
2482
- constructor() {
2483
- this.eventService = inject(AXPDistributedEventListenerService);
2484
- }
2485
- async dispatchEntityEvent(operation, entityName, data) {
2486
- const enhancedData = {
2487
- ...data,
2488
- entityName,
2489
- operation,
2490
- timestamp: new Date(),
2491
- source: 'entity-dispatcher',
2492
- };
2493
- const eventKeysToDispatch = await this.getAllMatchingEventKeys(operation, entityName);
2494
- const dispatchPromises = eventKeysToDispatch.map((key) => this.eventService.dispatch(key, enhancedData));
2495
- await Promise.all(dispatchPromises);
2496
- }
2497
- async getAllMatchingEventKeys(operation, entityName) {
2498
- const eventKeys = new Set();
2499
- const exactKeys = this.generateEventKeys(operation, entityName);
2500
- exactKeys.forEach((key) => eventKeys.add(key));
2501
- const wildcardKeys = await this.findMatchingWildcardKeys(operation, entityName);
2502
- wildcardKeys.forEach((key) => eventKeys.add(key));
2503
- return Array.from(eventKeys);
2504
- }
2505
- async findMatchingWildcardKeys(operation, entityName) {
2506
- const matchingKeys = [];
2507
- const allListenerKeys = await this.eventService.getRegisteredKeys();
2508
- const actualEventKey = `entity.${operation}.${entityName}`;
2509
- for (const listenerKey of allListenerKeys) {
2510
- if (listenerKey.includes('*') && this.matchesEntityPattern(actualEventKey, listenerKey)) {
2511
- matchingKeys.push(listenerKey);
2512
- }
2513
- }
2514
- return matchingKeys;
2515
- }
2516
- matchesEntityPattern(eventKey, pattern) {
2517
- if (!pattern.startsWith('entity.') || !pattern.includes('*')) {
2518
- return false;
2519
- }
2520
- const regexPattern = pattern.replace(/\./g, '\\.').replace(/\*/g, '.*');
2521
- const regex = new RegExp(`^${regexPattern}$`);
2522
- return regex.test(eventKey);
2523
- }
2524
- generateEventKeys(operation, entityName) {
2525
- const keys = [];
2526
- keys.push(`entity.${operation}`);
2527
- keys.push(`entity.${operation}.${entityName}`);
2528
- const entityParts = entityName.split('.');
2529
- if (entityParts.length > 1) {
2530
- const moduleName = entityParts[0];
2531
- keys.push(`entity.${operation}.${moduleName}`);
2532
- }
2533
- return keys;
2534
- }
2535
- async dispatchInserted(entityName, data) {
2536
- await this.dispatchEntityEvent('inserted', entityName, data);
2537
- }
2538
- async dispatchUpdated(entityName, data) {
2539
- await this.dispatchEntityEvent('updated', entityName, data);
2540
- }
2541
- async dispatchDeleted(entityName, data) {
2542
- await this.dispatchEntityEvent('deleted', entityName, data);
2543
- }
2544
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPEntityEventDispatcherService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
2545
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPEntityEventDispatcherService, providedIn: 'root' }); }
2546
- }
2547
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPEntityEventDispatcherService, decorators: [{
2548
- type: Injectable,
2549
- args: [{
2550
- providedIn: 'root',
2551
- }]
2552
- }] });
2553
-
2554
2920
  class AXPLayoutAdapterBuilder {
2555
2921
  constructor() {
2556
2922
  this.adapter = {};
@@ -2632,10 +2998,10 @@ class AXPLayoutAdapterBuilder {
2632
2998
  };
2633
2999
  };
2634
3000
  }
2635
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPLayoutAdapterBuilder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
2636
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPLayoutAdapterBuilder, providedIn: 'root' }); }
3001
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPLayoutAdapterBuilder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
3002
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPLayoutAdapterBuilder, providedIn: 'root' }); }
2637
3003
  }
2638
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPLayoutAdapterBuilder, decorators: [{
3004
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPLayoutAdapterBuilder, decorators: [{
2639
3005
  type: Injectable,
2640
3006
  args: [{
2641
3007
  providedIn: 'root',
@@ -2837,13 +3203,13 @@ class AXPPageDetailsConverter extends AXPBaseRelatedEntityConverter {
2837
3203
  return {
2838
3204
  commands: {
2839
3205
  reject: {
2840
- title: 't("discard")',
3206
+ title: '@general:actions.discard.title',
2841
3207
  color: 'default',
2842
3208
  visible: '{{context.isDirty()}}',
2843
3209
  command: { name: 'discard' },
2844
3210
  },
2845
3211
  accept: {
2846
- title: 't("confirm")',
3212
+ title: '@general:actions.confirm.title',
2847
3213
  color: 'secondary',
2848
3214
  visible: '{{context.isDirty()}}',
2849
3215
  command: { name: 'update-entity' },
@@ -2988,7 +3354,7 @@ class AXPPageListConverter extends AXPBaseRelatedEntityConverter {
2988
3354
  module: entityDef.module,
2989
3355
  title: entityDef.title,
2990
3356
  parentKey: entityDef.parentKey,
2991
- source: entityDef.source,
3357
+ source: `${entityDef.module}.${entityDef.name}`,
2992
3358
  },
2993
3359
  data: action.scope == AXPEntityCommandScope.Selected
2994
3360
  ? executeContext
@@ -3088,6 +3454,7 @@ class AXPTabDetailsConverter extends AXPBaseRelatedEntityConverter {
3088
3454
  class AXPTabListConverter extends AXPBaseRelatedEntityConverter {
3089
3455
  async convert(relatedEntity, context) {
3090
3456
  const { entityDef } = await this.getEntityDefinition(relatedEntity, context.entityResolver);
3457
+ debugger;
3091
3458
  const evaluateExpressions = async (actionData) => {
3092
3459
  const scope = {
3093
3460
  context: {
@@ -3161,10 +3528,10 @@ class AXPRelatedEntityConverterFactory {
3161
3528
  createTabListConverter() {
3162
3529
  return this.createConverter('tab-list');
3163
3530
  }
3164
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPRelatedEntityConverterFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
3165
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPRelatedEntityConverterFactory, providedIn: 'root' }); }
3531
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPRelatedEntityConverterFactory, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
3532
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPRelatedEntityConverterFactory, providedIn: 'root' }); }
3166
3533
  }
3167
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPRelatedEntityConverterFactory, decorators: [{
3534
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPRelatedEntityConverterFactory, decorators: [{
3168
3535
  type: Injectable,
3169
3536
  args: [{
3170
3537
  providedIn: 'root',
@@ -3430,7 +3797,7 @@ class AXPMainEntityContentBuilder {
3430
3797
  })),
3431
3798
  ];
3432
3799
  // eslint-disable-next-line no-console
3433
- console.debug('[AXP] merge-details sorted sections', debugSections);
3800
+ //console.debug('[AXP] merge-details sorted sections', debugSections);
3434
3801
  }
3435
3802
  catch { }
3436
3803
  const getVisiblePropertyByGroupId = async (groupId) => {
@@ -3460,7 +3827,7 @@ class AXPMainEntityContentBuilder {
3460
3827
  settings: {
3461
3828
  commands: {
3462
3829
  reject: {
3463
- title: 't("discard")',
3830
+ title: '@general:actions.discard.title',
3464
3831
  color: 'default',
3465
3832
  visible: '{{context.isDirty()}}',
3466
3833
  command: {
@@ -3468,7 +3835,7 @@ class AXPMainEntityContentBuilder {
3468
3835
  },
3469
3836
  },
3470
3837
  accept: {
3471
- title: 't("confirm")',
3838
+ title: '@general:actions.confirm.title',
3472
3839
  color: 'secondary',
3473
3840
  visible: '{{context.isDirty()}}',
3474
3841
  command: {
@@ -3490,57 +3857,68 @@ class AXPMainEntityContentBuilder {
3490
3857
  };
3491
3858
  },
3492
3859
  execute: async (e, context) => {
3493
- if (e.name == 'update-entity') {
3494
- const fn = entity?.commands?.update?.execute;
3495
- const result = await fn(context);
3496
- return {
3497
- success: true,
3498
- result: result,
3499
- };
3500
- }
3501
- else {
3502
- // Find action in single interface actions
3503
- const action = actions.find((a) => a.name === e.name);
3504
- if (action && dependencies?.workflowService) {
3505
- // Evaluate action options with current context
3506
- let evaluatedOptions = action.options;
3507
- if (evaluateExpressions && action.options) {
3508
- try {
3509
- evaluatedOptions = await evaluateExpressions(action.options);
3860
+ try {
3861
+ if (e.name == 'update-entity') {
3862
+ const fn = entity?.commands?.update?.execute;
3863
+ const result = await fn(context);
3864
+ return {
3865
+ success: true,
3866
+ result: result,
3867
+ };
3868
+ }
3869
+ else {
3870
+ // Find action in single interface actions
3871
+ const action = actions.find((a) => a.name === e.name);
3872
+ if (action && dependencies?.workflowService) {
3873
+ // Evaluate action options with current context
3874
+ let evaluatedOptions = action.options;
3875
+ if (evaluateExpressions && action.options) {
3876
+ try {
3877
+ evaluatedOptions = await evaluateExpressions(action.options);
3878
+ }
3879
+ catch {
3880
+ // Keep original options if evaluation fails
3881
+ }
3510
3882
  }
3511
- catch {
3512
- // Keep original options if evaluation fails
3883
+ const commandName = e.name.split('&')[0];
3884
+ if (this.workflowService.exists(commandName)) {
3885
+ await this.workflowService.execute(commandName, {
3886
+ entity: getEntityInfo(entity).source,
3887
+ data: context,
3888
+ entityInfo: {
3889
+ name: entity.name,
3890
+ module: entity.module,
3891
+ title: entity.title,
3892
+ parentKey: entity.parentKey,
3893
+ source: `${entity.module}.${entity.name}`,
3894
+ },
3895
+ options: evaluatedOptions,
3896
+ metadata: action.metadata,
3897
+ });
3898
+ return {
3899
+ success: true,
3900
+ };
3901
+ }
3902
+ if (this.commandService.exists(commandName)) {
3903
+ // check options for evaluation
3904
+ await this.commandService.execute(commandName, e.options);
3513
3905
  }
3514
3906
  }
3515
- const commandName = e.name.split('&')[0];
3516
- if (this.workflowService.exists(commandName)) {
3517
- await this.workflowService.execute(commandName, {
3518
- entity: getEntityInfo(entity).source,
3519
- data: context,
3520
- entityInfo: {
3521
- name: entity.name,
3522
- module: entity.module,
3523
- title: entity.title,
3524
- parentKey: entity.parentKey,
3525
- source: entity.source,
3526
- },
3527
- options: evaluatedOptions,
3528
- metadata: action.metadata,
3529
- });
3530
- return {
3531
- success: true,
3532
- };
3533
- }
3534
- if (this.commandService.exists(commandName)) {
3535
- // check options for evaluation
3536
- await this.commandService.execute(commandName, e.options);
3537
- }
3907
+ return {
3908
+ success: false,
3909
+ error: {
3910
+ code: 'invalid_command',
3911
+ message: 'Invalid command',
3912
+ },
3913
+ };
3538
3914
  }
3915
+ }
3916
+ catch (error) {
3539
3917
  return {
3540
3918
  success: false,
3541
3919
  error: {
3542
- code: 'invalid_command',
3543
- message: 'Invalid command',
3920
+ //TODO: handle error as object
3921
+ message: error,
3544
3922
  },
3545
3923
  };
3546
3924
  }
@@ -3740,10 +4118,10 @@ class AXPMainEntityContentBuilder {
3740
4118
  }
3741
4119
  return tabs;
3742
4120
  }
3743
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPMainEntityContentBuilder, deps: [{ token: AXPRelatedEntityConverterFactory }], target: i0.ɵɵFactoryTarget.Injectable }); }
3744
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPMainEntityContentBuilder, providedIn: 'root' }); }
4121
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPMainEntityContentBuilder, deps: [{ token: AXPRelatedEntityConverterFactory }], target: i0.ɵɵFactoryTarget.Injectable }); }
4122
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPMainEntityContentBuilder, providedIn: 'root' }); }
3745
4123
  }
3746
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPMainEntityContentBuilder, decorators: [{
4124
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPMainEntityContentBuilder, decorators: [{
3747
4125
  type: Injectable,
3748
4126
  args: [{
3749
4127
  providedIn: 'root',
@@ -3882,10 +4260,10 @@ class AXPLayoutAdapterFactory {
3882
4260
  const title = await dependencies.expressionEvaluator.evaluate(entity.interfaces?.master?.single?.title, rootContext);
3883
4261
  return title;
3884
4262
  }
3885
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPLayoutAdapterFactory, deps: [{ token: AXPRelatedEntityConverterFactory }, { token: AXPMainEntityContentBuilder }, { token: AXPLayoutAdapterBuilder }], target: i0.ɵɵFactoryTarget.Injectable }); }
3886
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPLayoutAdapterFactory, providedIn: 'root' }); }
4263
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPLayoutAdapterFactory, deps: [{ token: AXPRelatedEntityConverterFactory }, { token: AXPMainEntityContentBuilder }, { token: AXPLayoutAdapterBuilder }], target: i0.ɵɵFactoryTarget.Injectable }); }
4264
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPLayoutAdapterFactory, providedIn: 'root' }); }
3887
4265
  }
3888
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPLayoutAdapterFactory, decorators: [{
4266
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPLayoutAdapterFactory, decorators: [{
3889
4267
  type: Injectable,
3890
4268
  args: [{
3891
4269
  providedIn: 'root',
@@ -4041,13 +4419,14 @@ function mapEntityColumnToWidgetColumn(entity, column) {
4041
4419
  path: column.options?.dataPath || column.name,
4042
4420
  options: {
4043
4421
  readonly: true,
4422
+ columnName: column.name,
4044
4423
  ...property.schema.interface.options,
4045
4424
  },
4046
4425
  }
4047
4426
  : {
4048
4427
  type: 'text-editor',
4049
4428
  path: column.options?.dataPath || column.name,
4050
- options: { readonly: true },
4429
+ options: { readonly: true, columnName: column.name },
4051
4430
  },
4052
4431
  };
4053
4432
  }
@@ -4077,7 +4456,6 @@ function getVisibleProperties(entity) {
4077
4456
  class AXPEntityListTableService {
4078
4457
  constructor() {
4079
4458
  //#region ---- Services & Dependencies ----
4080
- this.entityResolver = inject(AXPEntityResolver);
4081
4459
  this.workflow = inject(AXPWorkflowService);
4082
4460
  this.expressionEvaluator = inject(AXPExpressionEvaluatorService);
4083
4461
  this.evaluateExpressions = async (options, data) => {
@@ -4210,7 +4588,7 @@ class AXPEntityListTableService {
4210
4588
  module: entity.module,
4211
4589
  title: entity.title,
4212
4590
  parentKey: entity.parentKey,
4213
- source: entity.source,
4591
+ source: `${entity.module}.${entity.name}`,
4214
4592
  },
4215
4593
  data: action?.scope == AXPEntityCommandScope.Selected ? selectedRows : data,
4216
4594
  options: options,
@@ -4250,10 +4628,10 @@ class AXPEntityListTableService {
4250
4628
  },
4251
4629
  };
4252
4630
  }
4253
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPEntityListTableService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
4254
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPEntityListTableService }); }
4631
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPEntityListTableService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
4632
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPEntityListTableService }); }
4255
4633
  }
4256
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPEntityListTableService, decorators: [{
4634
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPEntityListTableService, decorators: [{
4257
4635
  type: Injectable
4258
4636
  }] });
4259
4637
 
@@ -4344,17 +4722,17 @@ class AXPEntityListToolbarService {
4344
4722
  };
4345
4723
  });
4346
4724
  }
4347
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPEntityListToolbarService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
4348
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPEntityListToolbarService }); }
4725
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPEntityListToolbarService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
4726
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPEntityListToolbarService }); }
4349
4727
  }
4350
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPEntityListToolbarService, decorators: [{
4728
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPEntityListToolbarService, decorators: [{
4351
4729
  type: Injectable
4352
4730
  }] });
4353
4731
 
4354
4732
  class AXPEntityListWidgetViewComponent extends AXPValueWidgetComponent {
4355
4733
  constructor() {
4356
4734
  super(...arguments);
4357
- this.entityResolver = inject(AXPEntityResolver);
4735
+ this.entityService = inject(AXPEntityDefinitionRegistryService);
4358
4736
  this.workflow = inject(AXPWorkflowService);
4359
4737
  this.entityListTableService = inject(AXPEntityListTableService);
4360
4738
  this.entityListToolbarService = inject(AXPEntityListToolbarService);
@@ -4444,6 +4822,7 @@ class AXPEntityListWidgetViewComponent extends AXPValueWidgetComponent {
4444
4822
  const queries = this.getValue()?.toolbar;
4445
4823
  const listInstance = this.listWidget()?.instance;
4446
4824
  const dataSource = this.listWidget()?.options()['dataSource'];
4825
+ // const dataSource = this.listWidget()?.instance.options()['dataSource'] as AXDataSource;
4447
4826
  const isMounted = this.isMounted();
4448
4827
  if (!this.hasRequiredDependencies(dataSource, queries, listInstance)) {
4449
4828
  return;
@@ -4486,7 +4865,7 @@ class AXPEntityListWidgetViewComponent extends AXPValueWidgetComponent {
4486
4865
  module: this.entity()?.module,
4487
4866
  title: this.entity()?.title,
4488
4867
  parentKey: this.entity()?.parentKey,
4489
- source: this.entity()?.source,
4868
+ source: `${this.entity()?.module}.${this.entity()?.name}`,
4490
4869
  },
4491
4870
  data: action?.scope == AXPEntityCommandScope.Selected
4492
4871
  ? this.selectedItems()
@@ -4588,7 +4967,7 @@ class AXPEntityListWidgetViewComponent extends AXPValueWidgetComponent {
4588
4967
  throw new Error('Invalid entity source');
4589
4968
  }
4590
4969
  // Resolve entity and set it in the signal
4591
- const resolvedEntity = await this.entityResolver.get(moduleName, entityName);
4970
+ const resolvedEntity = await this.entityService.resolve(moduleName, entityName);
4592
4971
  if (!resolvedEntity) {
4593
4972
  throw new Error(`Entity not found: ${this.entitySource()}`);
4594
4973
  }
@@ -4643,8 +5022,8 @@ class AXPEntityListWidgetViewComponent extends AXPValueWidgetComponent {
4643
5022
  this.destroyed.next();
4644
5023
  this.destroyed.complete();
4645
5024
  }
4646
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPEntityListWidgetViewComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
4647
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.6", 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: `
5025
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPEntityListWidgetViewComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
5026
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.8", 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: `
4648
5027
  @if (showEntityActions()) {
4649
5028
  <div class="ax-flex ax-gap-2 ax-justify-end ax-mb-4">
4650
5029
  @for (action of primaryActions(); track $index) {
@@ -4691,7 +5070,7 @@ class AXPEntityListWidgetViewComponent extends AXPValueWidgetComponent {
4691
5070
  <ax-button
4692
5071
  [class.ax-sm]="layoutThemeService.isSmall()"
4693
5072
  [iconOnly]="layoutThemeService.isSmall()"
4694
- [text]="'actions'"
5073
+ [text]="'@general:terms.interface.actions' | translate | async"
4695
5074
  [look]="layoutThemeService.isSmall() ? 'blank' : 'solid'"
4696
5075
  [color]="'default'"
4697
5076
  >
@@ -4745,9 +5124,9 @@ class AXPEntityListWidgetViewComponent extends AXPValueWidgetComponent {
4745
5124
  ></ng-container>
4746
5125
  }
4747
5126
  </div>
4748
- `, 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: AXPLayoutBuilderModule }, { kind: "directive", type: i2.AXPWidgetRendererDirective, selector: "[axp-widget-renderer]", inputs: ["parentNode", "index", "mode", "node"], outputs: ["onOptionsChanged", "onValueChanged"], exportAs: ["widgetRenderer"] }, { kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i3$1.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$1.AXButtonItemComponent, selector: "ax-button-item", inputs: ["color", "disabled", "text", "selected", "divided", "data", "name"], outputs: ["onClick", "onFocus", "onBlur", "disabledChange"] }, { kind: "component", type: i3$1.AXButtonItemListComponent, selector: "ax-button-item-list", inputs: ["items"], outputs: ["onItemClick"] }, { kind: "ngmodule", type: AXDropdownModule }, { kind: "component", type: i4.AXDropdownPanelComponent, selector: "ax-dropdown-panel", inputs: ["isOpen", "fitParent", "dropdownWidth", "position", "placement", "_target", "adaptivityEnabled"], outputs: ["onOpened", "onClosed"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
5127
+ `, 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: AXPLayoutBuilderModule }, { 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$1.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 }); }
4749
5128
  }
4750
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPEntityListWidgetViewComponent, decorators: [{
5129
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPEntityListWidgetViewComponent, decorators: [{
4751
5130
  type: Component,
4752
5131
  args: [{
4753
5132
  template: `
@@ -4797,7 +5176,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImpor
4797
5176
  <ax-button
4798
5177
  [class.ax-sm]="layoutThemeService.isSmall()"
4799
5178
  [iconOnly]="layoutThemeService.isSmall()"
4800
- [text]="'actions'"
5179
+ [text]="'@general:terms.interface.actions' | translate | async"
4801
5180
  [look]="layoutThemeService.isSmall() ? 'blank' : 'solid'"
4802
5181
  [color]="'default'"
4803
5182
  >
@@ -4858,7 +5237,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImpor
4858
5237
  },
4859
5238
  changeDetection: ChangeDetectionStrategy.OnPush,
4860
5239
  providers: [AXPEntityListTableService, AXPEntityListToolbarService],
4861
- imports: [CommonModule, AXDecoratorModule, AXPLayoutBuilderModule, AXButtonModule, AXDropdownModule],
5240
+ imports: [
5241
+ CommonModule,
5242
+ AXDecoratorModule,
5243
+ AXPLayoutBuilderModule,
5244
+ AXButtonModule,
5245
+ AXDropdownModule,
5246
+ AXTranslationModule,
5247
+ ],
4862
5248
  }]
4863
5249
  }] });
4864
5250
 
@@ -4893,10 +5279,10 @@ const AXPEntityListWidget = {
4893
5279
  };
4894
5280
 
4895
5281
  class AXPEntityReferenceWidgetViewComponent extends AXPLayoutBaseWidgetComponent {
4896
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPEntityReferenceWidgetViewComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
4897
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.6", type: AXPEntityReferenceWidgetViewComponent, isStandalone: true, selector: "ng-component", usesInheritance: true, ngImport: i0, template: ``, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
5282
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPEntityReferenceWidgetViewComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
5283
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.8", type: AXPEntityReferenceWidgetViewComponent, isStandalone: true, selector: "ng-component", usesInheritance: true, ngImport: i0, template: ``, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
4898
5284
  }
4899
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPEntityReferenceWidgetViewComponent, decorators: [{
5285
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPEntityReferenceWidgetViewComponent, decorators: [{
4900
5286
  type: Component,
4901
5287
  args: [{
4902
5288
  template: ``,
@@ -4925,10 +5311,10 @@ class AXPEntityReferenceWidgetEditComponent extends AXPLayoutBaseWidgetComponent
4925
5311
  }, ...(ngDevMode ? [{ debugName: "#efEntity" }] : []));
4926
5312
  }
4927
5313
  #efEntity;
4928
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPEntityReferenceWidgetEditComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
4929
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.6", 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 }); }
5314
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPEntityReferenceWidgetEditComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
5315
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.8", 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 }); }
4930
5316
  }
4931
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPEntityReferenceWidgetEditComponent, decorators: [{
5317
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPEntityReferenceWidgetEditComponent, decorators: [{
4932
5318
  type: Component,
4933
5319
  args: [{
4934
5320
  template: ``,
@@ -4944,10 +5330,10 @@ var entityReferenceWidgetEdit_component = /*#__PURE__*/Object.freeze({
4944
5330
  });
4945
5331
 
4946
5332
  class AXPEntityReferenceWidgetColumnComponent extends AXPColumnWidgetComponent {
4947
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPEntityReferenceWidgetColumnComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
4948
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.6", 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 }); }
5333
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPEntityReferenceWidgetColumnComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
5334
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.8", 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 }); }
4949
5335
  }
4950
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPEntityReferenceWidgetColumnComponent, decorators: [{
5336
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPEntityReferenceWidgetColumnComponent, decorators: [{
4951
5337
  type: Component,
4952
5338
  args: [{
4953
5339
  template: `{{rawValue}}`,
@@ -4964,10 +5350,10 @@ var entityReferenceWidgetColumn_component = /*#__PURE__*/Object.freeze({
4964
5350
  });
4965
5351
 
4966
5352
  class AXPEntityReferenceWidgetPrintComponent extends AXPLayoutBaseWidgetComponent {
4967
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPEntityReferenceWidgetPrintComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
4968
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.6", type: AXPEntityReferenceWidgetPrintComponent, isStandalone: true, selector: "ng-component", usesInheritance: true, ngImport: i0, template: ``, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
5353
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPEntityReferenceWidgetPrintComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
5354
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.8", type: AXPEntityReferenceWidgetPrintComponent, isStandalone: true, selector: "ng-component", usesInheritance: true, ngImport: i0, template: ``, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
4969
5355
  }
4970
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPEntityReferenceWidgetPrintComponent, decorators: [{
5356
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPEntityReferenceWidgetPrintComponent, decorators: [{
4971
5357
  type: Component,
4972
5358
  args: [{
4973
5359
  template: ``,
@@ -4984,10 +5370,10 @@ var entityReferenceWidgetPrint_component = /*#__PURE__*/Object.freeze({
4984
5370
  });
4985
5371
 
4986
5372
  class AXPEntityReferenceWidgetDesignerComponent extends AXPLayoutBaseWidgetComponent {
4987
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPEntityReferenceWidgetDesignerComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
4988
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.6", type: AXPEntityReferenceWidgetDesignerComponent, isStandalone: true, selector: "ng-component", usesInheritance: true, ngImport: i0, template: ``, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
5373
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPEntityReferenceWidgetDesignerComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
5374
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.8", type: AXPEntityReferenceWidgetDesignerComponent, isStandalone: true, selector: "ng-component", usesInheritance: true, ngImport: i0, template: ``, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
4989
5375
  }
4990
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPEntityReferenceWidgetDesignerComponent, decorators: [{
5376
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPEntityReferenceWidgetDesignerComponent, decorators: [{
4991
5377
  type: Component,
4992
5378
  args: [{
4993
5379
  template: ``,
@@ -5092,8 +5478,8 @@ class AXPLookupWidgetViewComponent extends AXPValueWidgetComponent {
5092
5478
  cls[`ax-gap-1`] = true;
5093
5479
  return cls;
5094
5480
  }
5095
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPLookupWidgetViewComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
5096
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.6", type: AXPLookupWidgetViewComponent, isStandalone: true, selector: "axp-lookup-widget-view", host: { properties: { "class": "this.__class" } }, usesInheritance: true, ngImport: i0, template: `
5481
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPLookupWidgetViewComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
5482
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.8", type: AXPLookupWidgetViewComponent, isStandalone: true, selector: "axp-lookup-widget-view", host: { properties: { "class": "this.__class" } }, usesInheritance: true, ngImport: i0, template: `
5097
5483
  @if(loading())
5098
5484
  {
5099
5485
  <ax-loading></ax-loading>
@@ -5111,9 +5497,9 @@ class AXPLookupWidgetViewComponent extends AXPValueWidgetComponent {
5111
5497
  <span class="ax-text-muted">---</span>
5112
5498
  }
5113
5499
  }
5114
- `, isInline: true, dependencies: [{ kind: "ngmodule", type: AXLoadingModule }, { kind: "component", type: i1.AXLoadingComponent, selector: "ax-loading", inputs: ["visible", "type", "context"], outputs: ["visibleChange"] }, { kind: "ngmodule", type: AXBadgeModule }, { kind: "component", type: i1$1.AXBadgeComponent, selector: "ax-badge", inputs: ["color", "look", "text"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
5500
+ `, 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 }); }
5115
5501
  }
5116
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPLookupWidgetViewComponent, decorators: [{
5502
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPLookupWidgetViewComponent, decorators: [{
5117
5503
  type: Component,
5118
5504
  args: [{
5119
5505
  selector: 'axp-lookup-widget-view',
@@ -5149,383 +5535,193 @@ var lookupWidgetView_component = /*#__PURE__*/Object.freeze({
5149
5535
  AXPLookupWidgetViewComponent: AXPLookupWidgetViewComponent
5150
5536
  });
5151
5537
 
5152
- class AXPLookupWidgetSelectorComponent extends AXBasePageComponent {
5538
+ //#endregion
5539
+ class AXPEntityDataSelectorService {
5153
5540
  constructor() {
5154
- super(...arguments);
5155
- this.grid = viewChild('grid', ...(ngDevMode ? [{ debugName: "grid" }] : []));
5156
- this.initialSelectedItems = [];
5157
- this.selectedItems = signal([], ...(ngDevMode ? [{ debugName: "selectedItems" }] : []));
5158
- this.allowSelect = computed(() => this.selectedItems().length > 0, ...(ngDevMode ? [{ debugName: "allowSelect" }] : []));
5541
+ //#region ---- Services & Dependencies ----
5542
+ this.dataSelectorService = inject(AXPDataSelectorService);
5543
+ this.filterOperatorMiddleware = inject(AXPFilterOperatorMiddlewareService);
5544
+ this.widgetResolver = inject(AXPWidgetRegistryService);
5159
5545
  }
5160
- ngAfterViewInit() {
5161
- if (this.initialSelectedItems.length > 0 && this.grid()) {
5162
- this.grid()?.selectRows(...this.initialSelectedItems);
5163
- }
5164
- if (this.searchTerm) {
5165
- this.vm.applyInlineFilter(this.searchTerm);
5166
- }
5167
- else {
5168
- this.vm.applyFilterAndSort();
5169
- }
5546
+ //#endregion
5547
+ //#region ---- Public Methods ----
5548
+ /**
5549
+ * Open entity data selector popup
5550
+ */
5551
+ async open(options) {
5552
+ const config = this.createDataSelectorConfig(options);
5553
+ const result = await this.dataSelectorService.open(config);
5554
+ return result;
5170
5555
  }
5171
- handleRowDbClick(e) {
5172
- this.close({ items: [e.data] });
5556
+ /**
5557
+ * Open entity data selector with category filter
5558
+ */
5559
+ async openWithCategoryFilter(options, categoryFilterConfig) {
5560
+ const config = this.createDataSelectorConfig({
5561
+ ...options,
5562
+ allowCreate: false
5563
+ });
5564
+ // Add category filter to config
5565
+ config.categoryFilter = {
5566
+ enabled: true,
5567
+ ...categoryFilterConfig
5568
+ };
5569
+ const result = await this.dataSelectorService.open(config);
5570
+ return result;
5173
5571
  }
5174
- handleRowClick(e) {
5175
- if (this.vm.allowMultiple()) {
5176
- this.selectedItems.set([...this.selectedItems(), e.data]);
5177
- }
5178
- else if (this.selectedItems().length > 0) {
5179
- const selected = this.selectedItems().find((item) => item.id === e.data.id);
5180
- if (selected) {
5181
- this.selectedItems.set(this.selectedItems().filter((item) => item.id !== selected.id));
5182
- }
5183
- else {
5184
- this.selectedItems.set([e.data]);
5185
- }
5186
- }
5187
- else if (this.selectedItems().length === 0) {
5188
- this.selectedItems.set([e.data]);
5189
- }
5190
- else {
5191
- this.selectedItems.set([e.data]);
5192
- }
5193
- }
5194
- async handleSelectedRowsChange(rows) {
5195
- this.selectedItems.set(rows);
5572
+ //#endregion
5573
+ //#region ---- Private Methods ----
5574
+ /**
5575
+ * Create data selector configuration from entity options
5576
+ */
5577
+ createDataSelectorConfig(options) {
5578
+ const dataSource = this.createDataSource(options);
5579
+ const columns = this.createColumns(options);
5580
+ const searchFields = this.getSearchFields(options);
5581
+ return {
5582
+ title: options.title,
5583
+ dataSource,
5584
+ columns,
5585
+ selectionMode: options.allowMultiple ? 'multiple' : 'single',
5586
+ searchFields,
5587
+ parentField: options.entity.parentKey,
5588
+ allowCreate: options.allowCreate ?? this.canCreate(options.entity),
5589
+ // Note: Custom filters will be applied to the dataSource in createDataSource
5590
+ };
5196
5591
  }
5197
- handleChangeSearchValue(e) {
5198
- if (e.isUserInteraction) {
5199
- this.vm.applyInlineFilter(e.value);
5200
- }
5201
- }
5202
- async handleCreateNewClick() {
5203
- this.close();
5204
- await this.vm.create();
5205
- }
5206
- handleCloseClick() {
5207
- this.close();
5208
- }
5209
- handleSelectClick() {
5210
- this.close({ items: this.selectedItems() });
5211
- }
5212
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPLookupWidgetSelectorComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
5213
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.6", type: AXPLookupWidgetSelectorComponent, isStandalone: true, selector: "ng-component", viewQueries: [{ propertyName: "grid", first: true, predicate: ["grid"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: `
5214
- <div class="ax-p-4 ax-flex ax-flex-col ax-gap-4 ax-overflow-hidden">
5215
- @if (vm.hasInlineFilters()) {
5216
- <div class="ax-w-full">
5217
- <ax-search-box
5218
- [placeholder]="('widget.lookup.search' | translate | async) + vm.inlineFiltersPlaceholders().join(', ')"
5219
- [value]="searchTerm"
5220
- (onValueChanged)="handleChangeSearchValue($event)"
5221
- [axAutoFocus]="true"
5222
- ><ax-clear-button></ax-clear-button
5223
- ></ax-search-box>
5224
- </div>
5225
- }
5226
- <ax-data-table
5227
- #grid
5228
- [showFooter]="false"
5229
- class="ax-h-[50vh]"
5230
- [paging]="true"
5231
- [fetchDataMode]="'manual'"
5232
- [loading]="{ enabled: true, animation: true }"
5233
- [dataSource]="vm.dataSource"
5234
- [parentField]="vm.parentKey()"
5235
- (selectedRowsChange)="handleSelectedRowsChange($event)"
5236
- (onRowClick)="handleRowClick($event)"
5237
- (onRowDbClick)="handleRowDbClick($event)"
5238
- >
5239
- @if (vm.allowMultiple()) {
5240
- <ax-select-column fixed="start" [width]="'50px'"></ax-select-column>
5241
- }
5242
- @for (col of vm.columns(); track col.name) {
5243
- @if (col.visible) {
5244
- <axp-widget-column-renderer
5245
- [expandHandler]="$index === 0 && vm.parentKey() ? true : false"
5246
- [caption]="col.title | translate | async"
5247
- [node]="col.node()"
5248
- ></axp-widget-column-renderer>
5249
- }
5250
- }
5251
- </ax-data-table>
5252
- </div>
5253
- <ax-footer>
5254
- <ax-suffix>
5255
- <ax-button look="solid" [text]="('close' | translate | async)!" (onClick)="handleCloseClick()"> </ax-button>
5256
- <ax-button
5257
- look="solid"
5258
- color="primary"
5259
- [text]="('select' | translate | async)!"
5260
- (onClick)="handleSelectClick()"
5261
- [disabled]="allowSelect() === false"
5262
- >
5263
- </ax-button>
5264
- @if (!vm.canCreate()) {
5265
- <ax-button
5266
- look="solid"
5267
- color="primary"
5268
- [text]="'Create-New' | translate | async"
5269
- (onClick)="handleCreateNewClick()"
5270
- >
5271
- <ax-prefix>
5272
- <ax-icon icon="fa-solid fa-add"></ax-icon>
5273
- </ax-prefix>
5274
- </ax-button>
5275
- }
5276
- </ax-suffix>
5277
- </ax-footer>
5278
- `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: AXCommonModule }, { kind: "directive", type: i1$2.AXAutoFocusDirective, selector: "[axAutoFocus]", inputs: ["axAutoFocus", "axAutoFocusTime"] }, { kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i3$1.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: AXFormModule }, { 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: AXDropdownButtonModule }, { kind: "ngmodule", type: AXDataTableModule }, { kind: "component", type: i4$1.AXDataTableComponent, selector: "ax-data-table", inputs: ["dataSource", "selectedRows", "parentField", "rowTemplate", "emptyTemplate", "noDataTemplate", "alternative", "showHeader", "fixedHeader", "showFooter", "fixedFooter", "itemHeight", "allowReordering", "paging", "fetchDataMode", "loading", "focusedRow"], outputs: ["selectedRowsChange", "focusedRowChange", "onRowClick", "onRowDbClick", "onColumnsOrderChanged", "onColumnSizeChanged", "onPageChanged"] }, { kind: "component", type: i4$1.AXRowSelectColumnComponent, selector: "ax-select-column", inputs: ["width", "caption", "fixed"] }, { kind: "ngmodule", type: AXSearchBoxModule }, { kind: "component", type: i5.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: "ngmodule", type: AXPLayoutBuilderModule }, { kind: "component", type: i2.AXPWidgetColumnRendererComponent, selector: "axp-widget-column-renderer", inputs: ["caption", "customExpandIcon", "customCollapseIcon", "customWidth", "node", "footerTemplate", "expandHandler", "cellTemplate", "headerTemplate"] }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "pipe", type: i7.AsyncPipe, name: "async" }, { kind: "pipe", type: i8.AXTranslatorPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
5279
- }
5280
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPLookupWidgetSelectorComponent, decorators: [{
5281
- type: Component,
5282
- args: [{
5283
- template: `
5284
- <div class="ax-p-4 ax-flex ax-flex-col ax-gap-4 ax-overflow-hidden">
5285
- @if (vm.hasInlineFilters()) {
5286
- <div class="ax-w-full">
5287
- <ax-search-box
5288
- [placeholder]="('widget.lookup.search' | translate | async) + vm.inlineFiltersPlaceholders().join(', ')"
5289
- [value]="searchTerm"
5290
- (onValueChanged)="handleChangeSearchValue($event)"
5291
- [axAutoFocus]="true"
5292
- ><ax-clear-button></ax-clear-button
5293
- ></ax-search-box>
5294
- </div>
5295
- }
5296
- <ax-data-table
5297
- #grid
5298
- [showFooter]="false"
5299
- class="ax-h-[50vh]"
5300
- [paging]="true"
5301
- [fetchDataMode]="'manual'"
5302
- [loading]="{ enabled: true, animation: true }"
5303
- [dataSource]="vm.dataSource"
5304
- [parentField]="vm.parentKey()"
5305
- (selectedRowsChange)="handleSelectedRowsChange($event)"
5306
- (onRowClick)="handleRowClick($event)"
5307
- (onRowDbClick)="handleRowDbClick($event)"
5308
- >
5309
- @if (vm.allowMultiple()) {
5310
- <ax-select-column fixed="start" [width]="'50px'"></ax-select-column>
5311
- }
5312
- @for (col of vm.columns(); track col.name) {
5313
- @if (col.visible) {
5314
- <axp-widget-column-renderer
5315
- [expandHandler]="$index === 0 && vm.parentKey() ? true : false"
5316
- [caption]="col.title | translate | async"
5317
- [node]="col.node()"
5318
- ></axp-widget-column-renderer>
5319
- }
5320
- }
5321
- </ax-data-table>
5322
- </div>
5323
- <ax-footer>
5324
- <ax-suffix>
5325
- <ax-button look="solid" [text]="('close' | translate | async)!" (onClick)="handleCloseClick()"> </ax-button>
5326
- <ax-button
5327
- look="solid"
5328
- color="primary"
5329
- [text]="('select' | translate | async)!"
5330
- (onClick)="handleSelectClick()"
5331
- [disabled]="allowSelect() === false"
5332
- >
5333
- </ax-button>
5334
- @if (!vm.canCreate()) {
5335
- <ax-button
5336
- look="solid"
5337
- color="primary"
5338
- [text]="'Create-New' | translate | async"
5339
- (onClick)="handleCreateNewClick()"
5340
- >
5341
- <ax-prefix>
5342
- <ax-icon icon="fa-solid fa-add"></ax-icon>
5343
- </ax-prefix>
5344
- </ax-button>
5345
- }
5346
- </ax-suffix>
5347
- </ax-footer>
5348
- `,
5349
- changeDetection: ChangeDetectionStrategy.OnPush,
5350
- imports: [
5351
- CommonModule,
5352
- AXCommonModule,
5353
- AXButtonModule,
5354
- AXFormModule,
5355
- AXDecoratorModule,
5356
- AXDropdownButtonModule,
5357
- AXDataTableModule,
5358
- AXSearchBoxModule,
5359
- AXPLayoutBuilderModule,
5360
- AXTranslationModule,
5361
- ],
5362
- inputs: [],
5363
- }]
5364
- }] });
5365
-
5366
- class AXPLookupWidgetSelectorViewModel {
5367
- constructor(injector, entityDef, options = {
5368
- parentFilters: null,
5369
- customFilter: null,
5370
- sortedFields: [],
5371
- columns: [],
5372
- }) {
5373
- this.injector = injector;
5374
- this.entityDef = entityDef;
5375
- this.options = options;
5376
- this.workflow = this.injector.get(AXPWorkflowService);
5377
- this.filterOperatorMiddleware = this.injector.get(AXPFilterOperatorMiddlewareService);
5378
- this.widgetResolver = this.injector.get(AXPWidgetRegistryService);
5379
- this.dataSource = new AXDataSource({
5592
+ /**
5593
+ * Create data source from entity definition
5594
+ */
5595
+ createDataSource(options) {
5596
+ const { entity, customFilter, parentFilters } = options;
5597
+ return new AXDataSource({
5380
5598
  byKey: (key) => {
5381
- const func = this.entityDef.queries.byKey.execute;
5599
+ const func = entity.queries.byKey.execute;
5382
5600
  return func();
5383
5601
  },
5384
5602
  load: (e) => {
5385
- const func = this.entityDef.queries.list?.execute;
5386
- this.mergeFilter(e, this.options.customFilter);
5603
+ const func = entity.queries.list?.execute;
5604
+ this.mergeFilters(e, customFilter, parentFilters);
5387
5605
  return func(e);
5388
5606
  },
5389
5607
  pageSize: 10,
5390
5608
  key: 'id',
5391
5609
  });
5392
- this.canCreate = computed(() => {
5393
- return this.entityDef.commands?.create?.execute != null;
5394
- }, ...(ngDevMode ? [{ debugName: "canCreate" }] : []));
5395
- this.parentKey = computed(() => {
5396
- return this.entityDef.parentKey;
5397
- }, ...(ngDevMode ? [{ debugName: "parentKey" }] : []));
5398
- this.allowMultiple = computed(() => {
5399
- return this.options.allowMultiple ?? false;
5400
- }, ...(ngDevMode ? [{ debugName: "allowMultiple" }] : []));
5401
- this.inlineFiltersPlaceholders = computed(() => {
5402
- return (this.entityDef?.properties.filter((p) => p.options?.filter?.inline?.enabled).map((c) => c.title ?? c.name) ?? []);
5403
- }, ...(ngDevMode ? [{ debugName: "inlineFiltersPlaceholders" }] : []));
5404
- this.hasInlineFilters = computed(() => {
5405
- return this.inlineFiltersPlaceholders().length > 0;
5406
- }, ...(ngDevMode ? [{ debugName: "hasInlineFilters" }] : []));
5407
- this.columns = () => {
5408
- const { columns = [], properties } = this.entityDef;
5409
- const visibleProperties = properties.filter(({ schema }) => !schema?.hidden);
5410
- const visiblePropNames = new Set(visibleProperties.map(({ name }) => name));
5411
- return columns
5412
- .filter(({ name, showAs }) => visiblePropNames.has(name) || showAs)
5413
- .filter(({ name }) => ((this.options.columns?.length ?? 0) == 0) || this.options.columns?.includes(name))
5414
- .map((column) => {
5415
- if (column.showAs) {
5416
- const widgetConfig = this.widgetResolver.resolve(column.showAs.type);
5417
- const property = {
5418
- ...widgetConfig,
5419
- name: column.name,
5420
- title: column.title ?? '',
5421
- schema: {
5422
- dataType: 'string',
5423
- interface: {
5424
- type: column.showAs.type,
5425
- options: column.showAs.options,
5426
- },
5610
+ }
5611
+ /**
5612
+ * Create columns configuration from entity definition
5613
+ */
5614
+ createColumns(options) {
5615
+ const { entity, columns = [] } = options;
5616
+ const { columns: entityColumns = [], properties } = entity;
5617
+ const visibleProperties = properties.filter(({ schema }) => !schema?.hidden);
5618
+ const visiblePropNames = new Set(visibleProperties.map(({ name }) => name));
5619
+ return entityColumns
5620
+ .filter(({ name, showAs }) => visiblePropNames.has(name) || showAs)
5621
+ .filter(({ name }) => columns.length === 0 || columns.includes(name))
5622
+ .map((column) => {
5623
+ let property;
5624
+ let widgetType;
5625
+ let widgetOptions;
5626
+ if (column.showAs) {
5627
+ // Use custom column configuration
5628
+ const widgetConfig = this.widgetResolver.resolve(column.showAs.type);
5629
+ property = {
5630
+ ...widgetConfig,
5631
+ name: column.name,
5632
+ title: column.title ?? '',
5633
+ schema: {
5634
+ dataType: 'string',
5635
+ interface: {
5636
+ type: column.showAs.type,
5637
+ options: column.showAs.options,
5427
5638
  },
5428
- };
5429
- return new AXPEntityListViewColumnViewModel(property, column);
5430
- }
5431
- else {
5432
- const property = visibleProperties.find(({ name }) => name === column.name);
5433
- return new AXPEntityListViewColumnViewModel(property, column);
5639
+ },
5640
+ };
5641
+ widgetType = column.showAs.type;
5642
+ widgetOptions = column.showAs.options;
5643
+ }
5644
+ else {
5645
+ // Use entity property configuration
5646
+ property = visibleProperties.find(({ name }) => name === column.name);
5647
+ widgetType = property.schema?.interface?.type || 'text';
5648
+ widgetOptions = property.schema?.interface?.options || {};
5649
+ }
5650
+ return {
5651
+ name: column.name,
5652
+ title: property.title || column.title || column.name,
5653
+ visible: true,
5654
+ widget: {
5655
+ type: widgetType,
5656
+ options: widgetOptions
5434
5657
  }
5435
- });
5436
- };
5437
- this.inlineFilters = {
5438
- field: null,
5439
- logic: 'or',
5440
- operator: null,
5441
- filters: [],
5442
- };
5443
- this.advanceFilters = {
5444
- field: null,
5445
- logic: 'and',
5446
- operator: null,
5447
- filters: [],
5448
- };
5449
- }
5450
- async create() {
5451
- await this.workflow.execute('create-entity', {
5452
- entity: getEntityInfo(this.entityDef).source,
5658
+ };
5453
5659
  });
5454
5660
  }
5455
- applyInlineFilter(value, refresh = true) {
5456
- const props = this.entityDef.properties.filter((c) => c.options?.filter?.inline?.enabled);
5457
- this.inlineFilters.filters = [];
5458
- if (value) {
5459
- props.forEach((p) => {
5460
- this.inlineFilters.filters?.push({
5461
- field: p.name,
5462
- operator: {
5463
- type: 'contains',
5464
- },
5465
- value,
5466
- });
5467
- });
5661
+ /**
5662
+ * Get searchable fields from entity properties
5663
+ */
5664
+ getSearchFields(options) {
5665
+ const { entity, searchFields } = options;
5666
+ if (searchFields && searchFields.length > 0) {
5667
+ return searchFields;
5468
5668
  }
5469
- if (refresh)
5470
- this.applyFilterAndSort();
5669
+ // Auto-detect searchable fields from entity properties
5670
+ return entity.properties
5671
+ .filter(p => p.options?.filter?.inline?.enabled)
5672
+ .map(p => p.name);
5471
5673
  }
5472
- applyFilterAndSort() {
5473
- // this.dataSource.clearFilter();
5474
- //
5475
- //this.dataSource.sort(...this.sortedFields().map(s => ({ dir: s.dir, field: s.name } as AXDataSourceSortOption)));
5476
- //
5477
- // Check if inlineFilters or parentFilters have any filters
5478
- const hasInlineFilters = (this.inlineFilters?.filters?.length ?? 0) > 0;
5479
- const hasParentFilters = (this.options.parentFilters?.filters?.length ?? 0) > 0;
5480
- // Construct the filters array based on the presence of filters
5674
+ /**
5675
+ * Check if entity supports create operation
5676
+ */
5677
+ canCreate(entity) {
5678
+ return entity.commands?.create?.execute != null;
5679
+ }
5680
+ /**
5681
+ * Merge custom and parent filters into data source query
5682
+ */
5683
+ mergeFilters(request, customFilter, parentFilters) {
5684
+ if (!customFilter && !parentFilters) {
5685
+ return request;
5686
+ }
5481
5687
  const filters = [];
5482
- if (this.options.customFilter) {
5483
- const cleanedFilters = AXPCleanNestedFilters([this.options.customFilter]);
5688
+ // Add custom filter
5689
+ if (customFilter) {
5690
+ const cleanedFilters = AXPCleanNestedFilters([customFilter]);
5484
5691
  if (cleanedFilters.length > 0) {
5485
5692
  filters.push(this.filterOperatorMiddleware.transformFilter(cleanedFilters[0]));
5486
5693
  }
5487
5694
  }
5488
- if (hasInlineFilters) {
5489
- filters.push(this.inlineFilters);
5490
- }
5491
- if (hasParentFilters && this.options.parentFilters) {
5492
- filters.push(this.options.parentFilters);
5493
- }
5494
- // Apply the filters to the dataSource
5495
- this.dataSource.filter({
5496
- field: null,
5497
- logic: 'and',
5498
- operator: null,
5499
- filters: filters,
5500
- });
5501
- // Refresh the dataSource
5502
- this.dataSource.refresh();
5503
- }
5504
- async find(value) {
5505
- this.applyInlineFilter(value.trim(), false);
5506
- const func = this.entityDef.queries.list?.execute;
5507
- return (await func({ filter: this.inlineFilters, take: 10 })) ?? [];
5508
- }
5509
- setCustomFilter(filter) {
5510
- this.options.customFilter = filter;
5511
- this.applyFilterAndSort();
5512
- }
5513
- mergeFilter(request, filter) {
5514
- if (!filter) {
5515
- return request;
5695
+ // Add parent filters
5696
+ if (parentFilters) {
5697
+ filters.push(parentFilters);
5516
5698
  }
5699
+ // Merge with existing filter
5517
5700
  if (request.filter) {
5518
5701
  request.filter = {
5519
5702
  logic: 'and',
5520
- filters: [...[request.filter], ...(filter.filters ?? [])]
5703
+ filters: [...[request.filter], ...filters]
5521
5704
  };
5522
5705
  }
5523
5706
  else {
5524
- request.filter = filter;
5707
+ request.filter = {
5708
+ field: null,
5709
+ logic: 'and',
5710
+ operator: null,
5711
+ filters: filters,
5712
+ };
5525
5713
  }
5526
5714
  return request;
5527
5715
  }
5716
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPEntityDataSelectorService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
5717
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPEntityDataSelectorService, providedIn: 'root' }); }
5528
5718
  }
5719
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPEntityDataSelectorService, decorators: [{
5720
+ type: Injectable,
5721
+ args: [{
5722
+ providedIn: 'root'
5723
+ }]
5724
+ }] });
5529
5725
 
5530
5726
  class AXPLookupWidgetEditComponent extends AXPValueWidgetComponent {
5531
5727
  constructor() {
@@ -5534,6 +5730,7 @@ class AXPLookupWidgetEditComponent extends AXPValueWidgetComponent {
5534
5730
  this.entityResolver = inject(AXPEntityResolver);
5535
5731
  this.formatService = inject(AXFormatService);
5536
5732
  this.popupService = inject(AXPopupService);
5733
+ this.entityDataSelectorService = inject(AXPEntityDataSelectorService);
5537
5734
  this.translateService = inject(AXTranslationService);
5538
5735
  this.expose = computed(() => this.options()['expose'], ...(ngDevMode ? [{ debugName: "expose" }] : []));
5539
5736
  this.entity = computed(() => this.options()['entity'], ...(ngDevMode ? [{ debugName: "entity" }] : []));
@@ -5559,24 +5756,37 @@ class AXPLookupWidgetEditComponent extends AXPValueWidgetComponent {
5559
5756
  }, ...(ngDevMode ? [{ debugName: "selectedItemsText" }] : []));
5560
5757
  this.valueField = computed(() => this.entityDef()?.properties.find((c) => c.name == 'id')?.name ?? 'id', ...(ngDevMode ? [{ debugName: "valueField" }] : []));
5561
5758
  this.entityDef = signal(null, ...(ngDevMode ? [{ debugName: "entityDef" }] : []));
5759
+ this.dataSource = computed(() => {
5760
+ const entity = this.entityDef();
5761
+ if (!entity)
5762
+ return null;
5763
+ return new AXDataSource({
5764
+ byKey: (key) => {
5765
+ const func = entity.queries.byKey.execute;
5766
+ return func();
5767
+ },
5768
+ load: (e) => {
5769
+ const func = entity.queries.list?.execute;
5770
+ this.mergeFilter(e, this.customFilter());
5771
+ return func(e);
5772
+ },
5773
+ pageSize: 10,
5774
+ key: 'id',
5775
+ });
5776
+ }, ...(ngDevMode ? [{ debugName: "dataSource" }] : []));
5562
5777
  this.searchTerm = signal(null, ...(ngDevMode ? [{ debugName: "searchTerm" }] : []));
5563
5778
  this.selectedItems = signal([], ...(ngDevMode ? [{ debugName: "selectedItems" }] : []));
5564
5779
  this.textbox = viewChild(AXTagBoxComponent, ...(ngDevMode ? [{ debugName: "textbox" }] : []));
5565
5780
  this.isLoading = signal(false, ...(ngDevMode ? [{ debugName: "isLoading" }] : []));
5566
5781
  this.isOpen = signal(false, ...(ngDevMode ? [{ debugName: "isOpen" }] : []));
5567
- this.vm = signal(null, ...(ngDevMode ? [{ debugName: "vm" }] : []));
5568
5782
  this.placeholder = computed(() => {
5569
5783
  return this.selectedItems().length
5570
5784
  ? ''
5571
- : this.translateService.translateSync('widget.lookup.search') + this.vm()?.inlineFiltersPlaceholders().join(', ');
5785
+ : this.translateService.translateSync('@general:widgets.lookup.search');
5572
5786
  }, ...(ngDevMode ? [{ debugName: "placeholder" }] : []));
5573
5787
  this.#efEntity = effect(async () => {
5574
5788
  const [module, entity] = this.entity().split('.');
5575
5789
  this.entityDef.set(await this.entityResolver.get(module, entity));
5576
- this.vm.set(new AXPLookupWidgetSelectorViewModel(this.injector, this.entityDef(), {
5577
- parentFilters: this.filter,
5578
- allowMultiple: this.multiple(),
5579
- }));
5580
5790
  }, ...(ngDevMode ? [{ debugName: "#efEntity" }] : []));
5581
5791
  this.#efValue = effect(() => {
5582
5792
  if (this.getValue()) {
@@ -5586,15 +5796,9 @@ class AXPLookupWidgetEditComponent extends AXPValueWidgetComponent {
5586
5796
  this.clear();
5587
5797
  }
5588
5798
  }, ...(ngDevMode ? [{ debugName: "#efValue" }] : []));
5589
- this.#efCustomFilter = effect(() => {
5590
- if (this.customFilter()) {
5591
- this.vm()?.setCustomFilter(this.customFilter());
5592
- }
5593
- }, ...(ngDevMode ? [{ debugName: "#efCustomFilter" }] : []));
5594
5799
  }
5595
5800
  #efEntity;
5596
5801
  #efValue;
5597
- #efCustomFilter;
5598
5802
  async findByValue() {
5599
5803
  this.isLoading.set(true);
5600
5804
  const rawValue = this.getValue();
@@ -5619,31 +5823,29 @@ class AXPLookupWidgetEditComponent extends AXPValueWidgetComponent {
5619
5823
  handleOnClick(e) {
5620
5824
  this.showSelector();
5621
5825
  }
5622
- showSelector() {
5826
+ async showSelector() {
5623
5827
  this.isOpen.set(true);
5624
- const columnsCount = this.columns().length > 0 ? this.columns().length : (this.vm()?.columns().length ?? 0);
5625
- this.popupService
5626
- .open(AXPLookupWidgetSelectorComponent, {
5627
- title: `${this.translateService.translateSync('widget.lookup.search')} ${this.translateService.translateSync(this.entityDef()?.formats.plural ?? '')}`,
5628
- size: columnsCount < 3 ? 'md' : 'lg',
5629
- data: {
5630
- vm: new AXPLookupWidgetSelectorViewModel(this.injector, this.entityDef(), {
5631
- customFilter: this.customFilter(),
5632
- parentFilters: this.filter,
5633
- allowMultiple: this.multiple(),
5634
- columns: this.columns(),
5635
- }),
5636
- searchTerm: this.searchTerm(),
5637
- initialSelectedItems: this.selectedItems(),
5638
- },
5639
- })
5640
- .then((e) => {
5828
+ try {
5829
+ const result = await this.entityDataSelectorService.open({
5830
+ entity: this.entityDef(),
5831
+ title: `${this.translateService.translateSync('@general:widgets.lookup.search')} ${this.translateService.translateSync(this.entityDef()?.formats.plural ?? '')}`,
5832
+ allowMultiple: this.multiple(),
5833
+ customFilter: this.customFilter(),
5834
+ parentFilters: this.filter,
5835
+ columns: this.columns(),
5836
+ allowCreate: true
5837
+ });
5838
+ if (result && 'items' in result) {
5839
+ this.setItems(result.items);
5840
+ }
5841
+ }
5842
+ catch (error) {
5843
+ console.error('Error opening entity data selector:', error);
5844
+ }
5845
+ finally {
5641
5846
  this.isOpen.set(false);
5642
5847
  this.textbox()?.focus();
5643
- if (e.data?.items) {
5644
- this.setItems(e.data?.items);
5645
- }
5646
- });
5848
+ }
5647
5849
  }
5648
5850
  selectBoxValueChange(e) {
5649
5851
  const items = e.component.selectedItems;
@@ -5672,7 +5874,7 @@ class AXPLookupWidgetEditComponent extends AXPValueWidgetComponent {
5672
5874
  this.searchTerm.set(value);
5673
5875
  if ((keyEvent.code == 'Enter' || keyEvent.code == 'NumpadEnter') && value) {
5674
5876
  this.isLoading.set(true);
5675
- const result = await this.vm()?.find(value);
5877
+ const result = await this.searchByValue(value);
5676
5878
  if (result?.total == 1) {
5677
5879
  this.setItems(result.items[0]);
5678
5880
  }
@@ -5729,10 +5931,7 @@ class AXPLookupWidgetEditComponent extends AXPValueWidgetComponent {
5729
5931
  }
5730
5932
  refresh() {
5731
5933
  this.clear();
5732
- if (this.customFilter()) {
5733
- this.vm()?.setCustomFilter(this.customFilter());
5734
- }
5735
- this.vm()?.dataSource.refresh();
5934
+ this.dataSource()?.refresh();
5736
5935
  }
5737
5936
  clear() {
5738
5937
  this.setValue(null);
@@ -5743,15 +5942,53 @@ class AXPLookupWidgetEditComponent extends AXPValueWidgetComponent {
5743
5942
  this.textbox()?.inputValue.set('');
5744
5943
  this.searchTerm.set('');
5745
5944
  }
5945
+ async searchByValue(value) {
5946
+ if (!this.entityDef())
5947
+ return null;
5948
+ const entity = this.entityDef();
5949
+ const searchFields = entity.properties.filter(p => p.options?.filter?.inline?.enabled);
5950
+ const inlineFilters = {
5951
+ field: null,
5952
+ logic: 'or',
5953
+ operator: null,
5954
+ filters: [],
5955
+ };
5956
+ if (value && searchFields.length > 0) {
5957
+ searchFields.forEach((p) => {
5958
+ inlineFilters.filters?.push({
5959
+ field: p.name,
5960
+ operator: { type: 'contains' },
5961
+ value,
5962
+ });
5963
+ });
5964
+ }
5965
+ const func = entity.queries.list?.execute;
5966
+ return await func({ filter: inlineFilters, take: 10 });
5967
+ }
5968
+ mergeFilter(request, filter) {
5969
+ if (!filter) {
5970
+ return request;
5971
+ }
5972
+ if (request.filter) {
5973
+ request.filter = {
5974
+ logic: 'and',
5975
+ filters: [...[request.filter], ...(filter.filters ?? [])]
5976
+ };
5977
+ }
5978
+ else {
5979
+ request.filter = filter;
5980
+ }
5981
+ return request;
5982
+ }
5746
5983
  singleOrMultiple(values) {
5747
5984
  return this.multiple() ? values : values[0];
5748
5985
  }
5749
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPLookupWidgetEditComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
5750
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.6", 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: `
5751
- @if(vm()) {
5986
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPLookupWidgetEditComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
5987
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.8", 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: `
5988
+ @if(dataSource()) {
5752
5989
  @if (look() == 'select') {
5753
5990
  <ax-select-box
5754
- [dataSource]="vm()?.dataSource!"
5991
+ [dataSource]="dataSource()!"
5755
5992
  [ngModel]="selectedItems()"
5756
5993
  [textField]="displayField()"
5757
5994
  [valueField]="valueField()"
@@ -5814,19 +6051,19 @@ class AXPLookupWidgetEditComponent extends AXPValueWidgetComponent {
5814
6051
  </ax-tag-box>
5815
6052
  }
5816
6053
  }
5817
- `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type:
6054
+ `, 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:
5818
6055
  //
5819
- AXButtonModule }, { kind: "component", type: i3$1.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.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: AXLoadingModule }, { kind: "component", type: i1.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.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$1.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: i7.AsyncPipe, name: "async" }, { kind: "pipe", type: i8.AXTranslatorPipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
6056
+ 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 }); }
5820
6057
  }
5821
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPLookupWidgetEditComponent, decorators: [{
6058
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPLookupWidgetEditComponent, decorators: [{
5822
6059
  type: Component,
5823
6060
  args: [{
5824
6061
  selector: 'axp-lookup-widget-edit',
5825
6062
  template: `
5826
- @if(vm()) {
6063
+ @if(dataSource()) {
5827
6064
  @if (look() == 'select') {
5828
6065
  <ax-select-box
5829
- [dataSource]="vm()?.dataSource!"
6066
+ [dataSource]="dataSource()!"
5830
6067
  [ngModel]="selectedItems()"
5831
6068
  [textField]="displayField()"
5832
6069
  [valueField]="valueField()"
@@ -5916,12 +6153,85 @@ var lookupWidgetEdit_component = /*#__PURE__*/Object.freeze({
5916
6153
  class AXPLookupWidgetColumnComponent extends AXPColumnWidgetComponent {
5917
6154
  constructor() {
5918
6155
  super(...arguments);
6156
+ //#region ---- Dependencies ----
6157
+ this.entityDetailPopoverService = inject(AXPEntityDetailPopoverService);
6158
+ //#endregion
6159
+ //#region ---- View Children ----
6160
+ this.moreButton = viewChild('moreButton', ...(ngDevMode ? [{ debugName: "moreButton" }] : []));
6161
+ this.morePopover = viewChild('morePopover', ...(ngDevMode ? [{ debugName: "morePopover" }] : []));
6162
+ //#endregion
6163
+ //#region ---- Properties ----
6164
+ this.host = inject(ElementRef);
5919
6165
  this.valueField = this.options['valueField'] ?? 'id';
5920
6166
  this.textField = this.options['textField'] ?? 'title';
5921
- this.badgeClass = this.options['badgeClass'] ?? 'ax-accent1';
6167
+ this.entity = this.options['entity'] ?? 'title';
6168
+ this.columnName = this.options['columnName'] ?? 'title';
6169
+ this.maxVisible = this.options['maxVisible'] ?? 2;
6170
+ //#endregion
6171
+ //#region ---- Signals ----
6172
+ this.isMorePopoverOpen = signal(false, ...(ngDevMode ? [{ debugName: "isMorePopoverOpen" }] : []));
6173
+ this.selectedItemIndex = signal(-1, ...(ngDevMode ? [{ debugName: "selectedItemIndex" }] : []));
6174
+ //#endregion
6175
+ //#region ---- Computed Properties ----
5922
6176
  this.displayItems = computed(() => isNil(this.rawValue)
5923
6177
  ? []
5924
6178
  : castArray(this.rawValue).map((item) => this.extractItem(item)).filter((c) => c != null), ...(ngDevMode ? [{ debugName: "displayItems" }] : []));
6179
+ this.allItems = computed(() => this.displayItems(), ...(ngDevMode ? [{ debugName: "allItems" }] : []));
6180
+ this.visibleItems = computed(() => {
6181
+ const items = this.allItems();
6182
+ return items.slice(0, this.maxVisible);
6183
+ }, ...(ngDevMode ? [{ debugName: "visibleItems" }] : []));
6184
+ this.hasMoreItems = computed(() => {
6185
+ return this.allItems().length > this.maxVisible;
6186
+ }, ...(ngDevMode ? [{ debugName: "hasMoreItems" }] : []));
6187
+ this.remainingItemsCount = computed(() => {
6188
+ return this.allItems().length - this.maxVisible;
6189
+ }, ...(ngDevMode ? [{ debugName: "remainingItemsCount" }] : []));
6190
+ }
6191
+ //#endregion
6192
+ //#region ---- Public Methods ----
6193
+ showMoreItems() {
6194
+ this.entityDetailPopoverService.hide();
6195
+ this.openMorePopover();
6196
+ }
6197
+ onMorePopoverOpenChange(event) {
6198
+ this.isMorePopoverOpen.set(event);
6199
+ }
6200
+ async showItemDetail(item, index) {
6201
+ const columnData = this.rowData[this.columnName];
6202
+ const id = Array.isArray(columnData) ? columnData[index] : columnData;
6203
+ this.selectedItemIndex.set(index);
6204
+ this.closeMorePopover();
6205
+ // Show entity detail popover using the service
6206
+ await this.entityDetailPopoverService.show(this.host, {
6207
+ entity: this.entity,
6208
+ id: id,
6209
+ textField: this.textField,
6210
+ valueField: this.valueField,
6211
+ item
6212
+ });
6213
+ }
6214
+ handleItemClick(index) {
6215
+ const items = this.allItems();
6216
+ if (index < items.length) {
6217
+ const item = items[index];
6218
+ this.showItemDetail(item, index);
6219
+ }
6220
+ }
6221
+ //#endregion
6222
+ //#region ---- Private Methods ----
6223
+ openMorePopover() {
6224
+ if (this.morePopover() && this.moreButton()) {
6225
+ this.morePopover().target = this.moreButton().nativeElement;
6226
+ this.morePopover().open();
6227
+ this.isMorePopoverOpen.set(true);
6228
+ }
6229
+ }
6230
+ closeMorePopover() {
6231
+ if (this.morePopover()) {
6232
+ this.morePopover().close();
6233
+ this.isMorePopoverOpen.set(false);
6234
+ }
5925
6235
  }
5926
6236
  extractItem(item) {
5927
6237
  if (isNil(item)) {
@@ -5937,35 +6247,12 @@ class AXPLookupWidgetColumnComponent extends AXPColumnWidgetComponent {
5937
6247
  [this.textField]: item,
5938
6248
  };
5939
6249
  }
5940
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPLookupWidgetColumnComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
5941
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.6", type: AXPLookupWidgetColumnComponent, isStandalone: true, selector: "ng-component", inputs: { rawValue: "rawValue", rowData: "rowData" }, usesInheritance: true, ngImport: i0, template: `
5942
- <div class="ax-flex ax-gap-1">
5943
- @for (item of displayItems(); track $index) {
5944
- <ax-badge [text]="item[this.textField]" [class]="badgeClass"></ax-badge>
5945
- }
5946
- @empty {
5947
- <span class="ax-text-muted">---</span>
5948
- }
5949
- </div>
5950
- `, isInline: true, dependencies: [{ kind: "ngmodule", type: AXBadgeModule }, { kind: "component", type: i1$1.AXBadgeComponent, selector: "ax-badge", inputs: ["color", "look", "text"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
6250
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPLookupWidgetColumnComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
6251
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.8", 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 }); }
5951
6252
  }
5952
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPLookupWidgetColumnComponent, decorators: [{
6253
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPLookupWidgetColumnComponent, decorators: [{
5953
6254
  type: Component,
5954
- args: [{
5955
- template: `
5956
- <div class="ax-flex ax-gap-1">
5957
- @for (item of displayItems(); track $index) {
5958
- <ax-badge [text]="item[this.textField]" [class]="badgeClass"></ax-badge>
5959
- }
5960
- @empty {
5961
- <span class="ax-text-muted">---</span>
5962
- }
5963
- </div>
5964
- `,
5965
- changeDetection: ChangeDetectionStrategy.OnPush,
5966
- imports: [AXBadgeModule],
5967
- inputs: ['rawValue', 'rowData'],
5968
- }]
6255
+ 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" }]
5969
6256
  }] });
5970
6257
 
5971
6258
  var lookupWidgetColumn_component = /*#__PURE__*/Object.freeze({
@@ -6050,8 +6337,8 @@ class AXPTagableBoxWidgetColumnComponent extends AXPValueWidgetComponent {
6050
6337
  return Array.isArray(value) ? value : [value];
6051
6338
  }, ...(ngDevMode ? [{ debugName: "getData" }] : []));
6052
6339
  }
6053
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPTagableBoxWidgetColumnComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
6054
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.6", type: AXPTagableBoxWidgetColumnComponent, isStandalone: true, selector: "ng-component", usesInheritance: true, ngImport: i0, template: `
6340
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPTagableBoxWidgetColumnComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
6341
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.8", type: AXPTagableBoxWidgetColumnComponent, isStandalone: true, selector: "ng-component", usesInheritance: true, ngImport: i0, template: `
6055
6342
  <div class="ax-flex ax-gap-1 ax-flex-wrap">
6056
6343
  @if (useSelectBox() && getData().length > 0) { @for (item of getData(); track $index) {
6057
6344
  <ax-badge [look]="'twotone'" [text]="item[textField()]" color="primary"></ax-badge>
@@ -6061,9 +6348,9 @@ class AXPTagableBoxWidgetColumnComponent extends AXPValueWidgetComponent {
6061
6348
  <span class="ax-bg-slate-100 ax-px-2 ax-py-1 ax-rounded ax-inline-block">{{ internalValue()[0] }}</span>
6062
6349
  } }
6063
6350
  </div>
6064
- `, isInline: true, dependencies: [{ kind: "ngmodule", type: AXBadgeModule }, { kind: "component", type: i1$1.AXBadgeComponent, selector: "ax-badge", inputs: ["color", "look", "text"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
6351
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: AXBadgeModule }, { kind: "component", type: i1.AXBadgeComponent, selector: "ax-badge", inputs: ["color", "look", "text"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
6065
6352
  }
6066
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPTagableBoxWidgetColumnComponent, decorators: [{
6353
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPTagableBoxWidgetColumnComponent, decorators: [{
6067
6354
  type: Component,
6068
6355
  args: [{
6069
6356
  template: `
@@ -6126,8 +6413,8 @@ class AXPTagableBoxWidgetEditComponent extends AXPValueWidgetComponent {
6126
6413
  cls[`ax-flex-1`] = true;
6127
6414
  return cls;
6128
6415
  }
6129
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPTagableBoxWidgetEditComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
6130
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.6", type: AXPTagableBoxWidgetEditComponent, isStandalone: true, selector: "axp-tagable-box-widget", host: { properties: { "class": "this.__class" } }, usesInheritance: true, ngImport: i0, template: `
6416
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPTagableBoxWidgetEditComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
6417
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.8", type: AXPTagableBoxWidgetEditComponent, isStandalone: true, selector: "axp-tagable-box-widget", host: { properties: { "class": "this.__class" } }, usesInheritance: true, ngImport: i0, template: `
6131
6418
  <div class="ax-grid ax-grid-cols-12 ax-gap-4">
6132
6419
  <!-- نمایش Select Box با دکمه اضافه کردن آیتم -->
6133
6420
  <ax-select-box
@@ -6166,9 +6453,9 @@ class AXPTagableBoxWidgetEditComponent extends AXPValueWidgetComponent {
6166
6453
  </ax-prefix>
6167
6454
  </ax-button>
6168
6455
  </div>
6169
- `, isInline: true, dependencies: [{ kind: "ngmodule", type: AXTextBoxModule }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$3.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$1.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$1.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: i5.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 }); }
6456
+ `, 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 }); }
6170
6457
  }
6171
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPTagableBoxWidgetEditComponent, decorators: [{
6458
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPTagableBoxWidgetEditComponent, decorators: [{
6172
6459
  type: Component,
6173
6460
  args: [{
6174
6461
  selector: 'axp-tagable-box-widget',
@@ -6236,10 +6523,10 @@ var tagableBoxWidgetEdit_component = /*#__PURE__*/Object.freeze({
6236
6523
  });
6237
6524
 
6238
6525
  class AXPTagableBoxWidgetFilterComponent extends AXPValueWidgetComponent {
6239
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPTagableBoxWidgetFilterComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
6240
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.6", type: AXPTagableBoxWidgetFilterComponent, isStandalone: true, selector: "ng-component", usesInheritance: true, ngImport: i0, template: ``, isInline: true, dependencies: [{ kind: "ngmodule", type: FormsModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
6526
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPTagableBoxWidgetFilterComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
6527
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.8", type: AXPTagableBoxWidgetFilterComponent, isStandalone: true, selector: "ng-component", usesInheritance: true, ngImport: i0, template: ``, isInline: true, dependencies: [{ kind: "ngmodule", type: FormsModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
6241
6528
  }
6242
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPTagableBoxWidgetFilterComponent, decorators: [{
6529
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPTagableBoxWidgetFilterComponent, decorators: [{
6243
6530
  type: Component,
6244
6531
  args: [{
6245
6532
  template: ``,
@@ -6274,8 +6561,8 @@ class AXPTagableBoxWidgetPrintComponent extends AXPValueWidgetComponent {
6274
6561
  return Array.isArray(value) ? value : [value];
6275
6562
  }, ...(ngDevMode ? [{ debugName: "getData" }] : []));
6276
6563
  }
6277
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPTagableBoxWidgetPrintComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
6278
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.6", type: AXPTagableBoxWidgetPrintComponent, isStandalone: true, selector: "ng-component", usesInheritance: true, ngImport: i0, template: `
6564
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPTagableBoxWidgetPrintComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
6565
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.8", type: AXPTagableBoxWidgetPrintComponent, isStandalone: true, selector: "ng-component", usesInheritance: true, ngImport: i0, template: `
6279
6566
  <div>
6280
6567
  @if (useSelectBox() && getData().length > 0) { @for (item of getData(); track $index) {
6281
6568
  <span class="ax-bg-slate-100 ax-px-2 ax-py-1 ax-rounded ax-mr-2 ax-mb-2 ax-inline-block">{{
@@ -6291,7 +6578,7 @@ class AXPTagableBoxWidgetPrintComponent extends AXPValueWidgetComponent {
6291
6578
  </div>
6292
6579
  `, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
6293
6580
  }
6294
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPTagableBoxWidgetPrintComponent, decorators: [{
6581
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPTagableBoxWidgetPrintComponent, decorators: [{
6295
6582
  type: Component,
6296
6583
  args: [{
6297
6584
  template: `
@@ -6340,14 +6627,14 @@ class AXPTagableBoxWidgetViewComponent extends AXPValueWidgetComponent {
6340
6627
  return Array.isArray(value) ? value : [value];
6341
6628
  }, ...(ngDevMode ? [{ debugName: "getData" }] : []));
6342
6629
  }
6343
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPTagableBoxWidgetViewComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
6344
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.6", type: AXPTagableBoxWidgetViewComponent, isStandalone: true, selector: "axp-tagable-box-widget", usesInheritance: true, ngImport: i0, template: `
6630
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPTagableBoxWidgetViewComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
6631
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.8", type: AXPTagableBoxWidgetViewComponent, isStandalone: true, selector: "axp-tagable-box-widget", usesInheritance: true, ngImport: i0, template: `
6345
6632
  @for (item of internalValue(); track $index) {
6346
6633
  <ax-badge [look]="'twotone'" [text]="item" color="primary"></ax-badge>
6347
6634
  }
6348
- `, isInline: true, dependencies: [{ kind: "ngmodule", type: AXBadgeModule }, { kind: "component", type: i1$1.AXBadgeComponent, selector: "ax-badge", inputs: ["color", "look", "text"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
6635
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: AXBadgeModule }, { kind: "component", type: i1.AXBadgeComponent, selector: "ax-badge", inputs: ["color", "look", "text"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
6349
6636
  }
6350
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPTagableBoxWidgetViewComponent, decorators: [{
6637
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPTagableBoxWidgetViewComponent, decorators: [{
6351
6638
  type: Component,
6352
6639
  args: [{
6353
6640
  selector: 'axp-tagable-box-widget',
@@ -6443,8 +6730,8 @@ class AXPWidgetSelectorWidgetEditComponent extends AXPValueWidgetComponent {
6443
6730
  const widget = this.widgetRegisteryService.resolve(e.values.type);
6444
6731
  this.setValue({ title: widget?.title, ...e.values });
6445
6732
  }
6446
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPWidgetSelectorWidgetEditComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
6447
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.6", type: AXPWidgetSelectorWidgetEditComponent, isStandalone: true, selector: "ng-component", viewQueries: [{ propertyName: "textbox", first: true, predicate: AXTextBoxComponent, descendants: true }], usesInheritance: true, ngImport: i0, template: `
6733
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPWidgetSelectorWidgetEditComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
6734
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.8", type: AXPWidgetSelectorWidgetEditComponent, isStandalone: true, selector: "ng-component", viewQueries: [{ propertyName: "textbox", first: true, predicate: AXTextBoxComponent, descendants: true }], usesInheritance: true, ngImport: i0, template: `
6448
6735
  <ax-text-box [ngModel]="displayText()" [placeholder]="placeholder()" [readonly]="true">
6449
6736
  @for (validation of validationRules(); track $index) {
6450
6737
  <ax-validation-rule
@@ -6463,9 +6750,9 @@ class AXPWidgetSelectorWidgetEditComponent extends AXPValueWidgetComponent {
6463
6750
  <axp-widget-property-viewer [widget]="selectedWidgetNode()!" (onChanged)="handleChangeWidget($event)">
6464
6751
  </axp-widget-property-viewer>
6465
6752
  }
6466
- `, isInline: true, dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$3.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$1.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.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: 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 }); }
6753
+ `, 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 }); }
6467
6754
  }
6468
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPWidgetSelectorWidgetEditComponent, decorators: [{
6755
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPWidgetSelectorWidgetEditComponent, decorators: [{
6469
6756
  type: Component,
6470
6757
  args: [{
6471
6758
  template: `
@@ -6512,10 +6799,10 @@ var widgetSelectorWidgetEdit_component = /*#__PURE__*/Object.freeze({
6512
6799
  });
6513
6800
 
6514
6801
  class AXPWidgetSelectorWidgetViewComponent extends AXPValueWidgetComponent {
6515
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPWidgetSelectorWidgetViewComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
6516
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.6", type: AXPWidgetSelectorWidgetViewComponent, isStandalone: true, selector: "ng-component", usesInheritance: true, ngImport: i0, template: `{{ getValue()?.title }}`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
6802
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPWidgetSelectorWidgetViewComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
6803
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.8", type: AXPWidgetSelectorWidgetViewComponent, isStandalone: true, selector: "ng-component", usesInheritance: true, ngImport: i0, template: `{{ getValue()?.title }}`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
6517
6804
  }
6518
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPWidgetSelectorWidgetViewComponent, decorators: [{
6805
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPWidgetSelectorWidgetViewComponent, decorators: [{
6519
6806
  type: Component,
6520
6807
  args: [{
6521
6808
  template: `{{ getValue()?.title }}`,
@@ -6574,7 +6861,7 @@ class AXPEntityCreatePopupAction extends AXPWorkflowAction {
6574
6861
  const result = await this.popupService.open(com, {
6575
6862
  title: headerTitle
6576
6863
  ? headerTitle
6577
- : `${await this.translateService.translateAsync('create-new')} ${await this.translateService.translateAsync(entityRef.formats.individual)}`,
6864
+ : `${await this.translateService.translateAsync('@general:actions.create.title')} ${await this.translateService.translateAsync(entityRef.formats.individual)}`,
6578
6865
  size: this.platform.is('Mobile') || this.platform.is('SM') ? 'full' : size ? size : 'md',
6579
6866
  data: {
6580
6867
  vm: await this.factory.create(module, entity, data, options),
@@ -6592,10 +6879,10 @@ class AXPEntityCreatePopupAction extends AXPWorkflowAction {
6592
6879
  }
6593
6880
  }
6594
6881
  }
6595
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPEntityCreatePopupAction, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
6596
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPEntityCreatePopupAction }); }
6882
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPEntityCreatePopupAction, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
6883
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPEntityCreatePopupAction }); }
6597
6884
  }
6598
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPEntityCreatePopupAction, decorators: [{
6885
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPEntityCreatePopupAction, decorators: [{
6599
6886
  type: Injectable
6600
6887
  }] });
6601
6888
  class AXPEntityCreateSubmittedAction extends AXPWorkflowAction {
@@ -6603,10 +6890,10 @@ class AXPEntityCreateSubmittedAction extends AXPWorkflowAction {
6603
6890
  this.dispatch(AXPEntityCreateEvent({ entity: context.getVariable('entity'), meta: context.getVariable('meta') }));
6604
6891
  this.dispatch(AXPRefreshEvent({ entity: context.getVariable('entity'), meta: context.getVariable('meta') }));
6605
6892
  }
6606
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPEntityCreateSubmittedAction, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
6607
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPEntityCreateSubmittedAction }); }
6893
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPEntityCreateSubmittedAction, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
6894
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPEntityCreateSubmittedAction }); }
6608
6895
  }
6609
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPEntityCreateSubmittedAction, decorators: [{
6896
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPEntityCreateSubmittedAction, decorators: [{
6610
6897
  type: Injectable
6611
6898
  }] });
6612
6899
  const AXPCreateEntityWorkflow = {
@@ -6697,10 +6984,10 @@ class AXPQuickEntityModifyPopupAction extends AXPWorkflowAction {
6697
6984
  context.setVariable('data', cloneDeep(popup.data.context));
6698
6985
  }
6699
6986
  }
6700
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPQuickEntityModifyPopupAction, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
6701
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPQuickEntityModifyPopupAction }); }
6987
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPQuickEntityModifyPopupAction, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
6988
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPQuickEntityModifyPopupAction }); }
6702
6989
  }
6703
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPQuickEntityModifyPopupAction, decorators: [{
6990
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPQuickEntityModifyPopupAction, decorators: [{
6704
6991
  type: Injectable
6705
6992
  }] });
6706
6993
  const AXPQuickModifyEntityWorkflow = {
@@ -6757,10 +7044,10 @@ class AXPEntityApplyUpdatesAction extends AXPWorkflowAction {
6757
7044
  context.setOutput('error', error);
6758
7045
  }
6759
7046
  }
6760
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPEntityApplyUpdatesAction, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
6761
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPEntityApplyUpdatesAction }); }
7047
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPEntityApplyUpdatesAction, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
7048
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPEntityApplyUpdatesAction }); }
6762
7049
  }
6763
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPEntityApplyUpdatesAction, decorators: [{
7050
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPEntityApplyUpdatesAction, decorators: [{
6764
7051
  type: Injectable
6765
7052
  }] });
6766
7053
 
@@ -6779,10 +7066,10 @@ class AXPShowDetailViewAction extends AXPWorkflowAction {
6779
7066
  context.setVariable('payload', newPayload);
6780
7067
  this.navigation.execute(context);
6781
7068
  }
6782
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPShowDetailViewAction, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
6783
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPShowDetailViewAction }); }
7069
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPShowDetailViewAction, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
7070
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPShowDetailViewAction }); }
6784
7071
  }
6785
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPShowDetailViewAction, decorators: [{
7072
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPShowDetailViewAction, decorators: [{
6786
7073
  type: Injectable
6787
7074
  }] });
6788
7075
  const AXPShowDetailsViewWorkflow = {
@@ -6836,10 +7123,10 @@ class AXPShowFileUploaderPopupAction extends AXPWorkflowAction {
6836
7123
  context.setVariable('data', cloneDeep(entityData));
6837
7124
  }
6838
7125
  }
6839
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPShowFileUploaderPopupAction, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
6840
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPShowFileUploaderPopupAction }); }
7126
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPShowFileUploaderPopupAction, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
7127
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPShowFileUploaderPopupAction }); }
6841
7128
  }
6842
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPShowFileUploaderPopupAction, decorators: [{
7129
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPShowFileUploaderPopupAction, decorators: [{
6843
7130
  type: Injectable
6844
7131
  }] });
6845
7132
  const AXPShowFileUploaderPopupWorkflow = {
@@ -6890,10 +7177,10 @@ class AXPShowListViewAction extends AXPWorkflowAction {
6890
7177
  context.setVariable('payload', newPayload);
6891
7178
  this.navigation.execute(context);
6892
7179
  }
6893
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPShowListViewAction, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
6894
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPShowListViewAction }); }
7180
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPShowListViewAction, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
7181
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPShowListViewAction }); }
6895
7182
  }
6896
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPShowListViewAction, decorators: [{
7183
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPShowListViewAction, decorators: [{
6897
7184
  type: Injectable
6898
7185
  }] });
6899
7186
  const AXPShowListViewWorkflow = {
@@ -6982,9 +7269,9 @@ class AXPEntityModule {
6982
7269
  },
6983
7270
  });
6984
7271
  }
6985
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPEntityModule, deps: [{ token: i1$4.AXPAppStartUpService }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.NgModule }); }
6986
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.1.6", ngImport: i0, type: AXPEntityModule, imports: [RouterModule, i2$2.AXPWorkflowModule, i2.AXPLayoutBuilderModule] }); }
6987
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPEntityModule, providers: [
7272
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPEntityModule, deps: [{ token: i1$2.AXPAppStartUpService }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.NgModule }); }
7273
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.1.8", ngImport: i0, type: AXPEntityModule, imports: [RouterModule, i2$2.AXPWorkflowModule, i3$1.AXPLayoutBuilderModule] }); }
7274
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPEntityModule, providers: [
6988
7275
  {
6989
7276
  provide: ROUTES,
6990
7277
  multi: true,
@@ -7008,7 +7295,17 @@ class AXPEntityModule {
7008
7295
  provideCommandSetups([
7009
7296
  {
7010
7297
  key: 'Entity:OpenDetails',
7011
- command: () => Promise.resolve().then(function () { return openEntityDetails_command; }).then((c) => c.AXPOpenEntityDetailsCommand)
7298
+ command: () => Promise.resolve().then(function () { return openEntityDetails_command; }).then((c) => c.AXPOpenEntityDetailsCommand),
7299
+ },
7300
+ {
7301
+ key: 'Entity:Create',
7302
+ command: () => import('./acorex-platform-layout-entity-create-entity.command-764ie8R8.mjs').then((c) => c.AXPCreateEntityCommand),
7303
+ },
7304
+ ]),
7305
+ provideQuerySetups([
7306
+ {
7307
+ key: 'Entity:GetDetails',
7308
+ loader: () => Promise.resolve().then(function () { return getEntityDetails_query; }).then((c) => c.AXPGetEntityDetailsQuery),
7012
7309
  },
7013
7310
  ]),
7014
7311
  ], imports: [RouterModule,
@@ -7049,7 +7346,7 @@ class AXPEntityModule {
7049
7346
  ],
7050
7347
  })] }); }
7051
7348
  }
7052
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPEntityModule, decorators: [{
7349
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPEntityModule, decorators: [{
7053
7350
  type: NgModule,
7054
7351
  args: [{
7055
7352
  imports: [
@@ -7117,69 +7414,514 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImpor
7117
7414
  provideCommandSetups([
7118
7415
  {
7119
7416
  key: 'Entity:OpenDetails',
7120
- command: () => Promise.resolve().then(function () { return openEntityDetails_command; }).then((c) => c.AXPOpenEntityDetailsCommand)
7417
+ command: () => Promise.resolve().then(function () { return openEntityDetails_command; }).then((c) => c.AXPOpenEntityDetailsCommand),
7418
+ },
7419
+ {
7420
+ key: 'Entity:Create',
7421
+ command: () => import('./acorex-platform-layout-entity-create-entity.command-764ie8R8.mjs').then((c) => c.AXPCreateEntityCommand),
7422
+ },
7423
+ ]),
7424
+ provideQuerySetups([
7425
+ {
7426
+ key: 'Entity:GetDetails',
7427
+ loader: () => Promise.resolve().then(function () { return getEntityDetails_query; }).then((c) => c.AXPGetEntityDetailsQuery),
7121
7428
  },
7122
7429
  ]),
7123
7430
  ],
7124
7431
  }]
7125
- }], ctorParameters: () => [{ type: i1$4.AXPAppStartUpService }, { type: i0.Injector }] });
7432
+ }], ctorParameters: () => [{ type: i1$2.AXPAppStartUpService }, { type: i0.Injector }] });
7433
+
7434
+ const eventDispatchMiddleware = {
7435
+ target: { ops: ['create', 'update', 'delete'], order: 90 },
7436
+ execute: async (ctx, next) => {
7437
+ const dispatcher = inject(AXPEntityEventDispatcherService);
7438
+ await next();
7439
+ if (ctx.op === 'create') {
7440
+ const createdData = ctx.result ? { ...ctx.data, id: ctx.result } : ctx.data;
7441
+ await dispatcher.dispatchInserted(ctx.entityName, { refType: ctx.entityName, data: createdData });
7442
+ }
7443
+ else if (ctx.op === 'update') {
7444
+ await dispatcher.dispatchUpdated(ctx.entityName, {
7445
+ refType: ctx.entityName,
7446
+ data: ctx.result,
7447
+ changes: ctx.locals.get('changes'),
7448
+ });
7449
+ }
7450
+ else if (ctx.op === 'delete') {
7451
+ // For delete, prefer previous entity if available
7452
+ await dispatcher.dispatchDeleted(ctx.entityName, { refType: ctx.entityName, data: ctx.result ?? ctx.previous });
7453
+ }
7454
+ },
7455
+ };
7126
7456
 
7127
7457
  //#endregion
7128
- //#region ---- Entity Open Details Command ----
7458
+ //#region ---- Get Entity Details Query ----
7129
7459
  /**
7130
- * Generic command to open entity details view
7131
- * Can be used by any entity to navigate to its detail page
7460
+ * Generic query to get entity details including entity definition and entity data
7461
+ * Can be used by any entity to retrieve its definition and data by ID
7132
7462
  */
7133
- class AXPOpenEntityDetailsCommand {
7463
+ class AXPGetEntityDetailsQuery {
7134
7464
  constructor() {
7135
- //#endregion
7136
7465
  //#region ---- Services & Dependencies ----
7137
- this.navigation = inject(AXPWorkflowNavigateAction);
7138
- this.sessionService = inject(AXPSessionService);
7466
+ this.entityDefinitionRegistry = inject(AXPEntityDefinitionRegistryService);
7467
+ this.injector = inject(Injector);
7139
7468
  }
7140
- //#endregion
7141
- //#region ---- Command Execution ----
7469
+ //#region ---- Query Execution ----
7142
7470
  /**
7143
- * Execute the command to navigate to entity details
7144
- * @param input - Command input containing entity and data information
7471
+ * Execute the query to fetch entity definition and data
7472
+ * @param input - Query input containing entity and ID information
7145
7473
  */
7146
- async execute(input) {
7147
- const { entity, data } = input;
7148
- if (!entity) {
7149
- throw new Error('Entity name is required for opening details view');
7474
+ async fetch(input) {
7475
+ const { entity, id } = input;
7476
+ try {
7477
+ if (!entity) {
7478
+ throw new Error('Entity name is required for fetching entity details');
7479
+ }
7480
+ if (!id) {
7481
+ throw new Error('Entity ID is required for fetching entity details');
7482
+ }
7483
+ const [module, entityName] = entity.split('.');
7484
+ if (!module || !entityName) {
7485
+ throw new Error('Entity must be in format "ModuleName.EntityName"');
7486
+ }
7487
+ // Get entity definition
7488
+ const entityDefinition = await this.entityDefinitionRegistry.resolve(module, entityName);
7489
+ // Get entity data using the entity's CRUD service
7490
+ const entityData = await this.getEntityData(entity, id);
7491
+ return {
7492
+ success: true,
7493
+ entityDefinition,
7494
+ entityData
7495
+ };
7150
7496
  }
7151
- if (!data?.id) {
7152
- throw new Error('Entity ID is required for opening details view');
7497
+ catch (error) {
7498
+ return {
7499
+ success: false,
7500
+ error: error instanceof Error ? error.message : 'Unknown error occurred'
7501
+ };
7153
7502
  }
7154
- const [module, entityName] = entity.split('.');
7155
- if (!module || !entityName) {
7156
- throw new Error('Entity must be in format "ModuleName.EntityName"');
7503
+ }
7504
+ //#endregion
7505
+ //#region ---- Private Methods ----
7506
+ /**
7507
+ * Get entity data using the entity's CRUD service
7508
+ * @param entity - Full entity path (ModuleName.EntityName)
7509
+ * @param id - Entity ID
7510
+ * @returns Promise resolving to entity data
7511
+ */
7512
+ async getEntityData(entity, id) {
7513
+ const dataService = runInInjectionContext(this.injector, () => new AXMEntityCrudServiceImpl(entity));
7514
+ try {
7515
+ // Fetch the entity data
7516
+ return await dataService.getOne(id);
7517
+ }
7518
+ catch (error) {
7519
+ throw new Error(`Failed to fetch entity data: ${error instanceof Error ? error.message : 'Unknown error'}`);
7157
7520
  }
7158
- const url = `/${this.sessionService.application?.name}/m/${module}/e/${entityName}/${data.id}/new-view`;
7159
- // Navigate to the entity details page
7160
- window.location.href = url;
7161
- return { success: true };
7162
7521
  }
7163
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPOpenEntityDetailsCommand, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
7164
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPOpenEntityDetailsCommand, providedIn: 'root' }); }
7522
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPGetEntityDetailsQuery, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
7523
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPGetEntityDetailsQuery, providedIn: 'root' }); }
7165
7524
  }
7166
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPOpenEntityDetailsCommand, decorators: [{
7525
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPGetEntityDetailsQuery, decorators: [{
7167
7526
  type: Injectable,
7168
7527
  args: [{ providedIn: 'root' }]
7169
7528
  }] });
7170
7529
 
7171
- var openEntityDetails_command = /*#__PURE__*/Object.freeze({
7530
+ var getEntityDetails_query = /*#__PURE__*/Object.freeze({
7172
7531
  __proto__: null,
7173
- AXPOpenEntityDetailsCommand: AXPOpenEntityDetailsCommand
7532
+ AXPGetEntityDetailsQuery: AXPGetEntityDetailsQuery
7174
7533
  });
7175
7534
 
7535
+ //#endregion
7536
+ class AXPEntityDynamicFormDialogService {
7537
+ constructor() {
7538
+ //#region ---- Services & Dependencies ----
7539
+ this.entityRegistry = inject(AXPEntityDefinitionRegistryService);
7540
+ this.formBuilder = inject(AXPDynamicFormBuilderService);
7541
+ this.layoutTheme = inject(AXPLayoutThemeService);
7542
+ }
7543
+ //#endregion
7544
+ //#region ---- Public API ----
7545
+ entity(fullName) {
7546
+ return new InterfaceSelector(this.entityRegistry, this.formBuilder, this.layoutTheme, fullName);
7547
+ }
7548
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPEntityDynamicFormDialogService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
7549
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPEntityDynamicFormDialogService, providedIn: 'root' }); }
7550
+ }
7551
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPEntityDynamicFormDialogService, decorators: [{
7552
+ type: Injectable,
7553
+ args: [{ providedIn: 'root' }]
7554
+ }] });
7555
+ //#region ---- Builders ----
7556
+ class InterfaceSelector {
7557
+ constructor(entityRegistry, formBuilder, layoutTheme, fullName) {
7558
+ this.entityRegistry = entityRegistry;
7559
+ this.formBuilder = formBuilder;
7560
+ this.layoutTheme = layoutTheme;
7561
+ this.fullName = fullName;
7562
+ }
7563
+ create() {
7564
+ return new PropertyFilter(this.entityRegistry, this.formBuilder, this.layoutTheme, this.fullName, 'create');
7565
+ }
7566
+ update(id) {
7567
+ return new PropertyFilter(this.entityRegistry, this.formBuilder, this.layoutTheme, this.fullName, 'update', id);
7568
+ }
7569
+ }
7570
+ class PropertyFilter {
7571
+ constructor(entityRegistry, formBuilder, layoutTheme, fullName, kind, recordId) {
7572
+ this.entityRegistry = entityRegistry;
7573
+ this.formBuilder = formBuilder;
7574
+ this.layoutTheme = layoutTheme;
7575
+ this.fullName = fullName;
7576
+ this.kind = kind;
7577
+ this.includeList = null;
7578
+ this.excludeList = null;
7579
+ this.initialContext = {};
7580
+ this.extraFieldsByGroup = new Map();
7581
+ this.recordId = recordId;
7582
+ }
7583
+ include(...propertyNames) {
7584
+ this.includeList = new Set(propertyNames.filter(Boolean));
7585
+ return this;
7586
+ }
7587
+ exclude(...propertyNames) {
7588
+ // Ignored when include list is present
7589
+ if (!this.includeList) {
7590
+ this.excludeList = new Set(propertyNames.filter(Boolean));
7591
+ }
7592
+ return this;
7593
+ }
7594
+ title(text) {
7595
+ this.overrideTitle = text;
7596
+ return this;
7597
+ }
7598
+ context(context) {
7599
+ this.initialContext = context ?? {};
7600
+ return this;
7601
+ }
7602
+ size(size) {
7603
+ this.externalSize = size;
7604
+ return this;
7605
+ }
7606
+ actions(delegate) {
7607
+ this.externalActionsDelegate = delegate;
7608
+ return this;
7609
+ }
7610
+ field(groupId, path, delegate) {
7611
+ const list = this.extraFieldsByGroup.get(groupId) ?? [];
7612
+ list.push({ path, delegate });
7613
+ this.extraFieldsByGroup.set(groupId, list);
7614
+ return this;
7615
+ }
7616
+ async show() {
7617
+ const { moduleName, entityName } = parseEntityFullName(this.fullName);
7618
+ const entity = await this.entityRegistry.resolve(moduleName, entityName);
7619
+ const iface = this.kind === 'create' ? entity?.interfaces?.master?.create : entity?.interfaces?.master?.update;
7620
+ if (!iface) {
7621
+ throw new Error(`Entity interface not found: ${entity.module}.${entity.name}.interfaces.master.${this.kind}`);
7622
+ }
7623
+ // Build dialog using DynamicFormBuilder
7624
+ const dialog = this.formBuilder.dialog();
7625
+ // Title and size
7626
+ const title = this.overrideTitle || entity.formats?.individual || entity.title || `${entity.module}.${entity.name}`;
7627
+ dialog.title(title);
7628
+ dialog.look('borderless');
7629
+ dialog.direction('grid');
7630
+ dialog.size(this.externalSize ?? (this.layoutTheme.isMobileDevice() ? 'full' : 'md'));
7631
+ dialog.closeButton(true);
7632
+ // Build groups and fields preserving interface section order
7633
+ const sections = (iface.sections ?? []).slice();
7634
+ const entityProps = (entity.properties ?? []).slice();
7635
+ const nameToViewLayout = buildViewLayoutMap(iface.properties ?? []);
7636
+ const allowedNames = this.computeAllowedNames(entityProps.map((p) => p.name));
7637
+ for (const section of sections) {
7638
+ const groupId = section.id;
7639
+ const groupProps = entityProps.filter((p) => p.groupId === groupId && allowedNames.has(p.name));
7640
+ const extraFields = this.extraFieldsByGroup.get(groupId) ?? [];
7641
+ if (groupProps.length === 0 && extraFields.length === 0) {
7642
+ continue;
7643
+ }
7644
+ dialog.group(groupId, (g) => {
7645
+ g.title((getGroupTitle(entity, groupId) || groupId));
7646
+ // Preserve properties order as defined in interface.properties (if present), otherwise entity.properties order
7647
+ const orderedProps = orderProperties(groupProps, iface.properties ?? []);
7648
+ for (const prop of orderedProps) {
7649
+ const viewLayout = nameToViewLayout.get(prop.name);
7650
+ const fieldPath = buildFieldPath(prop, iface.properties ?? []);
7651
+ g.field(fieldPath, (f) => {
7652
+ // Title & description
7653
+ f.title(prop.title);
7654
+ // Options (default/hidden/readonly/disabled)
7655
+ f.options({
7656
+ defaultValue: prop.schema?.defaultValue,
7657
+ hidden: prop.schema?.hidden,
7658
+ readonly: prop.schema?.readonly,
7659
+ disabled: false,
7660
+ });
7661
+ // Layout mapping (per-field). Only colSpan is supported by dynamic-form per breakpoint.
7662
+ const fieldLayout = toFieldLayout(viewLayout?.layout);
7663
+ if (fieldLayout) {
7664
+ f.layout(fieldLayout);
7665
+ }
7666
+ // Widget mapping (generic to allow all widget types)
7667
+ const widgetType = prop.schema?.interface?.type || '';
7668
+ const widgetOptions = buildWidgetOptions(prop);
7669
+ f.widget(widgetType, widgetOptions);
7670
+ });
7671
+ }
7672
+ // Append any extra fields requested by the caller for this group
7673
+ for (const extra of extraFields) {
7674
+ g.field(extra.path, extra.delegate);
7675
+ }
7676
+ });
7677
+ }
7678
+ // Actions: external if provided, otherwise default cancel/submit
7679
+ dialog.actions(this.externalActionsDelegate ?? ((a) => a.cancel().submit()));
7680
+ // Context: load record by id for update and merge with provided context (context overrides)
7681
+ let baseContext = {};
7682
+ if (this.kind === 'update') {
7683
+ if (!this.recordId && typeof this['recordId'] === 'undefined') {
7684
+ // Preserve back-compat if constructor arg wasn't captured
7685
+ this['recordId'] = undefined;
7686
+ }
7687
+ }
7688
+ try {
7689
+ if (this.kind === 'update') {
7690
+ const id = this['recordId'];
7691
+ if (!id) {
7692
+ throw new Error('Record id is required for update().');
7693
+ }
7694
+ const byKeyFn = entity?.queries?.byKey?.execute;
7695
+ if (typeof byKeyFn === 'function') {
7696
+ baseContext = (await byKeyFn(id)) ?? {};
7697
+ }
7698
+ }
7699
+ }
7700
+ catch {
7701
+ baseContext = baseContext ?? {};
7702
+ }
7703
+ const effectiveContext = merge({}, baseContext ?? {}, this.initialContext ?? {});
7704
+ dialog.context(effectiveContext);
7705
+ return await dialog.show();
7706
+ }
7707
+ computeAllowedNames(allNames) {
7708
+ if (this.includeList && this.includeList.size > 0) {
7709
+ return new Set(allNames.filter((n) => this.includeList.has(n)));
7710
+ }
7711
+ if (this.excludeList && this.excludeList.size > 0) {
7712
+ return new Set(allNames.filter((n) => !this.excludeList.has(n)));
7713
+ }
7714
+ return new Set(allNames);
7715
+ }
7716
+ }
7717
+ //#endregion
7718
+ //#region ---- Helpers ----
7719
+ // No extra action builders to keep API identical to dynamic-form-builder
7720
+ function parseEntityFullName(fullName) {
7721
+ const [moduleName, entityName] = (fullName || '').split('.');
7722
+ if (!moduleName || !entityName) {
7723
+ throw new Error(`Invalid entity full name: "${fullName}"`);
7724
+ }
7725
+ return { moduleName, entityName };
7726
+ }
7727
+ function buildViewLayoutMap(views) {
7728
+ const map = new Map();
7729
+ for (const v of views || []) {
7730
+ if (v?.name) {
7731
+ map.set(v.name, v);
7732
+ }
7733
+ }
7734
+ return map;
7735
+ }
7736
+ function orderProperties(props, viewProps) {
7737
+ if (!viewProps || viewProps.length === 0) {
7738
+ return props;
7739
+ }
7740
+ const orderIndex = new Map();
7741
+ viewProps.forEach((vp, idx) => orderIndex.set(vp.name, idx));
7742
+ return [...props].sort((a, b) => {
7743
+ const ai = orderIndex.has(a.name) ? orderIndex.get(a.name) : Number.MAX_SAFE_INTEGER;
7744
+ const bi = orderIndex.has(b.name) ? orderIndex.get(b.name) : Number.MAX_SAFE_INTEGER;
7745
+ if (ai !== bi)
7746
+ return ai - bi;
7747
+ return 0;
7748
+ });
7749
+ }
7750
+ function buildFieldPath(prop, viewProps) {
7751
+ const vp = (viewProps || []).find((x) => x.name === prop.name);
7752
+ const prefix = vp?.dataPath ? `${vp.dataPath}.` : '';
7753
+ return `${prefix}${prop.name}`;
7754
+ }
7755
+ function toFieldLayout(layout) {
7756
+ const positions = layout?.positions;
7757
+ if (!positions)
7758
+ return undefined;
7759
+ // Map AXPGridLayoutOptions -> AXPDynamicFormFieldDefinition['layout']
7760
+ const getSpan = (key) => positions?.[key]?.colSpan;
7761
+ const d = getSpan('default');
7762
+ const md = getSpan('md');
7763
+ const lg = getSpan('lg');
7764
+ const xl = getSpan('xl');
7765
+ const xxl = getSpan('xxl');
7766
+ if (d == null && md == null && lg == null && xl == null && xxl == null)
7767
+ return undefined;
7768
+ return {
7769
+ default: d,
7770
+ md,
7771
+ lg,
7772
+ xl,
7773
+ xxl,
7774
+ };
7775
+ }
7776
+ function buildWidgetOptions(prop) {
7777
+ const base = prop.schema?.interface?.options || {};
7778
+ const validations = (prop.validations || []).map((c) => ({
7779
+ rule: c.rule,
7780
+ message: c.message,
7781
+ options: c.options,
7782
+ }));
7783
+ return {
7784
+ ...base,
7785
+ validations,
7786
+ };
7787
+ }
7788
+ function getGroupTitle(entity, groupId) {
7789
+ const g = (entity.groups || []).find((x) => x.id === groupId);
7790
+ return g?.title;
7791
+ }
7792
+
7793
+ /**
7794
+ * Error type that can be thrown by middlewares to abort the chain with a structured payload.
7795
+ */
7796
+ class AXPMiddlewareAbortError extends Error {
7797
+ constructor(message, options = {}) {
7798
+ super(message);
7799
+ this.message = message;
7800
+ this.options = options;
7801
+ this.name = 'AXPMiddlewareAbortError';
7802
+ }
7803
+ toResponse() {
7804
+ return {
7805
+ success: false,
7806
+ error: {
7807
+ code: this.options.code,
7808
+ message: this.message,
7809
+ status: this.options.status,
7810
+ details: this.options.details,
7811
+ },
7812
+ };
7813
+ }
7814
+ }
7815
+ /** Type guard for AXPMiddlewareAbortError */
7816
+ function isAXPMiddlewareAbortError(error) {
7817
+ return error instanceof AXPMiddlewareAbortError;
7818
+ }
7819
+ //#endregion
7820
+
7821
+ const AXP_ENTITY_STORAGE_BACKEND = new InjectionToken('AXP_ENTITY_STORAGE_BACKEND');
7822
+ const AXP_ENTITY_STORAGE_MIDDLEWARE = new InjectionToken('AXP_ENTITY_STORAGE_MIDDLEWARE');
7823
+
7824
+ class AXPMiddlewareEntityStorageService extends AXPEntityStorageService {
7825
+ constructor() {
7826
+ super(...arguments);
7827
+ this.backend = inject(AXP_ENTITY_STORAGE_BACKEND);
7828
+ this.allMiddlewares = (inject(AXP_ENTITY_STORAGE_MIDDLEWARE, { optional: true }) || []).slice();
7829
+ this.injector = inject(EnvironmentInjector);
7830
+ }
7831
+ get dbName() {
7832
+ return this.backend.dbName;
7833
+ }
7834
+ filterMiddlewares(ctx) {
7835
+ return this.allMiddlewares
7836
+ .filter((mw) => {
7837
+ const t = mw.target;
7838
+ if (!t)
7839
+ return true;
7840
+ if (t.ops && !t.ops.includes(ctx.op))
7841
+ return false;
7842
+ if (t.entity) {
7843
+ if (typeof t.entity === 'string' && t.entity !== ctx.entityName)
7844
+ return false;
7845
+ if (t.entity instanceof RegExp && !t.entity.test(ctx.entityName))
7846
+ return false;
7847
+ }
7848
+ if (t.predicate && !t.predicate(ctx))
7849
+ return false;
7850
+ return true;
7851
+ })
7852
+ .sort((a, b) => (a.target?.order ?? 0) - (b.target?.order ?? 0));
7853
+ }
7854
+ compose(mws, leaf, ctx) {
7855
+ return mws
7856
+ .slice()
7857
+ .reverse()
7858
+ .reduce((next, mw) => {
7859
+ return async () => runInInjectionContext(this.injector, () => mw.execute(ctx, next));
7860
+ }, leaf);
7861
+ }
7862
+ async run(ctx, delegate) {
7863
+ const chain = this.compose(this.filterMiddlewares(ctx), async () => {
7864
+ ctx.result = await delegate();
7865
+ }, ctx);
7866
+ await chain();
7867
+ return ctx.result;
7868
+ }
7869
+ createCtx(op, entityName, init) {
7870
+ return {
7871
+ op,
7872
+ entityName,
7873
+ locals: new Map(),
7874
+ backend: {
7875
+ getOne: (name, id) => this.backend.getOne(name, id),
7876
+ insertOne: (name, e) => this.backend.insertOne(name, e),
7877
+ query: (name, request) => this.backend.query(name, request),
7878
+ updateOne: (name, id, data) => this.backend.updateOne(name, id, data),
7879
+ },
7880
+ ...init,
7881
+ };
7882
+ }
7883
+ async initial(entityName, collection, options) {
7884
+ const ctx = this.createCtx('initial', entityName, { data: collection });
7885
+ return this.run(ctx, () => this.backend.initial(entityName, ctx.data, options));
7886
+ }
7887
+ async getOne(entityName, id) {
7888
+ const ctx = this.createCtx('getOne', entityName, { id });
7889
+ return this.run(ctx, () => this.backend.getOne(entityName, id));
7890
+ }
7891
+ async updateOne(entityName, id, keyValues) {
7892
+ const ctx = this.createCtx('update', entityName, { id, data: keyValues });
7893
+ return this.run(ctx, () => this.backend.updateOne(entityName, id, ctx.data));
7894
+ }
7895
+ async deleteOne(entityName, id) {
7896
+ const ctx = this.createCtx('delete', entityName, { id });
7897
+ return this.run(ctx, () => this.backend.deleteOne(entityName, id));
7898
+ }
7899
+ async insertOne(entityName, entity) {
7900
+ const ctx = this.createCtx('create', entityName, { data: entity });
7901
+ return this.run(ctx, () => this.backend.insertOne(entityName, ctx.data));
7902
+ }
7903
+ async getAll(entityName) {
7904
+ const ctx = this.createCtx('getAll', entityName);
7905
+ return this.run(ctx, () => this.backend.getAll(entityName));
7906
+ }
7907
+ async query(entityName, request) {
7908
+ const ctx = this.createCtx('query', entityName, { request });
7909
+ return this.run(ctx, () => this.backend.query(entityName, request));
7910
+ }
7911
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPMiddlewareEntityStorageService, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
7912
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPMiddlewareEntityStorageService }); }
7913
+ }
7914
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPMiddlewareEntityStorageService, decorators: [{
7915
+ type: Injectable
7916
+ }] });
7917
+
7176
7918
  // #region Master
7177
7919
  function entityMasterCreateAction() {
7178
7920
  return {
7179
7921
  title: '@general:actions.create.title',
7180
7922
  command: 'create-entity',
7181
7923
  priority: 'primary',
7182
- type: 'create',
7924
+ type: AXPSystemActionType.Create,
7183
7925
  scope: AXPEntityCommandScope.TypeLevel,
7184
7926
  };
7185
7927
  }
@@ -7188,7 +7930,7 @@ function entityMasterBulkDeleteAction() {
7188
7930
  title: '@general:actions.delete-items.title',
7189
7931
  command: 'delete-entity',
7190
7932
  priority: 'primary',
7191
- type: 'delete',
7933
+ type: AXPSystemActionType.Delete,
7192
7934
  scope: AXPEntityCommandScope.Selected,
7193
7935
  };
7194
7936
  }
@@ -7197,7 +7939,7 @@ function entityMasterViewAction() {
7197
7939
  title: '@general:actions.view.title',
7198
7940
  command: 'open-entity',
7199
7941
  priority: 'secondary',
7200
- type: 'view',
7942
+ type: AXPSystemActionType.View,
7201
7943
  scope: AXPEntityCommandScope.Individual,
7202
7944
  default: true,
7203
7945
  };
@@ -7207,17 +7949,32 @@ function entityMasterDeleteAction() {
7207
7949
  title: '@general:actions.delete.title',
7208
7950
  command: 'delete-entity',
7209
7951
  priority: 'secondary',
7210
- type: 'delete',
7952
+ type: AXPSystemActionType.Delete,
7211
7953
  scope: AXPEntityCommandScope.Individual,
7212
7954
  };
7213
7955
  }
7214
- function entityMasterCrudActions() {
7215
- return [
7216
- entityMasterCreateAction(),
7217
- entityMasterBulkDeleteAction(),
7218
- entityMasterViewAction(),
7219
- entityMasterDeleteAction(),
7220
- ];
7956
+ function entityMasterCrudActions(options) {
7957
+ const opts = {
7958
+ create: true,
7959
+ delete: true,
7960
+ view: true,
7961
+ edit: true,
7962
+ ...options,
7963
+ };
7964
+ const actions = [];
7965
+ if (opts.create) {
7966
+ actions.push(entityMasterCreateAction());
7967
+ }
7968
+ if (opts.delete) {
7969
+ actions.push(entityMasterBulkDeleteAction());
7970
+ }
7971
+ if (opts.view) {
7972
+ actions.push(entityMasterViewAction());
7973
+ }
7974
+ if (opts.edit) {
7975
+ actions.push(entityMasterDeleteAction());
7976
+ }
7977
+ return actions;
7221
7978
  }
7222
7979
  function entityMasterRecordActions() {
7223
7980
  return [entityMasterDeleteAction()];
@@ -7240,7 +7997,7 @@ function entityDetailsCreateActions(parentId) {
7240
7997
  },
7241
7998
  },
7242
7999
  priority: 'primary',
7243
- type: 'create',
8000
+ type: AXPSystemActionType.Create,
7244
8001
  scope: AXPEntityCommandScope.TypeLevel,
7245
8002
  };
7246
8003
  }
@@ -7270,7 +8027,7 @@ function entityDetailsEditAction() {
7270
8027
  title: '@general:actions.edit.title',
7271
8028
  command: 'quick-modify-entity',
7272
8029
  priority: 'secondary',
7273
- type: 'update',
8030
+ type: AXPSystemActionType.Update,
7274
8031
  default: true,
7275
8032
  scope: AXPEntityCommandScope.Individual,
7276
8033
  };
@@ -7281,7 +8038,7 @@ function entityOverrideDetailsViewAction() {
7281
8038
  command: 'open-entity',
7282
8039
  priority: 'secondary',
7283
8040
  hidden: true,
7284
- type: 'view',
8041
+ type: AXPSystemActionType.View,
7285
8042
  scope: AXPEntityCommandScope.Individual,
7286
8043
  };
7287
8044
  }
@@ -7308,7 +8065,7 @@ function entityDetailsReferenceCreateActions(type) {
7308
8065
  },
7309
8066
  },
7310
8067
  priority: 'primary',
7311
- type: 'create',
8068
+ type: AXPSystemActionType.Create,
7312
8069
  scope: AXPEntityCommandScope.TypeLevel,
7313
8070
  },
7314
8071
  entityDetailsEditAction(),
@@ -7348,32 +8105,9 @@ function detectEntityChanges(oldObj, newObj) {
7348
8105
  }
7349
8106
  //#endregion
7350
8107
 
7351
- const eventDispatchMiddleware = {
7352
- target: { ops: ['create', 'update', 'delete'], order: 90 },
7353
- execute: async (ctx, next) => {
7354
- const dispatcher = inject(AXPEntityEventDispatcherService);
7355
- await next();
7356
- if (ctx.op === 'create') {
7357
- const createdData = ctx.result ? { ...ctx.data, id: ctx.result } : ctx.data;
7358
- await dispatcher.dispatchInserted(ctx.entityName, { refType: ctx.entityName, data: createdData });
7359
- }
7360
- else if (ctx.op === 'update') {
7361
- await dispatcher.dispatchUpdated(ctx.entityName, {
7362
- refType: ctx.entityName,
7363
- data: ctx.result,
7364
- changes: ctx.locals.get('changes'),
7365
- });
7366
- }
7367
- else if (ctx.op === 'delete') {
7368
- // For delete, prefer previous entity if available
7369
- await dispatcher.dispatchDeleted(ctx.entityName, { refType: ctx.entityName, data: ctx.result ?? ctx.previous });
7370
- }
7371
- },
7372
- };
7373
-
7374
8108
  /**
7375
8109
  * Generated bundle index. Do not edit.
7376
8110
  */
7377
8111
 
7378
- export { AXMEntityCrudService, AXMEntityCrudServiceImpl, AXPCreateEntityWorkflow, AXPDataSeederService, AXPDeleteEntityWorkflow, AXPEntityApplyUpdatesAction, AXPEntityCommandTriggerViewModel, AXPEntityCreateEvent, AXPEntityCreatePopupAction, AXPEntityCreateSubmittedAction, AXPEntityCreateViewElementViewModel, AXPEntityCreateViewModelFactory, AXPEntityCreateViewSectionViewModel, AXPEntityDataProvider, AXPEntityDataProviderImpl, AXPEntityDefinitionRegistryService, AXPEntityDeletedEvent, AXPEntityDetailListViewModel, AXPEntityDetailViewModelFactory, AXPEntityDetailViewModelResolver, AXPEntityEventDispatcherService, AXPEntityListViewColumnViewModel, AXPEntityListViewModelFactory, AXPEntityListViewModelResolver, AXPEntityMasterCreateViewModel, AXPEntityMasterListViewModel, AXPEntityMasterListViewQueryViewModel, AXPEntityMasterSingleElementViewModel, AXPEntityMasterSingleViewGroupViewModel, AXPEntityMasterSingleViewModel, AXPEntityMasterUpdateElementViewModel, AXPEntityMasterUpdateViewModel, AXPEntityMasterUpdateViewModelFactory, AXPEntityMiddleware, AXPEntityModifyConfirmedAction, AXPEntityModifyEvent, AXPEntityModifySectionPopupAction, AXPEntityModule, AXPEntityPerformDeleteAction, AXPEntityResolver, AXPEntityService, AXPEntityStorageService, 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 };
8112
+ export { AXMEntityCrudService, AXMEntityCrudServiceImpl, AXPCreateEntityWorkflow, AXPDataSeederService, AXPDeleteEntityWorkflow, AXPEntityApplyUpdatesAction, AXPEntityCommandTriggerViewModel, AXPEntityCreateEvent, AXPEntityCreatePopupAction, AXPEntityCreateSubmittedAction, AXPEntityCreateViewElementViewModel, AXPEntityCreateViewModelFactory, AXPEntityCreateViewSectionViewModel, AXPEntityDataProvider, AXPEntityDataProviderImpl, AXPEntityDefinitionRegistryService, AXPEntityDeletedEvent, AXPEntityDetailListViewModel, AXPEntityDetailPopoverComponent, AXPEntityDetailPopoverService, AXPEntityDetailViewModelFactory, AXPEntityDetailViewModelResolver, AXPEntityDynamicFormDialogService, 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 };
7379
8113
  //# sourceMappingURL=acorex-platform-layout-entity.mjs.map