@acorex/platform 20.3.0-next.1 → 20.3.0-next.3

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 (113) hide show
  1. package/common/index.d.ts +120 -5
  2. package/core/index.d.ts +102 -61
  3. package/fesm2022/acorex-platform-auth.mjs +20 -20
  4. package/fesm2022/acorex-platform-auth.mjs.map +1 -1
  5. package/fesm2022/acorex-platform-common.mjs +136 -112
  6. package/fesm2022/acorex-platform-common.mjs.map +1 -1
  7. package/fesm2022/acorex-platform-core.mjs +287 -198
  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 +1226 -687
  12. package/fesm2022/acorex-platform-layout-builder.mjs.map +1 -1
  13. package/fesm2022/acorex-platform-layout-components.mjs +1525 -129
  14. package/fesm2022/acorex-platform-layout-components.mjs.map +1 -1
  15. package/fesm2022/acorex-platform-layout-designer.mjs +159 -204
  16. package/fesm2022/acorex-platform-layout-designer.mjs.map +1 -1
  17. package/fesm2022/acorex-platform-layout-entity.mjs +3674 -1154
  18. package/fesm2022/acorex-platform-layout-entity.mjs.map +1 -1
  19. package/fesm2022/acorex-platform-layout-views.mjs +387 -86
  20. package/fesm2022/acorex-platform-layout-views.mjs.map +1 -1
  21. package/fesm2022/acorex-platform-native.mjs +7 -7
  22. package/fesm2022/acorex-platform-native.mjs.map +1 -1
  23. package/fesm2022/acorex-platform-runtime.mjs +40 -40
  24. package/fesm2022/acorex-platform-runtime.mjs.map +1 -1
  25. package/fesm2022/{acorex-platform-themes-default-entity-master-create-view.component-hHXxHlFG.mjs → acorex-platform-themes-default-entity-master-create-view.component-BXbkGGei.mjs} +6 -6
  26. package/fesm2022/{acorex-platform-themes-default-entity-master-create-view.component-hHXxHlFG.mjs.map → acorex-platform-themes-default-entity-master-create-view.component-BXbkGGei.mjs.map} +1 -1
  27. package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-X0hLRZhX.mjs +708 -0
  28. package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-X0hLRZhX.mjs.map +1 -0
  29. package/fesm2022/{acorex-platform-themes-default-entity-master-modify-view.component-DC3MrDtI.mjs → acorex-platform-themes-default-entity-master-modify-view.component-Bp1JLsj1.mjs} +6 -13
  30. package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-Bp1JLsj1.mjs.map +1 -0
  31. package/fesm2022/acorex-platform-themes-default-entity-master-single-view.component-BExtm1JE.mjs +244 -0
  32. package/fesm2022/acorex-platform-themes-default-entity-master-single-view.component-BExtm1JE.mjs.map +1 -0
  33. package/fesm2022/{acorex-platform-themes-default-error-401.component-D4glpFvU.mjs → acorex-platform-themes-default-error-401.component-DrO1PEOH.mjs} +4 -4
  34. package/fesm2022/{acorex-platform-themes-default-error-401.component-D4glpFvU.mjs.map → acorex-platform-themes-default-error-401.component-DrO1PEOH.mjs.map} +1 -1
  35. package/fesm2022/{acorex-platform-themes-default-error-404.component-BvGeDMjo.mjs → acorex-platform-themes-default-error-404.component-DqVq0oHX.mjs} +4 -4
  36. package/fesm2022/{acorex-platform-themes-default-error-404.component-BvGeDMjo.mjs.map → acorex-platform-themes-default-error-404.component-DqVq0oHX.mjs.map} +1 -1
  37. package/fesm2022/{acorex-platform-themes-default-error-offline.component-BINy-Zo3.mjs → acorex-platform-themes-default-error-offline.component-Bt2PTL7_.mjs} +4 -4
  38. 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
  39. package/fesm2022/acorex-platform-themes-default.mjs +64 -509
  40. package/fesm2022/acorex-platform-themes-default.mjs.map +1 -1
  41. package/fesm2022/{acorex-platform-themes-shared-icon-chooser-view.component-C833prGO.mjs → acorex-platform-themes-shared-icon-chooser-view.component-KpZWpnOJ.mjs} +4 -4
  42. package/fesm2022/{acorex-platform-themes-shared-icon-chooser-view.component-C833prGO.mjs.map → acorex-platform-themes-shared-icon-chooser-view.component-KpZWpnOJ.mjs.map} +1 -1
  43. package/fesm2022/acorex-platform-themes-shared-settings.provider-CXiRmniv.mjs.map +1 -1
  44. package/fesm2022/{acorex-platform-themes-shared-color-chooser-column.component-DjKLg513.mjs → acorex-platform-themes-shared-theme-color-chooser-column.component-BvOiVCgt.mjs} +4 -4
  45. package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-column.component-BvOiVCgt.mjs.map +1 -0
  46. package/fesm2022/{acorex-platform-themes-shared-color-chooser-view.component-DE0wO98F.mjs → acorex-platform-themes-shared-theme-color-chooser-view.component-BW0rfkjk.mjs} +4 -4
  47. package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-view.component-BW0rfkjk.mjs.map +1 -0
  48. package/fesm2022/acorex-platform-themes-shared.mjs +50 -52
  49. package/fesm2022/acorex-platform-themes-shared.mjs.map +1 -1
  50. package/fesm2022/{acorex-platform-widgets-button-widget-designer.component-lNF95FJv.mjs → acorex-platform-widgets-button-widget-designer.component-C2Qn1YAW.mjs} +6 -6
  51. package/fesm2022/acorex-platform-widgets-button-widget-designer.component-C2Qn1YAW.mjs.map +1 -0
  52. package/fesm2022/{acorex-platform-widgets-checkbox-widget-column.component-BNBOATPB.mjs → acorex-platform-widgets-checkbox-widget-column.component-CzEFmKWG.mjs} +4 -5
  53. package/fesm2022/acorex-platform-widgets-checkbox-widget-column.component-CzEFmKWG.mjs.map +1 -0
  54. package/fesm2022/{acorex-platform-widgets-checkbox-widget-designer.component-BI18uzNZ.mjs → acorex-platform-widgets-checkbox-widget-designer.component-JC_nYunG.mjs} +5 -5
  55. package/fesm2022/acorex-platform-widgets-checkbox-widget-designer.component-JC_nYunG.mjs.map +1 -0
  56. package/fesm2022/{acorex-platform-widgets-checkbox-widget-view.component-C6-QPsnb.mjs → acorex-platform-widgets-checkbox-widget-view.component-C-4bWr9G.mjs} +4 -4
  57. package/fesm2022/{acorex-platform-widgets-checkbox-widget-view.component-C6-QPsnb.mjs.map → acorex-platform-widgets-checkbox-widget-view.component-C-4bWr9G.mjs.map} +1 -1
  58. package/fesm2022/{acorex-platform-widgets-color-box-widget-designer.component-pYOQv5g8.mjs → acorex-platform-widgets-color-box-widget-designer.component-CxgKO2VI.mjs} +5 -5
  59. package/fesm2022/acorex-platform-widgets-color-box-widget-designer.component-CxgKO2VI.mjs.map +1 -0
  60. package/fesm2022/acorex-platform-widgets-extra-properties-schema-widget-edit.component-D9mf08rU.mjs +50 -0
  61. package/fesm2022/acorex-platform-widgets-extra-properties-schema-widget-edit.component-D9mf08rU.mjs.map +1 -0
  62. package/fesm2022/acorex-platform-widgets-extra-properties-schema-widget-view.component-D6GQ-eyr.mjs +42 -0
  63. package/fesm2022/acorex-platform-widgets-extra-properties-schema-widget-view.component-D6GQ-eyr.mjs.map +1 -0
  64. package/fesm2022/acorex-platform-widgets-extra-properties-values-widget-edit.component-DVbIdVZ6.mjs +55 -0
  65. package/fesm2022/acorex-platform-widgets-extra-properties-values-widget-edit.component-DVbIdVZ6.mjs.map +1 -0
  66. package/fesm2022/acorex-platform-widgets-extra-properties-values-widget-view.component-D-aM64Hu.mjs +50 -0
  67. package/fesm2022/acorex-platform-widgets-extra-properties-values-widget-view.component-D-aM64Hu.mjs.map +1 -0
  68. package/fesm2022/acorex-platform-widgets-extra-properties-widget-edit.component-em2-aU8E.mjs +48 -0
  69. package/fesm2022/acorex-platform-widgets-extra-properties-widget-edit.component-em2-aU8E.mjs.map +1 -0
  70. package/fesm2022/acorex-platform-widgets-extra-properties-widget-view.component-BeuIofdr.mjs +42 -0
  71. package/fesm2022/acorex-platform-widgets-extra-properties-widget-view.component-BeuIofdr.mjs.map +1 -0
  72. package/fesm2022/{acorex-platform-widgets-file-list-popup.component-DFbPO0ud.mjs → acorex-platform-widgets-file-list-popup.component-rW2RD35f.mjs} +71 -6
  73. package/fesm2022/acorex-platform-widgets-file-list-popup.component-rW2RD35f.mjs.map +1 -0
  74. package/fesm2022/{acorex-platform-widgets-page-widget-designer.component-DRsLkulH.mjs → acorex-platform-widgets-page-widget-designer.component-DNvnQ4Mc.mjs} +77 -67
  75. package/fesm2022/acorex-platform-widgets-page-widget-designer.component-DNvnQ4Mc.mjs.map +1 -0
  76. package/fesm2022/{acorex-platform-widgets-rich-text-popup.component-CM_v-cL4.mjs → acorex-platform-widgets-rich-text-popup.component-Cydlpsat.mjs} +4 -4
  77. package/fesm2022/{acorex-platform-widgets-rich-text-popup.component-CM_v-cL4.mjs.map → acorex-platform-widgets-rich-text-popup.component-Cydlpsat.mjs.map} +1 -1
  78. package/fesm2022/{acorex-platform-widgets-tabular-data-edit-popup.component-nLZYiPnF.mjs → acorex-platform-widgets-tabular-data-edit-popup.component-CPVRbE8B.mjs} +8 -8
  79. package/fesm2022/{acorex-platform-widgets-tabular-data-edit-popup.component-nLZYiPnF.mjs.map → acorex-platform-widgets-tabular-data-edit-popup.component-CPVRbE8B.mjs.map} +1 -1
  80. package/fesm2022/{acorex-platform-widgets-tabular-data-view-popup.component-D6kiasYM.mjs → acorex-platform-widgets-tabular-data-view-popup.component-Dmg5DdX8.mjs} +6 -6
  81. package/fesm2022/{acorex-platform-widgets-tabular-data-view-popup.component-D6kiasYM.mjs.map → acorex-platform-widgets-tabular-data-view-popup.component-Dmg5DdX8.mjs.map} +1 -1
  82. package/fesm2022/{acorex-platform-widgets-text-block-widget-designer.component-CCMQtH3e.mjs → acorex-platform-widgets-text-block-widget-designer.component-yADN3Xji.mjs} +10 -14
  83. package/fesm2022/acorex-platform-widgets-text-block-widget-designer.component-yADN3Xji.mjs.map +1 -0
  84. package/fesm2022/acorex-platform-widgets.mjs +3953 -2138
  85. package/fesm2022/acorex-platform-widgets.mjs.map +1 -1
  86. package/fesm2022/acorex-platform-workflow.mjs +28 -25
  87. package/fesm2022/acorex-platform-workflow.mjs.map +1 -1
  88. package/layout/builder/index.d.ts +361 -181
  89. package/layout/components/index.d.ts +372 -25
  90. package/layout/designer/index.d.ts +16 -47
  91. package/layout/entity/index.d.ts +255 -336
  92. package/layout/views/index.d.ts +129 -22
  93. package/package.json +23 -37
  94. package/widgets/index.d.ts +372 -230
  95. package/workflow/index.d.ts +4 -1
  96. package/fesm2022/acorex-platform-themes-default-create-entity-view.component-SY0oMDoH.mjs +0 -22
  97. package/fesm2022/acorex-platform-themes-default-create-entity-view.component-SY0oMDoH.mjs.map +0 -1
  98. package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-hf4QOz_4.mjs +0 -665
  99. package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-hf4QOz_4.mjs.map +0 -1
  100. package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-DC3MrDtI.mjs.map +0 -1
  101. package/fesm2022/acorex-platform-themes-default-entity-master-single-view.component-Bb90PeHq.mjs +0 -236
  102. package/fesm2022/acorex-platform-themes-default-entity-master-single-view.component-Bb90PeHq.mjs.map +0 -1
  103. package/fesm2022/acorex-platform-themes-shared-color-chooser-column.component-DjKLg513.mjs.map +0 -1
  104. package/fesm2022/acorex-platform-themes-shared-color-chooser-view.component-DE0wO98F.mjs.map +0 -1
  105. package/fesm2022/acorex-platform-widgets-button-widget-designer.component-lNF95FJv.mjs.map +0 -1
  106. package/fesm2022/acorex-platform-widgets-checkbox-widget-column.component-BNBOATPB.mjs.map +0 -1
  107. package/fesm2022/acorex-platform-widgets-checkbox-widget-designer.component-BI18uzNZ.mjs.map +0 -1
  108. package/fesm2022/acorex-platform-widgets-color-box-widget-designer.component-pYOQv5g8.mjs.map +0 -1
  109. package/fesm2022/acorex-platform-widgets-file-list-popup.component-DFbPO0ud.mjs.map +0 -1
  110. package/fesm2022/acorex-platform-widgets-file-rename-popup.component-DA_CgIvm.mjs +0 -211
  111. package/fesm2022/acorex-platform-widgets-file-rename-popup.component-DA_CgIvm.mjs.map +0 -1
  112. package/fesm2022/acorex-platform-widgets-page-widget-designer.component-DRsLkulH.mjs.map +0 -1
  113. package/fesm2022/acorex-platform-widgets-text-block-widget-designer.component-CCMQtH3e.mjs.map +0 -1
