@acorex/platform 20.7.3 → 20.7.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/common/index.d.ts CHANGED
@@ -4,7 +4,7 @@ import { AXStyleColorType, AXDataSourceOperator, AXDataSourceFilterOption } from
4
4
  import * as i2 from '@acorex/components/popup';
5
5
  import { AXPopupSizeType, AXPopupService } from '@acorex/components/popup';
6
6
  import * as i5 from '@acorex/platform/core';
7
- import { AXPValueTransformerFunctions, AXPGridLayoutOptions, AXPValidationRules, AXPSystemActionType, AXPMetaData, AXPOptionsData, AXPLogoConfig, AXPNavigateActionCommand, AXPExecuteCommand, AXPEntityReference, AXPApplicationUserReference, AXPPlatformScopeKey, AXPPlatformScope, AXPWidgetTriggers, AXPExpressionEvaluatorScopeProvider, AXPExpressionEvaluatorScopeProviderContext } from '@acorex/platform/core';
7
+ import { AXPValueTransformerFunctions, AXPGridLayoutOptions, AXPValidationRules, AXPSystemActionType, AXPMetaData, AXPOptionsData, AXPLogoConfig, AXPFileListItem, AXPNavigateActionCommand, AXPExecuteCommand, AXPEntityReference, AXPApplicationUserReference, AXPPlatformScopeKey, AXPPlatformScope, AXPWidgetTriggers, AXPExpressionEvaluatorScopeProvider, AXPExpressionEvaluatorScopeProviderContext } from '@acorex/platform/core';
8
8
  import { AXPWidgetTypesMap, AXPMetaDataDefinition, AXPWidgetNode } from '@acorex/platform/layout/widget-core';
9
9
  import * as i6 from '@angular/router';
10
10
  import { Route, Routes } from '@angular/router';
@@ -854,6 +854,175 @@ declare abstract class AXPFileStorageService {
854
854
  static ɵprov: i0.ɵɵInjectableDeclaration<AXPFileStorageService>;
855
855
  }
856
856
 
