@acorex/platform 20.6.0-next.8 → 21.0.0-next.0
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 +91 -12
- package/common/index.d.ts +615 -44
- package/core/index.d.ts +718 -422
- package/fesm2022/acorex-platform-auth.mjs +152 -39
- package/fesm2022/acorex-platform-auth.mjs.map +1 -1
- package/fesm2022/acorex-platform-common.mjs +1009 -112
- package/fesm2022/acorex-platform-common.mjs.map +1 -1
- package/fesm2022/acorex-platform-core.mjs +887 -408
- package/fesm2022/acorex-platform-core.mjs.map +1 -1
- package/fesm2022/acorex-platform-domain.mjs +99 -11
- package/fesm2022/acorex-platform-domain.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-builder.mjs +555 -492
- package/fesm2022/acorex-platform-layout-builder.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-components.mjs +2446 -2733
- package/fesm2022/acorex-platform-layout-components.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-designer.mjs +9 -9
- package/fesm2022/acorex-platform-layout-designer.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-entity.mjs +9708 -4721
- package/fesm2022/acorex-platform-layout-entity.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-views.mjs +32 -26
- package/fesm2022/acorex-platform-layout-views.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-widget-core.mjs +252 -182
- 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-image-preview.popup-V31OpYah.mjs +30 -0
- package/fesm2022/acorex-platform-layout-widgets-image-preview.popup-V31OpYah.mjs.map +1 -0
- package/fesm2022/{acorex-platform-layout-widgets-tabular-data-edit-popup.component-C1l2KSDa.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-tabular-data-view-popup.component-D-31ej0C.mjs → acorex-platform-layout-widgets-tabular-data-view-popup.component-y8vjUiVs.mjs} +2 -2
- package/fesm2022/acorex-platform-layout-widgets-tabular-data-view-popup.component-y8vjUiVs.mjs.map +1 -0
- package/fesm2022/acorex-platform-layout-widgets.mjs +9789 -6817
- package/fesm2022/acorex-platform-layout-widgets.mjs.map +1 -1
- package/fesm2022/acorex-platform-runtime.mjs +79 -3
- package/fesm2022/acorex-platform-runtime.mjs.map +1 -1
- package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-VIGuU5M4.mjs +157 -0
- 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-DyDa_hyd.mjs +1542 -0
- 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 +282 -43
- package/fesm2022/acorex-platform-themes-default.mjs.map +1 -1
- package/fesm2022/acorex-platform-themes-shared-icon-chooser-column.component-C0EpfU2k.mjs +55 -0
- package/fesm2022/acorex-platform-themes-shared-icon-chooser-column.component-C0EpfU2k.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-shared.mjs +42 -137
- package/fesm2022/acorex-platform-themes-shared.mjs.map +1 -1
- package/fesm2022/acorex-platform-workflow.mjs +658 -45
- package/fesm2022/acorex-platform-workflow.mjs.map +1 -1
- package/layout/builder/index.d.ts +10 -34
- package/layout/components/index.d.ts +694 -375
- package/layout/designer/index.d.ts +4 -4
- package/layout/entity/index.d.ts +802 -183
- package/layout/views/index.d.ts +5 -58
- package/layout/widget-core/index.d.ts +63 -75
- package/layout/widgets/README.md +0 -1
- package/layout/widgets/index.d.ts +498 -129
- package/package.json +5 -5
- package/runtime/index.d.ts +36 -8
- package/themes/default/index.d.ts +44 -75
- package/themes/shared/index.d.ts +11 -49
- package/workflow/index.d.ts +401 -90
- package/fesm2022/acorex-platform-layout-entity-create-entity.command-DGeylNSY.mjs +0 -52
- package/fesm2022/acorex-platform-layout-entity-create-entity.command-DGeylNSY.mjs.map +0 -1
- 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-C1l2KSDa.mjs.map +0 -1
- package/fesm2022/acorex-platform-layout-widgets-tabular-data-view-popup.component-D-31ej0C.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-WbPPqDON.mjs +0 -115
- package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-WbPPqDON.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-CD7rJIMh.mjs +0 -803
- package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-CD7rJIMh.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,10 +1,10 @@
|
|
|
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, 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
|
-
import { Subject, interval } from 'rxjs';
|
|
5
|
+
import { Subject, interval, fromEvent } from 'rxjs';
|
|
6
6
|
import { AXCalendarService } from '@acorex/core/date-time';
|
|
7
|
-
import { startWith, map } from 'rxjs/operators';
|
|
7
|
+
import { startWith, map, debounceTime } from 'rxjs/operators';
|
|
8
8
|
|
|
9
9
|
const AXP_ACTIVITY_LOG_PROVIDER = new InjectionToken('AXP_ACTIVITY_LOGS_PROVIDER');
|
|
10
10
|
class AXPActivityLogService {
|
|
@@ -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) {
|
|
@@ -783,19 +822,152 @@ function objectKeyValueTransforms(keyName) {
|
|
|
783
822
|
};
|
|
784
823
|
}
|
|
785
824
|
|
|
825
|
+
//#region ---- Imports ----
|
|
826
|
+
//#endregion
|
|
827
|
+
//#region ---- Provider Registry Service ----
|
|
828
|
+
/**
|
|
829
|
+
* Registry service for dynamically loaded module providers.
|
|
830
|
+
* Stores provider instances that are loaded conditionally based on access control.
|
|
831
|
+
*/
|
|
832
|
+
class AXPModuleProviderRegistry {
|
|
833
|
+
constructor() {
|
|
834
|
+
//#region ---- Fields ----
|
|
835
|
+
this.permissionProviders = [];
|
|
836
|
+
this.menuProviders = [];
|
|
837
|
+
this.entityProviders = [];
|
|
838
|
+
this.settingProviders = [];
|
|
839
|
+
this.searchProviders = [];
|
|
840
|
+
this.featureProviders = [];
|
|
841
|
+
this.datasourceProviders = [];
|
|
842
|
+
}
|
|
843
|
+
//#endregion
|
|
844
|
+
//#region ---- Public Methods ----
|
|
845
|
+
/**
|
|
846
|
+
* Register a permission provider.
|
|
847
|
+
*/
|
|
848
|
+
registerPermissionProvider(provider) {
|
|
849
|
+
this.permissionProviders.push(provider);
|
|
850
|
+
}
|
|
851
|
+
/**
|
|
852
|
+
* Get all registered permission providers.
|
|
853
|
+
*/
|
|
854
|
+
getPermissionProviders() {
|
|
855
|
+
return [...this.permissionProviders];
|
|
856
|
+
}
|
|
857
|
+
/**
|
|
858
|
+
* Register a menu provider.
|
|
859
|
+
*/
|
|
860
|
+
registerMenuProvider(provider) {
|
|
861
|
+
this.menuProviders.push(provider);
|
|
862
|
+
}
|
|
863
|
+
/**
|
|
864
|
+
* Get all registered menu providers.
|
|
865
|
+
*/
|
|
866
|
+
getMenuProviders() {
|
|
867
|
+
return [...this.menuProviders];
|
|
868
|
+
}
|
|
869
|
+
/**
|
|
870
|
+
* Register an entity provider.
|
|
871
|
+
*/
|
|
872
|
+
registerEntityProvider(provider) {
|
|
873
|
+
this.entityProviders.push(provider);
|
|
874
|
+
}
|
|
875
|
+
/**
|
|
876
|
+
* Get all registered entity providers.
|
|
877
|
+
*/
|
|
878
|
+
getEntityProviders() {
|
|
879
|
+
return [...this.entityProviders];
|
|
880
|
+
}
|
|
881
|
+
/**
|
|
882
|
+
* Register a settings provider.
|
|
883
|
+
*/
|
|
884
|
+
registerSettingProvider(provider) {
|
|
885
|
+
this.settingProviders.push(provider);
|
|
886
|
+
}
|
|
887
|
+
/**
|
|
888
|
+
* Get all registered settings providers.
|
|
889
|
+
*/
|
|
890
|
+
getSettingProviders() {
|
|
891
|
+
return [...this.settingProviders];
|
|
892
|
+
}
|
|
893
|
+
/**
|
|
894
|
+
* Register a search provider.
|
|
895
|
+
*/
|
|
896
|
+
registerSearchProvider(provider) {
|
|
897
|
+
this.searchProviders.push(provider);
|
|
898
|
+
}
|
|
899
|
+
/**
|
|
900
|
+
* Get all registered search providers.
|
|
901
|
+
*/
|
|
902
|
+
getSearchProviders() {
|
|
903
|
+
return [...this.searchProviders];
|
|
904
|
+
}
|
|
905
|
+
/**
|
|
906
|
+
* Register a feature provider.
|
|
907
|
+
*/
|
|
908
|
+
registerFeatureProvider(provider) {
|
|
909
|
+
this.featureProviders.push(provider);
|
|
910
|
+
}
|
|
911
|
+
/**
|
|
912
|
+
* Get all registered feature providers.
|
|
913
|
+
*/
|
|
914
|
+
getFeatureProviders() {
|
|
915
|
+
return [...this.featureProviders];
|
|
916
|
+
}
|
|
917
|
+
/**
|
|
918
|
+
* Register a datasource provider.
|
|
919
|
+
*/
|
|
920
|
+
registerDatasourceProvider(provider) {
|
|
921
|
+
this.datasourceProviders.push(provider);
|
|
922
|
+
}
|
|
923
|
+
/**
|
|
924
|
+
* Get all registered datasource providers.
|
|
925
|
+
*/
|
|
926
|
+
getDatasourceProviders() {
|
|
927
|
+
return [...this.datasourceProviders];
|
|
928
|
+
}
|
|
929
|
+
/**
|
|
930
|
+
* Clear all registered providers.
|
|
931
|
+
* Useful for testing or re-initialization.
|
|
932
|
+
*/
|
|
933
|
+
clear() {
|
|
934
|
+
this.permissionProviders.length = 0;
|
|
935
|
+
this.menuProviders.length = 0;
|
|
936
|
+
this.entityProviders.length = 0;
|
|
937
|
+
this.settingProviders.length = 0;
|
|
938
|
+
this.searchProviders.length = 0;
|
|
939
|
+
this.featureProviders.length = 0;
|
|
940
|
+
this.datasourceProviders.length = 0;
|
|
941
|
+
}
|
|
942
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXPModuleProviderRegistry, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
943
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXPModuleProviderRegistry, providedIn: 'root' }); }
|
|
944
|
+
}
|
|
945
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXPModuleProviderRegistry, decorators: [{
|
|
946
|
+
type: Injectable,
|
|
947
|
+
args: [{ providedIn: 'root' }]
|
|
948
|
+
}] });
|
|
949
|
+
|
|
786
950
|
const AXP_DATASOURCE_DEFINITION_PROVIDER = new InjectionToken('AXP_DATASOURCE_TYPE_PROVIDER');
|
|
787
951
|
class AXPDataSourceDefinitionProviderService {
|
|
788
952
|
constructor() {
|
|
789
953
|
this.providers = inject(AXP_DATASOURCE_DEFINITION_PROVIDER, { optional: true });
|
|
954
|
+
this.providerRegistry = inject(AXPModuleProviderRegistry);
|
|
790
955
|
}
|
|
791
956
|
async items() {
|
|
792
957
|
const items = [];
|
|
958
|
+
// Load from DI tokens (backward compatibility)
|
|
793
959
|
if (Array.isArray(this.providers)) {
|
|
794
960
|
for (const provider of this.providers) {
|
|
795
961
|
set(provider, '__parent__', this);
|
|
796
962
|
items.push(...(await provider.items()));
|
|
797
963
|
}
|
|
798
964
|
}
|
|
965
|
+
// Load from registry (manifest-based, conditionally loaded)
|
|
966
|
+
const registryProviders = this.providerRegistry.getDatasourceProviders();
|
|
967
|
+
for (const provider of registryProviders) {
|
|
968
|
+
set(provider, '__parent__', this);
|
|
969
|
+
items.push(...(await provider.items()));
|
|
970
|
+
}
|
|
799
971
|
return items;
|
|
800
972
|
}
|
|
801
973
|
async get(name) {
|
|
@@ -966,6 +1138,203 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImpo
|
|
|
966
1138
|
}]
|
|
967
1139
|
}] });
|
|
968
1140
|
|
|
1141
|
+
//#region ---- Imports ----
|
|
1142
|
+
//#endregion
|
|
1143
|
+
//#region ---- Directive ----
|
|
1144
|
+
/**
|
|
1145
|
+
* Fullscreen directive that provides CSS-based fullscreen functionality
|
|
1146
|
+
* Usage: <element axFullscreen #fullscreen="axFullscreen"></element>
|
|
1147
|
+
* Then: fullscreen.toggle() or fullscreen.enter() or fullscreen.exit()
|
|
1148
|
+
*/
|
|
1149
|
+
class AXFullscreenDirective {
|
|
1150
|
+
constructor(elementRef) {
|
|
1151
|
+
this.elementRef = elementRef;
|
|
1152
|
+
//#region ---- Properties ----
|
|
1153
|
+
/**
|
|
1154
|
+
* Current fullscreen state
|
|
1155
|
+
*/
|
|
1156
|
+
this.isFullscreenState = signal(false, ...(ngDevMode ? [{ debugName: "isFullscreenState" }] : []));
|
|
1157
|
+
/**
|
|
1158
|
+
* Original element styles to restore
|
|
1159
|
+
*/
|
|
1160
|
+
this.originalStyles = {};
|
|
1161
|
+
/**
|
|
1162
|
+
* Original parent element reference
|
|
1163
|
+
*/
|
|
1164
|
+
this.originalParent = null;
|
|
1165
|
+
/**
|
|
1166
|
+
* Fullscreen container element
|
|
1167
|
+
*/
|
|
1168
|
+
this.fullscreenContainer = null;
|
|
1169
|
+
/**
|
|
1170
|
+
* Fullscreen change event
|
|
1171
|
+
*/
|
|
1172
|
+
this.fullscreenChange = output();
|
|
1173
|
+
//#endregion
|
|
1174
|
+
//#region ---- Constructor ----
|
|
1175
|
+
this.destroyRef = inject(DestroyRef);
|
|
1176
|
+
this.renderer = inject(Renderer2);
|
|
1177
|
+
// Sync state changes to output
|
|
1178
|
+
effect(() => {
|
|
1179
|
+
const isFullscreen = this.isFullscreenState();
|
|
1180
|
+
untracked(() => {
|
|
1181
|
+
this.fullscreenChange.emit(isFullscreen);
|
|
1182
|
+
});
|
|
1183
|
+
});
|
|
1184
|
+
}
|
|
1185
|
+
//#endregion
|
|
1186
|
+
//#region ---- Public API ----
|
|
1187
|
+
/**
|
|
1188
|
+
* Toggle fullscreen state
|
|
1189
|
+
*/
|
|
1190
|
+
async toggle() {
|
|
1191
|
+
if (this.isFullscreenState()) {
|
|
1192
|
+
await this.exit();
|
|
1193
|
+
}
|
|
1194
|
+
else {
|
|
1195
|
+
await this.enter();
|
|
1196
|
+
}
|
|
1197
|
+
}
|
|
1198
|
+
/**
|
|
1199
|
+
* Enter fullscreen mode using CSS
|
|
1200
|
+
*/
|
|
1201
|
+
async enter() {
|
|
1202
|
+
if (this.isFullscreenState()) {
|
|
1203
|
+
return;
|
|
1204
|
+
}
|
|
1205
|
+
const element = this.elementRef.nativeElement;
|
|
1206
|
+
try {
|
|
1207
|
+
// Store original styles and parent
|
|
1208
|
+
this.storeOriginalStyles(element);
|
|
1209
|
+
this.originalParent = element.parentElement;
|
|
1210
|
+
// Create fullscreen container
|
|
1211
|
+
this.fullscreenContainer = this.renderer.createElement('div');
|
|
1212
|
+
this.renderer.setStyle(this.fullscreenContainer, 'position', 'fixed');
|
|
1213
|
+
this.renderer.setStyle(this.fullscreenContainer, 'top', '0');
|
|
1214
|
+
this.renderer.setStyle(this.fullscreenContainer, 'left', '0');
|
|
1215
|
+
this.renderer.setStyle(this.fullscreenContainer, 'width', '100vw');
|
|
1216
|
+
this.renderer.setStyle(this.fullscreenContainer, 'height', '100vh');
|
|
1217
|
+
this.renderer.setStyle(this.fullscreenContainer, 'z-index', '9999');
|
|
1218
|
+
this.renderer.setStyle(this.fullscreenContainer, 'background-color', '#ffffff');
|
|
1219
|
+
this.renderer.setStyle(this.fullscreenContainer, 'overflow', 'auto');
|
|
1220
|
+
// Move element to container
|
|
1221
|
+
this.renderer.appendChild(this.fullscreenContainer, element);
|
|
1222
|
+
// Apply fullscreen styles to element
|
|
1223
|
+
this.renderer.setStyle(element, 'position', 'relative');
|
|
1224
|
+
this.renderer.setStyle(element, 'width', '100%');
|
|
1225
|
+
this.renderer.setStyle(element, 'height', '100%');
|
|
1226
|
+
this.renderer.setStyle(element, 'margin', '0');
|
|
1227
|
+
this.renderer.setStyle(element, 'padding', '0');
|
|
1228
|
+
// Append container to body
|
|
1229
|
+
this.renderer.appendChild(document.body, this.fullscreenContainer);
|
|
1230
|
+
// Prevent body scroll
|
|
1231
|
+
this.renderer.setStyle(document.body, 'overflow', 'hidden');
|
|
1232
|
+
this.isFullscreenState.set(true);
|
|
1233
|
+
}
|
|
1234
|
+
catch (error) {
|
|
1235
|
+
console.error('Error entering fullscreen:', error);
|
|
1236
|
+
this.restoreOriginalStyles(element);
|
|
1237
|
+
}
|
|
1238
|
+
}
|
|
1239
|
+
/**
|
|
1240
|
+
* Exit fullscreen mode
|
|
1241
|
+
*/
|
|
1242
|
+
async exit() {
|
|
1243
|
+
if (!this.isFullscreenState()) {
|
|
1244
|
+
return;
|
|
1245
|
+
}
|
|
1246
|
+
const element = this.elementRef.nativeElement;
|
|
1247
|
+
try {
|
|
1248
|
+
// Restore body scroll
|
|
1249
|
+
this.renderer.removeStyle(document.body, 'overflow');
|
|
1250
|
+
// Move element back to original parent
|
|
1251
|
+
if (this.fullscreenContainer && this.originalParent) {
|
|
1252
|
+
this.renderer.removeChild(this.fullscreenContainer, element);
|
|
1253
|
+
this.renderer.appendChild(this.originalParent, element);
|
|
1254
|
+
// Remove container
|
|
1255
|
+
this.renderer.removeChild(document.body, this.fullscreenContainer);
|
|
1256
|
+
this.fullscreenContainer = null;
|
|
1257
|
+
}
|
|
1258
|
+
// Restore original styles
|
|
1259
|
+
this.restoreOriginalStyles(element);
|
|
1260
|
+
this.isFullscreenState.set(false);
|
|
1261
|
+
}
|
|
1262
|
+
catch (error) {
|
|
1263
|
+
console.error('Error exiting fullscreen:', error);
|
|
1264
|
+
}
|
|
1265
|
+
}
|
|
1266
|
+
/**
|
|
1267
|
+
* Check if currently in fullscreen mode
|
|
1268
|
+
*/
|
|
1269
|
+
isFullscreen() {
|
|
1270
|
+
return this.isFullscreenState();
|
|
1271
|
+
}
|
|
1272
|
+
//#endregion
|
|
1273
|
+
//#region ---- Private Methods ----
|
|
1274
|
+
/**
|
|
1275
|
+
* Store original element styles
|
|
1276
|
+
*/
|
|
1277
|
+
storeOriginalStyles(element) {
|
|
1278
|
+
const computedStyle = window.getComputedStyle(element);
|
|
1279
|
+
this.originalStyles = {
|
|
1280
|
+
position: computedStyle.position,
|
|
1281
|
+
top: computedStyle.top,
|
|
1282
|
+
left: computedStyle.left,
|
|
1283
|
+
width: computedStyle.width,
|
|
1284
|
+
height: computedStyle.height,
|
|
1285
|
+
zIndex: computedStyle.zIndex,
|
|
1286
|
+
backgroundColor: computedStyle.backgroundColor,
|
|
1287
|
+
margin: computedStyle.margin,
|
|
1288
|
+
padding: computedStyle.padding,
|
|
1289
|
+
};
|
|
1290
|
+
}
|
|
1291
|
+
/**
|
|
1292
|
+
* Restore original element styles
|
|
1293
|
+
*/
|
|
1294
|
+
restoreOriginalStyles(element) {
|
|
1295
|
+
if (!this.originalStyles) {
|
|
1296
|
+
return;
|
|
1297
|
+
}
|
|
1298
|
+
// Restore each style property
|
|
1299
|
+
Object.entries(this.originalStyles).forEach(([key, value]) => {
|
|
1300
|
+
const styleKey = this.camelToKebabCase(key);
|
|
1301
|
+
if (value) {
|
|
1302
|
+
this.renderer.setStyle(element, styleKey, value);
|
|
1303
|
+
}
|
|
1304
|
+
else {
|
|
1305
|
+
this.renderer.removeStyle(element, styleKey);
|
|
1306
|
+
}
|
|
1307
|
+
});
|
|
1308
|
+
this.originalStyles = {};
|
|
1309
|
+
}
|
|
1310
|
+
/**
|
|
1311
|
+
* Convert camelCase to kebab-case for CSS properties
|
|
1312
|
+
*/
|
|
1313
|
+
camelToKebabCase(str) {
|
|
1314
|
+
return str.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, '$1-$2').toLowerCase();
|
|
1315
|
+
}
|
|
1316
|
+
//#endregion
|
|
1317
|
+
//#region ---- Lifecycle ----
|
|
1318
|
+
ngOnDestroy() {
|
|
1319
|
+
// Exit fullscreen if still active
|
|
1320
|
+
if (this.isFullscreenState()) {
|
|
1321
|
+
this.exit().catch(() => {
|
|
1322
|
+
// Ignore errors during cleanup
|
|
1323
|
+
});
|
|
1324
|
+
}
|
|
1325
|
+
}
|
|
1326
|
+
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 }); }
|
|
1327
|
+
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 }); }
|
|
1328
|
+
}
|
|
1329
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXFullscreenDirective, decorators: [{
|
|
1330
|
+
type: Directive,
|
|
1331
|
+
args: [{
|
|
1332
|
+
selector: '[axFullscreen]',
|
|
1333
|
+
standalone: true,
|
|
1334
|
+
exportAs: 'axFullscreen',
|
|
1335
|
+
}]
|
|
1336
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { fullscreenChange: [{ type: i0.Output, args: ["fullscreenChange"] }] } });
|
|
1337
|
+
|
|
969
1338
|
const AXP_DISTRIBUTED_EVENT_LISTENER_PROVIDER = new InjectionToken('AXP_DISTRIBUTED_EVENT_LISTENER_PROVIDER');
|
|
970
1339
|
|
|
971
1340
|
//#region ---- Imports ----
|
|
@@ -1445,448 +1814,362 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImpo
|
|
|
1445
1814
|
args: [{ providedIn: 'root' }]
|
|
1446
1815
|
}] });
|
|
1447
1816
|
|
|
1448
|
-
|
|
1817
|
+
//#region ---- Imports ----
|
|
1818
|
+
//#endregion
|
|
1819
|
+
|
|
1820
|
+
//#region ---- Imports ----
|
|
1821
|
+
//#endregion
|
|
1822
|
+
//#region ---- Injection Token ----
|
|
1823
|
+
/**
|
|
1824
|
+
* Injection token for module manifest providers.
|
|
1825
|
+
* Modules register their manifest providers using this token.
|
|
1826
|
+
*/
|
|
1827
|
+
const AXP_MODULE_MANIFEST_PROVIDER = new InjectionToken('AXP_MODULE_MANIFEST_PROVIDER');
|
|
1828
|
+
//#endregion
|
|
1829
|
+
//#region ---- Default Provider ----
|
|
1830
|
+
|
|
1831
|
+
//#region ---- Imports ----
|
|
1832
|
+
//#endregion
|
|
1833
|
+
//#region ---- Registry Service ----
|
|
1834
|
+
/**
|
|
1835
|
+
* Registry service for module manifests.
|
|
1836
|
+
* Collects and manages all registered module manifests.
|
|
1837
|
+
*/
|
|
1838
|
+
class AXPModuleManifestRegistry {
|
|
1449
1839
|
constructor() {
|
|
1450
|
-
|
|
1840
|
+
//#region ---- Fields ----
|
|
1841
|
+
this.manifests = new Map();
|
|
1842
|
+
this.featureDefinitions = new Map();
|
|
1843
|
+
this.injector = inject(Injector);
|
|
1844
|
+
this.initializationPromise = null;
|
|
1845
|
+
this.isInitialized = false;
|
|
1451
1846
|
}
|
|
1452
|
-
|
|
1453
|
-
|
|
1847
|
+
//#endregion
|
|
1848
|
+
//#region ---- Initialization ----
|
|
1849
|
+
/**
|
|
1850
|
+
* Initialize registry by loading all manifest providers.
|
|
1851
|
+
* Should be called during app startup.
|
|
1852
|
+
* Safe to call multiple times - will only initialize once.
|
|
1853
|
+
*/
|
|
1854
|
+
async initialize() {
|
|
1855
|
+
// If already initialized, return immediately
|
|
1856
|
+
if (this.isInitialized) {
|
|
1857
|
+
return;
|
|
1858
|
+
}
|
|
1859
|
+
// If initialization is in progress, wait for it
|
|
1860
|
+
if (this.initializationPromise) {
|
|
1861
|
+
return this.initializationPromise;
|
|
1862
|
+
}
|
|
1863
|
+
// Start initialization
|
|
1864
|
+
this.initializationPromise = this._doInitialize();
|
|
1865
|
+
await this.initializationPromise;
|
|
1454
1866
|
}
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1867
|
+
/**
|
|
1868
|
+
* Internal initialization logic.
|
|
1869
|
+
*/
|
|
1870
|
+
async _doInitialize() {
|
|
1871
|
+
// Get manifests from injector (using useValue, they are provided directly)
|
|
1872
|
+
let manifests;
|
|
1873
|
+
try {
|
|
1874
|
+
const injectedManifests = this.injector.get(AXP_MODULE_MANIFEST_PROVIDER, []);
|
|
1875
|
+
manifests = Array.isArray(injectedManifests) ? injectedManifests : injectedManifests ? [injectedManifests] : [];
|
|
1876
|
+
}
|
|
1877
|
+
catch (error) {
|
|
1878
|
+
console.error('Failed to get manifest providers from injector:', error);
|
|
1879
|
+
manifests = [];
|
|
1460
1880
|
}
|
|
1881
|
+
// Register all manifests directly
|
|
1882
|
+
const registerPromises = manifests.map(async (manifest) => {
|
|
1883
|
+
try {
|
|
1884
|
+
// Validate manifest
|
|
1885
|
+
if (!manifest) {
|
|
1886
|
+
console.error('Invalid manifest:', manifest);
|
|
1887
|
+
return;
|
|
1888
|
+
}
|
|
1889
|
+
await this.register(manifest);
|
|
1890
|
+
}
|
|
1891
|
+
catch (error) {
|
|
1892
|
+
console.error(`Failed to register manifest:`, error);
|
|
1893
|
+
}
|
|
1894
|
+
});
|
|
1895
|
+
await Promise.all(registerPromises);
|
|
1896
|
+
this.isInitialized = true;
|
|
1461
1897
|
}
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1898
|
+
//#endregion
|
|
1899
|
+
//#region ---- Manifest Management ----
|
|
1900
|
+
/**
|
|
1901
|
+
* Register a module manifest.
|
|
1902
|
+
*/
|
|
1903
|
+
async register(manifest) {
|
|
1904
|
+
// Validate manifest
|
|
1905
|
+
if (!manifest.name) {
|
|
1906
|
+
throw new Error('Manifest must have a name');
|
|
1907
|
+
}
|
|
1908
|
+
if (!manifest.version) {
|
|
1909
|
+
throw new Error(`Manifest for module '${manifest.name}' must have a version`);
|
|
1466
1910
|
}
|
|
1911
|
+
// Register manifest
|
|
1912
|
+
this.manifests.set(manifest.name, manifest);
|
|
1467
1913
|
}
|
|
1468
|
-
|
|
1469
|
-
|
|
1914
|
+
/**
|
|
1915
|
+
* Get manifest for a module.
|
|
1916
|
+
*/
|
|
1917
|
+
get(moduleName) {
|
|
1918
|
+
return this.manifests.get(moduleName);
|
|
1919
|
+
}
|
|
1920
|
+
/**
|
|
1921
|
+
* Get all registered manifests.
|
|
1922
|
+
*/
|
|
1923
|
+
getAll() {
|
|
1924
|
+
return Array.from(this.manifests.values());
|
|
1925
|
+
}
|
|
1926
|
+
/**
|
|
1927
|
+
* Check if a module manifest is registered.
|
|
1928
|
+
*/
|
|
1929
|
+
has(moduleName) {
|
|
1930
|
+
return this.manifests.has(moduleName);
|
|
1931
|
+
}
|
|
1932
|
+
//#endregion
|
|
1933
|
+
//#region ---- Feature Definition Management ----
|
|
1934
|
+
/**
|
|
1935
|
+
* Get all feature definitions from all manifests.
|
|
1936
|
+
*/
|
|
1937
|
+
getAllFeatureDefinitions() {
|
|
1938
|
+
return Array.from(this.featureDefinitions.values());
|
|
1939
|
+
}
|
|
1940
|
+
/**
|
|
1941
|
+
* Get feature definition by full name.
|
|
1942
|
+
*/
|
|
1943
|
+
getFeatureDefinition(featureName) {
|
|
1944
|
+
return this.featureDefinitions.get(featureName);
|
|
1945
|
+
}
|
|
1946
|
+
/**
|
|
1947
|
+
* Check if a feature is defined in any manifest.
|
|
1948
|
+
*/
|
|
1949
|
+
isFeatureDefined(featureName) {
|
|
1950
|
+
return this.featureDefinitions.has(featureName);
|
|
1951
|
+
}
|
|
1952
|
+
/**
|
|
1953
|
+
* Get default value for a feature.
|
|
1954
|
+
* Returns undefined if feature is not defined.
|
|
1955
|
+
*/
|
|
1956
|
+
getFeatureDefault(featureName) {
|
|
1957
|
+
const definition = this.getFeatureDefinition(featureName);
|
|
1958
|
+
return definition?.defaultValue;
|
|
1959
|
+
}
|
|
1960
|
+
/**
|
|
1961
|
+
* Get all feature definitions for a specific module.
|
|
1962
|
+
*/
|
|
1963
|
+
getModuleFeatures(moduleName) {
|
|
1964
|
+
return Array.from(this.featureDefinitions.values()).filter((def) => def.module === moduleName);
|
|
1965
|
+
}
|
|
1966
|
+
/**
|
|
1967
|
+
* Register a feature definition dynamically (e.g., from feature definition provider).
|
|
1968
|
+
* Used to add features that are defined at runtime via featuresProvider.
|
|
1969
|
+
*/
|
|
1970
|
+
registerFeatureDefinition(definition) {
|
|
1971
|
+
this.featureDefinitions.set(definition.name, definition);
|
|
1972
|
+
}
|
|
1973
|
+
//#endregion
|
|
1974
|
+
//#region ---- Dependency Checking ----
|
|
1975
|
+
/**
|
|
1976
|
+
* Check if module dependencies are satisfied.
|
|
1977
|
+
* Returns array of missing dependencies.
|
|
1978
|
+
*/
|
|
1979
|
+
checkDependencies(moduleName) {
|
|
1980
|
+
const manifest = this.get(moduleName);
|
|
1981
|
+
if (!manifest?.dependencies) {
|
|
1982
|
+
return { missingModules: [], missingFeatures: [] };
|
|
1983
|
+
}
|
|
1984
|
+
const missingModules = [];
|
|
1985
|
+
const missingFeatures = [];
|
|
1986
|
+
// Check module dependencies
|
|
1987
|
+
if (manifest.dependencies.modules) {
|
|
1988
|
+
for (const depModule of manifest.dependencies.modules) {
|
|
1989
|
+
if (!this.has(depModule)) {
|
|
1990
|
+
missingModules.push(depModule);
|
|
1991
|
+
}
|
|
1992
|
+
}
|
|
1993
|
+
}
|
|
1994
|
+
// Check feature dependencies
|
|
1995
|
+
if (manifest.dependencies.features) {
|
|
1996
|
+
for (const featureName of manifest.dependencies.features) {
|
|
1997
|
+
if (!this.isFeatureDefined(featureName)) {
|
|
1998
|
+
missingFeatures.push(featureName);
|
|
1999
|
+
}
|
|
2000
|
+
}
|
|
2001
|
+
}
|
|
2002
|
+
return { missingModules, missingFeatures };
|
|
2003
|
+
}
|
|
2004
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXPModuleManifestRegistry, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2005
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXPModuleManifestRegistry, providedIn: 'root' }); }
|
|
1470
2006
|
}
|
|
1471
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type:
|
|
2007
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXPModuleManifestRegistry, decorators: [{
|
|
1472
2008
|
type: Injectable,
|
|
1473
|
-
args: [{
|
|
1474
|
-
providedIn: 'root',
|
|
1475
|
-
}]
|
|
2009
|
+
args: [{ providedIn: 'root' }]
|
|
1476
2010
|
}] });
|
|
1477
|
-
function initAppFactory(appInitService) {
|
|
1478
|
-
return () => appInitService.runAllTasks();
|
|
1479
|
-
}
|
|
1480
|
-
const AXPAppStartUpProvider = provideAppInitializer(() => {
|
|
1481
|
-
const initializerFn = initAppFactory(inject(AXPAppStartUpService));
|
|
1482
|
-
return initializerFn();
|
|
1483
|
-
});
|
|
1484
2011
|
|
|
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
|
-
}
|
|
1495
|
-
|
|
1496
|
-
//#region ---- Injection Token ----
|
|
1497
|
-
/**
|
|
1498
|
-
* Injection token for status providers
|
|
1499
|
-
* Use with multi: true to register multiple providers
|
|
1500
|
-
*/
|
|
1501
|
-
const AXP_STATUS_PROVIDERS = new InjectionToken('AXP_STATUS_PROVIDERS');
|
|
2012
|
+
//#region ---- Imports ----
|
|
1502
2013
|
//#endregion
|
|
1503
|
-
//#region ----
|
|
2014
|
+
//#region ---- Initializer ----
|
|
1504
2015
|
/**
|
|
1505
|
-
*
|
|
1506
|
-
*
|
|
1507
|
-
*
|
|
1508
|
-
* @example
|
|
1509
|
-
* ```typescript
|
|
1510
|
-
* // In a module providers array:
|
|
1511
|
-
* {
|
|
1512
|
-
* provide: AXP_STATUS_PROVIDERS,
|
|
1513
|
-
* useClass: TaskStatusProvider,
|
|
1514
|
-
* multi: true,
|
|
1515
|
-
* }
|
|
1516
|
-
*
|
|
1517
|
-
* // Example provider implementation:
|
|
1518
|
-
* export class TaskStatusProvider extends AXPStatusProvider {
|
|
1519
|
-
* readonly key = 'task-management.status';
|
|
1520
|
-
* readonly statuses = [
|
|
1521
|
-
* { name: 'todo', title: 'To Do', color: '#6b7280', icon: 'fa-light fa-circle', isInitial: true },
|
|
1522
|
-
* { name: 'in-progress', title: 'In Progress', color: '#3b82f6', icon: 'fa-light fa-play' },
|
|
1523
|
-
* { name: 'done', title: 'Done', color: '#10b981', icon: 'fa-light fa-check-circle', isFinal: true },
|
|
1524
|
-
* ];
|
|
1525
|
-
* readonly transitions = [
|
|
1526
|
-
* { from: 'todo', to: 'in-progress', title: 'Start', condition: '{{user.canEdit}}' },
|
|
1527
|
-
* { from: 'in-progress', to: 'done', title: 'Complete' },
|
|
1528
|
-
* ];
|
|
1529
|
-
* readonly defaultStatus = 'todo';
|
|
1530
|
-
* }
|
|
1531
|
-
*
|
|
1532
|
-
* // Later, get the status:
|
|
1533
|
-
* const status = statusService.getStatus('task-management.status');
|
|
1534
|
-
* if (status) {
|
|
1535
|
-
* console.log('Statuses:', status.statuses);
|
|
1536
|
-
* console.log('Transitions:', status.transitions);
|
|
1537
|
-
* }
|
|
1538
|
-
* ```
|
|
2016
|
+
* Startup task to initialize module manifest registry.
|
|
2017
|
+
* Registers this task with app startup service.
|
|
1539
2018
|
*/
|
|
1540
|
-
class
|
|
1541
|
-
//#endregion
|
|
1542
|
-
//#region ---- Constructor ----
|
|
2019
|
+
class AXPModuleManifestInitializer {
|
|
1543
2020
|
constructor() {
|
|
1544
|
-
//#region ----
|
|
1545
|
-
this.
|
|
1546
|
-
//#endregion
|
|
1547
|
-
//#region ---- State ----
|
|
1548
|
-
this.statusMap = new Map();
|
|
1549
|
-
// Register all providers in constructor (like badge service)
|
|
1550
|
-
for (const provider of this.providers) {
|
|
1551
|
-
if (this.statusMap.has(provider.key)) {
|
|
1552
|
-
console.warn(`Status with key "${provider.key}" already exists. Overwriting with new status.`);
|
|
1553
|
-
}
|
|
1554
|
-
this.statusMap.set(provider.key, provider);
|
|
1555
|
-
}
|
|
2021
|
+
//#region ---- Fields ----
|
|
2022
|
+
this.manifestRegistry = inject(AXPModuleManifestRegistry);
|
|
1556
2023
|
}
|
|
1557
2024
|
//#endregion
|
|
1558
|
-
//#region ---- Public
|
|
2025
|
+
//#region ---- Public Methods ----
|
|
1559
2026
|
/**
|
|
1560
|
-
*
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
*/
|
|
1575
|
-
getStatus(key) {
|
|
1576
|
-
return this.statusMap.get(key);
|
|
1577
|
-
}
|
|
1578
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXPStatusDefinitionProviderService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1579
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXPStatusDefinitionProviderService, providedIn: 'root' }); }
|
|
2027
|
+
* Create startup task for manifest initialization.
|
|
2028
|
+
*/
|
|
2029
|
+
createStartupTask() {
|
|
2030
|
+
return {
|
|
2031
|
+
name: 'ModuleManifests',
|
|
2032
|
+
statusText: 'Loading module manifests...',
|
|
2033
|
+
priority: 1, // Load early, before features/permissions
|
|
2034
|
+
run: async () => {
|
|
2035
|
+
await this.manifestRegistry.initialize();
|
|
2036
|
+
},
|
|
2037
|
+
};
|
|
2038
|
+
}
|
|
2039
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXPModuleManifestInitializer, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2040
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXPModuleManifestInitializer, providedIn: 'root' }); }
|
|
1580
2041
|
}
|
|
1581
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type:
|
|
2042
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXPModuleManifestInitializer, decorators: [{
|
|
1582
2043
|
type: Injectable,
|
|
1583
2044
|
args: [{ providedIn: 'root' }]
|
|
1584
|
-
}]
|
|
2045
|
+
}] });
|
|
1585
2046
|
|
|
2047
|
+
//#region ---- Imports ----
|
|
2048
|
+
//#endregion
|
|
2049
|
+
//#region ---- Feature Definition Provider Interface ----
|
|
1586
2050
|
/**
|
|
1587
|
-
*
|
|
1588
|
-
*
|
|
2051
|
+
* Context for feature definition providers.
|
|
2052
|
+
* Allows providers to add additional feature definitions dynamically.
|
|
1589
2053
|
*/
|
|
1590
|
-
|
|
1591
|
-
(
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
AXPSystemStatusType["Failed"] = "failed";
|
|
1610
|
-
})(AXPSystemStatusType || (AXPSystemStatusType = {}));
|
|
1611
|
-
const i18n$1 = (key) => `@general:statuses.${key}`;
|
|
2054
|
+
class AXPFeatureDefinitionProviderContext {
|
|
2055
|
+
constructor() {
|
|
2056
|
+
this.features = new Map();
|
|
2057
|
+
}
|
|
2058
|
+
/**
|
|
2059
|
+
* Add a feature definition.
|
|
2060
|
+
* @param key Full feature key (ModuleName:FeatureKey format with colon separator)
|
|
2061
|
+
* @param definition Feature definition
|
|
2062
|
+
*/
|
|
2063
|
+
addFeature(key, definition) {
|
|
2064
|
+
this.features.set(key, definition);
|
|
2065
|
+
}
|
|
2066
|
+
/**
|
|
2067
|
+
* Get all feature definitions.
|
|
2068
|
+
*/
|
|
2069
|
+
getFeatures() {
|
|
2070
|
+
return this.features;
|
|
2071
|
+
}
|
|
2072
|
+
}
|
|
1612
2073
|
/**
|
|
1613
|
-
*
|
|
1614
|
-
* Provides consistent status definitions across the platform
|
|
1615
|
-
* Uses AXPStatusDefinition interface from status-definition.types.ts
|
|
2074
|
+
* Injection token for feature definition providers.
|
|
1616
2075
|
*/
|
|
1617
|
-
const
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
icon: 'fa-light fa-play',
|
|
1633
|
-
color: '#3b82f6',
|
|
1634
|
-
description: i18n$1('in-progress.description'),
|
|
1635
|
-
order: 2,
|
|
1636
|
-
isActive: true,
|
|
1637
|
-
isInitial: false,
|
|
1638
|
-
isFinal: false,
|
|
1639
|
-
},
|
|
1640
|
-
InReview: {
|
|
1641
|
-
name: AXPSystemStatusType.InReview,
|
|
1642
|
-
title: i18n$1('in-review.title'),
|
|
1643
|
-
icon: 'fa-light fa-eye',
|
|
1644
|
-
color: '#8b5cf6',
|
|
1645
|
-
description: i18n$1('in-review.description'),
|
|
1646
|
-
order: 3,
|
|
1647
|
-
isActive: true,
|
|
1648
|
-
isInitial: false,
|
|
1649
|
-
isFinal: false,
|
|
1650
|
-
},
|
|
1651
|
-
Blocked: {
|
|
1652
|
-
name: AXPSystemStatusType.Blocked,
|
|
1653
|
-
title: i18n$1('blocked.title'),
|
|
1654
|
-
icon: 'fa-light fa-ban',
|
|
1655
|
-
color: '#ef4444',
|
|
1656
|
-
description: i18n$1('blocked.description'),
|
|
1657
|
-
order: 4,
|
|
1658
|
-
isActive: true,
|
|
1659
|
-
isInitial: false,
|
|
1660
|
-
isFinal: false,
|
|
1661
|
-
},
|
|
1662
|
-
Done: {
|
|
1663
|
-
name: AXPSystemStatusType.Done,
|
|
1664
|
-
title: i18n$1('done.title'),
|
|
1665
|
-
icon: 'fa-light fa-check-circle',
|
|
1666
|
-
color: '#10b981',
|
|
1667
|
-
description: i18n$1('done.description'),
|
|
1668
|
-
order: 5,
|
|
1669
|
-
isActive: true,
|
|
1670
|
-
isInitial: false,
|
|
1671
|
-
isFinal: true,
|
|
1672
|
-
},
|
|
1673
|
-
Cancelled: {
|
|
1674
|
-
name: AXPSystemStatusType.Cancelled,
|
|
1675
|
-
title: i18n$1('cancelled.title'),
|
|
1676
|
-
icon: 'fa-light fa-times-circle',
|
|
1677
|
-
color: '#64748b',
|
|
1678
|
-
description: i18n$1('cancelled.description'),
|
|
1679
|
-
order: 6,
|
|
1680
|
-
isActive: true,
|
|
1681
|
-
isInitial: false,
|
|
1682
|
-
isFinal: true,
|
|
1683
|
-
},
|
|
1684
|
-
Draft: {
|
|
1685
|
-
name: AXPSystemStatusType.Draft,
|
|
1686
|
-
title: i18n$1('draft.title'),
|
|
1687
|
-
icon: 'fa-light fa-file-pen',
|
|
1688
|
-
color: '#6b7280',
|
|
1689
|
-
description: i18n$1('draft.description'),
|
|
1690
|
-
order: 1,
|
|
1691
|
-
isActive: true,
|
|
1692
|
-
isInitial: true,
|
|
1693
|
-
isFinal: false,
|
|
1694
|
-
},
|
|
1695
|
-
PendingReview: {
|
|
1696
|
-
name: AXPSystemStatusType.PendingReview,
|
|
1697
|
-
title: i18n$1('pending-review.title'),
|
|
1698
|
-
icon: 'fa-light fa-clock',
|
|
1699
|
-
color: '#f59e0b',
|
|
1700
|
-
description: i18n$1('pending-review.description'),
|
|
1701
|
-
order: 2,
|
|
1702
|
-
isActive: true,
|
|
1703
|
-
isInitial: false,
|
|
1704
|
-
isFinal: false,
|
|
1705
|
-
},
|
|
1706
|
-
Approved: {
|
|
1707
|
-
name: AXPSystemStatusType.Approved,
|
|
1708
|
-
title: i18n$1('approved.title'),
|
|
1709
|
-
icon: 'fa-light fa-check-circle',
|
|
1710
|
-
color: '#10b981',
|
|
1711
|
-
description: i18n$1('approved.description'),
|
|
1712
|
-
order: 3,
|
|
1713
|
-
isActive: true,
|
|
1714
|
-
isInitial: false,
|
|
1715
|
-
isFinal: false,
|
|
1716
|
-
},
|
|
1717
|
-
Published: {
|
|
1718
|
-
name: AXPSystemStatusType.Published,
|
|
1719
|
-
title: i18n$1('published.title'),
|
|
1720
|
-
icon: 'fa-light fa-globe',
|
|
1721
|
-
color: '#3b82f6',
|
|
1722
|
-
description: i18n$1('published.description'),
|
|
1723
|
-
order: 4,
|
|
1724
|
-
isActive: true,
|
|
1725
|
-
isInitial: false,
|
|
1726
|
-
isFinal: false,
|
|
1727
|
-
},
|
|
1728
|
-
Archived: {
|
|
1729
|
-
name: AXPSystemStatusType.Archived,
|
|
1730
|
-
title: i18n$1('archived.title'),
|
|
1731
|
-
icon: 'fa-light fa-archive',
|
|
1732
|
-
color: '#64748b',
|
|
1733
|
-
description: i18n$1('archived.description'),
|
|
1734
|
-
order: 5,
|
|
1735
|
-
isActive: true,
|
|
1736
|
-
isInitial: false,
|
|
1737
|
-
isFinal: true,
|
|
1738
|
-
},
|
|
1739
|
-
Rejected: {
|
|
1740
|
-
name: AXPSystemStatusType.Rejected,
|
|
1741
|
-
title: i18n$1('rejected.title'),
|
|
1742
|
-
icon: 'fa-light fa-times-circle',
|
|
1743
|
-
color: '#ef4444',
|
|
1744
|
-
description: i18n$1('rejected.description'),
|
|
1745
|
-
order: 6,
|
|
1746
|
-
isActive: true,
|
|
1747
|
-
isInitial: false,
|
|
1748
|
-
isFinal: true,
|
|
1749
|
-
},
|
|
1750
|
-
Active: {
|
|
1751
|
-
name: AXPSystemStatusType.Active,
|
|
1752
|
-
title: i18n$1('active.title'),
|
|
1753
|
-
icon: 'fa-light fa-check-circle',
|
|
1754
|
-
color: '#10b981',
|
|
1755
|
-
description: i18n$1('active.description'),
|
|
1756
|
-
order: 1,
|
|
1757
|
-
isActive: true,
|
|
1758
|
-
isInitial: false,
|
|
1759
|
-
isFinal: false,
|
|
1760
|
-
},
|
|
1761
|
-
Inactive: {
|
|
1762
|
-
name: AXPSystemStatusType.Inactive,
|
|
1763
|
-
title: i18n$1('inactive.title'),
|
|
1764
|
-
icon: 'fa-light fa-circle',
|
|
1765
|
-
color: '#6b7280',
|
|
1766
|
-
description: i18n$1('inactive.description'),
|
|
1767
|
-
order: 2,
|
|
1768
|
-
isActive: true,
|
|
1769
|
-
isInitial: false,
|
|
1770
|
-
isFinal: false,
|
|
1771
|
-
},
|
|
1772
|
-
Pending: {
|
|
1773
|
-
name: AXPSystemStatusType.Pending,
|
|
1774
|
-
title: i18n$1('pending.title'),
|
|
1775
|
-
icon: 'fa-light fa-clock',
|
|
1776
|
-
color: '#f59e0b',
|
|
1777
|
-
description: i18n$1('pending.description'),
|
|
1778
|
-
order: 1,
|
|
1779
|
-
isActive: true,
|
|
1780
|
-
isInitial: true,
|
|
1781
|
-
isFinal: false,
|
|
1782
|
-
},
|
|
1783
|
-
Completed: {
|
|
1784
|
-
name: AXPSystemStatusType.Completed,
|
|
1785
|
-
title: i18n$1('completed.title'),
|
|
1786
|
-
icon: 'fa-light fa-check-circle',
|
|
1787
|
-
color: '#10b981',
|
|
1788
|
-
description: i18n$1('completed.description'),
|
|
1789
|
-
order: 10,
|
|
1790
|
-
isActive: true,
|
|
1791
|
-
isInitial: false,
|
|
1792
|
-
isFinal: true,
|
|
1793
|
-
},
|
|
1794
|
-
Suspended: {
|
|
1795
|
-
name: AXPSystemStatusType.Suspended,
|
|
1796
|
-
title: i18n$1('suspended.title'),
|
|
1797
|
-
icon: 'fa-light fa-pause-circle',
|
|
1798
|
-
color: '#f59e0b',
|
|
1799
|
-
description: i18n$1('suspended.description'),
|
|
1800
|
-
order: 5,
|
|
1801
|
-
isActive: true,
|
|
1802
|
-
isInitial: false,
|
|
1803
|
-
isFinal: false,
|
|
1804
|
-
},
|
|
1805
|
-
Failed: {
|
|
1806
|
-
name: AXPSystemStatusType.Failed,
|
|
1807
|
-
title: i18n$1('failed.title'),
|
|
1808
|
-
icon: 'fa-light fa-xmark-circle',
|
|
1809
|
-
color: '#ef4444',
|
|
1810
|
-
description: i18n$1('failed.description'),
|
|
1811
|
-
order: 10,
|
|
1812
|
-
isActive: true,
|
|
1813
|
-
isInitial: false,
|
|
1814
|
-
isFinal: true,
|
|
2076
|
+
const AXP_FEATURE_DEFINITION_PROVIDER = new InjectionToken('AXP_FEATURE_DEFINITION_PROVIDER', {
|
|
2077
|
+
providedIn: 'root',
|
|
2078
|
+
factory: () => [],
|
|
2079
|
+
});
|
|
2080
|
+
//#endregion
|
|
2081
|
+
|
|
2082
|
+
//#region ---- Provider Interfaces ----
|
|
2083
|
+
/**
|
|
2084
|
+
* Injection token for edition service.
|
|
2085
|
+
* Modules should provide their implementation using this token.
|
|
2086
|
+
*/
|
|
2087
|
+
const AXP_EDITION_SERVICE = new InjectionToken('AXP_EDITION_SERVICE', {
|
|
2088
|
+
providedIn: 'root',
|
|
2089
|
+
factory: () => {
|
|
2090
|
+
return null;
|
|
1815
2091
|
},
|
|
1816
2092
|
});
|
|
1817
2093
|
/**
|
|
1818
|
-
*
|
|
1819
|
-
* @
|
|
1820
|
-
* @returns System status definition or undefined
|
|
2094
|
+
* Injection token for module provider loader.
|
|
2095
|
+
* Implementation: @acorex/platform/auth
|
|
1821
2096
|
*/
|
|
1822
|
-
|
|
1823
|
-
return Object.values(AXPSystemStatuses).find(status => status.name === type);
|
|
1824
|
-
}
|
|
2097
|
+
const AXP_MODULE_PROVIDER_LOADER = new InjectionToken('AXP_MODULE_PROVIDER_LOADER');
|
|
1825
2098
|
/**
|
|
1826
|
-
*
|
|
1827
|
-
*
|
|
1828
|
-
* @param statusType - Status type string
|
|
1829
|
-
* @returns Color and icon for the status
|
|
2099
|
+
* Injection token for module provider initializer.
|
|
2100
|
+
* Implementation: @acorex/platform/auth
|
|
1830
2101
|
*/
|
|
1831
|
-
|
|
1832
|
-
// Try to get system status first
|
|
1833
|
-
const systemStatusType = statusType;
|
|
1834
|
-
if (systemStatusType) {
|
|
1835
|
-
const systemStatus = getSystemStatus(systemStatusType);
|
|
1836
|
-
if (systemStatus) {
|
|
1837
|
-
// Convert hex color to semantic color type if needed
|
|
1838
|
-
// For now, return as-is and let the UI handle it
|
|
1839
|
-
return {
|
|
1840
|
-
color: systemStatus.color,
|
|
1841
|
-
icon: systemStatus.icon || ''
|
|
1842
|
-
};
|
|
1843
|
-
}
|
|
1844
|
-
}
|
|
1845
|
-
// Fallback for unknown statuses
|
|
1846
|
-
return {
|
|
1847
|
-
color: '#6b7280',
|
|
1848
|
-
icon: ''
|
|
1849
|
-
};
|
|
1850
|
-
}
|
|
2102
|
+
const AXP_MODULE_PROVIDER_INITIALIZER = new InjectionToken('AXP_MODULE_PROVIDER_INITIALIZER');
|
|
1851
2103
|
/**
|
|
1852
|
-
*
|
|
1853
|
-
*
|
|
1854
|
-
* @param statusType - Status type string
|
|
1855
|
-
* @returns Complete status information as AXPStatusDefinition
|
|
2104
|
+
* Injection token for session service.
|
|
2105
|
+
* Implementation: @acorex/platform/auth
|
|
1856
2106
|
*/
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
}
|
|
2107
|
+
const AXP_SESSION_SERVICE = new InjectionToken('AXP_SESSION_SERVICE');
|
|
2108
|
+
//#endregion
|
|
2109
|
+
|
|
2110
|
+
//#region ---- Imports ----
|
|
2111
|
+
//#endregion
|
|
2112
|
+
//#region ---- Default Implementation ----
|
|
2113
|
+
/**
|
|
2114
|
+
* Default implementation of module access control service.
|
|
2115
|
+
* Checks if module is enabled in edition.modulesAndFeatures.modules.
|
|
2116
|
+
*/
|
|
2117
|
+
class DefaultModuleAccessControlService {
|
|
2118
|
+
checkAccess(moduleName, context) {
|
|
2119
|
+
// Check if module is enabled in edition
|
|
2120
|
+
const enabledModules = context.edition.modulesAndFeatures?.modules || [];
|
|
2121
|
+
return enabledModules.includes(moduleName);
|
|
2122
|
+
}
|
|
2123
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: DefaultModuleAccessControlService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2124
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: DefaultModuleAccessControlService, providedIn: 'root' }); }
|
|
1873
2125
|
}
|
|
2126
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: DefaultModuleAccessControlService, decorators: [{
|
|
2127
|
+
type: Injectable,
|
|
2128
|
+
args: [{ providedIn: 'root' }]
|
|
2129
|
+
}] });
|
|
2130
|
+
//#endregion
|
|
2131
|
+
//#region ---- Injection Token ----
|
|
1874
2132
|
/**
|
|
1875
|
-
*
|
|
1876
|
-
*
|
|
1877
|
-
* @param overrides - Optional overrides for the status definition
|
|
1878
|
-
* @returns AXPStatusDefinition
|
|
2133
|
+
* Injection token for module access control service.
|
|
2134
|
+
* If not provided, DefaultModuleAccessControlService will be used as fallback.
|
|
1879
2135
|
*/
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
2136
|
+
const AXP_MODULE_ACCESS_CONTROL_SERVICE = new InjectionToken('AXP_MODULE_ACCESS_CONTROL_SERVICE');
|
|
2137
|
+
|
|
2138
|
+
class AXPAppStartUpService {
|
|
2139
|
+
constructor() {
|
|
2140
|
+
this.tasks = [];
|
|
1884
2141
|
}
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
2142
|
+
registerTask(task) {
|
|
2143
|
+
this.tasks.push(task);
|
|
2144
|
+
}
|
|
2145
|
+
async runAllTasks() {
|
|
2146
|
+
for (const task of this.tasks.sort((a, b) => a.priority - b.priority)) {
|
|
2147
|
+
this.updateStatus(task.statusText);
|
|
2148
|
+
await task.run();
|
|
2149
|
+
}
|
|
2150
|
+
}
|
|
2151
|
+
updateStatus(status) {
|
|
2152
|
+
const loadingText = document.querySelector('#loadingText');
|
|
2153
|
+
if (loadingText) {
|
|
2154
|
+
loadingText.innerHTML = status;
|
|
2155
|
+
}
|
|
2156
|
+
}
|
|
2157
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXPAppStartUpService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2158
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXPAppStartUpService, providedIn: 'root' }); }
|
|
1889
2159
|
}
|
|
2160
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXPAppStartUpService, decorators: [{
|
|
2161
|
+
type: Injectable,
|
|
2162
|
+
args: [{
|
|
2163
|
+
providedIn: 'root',
|
|
2164
|
+
}]
|
|
2165
|
+
}] });
|
|
2166
|
+
function initAppFactory(appInitService) {
|
|
2167
|
+
return () => appInitService.runAllTasks();
|
|
2168
|
+
}
|
|
2169
|
+
const AXPAppStartUpProvider = provideAppInitializer(() => {
|
|
2170
|
+
const initializerFn = initAppFactory(inject(AXPAppStartUpService));
|
|
2171
|
+
return initializerFn();
|
|
2172
|
+
});
|
|
1890
2173
|
|
|
1891
2174
|
//#region ---- Tag Types ----
|
|
1892
2175
|
//#endregion
|
|
@@ -2800,7 +3083,6 @@ const AXPSystemActions = Object.freeze({
|
|
|
2800
3083
|
key: AXPSystemActionType.Cancel,
|
|
2801
3084
|
title: i18n('cancel.title'),
|
|
2802
3085
|
icon: 'fa-light fa-xmark',
|
|
2803
|
-
color: 'danger',
|
|
2804
3086
|
critical: true,
|
|
2805
3087
|
descriptions: {
|
|
2806
3088
|
title: i18n('cancel.title'),
|
|
@@ -2997,6 +3279,12 @@ class AXPComponentLogoConfig {
|
|
|
2997
3279
|
this.component = component;
|
|
2998
3280
|
}
|
|
2999
3281
|
}
|
|
3282
|
+
class AXPIconLogoConfig {
|
|
3283
|
+
constructor(icon, color) {
|
|
3284
|
+
this.icon = icon;
|
|
3285
|
+
this.color = color;
|
|
3286
|
+
}
|
|
3287
|
+
}
|
|
3000
3288
|
|
|
3001
3289
|
var AXPPlatformScope;
|
|
3002
3290
|
(function (AXPPlatformScope) {
|
|
@@ -3290,6 +3578,185 @@ async function applyQueryArray(dataArray, query) {
|
|
|
3290
3578
|
};
|
|
3291
3579
|
}
|
|
3292
3580
|
|
|
3581
|
+
//#region ---- Type Definitions ----
|
|
3582
|
+
/**
|
|
3583
|
+
* Screen Size Enum
|
|
3584
|
+
*/
|
|
3585
|
+
var AXPScreenSize;
|
|
3586
|
+
(function (AXPScreenSize) {
|
|
3587
|
+
AXPScreenSize["Small"] = "small";
|
|
3588
|
+
AXPScreenSize["Medium"] = "medium";
|
|
3589
|
+
AXPScreenSize["Large"] = "large";
|
|
3590
|
+
})(AXPScreenSize || (AXPScreenSize = {}));
|
|
3591
|
+
/**
|
|
3592
|
+
* Device Type Enum
|
|
3593
|
+
*/
|
|
3594
|
+
var AXPDeviceType;
|
|
3595
|
+
(function (AXPDeviceType) {
|
|
3596
|
+
AXPDeviceType["Mobile"] = "mobile";
|
|
3597
|
+
AXPDeviceType["Tablet"] = "tablet";
|
|
3598
|
+
AXPDeviceType["Desktop"] = "desktop";
|
|
3599
|
+
})(AXPDeviceType || (AXPDeviceType = {}));
|
|
3600
|
+
//#endregion
|
|
3601
|
+
//#region ---- Helper Functions ----
|
|
3602
|
+
/**
|
|
3603
|
+
* Get the initial screen size based on window width
|
|
3604
|
+
*/
|
|
3605
|
+
const getScreenSize = () => {
|
|
3606
|
+
const width = window.innerWidth;
|
|
3607
|
+
if (width <= 600)
|
|
3608
|
+
return AXPScreenSize.Small;
|
|
3609
|
+
if (width <= 1024)
|
|
3610
|
+
return AXPScreenSize.Medium;
|
|
3611
|
+
return AXPScreenSize.Large;
|
|
3612
|
+
};
|
|
3613
|
+
/**
|
|
3614
|
+
* Determine device type based on viewport width
|
|
3615
|
+
*/
|
|
3616
|
+
const getDeviceType = () => {
|
|
3617
|
+
const width = window.innerWidth;
|
|
3618
|
+
if (width <= 600) {
|
|
3619
|
+
return AXPDeviceType.Mobile;
|
|
3620
|
+
}
|
|
3621
|
+
else if (width <= 1024) {
|
|
3622
|
+
return AXPDeviceType.Tablet;
|
|
3623
|
+
}
|
|
3624
|
+
return AXPDeviceType.Desktop;
|
|
3625
|
+
};
|
|
3626
|
+
/**
|
|
3627
|
+
* Determine if the device supports touch
|
|
3628
|
+
*/
|
|
3629
|
+
const isTouchDevice = () => {
|
|
3630
|
+
return 'ontouchstart' in window || navigator.maxTouchPoints > 0;
|
|
3631
|
+
};
|
|
3632
|
+
//#endregion
|
|
3633
|
+
//#region ---- Device Service ----
|
|
3634
|
+
/**
|
|
3635
|
+
* Injectable service that provides reactive device and screen size information.
|
|
3636
|
+
* Monitors window resize events and updates signals accordingly.
|
|
3637
|
+
*/
|
|
3638
|
+
class AXPDeviceService {
|
|
3639
|
+
//#endregion
|
|
3640
|
+
//#region ---- Constructor & Lifecycle ----
|
|
3641
|
+
constructor() {
|
|
3642
|
+
//#region ---- State Signals ----
|
|
3643
|
+
/**
|
|
3644
|
+
* Current screen size (Small, Medium, Large)
|
|
3645
|
+
*/
|
|
3646
|
+
this.screenSize = signal(getScreenSize(), ...(ngDevMode ? [{ debugName: "screenSize" }] : []));
|
|
3647
|
+
/**
|
|
3648
|
+
* Current device type (Mobile, Tablet, Desktop)
|
|
3649
|
+
*/
|
|
3650
|
+
this.deviceType = signal(getDeviceType(), ...(ngDevMode ? [{ debugName: "deviceType" }] : []));
|
|
3651
|
+
/**
|
|
3652
|
+
* Whether the device supports touch input
|
|
3653
|
+
*/
|
|
3654
|
+
this.isTouchDevice = signal(isTouchDevice(), ...(ngDevMode ? [{ debugName: "isTouchDevice" }] : []));
|
|
3655
|
+
//#endregion
|
|
3656
|
+
//#region ---- Computed Signals ----
|
|
3657
|
+
/**
|
|
3658
|
+
* Whether the screen size is Small
|
|
3659
|
+
*/
|
|
3660
|
+
this.isSmall = computed(() => this.screenSize() === AXPScreenSize.Small, ...(ngDevMode ? [{ debugName: "isSmall" }] : []));
|
|
3661
|
+
/**
|
|
3662
|
+
* Whether the screen size is Medium
|
|
3663
|
+
*/
|
|
3664
|
+
this.isMedium = computed(() => this.screenSize() === AXPScreenSize.Medium, ...(ngDevMode ? [{ debugName: "isMedium" }] : []));
|
|
3665
|
+
/**
|
|
3666
|
+
* Whether the screen size is Large
|
|
3667
|
+
*/
|
|
3668
|
+
this.isLarge = computed(() => this.screenSize() === AXPScreenSize.Large, ...(ngDevMode ? [{ debugName: "isLarge" }] : []));
|
|
3669
|
+
/**
|
|
3670
|
+
* Whether the device is Mobile
|
|
3671
|
+
*/
|
|
3672
|
+
this.isMobileDevice = computed(() => this.deviceType() === AXPDeviceType.Mobile, ...(ngDevMode ? [{ debugName: "isMobileDevice" }] : []));
|
|
3673
|
+
/**
|
|
3674
|
+
* Whether the device is Tablet
|
|
3675
|
+
*/
|
|
3676
|
+
this.isTabletDevice = computed(() => this.deviceType() === AXPDeviceType.Tablet, ...(ngDevMode ? [{ debugName: "isTabletDevice" }] : []));
|
|
3677
|
+
/**
|
|
3678
|
+
* Whether the device is Desktop
|
|
3679
|
+
*/
|
|
3680
|
+
this.isDesktopDevice = computed(() => this.deviceType() === AXPDeviceType.Desktop, ...(ngDevMode ? [{ debugName: "isDesktopDevice" }] : []));
|
|
3681
|
+
/**
|
|
3682
|
+
* Whether the device supports touch (alias for isTouchDevice)
|
|
3683
|
+
*/
|
|
3684
|
+
this.isTouchScreen = computed(() => this.isTouchDevice(), ...(ngDevMode ? [{ debugName: "isTouchScreen" }] : []));
|
|
3685
|
+
//#endregion
|
|
3686
|
+
//#region ---- Private Properties ----
|
|
3687
|
+
this._resizeListener = null;
|
|
3688
|
+
this._setupResizeListener();
|
|
3689
|
+
}
|
|
3690
|
+
//#endregion
|
|
3691
|
+
//#region ---- Private Methods ----
|
|
3692
|
+
/**
|
|
3693
|
+
* Update screen size and device type based on window width
|
|
3694
|
+
*/
|
|
3695
|
+
_updateScreenSize() {
|
|
3696
|
+
const width = window.innerWidth;
|
|
3697
|
+
let newScreenSize;
|
|
3698
|
+
if (width <= 600) {
|
|
3699
|
+
newScreenSize = AXPScreenSize.Small;
|
|
3700
|
+
}
|
|
3701
|
+
else if (width <= 1024) {
|
|
3702
|
+
newScreenSize = AXPScreenSize.Medium;
|
|
3703
|
+
}
|
|
3704
|
+
else {
|
|
3705
|
+
newScreenSize = AXPScreenSize.Large;
|
|
3706
|
+
}
|
|
3707
|
+
// Determine device type based on width to keep it reactive to devtools emulation
|
|
3708
|
+
let newDeviceType;
|
|
3709
|
+
if (width <= 600) {
|
|
3710
|
+
newDeviceType = AXPDeviceType.Mobile;
|
|
3711
|
+
}
|
|
3712
|
+
else if (width <= 1024) {
|
|
3713
|
+
newDeviceType = AXPDeviceType.Tablet;
|
|
3714
|
+
}
|
|
3715
|
+
else {
|
|
3716
|
+
newDeviceType = AXPDeviceType.Desktop;
|
|
3717
|
+
}
|
|
3718
|
+
if (newScreenSize !== this.screenSize() || newDeviceType !== this.deviceType()) {
|
|
3719
|
+
this.screenSize.set(newScreenSize);
|
|
3720
|
+
this.deviceType.set(newDeviceType);
|
|
3721
|
+
}
|
|
3722
|
+
}
|
|
3723
|
+
/**
|
|
3724
|
+
* Set up event listener for window resize
|
|
3725
|
+
*/
|
|
3726
|
+
_setupResizeListener() {
|
|
3727
|
+
this._resizeListener = fromEvent(window, 'resize')
|
|
3728
|
+
.pipe(debounceTime(250)) // 250ms debounce delay
|
|
3729
|
+
.subscribe(() => {
|
|
3730
|
+
this._updateScreenSize();
|
|
3731
|
+
});
|
|
3732
|
+
}
|
|
3733
|
+
/**
|
|
3734
|
+
* Remove event listener for window resize
|
|
3735
|
+
*/
|
|
3736
|
+
_removeResizeListener() {
|
|
3737
|
+
if (this._resizeListener) {
|
|
3738
|
+
this._resizeListener.unsubscribe();
|
|
3739
|
+
this._resizeListener = null;
|
|
3740
|
+
}
|
|
3741
|
+
}
|
|
3742
|
+
//#endregion
|
|
3743
|
+
//#region ---- Public Methods ----
|
|
3744
|
+
/**
|
|
3745
|
+
* Clean up resources when service is destroyed
|
|
3746
|
+
*/
|
|
3747
|
+
destroy() {
|
|
3748
|
+
this._removeResizeListener();
|
|
3749
|
+
}
|
|
3750
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXPDeviceService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
3751
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXPDeviceService, providedIn: 'root' }); }
|
|
3752
|
+
}
|
|
3753
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXPDeviceService, decorators: [{
|
|
3754
|
+
type: Injectable,
|
|
3755
|
+
args: [{
|
|
3756
|
+
providedIn: 'root',
|
|
3757
|
+
}]
|
|
3758
|
+
}], ctorParameters: () => [] });
|
|
3759
|
+
|
|
3293
3760
|
/**
|
|
3294
3761
|
* Service for applying and resetting text highlighting within specified HTML elements.
|
|
3295
3762
|
*/
|
|
@@ -3402,10 +3869,22 @@ function extractTextFromHtml(value) {
|
|
|
3402
3869
|
div.innerHTML = value;
|
|
3403
3870
|
return div.textContent || div.innerText || '';
|
|
3404
3871
|
}
|
|
3872
|
+
/**
|
|
3873
|
+
* Generate kebab-case group name from title
|
|
3874
|
+
*/
|
|
3875
|
+
function generateKebabCase(title) {
|
|
3876
|
+
return title
|
|
3877
|
+
.toLowerCase()
|
|
3878
|
+
.trim()
|
|
3879
|
+
.replace(/[^a-z0-9\s-]/g, '') // Remove special characters
|
|
3880
|
+
.replace(/\s+/g, '-') // Replace spaces with hyphens
|
|
3881
|
+
.replace(/-+/g, '-') // Replace multiple hyphens with single
|
|
3882
|
+
.replace(/^-+|-+$/g, ''); // Remove leading/trailing hyphens
|
|
3883
|
+
}
|
|
3405
3884
|
|
|
3406
3885
|
/**
|
|
3407
3886
|
* Generated bundle index. Do not edit.
|
|
3408
3887
|
*/
|
|
3409
3888
|
|
|
3410
|
-
export { AXHighlightService, AXPActivityLogProvider, AXPActivityLogService, AXPAppStartUpProvider, AXPAppStartUpService, AXPBroadcastEventService, AXPColorPaletteProvider, AXPColorPaletteService, AXPComponentLogoConfig, AXPContentCheckerDirective, AXPContextChangeEvent, AXPContextStore, AXPCountdownPipe, AXPDataGenerator, AXPDataSourceDefinitionProviderService, AXPDblClickDirective, AXPDefaultColorPalettesProvider, AXPDistributedEventListenerService, AXPElementDataDirective, AXPExportTemplateToken, AXPExpressionEvaluatorScopeProviderContext, AXPExpressionEvaluatorScopeProviderService, AXPExpressionEvaluatorService, AXPGridLayoutDirective, AXPHookService, AXPImageUrlLogoConfig,
|
|
3889
|
+
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, AXPModuleManifestInitializer, AXPModuleManifestRegistry, AXPModuleProviderRegistry, AXPPlatformScope, AXPScreenSize, AXPSystemActionType, AXPSystemActions, AXPTagProvider, AXPTagService, AXP_ACTIVITY_LOG_PROVIDER, AXP_COLOR_PALETTE_PROVIDER, AXP_DATASOURCE_DEFINITION_PROVIDER, AXP_DISTRIBUTED_EVENT_LISTENER_PROVIDER, AXP_EDITION_SERVICE, AXP_EXPRESSION_EVALUATOR_SCOPE_PROVIDER, AXP_FEATURE_DEFINITION_PROVIDER, AXP_MODULE_ACCESS_CONTROL_SERVICE, AXP_MODULE_MANIFEST_PROVIDER, AXP_MODULE_PROVIDER_INITIALIZER, AXP_MODULE_PROVIDER_LOADER, AXP_SESSION_SERVICE, AXP_TAG_PROVIDER, DefaultModuleAccessControlService, applyFilterArray, applyPagination, applyQueryArray, applySortArray, applySystemActionDefault, cleanDeep, extractNestedFieldsWildcard, extractTextFromHtml, extractValue, generateKebabCase, getActionButton, getChangedPaths, getDetailedChanges, getEnumValues, getNestedKeys, getSmart, getSystemActions, objectKeyValueTransforms, resolveActionLook, resolvePlatformScopeKey, resolvePlatformScopeName, setSmart };
|
|
3411
3890
|
//# sourceMappingURL=acorex-platform-core.mjs.map
|