@@ -1,7 +1,7 @@
1
1
  import { signalStore, withState, withComputed, withMethods, patchState } from '@ngrx/signals';
2
- import { get, isPlainObject, set, isArray, merge, isNil, isObjectLike, transform, isEmpty, cloneDeep, isEqual, isUndefined, endsWith, startsWith, includes, lte, gte, lt, gt, orderBy } from 'lodash-es';
2
+ import { get, isPlainObject, set, isArray, merge, isNil, isObjectLike, transform, isEmpty, isEqual, differenceWith, union, cloneDeep, isUndefined, endsWith, startsWith, includes, lte, gte, lt, gt, orderBy } from 'lodash-es';
3
3
  import * as i0 from '@angular/core';
4
- import { computed, InjectionToken, inject, Injectable, input, effect, Directive, EventEmitter, HostListener, Output, ViewContainerRef, ElementRef, provideAppInitializer, signal, Pipe } from '@angular/core';
4
+ import { computed, InjectionToken, inject, Injectable, input, effect, Directive, EventEmitter, HostListener, Output, ViewContainerRef, ElementRef, provideAppInitializer, signal, Pipe, Injector, runInInjectionContext } from '@angular/core';
5
5
  import { Subject, interval } from 'rxjs';
6
6
  import { AXCalendarService } from '@acorex/core/date-time';