857
+ /**
858
+ * Capabilities API provided to file action providers.
859
+ * These methods allow actions to interact with the file uploader widget.
860
+ */
861
+ interface AXCFileUploaderCapabilities {
862
+ /**
863
+ * Get all current files in the uploader.
864
+ */
865
+ getFiles: () => AXPFileListItem[];
866
+ /**
867
+ * Replace all files in the uploader.
868
+ */
869
+ setFiles: (files: AXPFileListItem[]) => void;
870
+ /**
871
+ * Add new files to the uploader.
872
+ */
873
+ addFiles: (files: AXPFileListItem[]) => void;
874
+ /**
875
+ * Update files matching a predicate.
876
+ */
877
+ updateFile: (predicate: (f: AXPFileListItem) => boolean, updater: (f: AXPFileListItem) => AXPFileListItem) => void;
878
+ /**
879
+ * Remove a file from the uploader.
880
+ */
881
+ removeFile: (file: AXPFileListItem) => void;
882
+ /**
883
+ * Clear all files from the uploader.
884
+ */
885
+ clear: () => void;
886
+ /**
887
+ * Get a file by its ID.
888
+ */
889
+ getFileById: (id: string) => AXPFileListItem | undefined;
890
+ /**
891
+ * Update a file by its ID.
892
+ */
893
+ updateFileById: (id: string, next: Partial<AXPFileListItem>) => void;
894
+ }
895
+ /**
896
+ * A file uploader action that can be added by providers.
897
+ */
898
+ interface AXCFileUploaderAction {
899
+ /**
900
+ * Unique identifier for the action/plugin.
901
+ */
902
+ plugin: string;
903
+ /**
904
+ * Whether this action is global (available even if plugin is not explicitly enabled).
905
+ */
906
+ global?: boolean;
907
+ /**
908
+ * Display text for the action (optional if textKey is provided).
909
+ */
910
+ text?: string;
911
+ /**
912
+ * Translation key for the action text (optional if text is provided).
913
+ */
914
+ textKey?: string;
915
+ /**
916
+ * Icon class for the action (e.g., 'fa-light fa-file-arrow-up').
917
+ */
918
+ icon?: string;
919
+ /**
920
+ * Action execution handler.
921
+ * Receives capabilities to interact with the file uploader.
922
+ * @param capabilities The capabilities API for file operations.
923
+ */
924
+ run: (capabilities: AXCFileUploaderCapabilities) => void | Promise<void>;
925
+ }
926
+ /**
927
+ * Payload passed to file action providers.
928
+ */
929
+ interface AXCFileUploaderActionsPayload {
930
+ /**
931
+ * Enabled plugins configuration.
932
+ */
933
+ plugins: {
934
+ name: string;
935
+ options?: unknown;
936
+ }[];
937
+ /**
938
+ * List of plugin names to exclude.
939
+ */
940
+ excludePlugins: string[];
941
+ /**
942
+ * Capabilities API for interacting with the file uploader.
943
+ */
944
+ capabilities: AXCFileUploaderCapabilities;
945
+ /**
946
+ * Current list of actions (providers can add to this array).
947
+ */
948
+ actions: AXCFileUploaderAction[];
949
+ /**
950
+ * Widget options (optional, for accessing widget-specific settings).
951
+ */
952
+ options?: {
953
+ /**
954
+ * Whether multiple files are allowed.
955
+ */
956
+ multiple?: boolean;
957
+ /**
958
+ * Accepted file types (e.g., '.jpg,.png' or 'image/*').
959
+ */
960
+ accept?: string;
961
+ };
962
+ }
963
+
964
+ /**
965
+ * Type for file action provider token (supports both direct and async providers).
966
+ */
967
+ type AXPFileActionProviderToken = AXPFileActionProvider | Promise<AXPFileActionProvider>;
968
+ /**
969
+ * File action provider interface.
970
+ * Providers can add actions to the file uploader widget.
971
+ */
972
+ interface AXPFileActionProvider {
973
+ /**
974
+ * Unique key identifying this provider.
975
+ * Should match the webhook key for backward compatibility: 'file-uploader.actions'
976
+ */
977
+ key: string;
978
+ /**
979
+ * Execute the provider to add actions.
980
+ * @param payload The payload containing capabilities and current actions.
981
+ * @returns The modified payload with new actions added.
982
+ */
983
+ execute(payload: AXCFileUploaderActionsPayload): Promise<AXCFileUploaderActionsPayload> | AXCFileUploaderActionsPayload;
984
+ /**
985
+ * Priority for execution order (lower numbers execute first).
986
+ * Defaults to 0 if not specified.
987
+ */
988
+ priority?: number;
989
+ }
990
+ /**
991
+ * Multi-provider injection token for file action providers.
992
+ * Modules can provide multiple implementations using this token.
993
+ */
994
+ declare const AXP_FILE_ACTION_PROVIDER: InjectionToken<AXPFileActionProviderToken[]>;
995
+
996
+ /**
997
+ * Service for managing file uploader actions.
998
+ * Aggregates actions from multiple providers and filters them based on plugin configuration.
999
+ * Wraps the hook system for backward compatibility.
1000
+ */
1001
+ declare class AXPFileActionsService {
1002
+ private readonly actionProviders;
1003
+ private readonly hookService;
1004
+ private readonly injector;
1005
+ /**
1006
+ * Get all actions from providers, filtered based on plugin configuration.
1007
+ * Wraps the hook system for backward compatibility.
1008
+ * @param payload Initial payload with capabilities and plugin configuration.
1009
+ * @returns Filtered list of actions.
1010
+ */
1011
+ getActions(payload: AXCFileUploaderActionsPayload): Promise<AXCFileUploaderAction[]>;
1012
+ /**
1013
+ * Resolve all providers (handle both direct providers and Promise<provider>).
1014
+ */
1015
+ private resolveProviders;
1016
+ /**
1017
+ * Filter actions based on enabled plugins and exclude list.
1018
+ */
1019
+ private filterActions;
1020
+ static ɵfac: i0.ɵɵFactoryDeclaration<AXPFileActionsService, never>;
1021
+ static ɵprov: i0.ɵɵInjectableDeclaration<AXPFileActionsService>;
1022
+ }
1023
+
1024
+ declare const UploadFromComputerActionProvider: AXPFileActionProvider;
1025
+
857
1026
  interface AXPFileType {
858
1027
  /**
859
1028
  * The unique identifier for the file type.
@@ -2468,5 +2637,5 @@ declare class AXMWorkflowErrorHandler implements AXPErrorHandler {
2468
2637
  static ɵprov: i0.ɵɵInjectableDeclaration<AXMWorkflowErrorHandler>;
2469
2638
  }
2470
2639
 
2471
- export { ALL_DEFAULT_OPERATORS, AXMWorkflowErrorHandler, AXPAppVersionService, AXPCleanNestedFilters, AXPClipBoardService, AXPCommonModule, AXPCommonSettings, AXPCustomOperatorService, AXPCustomOperatorServiceImpl, AXPDataProvider, AXPDebugService, AXPDialogConfirmAction, AXPEntityCommandScope, AXPEntityQueryType, AXPErrorHandlerRegistryService, AXPExportService, AXPFileStorageService, AXPFileStorageStatus, AXPFileTypeProviderService, AXPFilterOperatorMiddlewareService, AXPFilterOperatorMiddlewareServiceImpl, AXPFooterTextSlotComponent, AXPGlobalErrorHandler, AXPHomePageModule, AXPHomePageService, AXPLockService, AXPMenuMiddlewareRegistry, AXPMenuProviderService, AXPMenuSearchDefinitionProvider, AXPMenuSearchProvider, AXPMenuService, AXPMenuVisibilityService, AXPNavBarSlotComponent, AXPNavigateWorkflow, AXPPlatformDefaultConfigs, AXPRedirectEvent, AXPRefreshEvent, AXPRegionalSetting, AXPRelationshipCardinality, AXPRelationshipKind, AXPReloadAction, AXPReloadEvent, AXPSearchCommandProvider, AXPSearchDefinitionActionBuilder, AXPSearchDefinitionBuilder, AXPSearchDefinitionProviderContext, AXPSearchDefinitionProviderService, AXPSearchService, AXPSettingDefaultValuesAggregatorService, AXPSettingDefinitionGroupBuilder, AXPSettingDefinitionProviderContext, AXPSettingDefinitionProviderService, AXPSettingDefinitionSectionBuilder, AXPSettingsService, AXPStatusDefinitionProviderService, AXPStatusProvider, AXPStickyDirective, AXPSystemStatusType, AXPSystemStatuses, AXPToastAction, AXPTokenDefinitionService, AXPTokenEvaluatorScopeProvider, AXPVersioningService, AXPWorkflowNavigateAction, AXPWorkflowRouterNavigateAction, AXP_APP_VERSION_PROVIDER, AXP_FILE_TYPE_INFO_PROVIDER, AXP_HOME_PAGES, AXP_HOME_PAGE_DEFAULT_KEY, AXP_MENU_MIDDLEWARE, AXP_MENU_PROVIDER, AXP_PLATFORM_CONFIG_TOKEN, AXP_ROOT_CONFIG_TOKEN, AXP_SEARCH_DEFINITION_PROVIDER, AXP_SEARCH_PROVIDER, AXP_SETTING_DEFAULT_VALUES_PROVIDERS, AXP_SETTING_DEFINITION_PROVIDER, AXP_SETTING_VALUE_PROVIDER, AXP_STATUS_PROVIDERS, AXP_TOKEN_DEFINITION_PROVIDER, AXVChangeType, BETWEEN_OPER, BOOLEAN_OPERATORS, CONTAINS_OPER, DATE_OPERATORS, ENDS_WITH_OPER, ENVIRONMENT, EQ_OPER, GTE_OPER, GT_OPER, IN_OPER, IS_EMPTY_OPER, IS_NOT_EMPTY_OPER, LTE_OPER, LT_OPER, NOT_CONTAINS_OPER, NOT_EQ_OPER, NUMBER_OPERATORS, STARTS_WITH_OPER, STRING_OPERATORS, configPlatform, createAllQueryView, createMenuContext, createMenuMiddleware, createQueryView, getEntityInfo, getStatusInfo, getSystemStatus, provideDynamicHomePage, provideMenuMiddleware, resolveStatusLook, systemStatusToDefinition };
2472
- export type { AXEntityPropertyWidget, AXPAggregate, AXPAppVersion, AXPAppVersionProvider, AXPApplication, AXPCategoryEntity, AXPCommandActionCallback, AXPCommandActionDisplay, AXPCommandActionLook, AXPCommandActionPriority, AXPCommandActionType, AXPCommonModuleConfigs, AXPCurrency, AXPDomToImageOptions, AXPEntity, AXPEntityAction, AXPEntityCommand, AXPEntityDetailListView, AXPEntityMasterCreateLayoutView, AXPEntityMasterLayoutView, AXPEntityMasterListView, AXPEntityMasterSingleLayoutView, AXPEntityMasterUpdateLayoutView, AXPEntityProperty, AXPEntityPropertyCreateView, AXPEntityPropertyGroup, AXPEntityPropertyLayoutConfig, AXPEntityPropertyUpdateView, AXPEntityPropertyView, AXPEntityQuery, AXPEntitySectionView, AXPEntityTableColumn, AXPEntityVersionHistory, AXPErrorHandler, AXPFileExtension, AXPFileManyStorageInfo, AXPFileStorageCreateRequest, AXPFileStorageFindRequest, AXPFileStorageInfo, AXPFileStorageUpdateRequest, AXPFileType, AXPFileTypeInfoProvider, AXPFilterOperator, AXPGeoLocation, AXPGroupSearchResult, AXPHomePageDefinition, AXPLanguage, AXPLocaleProfile, AXPLockGetInfoRequest, AXPLockInfo, AXPLockRequest, AXPLockType, AXPMenuFinderResult, AXPMenuInsertion, AXPMenuItem, AXPMenuItemCommand, AXPMenuItemFinder, AXPMenuItemWithParent, AXPMenuMiddleware, AXPMenuMiddlewareContext, AXPMenuMiddlewareProvider, AXPMenuProvider, AXPMenuProviderContext, AXPMenuType, AXPModule, AXPPlatformConfigs, AXPQueryFilter, AXPQuerySort, AXPQueryView, AXPRelatedEntity, AXPRelationship, AXPRootConfigs, AXPSearchAction, AXPSearchDefinition, AXPSearchDefinitionDisplayFormat, AXPSearchDefinitionProvider, AXPSearchDisplayGroupResult, AXPSearchDisplayResult, AXPSearchDisplayResultForSave, AXPSearchParentResult, AXPSearchProvider, AXPSearchResult, AXPSettingChangedEvent, AXPSettingDefaultValuesProvider, AXPSettingDefinition, AXPSettingDefinitionGroup, AXPSettingDefinitionProvider, AXPSettingDefinitionSection, AXPSettingValue, AXPSettingValueProvider, AXPSettingsServiceInterface, AXPStatusDefinition, AXPStatusTransition, AXPTimeZone, AXPTokenDefinition, AXPTokenDefinitionProvider, AXPTokenDefinitionProviderToken, AXPUnLockRequest, AXPVersionChange, AXPVersionEntry, AXPVersionStream, CanonicalChange, CanonicalChangeOp, VersionedFileInfo };
2640
+ export { ALL_DEFAULT_OPERATORS, AXMWorkflowErrorHandler, AXPAppVersionService, AXPCleanNestedFilters, AXPClipBoardService, AXPCommonModule, AXPCommonSettings, AXPCustomOperatorService, AXPCustomOperatorServiceImpl, AXPDataProvider, AXPDebugService, AXPDialogConfirmAction, AXPEntityCommandScope, AXPEntityQueryType, AXPErrorHandlerRegistryService, AXPExportService, AXPFileActionsService, AXPFileStorageService, AXPFileStorageStatus, AXPFileTypeProviderService, AXPFilterOperatorMiddlewareService, AXPFilterOperatorMiddlewareServiceImpl, AXPFooterTextSlotComponent, AXPGlobalErrorHandler, AXPHomePageModule, AXPHomePageService, AXPLockService, AXPMenuMiddlewareRegistry, AXPMenuProviderService, AXPMenuSearchDefinitionProvider, AXPMenuSearchProvider, AXPMenuService, AXPMenuVisibilityService, AXPNavBarSlotComponent, AXPNavigateWorkflow, AXPPlatformDefaultConfigs, AXPRedirectEvent, AXPRefreshEvent, AXPRegionalSetting, AXPRelationshipCardinality, AXPRelationshipKind, AXPReloadAction, AXPReloadEvent, AXPSearchCommandProvider, AXPSearchDefinitionActionBuilder, AXPSearchDefinitionBuilder, AXPSearchDefinitionProviderContext, AXPSearchDefinitionProviderService, AXPSearchService, AXPSettingDefaultValuesAggregatorService, AXPSettingDefinitionGroupBuilder, AXPSettingDefinitionProviderContext, AXPSettingDefinitionProviderService, AXPSettingDefinitionSectionBuilder, AXPSettingsService, AXPStatusDefinitionProviderService, AXPStatusProvider, AXPStickyDirective, AXPSystemStatusType, AXPSystemStatuses, AXPToastAction, AXPTokenDefinitionService, AXPTokenEvaluatorScopeProvider, AXPVersioningService, AXPWorkflowNavigateAction, AXPWorkflowRouterNavigateAction, AXP_APP_VERSION_PROVIDER, AXP_FILE_ACTION_PROVIDER, AXP_FILE_TYPE_INFO_PROVIDER, AXP_HOME_PAGES, AXP_HOME_PAGE_DEFAULT_KEY, AXP_MENU_MIDDLEWARE, AXP_MENU_PROVIDER, AXP_PLATFORM_CONFIG_TOKEN, AXP_ROOT_CONFIG_TOKEN, AXP_SEARCH_DEFINITION_PROVIDER, AXP_SEARCH_PROVIDER, AXP_SETTING_DEFAULT_VALUES_PROVIDERS, AXP_SETTING_DEFINITION_PROVIDER, AXP_SETTING_VALUE_PROVIDER, AXP_STATUS_PROVIDERS, AXP_TOKEN_DEFINITION_PROVIDER, AXVChangeType, BETWEEN_OPER, BOOLEAN_OPERATORS, CONTAINS_OPER, DATE_OPERATORS, ENDS_WITH_OPER, ENVIRONMENT, EQ_OPER, GTE_OPER, GT_OPER, IN_OPER, IS_EMPTY_OPER, IS_NOT_EMPTY_OPER, LTE_OPER, LT_OPER, NOT_CONTAINS_OPER, NOT_EQ_OPER, NUMBER_OPERATORS, STARTS_WITH_OPER, STRING_OPERATORS, UploadFromComputerActionProvider, configPlatform, createAllQueryView, createMenuContext, createMenuMiddleware, createQueryView, getEntityInfo, getStatusInfo, getSystemStatus, provideDynamicHomePage, provideMenuMiddleware, resolveStatusLook, systemStatusToDefinition };
2641
+ export type { AXCFileUploaderAction, AXCFileUploaderActionsPayload, AXCFileUploaderCapabilities, AXEntityPropertyWidget, AXPAggregate, AXPAppVersion, AXPAppVersionProvider, AXPApplication, AXPCategoryEntity, AXPCommandActionCallback, AXPCommandActionDisplay, AXPCommandActionLook, AXPCommandActionPriority, AXPCommandActionType, AXPCommonModuleConfigs, AXPCurrency, AXPDomToImageOptions, AXPEntity, AXPEntityAction, AXPEntityCommand, AXPEntityDetailListView, AXPEntityMasterCreateLayoutView, AXPEntityMasterLayoutView, AXPEntityMasterListView, AXPEntityMasterSingleLayoutView, AXPEntityMasterUpdateLayoutView, AXPEntityProperty, AXPEntityPropertyCreateView, AXPEntityPropertyGroup, AXPEntityPropertyLayoutConfig, AXPEntityPropertyUpdateView, AXPEntityPropertyView, AXPEntityQuery, AXPEntitySectionView, AXPEntityTableColumn, AXPEntityVersionHistory, AXPErrorHandler, AXPFileActionProvider, AXPFileActionProviderToken, AXPFileExtension, AXPFileManyStorageInfo, AXPFileStorageCreateRequest, AXPFileStorageFindRequest, AXPFileStorageInfo, AXPFileStorageUpdateRequest, AXPFileType, AXPFileTypeInfoProvider, AXPFilterOperator, AXPGeoLocation, AXPGroupSearchResult, AXPHomePageDefinition, AXPLanguage, AXPLocaleProfile, AXPLockGetInfoRequest, AXPLockInfo, AXPLockRequest, AXPLockType, AXPMenuFinderResult, AXPMenuInsertion, AXPMenuItem, AXPMenuItemCommand, AXPMenuItemFinder, AXPMenuItemWithParent, AXPMenuMiddleware, AXPMenuMiddlewareContext, AXPMenuMiddlewareProvider, AXPMenuProvider, AXPMenuProviderContext, AXPMenuType, AXPModule, AXPPlatformConfigs, AXPQueryFilter, AXPQuerySort, AXPQueryView, AXPRelatedEntity, AXPRelationship, AXPRootConfigs, AXPSearchAction, AXPSearchDefinition, AXPSearchDefinitionDisplayFormat, AXPSearchDefinitionProvider, AXPSearchDisplayGroupResult, AXPSearchDisplayResult, AXPSearchDisplayResultForSave, AXPSearchParentResult, AXPSearchProvider, AXPSearchResult, AXPSettingChangedEvent, AXPSettingDefaultValuesProvider, AXPSettingDefinition, AXPSettingDefinitionGroup, AXPSettingDefinitionProvider, AXPSettingDefinitionSection, AXPSettingValue, AXPSettingValueProvider, AXPSettingsServiceInterface, AXPStatusDefinition, AXPStatusTransition, AXPTimeZone, AXPTokenDefinition, AXPTokenDefinitionProvider, AXPTokenDefinitionProviderToken, AXPUnLockRequest, AXPVersionChange, AXPVersionEntry, AXPVersionStream, CanonicalChange, CanonicalChangeOp, VersionedFileInfo };
@@ -1,10 +1,10 @@
1
1
  import * as i0 from '@angular/core';
2
- import { InjectionToken, inject, Injectable, Injector, makeEnvironmentProviders, NgModule, ErrorHandler, EventEmitter, Input, Output, Directive, Component, ViewEncapsulation, Inject, signal, model, linkedSignal, afterNextRender } from '@angular/core';
2
+ import { InjectionToken, inject, Injectable, Injector, makeEnvironmentProviders, NgModule, ErrorHandler, EventEmitter, Input, Output, Directive, Component, ViewEncapsulation, Inject, runInInjectionContext, signal, model, linkedSignal, afterNextRender } from '@angular/core';
3
3
  import { kebabCase, merge, sortBy, cloneDeep, get, omit } from 'lodash-es';
4
4
  import { Router, ROUTES, RouterModule } from '@angular/router';
5
5
  import { AXPSessionService, AXPSessionStatus } from '@acorex/platform/auth';
6
6
  import { Subject, distinctUntilChanged, merge as merge$1 } from 'rxjs';
7
- import { AXPPlatformScope, AXPBroadcastEventService, objectKeyValueTransforms, AXPSystemActionType, AXPModuleManifestModule, AXPAppStartUpProvider, AXP_EXPRESSION_EVALUATOR_SCOPE_PROVIDER, AXPModuleManifestRegistry } from '@acorex/platform/core';
7
+ import { AXPPlatformScope, AXPBroadcastEventService, objectKeyValueTransforms, AXPSystemActionType, AXPModuleManifestModule, AXPAppStartUpProvider, AXP_EXPRESSION_EVALUATOR_SCOPE_PROVIDER, AXPHookService, AXPDataGenerator, AXPModuleManifestRegistry } from '@acorex/platform/core';
8
8
  import { AXTranslationService } from '@acorex/core/translation';
9
9
  import { AXPWidgetsCatalog } from '@acorex/platform/layout/widget-core';
10
10
  import { AXPopupModule, AXPopupService } from '@acorex/components/popup';
@@ -16,6 +16,7 @@ import { AXPCommandExecutor, AXPCommandService } from '@acorex/platform/runtime'
16
16
  import { signalStore, withState, withMethods, patchState, withHooks } from '@ngrx/signals';
17
17
  import { AXFormatService } from '@acorex/core/format';
18
18
  import { AXDialogService } from '@acorex/components/dialog';
19
+ import { AXFileService } from '@acorex/core/file';
19
20
  import * as i5 from '@acorex/components/button';
20
21
  import { AXButtonModule } from '@acorex/components/button';
21
22
  import { AXCheckBoxModule } from '@acorex/components/check-box';
@@ -3012,6 +3013,166 @@ var AXPFileStorageStatus;
3012
3013
  AXPFileStorageStatus["Error"] = "error";
3013
3014
  })(AXPFileStorageStatus || (AXPFileStorageStatus = {}));
3014
3015
 
3016
+ //#endregion
3017
+ //#region ---- Injection Token ----
3018
+ /**
3019
+ * Multi-provider injection token for file action providers.
3020
+ * Modules can provide multiple implementations using this token.
3021
+ */
3022
+ const AXP_FILE_ACTION_PROVIDER = new InjectionToken('AXP_FILE_ACTION_PROVIDER');
3023
+ //#endregion
3024
+
3025
+ //#region ---- Service ----
3026
+ /**
3027
+ * Service for managing file uploader actions.
3028
+ * Aggregates actions from multiple providers and filters them based on plugin configuration.
3029
+ * Wraps the hook system for backward compatibility.
3030
+ */
3031
+ class AXPFileActionsService {
3032
+ constructor() {
3033
+ //#region ---- Dependencies ----
3034
+ this.actionProviders = inject(AXP_FILE_ACTION_PROVIDER, { optional: true }) || [];
3035
+ this.hookService = inject(AXPHookService);
3036
+ this.injector = inject(Injector);
3037
+ }
3038
+ //#endregion
3039
+ //#region ---- Public API ----
3040
+ /**
3041
+ * Get all actions from providers, filtered based on plugin configuration.
3042
+ * Wraps the hook system for backward compatibility.
3043
+ * @param payload Initial payload with capabilities and plugin configuration.
3044
+ * @returns Filtered list of actions.
3045
+ */
3046
+ async getActions(payload) {
3047
+ // First, run hook system for backward compatibility
3048
+ // Note: Hook system may still use old format with 'host', but we pass capabilities
3049
+ // Hook providers that need host will need to be migrated to use capabilities
3050
+ let hookPayload;
3051
+ try {
3052
+ hookPayload = await this.hookService.runAsync('file-uploader.actions', {
3053
+ ...payload,
3054
+ // For backward compatibility, hooks might expect 'host' but we're using capabilities
3055
+ // Old hook providers will need to be migrated
3056
+ });
3057
+ }
3058
+ catch (err) {
3059
+ // If hook fails, continue with new system
3060
+ console.warn('[AXPFileActionsService] Hook system failed, continuing with providers only', err);
3061
+ }
3062
+ // Merge hook actions into payload (if any)
3063
+ const mergedPayload = {
3064
+ ...payload,
3065
+ actions: hookPayload?.actions ?? payload.actions ?? [],
3066
+ };
3067
+ // Resolve all providers (handle both direct and Promise<provider>)
3068
+ const providers = await this.resolveProviders();
3069
+ // Filter providers by key
3070
+ const matchingProviders = providers
3071
+ .filter((p) => p.key === 'file-uploader.actions')
3072
+ .sort((a, b) => (a.priority ?? 0) - (b.priority ?? 0));
3073
+ // Execute providers sequentially (waterfall pattern)
3074
+ let currentPayload = { ...mergedPayload, actions: [...mergedPayload.actions] };
3075
+ for (const provider of matchingProviders) {
3076
+ try {
3077
+ currentPayload = await Promise.resolve(runInInjectionContext(this.injector, () => provider.execute(currentPayload)));
3078
+ }
3079
+ catch (err) {
3080
+ console.error(`[AXPFileActionsService] Provider '${provider.key}' failed`, err);
3081
+ }
3082
+ }
3083
+ // Filter actions based on plugin configuration
3084
+ return this.filterActions(currentPayload.actions, payload.plugins, payload.excludePlugins);
3085
+ }
3086
+ //#endregion
3087
+ //#region ---- Private Methods ----
3088
+ /**
3089
+ * Resolve all providers (handle both direct providers and Promise<provider>).
3090
+ */
3091
+ async resolveProviders() {
3092
+ return Promise.all(this.actionProviders.map((p) => (p instanceof Promise ? p : Promise.resolve(p))));
3093
+ }
3094
+ /**
3095
+ * Filter actions based on enabled plugins and exclude list.
3096
+ */
3097
+ filterActions(actions, enabledPlugins, excludePlugins) {
3098
+ const enabledPluginNames = enabledPlugins?.map((p) => p.name) ?? [];
3099
+ const excludedPluginNames = excludePlugins ?? [];
3100
+ return actions.filter((action) => {
3101
+ // Exclude if in exclude list
3102
+ if (excludedPluginNames.includes(action.plugin)) {
3103
+ return false;
3104
+ }
3105
+ // Include if global
3106
+ if (action.global === true) {
3107
+ return true;
3108
+ }
3109
+ // Include if plugin is explicitly enabled
3110
+ if (enabledPluginNames.length > 0 && enabledPluginNames.includes(action.plugin)) {
3111
+ return true;
3112
+ }
3113
+ // If no plugins are enabled, only show global actions
3114
+ if (enabledPluginNames.length === 0) {
3115
+ return !!action.global;
3116
+ }
3117
+ return false;
3118
+ });
3119
+ }
3120
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AXPFileActionsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
3121
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AXPFileActionsService, providedIn: 'root' }); }
3122
+ }
3123
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AXPFileActionsService, decorators: [{
3124
+ type: Injectable,
3125
+ args: [{
3126
+ providedIn: 'root',
3127
+ }]
3128
+ }] });
3129
+
3130
+ //#endregion
3131
+
3132
+ const UploadFromComputerActionProvider = {
3133
+ key: 'file-uploader.actions',
3134
+ priority: 1, // Higher priority than upload-from-drive to show first
3135
+ execute: (payload) => {
3136
+ const fileService = inject(AXFileService);
3137
+ // Capture widget options for use in the action
3138
+ const widgetOptions = payload.options;
3139
+ payload.actions = [
3140
+ ...payload.actions,
3141
+ {
3142
+ plugin: 'upload-from-computer',
3143
+ global: true,
3144
+ textKey: '@document-management:actions.upload-from-device',
3145
+ icon: 'fa-light fa-file-arrow-up',
3146
+ run: async (capabilities) => {
3147
+ // Open file picker with widget options
3148
+ const files = await fileService.choose({
3149
+ multiple: widgetOptions?.multiple ?? true,
3150
+ accept: widgetOptions?.accept,
3151
+ });
3152
+ // If no files are selected, return
3153
+ if (files.length === 0) {
3154
+ return;
3155
+ }
3156
+ // Create file list items from selected files
3157
+ const fileItems = files.map((file) => ({
3158
+ id: AXPDataGenerator.uuid(),
3159
+ name: file.name,
3160
+ size: file.size,
3161
+ status: 'attached',
3162
+ source: {
3163
+ kind: 'blob',
3164
+ value: file,
3165
+ },
3166
+ }));
3167
+ // Add files using capabilities
3168
+ capabilities.addFiles(fileItems);
3169
+ },
3170
+ },
3171
+ ];
3172
+ return payload;
3173
+ },
3174
+ };
3175
+
3015
3176
  const AXP_FILE_TYPE_INFO_PROVIDER = new InjectionToken('AXP_FILE_TYPE_INFO_PROVIDER');
