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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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, signal, output, DestroyRef, Renderer2, untracked, Injector, runInInjectionContext, provideAppInitializer, Pipe } from '@angular/core';
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';
@@ -1817,16 +1817,33 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImpo
1817
1817
  //#region ---- Imports ----
1818
1818
  //#endregion
1819
1819
 
1820
- //#region ---- Imports ----
1821
- //#endregion
1822
- //#region ---- Injection Token ----
1820
+ //#region ---- Provider Interfaces ----
1821
+ /**
1822
+ * Injection token for edition service.
1823
+ * Modules should provide their implementation using this token.
1824
+ */
1825
+ const AXP_EDITION_SERVICE = new InjectionToken('AXP_EDITION_SERVICE', {
1826
+ providedIn: 'root',
1827
+ factory: () => {
1828
+ return null;
1829
+ },
1830
+ });
1831
+ /**
1832
+ * Injection token for module provider loader.
1833
+ * Implementation: @acorex/platform/auth
1834
+ */
1835
+ const AXP_MODULE_PROVIDER_LOADER = new InjectionToken('AXP_MODULE_PROVIDER_LOADER');
1836
+ /**
1837
+ * Injection token for session service.
1838
+ * Implementation: @acorex/platform/auth
1839
+ */
1840
+ const AXP_SESSION_SERVICE = new InjectionToken('AXP_SESSION_SERVICE');
1823
1841
  /**
1824
1842
  * Injection token for module manifest providers.
1825
1843
  * Modules register their manifest providers using this token.
1826
1844
  */
1827
1845
  const AXP_MODULE_MANIFEST_PROVIDER = new InjectionToken('AXP_MODULE_MANIFEST_PROVIDER');
1828
1846
  //#endregion
1829
- //#region ---- Default Provider ----
1830
1847
 
1831
1848
  //#region ---- Imports ----
1832
1849
  //#endregion
@@ -2009,40 +2026,94 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImpo
2009
2026
  args: [{ providedIn: 'root' }]
2010
2027
  }] });
2011
2028
 
2029
+ class AXPAppStartUpService {
2030
+ constructor() {
2031
+ this.tasks = [];
2032
+ }
2033
+ registerTask(task) {
2034
+ this.tasks.push(task);
2035
+ }
2036
+ async runAllTasks() {
2037
+ for (const task of this.tasks.sort((a, b) => a.priority - b.priority)) {
2038
+ this.updateStatus(task.statusText);
2039
+ await task.run();
2040
+ }
2041
+ }
2042
+ updateStatus(status) {
2043
+ const loadingText = document.querySelector('#loadingText');
2044
+ if (loadingText) {
2045
+ loadingText.innerHTML = status;
2046
+ }
2047
+ }
2048
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXPAppStartUpService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
2049
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXPAppStartUpService, providedIn: 'root' }); }
2050
+ }
2051
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXPAppStartUpService, decorators: [{
2052
+ type: Injectable,
2053
+ args: [{
2054
+ providedIn: 'root',
2055
+ }]
2056
+ }] });
2057
+ function initAppFactory(appInitService) {
2058
+ return () => appInitService.runAllTasks();
2059
+ }
2060
+ const AXPAppStartUpProvider = provideAppInitializer(() => {
2061
+ const initializerFn = initAppFactory(inject(AXPAppStartUpService));
2062
+ return initializerFn();
2063
+ });
2064
+
2012
2065
  //#region ---- Imports ----
2013
2066
  //#endregion
2014
- //#region ---- Initializer ----
2067
+ //#region ---- Module ----
2015
2068
  /**
2016
- * Startup task to initialize module manifest registry.
2017
- * Registers this task with app startup service.
2069
+ * Module for managing module manifests and providers initialization.
2070
+ * Handles the registration of manifest and module provider startup tasks.
2018
2071
  */