7
7
  import { startWith, map } from 'rxjs/operators';
@@ -107,7 +107,6 @@ function extractValue(value, key = 'id') {
107
107
  if (isNil(value)) {
108
108
  return null;
109
109
  }
110
- ;
111
110
  return isObjectLike(value) ? get(value, key) : value;
112
111
  }
113
112
  function cleanDeep(obj) {
@@ -126,6 +125,114 @@ function cleanDeep(obj) {
126
125
  }
127
126
  });
128
127
  }
128
+ function getDeepChanges(obj1, obj2) {
129
+ const changes = [];
130
+ function walk(o1, o2, currentPath = []) {
131
+ // If both values are deeply equal, skip
132
+ if (isEqual(o1, o2))
133
+ return;
134
+ const isObj1Nil = o1 === null || o1 === undefined;
135
+ const isObj2Nil = o2 === null || o2 === undefined;
136
+ // If obj1 is null/undefined and obj2 is not, treat entire obj2 as added
137
+ if (isObj1Nil && !isObj2Nil) {
138
+ if (isPlainObject(o2)) {
139
+ for (const key of Object.keys(o2)) {
140
+ walk(undefined, o2[key], [...currentPath, key]);
141
+ }
142
+ }
143
+ else if (Array.isArray(o2)) {
144
+ changes.push({
145
+ path: currentPath.join('.'),
146
+ oldValue: undefined,
147
+ newValue: o2,
148
+ arrayDiff: {
149
+ added: o2,
150
+ removed: [],
151
+ },
152
+ });
153
+ }
154
+ else {
155
+ changes.push({
156
+ path: currentPath.join('.'),
157
+ oldValue: undefined,
158
+ newValue: o2,
159
+ });
160
+ }
161
+ return;
162
+ }
163
+ // If obj2 is null/undefined and obj1 is not, treat entire obj1 as removed
164
+ if (!isObj1Nil && isObj2Nil) {
165
+ if (isPlainObject(o1)) {
166
+ for (const key of Object.keys(o1)) {
167
+ walk(o1[key], undefined, [...currentPath, key]);
168
+ }
169
+ }
170
+ else if (Array.isArray(o1)) {
171
+ changes.push({
172
+ path: currentPath.join('.'),
173
+ oldValue: o1,
174
+ newValue: undefined,
175
+ arrayDiff: {
176
+ added: [],
177
+ removed: o1,
178
+ },
179
+ });
180
+ }
181
+ else {
182
+ changes.push({
183
+ path: currentPath.join('.'),
184
+ oldValue: o1,
185
+ newValue: undefined,
186
+ });
187
+ }
188
+ return;
189
+ }
190
+ // If both are arrays, compare items
191
+ if (Array.isArray(o1) && Array.isArray(o2)) {
192
+ if (!isEqual(o1, o2)) {
193
+ const added = differenceWith(o2, o1, isEqual);
194
+ const removed = differenceWith(o1, o2, isEqual);
195
+ changes.push({
196
+ path: currentPath.join('.'),
197
+ oldValue: o1,
198
+ newValue: o2,
199
+ arrayDiff: {
200
+ added,
201
+ removed,
202
+ },
203
+ });
204
+ }
205
+ return;
206
+ }
207
+ // If both are plain objects, walk each key
208
+ if (isPlainObject(o1) && isPlainObject(o2)) {
209
+ const allKeys = union(Object.keys(o1), Object.keys(o2));
210
+ for (const key of allKeys) {
211
+ walk(o1[key], o2[key], [...currentPath, key]);
212
+ }
213
+ return;
214
+ }
215
+ // Primitive values or mismatched types
216
+ changes.push({
217
+ path: currentPath.join('.'),
218
+ oldValue: o1,
219
+ newValue: o2,
220
+ });
221
+ }
222
+ walk(obj1, obj2);
223
+ return changes;
224
+ }
225
+ // Method 1: Returns only changed paths
226
+ function getChangedPaths(obj1, obj2) {
227
+ return getDeepChanges(obj1, obj2).map((change) => change.path);
228
+ }
229
+ // Method 2: Returns full change entries
230
+ function getDetailedChanges(obj1, obj2) {
231
+ return getDeepChanges(obj1, obj2);
232
+ }
233
+ function getEnumValues(enumType) {
234
+ return Object.entries(enumType).map(([key, value]) => ({ id: value, title: key }));
235
+ }
129
236
 
