@acorex/platform 20.9.10 → 20.9.11
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.
|
@@ -4902,29 +4902,57 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImpor
|
|
|
4902
4902
|
}]
|
|
4903
4903
|
}], ctorParameters: () => [] });
|
|
4904
4904
|
|
|
4905
|
+
/**
|
|
4906
|
+
* Instantiates a class inside an injection context.
|
|
4907
|
+
* Use when a lazy provider manually calls `new` on a nested class that relies on `inject()`.
|
|
4908
|
+
*
|
|
4909
|
+
* @example
|
|
4910
|
+
* ```typescript
|
|
4911
|
+
* export class AXMAuthDataSourceProvider implements AXPDataSourceDefinitionProvider {
|
|
4912
|
+
* constructor(private readonly injector: Injector) {}
|
|
4913
|
+
*
|
|
4914
|
+
* async items() {
|
|
4915
|
+
* const userActivity = instantiateWithInjectionContext(
|
|
4916
|
+
* this.injector,
|
|
4917
|
+
* AXMUserActivityDataSourceDefinition,
|
|
4918
|
+
* );
|
|
4919
|
+
* return [...(await userActivity.items())];
|
|
4920
|
+
* }
|
|
4921
|
+
* }
|
|
4922
|
+
* ```
|
|
4923
|
+
*/
|
|
4924
|
+
function instantiateWithInjectionContext(injector, type) {
|
|
4925
|
+
return runInInjectionContext(injector, () => new type(injector));
|
|
4926
|
+
}
|
|
4905
4927
|
/**
|
|
4906
4928
|
* Creates a provider instance within an injection context.
|
|
4907
|
-
*
|
|
4929
|
+
* The injector must be captured synchronously from the useFactory injection context.
|
|
4908
4930
|
*
|
|
4931
|
+
* @param injector - Injector resolved synchronously inside `useFactory`
|
|
4909
4932
|
* @param loader - Function that returns a promise resolving to the provider class
|
|
4910
4933
|
* @returns Promise that resolves to the provider instance
|
|
4911
4934
|
*
|
|
4912
4935
|
* @example
|
|
4913
4936
|
* ```typescript
|
|
4914
|
-
* useFactory: () =>
|
|
4915
|
-
*
|
|
4916
|
-
* )
|
|
4937
|
+
* useFactory: () => {
|
|
4938
|
+
* const injector = inject(Injector);
|
|
4939
|
+
* return createProviderWithInjectionContext(injector, () =>
|
|
4940
|
+
* import('./settings.provider').then((m) => m.AXMSettingProvider),
|
|
4941
|
+
* );
|
|
4942
|
+
* }
|
|
4917
4943
|
* ```
|
|
4918
4944
|
*/
|
|
4919
|
-
async function createProviderWithInjectionContext(loader) {
|
|
4920
|
-
const injector = inject(Injector);
|
|
4945
|
+
async function createProviderWithInjectionContext(injector, loader) {
|
|
4921
4946
|
const ProviderClass = await loader();
|
|
4922
|
-
return runInInjectionContext(injector, () => new ProviderClass());
|
|
4947
|
+
return runInInjectionContext(injector, () => new ProviderClass(injector));
|
|
4923
4948
|
}
|
|
4924
4949
|
/**
|
|
4925
4950
|
* Creates a provider configuration for lazy-loaded providers with injection context.
|
|
4926
4951
|
* Simplifies provider registration in NgModule providers array.
|
|
4927
4952
|
*
|
|
4953
|
+
* Captures `Injector` synchronously in `useFactory` (before any `await`) so injection
|
|
4954
|
+
* context is reliable after dynamic import and cache rebuilds.
|
|
4955
|
+
*
|
|
4928
4956
|
* @param token - The injection token to provide
|
|
4929
4957
|
* @param loader - Function that returns a promise resolving to the provider class
|
|
4930
4958
|
* @param multi - Optional. Whether the provider is a multi-provider (array of values). Defaults to `true`. Pass `false` for a single provider.
|
|
@@ -4949,7 +4977,10 @@ async function createProviderWithInjectionContext(loader) {
|
|
|
4949
4977
|
function provideLazyProvider(token, loader, multi = true) {
|
|
4950
4978
|
return {
|
|
4951
4979
|
provide: token,
|
|
4952
|
-
useFactory: () =>
|
|
4980
|
+
useFactory: () => {
|
|
4981
|
+
const injector = inject(Injector);
|
|
4982
|
+
return createProviderWithInjectionContext(injector, loader);
|
|
4983
|
+
},
|
|
4953
4984
|
multi,
|
|
4954
4985
|
};
|
|
4955
4986
|
}
|
|
@@ -4958,5 +4989,5 @@ function provideLazyProvider(token, loader, multi = true) {
|
|
|
4958
4989
|
* Generated bundle index. Do not edit.
|
|
4959
4990
|
*/
|
|
4960
4991
|
|
|
4961
|
-
export { AXHighlightService, AXPActivityLogProvider, AXPActivityLogService, AXPAppStartUpProvider, AXPAppStartUpService, AXPBroadcastEventService, AXPCatalogScopeDefinitionProviderService, AXPCatalogScopeDefinitionsDataSourceDefinition, AXPColorPaletteProvider, AXPColorPaletteService, AXPColumnWidthService, AXPComponentLogoConfig, AXPComponentSlot, AXPComponentSlotDirective, AXPComponentSlotModule, AXPComponentSlotRegistryService, AXPContentCheckerDirective, AXPContextDefinitionProviderService, AXPContextEvalFactory, AXPContextStore, AXPCountdownPipe, AXPDataGenerator, AXPDataSourceDefinitionProviderService, AXPDataSourceQueryService, AXPDblClickDirective, AXPDebugService, AXPDefaultColorPalettesProvider, AXPDeviceService, AXPDeviceType, AXPDistributedEventListenerService, AXPElementDataDirective, AXPExpressionEvaluatorScopeProviderContext, AXPExpressionEvaluatorScopeProviderService, AXPExpressionEvaluatorService, AXPFeatureDefinitionProviderContext, AXPGridLayoutDirective, AXPHookService, AXPIconLogoConfig, AXPIdleSchedulerService, AXPImageUrlLogoConfig, AXPKeyboardShortcutRegistry, AXPModuleManifestModule, AXPModuleManifestRegistry, AXPModuleManifestsDataSourceDefinition, AXPScreenSize, AXPTagProvider, AXPTagService, AXP_ACTIVITY_LOG_PROVIDER, AXP_CATALOG_SCOPE_DEFINITION_PROVIDER, AXP_COLOR_PALETTE_PROVIDER, AXP_COLUMN_WIDTH_PROVIDER, AXP_CONTEXT_DEFINITION_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, AX_OVERLAY_CONTAINER_SELECTOR, AX_OVERLAY_PANE_SELECTOR, DEFAULT_CANCEL_DIALOG_ACTION_SHORTCUTS, DEFAULT_SUBMIT_DIALOG_ACTION_SHORTCUTS, FORM_DIRTY_TRACE_NS, OVERLAY_DETAILS_VIEW_TRACE_NS, OVERLAY_LAYOUT_TRACE_NS, OVERLAY_ROOT_LAYOUT_TRACE_NS, OVERLAY_WIDGET_SETTLE_TRACE_NS, applyContextEvalPipes, applyFilterArray, applyPagination, applyQueryArray, applySortArray, applySystemActionDefault, chordToKbdItemKeys, contextEvalWithPipes, createProviderWithInjectionContext, defaultColumnWidthProvider, findOverlayContainerAncestor, formatKeyboardShortcutChord, formatKeyboardShortcutChords, getNestedVisibleOverlayPanes, getPrimaryKeyboardShortcutChord, getTopVisibleOverlayContainer, getVisibleAnchoredOverlayPanes, getVisibleOverlayContainers, hasForegroundOverlayLayer, isDialogShortcutAllowedInEditableField, isHorizontalDirectionalShortcutKey, isKeyboardTargetInsideEditableField, isMacPlatform, isVisibleOverlayElement, matchesDialogActionShortcut, matchesKeyboardShortcutChord, mirrorHorizontalDirectionalKey, normalizeContextEvalPipes, normalizeDialogActionShortcutChord, normalizeExpressionTemplate, normalizeKeyboardShortcut, normalizeKeyboardShortcuts, objectKeyValueTransforms, parseDialogActionShortcut, parseKeyboardShortcutChord, provideLazyProvider, registerPopupFooterKeyboardShortcuts, resolveConfiguredFooterActionShortcuts, resolveDialogActionShortcuts, resolveDisplayShortcutChord, resolveEffectiveDirectionBehavior, resolveSemanticDirectionalKey, setupPopupFooterKeyboardShortcuts, shouldDeferEscapeToOpenOverlay, shouldTriggerDialogActionShortcut };
|
|
4992
|
+
export { AXHighlightService, AXPActivityLogProvider, AXPActivityLogService, AXPAppStartUpProvider, AXPAppStartUpService, AXPBroadcastEventService, AXPCatalogScopeDefinitionProviderService, AXPCatalogScopeDefinitionsDataSourceDefinition, AXPColorPaletteProvider, AXPColorPaletteService, AXPColumnWidthService, AXPComponentLogoConfig, AXPComponentSlot, AXPComponentSlotDirective, AXPComponentSlotModule, AXPComponentSlotRegistryService, AXPContentCheckerDirective, AXPContextDefinitionProviderService, AXPContextEvalFactory, AXPContextStore, AXPCountdownPipe, AXPDataGenerator, AXPDataSourceDefinitionProviderService, AXPDataSourceQueryService, AXPDblClickDirective, AXPDebugService, AXPDefaultColorPalettesProvider, AXPDeviceService, AXPDeviceType, AXPDistributedEventListenerService, AXPElementDataDirective, AXPExpressionEvaluatorScopeProviderContext, AXPExpressionEvaluatorScopeProviderService, AXPExpressionEvaluatorService, AXPFeatureDefinitionProviderContext, AXPGridLayoutDirective, AXPHookService, AXPIconLogoConfig, AXPIdleSchedulerService, AXPImageUrlLogoConfig, AXPKeyboardShortcutRegistry, AXPModuleManifestModule, AXPModuleManifestRegistry, AXPModuleManifestsDataSourceDefinition, AXPScreenSize, AXPTagProvider, AXPTagService, AXP_ACTIVITY_LOG_PROVIDER, AXP_CATALOG_SCOPE_DEFINITION_PROVIDER, AXP_COLOR_PALETTE_PROVIDER, AXP_COLUMN_WIDTH_PROVIDER, AXP_CONTEXT_DEFINITION_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, AX_OVERLAY_CONTAINER_SELECTOR, AX_OVERLAY_PANE_SELECTOR, DEFAULT_CANCEL_DIALOG_ACTION_SHORTCUTS, DEFAULT_SUBMIT_DIALOG_ACTION_SHORTCUTS, FORM_DIRTY_TRACE_NS, OVERLAY_DETAILS_VIEW_TRACE_NS, OVERLAY_LAYOUT_TRACE_NS, OVERLAY_ROOT_LAYOUT_TRACE_NS, OVERLAY_WIDGET_SETTLE_TRACE_NS, applyContextEvalPipes, applyFilterArray, applyPagination, applyQueryArray, applySortArray, applySystemActionDefault, chordToKbdItemKeys, contextEvalWithPipes, createProviderWithInjectionContext, defaultColumnWidthProvider, findOverlayContainerAncestor, formatKeyboardShortcutChord, formatKeyboardShortcutChords, getNestedVisibleOverlayPanes, getPrimaryKeyboardShortcutChord, getTopVisibleOverlayContainer, getVisibleAnchoredOverlayPanes, getVisibleOverlayContainers, hasForegroundOverlayLayer, instantiateWithInjectionContext, isDialogShortcutAllowedInEditableField, isHorizontalDirectionalShortcutKey, isKeyboardTargetInsideEditableField, isMacPlatform, isVisibleOverlayElement, matchesDialogActionShortcut, matchesKeyboardShortcutChord, mirrorHorizontalDirectionalKey, normalizeContextEvalPipes, normalizeDialogActionShortcutChord, normalizeExpressionTemplate, normalizeKeyboardShortcut, normalizeKeyboardShortcuts, objectKeyValueTransforms, parseDialogActionShortcut, parseKeyboardShortcutChord, provideLazyProvider, registerPopupFooterKeyboardShortcuts, resolveConfiguredFooterActionShortcuts, resolveDialogActionShortcuts, resolveDisplayShortcutChord, resolveEffectiveDirectionBehavior, resolveSemanticDirectionalKey, setupPopupFooterKeyboardShortcuts, shouldDeferEscapeToOpenOverlay, shouldTriggerDialogActionShortcut };
|
|
4962
4993
|
//# sourceMappingURL=acorex-platform-core.mjs.map
|