@acorex/platform 20.3.0-next.0 → 20.3.0-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/common/index.d.ts +5 -119
- package/core/index.d.ts +67 -72
- package/fesm2022/acorex-platform-auth.mjs +1 -1
- package/fesm2022/acorex-platform-auth.mjs.map +1 -1
- package/fesm2022/acorex-platform-common.mjs +11 -35
- package/fesm2022/acorex-platform-common.mjs.map +1 -1
- package/fesm2022/acorex-platform-core.mjs +164 -142
- package/fesm2022/acorex-platform-core.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-builder.mjs +638 -1168
- package/fesm2022/acorex-platform-layout-builder.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-components.mjs +51 -1439
- package/fesm2022/acorex-platform-layout-components.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-designer.mjs +137 -92
- package/fesm2022/acorex-platform-layout-designer.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-entity.mjs +1059 -3204
- package/fesm2022/acorex-platform-layout-entity.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-views.mjs +72 -373
- package/fesm2022/acorex-platform-layout-views.mjs.map +1 -1
- package/fesm2022/acorex-platform-themes-default-create-entity-view.component-SY0oMDoH.mjs +22 -0
- package/fesm2022/acorex-platform-themes-default-create-entity-view.component-SY0oMDoH.mjs.map +1 -0
- package/fesm2022/{acorex-platform-themes-default-entity-master-create-view.component-I7Eq8Nti.mjs → acorex-platform-themes-default-entity-master-create-view.component-hHXxHlFG.mjs} +3 -3
- package/fesm2022/{acorex-platform-themes-default-entity-master-create-view.component-I7Eq8Nti.mjs.map → acorex-platform-themes-default-entity-master-create-view.component-hHXxHlFG.mjs.map} +1 -1
- package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-hf4QOz_4.mjs +665 -0
- package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-hf4QOz_4.mjs.map +1 -0
- package/fesm2022/{acorex-platform-themes-default-entity-master-modify-view.component-16sdMBvH.mjs → acorex-platform-themes-default-entity-master-modify-view.component-DC3MrDtI.mjs} +10 -3
- package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-DC3MrDtI.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-default-entity-master-single-view.component-Bb90PeHq.mjs +236 -0
- package/fesm2022/acorex-platform-themes-default-entity-master-single-view.component-Bb90PeHq.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-default.mjs +484 -39
- package/fesm2022/acorex-platform-themes-default.mjs.map +1 -1
- package/fesm2022/{acorex-platform-themes-shared-theme-color-chooser-column.component-DjKLg513.mjs → acorex-platform-themes-shared-color-chooser-column.component-DjKLg513.mjs} +1 -1
- package/fesm2022/acorex-platform-themes-shared-color-chooser-column.component-DjKLg513.mjs.map +1 -0
- package/fesm2022/{acorex-platform-themes-shared-theme-color-chooser-view.component-DE0wO98F.mjs → acorex-platform-themes-shared-color-chooser-view.component-DE0wO98F.mjs} +1 -1
- package/fesm2022/acorex-platform-themes-shared-color-chooser-view.component-DE0wO98F.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-shared.mjs +13 -11
- package/fesm2022/acorex-platform-themes-shared.mjs.map +1 -1
- package/fesm2022/{acorex-platform-widgets-button-widget-designer.component-BJtkWusr.mjs → acorex-platform-widgets-button-widget-designer.component-lNF95FJv.mjs} +3 -3
- package/fesm2022/acorex-platform-widgets-button-widget-designer.component-lNF95FJv.mjs.map +1 -0
- package/fesm2022/{acorex-platform-widgets-checkbox-widget-column.component-DeKpl0uK.mjs → acorex-platform-widgets-checkbox-widget-column.component-BNBOATPB.mjs} +2 -1
- package/fesm2022/acorex-platform-widgets-checkbox-widget-column.component-BNBOATPB.mjs.map +1 -0
- package/fesm2022/{acorex-platform-widgets-checkbox-widget-designer.component-Cv7dEMCm.mjs → acorex-platform-widgets-checkbox-widget-designer.component-BI18uzNZ.mjs} +2 -2
- package/fesm2022/acorex-platform-widgets-checkbox-widget-designer.component-BI18uzNZ.mjs.map +1 -0
- package/fesm2022/{acorex-platform-widgets-color-box-widget-designer.component-CohkI1w1.mjs → acorex-platform-widgets-color-box-widget-designer.component-pYOQv5g8.mjs} +2 -2
- package/fesm2022/acorex-platform-widgets-color-box-widget-designer.component-pYOQv5g8.mjs.map +1 -0
- package/fesm2022/{acorex-platform-widgets-file-list-popup.component-BafU5Lfl.mjs → acorex-platform-widgets-file-list-popup.component-DFbPO0ud.mjs} +4 -69
- package/fesm2022/acorex-platform-widgets-file-list-popup.component-DFbPO0ud.mjs.map +1 -0
- package/fesm2022/{acorex-platform-widgets-page-widget-designer.component-Cw9WcZze.mjs → acorex-platform-widgets-page-widget-designer.component-DRsLkulH.mjs} +64 -74
- package/fesm2022/acorex-platform-widgets-page-widget-designer.component-DRsLkulH.mjs.map +1 -0
- package/fesm2022/{acorex-platform-widgets-tabular-data-edit-popup.component-BDQIfr0g.mjs → acorex-platform-widgets-tabular-data-edit-popup.component-nLZYiPnF.mjs} +5 -5
- package/fesm2022/{acorex-platform-widgets-tabular-data-edit-popup.component-BDQIfr0g.mjs.map → acorex-platform-widgets-tabular-data-edit-popup.component-nLZYiPnF.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-widgets-tabular-data-view-popup.component-CmPqtt0G.mjs → acorex-platform-widgets-tabular-data-view-popup.component-D6kiasYM.mjs} +3 -3
- package/fesm2022/{acorex-platform-widgets-tabular-data-view-popup.component-CmPqtt0G.mjs.map → acorex-platform-widgets-tabular-data-view-popup.component-D6kiasYM.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-widgets-text-block-widget-designer.component-DaR4Nkv4.mjs → acorex-platform-widgets-text-block-widget-designer.component-CCMQtH3e.mjs} +12 -8
- package/fesm2022/acorex-platform-widgets-text-block-widget-designer.component-CCMQtH3e.mjs.map +1 -0
- package/fesm2022/acorex-platform-widgets.mjs +1498 -2707
- package/fesm2022/acorex-platform-widgets.mjs.map +1 -1
- package/fesm2022/acorex-platform-workflow.mjs +0 -3
- package/fesm2022/acorex-platform-workflow.mjs.map +1 -1
- package/layout/builder/index.d.ts +181 -367
- package/layout/components/index.d.ts +25 -372
- package/layout/designer/index.d.ts +47 -16
- package/layout/entity/index.d.ts +336 -222
- package/layout/views/index.d.ts +22 -129
- package/package.json +36 -22
- package/widgets/index.d.ts +224 -275
- package/workflow/index.d.ts +1 -4
- package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-D3VUh8K8.mjs +0 -707
- package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-D3VUh8K8.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-16sdMBvH.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-entity-master-single-view.component-BMkhNfF4.mjs +0 -244
- package/fesm2022/acorex-platform-themes-default-entity-master-single-view.component-BMkhNfF4.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-column.component-DjKLg513.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-view.component-DE0wO98F.mjs.map +0 -1
- package/fesm2022/acorex-platform-widgets-button-widget-designer.component-BJtkWusr.mjs.map +0 -1
- package/fesm2022/acorex-platform-widgets-checkbox-widget-column.component-DeKpl0uK.mjs.map +0 -1
- package/fesm2022/acorex-platform-widgets-checkbox-widget-designer.component-Cv7dEMCm.mjs.map +0 -1
- package/fesm2022/acorex-platform-widgets-color-box-widget-designer.component-CohkI1w1.mjs.map +0 -1
- package/fesm2022/acorex-platform-widgets-extra-properties-schema-widget-edit.component-B3SJUnGQ.mjs +0 -50
- package/fesm2022/acorex-platform-widgets-extra-properties-schema-widget-edit.component-B3SJUnGQ.mjs.map +0 -1
- package/fesm2022/acorex-platform-widgets-extra-properties-schema-widget-view.component-BLR0JkRt.mjs +0 -42
- package/fesm2022/acorex-platform-widgets-extra-properties-schema-widget-view.component-BLR0JkRt.mjs.map +0 -1
- package/fesm2022/acorex-platform-widgets-extra-properties-values-widget-edit.component-hzR2FgOm.mjs +0 -55
- package/fesm2022/acorex-platform-widgets-extra-properties-values-widget-edit.component-hzR2FgOm.mjs.map +0 -1
- package/fesm2022/acorex-platform-widgets-extra-properties-values-widget-view.component-IDm6Clua.mjs +0 -50
- package/fesm2022/acorex-platform-widgets-extra-properties-values-widget-view.component-IDm6Clua.mjs.map +0 -1
- package/fesm2022/acorex-platform-widgets-extra-properties-widget-edit.component-BRO9tYDa.mjs +0 -48
- package/fesm2022/acorex-platform-widgets-extra-properties-widget-edit.component-BRO9tYDa.mjs.map +0 -1
- package/fesm2022/acorex-platform-widgets-extra-properties-widget-view.component-CkpLimyW.mjs +0 -42
- package/fesm2022/acorex-platform-widgets-extra-properties-widget-view.component-CkpLimyW.mjs.map +0 -1
- package/fesm2022/acorex-platform-widgets-file-list-popup.component-BafU5Lfl.mjs.map +0 -1
- package/fesm2022/acorex-platform-widgets-page-widget-designer.component-Cw9WcZze.mjs.map +0 -1
- package/fesm2022/acorex-platform-widgets-text-block-widget-designer.component-DaR4Nkv4.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,
|
|
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';
|
|
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
|
|
4
|
+
import { computed, InjectionToken, inject, Injectable, input, effect, Directive, EventEmitter, HostListener, Output, ViewContainerRef, ElementRef, provideAppInitializer, signal, Pipe } 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,6 +107,7 @@ function extractValue(value, key = 'id') {
|
|
|
107
107
|
if (isNil(value)) {
|
|
108
108
|
return null;
|
|
109
109
|
}
|
|
110
|
+
;
|
|
110
111
|
return isObjectLike(value) ? get(value, key) : value;
|
|
111
112
|
}
|
|
112
113
|
function cleanDeep(obj) {
|
|
@@ -125,114 +126,6 @@ function cleanDeep(obj) {
|
|
|
125
126
|
}
|
|
126
127
|
});
|
|
127
128
|
}
|
|
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
|
-
}
|
|
236
129
|
|
|
237
130
|
class AXPContextChangeEvent {
|
|
238
131
|
}
|
|
@@ -699,6 +592,11 @@ class AXPContentCheckerDirective {
|
|
|
699
592
|
this.elementRef = inject((ElementRef));
|
|
700
593
|
this.isEmpty = computed(() => this.viewContainerRef.length === 0, ...(ngDevMode ? [{ debugName: "isEmpty" }] : []));
|
|
701
594
|
}
|
|
595
|
+
ngAfterViewInit() {
|
|
596
|
+
setTimeout(() => {
|
|
597
|
+
console.log(this.elementRef.nativeElement.childNodes);
|
|
598
|
+
}, 1000);
|
|
599
|
+
}
|
|
702
600
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPContentCheckerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
703
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 }); }
|
|
704
602
|
}
|
|
@@ -716,11 +614,10 @@ class AXPBroadcastEventService {
|
|
|
716
614
|
this.eventSubjects = new Map();
|
|
717
615
|
this.pendingRequests = new Map();
|
|
718
616
|
this.multiTabEventHistory = new Set(); // Prevent duplicate processing of the same event
|
|
719
|
-
this.instanceId = AXPDataGenerator.uuid();
|
|
720
617
|
this.channel = new BroadcastChannel('platform_global_events');
|
|
721
618
|
// Handle incoming messages
|
|
722
619
|
this.channel.onmessage = (event) => {
|
|
723
|
-
const { type, payload, requestId, response
|
|
620
|
+
const { type, payload, requestId, response } = event.data;
|
|
724
621
|
// Prevent processing the same event multiple times (multi-tab synchronization)
|
|
725
622
|
if (requestId && this.multiTabEventHistory.has(requestId)) {
|
|
726
623
|
return;
|
|
@@ -736,10 +633,6 @@ class AXPBroadcastEventService {
|
|
|
736
633
|
return;
|
|
737
634
|
}
|
|
738
635
|
// 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
|
-
}
|
|
743
636
|
if (type && this.eventSubjects.has(type)) {
|
|
744
637
|
this.eventSubjects.get(type).next({ data: payload, requestId });
|
|
745
638
|
}
|
|
@@ -749,11 +642,7 @@ class AXPBroadcastEventService {
|
|
|
749
642
|
* Publish an event without expecting a response
|
|
750
643
|
*/
|
|
751
644
|
publish(type, payload) {
|
|
752
|
-
this.channel.postMessage({ type, payload
|
|
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
|
-
}
|
|
645
|
+
this.channel.postMessage({ type, payload });
|
|
757
646
|
}
|
|
758
647
|
/**
|
|
759
648
|
* Subscribe to an event
|
|
@@ -776,11 +665,7 @@ class AXPBroadcastEventService {
|
|
|
776
665
|
/**
|
|
777
666
|
* Send a message and wait for a response with retry logic
|
|
778
667
|
*/
|
|
779
|
-
async sendAndWaitForResponse(type, payload, options = {
|
|
780
|
-
timeout: 60 * 60 * 1000,
|
|
781
|
-
retries: 3,
|
|
782
|
-
retryDelay: 1000,
|
|
783
|
-
}) {
|
|
668
|
+
async sendAndWaitForResponse(type, payload, options = { timeout: 60 * 60 * 1000, retries: 3, retryDelay: 1000 }) {
|
|
784
669
|
const requestId = AXPDataGenerator.uuid();
|
|
785
670
|
const attemptRequest = (attempt) => {
|
|
786
671
|
return new Promise((resolve, reject) => {
|
|
@@ -834,7 +719,7 @@ class AXPBroadcastEventService {
|
|
|
834
719
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPBroadcastEventService, decorators: [{
|
|
835
720
|
type: Injectable,
|
|
836
721
|
args: [{
|
|
837
|
-
providedIn: 'root'
|
|
722
|
+
providedIn: 'root'
|
|
838
723
|
}]
|
|
839
724
|
}], ctorParameters: () => [] });
|
|
840
725
|
|
|
@@ -1528,46 +1413,38 @@ function applyCondition(item, condition) {
|
|
|
1528
1413
|
if (!conditionType) {
|
|
1529
1414
|
return true;
|
|
1530
1415
|
}
|
|
1531
|
-
|
|
1532
|
-
switch (op) {
|
|
1416
|
+
switch (conditionType) {
|
|
1533
1417
|
case 'equal':
|
|
1534
|
-
case 'eq':
|
|
1535
1418
|
result = isEqual(valueToCompare, conditionValue);
|
|
1536
1419
|
if (loggingEnabled) {
|
|
1537
1420
|
console.log('Equal check result:', result);
|
|
1538
1421
|
}
|
|
1539
1422
|
break;
|
|
1540
1423
|
case 'notEqual':
|
|
1541
|
-
case 'ne':
|
|
1542
|
-
case 'neq':
|
|
1543
1424
|
result = !isEqual(valueToCompare, conditionValue);
|
|
1544
1425
|
if (loggingEnabled) {
|
|
1545
1426
|
console.log('Not equal check result:', result);
|
|
1546
1427
|
}
|
|
1547
1428
|
break;
|
|
1548
1429
|
case 'greaterThan':
|
|
1549
|
-
case 'gt':
|
|
1550
1430
|
result = gt(valueToCompare, conditionValue);
|
|
1551
1431
|
if (loggingEnabled) {
|
|
1552
1432
|
console.log('Greater than check result:', result);
|
|
1553
1433
|
}
|
|
1554
1434
|
break;
|
|
1555
1435
|
case 'lessThan':
|
|
1556
|
-
case 'lt':
|
|
1557
1436
|
result = lt(valueToCompare, conditionValue);
|
|
1558
1437
|
if (loggingEnabled) {
|
|
1559
1438
|
console.log('Less than check result:', result);
|
|
1560
1439
|
}
|
|
1561
1440
|
break;
|
|
1562
1441
|
case 'greaterThanOrEqual':
|
|
1563
|
-
case 'gte':
|
|
1564
1442
|
result = gte(valueToCompare, conditionValue);
|
|
1565
1443
|
if (loggingEnabled) {
|
|
1566
1444
|
console.log('Greater than or equal check result:', result);
|
|
1567
1445
|
}
|
|
1568
1446
|
break;
|
|
1569
1447
|
case 'lessThanOrEqual':
|
|
1570
|
-
case 'lte':
|
|
1571
1448
|
result = lte(valueToCompare, conditionValue);
|
|
1572
1449
|
if (loggingEnabled) {
|
|
1573
1450
|
console.log('Less than or equal check result:', result);
|
|
@@ -1664,9 +1541,7 @@ function applyCondition(item, condition) {
|
|
|
1664
1541
|
console.log('Default case, returning true');
|
|
1665
1542
|
}
|
|
1666
1543
|
}
|
|
1667
|
-
|
|
1668
|
-
const isNegative = !!condition?.operator?.negative;
|
|
1669
|
-
return isNegative ? !result : result;
|
|
1544
|
+
return result;
|
|
1670
1545
|
}
|
|
1671
1546
|
function applyFilterArray(dataArray, filters, logic = 'and') {
|
|
1672
1547
|
if (filters && filters.length) {
|
|
@@ -1863,7 +1738,6 @@ class AXPDistributedEventListenerService {
|
|
|
1863
1738
|
constructor() {
|
|
1864
1739
|
//#region ---- Providers & Caches ----
|
|
1865
1740
|
this.listenerProviders = inject(AXP_DISTRIBUTED_EVENT_LISTENER_PROVIDER, { optional: true }) || [];
|
|
1866
|
-
this.injector = inject(Injector);
|
|
1867
1741
|
/** Cache for listeners by key. */
|
|
1868
1742
|
this.listenersByKey = new Map();
|
|
1869
1743
|
/** Flag to track if providers have been loaded */
|
|
@@ -1882,7 +1756,7 @@ class AXPDistributedEventListenerService {
|
|
|
1882
1756
|
// Execute all listeners in parallel
|
|
1883
1757
|
const promises = listeners.map(listener => {
|
|
1884
1758
|
try {
|
|
1885
|
-
return Promise.resolve(
|
|
1759
|
+
return Promise.resolve(listener.execute(data));
|
|
1886
1760
|
}
|
|
1887
1761
|
catch (error) {
|
|
1888
1762
|
console.error(`Error executing listener for event key '${key}':`, error);
|
|
@@ -1946,9 +1820,157 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImpor
|
|
|
1946
1820
|
}]
|
|
1947
1821
|
}] });
|
|
1948
1822
|
|
|
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 {
|
|
1829
|
+
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;
|
|
1885
|
+
}
|
|
1886
|
+
/**
|
|
1887
|
+
* Check if an entity event key matches a wildcard pattern
|
|
1888
|
+
* Only supports entity patterns (entity.*)
|
|
1889
|
+
*/
|
|
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);
|
|
1901
|
+
}
|
|
1902
|
+
/**
|
|
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')
|
|
1906
|
+
*/
|
|
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;
|
|
1920
|
+
}
|
|
1921
|
+
/**
|
|
1922
|
+
* Convenience methods for specific operations
|
|
1923
|
+
*/
|
|
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' }); }
|
|
1935
|
+
}
|
|
1936
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: AXPEntityEventDispatcherService, decorators: [{
|
|
1937
|
+
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
|
|
1969
|
+
}] });
|
|
1970
|
+
|
|
1949
1971
|
/**
|
|
1950
1972
|
* Generated bundle index. Do not edit.
|
|
1951
1973
|
*/
|
|
1952
1974
|
|
|
1953
|
-
export { AXHighlightService, AXPActivityLogProvider, AXPActivityLogService, AXPAppStartUpProvider, AXPAppStartUpService, AXPBroadcastEventService, AXPComponentLogoConfig, AXPContentCheckerDirective, AXPContextChangeEvent, AXPContextStore, AXPCountdownPipe, AXPDataGenerator, AXPDataSourceDefinitionProviderService, AXPDblClickDirective, AXPDistributedEventListenerService, AXPElementDataDirective, 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, applyFilterArray, applyPagination, applyQueryArray, applySortArray, applySystemActionDefault, cleanDeep, extractNestedFieldsWildcard, extractTextFromHtml, extractValue,
|
|
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 };
|
|
1954
1976
|
//# sourceMappingURL=acorex-platform-core.mjs.map
|