130
237
  class AXPContextChangeEvent {
131
238
  }
@@ -440,10 +547,10 @@ class AXPDataSourceDefinitionProviderService {
440
547
  async get(name) {
441
548
  return (await this.items()).find((c) => c.name == name);
442
549
  }
443
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPDataSourceDefinitionProviderService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
444
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPDataSourceDefinitionProviderService, providedIn: 'root' }); }
550
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPDataSourceDefinitionProviderService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
551
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPDataSourceDefinitionProviderService, providedIn: 'root' }); }
445
552
  }
446
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPDataSourceDefinitionProviderService, decorators: [{
553
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPDataSourceDefinitionProviderService, decorators: [{
447
554
  type: Injectable,
448
555
  args: [{ providedIn: 'root' }]
449
556
  }] });
@@ -476,10 +583,10 @@ class AXPElementDataDirective {
476
583
  setData(data) {
477
584
  set(this.elementRef.nativeElement, this.path(), data);
478
585
  }
479
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPElementDataDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); }
480
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.1.6", type: AXPElementDataDirective, isStandalone: true, selector: "[axp-data]", inputs: { data: { classPropertyName: "data", publicName: "axp-data", isSignal: true, isRequired: false, transformFunction: null }, path: { classPropertyName: "path", publicName: "axp-data-path", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 }); }
586
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPElementDataDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); }
587
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.1.8", type: AXPElementDataDirective, isStandalone: true, selector: "[axp-data]", inputs: { data: { classPropertyName: "data", publicName: "axp-data", isSignal: true, isRequired: false, transformFunction: null }, path: { classPropertyName: "path", publicName: "axp-data-path", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 }); }
481
588
  }
482
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPElementDataDirective, decorators: [{
589
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPElementDataDirective, decorators: [{
483
590
  type: Directive,
484
591
  args: [{
485
592
  selector: '[axp-data]',
@@ -508,10 +615,10 @@ class AXPDblClickDirective {
508
615
  }
509
616
  this.lastTap = currentTime;
510
617
  }
511
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPDblClickDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
512
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.1.6", type: AXPDblClickDirective, isStandalone: true, selector: "[onDblClick]", outputs: { onDblClick: "onDblClick" }, host: { listeners: { "dblclick": "handleOnDblClick($event)", "touchend": "onTouchEnd($event)" } }, ngImport: i0 }); }
618
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPDblClickDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
619
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.1.8", type: AXPDblClickDirective, isStandalone: true, selector: "[onDblClick]", outputs: { onDblClick: "onDblClick" }, host: { listeners: { "dblclick": "handleOnDblClick($event)", "touchend": "onTouchEnd($event)" } }, ngImport: i0 }); }
513
620
  }
514
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPDblClickDirective, decorators: [{
621
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPDblClickDirective, decorators: [{
515
622
  type: Directive,
516
623
  args: [{
517
624
  selector: '[onDblClick]'
@@ -574,10 +681,10 @@ class AXPGridLayoutDirective {
574
681
  }
575
682
  });
576
683
  }
577
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPGridLayoutDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive }); }
578
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.1.6", type: AXPGridLayoutDirective, isStandalone: true, selector: "[axp-grid-layout]", inputs: { options: { classPropertyName: "options", publicName: "axp-grid-layout", isSignal: true, isRequired: true, transformFunction: null } }, usesOnChanges: true, ngImport: i0 }); }
684
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPGridLayoutDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive }); }
685
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.1.8", type: AXPGridLayoutDirective, isStandalone: true, selector: "[axp-grid-layout]", inputs: { options: { classPropertyName: "options", publicName: "axp-grid-layout", isSignal: true, isRequired: true, transformFunction: null } }, usesOnChanges: true, ngImport: i0 }); }
579
686
  }
