@acorex/platform 21.0.0-next.2 → 21.0.0-next.5
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/auth/index.d.ts +97 -238
- package/common/index.d.ts +783 -213
- package/core/index.d.ts +311 -442
- package/fesm2022/acorex-platform-auth.mjs +156 -200
- package/fesm2022/acorex-platform-auth.mjs.map +1 -1
- package/fesm2022/acorex-platform-common.mjs +1038 -127
- package/fesm2022/acorex-platform-common.mjs.map +1 -1
- package/fesm2022/acorex-platform-core.mjs +602 -413
- package/fesm2022/acorex-platform-core.mjs.map +1 -1
- package/fesm2022/acorex-platform-domain.mjs +54 -11
- package/fesm2022/acorex-platform-domain.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-builder.mjs +412 -270
- package/fesm2022/acorex-platform-layout-builder.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-components.mjs +2100 -3141
- package/fesm2022/acorex-platform-layout-components.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-designer.mjs +7 -7
- package/fesm2022/acorex-platform-layout-designer.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-entity.mjs +730 -652
- package/fesm2022/acorex-platform-layout-entity.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-views.mjs +4 -4
- package/fesm2022/acorex-platform-layout-views.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-widget-core.mjs +249 -205
- package/fesm2022/acorex-platform-layout-widget-core.mjs.map +1 -1
- package/fesm2022/{acorex-platform-layout-widgets-file-list-popup.component-D0y-9nE5.mjs → acorex-platform-layout-widgets-file-list-popup.component-CxrsI6Hn.mjs} +2 -2
- package/fesm2022/acorex-platform-layout-widgets-file-list-popup.component-CxrsI6Hn.mjs.map +1 -0
- package/fesm2022/{acorex-platform-layout-widgets-tabular-data-edit-popup.component-m8rHZP8L.mjs → acorex-platform-layout-widgets-tabular-data-edit-popup.component-Ck7-wpT2.mjs} +2 -2
- package/fesm2022/acorex-platform-layout-widgets-tabular-data-edit-popup.component-Ck7-wpT2.mjs.map +1 -0
- package/fesm2022/acorex-platform-layout-widgets.mjs +3066 -1040
- package/fesm2022/acorex-platform-layout-widgets.mjs.map +1 -1
- package/fesm2022/{acorex-platform-themes-default-entity-master-create-view.component-mARj77Mr.mjs → acorex-platform-themes-default-entity-master-create-view.component-VIGuU5M4.mjs} +26 -5
- package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-VIGuU5M4.mjs.map +1 -0
- package/fesm2022/{acorex-platform-themes-default-entity-master-list-view.component-Cym8pq0v.mjs → acorex-platform-themes-default-entity-master-list-view.component-DyDa_hyd.mjs} +4 -5
- package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-DyDa_hyd.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-Ua3ZA5hk.mjs +101 -0
- package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-Ua3ZA5hk.mjs.map +1 -0
- package/fesm2022/{acorex-platform-themes-default-entity-master-single-view.component-B_P0a5KW.mjs → acorex-platform-themes-default-entity-master-single-view.component-eMBby9k4.mjs} +3 -3
- package/fesm2022/acorex-platform-themes-default-entity-master-single-view.component-eMBby9k4.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-default.mjs +166 -30
- package/fesm2022/acorex-platform-themes-default.mjs.map +1 -1
- package/fesm2022/acorex-platform-themes-shared.mjs +27 -27
- package/fesm2022/acorex-platform-themes-shared.mjs.map +1 -1
- package/fesm2022/acorex-platform-workflow.mjs +474 -1527
- package/fesm2022/acorex-platform-workflow.mjs.map +1 -1
- package/layout/builder/index.d.ts +4 -1
- package/layout/components/index.d.ts +405 -327
- package/layout/designer/index.d.ts +3 -3
- package/layout/entity/index.d.ts +154 -108
- package/layout/widget-core/index.d.ts +39 -52
- package/layout/widgets/index.d.ts +368 -54
- package/package.json +9 -9
- package/themes/default/index.d.ts +15 -2
- package/themes/shared/index.d.ts +10 -10
- package/workflow/index.d.ts +182 -817
- package/fesm2022/acorex-platform-layout-widgets-extra-properties-schema-widget-edit.component-fhhZOWul.mjs +0 -50
- package/fesm2022/acorex-platform-layout-widgets-extra-properties-schema-widget-edit.component-fhhZOWul.mjs.map +0 -1
- package/fesm2022/acorex-platform-layout-widgets-extra-properties-schema-widget-view.component-C3Qbs0fz.mjs +0 -42
- package/fesm2022/acorex-platform-layout-widgets-extra-properties-schema-widget-view.component-C3Qbs0fz.mjs.map +0 -1
- package/fesm2022/acorex-platform-layout-widgets-extra-properties-values-widget-edit.component-CngQBUlN.mjs +0 -55
- package/fesm2022/acorex-platform-layout-widgets-extra-properties-values-widget-edit.component-CngQBUlN.mjs.map +0 -1
- package/fesm2022/acorex-platform-layout-widgets-extra-properties-values-widget-view.component-DSNo9e4W.mjs +0 -50
- package/fesm2022/acorex-platform-layout-widgets-extra-properties-values-widget-view.component-DSNo9e4W.mjs.map +0 -1
- package/fesm2022/acorex-platform-layout-widgets-extra-properties-widget-edit.component-CL0CwEHX.mjs +0 -48
- package/fesm2022/acorex-platform-layout-widgets-extra-properties-widget-edit.component-CL0CwEHX.mjs.map +0 -1
- package/fesm2022/acorex-platform-layout-widgets-extra-properties-widget-view.component-B6Fi0xTw.mjs +0 -42
- package/fesm2022/acorex-platform-layout-widgets-extra-properties-widget-view.component-B6Fi0xTw.mjs.map +0 -1
- package/fesm2022/acorex-platform-layout-widgets-file-list-popup.component-D0y-9nE5.mjs.map +0 -1
- package/fesm2022/acorex-platform-layout-widgets-tabular-data-edit-popup.component-m8rHZP8L.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-mARj77Mr.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-Cym8pq0v.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-BTA6h7Xd.mjs +0 -101
- package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-BTA6h7Xd.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-entity-master-single-view.component-B_P0a5KW.mjs.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { InjectionToken, inject, Injectable, computed, input, effect, Directive, EventEmitter, HostListener, Output, ViewContainerRef, ElementRef, Injector, runInInjectionContext, provideAppInitializer,
|
|
2
|
+
import { InjectionToken, inject, Injectable, computed, input, effect, Directive, EventEmitter, HostListener, Output, ViewContainerRef, ElementRef, signal, output, DestroyRef, Renderer2, untracked, Injector, runInInjectionContext, provideAppInitializer, NgModule, Pipe } from '@angular/core';
|
|
3
3
|
import { signalStore, withState, withComputed, withMethods, patchState } from '@ngrx/signals';
|
|
4
4
|
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';
|
|
5
5
|
import { Subject, interval, fromEvent } from 'rxjs';
|
|
@@ -115,6 +115,41 @@ class AXPColorPaletteService {
|
|
|
115
115
|
this.cache = null;
|
|
116
116
|
await this.loadPalettes();
|
|
117
117
|
}
|
|
118
|
+
/**
|
|
119
|
+
* Get the default palette (material-design) or fallback colors
|
|
120
|
+
* @returns Promise of default palette, never returns undefined
|
|
121
|
+
*/
|
|
122
|
+
async getDefaultPalette() {
|
|
123
|
+
const defaultPalette = await this.getPalette('material-design');
|
|
124
|
+
if (defaultPalette) {
|
|
125
|
+
return defaultPalette;
|
|
126
|
+
}
|
|
127
|
+
// Fallback to hardcoded material design colors if provider fails
|
|
128
|
+
return {
|
|
129
|
+
name: 'material-design',
|
|
130
|
+
title: 'Material Design',
|
|
131
|
+
category: 'material',
|
|
132
|
+
description: 'Google Material Design color palette',
|
|
133
|
+
colors: [
|
|
134
|
+
'#F44336', // Red
|
|
135
|
+
'#E91E63', // Pink
|
|
136
|
+
'#9C27B0', // Purple
|
|
137
|
+
'#673AB7', // Deep Purple
|
|
138
|
+
'#3F51B5', // Indigo
|
|
139
|
+
'#2196F3', // Blue
|
|
140
|
+
'#03A9F4', // Light Blue
|
|
141
|
+
'#00BCD4', // Cyan
|
|
142
|
+
'#009688', // Teal
|
|
143
|
+
'#4CAF50', // Green
|
|
144
|
+
'#8BC34A', // Light Green
|
|
145
|
+
'#CDDC39', // Lime
|
|
146
|
+
'#FFEB3B', // Yellow
|
|
147
|
+
'#FFC107', // Amber
|
|
148
|
+
'#FF9800', // Orange
|
|
149
|
+
'#FF5722', // Deep Orange
|
|
150
|
+
],
|
|
151
|
+
};
|
|
152
|
+
}
|
|
118
153
|
//#endregion
|
|
119
154
|
//#region ---- Private Methods ----
|
|
120
155
|
/**
|
|
@@ -770,6 +805,10 @@ class AXPDataGenerator {
|
|
|
770
805
|
const country = this.country();
|
|
771
806
|
return `${streetNumber} ${street}, ${city}, ${state} ${zip}, ${country}`;
|
|
772
807
|
}
|
|
808
|
+
static avatar() {
|
|
809
|
+
return `https://avatar.iran.liara.run/public/${this.pick([35, 22, 16, 6, 31])}`;
|
|
810
|
+
//return `https://i.pravatar.cc/300?u=${this.uuid()}`;
|
|
811
|
+
}
|
|
773
812
|
}
|
|
774
813
|
|
|
775
814
|
function objectKeyValueTransforms(keyName) {
|
|
@@ -790,6 +829,7 @@ class AXPDataSourceDefinitionProviderService {
|
|
|
790
829
|
}
|
|
791
830
|
async items() {
|
|
792
831
|
const items = [];
|
|
832
|
+
// Load from DI tokens
|
|
793
833
|
if (Array.isArray(this.providers)) {
|
|
794
834
|
for (const provider of this.providers) {
|
|
795
835
|
set(provider, '__parent__', this);
|
|
@@ -966,6 +1006,203 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImpo
|
|
|
966
1006
|
}]
|
|
967
1007
|
}] });
|
|
968
1008
|
|
|
1009
|
+
//#region ---- Imports ----
|
|
1010
|
+
//#endregion
|
|
1011
|
+
//#region ---- Directive ----
|
|
1012
|
+
/**
|
|
1013
|
+
* Fullscreen directive that provides CSS-based fullscreen functionality
|
|
1014
|
+
* Usage: <element axFullscreen #fullscreen="axFullscreen"></element>
|
|
1015
|
+
* Then: fullscreen.toggle() or fullscreen.enter() or fullscreen.exit()
|
|
1016
|
+
*/
|
|
1017
|
+
class AXFullscreenDirective {
|
|
1018
|
+
constructor(elementRef) {
|
|
1019
|
+
this.elementRef = elementRef;
|
|
1020
|
+
//#region ---- Properties ----
|
|
1021
|
+
/**
|
|
1022
|
+
* Current fullscreen state
|
|
1023
|
+
*/
|
|
1024
|
+
this.isFullscreenState = signal(false, ...(ngDevMode ? [{ debugName: "isFullscreenState" }] : []));
|
|
1025
|
+
/**
|
|
1026
|
+
* Original element styles to restore
|
|
1027
|
+
*/
|
|
1028
|
+
this.originalStyles = {};
|
|
1029
|
+
/**
|
|
1030
|
+
* Original parent element reference
|
|
1031
|
+
*/
|
|
1032
|
+
this.originalParent = null;
|
|
1033
|
+
/**
|
|
1034
|
+
* Fullscreen container element
|
|
1035
|
+
*/
|
|
1036
|
+
this.fullscreenContainer = null;
|
|
1037
|
+
/**
|
|
1038
|
+
* Fullscreen change event
|
|
1039
|
+
*/
|
|
1040
|
+
this.fullscreenChange = output();
|
|
1041
|
+
//#endregion
|
|
1042
|
+
//#region ---- Constructor ----
|
|
1043
|
+
this.destroyRef = inject(DestroyRef);
|
|
1044
|
+
this.renderer = inject(Renderer2);
|
|
1045
|
+
// Sync state changes to output
|
|
1046
|
+
effect(() => {
|
|
1047
|
+
const isFullscreen = this.isFullscreenState();
|
|
1048
|
+
untracked(() => {
|
|
1049
|
+
this.fullscreenChange.emit(isFullscreen);
|
|
1050
|
+
});
|
|
1051
|
+
});
|
|
1052
|
+
}
|
|
1053
|
+
//#endregion
|
|
1054
|
+
//#region ---- Public API ----
|
|
1055
|
+
/**
|
|
1056
|
+
* Toggle fullscreen state
|
|
1057
|
+
*/
|
|
1058
|
+
async toggle() {
|
|
1059
|
+
if (this.isFullscreenState()) {
|
|
1060
|
+
await this.exit();
|
|
1061
|
+
}
|
|
1062
|
+
else {
|
|
1063
|
+
await this.enter();
|
|
1064
|
+
}
|
|
1065
|
+
}
|
|
1066
|
+
/**
|
|
1067
|
+
* Enter fullscreen mode using CSS
|
|
1068
|
+
*/
|
|
1069
|
+
async enter() {
|
|
1070
|
+
if (this.isFullscreenState()) {
|
|
1071
|
+
return;
|
|
1072
|
+
}
|
|
1073
|
+
const element = this.elementRef.nativeElement;
|
|
1074
|
+
try {
|
|
1075
|
+
// Store original styles and parent
|
|
1076
|
+
this.storeOriginalStyles(element);
|
|
1077
|
+
this.originalParent = element.parentElement;
|
|
1078
|
+
// Create fullscreen container
|
|
1079
|
+
this.fullscreenContainer = this.renderer.createElement('div');
|
|
1080
|
+
this.renderer.setStyle(this.fullscreenContainer, 'position', 'fixed');
|
|
1081
|
+
this.renderer.setStyle(this.fullscreenContainer, 'top', '0');
|
|
1082
|
+
this.renderer.setStyle(this.fullscreenContainer, 'left', '0');
|
|
1083
|
+
this.renderer.setStyle(this.fullscreenContainer, 'width', '100vw');
|
|
1084
|
+
this.renderer.setStyle(this.fullscreenContainer, 'height', '100vh');
|
|
1085
|
+
this.renderer.setStyle(this.fullscreenContainer, 'z-index', '9999');
|
|
1086
|
+
this.renderer.setStyle(this.fullscreenContainer, 'background-color', '#ffffff');
|
|
1087
|
+
this.renderer.setStyle(this.fullscreenContainer, 'overflow', 'auto');
|
|
1088
|
+
// Move element to container
|
|
1089
|
+
this.renderer.appendChild(this.fullscreenContainer, element);
|
|
1090
|
+
// Apply fullscreen styles to element
|
|
1091
|
+
this.renderer.setStyle(element, 'position', 'relative');
|
|
1092
|
+
this.renderer.setStyle(element, 'width', '100%');
|
|
1093
|
+
this.renderer.setStyle(element, 'height', '100%');
|
|
1094
|
+
this.renderer.setStyle(element, 'margin', '0');
|
|
1095
|
+
this.renderer.setStyle(element, 'padding', '0');
|
|
1096
|
+
// Append container to body
|
|
1097
|
+
this.renderer.appendChild(document.body, this.fullscreenContainer);
|
|
1098
|
+
// Prevent body scroll
|
|
1099
|
+
this.renderer.setStyle(document.body, 'overflow', 'hidden');
|
|
1100
|
+
this.isFullscreenState.set(true);
|
|
1101
|
+
}
|
|
1102
|
+
catch (error) {
|
|
1103
|
+
console.error('Error entering fullscreen:', error);
|
|
1104
|
+
this.restoreOriginalStyles(element);
|
|
1105
|
+
}
|
|
1106
|
+
}
|
|
1107
|
+
/**
|
|
1108
|
+
* Exit fullscreen mode
|
|
1109
|
+
*/
|
|
1110
|
+
async exit() {
|
|
1111
|
+
if (!this.isFullscreenState()) {
|
|
1112
|
+
return;
|
|
1113
|
+
}
|
|
1114
|
+
const element = this.elementRef.nativeElement;
|
|
1115
|
+
try {
|
|
1116
|
+
// Restore body scroll
|
|
1117
|
+
this.renderer.removeStyle(document.body, 'overflow');
|
|
1118
|
+
// Move element back to original parent
|
|
1119
|
+
if (this.fullscreenContainer && this.originalParent) {
|
|
1120
|
+
this.renderer.removeChild(this.fullscreenContainer, element);
|
|
1121
|
+
this.renderer.appendChild(this.originalParent, element);
|
|
1122
|
+
// Remove container
|
|
1123
|
+
this.renderer.removeChild(document.body, this.fullscreenContainer);
|
|
1124
|
+
this.fullscreenContainer = null;
|
|
1125
|
+
}
|
|
1126
|
+
// Restore original styles
|
|
1127
|
+
this.restoreOriginalStyles(element);
|
|
1128
|
+
this.isFullscreenState.set(false);
|
|
1129
|
+
}
|
|
1130
|
+
catch (error) {
|
|
1131
|
+
console.error('Error exiting fullscreen:', error);
|
|
1132
|
+
}
|
|
1133
|
+
}
|
|
1134
|
+
/**
|
|
1135
|
+
* Check if currently in fullscreen mode
|
|
1136
|
+
*/
|
|
1137
|
+
isFullscreen() {
|
|
1138
|
+
return this.isFullscreenState();
|
|
1139
|
+
}
|
|
1140
|
+
//#endregion
|
|
1141
|
+
//#region ---- Private Methods ----
|
|
1142
|
+
/**
|
|
1143
|
+
* Store original element styles
|
|
1144
|
+
*/
|
|
1145
|
+
storeOriginalStyles(element) {
|
|
1146
|
+
const computedStyle = window.getComputedStyle(element);
|
|
1147
|
+
this.originalStyles = {
|
|
1148
|
+
position: computedStyle.position,
|
|
1149
|
+
top: computedStyle.top,
|
|
1150
|
+
left: computedStyle.left,
|
|
1151
|
+
width: computedStyle.width,
|
|
1152
|
+
height: computedStyle.height,
|
|
1153
|
+
zIndex: computedStyle.zIndex,
|
|
1154
|
+
backgroundColor: computedStyle.backgroundColor,
|
|
1155
|
+
margin: computedStyle.margin,
|
|
1156
|
+
padding: computedStyle.padding,
|
|
1157
|
+
};
|
|
1158
|
+
}
|
|
1159
|
+
/**
|
|
1160
|
+
* Restore original element styles
|
|
1161
|
+
*/
|
|
1162
|
+
restoreOriginalStyles(element) {
|
|
1163
|
+
if (!this.originalStyles) {
|
|
1164
|
+
return;
|
|
1165
|
+
}
|
|
1166
|
+
// Restore each style property
|
|
1167
|
+
Object.entries(this.originalStyles).forEach(([key, value]) => {
|
|
1168
|
+
const styleKey = this.camelToKebabCase(key);
|
|
1169
|
+
if (value) {
|
|
1170
|
+
this.renderer.setStyle(element, styleKey, value);
|
|
1171
|
+
}
|
|
1172
|
+
else {
|
|
1173
|
+
this.renderer.removeStyle(element, styleKey);
|
|
1174
|
+
}
|
|
1175
|
+
});
|
|
1176
|
+
this.originalStyles = {};
|
|
1177
|
+
}
|
|
1178
|
+
/**
|
|
1179
|
+
* Convert camelCase to kebab-case for CSS properties
|
|
1180
|
+
*/
|
|
1181
|
+
camelToKebabCase(str) {
|
|
1182
|
+
return str.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, '$1-$2').toLowerCase();
|
|
1183
|
+
}
|
|
1184
|
+
//#endregion
|
|
1185
|
+
//#region ---- Lifecycle ----
|
|
1186
|
+
ngOnDestroy() {
|
|
1187
|
+
// Exit fullscreen if still active
|
|
1188
|
+
if (this.isFullscreenState()) {
|
|
1189
|
+
this.exit().catch(() => {
|
|
1190
|
+
// Ignore errors during cleanup
|
|
1191
|
+
});
|
|
1192
|
+
}
|
|
1193
|
+
}
|
|
1194
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXFullscreenDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1195
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.3.12", type: AXFullscreenDirective, isStandalone: true, selector: "[axFullscreen]", outputs: { fullscreenChange: "fullscreenChange" }, exportAs: ["axFullscreen"], ngImport: i0 }); }
|
|
1196
|
+
}
|
|
1197
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXFullscreenDirective, decorators: [{
|
|
1198
|
+
type: Directive,
|
|
1199
|
+
args: [{
|
|
1200
|
+
selector: '[axFullscreen]',
|
|
1201
|
+
standalone: true,
|
|
1202
|
+
exportAs: 'axFullscreen',
|
|
1203
|
+
}]
|
|
1204
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { fullscreenChange: [{ type: i0.Output, args: ["fullscreenChange"] }] } });
|
|
1205
|
+
|
|
969
1206
|
const AXP_DISTRIBUTED_EVENT_LISTENER_PROVIDER = new InjectionToken('AXP_DISTRIBUTED_EVENT_LISTENER_PROVIDER');
|
|
970
1207
|
|
|
971
1208
|
//#region ---- Imports ----
|
|
@@ -1445,6 +1682,289 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImpo
|
|
|
1445
1682
|
args: [{ providedIn: 'root' }]
|
|
1446
1683
|
}] });
|
|
1447
1684
|
|
|
1685
|
+
//#region ---- Imports ----
|
|
1686
|
+
//#endregion
|
|
1687
|
+
|
|
1688
|
+
//#region ---- Provider Interfaces ----
|
|
1689
|
+
/**
|
|
1690
|
+
* Injection token for session service.
|
|
1691
|
+
* Implementation: @acorex/platform/auth
|
|
1692
|
+
*/
|
|
1693
|
+
const AXP_SESSION_SERVICE = new InjectionToken('AXP_SESSION_SERVICE');
|
|
1694
|
+
/**
|
|
1695
|
+
* Injection token for module manifest providers.
|
|
1696
|
+
* Modules register their manifest providers using this token.
|
|
1697
|
+
*/
|
|
1698
|
+
const AXP_MODULE_MANIFEST_PROVIDER = new InjectionToken('AXP_MODULE_MANIFEST_PROVIDER');
|
|
1699
|
+
//#endregion
|
|
1700
|
+
|
|
1701
|
+
//#region ---- Imports ----
|
|
1702
|
+
//#endregion
|
|
1703
|
+
//#region ---- Feature Definition Provider Interface ----
|
|
1704
|
+
/**
|
|
1705
|
+
* Context for feature definition providers.
|
|
1706
|
+
* Allows providers to add additional feature definitions dynamically.
|
|
1707
|
+
*/
|
|
1708
|
+
class AXPFeatureDefinitionProviderContext {
|
|
1709
|
+
constructor() {
|
|
1710
|
+
this.features = new Map();
|
|
1711
|
+
}
|
|
1712
|
+
/**
|
|
1713
|
+
* Add a feature definition.
|
|
1714
|
+
* @param key Full feature key (ModuleName:FeatureKey format with colon separator)
|
|
1715
|
+
* @param definition Feature definition
|
|
1716
|
+
*/
|
|
1717
|
+
addFeature(key, definition) {
|
|
1718
|
+
this.features.set(key, definition);
|
|
1719
|
+
}
|
|
1720
|
+
/**
|
|
1721
|
+
* Get all feature definitions.
|
|
1722
|
+
*/
|
|
1723
|
+
getFeatures() {
|
|
1724
|
+
return this.features;
|
|
1725
|
+
}
|
|
1726
|
+
}
|
|
1727
|
+
/**
|
|
1728
|
+
* Injection token for feature definition providers.
|
|
1729
|
+
*/
|
|
1730
|
+
const AXP_FEATURE_DEFINITION_PROVIDER = new InjectionToken('AXP_FEATURE_DEFINITION_PROVIDER', {
|
|
1731
|
+
providedIn: 'root',
|
|
1732
|
+
factory: () => [],
|
|
1733
|
+
});
|
|
1734
|
+
//#endregion
|
|
1735
|
+
|
|
1736
|
+
//#region ---- Imports ----
|
|
1737
|
+
//#endregion
|
|
1738
|
+
//#region ---- Registry Service ----
|
|
1739
|
+
/**
|
|
1740
|
+
* Registry service for module manifests.
|
|
1741
|
+
* Collects and manages all registered module manifests.
|
|
1742
|
+
*/
|
|
1743
|
+
class AXPModuleManifestRegistry {
|
|
1744
|
+
constructor() {
|
|
1745
|
+
//#region ---- Fields ----
|
|
1746
|
+
this.manifests = new Map();
|
|
1747
|
+
this.featureDefinitions = new Map();
|
|
1748
|
+
this.injector = inject(Injector);
|
|
1749
|
+
this.initializationPromise = null;
|
|
1750
|
+
this.isInitialized = false;
|
|
1751
|
+
}
|
|
1752
|
+
//#endregion
|
|
1753
|
+
//#region ---- Initialization ----
|
|
1754
|
+
/**
|
|
1755
|
+
* Initialize registry by loading all manifest providers.
|
|
1756
|
+
* Should be called during app startup.
|
|
1757
|
+
* Safe to call multiple times - will only initialize once.
|
|
1758
|
+
*/
|
|
1759
|
+
async initialize() {
|
|
1760
|
+
// If already initialized, return immediately
|
|
1761
|
+
if (this.isInitialized) {
|
|
1762
|
+
return;
|
|
1763
|
+
}
|
|
1764
|
+
// If initialization is in progress, wait for it
|
|
1765
|
+
if (this.initializationPromise) {
|
|
1766
|
+
return this.initializationPromise;
|
|
1767
|
+
}
|
|
1768
|
+
// Start initialization
|
|
1769
|
+
this.initializationPromise = this._doInitialize();
|
|
1770
|
+
await this.initializationPromise;
|
|
1771
|
+
}
|
|
1772
|
+
/**
|
|
1773
|
+
* Internal initialization logic.
|
|
1774
|
+
*/
|
|
1775
|
+
async _doInitialize() {
|
|
1776
|
+
// Get manifests from injector (using useValue, they are provided directly)
|
|
1777
|
+
let manifests;
|
|
1778
|
+
try {
|
|
1779
|
+
const injectedManifests = this.injector.get(AXP_MODULE_MANIFEST_PROVIDER, []);
|
|
1780
|
+
manifests = Array.isArray(injectedManifests) ? injectedManifests : injectedManifests ? [injectedManifests] : [];
|
|
1781
|
+
}
|
|
1782
|
+
catch (error) {
|
|
1783
|
+
console.error('Failed to get manifest providers from injector:', error);
|
|
1784
|
+
manifests = [];
|
|
1785
|
+
}
|
|
1786
|
+
// Register all manifests directly
|
|
1787
|
+
const registerPromises = manifests.map(async (manifest) => {
|
|
1788
|
+
try {
|
|
1789
|
+
// Validate manifest
|
|
1790
|
+
if (!manifest) {
|
|
1791
|
+
console.error('Invalid manifest:', manifest);
|
|
1792
|
+
return;
|
|
1793
|
+
}
|
|
1794
|
+
await this.register(manifest);
|
|
1795
|
+
}
|
|
1796
|
+
catch (error) {
|
|
1797
|
+
console.error(`Failed to register manifest:`, error);
|
|
1798
|
+
}
|
|
1799
|
+
});
|
|
1800
|
+
await Promise.all(registerPromises);
|
|
1801
|
+
// Load and register features from all feature definition providers
|
|
1802
|
+
await this.loadFeatureDefinitions();
|
|
1803
|
+
this.isInitialized = true;
|
|
1804
|
+
}
|
|
1805
|
+
//#endregion
|
|
1806
|
+
//#region ---- Manifest Management ----
|
|
1807
|
+
/**
|
|
1808
|
+
* Register a module manifest.
|
|
1809
|
+
*/
|
|
1810
|
+
async register(manifest) {
|
|
1811
|
+
// Validate manifest
|
|
1812
|
+
if (!manifest.name) {
|
|
1813
|
+
throw new Error('Manifest must have a name');
|
|
1814
|
+
}
|
|
1815
|
+
if (!manifest.version) {
|
|
1816
|
+
throw new Error(`Manifest for module '${manifest.name}' must have a version`);
|
|
1817
|
+
}
|
|
1818
|
+
// Register manifest
|
|
1819
|
+
this.manifests.set(manifest.name, manifest);
|
|
1820
|
+
}
|
|
1821
|
+
/**
|
|
1822
|
+
* Get manifest for a module.
|
|
1823
|
+
*/
|
|
1824
|
+
get(moduleName) {
|
|
1825
|
+
return this.manifests.get(moduleName);
|
|
1826
|
+
}
|
|
1827
|
+
/**
|
|
1828
|
+
* Get all registered manifests.
|
|
1829
|
+
*/
|
|
1830
|
+
getAll() {
|
|
1831
|
+
return Array.from(this.manifests.values());
|
|
1832
|
+
}
|
|
1833
|
+
/**
|
|
1834
|
+
* Check if a module manifest is registered.
|
|
1835
|
+
*/
|
|
1836
|
+
has(moduleName) {
|
|
1837
|
+
return this.manifests.has(moduleName);
|
|
1838
|
+
}
|
|
1839
|
+
/**
|
|
1840
|
+
* Load feature definitions from all registered feature definition providers.
|
|
1841
|
+
* Features are automatically associated with modules based on the module name in the feature key.
|
|
1842
|
+
*/
|
|
1843
|
+
async loadFeatureDefinitions() {
|
|
1844
|
+
try {
|
|
1845
|
+
const featureProviders = this.injector.get(AXP_FEATURE_DEFINITION_PROVIDER, []);
|
|
1846
|
+
if (!featureProviders || featureProviders.length === 0) {
|
|
1847
|
+
return;
|
|
1848
|
+
}
|
|
1849
|
+
const context = new AXPFeatureDefinitionProviderContext();
|
|
1850
|
+
// Call all providers to collect features
|
|
1851
|
+
for (const provider of featureProviders) {
|
|
1852
|
+
if (provider instanceof Promise) {
|
|
1853
|
+
// If provider is a promise, resolve it
|
|
1854
|
+
const resolvedProvider = await provider;
|
|
1855
|
+
await resolvedProvider.provide(context);
|
|
1856
|
+
}
|
|
1857
|
+
else {
|
|
1858
|
+
// If provider is a direct instance, use it directly
|
|
1859
|
+
await provider.provide(context);
|
|
1860
|
+
}
|
|
1861
|
+
}
|
|
1862
|
+
// Register all features and associate them with their modules
|
|
1863
|
+
const features = context.getFeatures();
|
|
1864
|
+
for (const [key, definition] of features.entries()) {
|
|
1865
|
+
// Extract module name from key (format: ModuleName:FeatureKey)
|
|
1866
|
+
const [moduleName, ...keyParts] = key.split(':');
|
|
1867
|
+
const shortKey = keyParts.join(':');
|
|
1868
|
+
// Verify that the module exists
|
|
1869
|
+
if (!this.has(moduleName)) {
|
|
1870
|
+
console.warn(`Feature '${key}' references unknown module '${moduleName}'. Skipping.`);
|
|
1871
|
+
continue;
|
|
1872
|
+
}
|
|
1873
|
+
// Register feature definition
|
|
1874
|
+
this.registerFeatureDefinition({
|
|
1875
|
+
...definition,
|
|
1876
|
+
name: key,
|
|
1877
|
+
module: moduleName,
|
|
1878
|
+
key: shortKey,
|
|
1879
|
+
});
|
|
1880
|
+
}
|
|
1881
|
+
}
|
|
1882
|
+
catch (error) {
|
|
1883
|
+
console.error('Failed to load feature definitions:', error);
|
|
1884
|
+
}
|
|
1885
|
+
}
|
|
1886
|
+
//#endregion
|
|
1887
|
+
//#region ---- Feature Definition Management ----
|
|
1888
|
+
/**
|
|
1889
|
+
* Get all feature definitions from all manifests.
|
|
1890
|
+
*/
|
|
1891
|
+
getAllFeatureDefinitions() {
|
|
1892
|
+
return Array.from(this.featureDefinitions.values());
|
|
1893
|
+
}
|
|
1894
|
+
/**
|
|
1895
|
+
* Get feature definition by full name.
|
|
1896
|
+
*/
|
|
1897
|
+
getFeatureDefinition(featureName) {
|
|
1898
|
+
return this.featureDefinitions.get(featureName);
|
|
1899
|
+
}
|
|
1900
|
+
/**
|
|
1901
|
+
* Check if a feature is defined in any manifest.
|
|
1902
|
+
*/
|
|
1903
|
+
isFeatureDefined(featureName) {
|
|
1904
|
+
return this.featureDefinitions.has(featureName);
|
|
1905
|
+
}
|
|
1906
|
+
/**
|
|
1907
|
+
* Get default value for a feature.
|
|
1908
|
+
* Returns undefined if feature is not defined.
|
|
1909
|
+
*/
|
|
1910
|
+
getFeatureDefault(featureName) {
|
|
1911
|
+
const definition = this.getFeatureDefinition(featureName);
|
|
1912
|
+
return definition?.defaultValue;
|
|
1913
|
+
}
|
|
1914
|
+
/**
|
|
1915
|
+
* Get all feature definitions for a specific module.
|
|
1916
|
+
*/
|
|
1917
|
+
getModuleFeatures(moduleName) {
|
|
1918
|
+
return Array.from(this.featureDefinitions.values()).filter((def) => def.module === moduleName);
|
|
1919
|
+
}
|
|
1920
|
+
/**
|
|
1921
|
+
* Register a feature definition dynamically (e.g., from feature definition provider).
|
|
1922
|
+
* Used to add features that are defined at runtime via AXP_FEATURE_DEFINITION_PROVIDER.
|
|
1923
|
+
*/
|
|
1924
|
+
registerFeatureDefinition(definition) {
|
|
1925
|
+
this.featureDefinitions.set(definition.name, definition);
|
|
1926
|
+
}
|
|
1927
|
+
//#endregion
|
|
1928
|
+
//#region ---- Dependency Checking ----
|
|
1929
|
+
/**
|
|
1930
|
+
* Check if module dependencies are satisfied.
|
|
1931
|
+
* Returns array of missing dependencies.
|
|
1932
|
+
* Dependencies can be module names or feature keys (ModuleName.FeatureKey format).
|
|
1933
|
+
*/
|
|
1934
|
+
checkDependencies(moduleName) {
|
|
1935
|
+
const manifest = this.get(moduleName);
|
|
1936
|
+
if (!manifest?.dependencies || manifest.dependencies.length === 0) {
|
|
1937
|
+
return { missingModules: [], missingFeatures: [] };
|
|
1938
|
+
}
|
|
1939
|
+
const missingModules = [];
|
|
1940
|
+
const missingFeatures = [];
|
|
1941
|
+
for (const dependency of manifest.dependencies) {
|
|
1942
|
+
// If dependency contains a dot, it's a feature (ModuleName.FeatureKey)
|
|
1943
|
+
if (dependency.includes('.')) {
|
|
1944
|
+
// Convert dependency format (ModuleName.FeatureKey) to feature name format (ModuleName:Feature:FeatureKey)
|
|
1945
|
+
const [moduleName, featureKey] = dependency.split('.');
|
|
1946
|
+
const featureName = `${moduleName}:Feature:${featureKey}`;
|
|
1947
|
+
if (!this.isFeatureDefined(featureName)) {
|
|
1948
|
+
missingFeatures.push(dependency);
|
|
1949
|
+
}
|
|
1950
|
+
}
|
|
1951
|
+
else {
|
|
1952
|
+
// Otherwise, it's a module name
|
|
1953
|
+
if (!this.has(dependency)) {
|
|
1954
|
+
missingModules.push(dependency);
|
|
1955
|
+
}
|
|
1956
|
+
}
|
|
1957
|
+
}
|
|
1958
|
+
return { missingModules, missingFeatures };
|
|
1959
|
+
}
|
|
1960
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXPModuleManifestRegistry, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1961
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXPModuleManifestRegistry, providedIn: 'root' }); }
|
|
1962
|
+
}
|
|
1963
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXPModuleManifestRegistry, decorators: [{
|
|
1964
|
+
type: Injectable,
|
|
1965
|
+
args: [{ providedIn: 'root' }]
|
|
1966
|
+
}] });
|
|
1967
|
+
|
|
1448
1968
|
class AXPAppStartUpService {
|
|
1449
1969
|
constructor() {
|
|
1450
1970
|
this.tasks = [];
|
|
@@ -1454,7 +1974,6 @@ class AXPAppStartUpService {
|
|
|
1454
1974
|
}
|
|
1455
1975
|
async runAllTasks() {
|
|
1456
1976
|
for (const task of this.tasks.sort((a, b) => a.priority - b.priority)) {
|
|
1457
|
-
console.log(`Running "${task.statusText}" with priority "${task.priority}"`);
|
|
1458
1977
|
this.updateStatus(task.statusText);
|
|
1459
1978
|
await task.run();
|
|
1460
1979
|
}
|
|
@@ -1482,422 +2001,40 @@ const AXPAppStartUpProvider = provideAppInitializer(() => {
|
|
|
1482
2001
|
return initializerFn();
|
|
1483
2002
|
});
|
|
1484
2003
|
|
|
1485
|
-
|
|
1486
|
-
* Status Definition Types
|
|
1487
|
-
* Defines the structure for status definitions and their transitions
|
|
1488
|
-
*/
|
|
1489
|
-
/**
|
|
1490
|
-
* Abstract class for status providers
|
|
1491
|
-
* Similar to AXPTaskBadgeProvider pattern
|
|
1492
|
-
*/
|
|
1493
|
-
class AXPStatusProvider {
|
|
1494
|
-
}
|
|
2004
|
+
//#region ---- Imports ----
|
|
1495
2005
|
//#endregion
|
|
1496
|
-
|
|
1497
|
-
//#region ---- Injection Token ----
|
|
2006
|
+
//#region ---- Module ----
|
|
1498
2007
|
/**
|
|
1499
|
-
*
|
|
1500
|
-
*
|
|
2008
|
+
* Module for managing module manifests initialization.
|
|
2009
|
+
* Handles the registration of manifest startup tasks.
|
|
1501
2010
|
*/
|
|
1502
|
-
|
|
1503
|
-
//#endregion
|
|
1504
|
-
//#region ---- Provider Service ----
|
|
1505
|
-
/**
|
|
1506
|
-
* Service for managing status definitions from multiple providers
|
|
1507
|
-
* Similar to AXPTaskBadgeService pattern - no cache, direct access
|
|
1508
|
-
*
|
|
1509
|
-
* @example
|
|
1510
|
-
* ```typescript
|
|
1511
|
-
* // In a module providers array:
|
|
1512
|
-
* {
|
|
1513
|
-
* provide: AXP_STATUS_PROVIDERS,
|
|
1514
|
-
* useClass: TaskStatusProvider,
|
|
1515
|
-
* multi: true,
|
|
1516
|
-
* }
|
|
1517
|
-
*
|
|
1518
|
-
* // Example provider implementation:
|
|
1519
|
-
* export class TaskStatusProvider extends AXPStatusProvider {
|
|
1520
|
-
* readonly key = 'task-management.status';
|
|
1521
|
-
* readonly statuses = [
|
|
1522
|
-
* { name: 'todo', title: 'To Do', color: '#6b7280', icon: 'fa-light fa-circle', isInitial: true },
|
|
1523
|
-
* { name: 'in-progress', title: 'In Progress', color: '#3b82f6', icon: 'fa-light fa-play' },
|
|
1524
|
-
* { name: 'done', title: 'Done', color: '#10b981', icon: 'fa-light fa-check-circle', isFinal: true },
|
|
1525
|
-
* ];
|
|
1526
|
-
* readonly transitions = [
|
|
1527
|
-
* { from: 'todo', to: 'in-progress', title: 'Start', condition: '{{user.canEdit}}' },
|
|
1528
|
-
* { from: 'in-progress', to: 'done', title: 'Complete' },
|
|
1529
|
-
* ];
|
|
1530
|
-
* readonly defaultStatus = 'todo';
|
|
1531
|
-
* }
|
|
1532
|
-
*
|
|
1533
|
-
* // Later, get the status:
|
|
1534
|
-
* const status = statusService.getStatus('task-management.status');
|
|
1535
|
-
* if (status) {
|
|
1536
|
-
* console.log('Statuses:', status.statuses);
|
|
1537
|
-
* console.log('Transitions:', status.transitions);
|
|
1538
|
-
* }
|
|
1539
|
-
* ```
|
|
1540
|
-
*/
|
|
1541
|
-
class AXPStatusDefinitionProviderService {
|
|
1542
|
-
//#endregion
|
|
1543
|
-
//#region ---- Constructor ----
|
|
1544
|
-
constructor() {
|
|
1545
|
-
//#region ---- Dependencies ----
|
|
1546
|
-
this.providers = inject(AXP_STATUS_PROVIDERS, { optional: true }) ?? [];
|
|
1547
|
-
//#endregion
|
|
1548
|
-
//#region ---- State ----
|
|
1549
|
-
this.statusMap = new Map();
|
|
1550
|
-
// Register all providers in constructor (like badge service)
|
|
1551
|
-
for (const provider of this.providers) {
|
|
1552
|
-
if (this.statusMap.has(provider.key)) {
|
|
1553
|
-
console.warn(`Status with key "${provider.key}" already exists. Overwriting with new status.`);
|
|
1554
|
-
}
|
|
1555
|
-
this.statusMap.set(provider.key, provider);
|
|
1556
|
-
}
|
|
1557
|
-
}
|
|
1558
|
-
//#endregion
|
|
1559
|
-
//#region ---- Public API ----
|
|
2011
|
+
class AXPModuleManifestModule {
|
|
1560
2012
|
/**
|
|
1561
|
-
*
|
|
1562
|
-
*
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
*/
|
|
1576
|
-
getStatus(key) {
|
|
1577
|
-
return this.statusMap.get(key);
|
|
1578
|
-
}
|
|
1579
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXPStatusDefinitionProviderService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1580
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXPStatusDefinitionProviderService, providedIn: 'root' }); }
|
|
1581
|
-
}
|
|
1582
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXPStatusDefinitionProviderService, decorators: [{
|
|
1583
|
-
type: Injectable,
|
|
1584
|
-
args: [{ providedIn: 'root' }]
|
|
1585
|
-
}], ctorParameters: () => [] });
|
|
1586
|
-
|
|
1587
|
-
/**
|
|
1588
|
-
* Standard system status types
|
|
1589
|
-
* These are the predefined status values used across the platform
|
|
1590
|
-
*/
|
|
1591
|
-
var AXPSystemStatusType;
|
|
1592
|
-
(function (AXPSystemStatusType) {
|
|
1593
|
-
AXPSystemStatusType["Todo"] = "todo";
|
|
1594
|
-
AXPSystemStatusType["InProgress"] = "in-progress";
|
|
1595
|
-
AXPSystemStatusType["InReview"] = "in-review";
|
|
1596
|
-
AXPSystemStatusType["Blocked"] = "blocked";
|
|
1597
|
-
AXPSystemStatusType["Done"] = "done";
|
|
1598
|
-
AXPSystemStatusType["Cancelled"] = "cancelled";
|
|
1599
|
-
AXPSystemStatusType["Draft"] = "draft";
|
|
1600
|
-
AXPSystemStatusType["PendingReview"] = "pending-review";
|
|
1601
|
-
AXPSystemStatusType["Approved"] = "approved";
|
|
1602
|
-
AXPSystemStatusType["Published"] = "published";
|
|
1603
|
-
AXPSystemStatusType["Archived"] = "archived";
|
|
1604
|
-
AXPSystemStatusType["Rejected"] = "rejected";
|
|
1605
|
-
AXPSystemStatusType["Active"] = "active";
|
|
1606
|
-
AXPSystemStatusType["Inactive"] = "inactive";
|
|
1607
|
-
AXPSystemStatusType["Pending"] = "pending";
|
|
1608
|
-
AXPSystemStatusType["Completed"] = "completed";
|
|
1609
|
-
AXPSystemStatusType["Suspended"] = "suspended";
|
|
1610
|
-
AXPSystemStatusType["Failed"] = "failed";
|
|
1611
|
-
AXPSystemStatusType["Review"] = "review";
|
|
1612
|
-
})(AXPSystemStatusType || (AXPSystemStatusType = {}));
|
|
1613
|
-
const i18n$1 = (key) => `@general:statuses.${key}`;
|
|
1614
|
-
/**
|
|
1615
|
-
* Standard system status definitions
|
|
1616
|
-
* Provides consistent status definitions across the platform
|
|
1617
|
-
* Uses AXPStatusDefinition interface from status-definition.types.ts
|
|
1618
|
-
*/
|
|
1619
|
-
const AXPSystemStatuses = Object.freeze({
|
|
1620
|
-
Todo: {
|
|
1621
|
-
name: AXPSystemStatusType.Todo,
|
|
1622
|
-
title: i18n$1('todo.title'),
|
|
1623
|
-
icon: 'fa-light fa-circle',
|
|
1624
|
-
color: 'secondary',
|
|
1625
|
-
description: i18n$1('todo.description'),
|
|
1626
|
-
order: 1,
|
|
1627
|
-
isActive: true,
|
|
1628
|
-
isInitial: true,
|
|
1629
|
-
isFinal: false,
|
|
1630
|
-
},
|
|
1631
|
-
InProgress: {
|
|
1632
|
-
name: AXPSystemStatusType.InProgress,
|
|
1633
|
-
title: i18n$1('in-progress.title'),
|
|
1634
|
-
icon: 'fa-light fa-play',
|
|
1635
|
-
color: 'info',
|
|
1636
|
-
description: i18n$1('in-progress.description'),
|
|
1637
|
-
order: 2,
|
|
1638
|
-
isActive: true,
|
|
1639
|
-
isInitial: false,
|
|
1640
|
-
isFinal: false,
|
|
1641
|
-
},
|
|
1642
|
-
InReview: {
|
|
1643
|
-
name: AXPSystemStatusType.InReview,
|
|
1644
|
-
title: i18n$1('in-review.title'),
|
|
1645
|
-
icon: 'fa-light fa-eye',
|
|
1646
|
-
color: 'info',
|
|
1647
|
-
description: i18n$1('in-review.description'),
|
|
1648
|
-
order: 3,
|
|
1649
|
-
isActive: true,
|
|
1650
|
-
isInitial: false,
|
|
1651
|
-
isFinal: false,
|
|
1652
|
-
},
|
|
1653
|
-
Blocked: {
|
|
1654
|
-
name: AXPSystemStatusType.Blocked,
|
|
1655
|
-
title: i18n$1('blocked.title'),
|
|
1656
|
-
icon: 'fa-light fa-ban',
|
|
1657
|
-
color: 'danger',
|
|
1658
|
-
description: i18n$1('blocked.description'),
|
|
1659
|
-
order: 4,
|
|
1660
|
-
isActive: true,
|
|
1661
|
-
isInitial: false,
|
|
1662
|
-
isFinal: false,
|
|
1663
|
-
},
|
|
1664
|
-
Done: {
|
|
1665
|
-
name: AXPSystemStatusType.Done,
|
|
1666
|
-
title: i18n$1('done.title'),
|
|
1667
|
-
icon: 'fa-light fa-check-circle',
|
|
1668
|
-
color: 'success',
|
|
1669
|
-
description: i18n$1('done.description'),
|
|
1670
|
-
order: 5,
|
|
1671
|
-
isActive: true,
|
|
1672
|
-
isInitial: false,
|
|
1673
|
-
isFinal: true,
|
|
1674
|
-
},
|
|
1675
|
-
Cancelled: {
|
|
1676
|
-
name: AXPSystemStatusType.Cancelled,
|
|
1677
|
-
title: i18n$1('cancelled.title'),
|
|
1678
|
-
icon: 'fa-light fa-times-circle',
|
|
1679
|
-
color: 'neutral',
|
|
1680
|
-
description: i18n$1('cancelled.description'),
|
|
1681
|
-
order: 6,
|
|
1682
|
-
isActive: true,
|
|
1683
|
-
isInitial: false,
|
|
1684
|
-
isFinal: true,
|
|
1685
|
-
},
|
|
1686
|
-
Draft: {
|
|
1687
|
-
name: AXPSystemStatusType.Draft,
|
|
1688
|
-
title: i18n$1('draft.title'),
|
|
1689
|
-
icon: 'fa-light fa-file-pen',
|
|
1690
|
-
color: 'neutral',
|
|
1691
|
-
description: i18n$1('draft.description'),
|
|
1692
|
-
order: 1,
|
|
1693
|
-
isActive: true,
|
|
1694
|
-
isInitial: true,
|
|
1695
|
-
isFinal: false,
|
|
1696
|
-
},
|
|
1697
|
-
PendingReview: {
|
|
1698
|
-
name: AXPSystemStatusType.PendingReview,
|
|
1699
|
-
title: i18n$1('pending-review.title'),
|
|
1700
|
-
icon: 'fa-light fa-clock',
|
|
1701
|
-
color: 'warning',
|
|
1702
|
-
description: i18n$1('pending-review.description'),
|
|
1703
|
-
order: 2,
|
|
1704
|
-
isActive: true,
|
|
1705
|
-
isInitial: false,
|
|
1706
|
-
isFinal: false,
|
|
1707
|
-
},
|
|
1708
|
-
Approved: {
|
|
1709
|
-
name: AXPSystemStatusType.Approved,
|
|
1710
|
-
title: i18n$1('approved.title'),
|
|
1711
|
-
icon: 'fa-light fa-check-circle',
|
|
1712
|
-
color: 'success',
|
|
1713
|
-
description: i18n$1('approved.description'),
|
|
1714
|
-
order: 3,
|
|
1715
|
-
isActive: true,
|
|
1716
|
-
isInitial: false,
|
|
1717
|
-
isFinal: false,
|
|
1718
|
-
},
|
|
1719
|
-
Published: {
|
|
1720
|
-
name: AXPSystemStatusType.Published,
|
|
1721
|
-
title: i18n$1('published.title'),
|
|
1722
|
-
icon: 'fa-light fa-globe',
|
|
1723
|
-
color: 'primary',
|
|
1724
|
-
description: i18n$1('published.description'),
|
|
1725
|
-
order: 4,
|
|
1726
|
-
isActive: true,
|
|
1727
|
-
isInitial: false,
|
|
1728
|
-
isFinal: false,
|
|
1729
|
-
},
|
|
1730
|
-
Archived: {
|
|
1731
|
-
name: AXPSystemStatusType.Archived,
|
|
1732
|
-
title: i18n$1('archived.title'),
|
|
1733
|
-
icon: 'fa-light fa-archive',
|
|
1734
|
-
color: 'neutral',
|
|
1735
|
-
description: i18n$1('archived.description'),
|
|
1736
|
-
order: 5,
|
|
1737
|
-
isActive: true,
|
|
1738
|
-
isInitial: false,
|
|
1739
|
-
isFinal: true,
|
|
1740
|
-
},
|
|
1741
|
-
Rejected: {
|
|
1742
|
-
name: AXPSystemStatusType.Rejected,
|
|
1743
|
-
title: i18n$1('rejected.title'),
|
|
1744
|
-
icon: 'fa-light fa-times-circle',
|
|
1745
|
-
color: 'danger',
|
|
1746
|
-
description: i18n$1('rejected.description'),
|
|
1747
|
-
order: 6,
|
|
1748
|
-
isActive: true,
|
|
1749
|
-
isInitial: false,
|
|
1750
|
-
isFinal: true,
|
|
1751
|
-
},
|
|
1752
|
-
Active: {
|
|
1753
|
-
name: AXPSystemStatusType.Active,
|
|
1754
|
-
title: i18n$1('active.title'),
|
|
1755
|
-
icon: 'fa-light fa-check-circle',
|
|
1756
|
-
color: 'success',
|
|
1757
|
-
description: i18n$1('active.description'),
|
|
1758
|
-
order: 1,
|
|
1759
|
-
isActive: true,
|
|
1760
|
-
isInitial: false,
|
|
1761
|
-
isFinal: false,
|
|
1762
|
-
},
|
|
1763
|
-
Inactive: {
|
|
1764
|
-
name: AXPSystemStatusType.Inactive,
|
|
1765
|
-
title: i18n$1('inactive.title'),
|
|
1766
|
-
icon: 'fa-light fa-circle',
|
|
1767
|
-
color: 'secondary',
|
|
1768
|
-
description: i18n$1('inactive.description'),
|
|
1769
|
-
order: 2,
|
|
1770
|
-
isActive: true,
|
|
1771
|
-
isInitial: false,
|
|
1772
|
-
isFinal: false,
|
|
1773
|
-
},
|
|
1774
|
-
Pending: {
|
|
1775
|
-
name: AXPSystemStatusType.Pending,
|
|
1776
|
-
title: i18n$1('pending.title'),
|
|
1777
|
-
icon: 'fa-light fa-clock',
|
|
1778
|
-
color: 'warning',
|
|
1779
|
-
description: i18n$1('pending.description'),
|
|
1780
|
-
order: 1,
|
|
1781
|
-
isActive: true,
|
|
1782
|
-
isInitial: true,
|
|
1783
|
-
isFinal: false,
|
|
1784
|
-
},
|
|
1785
|
-
Completed: {
|
|
1786
|
-
name: AXPSystemStatusType.Completed,
|
|
1787
|
-
title: i18n$1('completed.title'),
|
|
1788
|
-
icon: 'fa-light fa-check-circle',
|
|
1789
|
-
color: 'success',
|
|
1790
|
-
description: i18n$1('completed.description'),
|
|
1791
|
-
order: 10,
|
|
1792
|
-
isActive: true,
|
|
1793
|
-
isInitial: false,
|
|
1794
|
-
isFinal: true,
|
|
1795
|
-
},
|
|
1796
|
-
Suspended: {
|
|
1797
|
-
name: AXPSystemStatusType.Suspended,
|
|
1798
|
-
title: i18n$1('suspended.title'),
|
|
1799
|
-
icon: 'fa-light fa-pause-circle',
|
|
1800
|
-
color: 'neutral',
|
|
1801
|
-
description: i18n$1('suspended.description'),
|
|
1802
|
-
order: 5,
|
|
1803
|
-
isActive: true,
|
|
1804
|
-
isInitial: false,
|
|
1805
|
-
isFinal: false,
|
|
1806
|
-
},
|
|
1807
|
-
Failed: {
|
|
1808
|
-
name: AXPSystemStatusType.Failed,
|
|
1809
|
-
title: i18n$1('failed.title'),
|
|
1810
|
-
icon: 'fa-light fa-xmark-circle',
|
|
1811
|
-
color: 'danger',
|
|
1812
|
-
description: i18n$1('failed.description'),
|
|
1813
|
-
order: 10,
|
|
1814
|
-
isActive: true,
|
|
1815
|
-
isInitial: false,
|
|
1816
|
-
isFinal: true,
|
|
1817
|
-
},
|
|
1818
|
-
Review: {
|
|
1819
|
-
name: AXPSystemStatusType.Review,
|
|
1820
|
-
title: i18n$1('review.title'),
|
|
1821
|
-
icon: 'fa-light fa-eye',
|
|
1822
|
-
color: 'info',
|
|
1823
|
-
description: i18n$1('review.description'),
|
|
1824
|
-
order: 3,
|
|
1825
|
-
isActive: true,
|
|
1826
|
-
},
|
|
1827
|
-
});
|
|
1828
|
-
/**
|
|
1829
|
-
* Get system status definition by type
|
|
1830
|
-
* @param type - Status type
|
|
1831
|
-
* @returns System status definition or undefined
|
|
1832
|
-
*/
|
|
1833
|
-
function getSystemStatus(type) {
|
|
1834
|
-
return Object.values(AXPSystemStatuses).find(status => status.name === type);
|
|
1835
|
-
}
|
|
1836
|
-
/**
|
|
1837
|
-
* Resolves the visual appearance (color and icon) for status
|
|
1838
|
-
* using the system statuses from the core module.
|
|
1839
|
-
* @param statusType - Status type string
|
|
1840
|
-
* @returns Color and icon for the status
|
|
1841
|
-
*/
|
|
1842
|
-
function resolveStatusLook(statusType) {
|
|
1843
|
-
// Try to get system status first
|
|
1844
|
-
const systemStatusType = statusType;
|
|
1845
|
-
if (systemStatusType) {
|
|
1846
|
-
const systemStatus = getSystemStatus(systemStatusType);
|
|
1847
|
-
if (systemStatus) {
|
|
1848
|
-
// Convert hex color to semantic color type if needed
|
|
1849
|
-
// For now, return as-is and let the UI handle it
|
|
1850
|
-
return {
|
|
1851
|
-
color: systemStatus.color,
|
|
1852
|
-
icon: systemStatus.icon || ''
|
|
1853
|
-
};
|
|
1854
|
-
}
|
|
1855
|
-
}
|
|
1856
|
-
// Fallback for unknown statuses
|
|
1857
|
-
return {
|
|
1858
|
-
color: 'secondary',
|
|
1859
|
-
icon: ''
|
|
1860
|
-
};
|
|
1861
|
-
}
|
|
1862
|
-
/**
|
|
1863
|
-
* Resolves the complete status information (title, description, icon, color) for a status
|
|
1864
|
-
* using the system statuses from the core module.
|
|
1865
|
-
* @param statusType - Status type string
|
|
1866
|
-
* @returns Complete status information as AXPStatusDefinition
|
|
1867
|
-
*/
|
|
1868
|
-
function getStatusInfo(statusType) {
|
|
1869
|
-
const systemStatusType = statusType;
|
|
1870
|
-
if (systemStatusType) {
|
|
1871
|
-
const systemStatus = getSystemStatus(systemStatusType);
|
|
1872
|
-
if (systemStatus) {
|
|
1873
|
-
return systemStatus;
|
|
1874
|
-
}
|
|
1875
|
-
}
|
|
1876
|
-
// Fallback for unknown statuses
|
|
1877
|
-
return {
|
|
1878
|
-
name: statusType,
|
|
1879
|
-
title: statusType,
|
|
1880
|
-
description: `Status: ${statusType}`,
|
|
1881
|
-
icon: '',
|
|
1882
|
-
color: 'secondary'
|
|
1883
|
-
};
|
|
1884
|
-
}
|
|
1885
|
-
/**
|
|
1886
|
-
* Get system status definition directly (no conversion needed since it's already AXPStatusDefinition)
|
|
1887
|
-
* @param statusType - Status type
|
|
1888
|
-
* @param overrides - Optional overrides for the status definition
|
|
1889
|
-
* @returns AXPStatusDefinition
|
|
1890
|
-
*/
|
|
1891
|
-
function systemStatusToDefinition(statusType, overrides) {
|
|
1892
|
-
const systemStatus = getSystemStatus(statusType);
|
|
1893
|
-
if (!systemStatus) {
|
|
1894
|
-
throw new Error(`System status ${statusType} not found`);
|
|
2013
|
+
* @ignore
|
|
2014
|
+
* Initializes module manifest tasks on module construction.
|
|
2015
|
+
*/
|
|
2016
|
+
constructor(appInitService, injector) {
|
|
2017
|
+
const manifestRegistry = injector.get(AXPModuleManifestRegistry);
|
|
2018
|
+
// Register manifest initialization task
|
|
2019
|
+
appInitService.registerTask({
|
|
2020
|
+
name: 'ModuleManifests',
|
|
2021
|
+
statusText: 'Loading module manifests...',
|
|
2022
|
+
priority: 1, // Load early, before features/permissions
|
|
2023
|
+
run: async () => {
|
|
2024
|
+
await manifestRegistry.initialize();
|
|
2025
|
+
},
|
|
2026
|
+
});
|
|
1895
2027
|
}
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
};
|
|
2028
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXPModuleManifestModule, deps: [{ token: AXPAppStartUpService }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
2029
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.12", ngImport: i0, type: AXPModuleManifestModule }); }
|
|
2030
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXPModuleManifestModule }); }
|
|
1900
2031
|
}
|
|
2032
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXPModuleManifestModule, decorators: [{
|
|
2033
|
+
type: NgModule,
|
|
2034
|
+
args: [{
|
|
2035
|
+
providers: [],
|
|
2036
|
+
}]
|
|
2037
|
+
}], ctorParameters: () => [{ type: AXPAppStartUpService }, { type: i0.Injector }] });
|
|
1901
2038
|
|
|
1902
2039
|
//#region ---- Tag Types ----
|
|
1903
2040
|
//#endregion
|
|
@@ -3007,6 +3144,12 @@ class AXPComponentLogoConfig {
|
|
|
3007
3144
|
this.component = component;
|
|
3008
3145
|
}
|
|
3009
3146
|
}
|
|
3147
|
+
class AXPIconLogoConfig {
|
|
3148
|
+
constructor(icon, color) {
|
|
3149
|
+
this.icon = icon;
|
|
3150
|
+
this.color = color;
|
|
3151
|
+
}
|
|
3152
|
+
}
|
|
3010
3153
|
|
|
3011
3154
|
var AXPPlatformScope;
|
|
3012
3155
|
(function (AXPPlatformScope) {
|
|
@@ -3586,6 +3729,52 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImpo
|
|
|
3586
3729
|
}]
|
|
3587
3730
|
}], ctorParameters: () => [] });
|
|
3588
3731
|
|
|
3732
|
+
/**
|
|
3733
|
+
* Creates a provider instance within an injection context.
|
|
3734
|
+
* Handles dynamic import, injector resolution, and provider instantiation.
|
|
3735
|
+
*
|
|
3736
|
+
* @param loader - Function that returns a promise resolving to the provider class
|
|
3737
|
+
* @returns Promise that resolves to the provider instance
|
|
3738
|
+
*
|
|
3739
|
+
* @example
|
|
3740
|
+
* ```typescript
|
|
3741
|
+
* useFactory: () => createProviderWithInjectionContext(() =>
|
|
3742
|
+
* import('./settings.provider').then(m => m.AXMSettingProvider)
|
|
3743
|
+
* )
|
|
3744
|
+
* ```
|
|
3745
|
+
*/
|
|
3746
|
+
async function createProviderWithInjectionContext(loader) {
|
|
3747
|
+
const injector = inject(Injector);
|
|
3748
|
+
const ProviderClass = await loader();
|
|
3749
|
+
return runInInjectionContext(injector, () => new ProviderClass());
|
|
3750
|
+
}
|
|
3751
|
+
/**
|
|
3752
|
+
* Creates a provider configuration for lazy-loaded providers with injection context.
|
|
3753
|
+
* Simplifies provider registration in NgModule providers array.
|
|
3754
|
+
*
|
|
3755
|
+
* @param token - The injection token to provide
|
|
3756
|
+
* @param loader - Function that returns a promise resolving to the provider class
|
|
3757
|
+
* @param multi - Whether the provider is multi-provider (defaults to true)
|
|
3758
|
+
* @returns Provider configuration object
|
|
3759
|
+
*
|
|
3760
|
+
* @example
|
|
3761
|
+
* ```typescript
|
|
3762
|
+
* providers: [
|
|
3763
|
+
* provideLazyProvider(
|
|
3764
|
+
* AXP_SETTING_DEFINITION_PROVIDER,
|
|
3765
|
+
* () => import('./settings.provider').then(m => m.AXMSettingProvider)
|
|
3766
|
+
* )
|
|
3767
|
+
* ]
|
|
3768
|
+
* ```
|
|
3769
|
+
*/
|
|
3770
|
+
function provideLazyProvider(token, loader, multi = true) {
|
|
3771
|
+
return {
|
|
3772
|
+
provide: token,
|
|
3773
|
+
useFactory: () => createProviderWithInjectionContext(loader),
|
|
3774
|
+
multi,
|
|
3775
|
+
};
|
|
3776
|
+
}
|
|
3777
|
+
|
|
3589
3778
|
function extractTextFromHtml(value) {
|
|
3590
3779
|
const div = document.createElement('div');
|
|
3591
3780
|
div.innerHTML = value;
|
|
@@ -3608,5 +3797,5 @@ function generateKebabCase(title) {
|
|
|
3608
3797
|
* Generated bundle index. Do not edit.
|
|
3609
3798
|
*/
|
|
3610
3799
|
|
|
3611
|
-
export { AXHighlightService, AXPActivityLogProvider, AXPActivityLogService, AXPAppStartUpProvider, AXPAppStartUpService, AXPBroadcastEventService, AXPColorPaletteProvider, AXPColorPaletteService, AXPComponentLogoConfig, AXPContentCheckerDirective, AXPContextChangeEvent, AXPContextStore, AXPCountdownPipe, AXPDataGenerator, AXPDataSourceDefinitionProviderService, AXPDblClickDirective, AXPDefaultColorPalettesProvider, AXPDeviceService, AXPDeviceType, AXPDistributedEventListenerService, AXPElementDataDirective, AXPExportTemplateToken, AXPExpressionEvaluatorScopeProviderContext, AXPExpressionEvaluatorScopeProviderService, AXPExpressionEvaluatorService, AXPGridLayoutDirective, AXPHookService, AXPImageUrlLogoConfig,
|
|
3800
|
+
export { AXFullscreenDirective, AXHighlightService, AXPActivityLogProvider, AXPActivityLogService, AXPAppStartUpProvider, AXPAppStartUpService, AXPBroadcastEventService, AXPColorPaletteProvider, AXPColorPaletteService, AXPComponentLogoConfig, AXPContentCheckerDirective, AXPContextChangeEvent, AXPContextStore, AXPCountdownPipe, AXPDataGenerator, AXPDataSourceDefinitionProviderService, AXPDblClickDirective, AXPDefaultColorPalettesProvider, AXPDeviceService, AXPDeviceType, AXPDistributedEventListenerService, AXPElementDataDirective, AXPExportTemplateToken, AXPExpressionEvaluatorScopeProviderContext, AXPExpressionEvaluatorScopeProviderService, AXPExpressionEvaluatorService, AXPFeatureDefinitionProviderContext, AXPGridLayoutDirective, AXPHookService, AXPIconLogoConfig, AXPImageUrlLogoConfig, AXPModuleManifestModule, AXPModuleManifestRegistry, AXPPlatformScope, AXPScreenSize, AXPSystemActionType, AXPSystemActions, AXPTagProvider, AXPTagService, AXP_ACTIVITY_LOG_PROVIDER, AXP_COLOR_PALETTE_PROVIDER, AXP_DATASOURCE_DEFINITION_PROVIDER, AXP_DISTRIBUTED_EVENT_LISTENER_PROVIDER, AXP_EXPRESSION_EVALUATOR_SCOPE_PROVIDER, AXP_FEATURE_DEFINITION_PROVIDER, AXP_MODULE_MANIFEST_PROVIDER, AXP_SESSION_SERVICE, AXP_TAG_PROVIDER, applyFilterArray, applyPagination, applyQueryArray, applySortArray, applySystemActionDefault, cleanDeep, createProviderWithInjectionContext, extractNestedFieldsWildcard, extractTextFromHtml, extractValue, generateKebabCase, getActionButton, getChangedPaths, getDetailedChanges, getEnumValues, getNestedKeys, getSmart, getSystemActions, objectKeyValueTransforms, provideLazyProvider, resolveActionLook, resolvePlatformScopeKey, resolvePlatformScopeName, setSmart };
|
|
3612
3801
|
//# sourceMappingURL=acorex-platform-core.mjs.map
|