@acorex/platform 20.2.4-next.9 → 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 -71
- package/fesm2022/acorex-platform-common.mjs +9 -19
- package/fesm2022/acorex-platform-common.mjs.map +1 -1
- package/fesm2022/acorex-platform-core.mjs +158 -113
- 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 +46 -1087
- 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 +1064 -3100
- package/fesm2022/acorex-platform-layout-entity.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-views.mjs +72 -332
- 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 +1442 -2641
- 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 +20 -217
- package/layout/designer/index.d.ts +47 -16
- package/layout/entity/index.d.ts +336 -196
- package/layout/views/index.d.ts +21 -118
- package/package.json +37 -23
- package/widgets/index.d.ts +224 -275
- package/workflow/index.d.ts +1 -3
- 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
|
}
|
|
@@ -1840,7 +1738,6 @@ class AXPDistributedEventListenerService {
|
|
|
1840
1738
|
constructor() {
|
|
1841
1739
|
//#region ---- Providers & Caches ----
|
|
1842
1740
|
this.listenerProviders = inject(AXP_DISTRIBUTED_EVENT_LISTENER_PROVIDER, { optional: true }) || [];
|
|
1843
|
-
this.injector = inject(Injector);
|
|
1844
1741
|
/** Cache for listeners by key. */
|
|
1845
1742
|
this.listenersByKey = new Map();
|
|
1846
1743
|
/** Flag to track if providers have been loaded */
|
|
@@ -1859,7 +1756,7 @@ class AXPDistributedEventListenerService {
|
|
|
1859
1756
|
// Execute all listeners in parallel
|
|
1860
1757
|
const promises = listeners.map(listener => {
|
|
1861
1758
|
try {
|
|
1862
|
-
return Promise.resolve(
|
|
1759
|
+
return Promise.resolve(listener.execute(data));
|
|
1863
1760
|
}
|
|
1864
1761
|
catch (error) {
|
|
1865
1762
|
console.error(`Error executing listener for event key '${key}':`, error);
|
|
@@ -1923,9 +1820,157 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImpor
|
|
|
1923
1820
|
}]
|
|
1924
1821
|
}] });
|
|
1925
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
|
+
|
|
1926
1971
|
/**
|
|
1927
1972
|
* Generated bundle index. Do not edit.
|
|
1928
1973
|
*/
|
|
1929
1974
|
|
|
1930
|
-
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 };
|
|
1931
1976
|
//# sourceMappingURL=acorex-platform-core.mjs.map
|