580
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPGridLayoutDirective, decorators: [{
687
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPGridLayoutDirective, decorators: [{
581
688
  type: Directive,
582
689
  args: [{
583
690
  selector: '[axp-grid-layout]',
@@ -592,15 +699,10 @@ class AXPContentCheckerDirective {
592
699
  this.elementRef = inject((ElementRef));
593
700
  this.isEmpty = computed(() => this.viewContainerRef.length === 0, ...(ngDevMode ? [{ debugName: "isEmpty" }] : []));
594
701
  }
595
- ngAfterViewInit() {
596
- setTimeout(() => {
597
- console.log(this.elementRef.nativeElement.childNodes);
598
- }, 1000);
599
- }
600
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPContentCheckerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
601
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.1.6", type: AXPContentCheckerDirective, isStandalone: true, selector: "[axp-content-checker]", exportAs: ["checker"], ngImport: i0 }); }
702
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPContentCheckerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
703
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.1.8", type: AXPContentCheckerDirective, isStandalone: true, selector: "[axp-content-checker]", exportAs: ["checker"], ngImport: i0 }); }
602
704
  }
603
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPContentCheckerDirective, decorators: [{
705
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPContentCheckerDirective, decorators: [{
604
706
  type: Directive,
605
707
  args: [{
606
708
  selector: '[axp-content-checker]',
@@ -614,10 +716,11 @@ class AXPBroadcastEventService {
614
716
  this.eventSubjects = new Map();
615
717
  this.pendingRequests = new Map();
616
718
  this.multiTabEventHistory = new Set(); // Prevent duplicate processing of the same event
719
+ this.instanceId = AXPDataGenerator.uuid();
617
720
  this.channel = new BroadcastChannel('platform_global_events');
618
721
  // Handle incoming messages
619
722
  this.channel.onmessage = (event) => {
620
- const { type, payload, requestId, response } = event.data;
723
+ const { type, payload, requestId, response, sourceId } = event.data;
621
724
  // Prevent processing the same event multiple times (multi-tab synchronization)
622
725
  if (requestId && this.multiTabEventHistory.has(requestId)) {
623
726
  return;
@@ -633,6 +736,10 @@ class AXPBroadcastEventService {
633
736
  return;
634
737
  }
635
738
  // Handle normal broadcast events
739
+ // Ignore events originating from this same instance to avoid double-delivery
740
+ if (sourceId && sourceId === this.instanceId) {
741
+ return;
742
+ }
636
743
  if (type && this.eventSubjects.has(type)) {
637
744
  this.eventSubjects.get(type).next({ data: payload, requestId });
638
745
  }
@@ -642,7 +749,11 @@ class AXPBroadcastEventService {
642
749
  * Publish an event without expecting a response
643
750
  */
644
751
  publish(type, payload) {
645
- this.channel.postMessage({ type, payload });
752
+ this.channel.postMessage({ type, payload, sourceId: this.instanceId });
753
+ // Local echo so same-tab listeners receive the event as well
754
+ if (this.eventSubjects.has(type)) {
755
+ this.eventSubjects.get(type).next({ data: payload });
756
+ }
646
757
  }
647
758
  /**
648
759
  * Subscribe to an event
@@ -665,7 +776,11 @@ class AXPBroadcastEventService {
665
776
  /**
666
777
  * Send a message and wait for a response with retry logic
667
778
  */
668
- async sendAndWaitForResponse(type, payload, options = { timeout: 60 * 60 * 1000, retries: 3, retryDelay: 1000 }) {
779
+ async sendAndWaitForResponse(type, payload, options = {
780
+ timeout: 60 * 60 * 1000,
781
+ retries: 3,
782
+ retryDelay: 1000,
783
+ }) {
669
784
  const requestId = AXPDataGenerator.uuid();
670
785
  const attemptRequest = (attempt) => {
671
786
  return new Promise((resolve, reject) => {
@@ -713,13 +828,13 @@ class AXPBroadcastEventService {
713
828
  // Cleanup multi-tab event history
714
829
  this.multiTabEventHistory.clear();
715
830
  }
716
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPBroadcastEventService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
717
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPBroadcastEventService, providedIn: 'root' }); }
831
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPBroadcastEventService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
832
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPBroadcastEventService, providedIn: 'root' }); }
718
833
  }
719
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPBroadcastEventService, decorators: [{
834
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPBroadcastEventService, decorators: [{
720
835
  type: Injectable,
721
836
  args: [{
722
- providedIn: 'root'
837
+ providedIn: 'root',
723
838
  }]
724
839
  }], ctorParameters: () => [] });
725
840
 
@@ -755,10 +870,10 @@ class AXPExpressionEvaluatorScopeProviderService {
755
870
  await this.load();
756
871
  return this.cache || {};
757
872
  }
758
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPExpressionEvaluatorScopeProviderService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
759
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPExpressionEvaluatorScopeProviderService, providedIn: 'root' }); }
873
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPExpressionEvaluatorScopeProviderService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
874
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPExpressionEvaluatorScopeProviderService, providedIn: 'root' }); }
760
875
  }
761
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPExpressionEvaluatorScopeProviderService, decorators: [{
876
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPExpressionEvaluatorScopeProviderService, decorators: [{
762
877
  type: Injectable,
763
878
  args: [{ providedIn: 'root' }]
764
879
  }] });
@@ -867,10 +982,10 @@ class AXPExpressionEvaluatorService {
867
982
  }
868
983
  return false;
869
984
  }
870
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPExpressionEvaluatorService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
871
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPExpressionEvaluatorService, providedIn: 'root' }); }
985
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPExpressionEvaluatorService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
986
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPExpressionEvaluatorService, providedIn: 'root' }); }
872
987
  }
873
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPExpressionEvaluatorService, decorators: [{
988
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPExpressionEvaluatorService, decorators: [{
874
989
  type: Injectable,
875
990
  args: [{ providedIn: 'root' }]
876
991
  }] });
@@ -895,10 +1010,10 @@ class AXPAppStartUpService {
895
1010
  loadingText.innerHTML = status;
896
1011
  }
897
1012
  }
898
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPAppStartUpService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
899
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPAppStartUpService, providedIn: 'root' }); }
1013
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPAppStartUpService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1014
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPAppStartUpService, providedIn: 'root' }); }
900
1015
  }
901
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPAppStartUpService, decorators: [{
1016
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPAppStartUpService, decorators: [{
902
1017
  type: Injectable,
903
1018
  args: [{
904
1019
  providedIn: 'root',
@@ -1384,10 +1499,10 @@ class AXPCountdownPipe {
1384
1499
  updateTargetDate(value) {
1385
1500
  this.targetDate = new Date(value).getTime();
1386
1501
  }
1387
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPCountdownPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
1388
- static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "20.1.6", ngImport: i0, type: AXPCountdownPipe, isStandalone: true, name: "countdown", pure: false }); }
1502
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPCountdownPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
1503
+ static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "20.1.8", ngImport: i0, type: AXPCountdownPipe, isStandalone: true, name: "countdown", pure: false }); }
1389
1504
  }