2019
- class AXPModuleManifestInitializer {
2020
- constructor() {
2021
- //#region ---- Fields ----
2022
- this.manifestRegistry = inject(AXPModuleManifestRegistry);
2023
- }
2024
- //#endregion
2025
- //#region ---- Public Methods ----
2072
+ class AXPModuleManifestModule {
2026
2073
  /**
2027
- * Create startup task for manifest initialization.
2074
+ * @ignore
2075
+ * Initializes module manifest and provider tasks on module construction.
2028
2076
  */
2029
- createStartupTask() {
2030
- return {
2077
+ constructor(appInitService, injector) {
2078
+ const manifestRegistry = injector.get(AXPModuleManifestRegistry);
2079
+ const moduleProviderLoader = injector.get(AXP_MODULE_PROVIDER_LOADER);
2080
+ // Register manifest initialization task
2081
+ appInitService.registerTask({
2031
2082
  name: 'ModuleManifests',
2032
2083
  statusText: 'Loading module manifests...',
2033
2084
  priority: 1, // Load early, before features/permissions
2034
2085
  run: async () => {
2035
- await this.manifestRegistry.initialize();
2086
+ await manifestRegistry.initialize();
2036
2087
  },
2037
- };
2088
+ });
2089
+ // Register module provider tasks
2090
+ appInitService.registerTask({
2091
+ name: 'RequiredModuleProviders',
2092
+ statusText: 'Loading required modules...',
2093
+ priority: 1.5,
2094
+ run: async () => {
2095
+ await moduleProviderLoader.loadRequiredModules();
2096
+ },
2097
+ });
2098
+ appInitService.registerTask({
2099
+ name: 'ModuleProviders',
2100
+ statusText: 'Loading module providers...',
2101
+ priority: 3,
2102
+ run: async () => {
2103
+ await moduleProviderLoader.loadProvidersIfReady();
2104
+ },
2105
+ });
2038
2106
  }
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' }); }
2107
+ 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 }); }
2108
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.12", ngImport: i0, type: AXPModuleManifestModule }); }
2109
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXPModuleManifestModule }); }
2041
2110
  }
2042
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXPModuleManifestInitializer, decorators: [{
2043
- type: Injectable,
2044
- args: [{ providedIn: 'root' }]
2045
- }] });
2111
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: AXPModuleManifestModule, decorators: [{
2112
+ type: NgModule,
2113
+ args: [{
2114
+ providers: [],
2115
+ }]
2116
+ }], ctorParameters: () => [{ type: AXPAppStartUpService }, { type: i0.Injector }] });
2046
2117
 
2047
2118
  //#region ---- Imports ----
2048
2119
  //#endregion
@@ -2079,34 +2150,6 @@ const AXP_FEATURE_DEFINITION_PROVIDER = new InjectionToken('AXP_FEATURE_DEFINITI
2079
2150
  });
2080
2151
  //#endregion
2081
2152
 
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;
2091
- },
2092
- });
2093
- /**
2094
- * Injection token for module provider loader.
2095
- * Implementation: @acorex/platform/auth
2096
- */
2097
- const AXP_MODULE_PROVIDER_LOADER = new InjectionToken('AXP_MODULE_PROVIDER_LOADER');
2098
- /**
2099
- * Injection token for module provider initializer.
2100
- * Implementation: @acorex/platform/auth
2101
- */
2102
- const AXP_MODULE_PROVIDER_INITIALIZER = new InjectionToken('AXP_MODULE_PROVIDER_INITIALIZER');
2103
- /**
2104
- * Injection token for session service.
2105
- * Implementation: @acorex/platform/auth
2106
- */
2107
- const AXP_SESSION_SERVICE = new InjectionToken('AXP_SESSION_SERVICE');
2108
- //#endregion
2109
-
2110
2153
  //#region ---- Imports ----
2111
2154
  //#endregion
2112
2155
  //#region ---- Default Implementation ----
@@ -2115,10 +2158,10 @@ const AXP_SESSION_SERVICE = new InjectionToken('AXP_SESSION_SERVICE');
2115
2158
  * Checks if module is enabled in edition.modulesAndFeatures.modules.
2116
2159
  */
2117
2160
  class DefaultModuleAccessControlService {
2118
- checkAccess(moduleName, context) {
2161
+ checkAccess(manifest, context) {
2119
2162
  // Check if module is enabled in edition
2120
2163
  const enabledModules = context.edition.modulesAndFeatures?.modules || [];
2121
- return enabledModules.includes(moduleName);
2164
+ return enabledModules.includes(manifest.name);
2122
2165
  }
2123
2166
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: DefaultModuleAccessControlService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
2124
2167
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.12", ngImport: i0, type: DefaultModuleAccessControlService, providedIn: 'root' }); }
@@ -2135,42 +2178,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImpo
2135
2178
  */
2136
2179
  const AXP_MODULE_ACCESS_CONTROL_SERVICE = new InjectionToken('AXP_MODULE_ACCESS_CONTROL_SERVICE');
2137
2180
 
2138
- class AXPAppStartUpService {
2139
- constructor() {
2140
- this.tasks = [];
2141
- }
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' }); }
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
- });
2173
-
2174
2181
  //#region ---- Tag Types ----
2175
2182
  //#endregion
2176
2183
 
@@ -3886,5 +3893,5 @@ function generateKebabCase(title) {
3886
3893
  * Generated bundle index. Do not edit.
3887
3894
  */
3888
3895
 
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 };
3896
+ 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, 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_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 };
3890
3897
  //# sourceMappingURL=acorex-platform-core.mjs.map