3016
3177
  class AXPFileTypeProviderService {
3017
3178
  constructor() {
@@ -3983,5 +4144,5 @@ class AXPVersioningService {
3983
4144
  * Generated bundle index. Do not edit.
3984
4145
  */
3985
4146
 
3986
- export { ALL_DEFAULT_OPERATORS, AXMWorkflowErrorHandler, AXPAppVersionService, AXPCleanNestedFilters, AXPClipBoardService, AXPCommonModule, AXPCommonSettings, AXPCustomOperatorService, AXPCustomOperatorServiceImpl, AXPDataProvider, AXPDebugService, AXPDialogConfirmAction, AXPEntityCommandScope, AXPEntityQueryType, AXPErrorHandlerRegistryService, AXPExportService, AXPFileStorageService, AXPFileStorageStatus, AXPFileTypeProviderService, AXPFilterOperatorMiddlewareService, AXPFilterOperatorMiddlewareServiceImpl, AXPFooterTextSlotComponent, AXPGlobalErrorHandler, AXPHomePageModule, AXPHomePageService, AXPLockService, AXPMenuMiddlewareRegistry, AXPMenuProviderService, AXPMenuSearchDefinitionProvider, AXPMenuSearchProvider, AXPMenuService, AXPMenuVisibilityService, AXPNavBarSlotComponent, AXPNavigateWorkflow, AXPPlatformDefaultConfigs, AXPRedirectEvent, AXPRefreshEvent, AXPRegionalSetting, AXPRelationshipCardinality, AXPRelationshipKind, AXPReloadAction, AXPReloadEvent, AXPSearchCommandProvider, AXPSearchDefinitionActionBuilder, AXPSearchDefinitionBuilder, AXPSearchDefinitionProviderContext, AXPSearchDefinitionProviderService, AXPSearchService, AXPSettingDefaultValuesAggregatorService, AXPSettingDefinitionGroupBuilder, AXPSettingDefinitionProviderContext, AXPSettingDefinitionProviderService, AXPSettingDefinitionSectionBuilder, AXPSettingsService, AXPStatusDefinitionProviderService, AXPStatusProvider, AXPStickyDirective, AXPSystemStatusType, AXPSystemStatuses, AXPToastAction, AXPTokenDefinitionService, AXPTokenEvaluatorScopeProvider, AXPVersioningService, AXPWorkflowNavigateAction, AXPWorkflowRouterNavigateAction, AXP_APP_VERSION_PROVIDER, AXP_FILE_TYPE_INFO_PROVIDER, AXP_HOME_PAGES, AXP_HOME_PAGE_DEFAULT_KEY, AXP_MENU_MIDDLEWARE, AXP_MENU_PROVIDER, AXP_PLATFORM_CONFIG_TOKEN, AXP_ROOT_CONFIG_TOKEN, AXP_SEARCH_DEFINITION_PROVIDER, AXP_SEARCH_PROVIDER, AXP_SETTING_DEFAULT_VALUES_PROVIDERS, AXP_SETTING_DEFINITION_PROVIDER, AXP_SETTING_VALUE_PROVIDER, AXP_STATUS_PROVIDERS, AXP_TOKEN_DEFINITION_PROVIDER, AXVChangeType, BETWEEN_OPER, BOOLEAN_OPERATORS, CONTAINS_OPER, DATE_OPERATORS, ENDS_WITH_OPER, ENVIRONMENT, EQ_OPER, GTE_OPER, GT_OPER, IN_OPER, IS_EMPTY_OPER, IS_NOT_EMPTY_OPER, LTE_OPER, LT_OPER, NOT_CONTAINS_OPER, NOT_EQ_OPER, NUMBER_OPERATORS, STARTS_WITH_OPER, STRING_OPERATORS, configPlatform, createAllQueryView, createMenuContext, createMenuMiddleware, createQueryView, getEntityInfo, getStatusInfo, getSystemStatus, provideDynamicHomePage, provideMenuMiddleware, resolveStatusLook, systemStatusToDefinition };
4147
+ export { ALL_DEFAULT_OPERATORS, AXMWorkflowErrorHandler, AXPAppVersionService, AXPCleanNestedFilters, AXPClipBoardService, AXPCommonModule, AXPCommonSettings, AXPCustomOperatorService, AXPCustomOperatorServiceImpl, AXPDataProvider, AXPDebugService, AXPDialogConfirmAction, AXPEntityCommandScope, AXPEntityQueryType, AXPErrorHandlerRegistryService, AXPExportService, AXPFileActionsService, AXPFileStorageService, AXPFileStorageStatus, AXPFileTypeProviderService, AXPFilterOperatorMiddlewareService, AXPFilterOperatorMiddlewareServiceImpl, AXPFooterTextSlotComponent, AXPGlobalErrorHandler, AXPHomePageModule, AXPHomePageService, AXPLockService, AXPMenuMiddlewareRegistry, AXPMenuProviderService, AXPMenuSearchDefinitionProvider, AXPMenuSearchProvider, AXPMenuService, AXPMenuVisibilityService, AXPNavBarSlotComponent, AXPNavigateWorkflow, AXPPlatformDefaultConfigs, AXPRedirectEvent, AXPRefreshEvent, AXPRegionalSetting, AXPRelationshipCardinality, AXPRelationshipKind, AXPReloadAction, AXPReloadEvent, AXPSearchCommandProvider, AXPSearchDefinitionActionBuilder, AXPSearchDefinitionBuilder, AXPSearchDefinitionProviderContext, AXPSearchDefinitionProviderService, AXPSearchService, AXPSettingDefaultValuesAggregatorService, AXPSettingDefinitionGroupBuilder, AXPSettingDefinitionProviderContext, AXPSettingDefinitionProviderService, AXPSettingDefinitionSectionBuilder, AXPSettingsService, AXPStatusDefinitionProviderService, AXPStatusProvider, AXPStickyDirective, AXPSystemStatusType, AXPSystemStatuses, AXPToastAction, AXPTokenDefinitionService, AXPTokenEvaluatorScopeProvider, AXPVersioningService, AXPWorkflowNavigateAction, AXPWorkflowRouterNavigateAction, AXP_APP_VERSION_PROVIDER, AXP_FILE_ACTION_PROVIDER, AXP_FILE_TYPE_INFO_PROVIDER, AXP_HOME_PAGES, AXP_HOME_PAGE_DEFAULT_KEY, AXP_MENU_MIDDLEWARE, AXP_MENU_PROVIDER, AXP_PLATFORM_CONFIG_TOKEN, AXP_ROOT_CONFIG_TOKEN, AXP_SEARCH_DEFINITION_PROVIDER, AXP_SEARCH_PROVIDER, AXP_SETTING_DEFAULT_VALUES_PROVIDERS, AXP_SETTING_DEFINITION_PROVIDER, AXP_SETTING_VALUE_PROVIDER, AXP_STATUS_PROVIDERS, AXP_TOKEN_DEFINITION_PROVIDER, AXVChangeType, BETWEEN_OPER, BOOLEAN_OPERATORS, CONTAINS_OPER, DATE_OPERATORS, ENDS_WITH_OPER, ENVIRONMENT, EQ_OPER, GTE_OPER, GT_OPER, IN_OPER, IS_EMPTY_OPER, IS_NOT_EMPTY_OPER, LTE_OPER, LT_OPER, NOT_CONTAINS_OPER, NOT_EQ_OPER, NUMBER_OPERATORS, STARTS_WITH_OPER, STRING_OPERATORS, UploadFromComputerActionProvider, configPlatform, createAllQueryView, createMenuContext, createMenuMiddleware, createQueryView, getEntityInfo, getStatusInfo, getSystemStatus, provideDynamicHomePage, provideMenuMiddleware, resolveStatusLook, systemStatusToDefinition };
3987
4148
  //# sourceMappingURL=acorex-platform-common.mjs.map