1390
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPCountdownPipe, decorators: [{
1505
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPCountdownPipe, decorators: [{
1391
1506
  type: Pipe,
1392
1507
  args: [{
1393
1508
  name: 'countdown',
@@ -1413,38 +1528,46 @@ function applyCondition(item, condition) {
1413
1528
  if (!conditionType) {
1414
1529
  return true;
1415
1530
  }
1416
- switch (conditionType) {
1531
+ const op = String(conditionType);
1532
+ switch (op) {
1417
1533
  case 'equal':
1534
+ case 'eq':
1418
1535
  result = isEqual(valueToCompare, conditionValue);
1419
1536
  if (loggingEnabled) {
1420
1537
  console.log('Equal check result:', result);
1421
1538
  }
1422
1539
  break;
1423
1540
  case 'notEqual':
1541
+ case 'ne':
1542
+ case 'neq':
1424
1543
  result = !isEqual(valueToCompare, conditionValue);
1425
1544
  if (loggingEnabled) {
1426
1545
  console.log('Not equal check result:', result);
1427
1546
  }
1428
1547
  break;
1429
1548
  case 'greaterThan':
1549
+ case 'gt':
1430
1550
  result = gt(valueToCompare, conditionValue);
1431
1551
  if (loggingEnabled) {
1432
1552
  console.log('Greater than check result:', result);
1433
1553
  }
1434
1554
  break;
1435
1555
  case 'lessThan':
1556
+ case 'lt':
1436
1557
  result = lt(valueToCompare, conditionValue);
1437
1558
  if (loggingEnabled) {
1438
1559
  console.log('Less than check result:', result);
1439
1560
  }
1440
1561
  break;
1441
1562
  case 'greaterThanOrEqual':
1563
+ case 'gte':
1442
1564
  result = gte(valueToCompare, conditionValue);
1443
1565
  if (loggingEnabled) {
1444
1566
  console.log('Greater than or equal check result:', result);
1445
1567
  }
1446
1568
  break;
1447
1569
  case 'lessThanOrEqual':
1570
+ case 'lte':
1448
1571
  result = lte(valueToCompare, conditionValue);
1449
1572
  if (loggingEnabled) {
1450
1573
  console.log('Less than or equal check result:', result);
@@ -1541,7 +1664,9 @@ function applyCondition(item, condition) {
1541
1664
  console.log('Default case, returning true');
1542
1665
  }
1543
1666
  }
1544
- return result;
1667
+ // Apply negative flag if present on operator (invert the result)
1668
+ const isNegative = !!condition?.operator?.negative;
1669
+ return isNegative ? !result : result;
1545
1670
  }
1546
1671
  function applyFilterArray(dataArray, filters, logic = 'and') {
1547
1672
  if (filters && filters.length) {
@@ -1692,10 +1817,10 @@ class AXHighlightService {
1692
1817
  resultHTML += '</span>';
1693
1818
  return resultHTML;
1694
1819
  }
1695
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXHighlightService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1696
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXHighlightService, providedIn: 'root' }); }
1820
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXHighlightService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1821
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXHighlightService, providedIn: 'root' }); }
1697
1822
  }
1698
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXHighlightService, decorators: [{
1823
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXHighlightService, decorators: [{
1699
1824
  type: Injectable,
1700
1825
  args: [{
1701
1826
  providedIn: 'root',
@@ -1719,10 +1844,10 @@ class AXPActivityLogService {
1719
1844
  async getHistoryByIds(refId, refType, ids) {
1720
1845
  return (await Promise.all(this.providers?.map((p) => p.getHistoryByIds(refId, refType, ids)) ?? [])).flat();
1721
1846
  }
1722
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPActivityLogService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1723
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPActivityLogService, providedIn: 'root' }); }
1847
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPActivityLogService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1848
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPActivityLogService, providedIn: 'root' }); }
1724
1849
  }
1725
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPActivityLogService, decorators: [{
1850
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPActivityLogService, decorators: [{
1726
1851
  type: Injectable,
1727
1852
  args: [{ providedIn: 'root' }]
1728
1853
  }] });
@@ -1738,6 +1863,7 @@ class AXPDistributedEventListenerService {
1738
1863
  constructor() {
1739
1864
  //#region ---- Providers & Caches ----
1740
1865
  this.listenerProviders = inject(AXP_DISTRIBUTED_EVENT_LISTENER_PROVIDER, { optional: true }) || [];
1866
+ this.injector = inject(Injector);
1741
1867
  /** Cache for listeners by key. */
1742
1868
  this.listenersByKey = new Map();
1743
1869
  /** Flag to track if providers have been loaded */
@@ -1751,19 +1877,76 @@ class AXPDistributedEventListenerService {
1751
1877
  * @param data The event data to pass to listeners.
1752
1878
  */
1753
1879
  async dispatch(key, data) {
1754
- await this.ensureProvidersLoaded();
1755
- const listeners = this.listenersByKey.get(key) || [];
1756
- // Execute all listeners in parallel
1757
- const promises = listeners.map(listener => {
1880
+ const providers = await this.resolveProviders();
1881
+ const matched = providers.filter(p => p.key === key);
1882
+ if (!matched.length) {
1883
+ console.warn(`[AXPDistributedEventListenerService] No provider found for key='${key}'`);
1884
+ return;
1885
+ }
1886
+ for (const provider of matched) {
1758
1887
  try {
1759
- return Promise.resolve(listener.execute(data));
1888
+ await Promise.resolve(runInInjectionContext(this.injector, () => provider.execute(data)));
1760
1889
  }
1761
- catch (error) {
1762
- console.error(`Error executing listener for event key '${key}':`, error);
1763
- return Promise.resolve(); // Continue with other listeners even if one fails
1890
+ catch (err) {
1891
+ console.error(`[AXPDistributedEventListenerService] Provider for key='${key}' failed`, err);
1764
1892
  }
1765
- });
1766
- await Promise.all(promises);
1893
+ }
1894
+ }
1895
+ /**
1896
+ * Dispatch with async response (first matching provider, with retry/timeout)
1897
+ */
1898
+ async dispatchAsync(key, data, options = {
1899
+ timeout: 60_000,
1900
+ retries: 3,
1901
+ retryDelay: 1000,
1902
+ }) {
1903
+ const providers = await this.resolveProviders();
1904
+ const matched = providers.filter(p => p.key === key);
1905
+ if (!matched.length) {
1906
+ throw new Error(`No provider found for key='${key}'`);
1907
+ }
1908
+ const attempt = (n) => {
1909
+ return new Promise((resolve, reject) => {
1910
+ let finished = false;
1911
+ const timer = setTimeout(() => {
1912
+ if (!finished) {
1913
+ if (n < options.retries) {
1914
+ console.warn(`[dispatchAsync] retrying key='${key}' (${n + 1}/${options.retries})`);
1915
+ resolve(attempt(n + 1));
1916
+ }
1917
+ else {
1918
+ reject(new Error(`Timeout: no response for key='${key}' after ${options.retries} attempts.`));
1919
+ }
1920
+ }
1921
+ }, options.timeout);
1922
+ try {
1923
+ const provider = matched[0];
1924
+ const result = runInInjectionContext(this.injector, () => provider.execute(data));
1925
+ Promise.resolve(result)
1926
+ .then((r) => {
1927
+ finished = true;
1928
+ clearTimeout(timer);
1929
+ resolve(r);
1930
+ })
1931
+ .catch(err => {
1932
+ finished = true;
1933
+ clearTimeout(timer);
1934
+ reject(err);
1935
+ });
1936
+ }
1937
+ catch (err) {
1938
+ clearTimeout(timer);
1939
+ reject(err);
1940
+ }
1941
+ });
1942
+ };
1943
+ return attempt(0);
1944
+ }
1945
+ /**
1946
+ * Resolve all providers (handle both direct provider and Promise<provider>)
1947
+ */
1948
+ async resolveProviders() {
1949
+ return Promise.all(this.listenerProviders.map(p => p instanceof Promise ? p : Promise.resolve(p)));
1767
1950
  }
1768
1951
  /**
1769
1952
  * Returns all listeners for a specific event key.
@@ -1810,167 +1993,73 @@ class AXPDistributedEventListenerService {
1810
1993
  this.listenersByKey.clear();
1811
1994
  this.providersLoaded = false;
1812
1995
  }
1813
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPDistributedEventListenerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1814
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPDistributedEventListenerService, providedIn: 'root' }); }
1996
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPDistributedEventListenerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1997
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPDistributedEventListenerService, providedIn: 'root' }); }
1815
1998
  }
1816
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPDistributedEventListenerService, decorators: [{
1999
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPDistributedEventListenerService, decorators: [{
1817
2000
  type: Injectable,
1818
2001
  args: [{
1819
2002
  providedIn: 'root',
1820
2003
  }]
1821
2004
  }] });
1822
2005
 
1823
- //import { AXPEntityDefinitionRegistryService } from '@acorex/platform/layout/entity';
1824
- /**
1825
- * Entity Event Dispatcher - A wrapper for entity-specific events
1826
- * Handles pattern-based dispatching for entity operations with wildcard support
1827
- */
1828
- class AXPEntityEventDispatcherService {
2006
+ class AXPHookService {
1829
2007
  constructor() {
1830
- this.eventService = inject(AXPDistributedEventListenerService);
1831
- }
1832
- //private readonly entityRegistry = inject(AXPEntityDefinitionRegistryService);
1833
- /**
1834
- * Dispatch entity events with pattern matching support for wildcard listeners
1835
- * @param operation The operation type (inserted, updated, deleted)
1836
- * @param entityName The full entity name (e.g., 'PlatformManagement.Category')
1837
- * @param data The event data
1838
- */
1839
- async dispatchEntityEvent(operation, entityName, data) {
1840
- console.log('dispatchEntityEvent', operation, entityName, data);
1841
- const enhancedData = {
1842
- ...data,
1843
- entityName,
1844
- operation,
1845
- timestamp: new Date(),
1846
- source: 'entity-dispatcher'
1847
- };
1848
- // Get all possible event keys that could match this entity operation
1849
- const eventKeysToDispatch = await this.getAllMatchingEventKeys(operation, entityName);
1850
- console.log('eventKeysToDispatch', eventKeysToDispatch);
1851
- // Dispatch to all matching patterns simultaneously
1852
- const dispatchPromises = eventKeysToDispatch.map(key => this.eventService.dispatch(key, enhancedData));
1853
- await Promise.all(dispatchPromises);
1854
- }
1855
- /**
1856
- * Get all event keys that should be dispatched for this entity operation
1857
- * including wildcard pattern matches
1858
- */
1859
- async getAllMatchingEventKeys(operation, entityName) {
1860
- const eventKeys = new Set();
1861
- // 1. Add exact patterns for this specific entity
1862
- const exactKeys = this.generateEventKeys(operation, entityName);
1863
- exactKeys.forEach(key => eventKeys.add(key));
1864
- // 2. Find and add wildcard listeners that match this entity
1865
- const wildcardKeys = await this.findMatchingWildcardKeys(operation, entityName);
1866
- wildcardKeys.forEach(key => eventKeys.add(key));
1867
- return Array.from(eventKeys);
1868
- }
1869
- /**
1870
- * Find wildcard listener keys that match this entity operation
1871
- */
1872
- async findMatchingWildcardKeys(operation, entityName) {
1873
- const matchingKeys = [];
1874
- // Get all registered listeners
1875
- const allListenerKeys = await this.eventService.getRegisteredKeys();
1876
- // Generate the event key that would be dispatched
1877
- const actualEventKey = `entity.${operation}.${entityName}`;
1878
- // Check each listener key for wildcard patterns
1879
- for (const listenerKey of allListenerKeys) {
1880
- if (listenerKey.includes('*') && this.matchesEntityPattern(actualEventKey, listenerKey)) {
1881
- matchingKeys.push(listenerKey);
1882
- }
1883
- }
1884
- return matchingKeys;
2008
+ this.listenerProviders = inject(AXP_DISTRIBUTED_EVENT_LISTENER_PROVIDER, { optional: true }) || [];
2009
+ this.injector = inject(Injector);
1885
2010
  }
1886
2011
  /**
1887
- * Check if an entity event key matches a wildcard pattern
1888
- * Only supports entity patterns (entity.*)
2012
+ * Resolve all providers (handle both direct providers and Promise<provider>)
1889
2013
  */
1890
- matchesEntityPattern(eventKey, pattern) {
1891
- // Only process entity patterns
1892
- if (!pattern.startsWith('entity.') || !pattern.includes('*')) {
1893
- return false;
1894
- }
1895
- // Convert pattern to regex
1896
- const regexPattern = pattern
1897
- .replace(/\./g, '\\.') // Escape dots
1898
- .replace(/\*/g, '.*'); // Convert * to regex wildcard
1899
- const regex = new RegExp(`^${regexPattern}$`);
1900
- return regex.test(eventKey);
2014
+ async resolveProviders() {
2015
+ return Promise.all(this.listenerProviders.map(p => p instanceof Promise ? p : Promise.resolve(p)));
1901
2016
  }
1902
2017
  /**
1903
- * Generate all possible event keys for an entity operation
1904
- * @param operation The operation type
1905
- * @param entityName The entity name (e.g., 'PlatformManagement.Category')
2018
+ * Fire sync hooks (fire-and-forget).
2019
+ * All providers with the given key will be executed.
2020
+ * Execution is not awaited.
1906
2021
  */
1907
- generateEventKeys(operation, entityName) {
1908
- const keys = [];
1909
- // 1. Base pattern: entity.inserted
1910
- keys.push(`entity.${operation}`);
1911
- // 2. Specific entity pattern: entity.inserted.PlatformManagement.Category
1912
- keys.push(`entity.${operation}.${entityName}`);
1913
- // 3. Module-level pattern: entity.inserted.PlatformManagement
1914
- const entityParts = entityName.split('.');
1915
- if (entityParts.length > 1) {
1916
- const moduleName = entityParts[0];
1917
- keys.push(`entity.${operation}.${moduleName}`);
1918
- }
1919
- return keys;
2022
+ fire(key, data) {
2023
+ this.resolveProviders().then(providers => {
2024
+ providers
2025
+ .filter(p => p.key === key)
2026
+ .sort((a, b) => (a.priority ?? 0) - (b.priority ?? 0))
2027
+ .forEach(p => {
2028
+ try {
2029
+ runInInjectionContext(this.injector, () => p.execute(data));
2030
+ }
2031
+ catch (err) {
2032
+ console.error(`[AXPHookService] Hook '${key}' failed`, err);
2033
+ }
2034
+ });
2035
+ });
1920
2036
  }
1921
2037
  /**
1922
- * Convenience methods for specific operations
2038
+ * Run async hooks sequentially (waterfall).
2039
+ * The output of each hook is passed as input to the next hook.
2040
+ * Returns the final merged data after all hooks are executed.
1923
2041
  */
1924
- async dispatchInserted(entityName, data) {
1925
- await this.dispatchEntityEvent('inserted', entityName, data);
1926
- }
1927
- async dispatchUpdated(entityName, data) {
1928
- await this.dispatchEntityEvent('updated', entityName, data);
1929
- }
1930
- async dispatchDeleted(entityName, data) {
1931
- await this.dispatchEntityEvent('deleted', entityName, data);
1932
- }
1933
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPEntityEventDispatcherService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1934
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPEntityEventDispatcherService, providedIn: 'root' }); }
2042
+ async runAsync(key, initialData) {
2043
+ const providers = (await this.resolveProviders())
2044
+ .filter(p => p.key === key)
2045
+ .sort((a, b) => (a.priority ?? 0) - (b.priority ?? 0));
2046
+ let data = initialData;
2047
+ for (const p of providers) {
2048
+ data = await Promise.resolve(runInInjectionContext(this.injector, () => p.execute(data)));
2049
+ }
2050
+ return data;
2051
+ }
2052
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPHookService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
2053
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPHookService, providedIn: 'root' }); }
1935
2054
  }
1936
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPEntityEventDispatcherService, decorators: [{
2055
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: AXPHookService, decorators: [{
1937
2056
  type: Injectable,
1938
- args: [{
1939
- providedIn: 'root',
1940
- }]
1941
- }] });
1942
-
1943
- /**
1944
- * Example implementation of a distributed event listener provider.
1945
- * This is just a sample to show how to implement the interface.
1946
- */
1947
- class ExampleEventListenerProvider {
1948
- constructor() {
1949
- this.key = 'example.event';
1950
- }
1951
- async execute(data) {
1952
- console.log('Example event received:', data);
1953
- // Your implementation here
1954
- // For example:
1955
- // - Log the event
1956
- // - Update cache
1957
- // - Send notifications
1958
- // - Call external APIs
1959
- // - Update UI state
1960
- // Simulate async work
1961
- await new Promise(resolve => setTimeout(resolve, 100));
1962
- console.log('Example event processed successfully');
1963
- }
1964
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: ExampleEventListenerProvider, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1965
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: ExampleEventListenerProvider }); }
1966
- }
1967
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: ExampleEventListenerProvider, decorators: [{
1968
- type: Injectable
2057
+ args: [{ providedIn: 'root' }]
1969
2058
  }] });
1970
2059
 
1971
2060
  /**
1972
2061
  * Generated bundle index. Do not edit.
1973
2062
  */
1974
2063
 
1975
- export { AXHighlightService, AXPActivityLogProvider, AXPActivityLogService, AXPAppStartUpProvider, AXPAppStartUpService, AXPBroadcastEventService, AXPComponentLogoConfig, AXPContentCheckerDirective, AXPContextChangeEvent, AXPContextStore, AXPCountdownPipe, AXPDataGenerator, AXPDataSourceDefinitionProviderService, AXPDblClickDirective, AXPDistributedEventListenerService, AXPElementDataDirective, AXPEntityEventDispatcherService, AXPExportTemplateToken, AXPExpressionEvaluatorScopeProviderContext, AXPExpressionEvaluatorScopeProviderService, AXPExpressionEvaluatorService, AXPGridLayoutDirective, AXPImageUrlLogoConfig, AXPPlatformScope, AXPSystemActionType, AXPSystemActions, AXP_ACTIVITY_LOG_PROVIDER, AXP_DATASOURCE_DEFINITION_PROVIDER, AXP_DISTRIBUTED_EVENT_LISTENER_PROVIDER, AXP_EXPRESSION_EVALUATOR_SCOPE_PROVIDER, ExampleEventListenerProvider, applyFilterArray, applyPagination, applyQueryArray, applySortArray, applySystemActionDefault, cleanDeep, extractNestedFieldsWildcard, extractTextFromHtml, extractValue, getNestedKeys, getSmart, getSystemActions, objectKeyValueTransforms, resolvePlatformScopeKey, resolvePlatformScopeName, setSmart };
2064
+ export { AXHighlightService, AXPActivityLogProvider, AXPActivityLogService, AXPAppStartUpProvider, AXPAppStartUpService, AXPBroadcastEventService, AXPComponentLogoConfig, AXPContentCheckerDirective, AXPContextChangeEvent, AXPContextStore, AXPCountdownPipe, AXPDataGenerator, AXPDataSourceDefinitionProviderService, AXPDblClickDirective, AXPDistributedEventListenerService, AXPElementDataDirective, AXPExportTemplateToken, AXPExpressionEvaluatorScopeProviderContext, AXPExpressionEvaluatorScopeProviderService, AXPExpressionEvaluatorService, AXPGridLayoutDirective, AXPHookService, AXPImageUrlLogoConfig, AXPPlatformScope, AXPSystemActionType, AXPSystemActions, AXP_ACTIVITY_LOG_PROVIDER, AXP_DATASOURCE_DEFINITION_PROVIDER, AXP_DISTRIBUTED_EVENT_LISTENER_PROVIDER, AXP_EXPRESSION_EVALUATOR_SCOPE_PROVIDER, applyFilterArray, applyPagination, applyQueryArray, applySortArray, applySystemActionDefault, cleanDeep, extractNestedFieldsWildcard, extractTextFromHtml, extractValue, getChangedPaths, getDetailedChanges, getEnumValues, getNestedKeys, getSmart, getSystemActions, objectKeyValueTransforms, resolvePlatformScopeKey, resolvePlatformScopeName, setSmart };
1976
2065
  //# sourceMappingURL=acorex-platform-core.mjs.map