@acorex/modules 19.4.3 → 19.4.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/conversation/README.md +113 -2
- package/conversation/index.d.ts +2 -14
- package/conversation/lib/const.d.ts +25 -6
- package/conversation/lib/conversation.module.d.ts +32 -3
- package/conversation/lib/entities/index.d.ts +2 -0
- package/conversation/lib/entities/message/index.d.ts +3 -0
- package/conversation/lib/entities/message/message.entity.d.ts +3 -0
- package/conversation/lib/entities/message/message.service.d.ts +10 -0
- package/conversation/lib/entities/message/message.types.d.ts +20 -0
- package/conversation/lib/entities/room/index.d.ts +3 -0
- package/conversation/lib/entities/room/room.entity.d.ts +3 -0
- package/conversation/lib/entities/room/room.service.d.ts +10 -0
- package/conversation/lib/entities/room/room.types.d.ts +8 -0
- package/conversation/lib/entity.provider.d.ts +12 -0
- package/conversation/lib/features/chat/chat-preview.helper.d.ts +68 -0
- package/conversation/lib/features/chat/chat.component.d.ts +42 -0
- package/conversation/lib/features/chat/chat.service.d.ts +101 -0
- package/conversation/lib/features/chat/chat.type.d.ts +38 -0
- package/conversation/lib/{entities → features}/chat/components/chat-item/chat-item.component.d.ts +6 -1
- package/conversation/lib/{entities → features}/chat/components/chat-preview/chat-preview.component.d.ts +3 -0
- package/conversation/lib/features/chat/index.d.ts +5 -0
- package/conversation/lib/{entities/comments/pages → features/comment}/comment-list-view.component.d.ts +12 -12
- package/conversation/lib/features/comment/comment.service.d.ts +66 -0
- package/conversation/lib/features/comment/comment.type.d.ts +45 -0
- package/conversation/lib/features/comment/index.d.ts +4 -0
- package/conversation/lib/features/index.d.ts +2 -0
- package/document-management/lib/entities/folder/folder.types.d.ts +3 -2
- package/document-management/lib/features/document-explorer/components/create-folder-dialog/create-folder-dialog.component.d.ts +5 -2
- package/document-management/lib/features/document-explorer/document-explorer.component.d.ts +22 -20
- package/document-management/lib/features/document-explorer/document-explorer.viewmodel.d.ts +22 -2
- package/document-management/lib/features/document-explorer/views/attachement-widget/attachment-widget.component.d.ts +52 -33
- package/document-management/lib/features/document-explorer/views/detail-panel/detail-panel.component.d.ts +52 -33
- package/document-management/lib/features/document-explorer/views/details/details-view.component.d.ts +52 -33
- package/document-management/lib/features/document-explorer/views/large-icons/large-icons-view.component.d.ts +52 -33
- package/document-management/lib/features/document-explorer/views/large-tiles/large-tiles-view.component.d.ts +52 -33
- package/document-management/lib/features/document-explorer/views/list/list-view.component.d.ts +52 -33
- package/document-management/lib/features/document-explorer/views/small-icons/small-icons-view.component.d.ts +52 -33
- package/document-management/lib/features/document-explorer/views/small-tiles/small-tiles-view.component.d.ts +52 -33
- package/document-management/lib/features/drive/drive.component.d.ts +52 -31
- package/document-management/lib/features/drive-choose/drive-choose.component.d.ts +49 -28
- package/document-management/lib/features/shared/components/document-type-choose-file/document-type-choose-file.component.d.ts +6 -6
- package/document-management/lib/features/shared/components/folder-path-breadcrumbs/folder-path-breadcrumbs.component.d.ts +21 -2
- package/document-management/lib/features/shared/document-manager.service.d.ts +177 -45
- package/document-management/lib/features/shared/document-manager.types.d.ts +2 -1
- package/document-management/lib/features/shared/index.d.ts +1 -0
- package/fesm2022/acorex-modules-application-management-module-designer.component-BJp8imYd.mjs +315 -0
- package/fesm2022/acorex-modules-application-management-module-designer.component-BJp8imYd.mjs.map +1 -0
- package/fesm2022/acorex-modules-application-management.mjs +1 -1
- package/fesm2022/acorex-modules-common.mjs +7 -0
- package/fesm2022/acorex-modules-common.mjs.map +1 -1
- package/fesm2022/acorex-modules-conversation.mjs +2382 -820
- package/fesm2022/acorex-modules-conversation.mjs.map +1 -1
- package/fesm2022/{acorex-modules-document-management-acorex-modules-document-management-BpmG6Dyx.mjs → acorex-modules-document-management-acorex-modules-document-management-BATdoqJi.mjs} +1679 -2019
- package/fesm2022/acorex-modules-document-management-acorex-modules-document-management-BATdoqJi.mjs.map +1 -0
- package/fesm2022/{acorex-modules-document-management-attachment-widget.component-DIF_t4fE.mjs → acorex-modules-document-management-attachment-widget.component-C1-gQepw.mjs} +2 -2
- package/fesm2022/{acorex-modules-document-management-attachment-widget.component-DIF_t4fE.mjs.map → acorex-modules-document-management-attachment-widget.component-C1-gQepw.mjs.map} +1 -1
- package/fesm2022/acorex-modules-document-management-create-folder-dialog.component-ZMvsadWt.mjs +144 -0
- package/fesm2022/acorex-modules-document-management-create-folder-dialog.component-ZMvsadWt.mjs.map +1 -0
- package/fesm2022/{acorex-modules-document-management-details-view.component-D0RIYrHB.mjs → acorex-modules-document-management-details-view.component-CvHIETNf.mjs} +2 -2
- package/fesm2022/{acorex-modules-document-management-details-view.component-D0RIYrHB.mjs.map → acorex-modules-document-management-details-view.component-CvHIETNf.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-document-management-drive-choose.component-DMAQr0nK.mjs → acorex-modules-document-management-drive-choose.component-UTy9OISj.mjs} +29 -9
- package/fesm2022/acorex-modules-document-management-drive-choose.component-UTy9OISj.mjs.map +1 -0
- package/fesm2022/acorex-modules-document-management-drive.component-Crh10Z5J.mjs +363 -0
- package/fesm2022/acorex-modules-document-management-drive.component-Crh10Z5J.mjs.map +1 -0
- package/fesm2022/{acorex-modules-document-management-large-icons-view.component-C686Ec7s.mjs → acorex-modules-document-management-large-icons-view.component-BuV7MPG5.mjs} +2 -2
- package/fesm2022/{acorex-modules-document-management-large-icons-view.component-C686Ec7s.mjs.map → acorex-modules-document-management-large-icons-view.component-BuV7MPG5.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-document-management-large-tiles-view.component-0GpMVYv5.mjs → acorex-modules-document-management-large-tiles-view.component-CwYwVxoG.mjs} +2 -2
- package/fesm2022/{acorex-modules-document-management-large-tiles-view.component-0GpMVYv5.mjs.map → acorex-modules-document-management-large-tiles-view.component-CwYwVxoG.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-document-management-list-view.component-C1inszTC.mjs → acorex-modules-document-management-list-view.component-BHEwRA3m.mjs} +2 -2
- package/fesm2022/{acorex-modules-document-management-list-view.component-C1inszTC.mjs.map → acorex-modules-document-management-list-view.component-BHEwRA3m.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-document-management-permission-definition.provider-B7lgRLHi.mjs → acorex-modules-document-management-permission-definition.provider-B3qaYwRL.mjs} +2 -2
- package/fesm2022/{acorex-modules-document-management-permission-definition.provider-B7lgRLHi.mjs.map → acorex-modules-document-management-permission-definition.provider-B3qaYwRL.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-document-management-rename-node-dialog.component-C9k8WgDG.mjs → acorex-modules-document-management-rename-node-dialog.component-CrcJm9jP.mjs} +5 -5
- package/fesm2022/{acorex-modules-document-management-rename-node-dialog.component-C9k8WgDG.mjs.map → acorex-modules-document-management-rename-node-dialog.component-CrcJm9jP.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-document-management-small-icons-view.component-BGcUzNCv.mjs → acorex-modules-document-management-small-icons-view.component-CD5UORaq.mjs} +2 -2
- package/fesm2022/{acorex-modules-document-management-small-icons-view.component-BGcUzNCv.mjs.map → acorex-modules-document-management-small-icons-view.component-CD5UORaq.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-document-management-small-tiles-view.component-CumumWvO.mjs → acorex-modules-document-management-small-tiles-view.component-cpc_xfbT.mjs} +2 -2
- package/fesm2022/{acorex-modules-document-management-small-tiles-view.component-CumumWvO.mjs.map → acorex-modules-document-management-small-tiles-view.component-cpc_xfbT.mjs.map} +1 -1
- package/fesm2022/acorex-modules-document-management.mjs +1 -1
- package/fesm2022/{acorex-modules-issue-management-acorex-modules-issue-management-ErtEMU89.mjs → acorex-modules-issue-management-acorex-modules-issue-management-DbVfrgVX.mjs} +5 -5
- package/fesm2022/acorex-modules-issue-management-acorex-modules-issue-management-DbVfrgVX.mjs.map +1 -0
- package/fesm2022/{acorex-modules-issue-management-capture-screen.component-B6k0Zn9C.mjs → acorex-modules-issue-management-capture-screen.component-_9mwJVkz.mjs} +2 -2
- package/fesm2022/{acorex-modules-issue-management-capture-screen.component-B6k0Zn9C.mjs.map → acorex-modules-issue-management-capture-screen.component-_9mwJVkz.mjs.map} +1 -1
- package/fesm2022/acorex-modules-issue-management.mjs +1 -1
- package/fesm2022/acorex-modules-notification-management.mjs +5 -5
- package/fesm2022/acorex-modules-notification-management.mjs.map +1 -1
- package/fesm2022/{acorex-modules-organization-management-org-chart.page-CP8zz-Bc.mjs → acorex-modules-organization-management-org-chart.page-CrOUUr4c.mjs} +1 -2
- package/fesm2022/acorex-modules-organization-management-org-chart.page-CrOUUr4c.mjs.map +1 -0
- package/fesm2022/acorex-modules-organization-management.mjs +2 -2
- package/fesm2022/{acorex-modules-platform-management-acorex-modules-platform-management-C9ZApxct.mjs → acorex-modules-platform-management-acorex-modules-platform-management-DtXOjIIK.mjs} +326 -87
- package/fesm2022/acorex-modules-platform-management-acorex-modules-platform-management-DtXOjIIK.mjs.map +1 -0
- package/fesm2022/{acorex-modules-platform-management-list-version.component-D50Xundj.mjs → acorex-modules-platform-management-list-version.component-DY4yMd8n.mjs} +2 -2
- package/fesm2022/{acorex-modules-platform-management-list-version.component-D50Xundj.mjs.map → acorex-modules-platform-management-list-version.component-DY4yMd8n.mjs.map} +1 -1
- package/fesm2022/{acorex-modules-platform-management-settings.provider-DsHGn3AZ.mjs → acorex-modules-platform-management-settings.provider-BO-1dmVc.mjs} +2 -2
- package/fesm2022/{acorex-modules-platform-management-settings.provider-DsHGn3AZ.mjs.map → acorex-modules-platform-management-settings.provider-BO-1dmVc.mjs.map} +1 -1
- package/fesm2022/acorex-modules-platform-management.mjs +1 -1
- package/fesm2022/acorex-modules-project-management.mjs +108 -0
- package/fesm2022/acorex-modules-project-management.mjs.map +1 -1
- package/fesm2022/acorex-modules-settings-management.mjs +20 -21
- package/fesm2022/acorex-modules-settings-management.mjs.map +1 -1
- package/fesm2022/acorex-modules-training-management.mjs +1 -1
- package/fesm2022/acorex-modules-training-management.mjs.map +1 -1
- package/fesm2022/acorex-modules-workflow-management-task-board.page-3_Tn2GeA.mjs +305 -0
- package/fesm2022/acorex-modules-workflow-management-task-board.page-3_Tn2GeA.mjs.map +1 -0
- package/fesm2022/acorex-modules-workflow-management.mjs +123 -0
- package/fesm2022/acorex-modules-workflow-management.mjs.map +1 -0
- package/package.json +20 -16
- package/platform-management/lib/task-board.provider.d.ts +14 -0
- package/project-management/lib/task-board.provider.d.ts +14 -0
- package/settings-management/lib/settings-management.module.d.ts +1 -1
- package/workflow-management/README.md +3 -0
- package/workflow-management/index.d.ts +2 -0
- package/workflow-management/lib/const.d.ts +11 -0
- package/workflow-management/lib/features/task-board/index.d.ts +2 -0
- package/workflow-management/lib/features/task-board/settings.keys.d.ts +5 -0
- package/workflow-management/lib/features/task-board/task-board.module.d.ts +6 -0
- package/workflow-management/lib/features/task-board/task-board.page.d.ts +76 -0
- package/workflow-management/lib/features/task-board/task-board.service.d.ts +13 -0
- package/workflow-management/lib/features/task-board/task-board.viewmodel.d.ts +20 -0
- package/workflow-management/lib/features/task-board/views/task-board-calendar-view/task-board-calendar-view.page.d.ts +25 -0
- package/workflow-management/lib/workflow-management.module.d.ts +8 -0
- package/conversation/lib/entities/chat/chat.module.d.ts +0 -28
- package/conversation/lib/entities/chat/chat.service.d.ts +0 -14
- package/conversation/lib/entities/chat/chat.type.d.ts +0 -22
- package/conversation/lib/entities/chat/components/chat-item-footer/chat-item-footer.component.d.ts +0 -5
- package/conversation/lib/entities/chat/components/chat-item-header/chat-item-header.component.d.ts +0 -12
- package/conversation/lib/entities/chat/components/chat-preview-header/chat-preview-header.component.d.ts +0 -7
- package/conversation/lib/entities/chat/pages/chat/chat.component.d.ts +0 -23
- package/conversation/lib/entities/comments/comment.module.d.ts +0 -26
- package/conversation/lib/entities/comments/comments.service.d.ts +0 -13
- package/conversation/lib/entities/comments/comments.type.d.ts +0 -74
- package/document-management/lib/features/widgets/document-attachment/document-attachment-widget-column.component.d.ts +0 -6
- package/document-management/lib/features/widgets/document-attachment/document-attachment-widget-edit.component.d.ts +0 -212
- package/document-management/lib/features/widgets/document-attachment/document-attachment-widget-print.component.d.ts +0 -6
- package/document-management/lib/features/widgets/document-attachment/document-attachment-widget-view.component.d.ts +0 -6
- package/document-management/lib/features/widgets/document-attachment/document-attachment-widget.config.d.ts +0 -7
- package/document-management/lib/features/widgets/document-attachment/index.d.ts +0 -5
- package/document-management/lib/features/widgets/index.d.ts +0 -1
- package/fesm2022/acorex-modules-application-management-module-designer.component-BRh6mzWA.mjs +0 -315
- package/fesm2022/acorex-modules-application-management-module-designer.component-BRh6mzWA.mjs.map +0 -1
- package/fesm2022/acorex-modules-document-management-acorex-modules-document-management-BpmG6Dyx.mjs.map +0 -1
- package/fesm2022/acorex-modules-document-management-create-folder-dialog.component-CCvKUDsw.mjs +0 -141
- package/fesm2022/acorex-modules-document-management-create-folder-dialog.component-CCvKUDsw.mjs.map +0 -1
- package/fesm2022/acorex-modules-document-management-drive-choose.component-DMAQr0nK.mjs.map +0 -1
- package/fesm2022/acorex-modules-issue-management-acorex-modules-issue-management-ErtEMU89.mjs.map +0 -1
- package/fesm2022/acorex-modules-organization-management-org-chart.page-CP8zz-Bc.mjs.map +0 -1
- package/fesm2022/acorex-modules-platform-management-acorex-modules-platform-management-C9ZApxct.mjs.map +0 -1
- /package/conversation/lib/{entities/comments/pages → features/comment}/comment-lookup-popup.component.d.ts +0 -0
@@ -2,11 +2,11 @@ import { AXPSessionService, AXPAuthGuard, AXP_PERMISSION_DEFINITION_PROVIDER } f
|
|
2
2
|
import { AXPSearchCommandProvider, createAllQueryView, AXPEntityCommandScope, AXPEntityQueryType, AXPFileTypeProviderService, AXP_FILE_TYPE_INFO_PROVIDER, AXPFileStorageService, AXPSettingService, AXP_MENU_PROVIDER, AXP_SETTING_DEFINITION_PROVIDER, AXP_SEARCH_PROVIDER } from '@acorex/platform/common';
|
3
3
|
import { AXPEntityService, AXMEntityCrudServiceImpl, AXP_ENTITY_CONFIG_TOKEN, AXP_ENTITY_DEFINITION_LOADER } from '@acorex/platform/layout/entity';
|
4
4
|
import * as i0 from '@angular/core';
|
5
|
-
import { inject, Injector, Injectable, NgModule, ChangeDetectionStrategy, Component, signal,
|
5
|
+
import { inject, Injector, Injectable, NgModule, ChangeDetectionStrategy, Component, signal, viewChild, afterNextRender, computed, input, effect, ViewEncapsulation } from '@angular/core';
|
6
6
|
import { firstValueFrom } from 'rxjs';
|
7
7
|
import * as i6 from '@acorex/platform/layout/builder';
|
8
|
-
import { AXPWidgetsCatalog, AXPValueWidgetComponent, AXPLayoutBuilderModule, AXP_WIDGETS_ADVANCE_CATEGORY
|
9
|
-
import { RouterModule,
|
8
|
+
import { AXPWidgetsCatalog, AXPValueWidgetComponent, AXPLayoutBuilderModule, AXP_WIDGETS_ADVANCE_CATEGORY } from '@acorex/platform/layout/builder';
|
9
|
+
import { RouterModule, ROUTES } from '@angular/router';
|
10
10
|
import { AXDataSource } from '@acorex/cdk/common';
|
11
11
|
import { AXMMetaDataDefinitionService } from '@acorex/modules/platform-management';
|
12
12
|
import * as i1$1 from '@angular/common';
|
@@ -17,7 +17,7 @@ import * as i3$1 from '@acorex/components/decorators';
|
|
17
17
|
import { AXDecoratorModule } from '@acorex/components/decorators';
|
18
18
|
import * as i3 from '@acorex/components/form';
|
19
19
|
import { AXFormModule } from '@acorex/components/form';
|
20
|
-
import * as
|
20
|
+
import * as i5 from '@acorex/components/label';
|
21
21
|
import { AXLabelModule } from '@acorex/components/label';
|
22
22
|
import * as i1 from '@acorex/components/select-box';
|
23
23
|
import { AXSelectBoxModule } from '@acorex/components/select-box';
|
@@ -29,39 +29,29 @@ import { AXP_NAME_PROPERTY, AXP_DATA_PATH_PROPERTY } from '@acorex/platform/widg
|
|
29
29
|
import * as i3$3 from '@acorex/components/media-viewer';
|
30
30
|
import { AXMediaViewerContainerComponent, AXMediaViewerModule } from '@acorex/components/media-viewer';
|
31
31
|
import * as i3$5 from '@acorex/platform/workflow';
|
32
|
-
import {
|
32
|
+
import { AXPWorkflowAction, AXPWorkflowService, AXPWorkflowModule } from '@acorex/platform/workflow';
|
33
|
+
import { AXPopupService } from '@acorex/components/popup';
|
34
|
+
import { AXUploaderService } from '@acorex/components/uploader';
|
35
|
+
import * as i1$2 from '@acorex/platform/layout/components';
|
36
|
+
import { AXPComponentSlotModule, AXP_TASK_BADGE_PROVIDERS } from '@acorex/platform/layout/components';
|
33
37
|
import * as i2$1 from '@acorex/components/button';
|
34
|
-
import { AXButtonModule
|
35
|
-
import {
|
36
|
-
import
|
37
|
-
import {
|
38
|
-
import {
|
39
|
-
import { AXFileService
|
40
|
-
import
|
38
|
+
import { AXButtonModule } from '@acorex/components/button';
|
39
|
+
import { AXTextBoxModule } from '@acorex/components/text-box';
|
40
|
+
import { AXCheckBoxModule } from '@acorex/components/check-box';
|
41
|
+
import { AXPPlatformScope } from '@acorex/platform/core';
|
42
|
+
import { AXDialogService } from '@acorex/components/dialog';
|
43
|
+
import { AXFileService } from '@acorex/core/file';
|
44
|
+
import { castArray, set as set$1, get as get$1 } from 'lodash-es';
|
45
|
+
import * as i3$2 from '@acorex/core/translation';
|
41
46
|
import { AXTranslationService, AXTranslationModule } from '@acorex/core/translation';
|
42
|
-
import {
|
47
|
+
import { AXBasePageComponent } from '@acorex/components/page';
|
43
48
|
import { AXLoadingModule } from '@acorex/components/loading';
|
44
|
-
import * as i3$
|
49
|
+
import * as i3$4 from '@acorex/components/menu';
|
45
50
|
import { AXMenuModule } from '@acorex/components/menu';
|
46
51
|
import { AXDateTimeModule } from '@acorex/core/date-time';
|
47
|
-
import * as i2$2 from '@acorex/core/format';
|
48
52
|
import { AXFormatModule } from '@acorex/core/format';
|
49
53
|
import { AXPLayoutThemeService } from '@acorex/platform/themes/shared';
|
50
|
-
import { castArray, get as get$1, set as set$1 } from 'lodash-es';
|
51
|
-
import { AXDialogService } from '@acorex/components/dialog';
|
52
|
-
import { AXPopupService } from '@acorex/components/popup';
|
53
54
|
import { signalStore, withState, withComputed, withMethods, patchState } from '@ngrx/signals';
|
54
|
-
import { AXBadgeModule } from '@acorex/components/badge';
|
55
|
-
import { AXBreadcrumbsModule } from '@acorex/components/breadcrumbs';
|
56
|
-
import * as i6$1 from '@acorex/components/search-box';
|
57
|
-
import { AXSearchBoxModule } from '@acorex/components/search-box';
|
58
|
-
import { AXPPageLayoutBaseComponent, AXPPageLayoutComponent, AXPPageLayoutBase } from '@acorex/platform/layout/views';
|
59
|
-
import * as i1$2 from '@acorex/platform/layout/components';
|
60
|
-
import { AXPThemeLayoutBlockComponent, AXPComponentSlotModule, AXP_TASK_BADGE_PROVIDERS } from '@acorex/platform/layout/components';
|
61
|
-
import { AXBasePageComponent } from '@acorex/components/page';
|
62
|
-
import { AXUploaderService } from '@acorex/components/uploader';
|
63
|
-
import { AXTextBoxModule } from '@acorex/components/text-box';
|
64
|
-
import { AXCheckBoxModule } from '@acorex/components/check-box';
|
65
55
|
|
66
56
|
const config = {
|
67
57
|
i18n: 'document-management',
|
@@ -384,7 +374,7 @@ async function documentFactory(injector) {
|
|
384
374
|
schema: {
|
385
375
|
dataType: 'string',
|
386
376
|
interface: {
|
387
|
-
type: AXPWidgetsCatalog.
|
377
|
+
type: AXPWidgetsCatalog.fileUploader,
|
388
378
|
options: {
|
389
379
|
maxFileSize: ` {{context.eval("type.maxSize")}} `,
|
390
380
|
multiple: ` {{context.eval("type.multiple")}} `,
|
@@ -2788,7 +2778,7 @@ class AXMFileTypeExtensionWidgetEditComponent extends AXPValueWidgetComponent {
|
|
2788
2778
|
</ax-collapse-group>
|
2789
2779
|
}
|
2790
2780
|
</axp-widgets-container>
|
2791
|
-
</div>`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: AXSelectBoxModule }, { kind: "component", type: i1.AXSelectBoxComponent, selector: "ax-select-box", inputs: ["disabled", "readonly", "tabIndex", "placeholder", "minValue", "maxValue", "value", "state", "name", "id", "type", "look", "multiple", "valueField", "textField", "disabledField", "textTemplate", "selectedItems", "dataSource", "minRecordsForSearch", "caption", "itemTemplate", "selectedTemplate", "emptyTemplate", "loadingTemplate", "dropdownWidth", "searchBoxAutoFocus"], outputs: ["valueChange", "stateChange", "onValueChanged", "onBlur", "onFocus", "readonlyChange", "disabledChange", "onOpened", "onClosed"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: AXFormModule }, { kind: "component", type: i3.AXFormFieldComponent, selector: "ax-form-field", inputs: ["labelMode"] }, { kind: "ngmodule", type: AXLabelModule }, { kind: "component", type:
|
2781
|
+
</div>`, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: AXSelectBoxModule }, { kind: "component", type: i1.AXSelectBoxComponent, selector: "ax-select-box", inputs: ["disabled", "readonly", "tabIndex", "placeholder", "minValue", "maxValue", "value", "state", "name", "id", "type", "look", "multiple", "valueField", "textField", "disabledField", "textTemplate", "selectedItems", "dataSource", "minRecordsForSearch", "caption", "itemTemplate", "selectedTemplate", "emptyTemplate", "loadingTemplate", "dropdownWidth", "searchBoxAutoFocus"], outputs: ["valueChange", "stateChange", "onValueChanged", "onBlur", "onFocus", "readonlyChange", "disabledChange", "onOpened", "onClosed"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: AXFormModule }, { kind: "component", type: i3.AXFormFieldComponent, selector: "ax-form-field", inputs: ["labelMode"] }, { kind: "ngmodule", type: AXLabelModule }, { kind: "component", type: i5.AXLabelComponent, selector: "ax-label", inputs: ["required", "for"], outputs: ["requiredChange"] }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i3$1.AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-subtitle, ax-placeholder, ax-overlay" }, { kind: "ngmodule", type: AXPLayoutBuilderModule }, { kind: "component", type: i6.AXPWidgetContainerComponent, selector: "axp-widgets-container", inputs: ["context", "functions"], outputs: ["onContextChanged"] }, { kind: "directive", type: i6.AXPWidgetRendererDirective, selector: "[axp-widget-renderer]", inputs: ["parentNode", "index", "mode", "node"], outputs: ["onOptionsChanged", "onValueChanged"], exportAs: ["widgetRenderer"] }, { kind: "ngmodule", type: AXCollapseModule }, { kind: "component", type: i7.AXCollapseComponent, selector: "ax-collapse", inputs: ["disabled", "look", "isCollapsed", "showHeader", "caption", "icon", "isLoading", "headerTemplate"], outputs: ["onClick", "isCollapsedChange"] }, { kind: "component", type: i7.AXCollapseGroupComponent, selector: "ax-collapse-group", inputs: ["look", "accordion", "activeIndex"], outputs: ["accordionChange", "activeIndexChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
2792
2782
|
}
|
2793
2783
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AXMFileTypeExtensionWidgetEditComponent, decorators: [{
|
2794
2784
|
type: Component,
|
@@ -3000,30 +2990,111 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImpo
|
|
3000
2990
|
}]
|
3001
2991
|
}] });
|
3002
2992
|
|
3003
|
-
class
|
3004
|
-
|
3005
|
-
|
2993
|
+
class AXMCheckDocumentTypeWorkflowAction extends AXPWorkflowAction {
|
2994
|
+
async execute(context) {
|
2995
|
+
const documentType = context.getVariable('documentType');
|
2996
|
+
if (documentType) {
|
2997
|
+
context.setOutput('need-choose-document-type', false);
|
2998
|
+
}
|
2999
|
+
else {
|
3000
|
+
context.setOutput('need-choose-document-type', true);
|
3001
|
+
}
|
3002
|
+
}
|
3006
3003
|
}
|
3007
|
-
|
3008
|
-
|
3009
|
-
|
3010
|
-
|
3011
|
-
|
3012
|
-
|
3013
|
-
|
3014
|
-
|
3015
|
-
|
3004
|
+
class AXMChooseDocumentTypeWorkflowAction extends AXPWorkflowAction {
|
3005
|
+
constructor() {
|
3006
|
+
super(...arguments);
|
3007
|
+
this.popupService = inject(AXPopupService);
|
3008
|
+
}
|
3009
|
+
async execute(context) {
|
3010
|
+
const comp = (await Promise.resolve().then(function () { return index; })).AXMDocumentTypeChooseFileComponent;
|
3011
|
+
const result = await this.popupService.open(comp);
|
3012
|
+
if (result.data != null && result.data.documentTypeId != null) {
|
3013
|
+
context.setVariable('documentTypeId', result.data.documentTypeId);
|
3014
|
+
context.setOutput('isCanceled', false);
|
3015
|
+
}
|
3016
|
+
else {
|
3017
|
+
context.setOutput('isCanceled', true);
|
3018
|
+
}
|
3019
|
+
}
|
3020
|
+
}
|
3021
|
+
class AXMChooseFileWorkflowAction extends AXPWorkflowAction {
|
3022
|
+
constructor() {
|
3023
|
+
super(...arguments);
|
3024
|
+
this.documentTypeService = inject(AXMDocumentTypeService);
|
3025
|
+
this.uploadService = inject(AXUploaderService);
|
3026
|
+
}
|
3027
|
+
async execute(context) {
|
3028
|
+
var doc = context.getVariable('documentType');
|
3029
|
+
if (!doc) {
|
3030
|
+
const docId = context.getVariable('documentTypeId');
|
3031
|
+
doc = await this.documentTypeService.getOne(docId);
|
3032
|
+
}
|
3033
|
+
this.uploadService.browse({
|
3034
|
+
//accept: doc.type,
|
3035
|
+
multiple: doc.isMultiple,
|
3036
|
+
});
|
3037
|
+
}
|
3038
|
+
}
|
3039
|
+
const AXMUploadWorkflow = {
|
3040
|
+
startStepId: 'check-document-type',
|
3041
|
+
steps: {
|
3042
|
+
'check-document-type': {
|
3043
|
+
action: 'AXMCheckDocumentTypeWorkflowAction',
|
3044
|
+
nextSteps: [
|
3045
|
+
{
|
3046
|
+
conditions: [{ type: 'SINGLE', expression: 'context.getOutput("need-choose-document-type") == true' }],
|
3047
|
+
nextStepId: 'choose-document-type',
|
3048
|
+
},
|
3049
|
+
],
|
3050
|
+
},
|
3051
|
+
'choose-document-type': {
|
3052
|
+
action: 'AXMChooseDocumentTypeWorkflowAction',
|
3053
|
+
nextSteps: [
|
3054
|
+
{
|
3055
|
+
conditions: [{ type: 'SINGLE', expression: 'context.getOutput("isCanceled") == false' }],
|
3056
|
+
nextStepId: 'file-browser',
|
3057
|
+
},
|
3058
|
+
],
|
3059
|
+
},
|
3060
|
+
'file-browser': {
|
3061
|
+
action: 'AXMChooseFileWorkflowAction',
|
3062
|
+
nextSteps: [
|
3063
|
+
{
|
3064
|
+
conditions: [],
|
3065
|
+
nextStepId: 'dispatch-event',
|
3066
|
+
},
|
3067
|
+
],
|
3068
|
+
},
|
3069
|
+
},
|
3070
|
+
};
|
3016
3071
|
|
3017
|
-
|
3018
|
-
|
3019
|
-
|
3020
|
-
|
3072
|
+
class AXMTaskBadgeProviderSample1 {
|
3073
|
+
constructor() {
|
3074
|
+
this.count = signal(0);
|
3075
|
+
this.key = 'badge-1';
|
3076
|
+
this.count.set(10);
|
3077
|
+
}
|
3078
|
+
}
|
3079
|
+
class AXMTaskBadgeProviderSample2 {
|
3080
|
+
constructor() {
|
3081
|
+
this.count = signal(5);
|
3082
|
+
this.key = 'badge-2';
|
3083
|
+
setInterval(() => {
|
3084
|
+
this.count.update(c => c + 1);
|
3085
|
+
}, 30000);
|
3086
|
+
}
|
3087
|
+
}
|
3021
3088
|
|
3089
|
+
//#region ---- Imports ----
|
3090
|
+
//#endregion
|
3091
|
+
//#region ---- Service Implementation ----
|
3022
3092
|
/**
|
3023
3093
|
* Service for handling document drive operations
|
3024
3094
|
*/
|
3025
3095
|
class AXMDocumentManagerService {
|
3026
3096
|
constructor() {
|
3097
|
+
//#region ---- Services & Dependencies ----
|
3027
3098
|
this.folderService = inject(AXMFolderService);
|
3028
3099
|
this.sessionService = inject(AXPSessionService);
|
3029
3100
|
this.documentService = inject(AXMDocumentService);
|
@@ -3032,7 +3103,15 @@ class AXMDocumentManagerService {
|
|
3032
3103
|
this.fileService = inject(AXPFileStorageService);
|
3033
3104
|
this.fileManagerService = inject(AXFileService);
|
3034
3105
|
this.workflow = inject(AXPWorkflowService);
|
3106
|
+
this.translate = inject(AXTranslationService);
|
3107
|
+
//#endregion
|
3108
|
+
//#region ---- Private Properties ----
|
3035
3109
|
this.scopedDriveCache = new Map();
|
3110
|
+
//#endregion
|
3111
|
+
//#region ---- Mapping Methods ----
|
3112
|
+
/**
|
3113
|
+
* Maps folder entity to document explorer node
|
3114
|
+
*/
|
3036
3115
|
this.mapFolderDtoToFolderNode = (folder) => {
|
3037
3116
|
return {
|
3038
3117
|
id: folder.id,
|
@@ -3046,6 +3125,7 @@ class AXMDocumentManagerService {
|
|
3046
3125
|
size: folder.size,
|
3047
3126
|
documentTypes: folder.documentTypes,
|
3048
3127
|
storageType: 'physical',
|
3128
|
+
inherit: folder.inherit,
|
3049
3129
|
children: [
|
3050
3130
|
...(folder.folders?.map(this.mapFolderDtoToFolderNode) || []),
|
3051
3131
|
...(folder.documents?.map(this.mapFileToNode) || []),
|
@@ -3053,6 +3133,11 @@ class AXMDocumentManagerService {
|
|
3053
3133
|
};
|
3054
3134
|
};
|
3055
3135
|
}
|
3136
|
+
//#endregion
|
3137
|
+
//#region ---- Scope Management Methods ----
|
3138
|
+
/**
|
3139
|
+
* Creates a scoped drive service for the specified platform scope
|
3140
|
+
*/
|
3056
3141
|
scope(scope, options) {
|
3057
3142
|
const cacheKey = this.getScopeCacheKey(scope, options);
|
3058
3143
|
if (!this.scopedDriveCache.has(cacheKey)) {
|
@@ -3060,12 +3145,16 @@ class AXMDocumentManagerService {
|
|
3060
3145
|
}
|
3061
3146
|
return this.scopedDriveCache.get(cacheKey);
|
3062
3147
|
}
|
3148
|
+
/**
|
3149
|
+
* Generates a cache key for the scoped drive service
|
3150
|
+
*/
|
3063
3151
|
getScopeCacheKey(scope, options) {
|
3064
3152
|
return scope;
|
3065
3153
|
}
|
3154
|
+
//#endregion
|
3155
|
+
//#region ---- Private Helper Methods ----
|
3066
3156
|
/**
|
3067
3157
|
* Gets the platform root folder (top-level folder)
|
3068
|
-
* @returns Root folder for the platform
|
3069
3158
|
*/
|
3070
3159
|
async getPlatformRootFolder() {
|
3071
3160
|
const result = await this.folderService.query({
|
@@ -3088,9 +3177,6 @@ class AXMDocumentManagerService {
|
|
3088
3177
|
}
|
3089
3178
|
/**
|
3090
3179
|
* Gets the tenant root folder
|
3091
|
-
* @param rootFolderId The platform root folder ID
|
3092
|
-
* @param tenantId The tenant ID
|
3093
|
-
* @returns Tenant root folder
|
3094
3180
|
*/
|
3095
3181
|
async getTenantRootFolder(rootFolder, tenantId) {
|
3096
3182
|
if (!tenantId) {
|
@@ -3120,10 +3206,6 @@ class AXMDocumentManagerService {
|
|
3120
3206
|
}
|
3121
3207
|
/**
|
3122
3208
|
* Gets the user root folder
|
3123
|
-
* @param tenantFolderId The tenant folder ID
|
3124
|
-
* @param tenantId The tenant ID
|
3125
|
-
* @param userId The user ID
|
3126
|
-
* @returns User root folder
|
3127
3209
|
*/
|
3128
3210
|
async getUserRootFolder(tenantFolderId, tenantId, userId) {
|
3129
3211
|
if (!tenantId || !userId) {
|
@@ -3147,6 +3229,52 @@ class AXMDocumentManagerService {
|
|
3147
3229
|
}
|
3148
3230
|
return result.items[0];
|
3149
3231
|
}
|
3232
|
+
/**
|
3233
|
+
* Maps file entity to document explorer node
|
3234
|
+
*/
|
3235
|
+
mapFileToNode(file) {
|
3236
|
+
return {
|
3237
|
+
id: file.id,
|
3238
|
+
name: file.name,
|
3239
|
+
type: 'file',
|
3240
|
+
parentId: file.parentId,
|
3241
|
+
modifiedAt: file.updatedAt,
|
3242
|
+
createdAt: file.createdAt,
|
3243
|
+
size: file.size,
|
3244
|
+
fileId: file.fileId,
|
3245
|
+
storageType: 'physical',
|
3246
|
+
meta: file.meta,
|
3247
|
+
};
|
3248
|
+
}
|
3249
|
+
/**
|
3250
|
+
* Maps document to media viewer data
|
3251
|
+
*/
|
3252
|
+
async mapDocumentToMediaViewerData(doc) {
|
3253
|
+
if (!doc.fileId?.startsWith('http')) {
|
3254
|
+
const fileInfo = await this.fileService.getInfo(doc.fileId);
|
3255
|
+
return {
|
3256
|
+
id: doc.id ?? '',
|
3257
|
+
name: doc.name,
|
3258
|
+
type: doc.name.endsWith('.pdf') ? 'pdf' : 'image',
|
3259
|
+
url: fileInfo.url ?? '',
|
3260
|
+
size: doc.size.toString(),
|
3261
|
+
thumbnail: fileInfo.url ?? '',
|
3262
|
+
};
|
3263
|
+
}
|
3264
|
+
return {
|
3265
|
+
id: doc.id ?? '',
|
3266
|
+
name: doc.name,
|
3267
|
+
type: doc.meta?.['type'] ?? 'image',
|
3268
|
+
url: doc.fileId ?? '',
|
3269
|
+
size: doc.size.toString(),
|
3270
|
+
thumbnail: doc.fileId ?? '',
|
3271
|
+
};
|
3272
|
+
}
|
3273
|
+
//#endregion
|
3274
|
+
//#region ---- Utility Methods ----
|
3275
|
+
/**
|
3276
|
+
* Builds navigation path for a node
|
3277
|
+
*/
|
3150
3278
|
async buildPath(node, stopFolderId) {
|
3151
3279
|
if (node.type === 'file') {
|
3152
3280
|
return (await this.documentService.getPath(node.id, stopFolderId)).map(this.mapFolderDtoToFolderNode);
|
@@ -3155,92 +3283,23 @@ class AXMDocumentManagerService {
|
|
3155
3283
|
return (await this.folderService.getPath(node.id, stopFolderId)).map(this.mapFolderDtoToFolderNode);
|
3156
3284
|
}
|
3157
3285
|
}
|
3158
|
-
|
3159
|
-
|
3160
|
-
|
3161
|
-
|
3162
|
-
|
3163
|
-
|
3164
|
-
|
3165
|
-
|
3166
|
-
if (popup.data?.result) {
|
3167
|
-
// Handle the share action with popup.data.data
|
3168
|
-
}
|
3169
|
-
}
|
3170
|
-
async showShareWithEmailDialog(node) {
|
3171
|
-
const comp = (await import('./acorex-modules-document-management-share-email-dialog.component-Bj6G6aqt.mjs'))
|
3172
|
-
.AXMShareEmailDialogComponent;
|
3173
|
-
const popup = await this.popupService.open(comp, {
|
3174
|
-
title: 'Share via Email',
|
3175
|
-
data: {
|
3176
|
-
node,
|
3177
|
-
},
|
3178
|
-
});
|
3179
|
-
if (popup.data?.result) {
|
3180
|
-
// Handle the share via email action with popup.data.data
|
3181
|
-
}
|
3182
|
-
}
|
3183
|
-
async showLinkDialog(node) {
|
3184
|
-
const comp = (await import('./acorex-modules-document-management-link-dialog.component-DKbO2nX8.mjs')).AXMLinkDialogComponent;
|
3185
|
-
const popup = await this.popupService.open(comp, {
|
3186
|
-
title: 'Share Link',
|
3187
|
-
data: {
|
3188
|
-
node,
|
3189
|
-
},
|
3190
|
-
});
|
3191
|
-
if (popup.data?.result) {
|
3192
|
-
// Handle the link generation with popup.data.data
|
3193
|
-
}
|
3194
|
-
}
|
3195
|
-
async showLockDialog(node) {
|
3196
|
-
const comp = (await import('./acorex-modules-document-management-lock-dialog.component-By36woOc.mjs')).AXMLockDialogComponent;
|
3197
|
-
const popup = await this.popupService.open(comp, {
|
3198
|
-
title: 'Lock Document',
|
3199
|
-
data: {
|
3200
|
-
node,
|
3201
|
-
},
|
3202
|
-
});
|
3203
|
-
if (popup.data?.result) {
|
3204
|
-
// Handle the lock action with popup.data.data
|
3205
|
-
}
|
3206
|
-
}
|
3207
|
-
async showUnlockDialog(node) {
|
3208
|
-
const comp = (await import('./acorex-modules-document-management-unlock-dialog.component-CNjFnm2w.mjs')).AXMUnlockDialogComponent;
|
3209
|
-
const popup = await this.popupService.open(comp, {
|
3210
|
-
title: 'Unlock Document',
|
3211
|
-
data: {
|
3212
|
-
node,
|
3213
|
-
},
|
3214
|
-
});
|
3215
|
-
if (popup.data?.result) {
|
3216
|
-
// Handle the unlock action with popup.data.data
|
3217
|
-
}
|
3218
|
-
}
|
3219
|
-
async showFolderEditDialog(node) {
|
3220
|
-
const comp = (await import('./acorex-modules-document-management-create-folder-dialog.component-CCvKUDsw.mjs'))
|
3221
|
-
.AXMCreateFolderDialog;
|
3222
|
-
const popup = await this.popupService.open(comp, {
|
3223
|
-
title: 't("actions.update-folder")',
|
3224
|
-
data: {
|
3225
|
-
defaultValue: node,
|
3226
|
-
},
|
3227
|
-
});
|
3228
|
-
return popup.data?.result;
|
3229
|
-
}
|
3230
|
-
async updateFileName(node, name) {
|
3231
|
-
if (node.storageType == 'physical') {
|
3232
|
-
return this.mapFileToNode(await this.documentService.updateOne(node.id, { name }));
|
3233
|
-
}
|
3234
|
-
else {
|
3235
|
-
node.name = name;
|
3236
|
-
return node;
|
3286
|
+
/**
|
3287
|
+
* Creates a copy name by adding " copy" before the extension
|
3288
|
+
*/
|
3289
|
+
createCopyName(originalName) {
|
3290
|
+
const lastDotIndex = originalName.lastIndexOf('.');
|
3291
|
+
if (lastDotIndex === -1) {
|
3292
|
+
// No extension
|
3293
|
+
return `${originalName} copy`;
|
3237
3294
|
}
|
3295
|
+
const nameWithoutExt = originalName.substring(0, lastDotIndex);
|
3296
|
+
const extension = originalName.substring(lastDotIndex);
|
3297
|
+
return `${nameWithoutExt} copy${extension}`;
|
3238
3298
|
}
|
3299
|
+
//#endregion
|
3300
|
+
//#region ---- Root and Folder Operations ----
|
3239
3301
|
/**
|
3240
3302
|
* Gets the root folder based on the specified scope
|
3241
|
-
* @param scope The drive scope (Platform, Tenant, User)
|
3242
|
-
* @param options Optional parameters for tenant and user IDs
|
3243
|
-
* @returns Root folder for the specified scope
|
3244
3303
|
*/
|
3245
3304
|
async getRoot(scope, options) {
|
3246
3305
|
const rootFolder = await this.getPlatformRootFolder();
|
@@ -3277,8 +3336,6 @@ class AXMDocumentManagerService {
|
|
3277
3336
|
}
|
3278
3337
|
/**
|
3279
3338
|
* Gets a specific folder by ID
|
3280
|
-
* @param folderId The folder ID to retrieve
|
3281
|
-
* @returns The requested folder
|
3282
3339
|
*/
|
3283
3340
|
async getFolder(scope, folderId, options) {
|
3284
3341
|
if (!folderId) {
|
@@ -3292,6 +3349,9 @@ class AXMDocumentManagerService {
|
|
3292
3349
|
const path = await this.buildPath(result, (await this.getRoot(scope, options)).result.id);
|
3293
3350
|
return { path, result };
|
3294
3351
|
}
|
3352
|
+
/**
|
3353
|
+
* Creates a new folder
|
3354
|
+
*/
|
3295
3355
|
async createFolder(data) {
|
3296
3356
|
const now = new Date();
|
3297
3357
|
const currentUser = this.sessionService.user;
|
@@ -3310,6 +3370,9 @@ class AXMDocumentManagerService {
|
|
3310
3370
|
const folder = await this.folderService.getOne(createdFolder);
|
3311
3371
|
return this.mapFolderDtoToFolderNode(folder);
|
3312
3372
|
}
|
3373
|
+
/**
|
3374
|
+
* Updates an existing folder
|
3375
|
+
*/
|
3313
3376
|
async updateFolder(folderId, data) {
|
3314
3377
|
const currentUser = this.sessionService.user;
|
3315
3378
|
const updateData = {
|
@@ -3321,40 +3384,81 @@ class AXMDocumentManagerService {
|
|
3321
3384
|
const updatedFolder = await this.folderService.getOne(folderId);
|
3322
3385
|
return this.mapFolderDtoToFolderNode(updatedFolder);
|
3323
3386
|
}
|
3387
|
+
/**
|
3388
|
+
* Deletes a folder
|
3389
|
+
*/
|
3324
3390
|
async deleteFolder(folderId) {
|
3325
3391
|
await this.folderService.deleteOne(folderId);
|
3326
3392
|
}
|
3393
|
+
/**
|
3394
|
+
* Gets available storage space
|
3395
|
+
*/
|
3327
3396
|
async getAvailableSpace() {
|
3328
3397
|
// For now, return a fixed value of 100GB (56 * 1024 * 1024 * 1024 bytes)
|
3329
3398
|
// This should be replaced with actual storage quota logic when implemented
|
3330
3399
|
return 56 * 1024 * 1024 * 1024;
|
3331
3400
|
}
|
3332
|
-
|
3333
|
-
|
3334
|
-
|
3335
|
-
|
3336
|
-
|
3337
|
-
parentId: file.parentId,
|
3338
|
-
modifiedAt: file.updatedAt,
|
3339
|
-
createdAt: file.createdAt,
|
3340
|
-
size: file.size,
|
3341
|
-
fileId: file.fileId,
|
3342
|
-
storageType: 'physical',
|
3343
|
-
meta: file.meta,
|
3344
|
-
};
|
3345
|
-
}
|
3401
|
+
//#endregion
|
3402
|
+
//#region ---- File Operations ----
|
3403
|
+
/**
|
3404
|
+
* Creates a new file
|
3405
|
+
*/
|
3346
3406
|
async createFile(data) {
|
3347
3407
|
const fileId = await this.documentService.insertOne(data);
|
3348
3408
|
const file = await this.documentService.getOne(fileId);
|
3349
3409
|
return this.mapFileToNode(file);
|
3350
3410
|
}
|
3411
|
+
/**
|
3412
|
+
* Updates an existing file
|
3413
|
+
*/
|
3351
3414
|
async updateFile(fileId, data) {
|
3352
3415
|
const updatedFile = await this.documentService.updateOne(fileId, data);
|
3353
3416
|
return this.mapFileToNode(updatedFile);
|
3354
3417
|
}
|
3418
|
+
/**
|
3419
|
+
* Deletes a file
|
3420
|
+
*/
|
3355
3421
|
async deleteFile(fileId) {
|
3356
3422
|
await this.documentService.deleteOne(fileId);
|
3357
3423
|
}
|
3424
|
+
/**
|
3425
|
+
* Opens a file
|
3426
|
+
*/
|
3427
|
+
async openFile(node) {
|
3428
|
+
const file = await this.documentService.getOne(node.id);
|
3429
|
+
}
|
3430
|
+
/**
|
3431
|
+
* Downloads a file
|
3432
|
+
*/
|
3433
|
+
async downloadFile(node) {
|
3434
|
+
// const file = await this.documentService.getOne(node.id);
|
3435
|
+
if (node.fileId) {
|
3436
|
+
if (node.fileId.startsWith('http')) {
|
3437
|
+
const link = document.createElement('a');
|
3438
|
+
link.href = node.fileId;
|
3439
|
+
link.download = node.name;
|
3440
|
+
document.body.appendChild(link);
|
3441
|
+
link.click();
|
3442
|
+
document.body.removeChild(link);
|
3443
|
+
return;
|
3444
|
+
}
|
3445
|
+
const fileInfo = await this.fileService.getInfo(node.fileId);
|
3446
|
+
const link = document.createElement('a');
|
3447
|
+
link.href = fileInfo.url ?? '';
|
3448
|
+
link.download = node.name; // Set the desired file name
|
3449
|
+
document.body.appendChild(link);
|
3450
|
+
link.click();
|
3451
|
+
document.body.removeChild(link);
|
3452
|
+
}
|
3453
|
+
else {
|
3454
|
+
console.log('id is null');
|
3455
|
+
}
|
3456
|
+
}
|
3457
|
+
//#endregion
|
3458
|
+
//#region ---- Node Operations ----
|
3459
|
+
/**
|
3460
|
+
* Deletes multiple nodes (files and folders)
|
3461
|
+
*/
|
3358
3462
|
async deleteNodes(nodes) {
|
3359
3463
|
for (const node of nodes) {
|
3360
3464
|
if (node.type == 'folder') {
|
@@ -3365,28 +3469,65 @@ class AXMDocumentManagerService {
|
|
3365
3469
|
}
|
3366
3470
|
}
|
3367
3471
|
}
|
3368
|
-
|
3369
|
-
|
3370
|
-
|
3371
|
-
|
3372
|
-
|
3373
|
-
|
3374
|
-
|
3375
|
-
|
3376
|
-
|
3377
|
-
|
3472
|
+
/**
|
3473
|
+
* Creates a copy of a node (file or folder)
|
3474
|
+
*/
|
3475
|
+
async copy(node) {
|
3476
|
+
if (!node) {
|
3477
|
+
throw new Error('Node to copy cannot be null or undefined');
|
3478
|
+
}
|
3479
|
+
// Create a name with " copy" before the extension
|
3480
|
+
const newName = this.createCopyName(node.name);
|
3481
|
+
if (node.type === 'file') {
|
3482
|
+
// Get the original file to copy all its data
|
3483
|
+
const originalFile = await this.documentService.getOne(node.id);
|
3484
|
+
if (!originalFile) {
|
3485
|
+
throw new Error(`File with ID ${node.id} not found`);
|
3486
|
+
}
|
3487
|
+
// Create a document model from the original with the new name
|
3488
|
+
// Extract needed properties without id
|
3489
|
+
const { id, ...fileDataWithoutId } = originalFile;
|
3490
|
+
const fileData = {
|
3491
|
+
...fileDataWithoutId,
|
3492
|
+
name: newName,
|
3493
|
+
title: newName,
|
3494
|
+
};
|
3495
|
+
// Create the new file
|
3496
|
+
return await this.createFile(fileData);
|
3497
|
+
}
|
3498
|
+
else if (node.type === 'folder') {
|
3499
|
+
// Get the original folder to copy all its data
|
3500
|
+
const originalFolder = await this.folderService.getOne(node.id);
|
3501
|
+
if (!originalFolder) {
|
3502
|
+
throw new Error(`Folder with ID ${node.id} not found`);
|
3503
|
+
}
|
3504
|
+
// Create a folder model from the original with the new name
|
3505
|
+
// Extract needed properties without id
|
3506
|
+
const { id, ...folderDataWithoutId } = originalFolder;
|
3507
|
+
const folderData = {
|
3508
|
+
...folderDataWithoutId,
|
3509
|
+
name: newName,
|
3510
|
+
};
|
3511
|
+
// Create the new folder
|
3512
|
+
return await this.createFolder(folderData);
|
3513
|
+
}
|
3514
|
+
else {
|
3515
|
+
throw new Error(`Unsupported node type: ${node.type}`);
|
3516
|
+
}
|
3378
3517
|
}
|
3518
|
+
/**
|
3519
|
+
* Moves a node to another location
|
3520
|
+
*/
|
3379
3521
|
async moveTo(options) {
|
3380
|
-
const comp = (await import('./acorex-modules-document-management-drive-choose.component-
|
3381
|
-
//
|
3522
|
+
const comp = (await import('./acorex-modules-document-management-drive-choose.component-UTy9OISj.mjs')).AXMDocumentDriveChooseComponent;
|
3382
3523
|
const popup = await this.popupService.open(comp, {
|
3383
3524
|
title: `Choose ${options.browseMode == 'file' ? 'File' : 'Folder'}`,
|
3384
3525
|
data: {
|
3385
3526
|
selectionMode: options.multiple ? 'multiple' : 'single',
|
3386
3527
|
browseMode: options.browseMode ?? 'file',
|
3528
|
+
scope: options.scope
|
3387
3529
|
},
|
3388
3530
|
});
|
3389
|
-
//
|
3390
3531
|
const selectedFolders = popup.data.result ? popup.data?.items ?? [] : [];
|
3391
3532
|
if (selectedFolders.length > 0) {
|
3392
3533
|
const selectedFolder = selectedFolders[0];
|
@@ -3407,17 +3548,19 @@ class AXMDocumentManagerService {
|
|
3407
3548
|
return false;
|
3408
3549
|
}
|
3409
3550
|
}
|
3551
|
+
/**
|
3552
|
+
* Copies a node to another location
|
3553
|
+
*/
|
3410
3554
|
async copyTo(options) {
|
3411
|
-
const comp = (await import('./acorex-modules-document-management-drive-choose.component-
|
3412
|
-
//
|
3555
|
+
const comp = (await import('./acorex-modules-document-management-drive-choose.component-UTy9OISj.mjs')).AXMDocumentDriveChooseComponent;
|
3413
3556
|
const popup = await this.popupService.open(comp, {
|
3414
3557
|
title: `Choose ${options.browseMode == 'file' ? 'File' : 'Folder'}`,
|
3415
3558
|
data: {
|
3416
3559
|
selectionMode: options.multiple ? 'multiple' : 'single',
|
3417
3560
|
browseMode: options.browseMode ?? 'file',
|
3561
|
+
scope: options.scope
|
3418
3562
|
},
|
3419
3563
|
});
|
3420
|
-
//
|
3421
3564
|
const selectedFolders = popup.data.result ? popup.data?.items ?? [] : [];
|
3422
3565
|
if (selectedFolders.length > 0) {
|
3423
3566
|
const selectedFolder = selectedFolders[0];
|
@@ -3428,7 +3571,7 @@ class AXMDocumentManagerService {
|
|
3428
3571
|
parentId: selectedFolder.id,
|
3429
3572
|
color: '#ffffff',
|
3430
3573
|
size: options.node.size,
|
3431
|
-
inherit: options.node.inherit ??
|
3574
|
+
inherit: options.node.inherit ?? 'None',
|
3432
3575
|
});
|
3433
3576
|
}
|
3434
3577
|
else {
|
@@ -3451,86 +3594,27 @@ class AXMDocumentManagerService {
|
|
3451
3594
|
return false;
|
3452
3595
|
}
|
3453
3596
|
}
|
3454
|
-
|
3455
|
-
|
3456
|
-
|
3457
|
-
|
3458
|
-
|
3459
|
-
name: doc.name,
|
3460
|
-
type: doc.name.endsWith('.pdf') ? 'pdf' : 'image',
|
3461
|
-
url: fileInfo.url ?? '',
|
3462
|
-
size: doc.size.toString(),
|
3463
|
-
thumbnail: fileInfo.url ?? '',
|
3464
|
-
};
|
3465
|
-
}
|
3466
|
-
return {
|
3467
|
-
id: doc.id ?? '',
|
3468
|
-
name: doc.name,
|
3469
|
-
type: doc.meta?.['type'] ?? 'image',
|
3470
|
-
url: doc.fileId ?? '',
|
3471
|
-
size: doc.size.toString(),
|
3472
|
-
thumbnail: doc.fileId ?? '',
|
3473
|
-
};
|
3474
|
-
}
|
3475
|
-
async showFileViewerPopup(node, options) {
|
3476
|
-
const isVirtualFolder = node.parentId === 'virtual';
|
3477
|
-
const parentFolderName = isVirtualFolder ? 'Virtual' : (await this.folderService.getOne(node.parentId)).name;
|
3478
|
-
const documents = isVirtualFolder
|
3479
|
-
? options?.folderVituralfiles ?? []
|
3480
|
-
: (await this.folderService.getOne(node.parentId)).documents ?? [];
|
3481
|
-
const nodes = await Promise.all(documents
|
3482
|
-
.filter((item) => {
|
3483
|
-
if (!item.name)
|
3484
|
-
return false;
|
3485
|
-
const ext = item.name.split('.').pop()?.toLowerCase();
|
3486
|
-
return ext && ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp', 'pdf'].includes(ext);
|
3487
|
-
})
|
3488
|
-
.map((doc) => this.mapDocumentToMediaViewerData(doc)));
|
3489
|
-
const comp = (await Promise.resolve().then(function () { return fileViewerPopup_component; }))
|
3490
|
-
.AXMFileViewerPopupComponent;
|
3491
|
-
await this.popupService.open(comp, {
|
3492
|
-
title: parentFolderName,
|
3493
|
-
data: {
|
3494
|
-
nodes,
|
3495
|
-
index: isVirtualFolder
|
3496
|
-
? options?.folderVituralfiles?.findIndex((f) => f.id === node.id) ?? 0
|
3497
|
-
: options?.index ?? 0,
|
3498
|
-
},
|
3499
|
-
});
|
3500
|
-
}
|
3501
|
-
async openFile(node) {
|
3502
|
-
const file = await this.documentService.getOne(node.id);
|
3503
|
-
}
|
3504
|
-
async showRenamePopup(node) {
|
3505
|
-
const comp = (await import('./acorex-modules-document-management-rename-node-dialog.component-C9k8WgDG.mjs'))
|
3506
|
-
.AXMRenameNodeDialog;
|
3507
|
-
const popup = await this.popupService.open(comp, {
|
3508
|
-
title: 't("actions.rename")',
|
3509
|
-
data: {
|
3510
|
-
node,
|
3511
|
-
},
|
3512
|
-
});
|
3513
|
-
return popup.data?.result;
|
3514
|
-
}
|
3515
|
-
async showDeleteNodesDialog(nodeIds) {
|
3516
|
-
const result = await this.workflow.execute('delete-entity', {
|
3517
|
-
entities: nodeIds.map((node) => ({
|
3518
|
-
source: `${RootConfig.module.name}.${node.type == 'folder' ? RootConfig.entities.folder.name : RootConfig.entities.document.name}`,
|
3519
|
-
ids: [node.id],
|
3520
|
-
})),
|
3521
|
-
});
|
3522
|
-
return result.getOutput('result') ?? false;
|
3523
|
-
}
|
3597
|
+
//#endregion
|
3598
|
+
//#region ---- Search Operations ----
|
3599
|
+
/**
|
3600
|
+
* Searches for folders by term within a scope
|
3601
|
+
*/
|
3524
3602
|
async searchFolders(searchTerm, scope, options) {
|
3525
3603
|
const { result: rootNode } = await this.getRoot(scope, options);
|
3526
3604
|
const folders = await this.folderService.searchFolders(searchTerm, rootNode.id);
|
3527
3605
|
return folders.map((folder) => this.mapFolderDtoToFolderNode(folder));
|
3528
3606
|
}
|
3607
|
+
/**
|
3608
|
+
* Searches for files by term within a scope
|
3609
|
+
*/
|
3529
3610
|
async searchFiles(searchTerm, scope, options) {
|
3530
3611
|
const { result: rootNode } = await this.getRoot(scope, options);
|
3531
3612
|
const files = await this.documentService.searchFiles(searchTerm, rootNode.id);
|
3532
3613
|
return files.map((file) => this.mapFileToNode(file));
|
3533
3614
|
}
|
3615
|
+
/**
|
3616
|
+
* Searches for both files and folders by term within a scope
|
3617
|
+
*/
|
3534
3618
|
async searchNodes(searchTerm, scope, options) {
|
3535
3619
|
const [folders, files] = await Promise.all([
|
3536
3620
|
this.searchFolders(searchTerm, scope, options),
|
@@ -3538,163 +3622,82 @@ class AXMDocumentManagerService {
|
|
3538
3622
|
]);
|
3539
3623
|
return [...folders, ...files];
|
3540
3624
|
}
|
3625
|
+
//#endregion
|
3626
|
+
//#region ---- Data Retrieval Operations ----
|
3627
|
+
/**
|
3628
|
+
* Gets all folders
|
3629
|
+
*/
|
3541
3630
|
async getAllFolders() {
|
3542
3631
|
//TODO filter by scope
|
3543
3632
|
return (await this.folderService.query()).items.map(this.mapFolderDtoToFolderNode);
|
3544
3633
|
}
|
3634
|
+
/**
|
3635
|
+
* Gets all files with optional query
|
3636
|
+
*/
|
3545
3637
|
async getAllFiles(request) {
|
3546
3638
|
//TODO filter by scope
|
3547
3639
|
return (await this.documentService.query(request)).items.map(this.mapFileToNode);
|
3548
3640
|
}
|
3641
|
+
/**
|
3642
|
+
* Gets all nodes (files and folders)
|
3643
|
+
*/
|
3549
3644
|
async getAllNodes() {
|
3550
3645
|
return [...(await this.getAllFolders()), ...(await this.getAllFiles())];
|
3551
3646
|
}
|
3552
|
-
|
3553
|
-
|
3647
|
+
//#endregion
|
3648
|
+
//#region ---- File Upload Operations ----
|
3649
|
+
/**
|
3650
|
+
* Uploads file by document type to a specific folder
|
3651
|
+
*/
|
3652
|
+
async uploadFileByType(folderId, docTypeId) {
|
3653
|
+
const folder = await this.folderService.getOne(folderId);
|
3654
|
+
var docType = folder.documentTypes?.find((dt) => dt.id === docTypeId);
|
3655
|
+
if (folder && docType != null) {
|
3656
|
+
const comp = (await Promise.resolve().then(function () { return index; })).AXMDocumentTypeChooseFileComponent;
|
3657
|
+
const result = await this.popupService.open(comp, {
|
3658
|
+
title: `Select ${docType.title}`,
|
3659
|
+
data: {
|
3660
|
+
documentType: docType,
|
3661
|
+
},
|
3662
|
+
});
|
3663
|
+
if (result.data != null) {
|
3664
|
+
const { uploads, ...metaContext } = result.data.context;
|
3665
|
+
for (const u of uploads) {
|
3666
|
+
const fileInfo = u;
|
3667
|
+
const f = await this.fileService.save({
|
3668
|
+
category: 'document',
|
3669
|
+
file: fileInfo,
|
3670
|
+
refId: folderId,
|
3671
|
+
refType: `${RootConfig.module.name}.${RootConfig.entities.folder.name}`,
|
3672
|
+
name: fileInfo.name ?? '',
|
3673
|
+
});
|
3674
|
+
await this.fileService.commit(f.fileId);
|
3675
|
+
const file = await this.documentService.insertOne({
|
3676
|
+
fileId: f.fileId,
|
3677
|
+
meta: metaContext,
|
3678
|
+
parentId: folderId,
|
3679
|
+
size: fileInfo.size,
|
3680
|
+
name: fileInfo.name ?? '',
|
3681
|
+
title: fileInfo.name ?? '',
|
3682
|
+
});
|
3683
|
+
}
|
3684
|
+
return true;
|
3685
|
+
}
|
3686
|
+
else {
|
3687
|
+
return false;
|
3688
|
+
}
|
3689
|
+
}
|
3690
|
+
return false;
|
3691
|
+
}
|
3692
|
+
/**
|
3693
|
+
* Uploads virtual file by document type
|
3694
|
+
*/
|
3695
|
+
async uploadFileVirtualByType(docType) {
|
3696
|
+
const comp = (await Promise.resolve().then(function () { return index; })).AXMDocumentTypeChooseFileComponent;
|
3554
3697
|
const result = await this.popupService.open(comp, {
|
3555
|
-
title: `
|
3698
|
+
title: `Select ${docType.title}`,
|
3556
3699
|
data: {
|
3557
|
-
|
3558
|
-
},
|
3559
|
-
});
|
3560
|
-
if (result.data?.result) {
|
3561
|
-
return castArray(result.data.items);
|
3562
|
-
}
|
3563
|
-
return [];
|
3564
|
-
}
|
3565
|
-
async downloadFile(node) {
|
3566
|
-
// const file = await this.documentService.getOne(node.id);
|
3567
|
-
if (node.fileId) {
|
3568
|
-
if (node.fileId.startsWith('http')) {
|
3569
|
-
const link = document.createElement('a');
|
3570
|
-
link.href = node.fileId;
|
3571
|
-
link.download = node.name;
|
3572
|
-
document.body.appendChild(link);
|
3573
|
-
link.click();
|
3574
|
-
document.body.removeChild(link);
|
3575
|
-
return;
|
3576
|
-
}
|
3577
|
-
const fileInfo = await this.fileService.getInfo(node.fileId);
|
3578
|
-
const link = document.createElement('a');
|
3579
|
-
link.href = fileInfo.url ?? '';
|
3580
|
-
link.download = node.name; // Set the desired file name
|
3581
|
-
document.body.appendChild(link);
|
3582
|
-
link.click();
|
3583
|
-
document.body.removeChild(link);
|
3584
|
-
}
|
3585
|
-
else {
|
3586
|
-
console.log('id is null');
|
3587
|
-
}
|
3588
|
-
}
|
3589
|
-
/**
|
3590
|
-
* Creates a copy of a node (file or folder)
|
3591
|
-
* @param node The node to copy
|
3592
|
-
* @returns The newly created copied node
|
3593
|
-
*/
|
3594
|
-
async copy(node) {
|
3595
|
-
if (!node) {
|
3596
|
-
throw new Error('Node to copy cannot be null or undefined');
|
3597
|
-
}
|
3598
|
-
// Create a name with " copy" before the extension
|
3599
|
-
const newName = this.createCopyName(node.name);
|
3600
|
-
if (node.type === 'file') {
|
3601
|
-
// Get the original file to copy all its data
|
3602
|
-
const originalFile = await this.documentService.getOne(node.id);
|
3603
|
-
if (!originalFile) {
|
3604
|
-
throw new Error(`File with ID ${node.id} not found`);
|
3605
|
-
}
|
3606
|
-
// Create a document model from the original with the new name
|
3607
|
-
// Extract needed properties without id
|
3608
|
-
const { id, ...fileDataWithoutId } = originalFile;
|
3609
|
-
const fileData = {
|
3610
|
-
...fileDataWithoutId,
|
3611
|
-
name: newName,
|
3612
|
-
title: newName,
|
3613
|
-
};
|
3614
|
-
// Create the new file
|
3615
|
-
return await this.createFile(fileData);
|
3616
|
-
}
|
3617
|
-
else if (node.type === 'folder') {
|
3618
|
-
// Get the original folder to copy all its data
|
3619
|
-
const originalFolder = await this.folderService.getOne(node.id);
|
3620
|
-
if (!originalFolder) {
|
3621
|
-
throw new Error(`Folder with ID ${node.id} not found`);
|
3622
|
-
}
|
3623
|
-
// Create a folder model from the original with the new name
|
3624
|
-
// Extract needed properties without id
|
3625
|
-
const { id, ...folderDataWithoutId } = originalFolder;
|
3626
|
-
const folderData = {
|
3627
|
-
...folderDataWithoutId,
|
3628
|
-
name: newName,
|
3629
|
-
};
|
3630
|
-
// Create the new folder
|
3631
|
-
return await this.createFolder(folderData);
|
3632
|
-
}
|
3633
|
-
else {
|
3634
|
-
throw new Error(`Unsupported node type: ${node.type}`);
|
3635
|
-
}
|
3636
|
-
}
|
3637
|
-
/**
|
3638
|
-
* Creates a copy name by adding " copy" before the extension
|
3639
|
-
* @param originalName The original filename
|
3640
|
-
* @returns The new filename with " copy" added before the extension
|
3641
|
-
*/
|
3642
|
-
createCopyName(originalName) {
|
3643
|
-
const lastDotIndex = originalName.lastIndexOf('.');
|
3644
|
-
if (lastDotIndex === -1) {
|
3645
|
-
// No extension
|
3646
|
-
return `${originalName} copy`;
|
3647
|
-
}
|
3648
|
-
const nameWithoutExt = originalName.substring(0, lastDotIndex);
|
3649
|
-
const extension = originalName.substring(lastDotIndex);
|
3650
|
-
return `${nameWithoutExt} copy${extension}`;
|
3651
|
-
}
|
3652
|
-
async uploadFileByType(folderId, docTypeId) {
|
3653
|
-
const folder = await this.folderService.getOne(folderId);
|
3654
|
-
var docType = folder.documentTypes?.find((dt) => dt.id === docTypeId);
|
3655
|
-
if (folder && docType != null) {
|
3656
|
-
const comp = (await Promise.resolve().then(function () { return index; })).AXMDocumentTypeChooseFileComponent;
|
3657
|
-
const result = await this.popupService.open(comp, {
|
3658
|
-
title: `Select ${docType.title}`,
|
3659
|
-
data: {
|
3660
|
-
documentType: docType,
|
3661
|
-
},
|
3662
|
-
});
|
3663
|
-
if (result.data != null) {
|
3664
|
-
const { uploads, ...metaContext } = result.data.context;
|
3665
|
-
for (const u of uploads) {
|
3666
|
-
const fileInfo = u;
|
3667
|
-
const f = await this.fileService.save({
|
3668
|
-
category: 'document',
|
3669
|
-
file: fileInfo,
|
3670
|
-
refId: folderId,
|
3671
|
-
refType: `${RootConfig.module.name}.${RootConfig.entities.folder.name}`,
|
3672
|
-
name: fileInfo.name ?? '',
|
3673
|
-
});
|
3674
|
-
await this.fileService.commit(f.fileId);
|
3675
|
-
const file = await this.documentService.insertOne({
|
3676
|
-
fileId: f.fileId,
|
3677
|
-
meta: metaContext,
|
3678
|
-
parentId: folderId,
|
3679
|
-
size: fileInfo.size,
|
3680
|
-
name: fileInfo.name ?? '',
|
3681
|
-
title: fileInfo.name ?? '',
|
3682
|
-
});
|
3683
|
-
}
|
3684
|
-
return true;
|
3685
|
-
}
|
3686
|
-
else {
|
3687
|
-
return false;
|
3688
|
-
}
|
3689
|
-
}
|
3690
|
-
return false;
|
3691
|
-
}
|
3692
|
-
async uploadFileVirtualByType(docType) {
|
3693
|
-
const comp = (await Promise.resolve().then(function () { return index; })).AXMDocumentTypeChooseFileComponent;
|
3694
|
-
const result = await this.popupService.open(comp, {
|
3695
|
-
title: `Select ${docType.title}`,
|
3696
|
-
data: {
|
3697
|
-
documentType: docType,
|
3700
|
+
documentType: docType,
|
3698
3701
|
},
|
3699
3702
|
});
|
3700
3703
|
const resultData = [];
|
@@ -3728,947 +3731,308 @@ class AXMDocumentManagerService {
|
|
3728
3731
|
return [];
|
3729
3732
|
}
|
3730
3733
|
}
|
3731
|
-
|
3732
|
-
|
3733
|
-
|
3734
|
-
|
3735
|
-
|
3736
|
-
|
3737
|
-
|
3738
|
-
|
3739
|
-
|
3740
|
-
|
3741
|
-
|
3742
|
-
|
3743
|
-
|
3744
|
-
|
3745
|
-
|
3746
|
-
}
|
3747
|
-
validateScopeOptions() {
|
3748
|
-
switch (this.scope) {
|
3749
|
-
case AXPPlatformScope.Tenant:
|
3750
|
-
if (!this.options?.tenantId) {
|
3751
|
-
throw new Error('Tenant ID is required for tenant scope');
|
3752
|
-
}
|
3753
|
-
break;
|
3754
|
-
case AXPPlatformScope.User:
|
3755
|
-
if (!this.options?.tenantId || !this.options?.userId) {
|
3756
|
-
throw new Error('Both Tenant ID and User ID are required for user scope');
|
3757
|
-
}
|
3758
|
-
break;
|
3734
|
+
//#endregion
|
3735
|
+
//#region ---- Dialog Operations ----
|
3736
|
+
/**
|
3737
|
+
* Shows share dialog for a node
|
3738
|
+
*/
|
3739
|
+
async showShareDialog(node) {
|
3740
|
+
const comp = (await import('./acorex-modules-document-management-share-dialog.component-Diof2rpe.mjs')).AXMShareDialogComponent;
|
3741
|
+
const popup = await this.popupService.open(comp, {
|
3742
|
+
title: 'Share',
|
3743
|
+
data: {
|
3744
|
+
node,
|
3745
|
+
},
|
3746
|
+
});
|
3747
|
+
if (popup.data?.result) {
|
3748
|
+
// Handle the share action with popup.data.data
|
3759
3749
|
}
|
3760
3750
|
}
|
3761
|
-
|
3762
|
-
|
3763
|
-
|
3764
|
-
async
|
3765
|
-
|
3766
|
-
|
3767
|
-
|
3768
|
-
|
3769
|
-
|
3770
|
-
|
3771
|
-
|
3772
|
-
};
|
3773
|
-
|
3774
|
-
|
3775
|
-
|
3776
|
-
return this.parent.updateFolder(folderId, data);
|
3777
|
-
}
|
3778
|
-
async deleteFolder(folderId) {
|
3779
|
-
return this.parent.deleteFolder(folderId);
|
3780
|
-
}
|
3781
|
-
async getAvailableSpace() {
|
3782
|
-
return this.parent.getAvailableSpace();
|
3783
|
-
}
|
3784
|
-
async searchFolders(searchTerm) {
|
3785
|
-
this.validateScopeOptions();
|
3786
|
-
return this.parent.searchFolders(searchTerm, this.scope, this.options);
|
3787
|
-
}
|
3788
|
-
async searchFiles(searchTerm) {
|
3789
|
-
this.validateScopeOptions();
|
3790
|
-
return this.parent.searchFiles(searchTerm, this.scope, this.options);
|
3751
|
+
/**
|
3752
|
+
* Shows share via email dialog for a node
|
3753
|
+
*/
|
3754
|
+
async showShareWithEmailDialog(node) {
|
3755
|
+
const comp = (await import('./acorex-modules-document-management-share-email-dialog.component-Bj6G6aqt.mjs'))
|
3756
|
+
.AXMShareEmailDialogComponent;
|
3757
|
+
const popup = await this.popupService.open(comp, {
|
3758
|
+
title: 'Share via Email',
|
3759
|
+
data: {
|
3760
|
+
node,
|
3761
|
+
},
|
3762
|
+
});
|
3763
|
+
if (popup.data?.result) {
|
3764
|
+
// Handle the share via email action with popup.data.data
|
3765
|
+
}
|
3791
3766
|
}
|
3792
|
-
|
3793
|
-
|
3794
|
-
|
3767
|
+
/**
|
3768
|
+
* Shows link dialog for a node
|
3769
|
+
*/
|
3770
|
+
async showLinkDialog(node) {
|
3771
|
+
const comp = (await import('./acorex-modules-document-management-link-dialog.component-DKbO2nX8.mjs')).AXMLinkDialogComponent;
|
3772
|
+
const popup = await this.popupService.open(comp, {
|
3773
|
+
title: 'Share Link',
|
3774
|
+
data: {
|
3775
|
+
node,
|
3776
|
+
},
|
3777
|
+
});
|
3778
|
+
if (popup.data?.result) {
|
3779
|
+
// Handle the link generation with popup.data.data
|
3780
|
+
}
|
3795
3781
|
}
|
3796
3782
|
/**
|
3797
|
-
*
|
3798
|
-
* @param node The node to copy
|
3799
|
-
* @returns The newly created copied node
|
3783
|
+
* Shows lock dialog for a document
|
3800
3784
|
*/
|
3801
|
-
async
|
3802
|
-
|
3803
|
-
|
3785
|
+
async showLockDialog(node) {
|
3786
|
+
const comp = (await import('./acorex-modules-document-management-lock-dialog.component-By36woOc.mjs')).AXMLockDialogComponent;
|
3787
|
+
const popup = await this.popupService.open(comp, {
|
3788
|
+
title: 'Lock Document',
|
3789
|
+
data: {
|
3790
|
+
node,
|
3791
|
+
},
|
3792
|
+
});
|
3793
|
+
if (popup.data?.result) {
|
3794
|
+
// Handle the lock action with popup.data.data
|
3795
|
+
}
|
3804
3796
|
}
|
3805
|
-
|
3806
|
-
|
3807
|
-
|
3808
|
-
|
3809
|
-
|
3810
|
-
|
3811
|
-
|
3812
|
-
|
3813
|
-
|
3814
|
-
const AXPDocumentExplorerViewModel = signalStore({ providedIn: 'root' }, withState(() => ({
|
3815
|
-
// View State
|
3816
|
-
viewMode: 'large-tiles',
|
3817
|
-
isLoading: false,
|
3818
|
-
scope: AXPPlatformScope.User,
|
3819
|
-
// Navigation State
|
3820
|
-
currentPath: [],
|
3821
|
-
currentNode: null,
|
3822
|
-
loadingFolderId: null,
|
3823
|
-
navigatingFolderId: null,
|
3824
|
-
backHistory: [],
|
3825
|
-
// Selection State
|
3826
|
-
selectionMode: 'none',
|
3827
|
-
selectedNodes: [],
|
3828
|
-
// Browse State
|
3829
|
-
browseMode: 'file',
|
3830
|
-
// Sort State
|
3831
|
-
sortField: 'name',
|
3832
|
-
sortDirection: 'asc',
|
3833
|
-
// Content State
|
3834
|
-
folders: [],
|
3835
|
-
files: [],
|
3836
|
-
itemsCount: 0,
|
3837
|
-
availableSpace: 0,
|
3838
|
-
// Drive State
|
3839
|
-
currentDrive: null,
|
3840
|
-
// File Type State
|
3841
|
-
fileTypes: [],
|
3842
|
-
// Detail Panel State
|
3843
|
-
detailPanel: false,
|
3844
|
-
})), withComputed((store) => ({
|
3845
|
-
isRoot: computed(() => {
|
3846
|
-
const path = store.currentPath();
|
3847
|
-
return path.length === 1;
|
3848
|
-
}),
|
3849
|
-
isVirtual: computed(() => {
|
3850
|
-
const node = store.currentNode();
|
3851
|
-
return node?.storageType === 'virtual';
|
3852
|
-
}),
|
3853
|
-
currentFolder: computed(() => store.currentNode()),
|
3854
|
-
currentFolderContents: computed(() => ({
|
3855
|
-
folders: store.folders(),
|
3856
|
-
files: store.files(),
|
3857
|
-
})),
|
3858
|
-
isLargeTilesView: computed(() => store.viewMode() === 'large-tiles'),
|
3859
|
-
isSmallTilesView: computed(() => store.viewMode() === 'small-tiles'),
|
3860
|
-
isListView: computed(() => store.viewMode() === 'list'),
|
3861
|
-
isDetailsView: computed(() => store.viewMode() === 'details'),
|
3862
|
-
isLargeIconsView: computed(() => store.viewMode() === 'large-icons'),
|
3863
|
-
isSmallIconsView: computed(() => store.viewMode() === 'small-icons'),
|
3864
|
-
isBackAvailable: computed(() => store.backHistory().length > 0),
|
3865
|
-
isUpAvailable: computed(() => {
|
3866
|
-
const node = store.currentNode();
|
3867
|
-
return node?.parentId != null;
|
3868
|
-
}),
|
3869
|
-
selectedCount: computed(() => store.selectedNodes().length),
|
3870
|
-
hasSelectedItems: computed(() => store.selectedNodes().length > 0),
|
3871
|
-
hasMultipleSelectedItems: computed(() => store.selectedNodes().length > 1),
|
3872
|
-
isMultiSelect: computed(() => store.selectionMode() === 'multiple'),
|
3873
|
-
selectedNode: computed(() => store.selectedNodes()[0] ?? null),
|
3874
|
-
isDetailPanelOpen: computed(() => store.detailPanel()),
|
3875
|
-
})), withMethods((store, fileTypeService = inject(AXPFileTypeProviderService), documentTypeService = inject(AXMDocumentTypeService), driveService = inject(AXMDocumentManagerService), settingService = inject(AXPSettingService), sessionService = inject(AXPSessionService), translateService = inject(AXTranslationService)) => ({
|
3876
|
-
async initialize(options) {
|
3877
|
-
// Load file types
|
3878
|
-
const fileTypes = await fileTypeService.items();
|
3879
|
-
patchState(store, { fileTypes });
|
3880
|
-
// Load initial settings
|
3881
|
-
const viewMode = await settingService
|
3882
|
-
.scope(options?.scope || AXPPlatformScope.User)
|
3883
|
-
.get(AXPDocumentExplorerSettings.ViewMode);
|
3884
|
-
const sortField = await settingService
|
3885
|
-
.scope(options?.scope || AXPPlatformScope.User)
|
3886
|
-
.get(AXPDocumentExplorerSettings.SortField);
|
3887
|
-
const sortDirection = await settingService
|
3888
|
-
.scope(options?.scope || AXPPlatformScope.User)
|
3889
|
-
.get(AXPDocumentExplorerSettings.SortDirection);
|
3890
|
-
patchState(store, {
|
3891
|
-
viewMode: viewMode || 'list',
|
3892
|
-
sortField: sortField || 'name',
|
3893
|
-
sortDirection: sortDirection || 'asc',
|
3894
|
-
browseMode: options?.browseMode || 'file',
|
3895
|
-
scope: options?.scope || AXPPlatformScope.User,
|
3896
|
-
});
|
3897
|
-
},
|
3898
|
-
_load: async (folderId) => {
|
3899
|
-
patchState(store, { loadingFolderId: folderId, isLoading: true });
|
3900
|
-
await new Promise((resolve) => setTimeout(resolve, 100));
|
3901
|
-
try {
|
3902
|
-
const node = await driveService.getFolder(store.scope(), folderId, {
|
3903
|
-
tenantId: sessionService.tenant?.id,
|
3904
|
-
userId: sessionService.user?.id,
|
3905
|
-
});
|
3906
|
-
patchState(store, {
|
3907
|
-
currentNode: node.result,
|
3908
|
-
currentPath: node.path,
|
3909
|
-
folders: node.result.children?.filter((item) => item.type === 'folder') || [],
|
3910
|
-
files: node.result.children?.filter((item) => store.browseMode() == 'file' && item.type === 'file') || [],
|
3911
|
-
itemsCount: node.result.children?.length || 0,
|
3912
|
-
availableSpace: await driveService.getAvailableSpace(),
|
3913
|
-
loadingFolderId: null,
|
3914
|
-
isLoading: false,
|
3915
|
-
navigatingFolderId: null,
|
3916
|
-
});
|
3917
|
-
}
|
3918
|
-
catch (error) {
|
3919
|
-
patchState(store, {
|
3920
|
-
loadingFolderId: null,
|
3921
|
-
isLoading: false,
|
3922
|
-
});
|
3923
|
-
throw error;
|
3924
|
-
}
|
3925
|
-
},
|
3926
|
-
navigateToFolder(folderId) {
|
3927
|
-
const currentNode = store.currentNode();
|
3928
|
-
if (currentNode) {
|
3929
|
-
patchState(store, {
|
3930
|
-
backHistory: [...store.backHistory(), { folderId: currentNode.id, path: store.currentPath() }],
|
3931
|
-
});
|
3932
|
-
}
|
3933
|
-
patchState(store, { navigatingFolderId: folderId });
|
3934
|
-
},
|
3935
|
-
async loadFolderContents(folderId) {
|
3936
|
-
await this._load(folderId);
|
3937
|
-
this.deselectAll();
|
3938
|
-
},
|
3939
|
-
async virtualFolder(files = []) {
|
3940
|
-
const id = 'virtual';
|
3941
|
-
patchState(store, {
|
3942
|
-
loadingFolderId: id,
|
3943
|
-
isLoading: true,
|
3944
|
-
});
|
3945
|
-
await new Promise((resolve) => setTimeout(resolve, 100));
|
3946
|
-
const node = {
|
3947
|
-
id: id,
|
3948
|
-
name: 'virtual',
|
3949
|
-
type: 'folder',
|
3950
|
-
children: files,
|
3951
|
-
parentId: null,
|
3952
|
-
size: 0,
|
3953
|
-
storageType: 'virtual',
|
3954
|
-
};
|
3955
|
-
patchState(store, {
|
3956
|
-
currentNode: node,
|
3957
|
-
currentPath: [],
|
3958
|
-
folders: [],
|
3959
|
-
files: files,
|
3960
|
-
itemsCount: node.children?.length || 0,
|
3961
|
-
availableSpace: await driveService.getAvailableSpace(),
|
3962
|
-
loadingFolderId: null,
|
3963
|
-
isLoading: false,
|
3964
|
-
navigatingFolderId: null,
|
3965
|
-
});
|
3966
|
-
},
|
3967
|
-
setViewMode(mode) {
|
3968
|
-
patchState(store, { viewMode: mode });
|
3969
|
-
settingService.scope(AXPPlatformScope.User).set(AXPDocumentExplorerSettings.ViewMode, mode);
|
3970
|
-
},
|
3971
|
-
isViewMode(mode) {
|
3972
|
-
return store.viewMode() === mode;
|
3973
|
-
},
|
3974
|
-
setSortField(field) {
|
3975
|
-
patchState(store, { sortField: field });
|
3976
|
-
settingService.scope(AXPPlatformScope.User).set(AXPDocumentExplorerSettings.SortField, field);
|
3977
|
-
},
|
3978
|
-
setSortDirection(direction) {
|
3979
|
-
patchState(store, { sortDirection: direction });
|
3980
|
-
settingService.scope(AXPPlatformScope.User).set(AXPDocumentExplorerSettings.SortDirection, direction);
|
3981
|
-
},
|
3982
|
-
setSelectionMode(mode) {
|
3983
|
-
patchState(store, { selectionMode: mode });
|
3984
|
-
},
|
3985
|
-
setDrive(scope) {
|
3986
|
-
patchState(store, { currentDrive: scope });
|
3987
|
-
},
|
3988
|
-
isLoadingFolder(folderId) {
|
3989
|
-
return store.loadingFolderId() === folderId;
|
3990
|
-
},
|
3991
|
-
getFileInfo(fileName) {
|
3992
|
-
const fileTypes = store.fileTypes();
|
3993
|
-
const extension = fileName.split('.').pop()?.toLowerCase() || '';
|
3994
|
-
const extensions = fileTypes.flatMap((type) => type.extensions);
|
3995
|
-
const fileType = extensions.find((e) => e.name === extension);
|
3996
|
-
return {
|
3997
|
-
icon: fileType?.icon || 'fa-light fa-file',
|
3998
|
-
type: fileType?.name || 'Unknown',
|
3999
|
-
};
|
4000
|
-
},
|
4001
|
-
getNodeInfo(node) {
|
4002
|
-
// If no node, return a default object
|
4003
|
-
if (!node) {
|
4004
|
-
return {
|
4005
|
-
name: '---',
|
4006
|
-
icon: 'fa-light fa-folder',
|
4007
|
-
type: 'Folder',
|
4008
|
-
sections: [
|
4009
|
-
{
|
4010
|
-
title: 'Details',
|
4011
|
-
details: [],
|
4012
|
-
},
|
4013
|
-
],
|
4014
|
-
};
|
4015
|
-
}
|
4016
|
-
// If the node is a file, return the file info
|
4017
|
-
if (node.type === 'file') {
|
4018
|
-
const fileTypes = store.fileTypes();
|
4019
|
-
const extension = node.name.split('.').pop()?.toLowerCase() || '';
|
4020
|
-
const extensions = fileTypes.flatMap((type) => type.extensions);
|
4021
|
-
const fileType = extensions.find((e) => e.name === extension);
|
4022
|
-
return {
|
4023
|
-
name: node.name,
|
4024
|
-
icon: fileType?.icon || 'fa-light fa-file',
|
4025
|
-
type: 'File',
|
4026
|
-
sections: [
|
4027
|
-
{
|
4028
|
-
title: 'Details',
|
4029
|
-
details: [
|
4030
|
-
{
|
4031
|
-
title: 'Description',
|
4032
|
-
content: node.description,
|
4033
|
-
icon: 'fa-solid fa-file-lines',
|
4034
|
-
},
|
4035
|
-
{
|
4036
|
-
title: 'Size',
|
4037
|
-
content: node.size || 0,
|
4038
|
-
format: 'filesize',
|
4039
|
-
icon: 'fa-solid fa-file-lines',
|
4040
|
-
},
|
4041
|
-
{
|
4042
|
-
title: 'Created at',
|
4043
|
-
content: node.createdAt || new Date(),
|
4044
|
-
format: 'datetime',
|
4045
|
-
icon: 'fa-solid fa-calendar-days',
|
4046
|
-
},
|
4047
|
-
{
|
4048
|
-
title: 'Modified at',
|
4049
|
-
content: node.modifiedAt || new Date(),
|
4050
|
-
format: 'datetime',
|
4051
|
-
icon: 'fa-solid fa-calendar-days',
|
4052
|
-
},
|
4053
|
-
],
|
4054
|
-
},
|
4055
|
-
],
|
4056
|
-
};
|
4057
|
-
}
|
4058
|
-
// If the node is a folder, return the folder info
|
4059
|
-
else {
|
4060
|
-
return {
|
4061
|
-
name: node.name,
|
4062
|
-
icon: 'fa-light fa-folder ax-text-yellow-500',
|
4063
|
-
type: 'Folder',
|
4064
|
-
sections: [
|
4065
|
-
{
|
4066
|
-
title: 'Details',
|
4067
|
-
details: [
|
4068
|
-
{
|
4069
|
-
title: 'Description',
|
4070
|
-
content: node.description,
|
4071
|
-
icon: 'fa-solid fa-file-lines',
|
4072
|
-
},
|
4073
|
-
{
|
4074
|
-
title: 'Items',
|
4075
|
-
content: node.childrenCount,
|
4076
|
-
icon: 'fa-solid fa-file-lines',
|
4077
|
-
},
|
4078
|
-
{
|
4079
|
-
title: 'Size',
|
4080
|
-
content: node.size || 0,
|
4081
|
-
format: 'filesize',
|
4082
|
-
icon: 'fa-solid fa-file-lines',
|
4083
|
-
},
|
4084
|
-
{
|
4085
|
-
title: 'Created at',
|
4086
|
-
content: node.createdAt || new Date(),
|
4087
|
-
format: 'datetime',
|
4088
|
-
icon: 'fa-solid fa-calendar-days',
|
4089
|
-
},
|
4090
|
-
{
|
4091
|
-
title: 'Modified at',
|
4092
|
-
content: node.modifiedAt || new Date(),
|
4093
|
-
format: 'datetime',
|
4094
|
-
icon: 'fa-solid fa-calendar-days',
|
4095
|
-
},
|
4096
|
-
],
|
4097
|
-
},
|
4098
|
-
],
|
4099
|
-
};
|
4100
|
-
}
|
4101
|
-
},
|
4102
|
-
sortItems(items) {
|
4103
|
-
const field = store.sortField();
|
4104
|
-
const direction = store.sortDirection();
|
4105
|
-
return [...items].sort((a, b) => {
|
4106
|
-
let comparison = 0;
|
4107
|
-
switch (field) {
|
4108
|
-
case 'name':
|
4109
|
-
comparison = a.name.localeCompare(b.name);
|
4110
|
-
break;
|
4111
|
-
case 'modified':
|
4112
|
-
const aDate = a.modifiedAt ? new Date(a.modifiedAt) : new Date(0);
|
4113
|
-
const bDate = b.modifiedAt ? new Date(b.modifiedAt) : new Date(0);
|
4114
|
-
comparison = aDate.getTime() - bDate.getTime();
|
4115
|
-
break;
|
4116
|
-
case 'size':
|
4117
|
-
comparison = (a.size || 0) - (b.size || 0);
|
4118
|
-
break;
|
4119
|
-
}
|
4120
|
-
return direction === 'asc' ? comparison : -comparison;
|
4121
|
-
});
|
4122
|
-
},
|
4123
|
-
async refresh() {
|
4124
|
-
if (!store.isVirtual()) {
|
4125
|
-
const currentFolder = store.currentNode();
|
4126
|
-
if (currentFolder) {
|
4127
|
-
await this._load(currentFolder.id);
|
4128
|
-
}
|
4129
|
-
}
|
4130
|
-
else {
|
4131
|
-
patchState(store, { loadingFolderId: 'fake' });
|
4132
|
-
patchState(store, { loadingFolderId: null });
|
4133
|
-
}
|
4134
|
-
},
|
4135
|
-
navigateToUp() {
|
4136
|
-
const currentNode = store.currentNode();
|
4137
|
-
const parentId = currentNode?.parentId;
|
4138
|
-
if (parentId && currentNode) {
|
4139
|
-
patchState(store, {
|
4140
|
-
backHistory: [...store.backHistory(), { folderId: currentNode.id, path: store.currentPath() }],
|
4141
|
-
});
|
4142
|
-
patchState(store, { navigatingFolderId: parentId });
|
4143
|
-
this.loadFolderContents(parentId);
|
4144
|
-
}
|
4145
|
-
},
|
4146
|
-
async navigateBack() {
|
4147
|
-
const history = store.backHistory();
|
4148
|
-
if (history.length === 0) {
|
4149
|
-
return;
|
4150
|
-
}
|
4151
|
-
const lastEntry = history[history.length - 1];
|
4152
|
-
patchState(store, { backHistory: history.slice(0, history.length - 1) });
|
4153
|
-
patchState(store, { navigatingFolderId: lastEntry.folderId });
|
4154
|
-
await this.loadFolderContents(lastEntry.folderId);
|
4155
|
-
},
|
4156
|
-
async openFile(file) {
|
4157
|
-
await driveService.openFile(file);
|
4158
|
-
},
|
4159
|
-
//TODO: Delete only one node at a time
|
4160
|
-
async deleteNodes(nodes = store.selectedNodes()) {
|
4161
|
-
if (store.isVirtual()) {
|
4162
|
-
patchState(store, {
|
4163
|
-
files: store.currentFolderContents().files.filter((file) => !nodes.some((node) => node.name === file.name)),
|
4164
|
-
});
|
4165
|
-
this.deselectAll();
|
4166
|
-
}
|
4167
|
-
else {
|
4168
|
-
const result = await driveService.showDeleteNodesDialog(nodes);
|
4169
|
-
if (result) {
|
4170
|
-
this.deselectAll();
|
4171
|
-
await this.refresh();
|
4172
|
-
}
|
4173
|
-
}
|
4174
|
-
},
|
4175
|
-
toggleSelect(node) {
|
4176
|
-
if (store.selectionMode() === 'multiple') {
|
4177
|
-
patchState(store, {
|
4178
|
-
selectedNodes: store.selectedNodes().includes(node)
|
4179
|
-
? store.selectedNodes().filter((n) => n.id !== node.id)
|
4180
|
-
: [...store.selectedNodes(), node],
|
4181
|
-
});
|
4182
|
-
}
|
4183
|
-
else {
|
4184
|
-
patchState(store, { selectedNodes: [node] });
|
4185
|
-
}
|
4186
|
-
},
|
4187
|
-
isItemSelected(node) {
|
4188
|
-
return store.selectedNodes().some((selectedNode) => selectedNode.id === node.id);
|
4189
|
-
},
|
4190
|
-
selectAll() {
|
4191
|
-
patchState(store, { selectedNodes: [...store.folders(), ...store.files()] });
|
4192
|
-
},
|
4193
|
-
deselectAll() {
|
4194
|
-
patchState(store, { selectedNodes: [] });
|
4195
|
-
},
|
4196
|
-
openDetailPanel() {
|
4197
|
-
patchState(store, { detailPanel: true });
|
4198
|
-
},
|
4199
|
-
closeDetailPanel() {
|
4200
|
-
patchState(store, { detailPanel: false });
|
4201
|
-
},
|
4202
|
-
toggleDetailPanel() {
|
4203
|
-
patchState(store, { detailPanel: !store.detailPanel() });
|
4204
|
-
},
|
4205
|
-
//#region Menu Items
|
4206
|
-
async getFolderAddMenuItems() {
|
4207
|
-
const scope = RootConfig.config.i18n;
|
4208
|
-
return [
|
4209
|
-
{
|
4210
|
-
title: await translateService.translateAsync('actions.create-folder', { scope }),
|
4211
|
-
icon: 'fa-light fa-folder-plus',
|
4212
|
-
break: true,
|
4213
|
-
command: {
|
4214
|
-
name: 'new-folder',
|
4215
|
-
options: {
|
4216
|
-
folderId: store.currentFolder()?.id,
|
4217
|
-
},
|
4218
|
-
},
|
4219
|
-
},
|
4220
|
-
...(store.currentFolder()?.documentTypes?.map((type) => ({
|
4221
|
-
title: type.title,
|
4222
|
-
//icon: type.icon,
|
4223
|
-
icon: 'fa-light fa-file-arrow-up',
|
4224
|
-
break: true,
|
4225
|
-
command: {
|
4226
|
-
name: `upload.${type.name}`,
|
4227
|
-
options: {
|
4228
|
-
folderId: store.currentFolder()?.id,
|
4229
|
-
documentType: type,
|
4230
|
-
},
|
4231
|
-
},
|
4232
|
-
})) ?? []),
|
4233
|
-
{
|
4234
|
-
title: await translateService.translateAsync('actions.open-gallery', { scope }),
|
4235
|
-
icon: 'fa-light fa-images',
|
4236
|
-
break: true,
|
4237
|
-
command: {
|
4238
|
-
name: 'open-gallery',
|
4239
|
-
options: {
|
4240
|
-
folderId: store.currentFolder()?.id,
|
4241
|
-
},
|
4242
|
-
},
|
4243
|
-
},
|
4244
|
-
];
|
4245
|
-
},
|
4246
|
-
async getFolderActionMenuItems() {
|
4247
|
-
return [
|
4248
|
-
{
|
4249
|
-
name: 'refresh',
|
4250
|
-
title: await translateService.translateAsync('refresh'),
|
4251
|
-
icon: 'fa-light fa-rotate-right',
|
4252
|
-
// break: true,
|
4253
|
-
},
|
4254
|
-
// {
|
4255
|
-
// name: 'delete',
|
4256
|
-
// title: await translateService.translateAsync('delete'),
|
4257
|
-
// color: 'danger',
|
4258
|
-
// icon: 'fa-light fa-trash',
|
4259
|
-
// },
|
4260
|
-
];
|
4261
|
-
},
|
4262
|
-
//#endregion
|
4263
|
-
//#region Context Menu Items
|
4264
|
-
async getContextMenuItems() {
|
4265
|
-
return [...(await this.getFolderAddMenuItems()), ...(await this.getFolderActionMenuItems())];
|
4266
|
-
},
|
4267
|
-
//#endregion
|
4268
|
-
})));
|
4269
|
-
|
4270
|
-
class AXMDocumentExplorerComponent {
|
4271
|
-
constructor() {
|
4272
|
-
this.vm = inject(AXPDocumentExplorerViewModel);
|
4273
|
-
this.contextMenu = viewChild('itemsContextMenu');
|
4274
|
-
this.rootContextMenu = viewChild('rootContextMenu');
|
4275
|
-
this.driveService = inject(AXMDocumentManagerService);
|
4276
|
-
this.translateService = inject(AXTranslationService);
|
4277
|
-
this.layout = inject(AXPLayoutThemeService);
|
4278
|
-
this.browseMode = input('file');
|
4279
|
-
this.viewMode = input();
|
4280
|
-
this.selectionMode = input('none');
|
4281
|
-
this.showContextMenu = input(true);
|
4282
|
-
this.view = signal(null);
|
4283
|
-
this.viewMap = {
|
4284
|
-
list: async () => (await import('./acorex-modules-document-management-list-view.component-C1inszTC.mjs')).AXMDocumentExplorerListViewComponent,
|
4285
|
-
'small-tiles': async () => (await import('./acorex-modules-document-management-small-tiles-view.component-CumumWvO.mjs')).AXMDocumentExplorerSmallTilesViewComponent,
|
4286
|
-
'large-tiles': async () => (await import('./acorex-modules-document-management-large-tiles-view.component-0GpMVYv5.mjs')).AXMDocumentExplorerLargeTilesViewComponent,
|
4287
|
-
details: async () => (await import('./acorex-modules-document-management-details-view.component-D0RIYrHB.mjs')).AXMDocumentExplorerDetailsViewComponent,
|
4288
|
-
'large-icons': async () => (await import('./acorex-modules-document-management-large-icons-view.component-C686Ec7s.mjs')).AXMDocumentExplorerLargeIconsViewComponent,
|
4289
|
-
'small-icons': async () => (await import('./acorex-modules-document-management-small-icons-view.component-BGcUzNCv.mjs')).AXMDocumentExplorerSmallIconsViewComponent,
|
4290
|
-
'attachment': async () => (await import('./acorex-modules-document-management-attachment-widget.component-DIF_t4fE.mjs')).AXMDocumentExplorerAttachmentComponent,
|
4291
|
-
};
|
4292
|
-
this.#effect = effect(() => {
|
4293
|
-
if (this.vm.loadingFolderId() == null) {
|
4294
|
-
setTimeout(() => {
|
4295
|
-
this.contextMenu()?.refresh();
|
4296
|
-
this.rootContextMenu()?.refresh();
|
4297
|
-
}, 300);
|
4298
|
-
}
|
4299
|
-
});
|
4300
|
-
this.#effect2 = effect(() => {
|
4301
|
-
if (this.viewMode()) {
|
4302
|
-
this.vm.setViewMode(this.viewMode());
|
4303
|
-
}
|
4304
|
-
if (this.selectionMode()) {
|
4305
|
-
this.vm.setSelectionMode(this.selectionMode());
|
4306
|
-
}
|
4307
|
-
});
|
4308
|
-
this.#effect3 = effect(async () => {
|
4309
|
-
const func = get$1(this.viewMap, this.vm.viewMode()) ?? this.viewMap['large-tiles'];
|
4310
|
-
const comp = await func();
|
4311
|
-
this.view.set(comp);
|
4312
|
-
});
|
4313
|
-
}
|
4314
|
-
#effect;
|
4315
|
-
#effect2;
|
4316
|
-
#effect3;
|
4317
|
-
handleNavigateToFolder(folderId) {
|
4318
|
-
this.vm.navigateToFolder(folderId);
|
4319
|
-
}
|
4320
|
-
//#region Menu and Context Menu
|
4321
|
-
async handleContextMenuOnOpening(e) {
|
4322
|
-
const node = get$1(e.targetElement, '__data__');
|
4323
|
-
if (!node) {
|
4324
|
-
return;
|
4325
|
-
}
|
4326
|
-
const allowedAddItems = node.type === 'folder';
|
4327
|
-
const allowDelete = true;
|
4328
|
-
const isPasteAvailable = true;
|
4329
|
-
const allowPaste = false;
|
4330
|
-
const open = node.type == 'file'
|
4331
|
-
? [
|
4332
|
-
{
|
4333
|
-
name: 'open-file',
|
4334
|
-
text: 'Open',
|
4335
|
-
icon: this.vm.getFileInfo(node.name).icon,
|
4336
|
-
data: node,
|
4337
|
-
},
|
4338
|
-
{
|
4339
|
-
name: 'download',
|
4340
|
-
text: 'Download',
|
4341
|
-
icon: 'fa-light fa-download',
|
4342
|
-
data: node,
|
4343
|
-
},
|
4344
|
-
]
|
4345
|
-
: [
|
4346
|
-
{
|
4347
|
-
name: 'open-folder',
|
4348
|
-
text: 'Open',
|
4349
|
-
icon: 'fa-light fa-folder-open',
|
4350
|
-
data: node,
|
4351
|
-
},
|
4352
|
-
{
|
4353
|
-
name: 'upload-file-33',
|
4354
|
-
text: 'Upload',
|
4355
|
-
icon: 'fa-light fa-file-arrow-up',
|
4356
|
-
break: true,
|
4357
|
-
items: node?.documentTypes?.map((type, index, array) => ({
|
4358
|
-
name: `upload.${type.name}`,
|
4359
|
-
text: type.title,
|
4360
|
-
// icon: type.icon,
|
4361
|
-
icon: 'fa-light fa-file-arrow-up',
|
4362
|
-
break: index !== array.length - 1,
|
4363
|
-
data: {
|
4364
|
-
node,
|
4365
|
-
documentType: type,
|
4366
|
-
},
|
4367
|
-
})) ?? [],
|
4368
|
-
},
|
4369
|
-
];
|
4370
|
-
const info = {
|
4371
|
-
name: node.type == 'file' ? 'file-info' : 'folder-info',
|
4372
|
-
text: 'Information',
|
4373
|
-
icon: 'fa-light fa-circle-info',
|
4374
|
-
items: [
|
4375
|
-
{
|
4376
|
-
name: 'rename',
|
4377
|
-
text: 'Rename',
|
4378
|
-
icon: 'fa-light fa-pencil',
|
4379
|
-
data: node,
|
4380
|
-
},
|
4381
|
-
{
|
4382
|
-
name: 'properties',
|
4383
|
-
text: 'Properties',
|
4384
|
-
icon: 'fa-light fa-memo-circle-info',
|
4385
|
-
break: true,
|
4386
|
-
data: node,
|
4387
|
-
},
|
4388
|
-
{
|
4389
|
-
name: 'lock ',
|
4390
|
-
text: 'Lock',
|
4391
|
-
icon: 'fa-light fa-lock',
|
4392
|
-
data: node,
|
4393
|
-
},
|
4394
|
-
],
|
4395
|
-
break: true,
|
4396
|
-
};
|
4397
|
-
const openWith = {
|
4398
|
-
name: 'open-with',
|
4399
|
-
text: 'Open with',
|
4400
|
-
icon: 'fa-light fa-circle-info',
|
4401
|
-
items: [
|
4402
|
-
{
|
4403
|
-
name: 'open-gallery',
|
4404
|
-
text: 'Gallery',
|
4405
|
-
icon: 'fa-light fa-images',
|
4406
|
-
data: node,
|
4407
|
-
},
|
4408
|
-
],
|
4409
|
-
break: true,
|
4410
|
-
};
|
4411
|
-
e.items = [
|
4412
|
-
...open,
|
4413
|
-
{
|
4414
|
-
name: 'share',
|
4415
|
-
text: 'Share',
|
4416
|
-
icon: 'fa-light fa-share-nodes',
|
4417
|
-
items: [
|
4418
|
-
{
|
4419
|
-
name: 'share',
|
4420
|
-
text: 'Share',
|
4421
|
-
icon: 'fa-light fa-users',
|
4422
|
-
},
|
4423
|
-
{
|
4424
|
-
name: 'share-with-email',
|
4425
|
-
text: 'Share with email',
|
4426
|
-
icon: 'fa-light fa-envelope',
|
4427
|
-
},
|
4428
|
-
{
|
4429
|
-
name: 'link',
|
4430
|
-
text: 'Link',
|
4431
|
-
icon: 'fa-light fa-link',
|
4432
|
-
},
|
4433
|
-
],
|
4434
|
-
break: true,
|
3797
|
+
/**
|
3798
|
+
* Shows unlock dialog for a document
|
3799
|
+
*/
|
3800
|
+
async showUnlockDialog(node) {
|
3801
|
+
const comp = (await import('./acorex-modules-document-management-unlock-dialog.component-CNjFnm2w.mjs')).AXMUnlockDialogComponent;
|
3802
|
+
const popup = await this.popupService.open(comp, {
|
3803
|
+
title: 'Unlock Document',
|
3804
|
+
data: {
|
3805
|
+
node,
|
4435
3806
|
},
|
4436
|
-
|
4437
|
-
|
4438
|
-
|
4439
|
-
|
4440
|
-
|
4441
|
-
|
3807
|
+
});
|
3808
|
+
if (popup.data?.result) {
|
3809
|
+
// Handle the unlock action with popup.data.data
|
3810
|
+
}
|
3811
|
+
}
|
3812
|
+
/**
|
3813
|
+
* Shows folder edit dialog
|
3814
|
+
*/
|
3815
|
+
async showFolderEditDialog(node) {
|
3816
|
+
const comp = (await import('./acorex-modules-document-management-create-folder-dialog.component-ZMvsadWt.mjs'))
|
3817
|
+
.AXMCreateFolderDialog;
|
3818
|
+
const popup = await this.popupService.open(comp, {
|
3819
|
+
title: await this.translate.translateAsync('@document-management:actions.update-folder'),
|
3820
|
+
data: {
|
3821
|
+
defaultValue: node,
|
4442
3822
|
},
|
4443
|
-
|
4444
|
-
|
4445
|
-
|
4446
|
-
|
4447
|
-
|
3823
|
+
});
|
3824
|
+
return popup.data?.result;
|
3825
|
+
}
|
3826
|
+
/**
|
3827
|
+
* Shows create folder dialog
|
3828
|
+
*/
|
3829
|
+
async showCreateFolderDialog(parentId) {
|
3830
|
+
const comp = (await import('./acorex-modules-document-management-create-folder-dialog.component-ZMvsadWt.mjs'))
|
3831
|
+
.AXMCreateFolderDialog;
|
3832
|
+
const popup = await this.popupService.open(comp, {
|
3833
|
+
title: await this.translate.translateAsync('@document-management:actions.create-folder'),
|
3834
|
+
data: {
|
3835
|
+
parentId,
|
4448
3836
|
},
|
4449
|
-
|
4450
|
-
|
4451
|
-
|
4452
|
-
|
4453
|
-
|
4454
|
-
|
3837
|
+
});
|
3838
|
+
return popup.data?.folder;
|
3839
|
+
}
|
3840
|
+
/**
|
3841
|
+
* Shows rename popup for a node
|
3842
|
+
*/
|
3843
|
+
async showRenamePopup(node) {
|
3844
|
+
const comp = (await import('./acorex-modules-document-management-rename-node-dialog.component-CrcJm9jP.mjs'))
|
3845
|
+
.AXMRenameNodeDialog;
|
3846
|
+
const popup = await this.popupService.open(comp, {
|
3847
|
+
title: 't("actions.rename")',
|
3848
|
+
data: {
|
3849
|
+
node,
|
4455
3850
|
},
|
4456
|
-
|
4457
|
-
|
4458
|
-
|
4459
|
-
|
4460
|
-
|
4461
|
-
|
3851
|
+
});
|
3852
|
+
return popup.data?.result;
|
3853
|
+
}
|
3854
|
+
/**
|
3855
|
+
* Shows delete nodes confirmation dialog
|
3856
|
+
*/
|
3857
|
+
async showDeleteNodesDialog(nodeIds) {
|
3858
|
+
const result = await this.workflow.execute('delete-entity', {
|
3859
|
+
entities: nodeIds.map((node) => ({
|
3860
|
+
source: `${RootConfig.module.name}.${node.type == 'folder' ? RootConfig.entities.folder.name : RootConfig.entities.document.name}`,
|
3861
|
+
ids: [node.id],
|
3862
|
+
})),
|
3863
|
+
});
|
3864
|
+
return result.getOutput('result') ?? false;
|
3865
|
+
}
|
3866
|
+
/**
|
3867
|
+
* Shows choose file dialog
|
3868
|
+
*/
|
3869
|
+
async showChooseFileDialog(scope) {
|
3870
|
+
const comp = (await import('./acorex-modules-document-management-drive-choose.component-UTy9OISj.mjs')).AXMDocumentDriveChooseComponent;
|
3871
|
+
const result = await this.popupService.open(comp, {
|
3872
|
+
title: await this.translate.translateAsync('@document-management:actions.choose-from-drive'),
|
3873
|
+
data: {
|
3874
|
+
scope: scope,
|
4462
3875
|
},
|
4463
|
-
|
4464
|
-
if (
|
4465
|
-
|
3876
|
+
});
|
3877
|
+
if (result.data?.result) {
|
3878
|
+
return castArray(result.data.items);
|
4466
3879
|
}
|
3880
|
+
return [];
|
4467
3881
|
}
|
4468
|
-
|
4469
|
-
|
4470
|
-
|
4471
|
-
|
4472
|
-
|
4473
|
-
|
4474
|
-
|
4475
|
-
|
4476
|
-
|
4477
|
-
|
4478
|
-
|
4479
|
-
|
4480
|
-
|
4481
|
-
|
4482
|
-
|
4483
|
-
|
3882
|
+
/**
|
3883
|
+
* Shows file viewer popup
|
3884
|
+
*/
|
3885
|
+
async showFileViewerPopup(node, options) {
|
3886
|
+
const isVirtualFolder = node.parentId === 'virtual';
|
3887
|
+
const parentFolderName = isVirtualFolder ? 'Virtual' : (await this.folderService.getOne(node.parentId)).name;
|
3888
|
+
const documents = isVirtualFolder
|
3889
|
+
? options?.folderVirtualFiles ?? []
|
3890
|
+
: (await this.folderService.getOne(node.parentId)).documents ?? [];
|
3891
|
+
const nodes = await Promise.all(documents
|
3892
|
+
.filter((item) => {
|
3893
|
+
if (!item.name)
|
3894
|
+
return false;
|
3895
|
+
const ext = item.name.split('.').pop()?.toLowerCase();
|
3896
|
+
return ext && ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'webp', 'pdf'].includes(ext);
|
3897
|
+
})
|
3898
|
+
.map((doc) => this.mapDocumentToMediaViewerData(doc)));
|
3899
|
+
const comp = (await Promise.resolve().then(function () { return fileViewerPopup_component; }))
|
3900
|
+
.AXMFileViewerPopupComponent;
|
3901
|
+
await this.popupService.open(comp, {
|
3902
|
+
title: parentFolderName,
|
3903
|
+
data: {
|
3904
|
+
nodes,
|
3905
|
+
index: isVirtualFolder
|
3906
|
+
? options?.folderVirtualFiles?.findIndex((f) => f.id === node.id) ?? 0
|
3907
|
+
: options?.index ?? 0,
|
3908
|
+
},
|
3909
|
+
});
|
4484
3910
|
}
|
4485
|
-
|
4486
|
-
|
4487
|
-
|
4488
|
-
|
4489
|
-
|
4490
|
-
|
4491
|
-
|
4492
|
-
|
4493
|
-
|
4494
|
-
|
4495
|
-
|
4496
|
-
|
4497
|
-
|
4498
|
-
|
4499
|
-
|
3911
|
+
/**
|
3912
|
+
* Updates a file name
|
3913
|
+
*/
|
3914
|
+
async updateFileName(node, name) {
|
3915
|
+
if (node.storageType == 'physical') {
|
3916
|
+
return this.mapFileToNode(await this.documentService.updateOne(node.id, { name }));
|
3917
|
+
}
|
3918
|
+
else {
|
3919
|
+
node.name = name;
|
3920
|
+
return node;
|
3921
|
+
}
|
3922
|
+
}
|
3923
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AXMDocumentManagerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
3924
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AXMDocumentManagerService, providedIn: 'root' }); }
|
3925
|
+
}
|
3926
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AXMDocumentManagerService, decorators: [{
|
3927
|
+
type: Injectable,
|
3928
|
+
args: [{
|
3929
|
+
providedIn: 'root',
|
3930
|
+
}]
|
3931
|
+
}] });
|
3932
|
+
//#endregion
|
3933
|
+
//#region ---- Scoped Drive Service ----
|
3934
|
+
/**
|
3935
|
+
* Scoped drive service for specific platform scopes
|
3936
|
+
*/
|
3937
|
+
class ScopedDriveService {
|
3938
|
+
//#region ---- Constructor ----
|
3939
|
+
constructor(parent, scope, options) {
|
3940
|
+
this.parent = parent;
|
3941
|
+
this.scope = scope;
|
3942
|
+
this.options = options;
|
3943
|
+
this.validateScopeOptions();
|
3944
|
+
}
|
3945
|
+
//#endregion
|
3946
|
+
//#region ---- Validation Methods ----
|
3947
|
+
/**
|
3948
|
+
* Validates the scope options are appropriate for the selected scope
|
3949
|
+
*/
|
3950
|
+
validateScopeOptions() {
|
3951
|
+
switch (this.scope) {
|
3952
|
+
case AXPPlatformScope.Tenant:
|
3953
|
+
if (!this.options?.tenantId) {
|
3954
|
+
throw new Error('Tenant ID is required for tenant scope');
|
4500
3955
|
}
|
4501
3956
|
break;
|
4502
|
-
case
|
4503
|
-
this.
|
4504
|
-
|
4505
|
-
case 'new-folder':
|
4506
|
-
await this.createFolder(node);
|
4507
|
-
// Handle new folder creation
|
4508
|
-
break;
|
4509
|
-
// case 'upload-file':
|
4510
|
-
// await this.uploadFile(node);
|
4511
|
-
// break;
|
4512
|
-
case 'paste':
|
4513
|
-
// Handle paste operation
|
4514
|
-
break;
|
4515
|
-
case 'move-to':
|
4516
|
-
this.moveTo(node);
|
4517
|
-
break;
|
4518
|
-
case 'copy-to':
|
4519
|
-
this.copyTo(node);
|
4520
|
-
break;
|
4521
|
-
case 'rename':
|
4522
|
-
this.renameNode(node);
|
4523
|
-
break;
|
4524
|
-
case 'properties':
|
4525
|
-
this.showFolderProperty(node);
|
4526
|
-
break;
|
4527
|
-
case 'delete':
|
4528
|
-
this.vm.deleteNodes([node]);
|
4529
|
-
break;
|
4530
|
-
case 'refresh':
|
4531
|
-
this.vm.refresh();
|
4532
|
-
break;
|
4533
|
-
case 'copy':
|
4534
|
-
this.makeCopy(node);
|
4535
|
-
break;
|
4536
|
-
case 'share':
|
4537
|
-
this.share(node);
|
4538
|
-
break;
|
4539
|
-
case 'share-with-email':
|
4540
|
-
this.shareWithEmail(node);
|
4541
|
-
break;
|
4542
|
-
case 'link':
|
4543
|
-
this.link(node);
|
4544
|
-
break;
|
4545
|
-
case 'lock':
|
4546
|
-
this.lock(node);
|
4547
|
-
break;
|
4548
|
-
case 'unlock':
|
4549
|
-
this.unlock(node);
|
4550
|
-
break;
|
4551
|
-
default:
|
4552
|
-
if (e.item.name?.startsWith('upload.')) {
|
4553
|
-
await this.driveService.uploadFileByType(e.item.data.node?.id ?? this.vm.currentFolder()?.id, e.item.data.documentType.id);
|
4554
|
-
this.vm.refresh();
|
3957
|
+
case AXPPlatformScope.User:
|
3958
|
+
if (!this.options?.tenantId || !this.options?.userId) {
|
3959
|
+
throw new Error('Both Tenant ID and User ID are required for user scope');
|
4555
3960
|
}
|
4556
3961
|
break;
|
4557
3962
|
}
|
4558
3963
|
}
|
4559
3964
|
//#endregion
|
4560
|
-
|
4561
|
-
|
4562
|
-
|
4563
|
-
|
4564
|
-
|
4565
|
-
|
4566
|
-
await this.driveService.showShareDialog(node);
|
4567
|
-
}
|
4568
|
-
async shareWithEmail(node) {
|
4569
|
-
await this.driveService.showShareWithEmailDialog(node);
|
4570
|
-
}
|
4571
|
-
async link(node) {
|
4572
|
-
await this.driveService.showLinkDialog(node);
|
4573
|
-
}
|
4574
|
-
async lock(node) {
|
4575
|
-
await this.driveService.showLockDialog(node);
|
4576
|
-
}
|
4577
|
-
async unlock(node) {
|
4578
|
-
await this.driveService.showUnlockDialog(node);
|
4579
|
-
}
|
4580
|
-
async openGalleryWithFolderId() {
|
4581
|
-
const folder = this.vm.currentFolder();
|
4582
|
-
const files = folder.children.filter((item) => item.type === 'file');
|
4583
|
-
await this.driveService.showFileViewerPopup(files[0]);
|
3965
|
+
//#region ---- Scoped Operations ----
|
3966
|
+
/**
|
3967
|
+
* Gets root folder for this scope
|
3968
|
+
*/
|
3969
|
+
async getRoot() {
|
3970
|
+
return this.parent.getRoot(this.scope, this.options);
|
4584
3971
|
}
|
4585
|
-
|
4586
|
-
|
4587
|
-
|
4588
|
-
|
4589
|
-
|
3972
|
+
/**
|
3973
|
+
* Gets folder for this scope
|
3974
|
+
*/
|
3975
|
+
async getFolder(folderId) {
|
3976
|
+
return this.parent.getFolder(this.scope, folderId, this.options);
|
4590
3977
|
}
|
4591
|
-
|
4592
|
-
|
3978
|
+
/**
|
3979
|
+
* Creates folder in this scope
|
3980
|
+
*/
|
3981
|
+
async createFolder(data) {
|
3982
|
+
const folderData = {
|
3983
|
+
...data,
|
3984
|
+
tenantId: this.options?.tenantId,
|
3985
|
+
userId: this.options?.userId,
|
3986
|
+
};
|
3987
|
+
return this.parent.createFolder(folderData);
|
4593
3988
|
}
|
4594
|
-
|
4595
|
-
|
3989
|
+
/**
|
3990
|
+
* Updates folder in this scope
|
3991
|
+
*/
|
3992
|
+
async updateFolder(folderId, data) {
|
3993
|
+
return this.parent.updateFolder(folderId, data);
|
4596
3994
|
}
|
4597
|
-
|
4598
|
-
|
4599
|
-
|
4600
|
-
|
4601
|
-
|
4602
|
-
await this.vm.refresh();
|
4603
|
-
}
|
4604
|
-
}
|
3995
|
+
/**
|
3996
|
+
* Deletes folder in this scope
|
3997
|
+
*/
|
3998
|
+
async deleteFolder(folderId) {
|
3999
|
+
return this.parent.deleteFolder(folderId);
|
4605
4000
|
}
|
4606
|
-
|
4607
|
-
|
4608
|
-
|
4609
|
-
|
4610
|
-
|
4611
|
-
const files = this.vm.files();
|
4612
|
-
const updatedFiles = files.map((file) => {
|
4613
|
-
if (file.id === result.id) {
|
4614
|
-
return result;
|
4615
|
-
}
|
4616
|
-
return file;
|
4617
|
-
});
|
4618
|
-
this.vm.virtualFolder(updatedFiles);
|
4619
|
-
}
|
4620
|
-
await this.vm.refresh();
|
4621
|
-
}
|
4622
|
-
return result;
|
4623
|
-
}
|
4624
|
-
return;
|
4001
|
+
/**
|
4002
|
+
* Gets available space for this scope
|
4003
|
+
*/
|
4004
|
+
async getAvailableSpace() {
|
4005
|
+
return this.parent.getAvailableSpace();
|
4625
4006
|
}
|
4626
|
-
|
4627
|
-
|
4628
|
-
|
4007
|
+
/**
|
4008
|
+
* Searches folders in this scope
|
4009
|
+
*/
|
4010
|
+
async searchFolders(searchTerm) {
|
4011
|
+
this.validateScopeOptions();
|
4012
|
+
return this.parent.searchFolders(searchTerm, this.scope, this.options);
|
4629
4013
|
}
|
4630
|
-
|
4631
|
-
|
4632
|
-
|
4633
|
-
|
4634
|
-
|
4635
|
-
|
4636
|
-
catch (error) {
|
4637
|
-
console.error('Error copying node:', error);
|
4638
|
-
}
|
4639
|
-
}
|
4014
|
+
/**
|
4015
|
+
* Searches files in this scope
|
4016
|
+
*/
|
4017
|
+
async searchFiles(searchTerm) {
|
4018
|
+
this.validateScopeOptions();
|
4019
|
+
return this.parent.searchFiles(searchTerm, this.scope, this.options);
|
4640
4020
|
}
|
4641
|
-
|
4642
|
-
|
4643
|
-
|
4644
|
-
|
4645
|
-
|
4646
|
-
|
4647
|
-
}
|
4021
|
+
/**
|
4022
|
+
* Searches nodes in this scope
|
4023
|
+
*/
|
4024
|
+
async searchNodes(searchTerm) {
|
4025
|
+
this.validateScopeOptions();
|
4026
|
+
return this.parent.searchNodes(searchTerm, this.scope, this.options);
|
4648
4027
|
}
|
4649
|
-
|
4650
|
-
|
4651
|
-
|
4652
|
-
|
4653
|
-
|
4654
|
-
|
4655
|
-
}
|
4028
|
+
/**
|
4029
|
+
* Creates a copy of a node in this scope
|
4030
|
+
*/
|
4031
|
+
async copy(node) {
|
4032
|
+
this.validateScopeOptions();
|
4033
|
+
return this.parent.copy(node);
|
4656
4034
|
}
|
4657
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AXMDocumentExplorerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
4658
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.10", type: AXMDocumentExplorerComponent, isStandalone: true, selector: "axm-document-explorer", inputs: { browseMode: { classPropertyName: "browseMode", publicName: "browseMode", isSignal: true, isRequired: false, transformFunction: null }, viewMode: { classPropertyName: "viewMode", publicName: "viewMode", isSignal: true, isRequired: false, transformFunction: null }, selectionMode: { classPropertyName: "selectionMode", publicName: "selectionMode", isSignal: true, isRequired: false, transformFunction: null }, showContextMenu: { classPropertyName: "showContextMenu", publicName: "showContextMenu", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "contextMenu", first: true, predicate: ["itemsContextMenu"], descendants: true, isSignal: true }, { propertyName: "rootContextMenu", first: true, predicate: ["rootContextMenu"], descendants: true, isSignal: true }], ngImport: i0, template: "<!-- Empty State -->\n<div class=\"view-container\">\n @if (vm.folders().length === 0 && vm.files().length === 0) {\n <div class=\"ax-flex ax-flex-col ax-items-center ax-justify-center ax-py-16 ax-h-full\">\n <ax-icon icon=\"fa-light fa-folder-open\" class=\"ax-text-6xl ax-mb-4\"></ax-icon>\n <h3 class=\"ax-text-xl ax-font-medium ax-mb-2\">No Items Found</h3>\n <p class=\"\">This folder is empty. Add some files or folders to get started.</p>\n </div>\n } @else {\n <ng-container [ngComponentOutlet]=\"view()\"></ng-container>\n }\n</div>\n\n<!-- Context Menu -->\n@if (showContextMenu()) {\n<!-- Item Context Menu-->\n<ax-context-menu\n #itemsContextMenu\n [target]=\"'.__explorer-item'\"\n [orientation]=\"'vertical'\"\n [closeOn]=\"'leave'\"\n (onItemClick)=\"handleContextMenuItemClick($event)\"\n (onOpening)=\"handleContextMenuOnOpening($event)\"\n>\n</ax-context-menu>\n<!-- Root Context Menu-->\n<ax-context-menu\n #rootContextMenu\n [target]=\"'.view-container'\"\n [orientation]=\"'vertical'\"\n [closeOn]=\"'leave'\"\n (onItemClick)=\"handleContextMenuItemClick($event)\"\n (onOpening)=\"handleContextMenuRootOnOpening($event)\"\n>\n</ax-context-menu>\n}\n", styles: ["axm-document-explorer{display:flex;height:max-content;min-height:100%;width:100%;flex-direction:row;gap:1rem}axm-document-explorer>.view-container{display:flex;flex:1 1 0%;-webkit-user-select:none;-moz-user-select:-moz-none;user-select:none;flex-direction:column;gap:1rem}axm-document-explorer .animation-duration-2s{--fa-animation-duration: 2s}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletContent", "ngComponentOutletNgModule", "ngComponentOutletNgModuleFactory"], exportAs: ["ngComponentOutlet"] }, { kind: "ngmodule", type: RouterModule }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i3$1.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "ngmodule", type: AXLoadingModule }, { kind: "ngmodule", type: AXFormatModule }, { kind: "ngmodule", type: AXDateTimeModule }, { kind: "ngmodule", type: AXMenuModule }, { kind: "component", type: i3$2.AXContextMenuComponent, selector: "ax-context-menu", inputs: ["orientation", "openOn", "closeOn", "items", "target"], outputs: ["onItemClick", "onOpening"] }], encapsulation: i0.ViewEncapsulation.None }); }
|
4659
4035
|
}
|
4660
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AXMDocumentExplorerComponent, decorators: [{
|
4661
|
-
type: Component,
|
4662
|
-
args: [{ selector: 'axm-document-explorer', standalone: true, encapsulation: ViewEncapsulation.None, imports: [
|
4663
|
-
CommonModule,
|
4664
|
-
RouterModule,
|
4665
|
-
AXDecoratorModule,
|
4666
|
-
AXLoadingModule,
|
4667
|
-
AXFormatModule,
|
4668
|
-
AXDateTimeModule,
|
4669
|
-
AXMenuModule,
|
4670
|
-
], template: "<!-- Empty State -->\n<div class=\"view-container\">\n @if (vm.folders().length === 0 && vm.files().length === 0) {\n <div class=\"ax-flex ax-flex-col ax-items-center ax-justify-center ax-py-16 ax-h-full\">\n <ax-icon icon=\"fa-light fa-folder-open\" class=\"ax-text-6xl ax-mb-4\"></ax-icon>\n <h3 class=\"ax-text-xl ax-font-medium ax-mb-2\">No Items Found</h3>\n <p class=\"\">This folder is empty. Add some files or folders to get started.</p>\n </div>\n } @else {\n <ng-container [ngComponentOutlet]=\"view()\"></ng-container>\n }\n</div>\n\n<!-- Context Menu -->\n@if (showContextMenu()) {\n<!-- Item Context Menu-->\n<ax-context-menu\n #itemsContextMenu\n [target]=\"'.__explorer-item'\"\n [orientation]=\"'vertical'\"\n [closeOn]=\"'leave'\"\n (onItemClick)=\"handleContextMenuItemClick($event)\"\n (onOpening)=\"handleContextMenuOnOpening($event)\"\n>\n</ax-context-menu>\n<!-- Root Context Menu-->\n<ax-context-menu\n #rootContextMenu\n [target]=\"'.view-container'\"\n [orientation]=\"'vertical'\"\n [closeOn]=\"'leave'\"\n (onItemClick)=\"handleContextMenuItemClick($event)\"\n (onOpening)=\"handleContextMenuRootOnOpening($event)\"\n>\n</ax-context-menu>\n}\n", styles: ["axm-document-explorer{display:flex;height:max-content;min-height:100%;width:100%;flex-direction:row;gap:1rem}axm-document-explorer>.view-container{display:flex;flex:1 1 0%;-webkit-user-select:none;-moz-user-select:-moz-none;user-select:none;flex-direction:column;gap:1rem}axm-document-explorer .animation-duration-2s{--fa-animation-duration: 2s}\n"] }]
|
4671
|
-
}] });
|
4672
4036
|
|
4673
4037
|
class AXMDocumentTypeChooseFileComponent extends AXBasePageComponent {
|
4674
4038
|
constructor() {
|
@@ -4703,777 +4067,1073 @@ class AXMDocumentTypeChooseFileComponent extends AXBasePageComponent {
|
|
4703
4067
|
: JSON.parse(i.interface)['children'][0]['children'][0]);
|
4704
4068
|
}
|
4705
4069
|
}
|
4706
|
-
}
|
4707
|
-
handleContextChanged(e) {
|
4708
|
-
console.log(e.data);
|
4709
|
-
this.context.set(e.data);
|
4710
|
-
}
|
4711
|
-
handleCancel() {
|
4712
|
-
this.close();
|
4713
|
-
}
|
4714
|
-
|
4715
|
-
this.close({
|
4716
|
-
context: this.context(),
|
4717
|
-
});
|
4718
|
-
}
|
4719
|
-
getNode(meta) {
|
4720
|
-
return get(meta, '__node__');
|
4721
|
-
}
|
4722
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AXMDocumentTypeChooseFileComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
4723
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.10", type: AXMDocumentTypeChooseFileComponent, isStandalone: true, selector: "
|
4724
|
-
|
4725
|
-
|
4726
|
-
|
4727
|
-
|
4728
|
-
|
4729
|
-
|
4730
|
-
|
4731
|
-
|
4732
|
-
|
4733
|
-
|
4734
|
-
|
4735
|
-
|
4736
|
-
|
4737
|
-
|
4070
|
+
}
|
4071
|
+
handleContextChanged(e) {
|
4072
|
+
console.log(e.data);
|
4073
|
+
this.context.set(e.data);
|
4074
|
+
}
|
4075
|
+
handleCancel() {
|
4076
|
+
this.close();
|
4077
|
+
}
|
4078
|
+
handleSubmit() {
|
4079
|
+
this.close({
|
4080
|
+
context: this.context(),
|
4081
|
+
});
|
4082
|
+
}
|
4083
|
+
getNode(meta) {
|
4084
|
+
return get(meta, '__node__');
|
4085
|
+
}
|
4086
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AXMDocumentTypeChooseFileComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
4087
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.10", type: AXMDocumentTypeChooseFileComponent, isStandalone: true, selector: "ng-component", usesInheritance: true, ngImport: i0, template: "<ax-content>\n <div class=\"ax-flex ax-flex-col ax-py-4 ax-px-6\">\n <axp-widgets-container [context]=\"context()\" (onContextChanged)=\"handleContextChanged($event)\">\n <ax-form>\n @for (doc of documentType.meta; track doc.name) {\n <ax-form-field>\n <ax-label>{{ doc.title }}</ax-label>\n <ng-container axp-widget-renderer [node]=\"getNode(doc)\" [mode]=\"'edit'\"></ng-container>\n </ax-form-field>\n }\n <ng-container axp-widget-renderer [node]=\"uploadNode()\" mode=\"edit\"></ng-container>\n </ax-form>\n </axp-widgets-container>\n </div>\n</ax-content>\n<ax-footer>\n <ax-suffix>\n <ax-button [text]=\"'cancel' | translate | async\" (onClick)=\"handleCancel()\"> </ax-button>\n <ax-button [text]=\"'submit' | translate | async\" look=\"solid\" color=\"primary\" (onClick)=\"handleSubmit()\">\n </ax-button>\n </ax-suffix>\n</ax-footer>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }, { kind: "ngmodule", type:
|
4088
|
+
//
|
4089
|
+
AXButtonModule }, { kind: "component", type: i2$1.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "iconOnly", "type", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "loadingTextChange"] }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i3$1.AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-subtitle, ax-placeholder, ax-overlay" }, { kind: "ngmodule", type: AXFormModule }, { kind: "component", type: i3.AXFormFieldComponent, selector: "ax-form-field", inputs: ["labelMode"] }, { kind: "component", type: i3.AXFormComponent, selector: "ax-form", inputs: ["labelMode", "look", "messageStyle", "updateOn"], outputs: ["onValidate", "updateOnChange"] }, { kind: "ngmodule", type: AXLabelModule }, { kind: "component", type: i5.AXLabelComponent, selector: "ax-label", inputs: ["required", "for"], outputs: ["requiredChange"] }, { kind: "ngmodule", type: AXSelectBoxModule }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "pipe", type: i3$2.AXTranslatorPipe, name: "translate" }, { kind: "ngmodule", type:
|
4090
|
+
//
|
4091
|
+
AXPLayoutBuilderModule }, { kind: "component", type: i6.AXPWidgetContainerComponent, selector: "axp-widgets-container", inputs: ["context", "functions"], outputs: ["onContextChanged"] }, { kind: "directive", type: i6.AXPWidgetRendererDirective, selector: "[axp-widget-renderer]", inputs: ["parentNode", "index", "mode", "node"], outputs: ["onOptionsChanged", "onValueChanged"], exportAs: ["widgetRenderer"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
4092
|
+
}
|
4093
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AXMDocumentTypeChooseFileComponent, decorators: [{
|
4094
|
+
type: Component,
|
4095
|
+
args: [{ changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
4096
|
+
CommonModule,
|
4097
|
+
//
|
4098
|
+
AXButtonModule,
|
4099
|
+
AXDecoratorModule,
|
4100
|
+
AXFormModule,
|
4101
|
+
AXLabelModule,
|
4102
|
+
AXSelectBoxModule,
|
4103
|
+
AXTranslationModule,
|
4104
|
+
//
|
4105
|
+
AXPLayoutBuilderModule,
|
4106
|
+
], template: "<ax-content>\n <div class=\"ax-flex ax-flex-col ax-py-4 ax-px-6\">\n <axp-widgets-container [context]=\"context()\" (onContextChanged)=\"handleContextChanged($event)\">\n <ax-form>\n @for (doc of documentType.meta; track doc.name) {\n <ax-form-field>\n <ax-label>{{ doc.title }}</ax-label>\n <ng-container axp-widget-renderer [node]=\"getNode(doc)\" [mode]=\"'edit'\"></ng-container>\n </ax-form-field>\n }\n <ng-container axp-widget-renderer [node]=\"uploadNode()\" mode=\"edit\"></ng-container>\n </ax-form>\n </axp-widgets-container>\n </div>\n</ax-content>\n<ax-footer>\n <ax-suffix>\n <ax-button [text]=\"'cancel' | translate | async\" (onClick)=\"handleCancel()\"> </ax-button>\n <ax-button [text]=\"'submit' | translate | async\" look=\"solid\" color=\"primary\" (onClick)=\"handleSubmit()\">\n </ax-button>\n </ax-suffix>\n</ax-footer>\n" }]
|
4107
|
+
}] });
|
4108
|
+
|
4109
|
+
class AXMFileViewerPopupComponent extends AXBasePageComponent {
|
4110
|
+
constructor() {
|
4111
|
+
super(...arguments);
|
4112
|
+
this.index = 0;
|
4113
|
+
this.mediaViewer = viewChild(AXMediaViewerContainerComponent);
|
4114
|
+
this.f = afterNextRender(() => {
|
4115
|
+
setTimeout(() => {
|
4116
|
+
this.mediaViewer()?.goToIndex(this.index, 0);
|
4117
|
+
});
|
4118
|
+
});
|
4119
|
+
}
|
4120
|
+
ngAfterViewInit() {
|
4121
|
+
console.log(this.index);
|
4122
|
+
//Called after ngAfterContentInit when the component's view has been initialized. Applies to components only.
|
4123
|
+
//Add 'implements AfterViewInit' to the class.
|
4124
|
+
this.mediaViewer()?.goToIndex(this.index, 0);
|
4125
|
+
}
|
4126
|
+
onClose() {
|
4127
|
+
this.close();
|
4128
|
+
}
|
4129
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AXMFileViewerPopupComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
4130
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "19.2.10", type: AXMFileViewerPopupComponent, isStandalone: true, selector: "ng-component", viewQueries: [{ propertyName: "mediaViewer", first: true, predicate: AXMediaViewerContainerComponent, descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<ax-content>\n <ax-media-viewer-container [thumbnail]=\"true\" #c [dataArray]=\"nodes\">\n <ax-header>\n <ax-prefix>\n <ax-file-info></ax-file-info>\n </ax-prefix>\n <ax-suffix>\n <ax-fullscreen-button></ax-fullscreen-button>\n </ax-suffix>\n </ax-header>\n <ax-prefix>\n <ax-button (click)=\"c.next()\">\n <ax-icon class=\"ax-icon ax-icon-chevron-right\"> </ax-icon>\n </ax-button>\n </ax-prefix>\n <ax-suffix>\n <ax-button (click)=\"c.prev()\">\n <ax-icon class=\"ax-icon ax-icon-chevron-left\"> </ax-icon>\n </ax-button>\n </ax-suffix>\n </ax-media-viewer-container>\n</ax-content>\n<ax-footer>\n <ax-suffix>\n <ax-button [text]=\"'close'\" (click)=\"onClose()\" />\n </ax-suffix>\n</ax-footer>\n", styles: ["ax-media-viewer-container{--ax-sys-border-radius:0 }\n"], dependencies: [{ kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i3$1.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "component", type: i3$1.AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-subtitle, ax-placeholder, ax-overlay" }, { kind: "component", type: i3$1.AXDecoratorFullScreenButtonComponent, selector: "ax-fullscreen-button" }, { kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i2$1.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "iconOnly", "type", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "loadingTextChange"] }, { kind: "ngmodule", type: AXMediaViewerModule }, { kind: "component", type: i3$3.AXMediaViewerContainerComponent, selector: "ax-media-viewer-container", inputs: ["dataArray", "thumbnail"] }, { kind: "component", type: i3$3.AXFileInfoComponent, selector: "ax-file-info" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
4131
|
+
}
|
4132
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AXMFileViewerPopupComponent, decorators: [{
|
4133
|
+
type: Component,
|
4134
|
+
args: [{ changeDetection: ChangeDetectionStrategy.OnPush, imports: [AXDecoratorModule, AXButtonModule, AXMediaViewerModule], template: "<ax-content>\n <ax-media-viewer-container [thumbnail]=\"true\" #c [dataArray]=\"nodes\">\n <ax-header>\n <ax-prefix>\n <ax-file-info></ax-file-info>\n </ax-prefix>\n <ax-suffix>\n <ax-fullscreen-button></ax-fullscreen-button>\n </ax-suffix>\n </ax-header>\n <ax-prefix>\n <ax-button (click)=\"c.next()\">\n <ax-icon class=\"ax-icon ax-icon-chevron-right\"> </ax-icon>\n </ax-button>\n </ax-prefix>\n <ax-suffix>\n <ax-button (click)=\"c.prev()\">\n <ax-icon class=\"ax-icon ax-icon-chevron-left\"> </ax-icon>\n </ax-button>\n </ax-suffix>\n </ax-media-viewer-container>\n</ax-content>\n<ax-footer>\n <ax-suffix>\n <ax-button [text]=\"'close'\" (click)=\"onClose()\" />\n </ax-suffix>\n</ax-footer>\n", styles: ["ax-media-viewer-container{--ax-sys-border-radius:0 }\n"] }]
|
4135
|
+
}] });
|
4136
|
+
|
4137
|
+
var fileViewerPopup_component = /*#__PURE__*/Object.freeze({
|
4138
|
+
__proto__: null,
|
4139
|
+
AXMFileViewerPopupComponent: AXMFileViewerPopupComponent
|
4140
|
+
});
|
4141
|
+
|
4142
|
+
var AXPDocumentExplorerSettings;
|
4143
|
+
(function (AXPDocumentExplorerSettings) {
|
4144
|
+
AXPDocumentExplorerSettings["ViewMode"] = "document-explorer:layout:view-mode";
|
4145
|
+
AXPDocumentExplorerSettings["SortField"] = "document-explorer:layout:sort-field";
|
4146
|
+
AXPDocumentExplorerSettings["SortDirection"] = "document-explorer:layout:sort-direction";
|
4147
|
+
})(AXPDocumentExplorerSettings || (AXPDocumentExplorerSettings = {}));
|
4148
|
+
|
4149
|
+
const AXPDocumentExplorerViewModel = signalStore({ providedIn: 'root' }, withState(() => ({
|
4150
|
+
// View State
|
4151
|
+
viewMode: 'large-tiles',
|
4152
|
+
isLoading: false,
|
4153
|
+
scope: AXPPlatformScope.User,
|
4154
|
+
// Navigation State
|
4155
|
+
currentPath: [],
|
4156
|
+
currentNode: null,
|
4157
|
+
loadingFolderId: null,
|
4158
|
+
navigatingFolderId: null,
|
4159
|
+
backHistory: [],
|
4160
|
+
// Selection State
|
4161
|
+
selectionMode: 'none',
|
4162
|
+
selectedNodes: [],
|
4163
|
+
// Browse State
|
4164
|
+
browseMode: 'file',
|
4165
|
+
// Sort State
|
4166
|
+
sortField: 'name',
|
4167
|
+
sortDirection: 'asc',
|
4168
|
+
// Content State
|
4169
|
+
folders: [],
|
4170
|
+
files: [],
|
4171
|
+
itemsCount: 0,
|
4172
|
+
availableSpace: 0,
|
4173
|
+
// Drive State
|
4174
|
+
currentDrive: null,
|
4175
|
+
// File Type State
|
4176
|
+
fileTypes: [],
|
4177
|
+
// Detail Panel State
|
4178
|
+
detailPanel: false,
|
4179
|
+
})), withComputed((store) => ({
|
4180
|
+
isRoot: computed(() => {
|
4181
|
+
const path = store.currentPath();
|
4182
|
+
return path.length === 1;
|
4183
|
+
}),
|
4184
|
+
isVirtual: computed(() => {
|
4185
|
+
const node = store.currentNode();
|
4186
|
+
return node?.storageType === 'virtual';
|
4187
|
+
}),
|
4188
|
+
currentFolder: computed(() => store.currentNode()),
|
4189
|
+
currentFolderContents: computed(() => ({
|
4190
|
+
folders: store.folders(),
|
4191
|
+
files: store.files(),
|
4192
|
+
})),
|
4193
|
+
isLargeTilesView: computed(() => store.viewMode() === 'large-tiles'),
|
4194
|
+
isSmallTilesView: computed(() => store.viewMode() === 'small-tiles'),
|
4195
|
+
isListView: computed(() => store.viewMode() === 'list'),
|
4196
|
+
isDetailsView: computed(() => store.viewMode() === 'details'),
|
4197
|
+
isLargeIconsView: computed(() => store.viewMode() === 'large-icons'),
|
4198
|
+
isSmallIconsView: computed(() => store.viewMode() === 'small-icons'),
|
4199
|
+
isBackAvailable: computed(() => store.backHistory().length > 0),
|
4200
|
+
isUpAvailable: computed(() => {
|
4201
|
+
const node = store.currentNode();
|
4202
|
+
return node?.parentId != null;
|
4203
|
+
}),
|
4204
|
+
selectedCount: computed(() => store.selectedNodes().length),
|
4205
|
+
hasSelectedItems: computed(() => store.selectedNodes().length > 0),
|
4206
|
+
hasMultipleSelectedItems: computed(() => store.selectedNodes().length > 1),
|
4207
|
+
isMultiSelect: computed(() => store.selectionMode() === 'multiple'),
|
4208
|
+
selectedNode: computed(() => store.selectedNodes()[0] ?? null),
|
4209
|
+
isDetailPanelOpen: computed(() => store.detailPanel()),
|
4210
|
+
})), withMethods((store, fileTypeService = inject(AXPFileTypeProviderService), documentTypeService = inject(AXMDocumentTypeService), driveService = inject(AXMDocumentManagerService), settingService = inject(AXPSettingService), sessionService = inject(AXPSessionService), translateService = inject(AXTranslationService)) => ({
|
4211
|
+
async initialize(options) {
|
4212
|
+
// Load file types
|
4213
|
+
const fileTypes = await fileTypeService.items();
|
4214
|
+
patchState(store, { fileTypes });
|
4215
|
+
// Load initial settings
|
4216
|
+
const viewMode = await settingService
|
4217
|
+
.scope(options?.scope || AXPPlatformScope.User)
|
4218
|
+
.get(AXPDocumentExplorerSettings.ViewMode);
|
4219
|
+
const sortField = await settingService
|
4220
|
+
.scope(options?.scope || AXPPlatformScope.User)
|
4221
|
+
.get(AXPDocumentExplorerSettings.SortField);
|
4222
|
+
const sortDirection = await settingService
|
4223
|
+
.scope(options?.scope || AXPPlatformScope.User)
|
4224
|
+
.get(AXPDocumentExplorerSettings.SortDirection);
|
4225
|
+
patchState(store, {
|
4226
|
+
viewMode: viewMode || 'list',
|
4227
|
+
sortField: sortField || 'name',
|
4228
|
+
sortDirection: sortDirection || 'asc',
|
4229
|
+
browseMode: options?.browseMode || 'file',
|
4230
|
+
scope: options?.scope || AXPPlatformScope.User,
|
4231
|
+
});
|
4232
|
+
},
|
4233
|
+
_load: async (folderId) => {
|
4234
|
+
patchState(store, { loadingFolderId: folderId, isLoading: true });
|
4235
|
+
await new Promise((resolve) => setTimeout(resolve, 100));
|
4236
|
+
try {
|
4237
|
+
const node = await driveService.getFolder(store.scope(), folderId, {
|
4238
|
+
tenantId: sessionService.tenant?.id,
|
4239
|
+
userId: sessionService.user?.id,
|
4240
|
+
});
|
4241
|
+
// Sort with direction
|
4242
|
+
const sortField = store.sortField();
|
4243
|
+
const sortDirection = store.sortDirection();
|
4244
|
+
const directionMultiplier = sortDirection === 'asc' ? 1 : -1;
|
4245
|
+
switch (sortField) {
|
4246
|
+
case 'name':
|
4247
|
+
node.result.children = node.result.children?.sort((a, b) => directionMultiplier * a.name.localeCompare(b.name));
|
4248
|
+
break;
|
4249
|
+
case 'modified':
|
4250
|
+
node.result.children = node.result.children?.sort((a, b) => directionMultiplier * ((a.modifiedAt?.getTime() ?? 0) - (b.modifiedAt?.getTime() ?? 0)));
|
4251
|
+
break;
|
4252
|
+
case 'size':
|
4253
|
+
node.result.children = node.result.children?.sort((a, b) => directionMultiplier * ((a.size ?? 0) - (b.size ?? 0)));
|
4254
|
+
break;
|
4255
|
+
default:
|
4256
|
+
node.result.children = node.result.children?.sort((a, b) => directionMultiplier * a.name.localeCompare(b.name));
|
4257
|
+
break;
|
4258
|
+
}
|
4259
|
+
patchState(store, {
|
4260
|
+
currentNode: node.result,
|
4261
|
+
currentPath: node.path,
|
4262
|
+
folders: node.result.children?.filter((item) => item.type === 'folder') || [],
|
4263
|
+
files: node.result.children?.filter((item) => store.browseMode() == 'file' && item.type === 'file') || [],
|
4264
|
+
itemsCount: node.result.children?.length || 0,
|
4265
|
+
availableSpace: await driveService.getAvailableSpace(),
|
4266
|
+
loadingFolderId: null,
|
4267
|
+
isLoading: false,
|
4268
|
+
navigatingFolderId: null,
|
4269
|
+
});
|
4270
|
+
}
|
4271
|
+
catch (error) {
|
4272
|
+
patchState(store, {
|
4273
|
+
loadingFolderId: null,
|
4274
|
+
isLoading: false,
|
4275
|
+
});
|
4276
|
+
throw error;
|
4277
|
+
}
|
4278
|
+
},
|
4279
|
+
navigateToFolder(folderId) {
|
4280
|
+
const currentNode = store.currentNode();
|
4281
|
+
if (currentNode) {
|
4282
|
+
patchState(store, {
|
4283
|
+
backHistory: [...store.backHistory(), { folderId: currentNode.id, path: store.currentPath() }],
|
4738
4284
|
});
|
4285
|
+
}
|
4286
|
+
patchState(store, { navigatingFolderId: folderId });
|
4287
|
+
},
|
4288
|
+
async loadFolderContents(folderId) {
|
4289
|
+
await this._load(folderId);
|
4290
|
+
this.deselectAll();
|
4291
|
+
},
|
4292
|
+
async virtualFolder(files = [], options) {
|
4293
|
+
const id = 'virtual';
|
4294
|
+
patchState(store, {
|
4295
|
+
loadingFolderId: id,
|
4296
|
+
isLoading: true,
|
4739
4297
|
});
|
4740
|
-
|
4741
|
-
|
4742
|
-
|
4743
|
-
|
4744
|
-
|
4745
|
-
|
4746
|
-
|
4747
|
-
|
4748
|
-
|
4749
|
-
|
4750
|
-
|
4751
|
-
|
4752
|
-
|
4753
|
-
|
4754
|
-
|
4755
|
-
|
4756
|
-
|
4757
|
-
|
4758
|
-
|
4759
|
-
|
4760
|
-
|
4761
|
-
|
4762
|
-
|
4763
|
-
class AXMFolderPathBreadcrumbsComponent {
|
4764
|
-
constructor() {
|
4765
|
-
this.vm = inject(AXPDocumentExplorerViewModel);
|
4766
|
-
this.layout = inject(AXPLayoutThemeService);
|
4767
|
-
}
|
4768
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AXMFolderPathBreadcrumbsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
4769
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.10", type: AXMFolderPathBreadcrumbsComponent, isStandalone: true, selector: "axm-folder-path-breadcrumbs", ngImport: i0, template: "<!-- Breadcrumbs Section -->\n<div class=\"__breadcrumb ax-xs\">\n <!-- Desktop Breadcrumb -->\n @for (item of vm.currentPath(); track item.id; let i = $index;let last = $last) {\n <!-- Navigation Button -->\n <ax-button look=\"blank\" (onClick)=\"vm.navigateToFolder(item.id)\" [text]=\"item.name\" [disabled]=\"last\">\n @if(i === 0) {\n <ax-icon icon=\"fa-light fa-cloud\"></ax-icon>\n }@else {\n <ax-icon icon=\"fa-light fa-folder-closed\"></ax-icon>\n }\n </ax-button>\n <!-- Separator -->\n @if(!last) {\n <i class=\"far fa-chevron-right rtl:ax-rotate-180 fa-fw fa-xs ax-me-2\"></i>\n }\n <!-- End Navigation Button -->\n }\n</div>\n", styles: [":host{display:flex;width:100%;align-items:center}:host .__nav{display:flex;flex-direction:row;align-items:center;gap:.25rem;border-inline-end-width:1px;padding-inline-start:.25rem;padding-inline-end:.5rem}:host .__breadcrumb{display:flex;flex-direction:row;flex-wrap:wrap;align-items:center;padding-inline-start:.5rem;padding-inline-end:.25rem}:host .__breadcrumb .ax-state-disabled button,:host .__breadcrumb .ax-state-loading button{cursor:default!important}\n"], dependencies: [{ kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i2$1.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "iconOnly", "type", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "loadingTextChange"] }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i3$1.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }] }); }
|
4770
|
-
}
|
4771
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AXMFolderPathBreadcrumbsComponent, decorators: [{
|
4772
|
-
type: Component,
|
4773
|
-
args: [{ selector: 'axm-folder-path-breadcrumbs', standalone: true, imports: [
|
4774
|
-
AXButtonModule,
|
4775
|
-
AXDecoratorModule,
|
4776
|
-
], template: "<!-- Breadcrumbs Section -->\n<div class=\"__breadcrumb ax-xs\">\n <!-- Desktop Breadcrumb -->\n @for (item of vm.currentPath(); track item.id; let i = $index;let last = $last) {\n <!-- Navigation Button -->\n <ax-button look=\"blank\" (onClick)=\"vm.navigateToFolder(item.id)\" [text]=\"item.name\" [disabled]=\"last\">\n @if(i === 0) {\n <ax-icon icon=\"fa-light fa-cloud\"></ax-icon>\n }@else {\n <ax-icon icon=\"fa-light fa-folder-closed\"></ax-icon>\n }\n </ax-button>\n <!-- Separator -->\n @if(!last) {\n <i class=\"far fa-chevron-right rtl:ax-rotate-180 fa-fw fa-xs ax-me-2\"></i>\n }\n <!-- End Navigation Button -->\n }\n</div>\n", styles: [":host{display:flex;width:100%;align-items:center}:host .__nav{display:flex;flex-direction:row;align-items:center;gap:.25rem;border-inline-end-width:1px;padding-inline-start:.25rem;padding-inline-end:.5rem}:host .__breadcrumb{display:flex;flex-direction:row;flex-wrap:wrap;align-items:center;padding-inline-start:.5rem;padding-inline-end:.25rem}:host .__breadcrumb .ax-state-disabled button,:host .__breadcrumb .ax-state-loading button{cursor:default!important}\n"] }]
|
4777
|
-
}] });
|
4778
|
-
|
4779
|
-
var index = /*#__PURE__*/Object.freeze({
|
4780
|
-
__proto__: null,
|
4781
|
-
AXMDocumentTypeChooseFileComponent: AXMDocumentTypeChooseFileComponent,
|
4782
|
-
AXMFileViewerPopupComponent: AXMFileViewerPopupComponent,
|
4783
|
-
AXMFolderPathBreadcrumbsComponent: AXMFolderPathBreadcrumbsComponent
|
4784
|
-
});
|
4785
|
-
|
4786
|
-
class AXMDocumentExplorerDetailPanelComponent {
|
4787
|
-
constructor() {
|
4788
|
-
this.vm = inject(AXPDocumentExplorerViewModel);
|
4789
|
-
}
|
4790
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AXMDocumentExplorerDetailPanelComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
4791
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.10", type: AXMDocumentExplorerDetailPanelComponent, isStandalone: true, selector: "axm-document-explorer-detail-panel", ngImport: i0, template: "<!-- Multiple Selected -->\n@if(vm.hasMultipleSelectedItems()) {\n<div class=\"__header\" *translate=\"let t\">\n <div class=\"__title\">\n <i class=\"fa-fw fa-lg fa-solid\"></i>\n <span> {{ vm.selectedCount() }} {{ t('itemsSelected', { scope: 'common' }) | async }}</span>\n </div>\n <ax-button [look]=\"'blank'\" class=\"ax-sm ax-rounded-full\" (onClick)=\"vm.closeDetailPanel()\">\n <ax-icon icon=\"fa-solid fa-xmark\"></ax-icon>\n </ax-button>\n</div>\n<div class=\"__content\"></div>\n}\n<!-- Single Selected -->\n@else {\n<!-- Info -->\n@let nodeInfo = vm.getNodeInfo((vm.selectedNode() ?? vm.currentFolder())!);\n<div class=\"__header\">\n <div class=\"__title\">\n <i class=\"fa-fw fa-lg {{ nodeInfo.icon }} fa-solid\"></i>\n <span>{{ nodeInfo.name }}</span>\n </div>\n <ax-button [look]=\"'blank'\" class=\"ax-sm ax-rounded-full\" (onClick)=\"vm.closeDetailPanel()\">\n <ax-icon icon=\"fa-solid fa-xmark\"></ax-icon>\n </ax-button>\n</div>\n<div class=\"__content\">\n @for(section of nodeInfo.sections; track section.title) {\n <div class=\"__section\">\n <div class=\"__title\">\n <span>{{ section.title }}</span>\n </div>\n <div class=\"__content\">\n @for(detail of section.details; track detail.title) {\n <div class=\"__row\">\n <div class=\"__title\">\n <span>{{ detail.title }}</span>\n </div>\n <div class=\"__content\">\n @if(detail.format) {\n <span>{{ detail.content | format : detail.format | async }}</span>\n } @else {\n <span>{{ detail.content ?? '---' }}</span>\n }\n </div>\n </div>\n }\n </div>\n </div>\n }\n</div>\n}\n", styles: ["axm-document-explorer-detail-panel{display:flex;flex-direction:column;border-radius:.5rem;border-width:1px;--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);background-color:rgb(var(--ax-sys-color-lightest-surface));color:rgb(var(--ax-sys-color-on-lightest-surface));border-color:rgb(var(--ax-sys-color-border-lightest-surface))}@media (min-width: 1024px){axm-document-explorer-detail-panel{min-width:20rem}}axm-document-explorer-detail-panel>.__header{display:flex;flex-direction:row;align-items:center;justify-content:space-between;border-bottom-width:1px;padding:1rem}axm-document-explorer-detail-panel>.__header>.__title{display:flex;width:90%;flex-direction:row;align-items:center;gap:.5rem}axm-document-explorer-detail-panel>.__header>.__title span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:start;font-weight:600;line-height:1.625}axm-document-explorer-detail-panel>.__content{display:flex;flex-direction:column}axm-document-explorer-detail-panel>.__content>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px * var(--tw-divide-y-reverse))}axm-document-explorer-detail-panel>.__content>.__section{display:flex;flex-direction:column;padding:1rem}axm-document-explorer-detail-panel>.__content>.__section>.__title{margin-bottom:1rem;font-size:.875rem;line-height:1.25rem;font-weight:700}axm-document-explorer-detail-panel>.__content>.__section>.__content{display:flex;flex-direction:column;gap:1rem}axm-document-explorer-detail-panel>.__content>.__section>.__content>.__row{display:flex;flex-direction:column;gap:.25rem}axm-document-explorer-detail-panel>.__content>.__section>.__content>.__row>.__title{display:flex;font-size:.875rem;line-height:1.25rem;font-weight:600;opacity:.9}axm-document-explorer-detail-panel>.__content>.__section>.__content>.__row>.__content{display:flex;flex-direction:row;align-items:center;gap:.5rem}axm-document-explorer-detail-panel>.__content>.__section>.__content>.__row>.__content span{opacity:.7}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i3$1.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "ngmodule", type: AXFormatModule }, { kind: "pipe", type: i2$2.AXFormatPipe, name: "format" }, { kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i2$1.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "iconOnly", "type", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "loadingTextChange"] }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "directive", type: i4$1.AXTranslatorDirective, selector: "[translate]" }], encapsulation: i0.ViewEncapsulation.None }); }
|
4792
|
-
}
|
4793
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AXMDocumentExplorerDetailPanelComponent, decorators: [{
|
4794
|
-
type: Component,
|
4795
|
-
args: [{ selector: 'axm-document-explorer-detail-panel', standalone: true, encapsulation: ViewEncapsulation.None, imports: [
|
4796
|
-
CommonModule,
|
4797
|
-
AXDecoratorModule,
|
4798
|
-
AXFormatModule,
|
4799
|
-
AXButtonModule,
|
4800
|
-
AXTranslationModule
|
4801
|
-
], template: "<!-- Multiple Selected -->\n@if(vm.hasMultipleSelectedItems()) {\n<div class=\"__header\" *translate=\"let t\">\n <div class=\"__title\">\n <i class=\"fa-fw fa-lg fa-solid\"></i>\n <span> {{ vm.selectedCount() }} {{ t('itemsSelected', { scope: 'common' }) | async }}</span>\n </div>\n <ax-button [look]=\"'blank'\" class=\"ax-sm ax-rounded-full\" (onClick)=\"vm.closeDetailPanel()\">\n <ax-icon icon=\"fa-solid fa-xmark\"></ax-icon>\n </ax-button>\n</div>\n<div class=\"__content\"></div>\n}\n<!-- Single Selected -->\n@else {\n<!-- Info -->\n@let nodeInfo = vm.getNodeInfo((vm.selectedNode() ?? vm.currentFolder())!);\n<div class=\"__header\">\n <div class=\"__title\">\n <i class=\"fa-fw fa-lg {{ nodeInfo.icon }} fa-solid\"></i>\n <span>{{ nodeInfo.name }}</span>\n </div>\n <ax-button [look]=\"'blank'\" class=\"ax-sm ax-rounded-full\" (onClick)=\"vm.closeDetailPanel()\">\n <ax-icon icon=\"fa-solid fa-xmark\"></ax-icon>\n </ax-button>\n</div>\n<div class=\"__content\">\n @for(section of nodeInfo.sections; track section.title) {\n <div class=\"__section\">\n <div class=\"__title\">\n <span>{{ section.title }}</span>\n </div>\n <div class=\"__content\">\n @for(detail of section.details; track detail.title) {\n <div class=\"__row\">\n <div class=\"__title\">\n <span>{{ detail.title }}</span>\n </div>\n <div class=\"__content\">\n @if(detail.format) {\n <span>{{ detail.content | format : detail.format | async }}</span>\n } @else {\n <span>{{ detail.content ?? '---' }}</span>\n }\n </div>\n </div>\n }\n </div>\n </div>\n }\n</div>\n}\n", styles: ["axm-document-explorer-detail-panel{display:flex;flex-direction:column;border-radius:.5rem;border-width:1px;--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow);background-color:rgb(var(--ax-sys-color-lightest-surface));color:rgb(var(--ax-sys-color-on-lightest-surface));border-color:rgb(var(--ax-sys-color-border-lightest-surface))}@media (min-width: 1024px){axm-document-explorer-detail-panel{min-width:20rem}}axm-document-explorer-detail-panel>.__header{display:flex;flex-direction:row;align-items:center;justify-content:space-between;border-bottom-width:1px;padding:1rem}axm-document-explorer-detail-panel>.__header>.__title{display:flex;width:90%;flex-direction:row;align-items:center;gap:.5rem}axm-document-explorer-detail-panel>.__header>.__title span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:start;font-weight:600;line-height:1.625}axm-document-explorer-detail-panel>.__content{display:flex;flex-direction:column}axm-document-explorer-detail-panel>.__content>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px * var(--tw-divide-y-reverse))}axm-document-explorer-detail-panel>.__content>.__section{display:flex;flex-direction:column;padding:1rem}axm-document-explorer-detail-panel>.__content>.__section>.__title{margin-bottom:1rem;font-size:.875rem;line-height:1.25rem;font-weight:700}axm-document-explorer-detail-panel>.__content>.__section>.__content{display:flex;flex-direction:column;gap:1rem}axm-document-explorer-detail-panel>.__content>.__section>.__content>.__row{display:flex;flex-direction:column;gap:.25rem}axm-document-explorer-detail-panel>.__content>.__section>.__content>.__row>.__title{display:flex;font-size:.875rem;line-height:1.25rem;font-weight:600;opacity:.9}axm-document-explorer-detail-panel>.__content>.__section>.__content>.__row>.__content{display:flex;flex-direction:row;align-items:center;gap:.5rem}axm-document-explorer-detail-panel>.__content>.__section>.__content>.__row>.__content span{opacity:.7}\n"] }]
|
4802
|
-
}] });
|
4803
|
-
|
4804
|
-
class AXMDocumentDriveComponent extends AXPPageLayoutBaseComponent {
|
4805
|
-
constructor() {
|
4806
|
-
super(...arguments);
|
4807
|
-
//#region ---------------- Services & Dependencies ----------------
|
4808
|
-
this.rootConfig = RootConfig;
|
4809
|
-
this.fileTypeService = inject(AXPFileTypeProviderService);
|
4810
|
-
this.driveService = inject(AXMDocumentManagerService);
|
4811
|
-
this.vm = inject(AXPDocumentExplorerViewModel);
|
4812
|
-
this.router = inject(Router);
|
4813
|
-
this.activatedRoute = inject(ActivatedRoute);
|
4814
|
-
//#endregion
|
4815
|
-
//#region ---------------- View Properties ----------------
|
4816
|
-
this.filterItems = signal([]);
|
4817
|
-
this.selectedFilter = signal('all');
|
4818
|
-
this.sortItems = signal([
|
4819
|
-
{ key: 'name', textKey: 'actions.sort-by-name', icon: 'fa-light fa-font' },
|
4820
|
-
{ key: 'modified', textKey: 'actions.sort-by-date', icon: 'fa-light fa-calendar' },
|
4821
|
-
{ key: 'size', textKey: 'actions.sort-by-size', icon: 'fa-light fa-weight-hanging' },
|
4822
|
-
]);
|
4823
|
-
this.viewsItems = signal([
|
4824
|
-
{ key: 'large-icons', icon: 'fa-light fa-grid' },
|
4825
|
-
{ key: 'small-icons', icon: 'fa-light fa-grid', break: true },
|
4826
|
-
{ key: 'large-tiles', icon: 'fa-grid-2' },
|
4827
|
-
{ key: 'small-tiles', icon: 'fa-grid-2', break: true },
|
4828
|
-
{ key: 'details', icon: 'fa-bars', break: true },
|
4829
|
-
{ key: 'list', icon: 'fa-list' },
|
4830
|
-
]);
|
4831
|
-
this.selectedViewMode = computed(() => this.viewsItems().find((item) => item.key === this.vm.viewMode()) || this.viewsItems()[0]);
|
4832
|
-
this.selectionMode = signal('single');
|
4833
|
-
this.documentExplorer = viewChild(AXMDocumentExplorerComponent);
|
4834
|
-
//#endregion
|
4835
|
-
//#region ---------------- Computed Properties ----------------
|
4836
|
-
this.selectedSort = computed(() => {
|
4837
|
-
const items = this.sortItems();
|
4838
|
-
return items.find((item) => item.key === this.vm.sortField()) || items[0];
|
4298
|
+
await new Promise((resolve) => setTimeout(resolve, 100));
|
4299
|
+
const node = {
|
4300
|
+
id: id,
|
4301
|
+
name: options?.name || 'virtual',
|
4302
|
+
type: 'folder',
|
4303
|
+
children: files,
|
4304
|
+
parentId: options?.parentId || null,
|
4305
|
+
size: 0,
|
4306
|
+
storageType: 'virtual',
|
4307
|
+
};
|
4308
|
+
patchState(store, {
|
4309
|
+
currentNode: node,
|
4310
|
+
currentPath: [
|
4311
|
+
node
|
4312
|
+
],
|
4313
|
+
folders: files.filter((item) => item.type === 'folder'),
|
4314
|
+
files: files.filter((item) => item.type === 'file'),
|
4315
|
+
itemsCount: files.length,
|
4316
|
+
availableSpace: await driveService.getAvailableSpace(),
|
4317
|
+
loadingFolderId: null,
|
4318
|
+
isLoading: false,
|
4319
|
+
navigatingFolderId: null,
|
4839
4320
|
});
|
4840
|
-
|
4841
|
-
|
4842
|
-
|
4843
|
-
|
4844
|
-
|
4845
|
-
|
4321
|
+
},
|
4322
|
+
setViewMode(mode) {
|
4323
|
+
patchState(store, { viewMode: mode });
|
4324
|
+
settingService.scope(AXPPlatformScope.User).set(AXPDocumentExplorerSettings.ViewMode, mode);
|
4325
|
+
},
|
4326
|
+
isViewMode(mode) {
|
4327
|
+
return store.viewMode() === mode;
|
4328
|
+
},
|
4329
|
+
setSortField(field) {
|
4330
|
+
patchState(store, { sortField: field });
|
4331
|
+
settingService.scope(AXPPlatformScope.User).set(AXPDocumentExplorerSettings.SortField, field);
|
4332
|
+
this.refresh();
|
4333
|
+
},
|
4334
|
+
setSortDirection(direction) {
|
4335
|
+
patchState(store, { sortDirection: direction });
|
4336
|
+
settingService.scope(AXPPlatformScope.User).set(AXPDocumentExplorerSettings.SortDirection, direction);
|
4337
|
+
this.refresh();
|
4338
|
+
},
|
4339
|
+
setSelectionMode(mode) {
|
4340
|
+
patchState(store, { selectionMode: mode });
|
4341
|
+
},
|
4342
|
+
setDrive(scope) {
|
4343
|
+
patchState(store, { currentDrive: scope });
|
4344
|
+
},
|
4345
|
+
isLoadingFolder(folderId) {
|
4346
|
+
return store.loadingFolderId() === folderId;
|
4347
|
+
},
|
4348
|
+
getFileInfo(fileName) {
|
4349
|
+
const fileTypes = store.fileTypes();
|
4350
|
+
const extension = fileName.split('.').pop()?.toLowerCase() || '';
|
4351
|
+
const extensions = fileTypes.flatMap((type) => type.extensions);
|
4352
|
+
const fileType = extensions.find((e) => e.name === extension);
|
4353
|
+
return {
|
4354
|
+
icon: fileType?.icon || 'fa-light fa-file',
|
4355
|
+
type: fileType?.name || 'Unknown',
|
4356
|
+
};
|
4357
|
+
},
|
4358
|
+
getNodeInfo(node) {
|
4359
|
+
// If no node, return a default object
|
4360
|
+
if (!node) {
|
4361
|
+
return {
|
4362
|
+
name: '---',
|
4363
|
+
icon: 'fa-light fa-folder',
|
4364
|
+
type: 'Folder',
|
4365
|
+
sections: [
|
4366
|
+
{
|
4367
|
+
title: 'Details',
|
4368
|
+
details: [],
|
4369
|
+
},
|
4370
|
+
],
|
4371
|
+
};
|
4372
|
+
}
|
4373
|
+
// If the node is a file, return the file info
|
4374
|
+
if (node.type === 'file') {
|
4375
|
+
const fileTypes = store.fileTypes();
|
4376
|
+
const extension = node.name.split('.').pop()?.toLowerCase() || '';
|
4377
|
+
const extensions = fileTypes.flatMap((type) => type.extensions);
|
4378
|
+
const fileType = extensions.find((e) => e.name === extension);
|
4379
|
+
return {
|
4380
|
+
name: node.name,
|
4381
|
+
icon: fileType?.icon || 'fa-light fa-file',
|
4382
|
+
type: 'File',
|
4383
|
+
sections: [
|
4384
|
+
{
|
4385
|
+
title: 'Details',
|
4386
|
+
details: [
|
4387
|
+
{
|
4388
|
+
title: 'Description',
|
4389
|
+
content: node.description,
|
4390
|
+
icon: 'fa-solid fa-file-lines',
|
4391
|
+
},
|
4392
|
+
{
|
4393
|
+
title: 'Size',
|
4394
|
+
content: node.size || 0,
|
4395
|
+
format: 'filesize',
|
4396
|
+
icon: 'fa-solid fa-file-lines',
|
4397
|
+
},
|
4398
|
+
{
|
4399
|
+
title: 'Created at',
|
4400
|
+
content: node.createdAt || new Date(),
|
4401
|
+
format: 'datetime',
|
4402
|
+
icon: 'fa-solid fa-calendar-days',
|
4403
|
+
},
|
4404
|
+
{
|
4405
|
+
title: 'Modified at',
|
4406
|
+
content: node.modifiedAt || new Date(),
|
4407
|
+
format: 'datetime',
|
4408
|
+
icon: 'fa-solid fa-calendar-days',
|
4409
|
+
},
|
4410
|
+
],
|
4411
|
+
},
|
4412
|
+
],
|
4413
|
+
};
|
4414
|
+
}
|
4415
|
+
// If the node is a folder, return the folder info
|
4416
|
+
else {
|
4417
|
+
return {
|
4418
|
+
name: node.name,
|
4419
|
+
icon: 'fa-light fa-folder ax-text-yellow-500',
|
4420
|
+
type: 'Folder',
|
4421
|
+
sections: [
|
4422
|
+
{
|
4423
|
+
title: 'Details',
|
4424
|
+
details: [
|
4425
|
+
{
|
4426
|
+
title: 'Description',
|
4427
|
+
content: node.description,
|
4428
|
+
icon: 'fa-solid fa-file-lines',
|
4429
|
+
},
|
4430
|
+
{
|
4431
|
+
title: 'Items',
|
4432
|
+
content: node.childrenCount,
|
4433
|
+
icon: 'fa-solid fa-file-lines',
|
4434
|
+
},
|
4435
|
+
{
|
4436
|
+
title: 'Size',
|
4437
|
+
content: node.size || 0,
|
4438
|
+
format: 'filesize',
|
4439
|
+
icon: 'fa-solid fa-file-lines',
|
4440
|
+
},
|
4441
|
+
{
|
4442
|
+
title: 'Created at',
|
4443
|
+
content: node.createdAt || new Date(),
|
4444
|
+
format: 'datetime',
|
4445
|
+
icon: 'fa-solid fa-calendar-days',
|
4446
|
+
},
|
4447
|
+
{
|
4448
|
+
title: 'Modified at',
|
4449
|
+
content: node.modifiedAt || new Date(),
|
4450
|
+
format: 'datetime',
|
4451
|
+
icon: 'fa-solid fa-calendar-days',
|
4452
|
+
},
|
4453
|
+
],
|
4454
|
+
},
|
4455
|
+
],
|
4456
|
+
};
|
4457
|
+
}
|
4458
|
+
},
|
4459
|
+
sortItems(items) {
|
4460
|
+
const field = store.sortField();
|
4461
|
+
const direction = store.sortDirection();
|
4462
|
+
return [...items].sort((a, b) => {
|
4463
|
+
let comparison = 0;
|
4464
|
+
switch (field) {
|
4465
|
+
case 'name':
|
4466
|
+
comparison = a.name.localeCompare(b.name);
|
4467
|
+
break;
|
4468
|
+
case 'modified':
|
4469
|
+
const aDate = a.modifiedAt ? new Date(a.modifiedAt) : new Date(0);
|
4470
|
+
const bDate = b.modifiedAt ? new Date(b.modifiedAt) : new Date(0);
|
4471
|
+
comparison = aDate.getTime() - bDate.getTime();
|
4472
|
+
break;
|
4473
|
+
case 'size':
|
4474
|
+
comparison = (a.size || 0) - (b.size || 0);
|
4475
|
+
break;
|
4846
4476
|
}
|
4477
|
+
return direction === 'asc' ? comparison : -comparison;
|
4847
4478
|
});
|
4848
|
-
|
4849
|
-
|
4850
|
-
|
4851
|
-
|
4852
|
-
|
4853
|
-
|
4854
|
-
|
4855
|
-
//#endregion
|
4856
|
-
//#region ---------------- Effects ----------------
|
4857
|
-
#navigateEffect;
|
4858
|
-
#loadingEffect;
|
4859
|
-
//#endregion
|
4860
|
-
//#region ---------------- Lifecycle Hooks ----------------
|
4861
|
-
async ngOnInit() {
|
4862
|
-
super.ngOnInit();
|
4863
|
-
await this.loadFilterItems();
|
4864
|
-
const snapshot = this.activatedRoute.snapshot;
|
4865
|
-
const routerScope = resolvePlatformScopeKey(snapshot.parent?.paramMap.get('scope')?.trim()?.toLowerCase());
|
4866
|
-
await this.vm.initialize({ browseMode: 'file', scope: routerScope });
|
4867
|
-
this.activatedRoute.paramMap.subscribe(async () => {
|
4868
|
-
this.loadDrive();
|
4869
|
-
});
|
4870
|
-
}
|
4871
|
-
//#endregion
|
4872
|
-
//#region ---------------- Event Handlers ----------------
|
4873
|
-
async handleSearchChange(event) {
|
4874
|
-
const result = await this.driveService.searchNodes(event.value, AXPPlatformScope.Tenant);
|
4875
|
-
}
|
4876
|
-
handleCtrlKey(e) {
|
4877
|
-
this.selectionMode.set('multiple');
|
4878
|
-
}
|
4879
|
-
handleCtrlKeyUp(e) {
|
4880
|
-
this.selectionMode.set('single');
|
4881
|
-
}
|
4882
|
-
handleNavigateToFolder(folderId) {
|
4883
|
-
this.router.navigate([
|
4884
|
-
`${this.sessionService.application?.name}/drive/${resolvePlatformScopeName(this.vm.scope())}/${folderId}`,
|
4885
|
-
]);
|
4886
|
-
}
|
4887
|
-
//#endregion
|
4888
|
-
//#region ---------------- Data Loading Methods ----------------
|
4889
|
-
async loadDrive() {
|
4890
|
-
const folderId = this.activatedRoute.snapshot.paramMap.get('id');
|
4891
|
-
if (folderId) {
|
4892
|
-
await this.vm.loadFolderContents(folderId);
|
4479
|
+
},
|
4480
|
+
async refresh() {
|
4481
|
+
if (!store.isVirtual()) {
|
4482
|
+
const currentFolder = store.currentNode();
|
4483
|
+
if (currentFolder) {
|
4484
|
+
await this._load(currentFolder.id);
|
4485
|
+
}
|
4893
4486
|
}
|
4894
4487
|
else {
|
4895
|
-
|
4896
|
-
|
4897
|
-
|
4898
|
-
|
4488
|
+
patchState(store, { loadingFolderId: 'fake' });
|
4489
|
+
patchState(store, { loadingFolderId: null });
|
4490
|
+
}
|
4491
|
+
},
|
4492
|
+
navigateToUp() {
|
4493
|
+
const currentNode = store.currentNode();
|
4494
|
+
const parentId = currentNode?.parentId;
|
4495
|
+
if (parentId && currentNode) {
|
4496
|
+
patchState(store, {
|
4497
|
+
backHistory: [...store.backHistory(), { folderId: currentNode.id, path: store.currentPath() }],
|
4899
4498
|
});
|
4900
|
-
|
4901
|
-
|
4902
|
-
|
4903
|
-
|
4904
|
-
|
4905
|
-
|
4499
|
+
patchState(store, { navigatingFolderId: parentId });
|
4500
|
+
this.loadFolderContents(parentId);
|
4501
|
+
}
|
4502
|
+
},
|
4503
|
+
async navigateBack() {
|
4504
|
+
const history = store.backHistory();
|
4505
|
+
if (history.length === 0) {
|
4506
|
+
return;
|
4507
|
+
}
|
4508
|
+
const lastEntry = history[history.length - 1];
|
4509
|
+
patchState(store, { backHistory: history.slice(0, history.length - 1) });
|
4510
|
+
patchState(store, { navigatingFolderId: lastEntry.folderId });
|
4511
|
+
await this.loadFolderContents(lastEntry.folderId);
|
4512
|
+
},
|
4513
|
+
async openGalleryWithFolderId() {
|
4514
|
+
const folder = store.currentNode();
|
4515
|
+
const files = folder?.children?.filter((item) => item.type === 'file') || [];
|
4516
|
+
await driveService.showFileViewerPopup(files[0]);
|
4517
|
+
},
|
4518
|
+
//TODO: Delete only one node at a time
|
4519
|
+
async deleteNodes(nodes = store.selectedNodes()) {
|
4520
|
+
if (store.isVirtual()) {
|
4521
|
+
patchState(store, {
|
4522
|
+
files: store.currentFolderContents().files.filter((file) => !nodes.some((node) => node.name === file.name)),
|
4523
|
+
});
|
4524
|
+
this.deselectAll();
|
4525
|
+
}
|
4526
|
+
else {
|
4527
|
+
const result = await driveService.showDeleteNodesDialog(nodes);
|
4528
|
+
if (result) {
|
4529
|
+
this.deselectAll();
|
4530
|
+
await this.refresh();
|
4906
4531
|
}
|
4907
4532
|
}
|
4908
|
-
|
4909
|
-
|
4910
|
-
|
4911
|
-
|
4912
|
-
|
4533
|
+
},
|
4534
|
+
toggleSelect(node) {
|
4535
|
+
if (store.selectionMode() === 'multiple') {
|
4536
|
+
patchState(store, {
|
4537
|
+
selectedNodes: store.selectedNodes().includes(node)
|
4538
|
+
? store.selectedNodes().filter((n) => n.id !== node.id)
|
4539
|
+
: [...store.selectedNodes(), node],
|
4540
|
+
});
|
4541
|
+
}
|
4542
|
+
else {
|
4543
|
+
patchState(store, { selectedNodes: [node] });
|
4544
|
+
}
|
4545
|
+
},
|
4546
|
+
isItemSelected(node) {
|
4547
|
+
return store.selectedNodes().some((selectedNode) => selectedNode.id === node.id);
|
4548
|
+
},
|
4549
|
+
selectAll() {
|
4550
|
+
patchState(store, { selectedNodes: [...store.folders(), ...store.files()] });
|
4551
|
+
},
|
4552
|
+
deselectAll() {
|
4553
|
+
patchState(store, { selectedNodes: [] });
|
4554
|
+
},
|
4555
|
+
openDetailPanel() {
|
4556
|
+
patchState(store, { detailPanel: true });
|
4557
|
+
},
|
4558
|
+
closeDetailPanel() {
|
4559
|
+
patchState(store, { detailPanel: false });
|
4560
|
+
},
|
4561
|
+
toggleDetailPanel() {
|
4562
|
+
patchState(store, { detailPanel: !store.detailPanel() });
|
4563
|
+
},
|
4564
|
+
//#region Menu Items
|
4565
|
+
async getFolderAddMenuItems() {
|
4566
|
+
const scope = RootConfig.config.i18n;
|
4567
|
+
return [
|
4568
|
+
{
|
4569
|
+
title: await translateService.translateAsync('actions.create-folder', { scope }),
|
4570
|
+
icon: 'fa-light fa-folder-plus',
|
4571
|
+
break: true,
|
4572
|
+
command: {
|
4573
|
+
name: 'new-folder',
|
4574
|
+
options: {
|
4575
|
+
folderId: store.currentFolder()?.id,
|
4576
|
+
},
|
4577
|
+
},
|
4578
|
+
},
|
4579
|
+
...(store.currentFolder()?.documentTypes?.map((type) => ({
|
4580
|
+
title: type.title,
|
4581
|
+
//icon: type.icon,
|
4582
|
+
icon: 'fa-light fa-file-arrow-up',
|
4583
|
+
break: true,
|
4584
|
+
command: {
|
4585
|
+
name: `upload.${type.name}`,
|
4586
|
+
options: {
|
4587
|
+
folderId: store.currentFolder()?.id,
|
4588
|
+
documentType: type,
|
4589
|
+
},
|
4590
|
+
},
|
4591
|
+
})) ?? []),
|
4592
|
+
// {
|
4593
|
+
// title: await translateService.translateAsync('actions.open-gallery', { scope }),
|
4594
|
+
// icon: 'fa-light fa-images',
|
4595
|
+
// break: true,
|
4596
|
+
// command: {
|
4597
|
+
// name: 'open-gallery',
|
4598
|
+
// options: {
|
4599
|
+
// folderId: store.currentFolder()?.id,
|
4600
|
+
// },
|
4601
|
+
// },
|
4602
|
+
// },
|
4603
|
+
];
|
4604
|
+
},
|
4605
|
+
async getFolderActionMenuItems() {
|
4606
|
+
return [
|
4607
|
+
{
|
4608
|
+
name: 'refresh',
|
4609
|
+
title: await translateService.translateAsync('refresh'),
|
4610
|
+
icon: 'fa-light fa-rotate-right',
|
4611
|
+
// break: true,
|
4612
|
+
},
|
4613
|
+
// {
|
4614
|
+
// name: 'delete',
|
4615
|
+
// title: await translateService.translateAsync('delete'),
|
4616
|
+
// color: 'danger',
|
4617
|
+
// icon: 'fa-light fa-trash',
|
4618
|
+
// },
|
4619
|
+
];
|
4620
|
+
},
|
4621
|
+
//#endregion
|
4622
|
+
//#region Context Menu Items
|
4623
|
+
async getContextMenuItems() {
|
4624
|
+
return [...(await this.getFolderAddMenuItems()), ...(await this.getFolderActionMenuItems())];
|
4625
|
+
},
|
4626
|
+
//#endregion
|
4627
|
+
//#region ---- Menu Items ----
|
4628
|
+
/**
|
4629
|
+
* Returns menu items for file context menu
|
4630
|
+
*/
|
4631
|
+
async getFileContextMenuItems(node) {
|
4632
|
+
const trans = async (key) => await translateService.translateAsync(key, { scope: RootConfig.config.i18n });
|
4633
|
+
return [
|
4634
|
+
{
|
4635
|
+
name: 'open-file',
|
4636
|
+
text: await trans('menu.open'),
|
4637
|
+
icon: this.getFileInfo(node.name).icon,
|
4638
|
+
data: node,
|
4639
|
+
},
|
4640
|
+
{
|
4641
|
+
name: 'download',
|
4642
|
+
text: await trans('menu.download'),
|
4643
|
+
icon: 'fa-light fa-download',
|
4644
|
+
data: node,
|
4645
|
+
},
|
4646
|
+
{
|
4647
|
+
name: 'share',
|
4648
|
+
text: await trans('menu.share.share'),
|
4649
|
+
icon: 'fa-light fa-share-nodes',
|
4650
|
+
items: [
|
4651
|
+
{
|
4652
|
+
name: 'share',
|
4653
|
+
text: await trans('menu.share.share'),
|
4654
|
+
icon: 'fa-light fa-users',
|
4655
|
+
data: node,
|
4656
|
+
},
|
4657
|
+
{
|
4658
|
+
name: 'share-with-email',
|
4659
|
+
text: await trans('menu.share.email'),
|
4660
|
+
icon: 'fa-light fa-envelope',
|
4661
|
+
data: node,
|
4662
|
+
},
|
4663
|
+
{
|
4664
|
+
name: 'link',
|
4665
|
+
text: await trans('menu.share.link'),
|
4666
|
+
icon: 'fa-light fa-link',
|
4667
|
+
data: node,
|
4668
|
+
},
|
4669
|
+
],
|
4670
|
+
break: true,
|
4671
|
+
},
|
4672
|
+
{
|
4673
|
+
name: 'file-info',
|
4674
|
+
text: await trans('menu.information'),
|
4675
|
+
icon: 'fa-light fa-circle-info',
|
4676
|
+
items: [
|
4677
|
+
{
|
4678
|
+
name: 'rename',
|
4679
|
+
text: await trans('menu.rename'),
|
4680
|
+
icon: 'fa-light fa-pencil',
|
4681
|
+
data: node,
|
4682
|
+
},
|
4683
|
+
{
|
4684
|
+
name: 'properties',
|
4685
|
+
text: await trans('menu.properties'),
|
4686
|
+
icon: 'fa-light fa-memo-circle-info',
|
4687
|
+
break: true,
|
4688
|
+
data: node,
|
4689
|
+
},
|
4690
|
+
{
|
4691
|
+
name: 'lock',
|
4692
|
+
text: await trans('menu.lock'),
|
4693
|
+
icon: 'fa-light fa-lock',
|
4694
|
+
data: node,
|
4695
|
+
},
|
4696
|
+
],
|
4697
|
+
break: true,
|
4698
|
+
},
|
4699
|
+
{
|
4700
|
+
name: 'copy',
|
4701
|
+
text: await trans('menu.make-copy'),
|
4702
|
+
icon: 'fa-light fa-copy',
|
4703
|
+
data: node,
|
4704
|
+
},
|
4705
|
+
{
|
4706
|
+
name: 'copy-to',
|
4707
|
+
text: await trans('menu.copy-to'),
|
4708
|
+
icon: 'fa-light fa-copy',
|
4709
|
+
data: node,
|
4710
|
+
},
|
4711
|
+
{
|
4712
|
+
name: 'move-to',
|
4713
|
+
text: await trans('menu.move-to'),
|
4714
|
+
icon: 'fa-light fa-arrow-right-arrow-left',
|
4715
|
+
break: true,
|
4716
|
+
data: node,
|
4717
|
+
},
|
4718
|
+
{
|
4719
|
+
name: 'delete',
|
4720
|
+
text: await trans('menu.delete'),
|
4721
|
+
color: 'danger',
|
4722
|
+
icon: 'fa-light fa-trash',
|
4723
|
+
data: node,
|
4724
|
+
},
|
4725
|
+
];
|
4726
|
+
},
|
4727
|
+
/**
|
4728
|
+
* Returns menu items for folder context menu
|
4729
|
+
*/
|
4730
|
+
async getFolderContextMenuItems(node) {
|
4731
|
+
const trans = async (key) => await translateService.translateAsync(key, { scope: RootConfig.config.i18n });
|
4913
4732
|
const items = [
|
4914
|
-
{
|
4915
|
-
|
4916
|
-
|
4917
|
-
|
4918
|
-
|
4919
|
-
}
|
4733
|
+
{
|
4734
|
+
name: 'open-folder',
|
4735
|
+
text: await trans('menu.open'),
|
4736
|
+
icon: 'fa-light fa-folder-open',
|
4737
|
+
data: node,
|
4738
|
+
}
|
4920
4739
|
];
|
4921
|
-
|
4922
|
-
|
4923
|
-
|
4924
|
-
|
4925
|
-
|
4926
|
-
|
4927
|
-
|
4928
|
-
|
4929
|
-
|
4930
|
-
|
4931
|
-
|
4932
|
-
|
4933
|
-
|
4934
|
-
|
4935
|
-
|
4936
|
-
|
4937
|
-
return 'file-types.all';
|
4740
|
+
if (node?.documentTypes?.length) {
|
4741
|
+
items.push({
|
4742
|
+
text: await trans('menu.upload'),
|
4743
|
+
icon: 'fa-light fa-file-arrow-up',
|
4744
|
+
break: true,
|
4745
|
+
items: node.documentTypes.map((type, index, array) => ({
|
4746
|
+
name: `upload.${type.name}`,
|
4747
|
+
text: type.title,
|
4748
|
+
icon: 'fa-light fa-file-arrow-up',
|
4749
|
+
break: index !== array.length - 1,
|
4750
|
+
data: {
|
4751
|
+
node,
|
4752
|
+
documentType: type,
|
4753
|
+
},
|
4754
|
+
})),
|
4755
|
+
});
|
4938
4756
|
}
|
4939
|
-
|
4940
|
-
|
4941
|
-
|
4942
|
-
|
4943
|
-
|
4944
|
-
async getPrimaryMenuItems() {
|
4945
|
-
if (this.vm.hasMultipleSelectedItems()) {
|
4946
|
-
return [
|
4757
|
+
items.push({
|
4758
|
+
name: 'folder-info',
|
4759
|
+
text: await trans('menu.information'),
|
4760
|
+
icon: 'fa-light fa-circle-info',
|
4761
|
+
items: [
|
4947
4762
|
{
|
4948
|
-
name: '
|
4949
|
-
|
4950
|
-
icon: 'fa-light fa-
|
4951
|
-
|
4763
|
+
name: 'rename',
|
4764
|
+
text: await trans('menu.rename'),
|
4765
|
+
icon: 'fa-light fa-pencil',
|
4766
|
+
data: node,
|
4952
4767
|
},
|
4953
|
-
];
|
4954
|
-
}
|
4955
|
-
const addItemItems = await this.vm.getFolderAddMenuItems();
|
4956
|
-
addItemItems[addItemItems.length - 1].break = false;
|
4957
|
-
return [
|
4958
|
-
{
|
4959
|
-
title: 't("add-item")',
|
4960
|
-
icon: 'fa-light fa-plus',
|
4961
|
-
color: 'primary',
|
4962
|
-
items: addItemItems,
|
4963
|
-
},
|
4964
|
-
];
|
4965
|
-
}
|
4966
|
-
async getSecondaryMenuItems() {
|
4967
|
-
if (this.vm.hasMultipleSelectedItems()) {
|
4968
|
-
return [
|
4969
4768
|
{
|
4970
|
-
name: '
|
4971
|
-
|
4972
|
-
icon: 'fa-light fa-
|
4973
|
-
|
4769
|
+
name: 'properties',
|
4770
|
+
text: await trans('menu.properties'),
|
4771
|
+
icon: 'fa-light fa-memo-circle-info',
|
4772
|
+
break: true,
|
4773
|
+
data: node,
|
4974
4774
|
},
|
4975
|
-
|
4976
|
-
|
4977
|
-
|
4978
|
-
|
4979
|
-
|
4980
|
-
|
4981
|
-
|
4982
|
-
|
4983
|
-
|
4984
|
-
|
4985
|
-
|
4986
|
-
|
4987
|
-
|
4988
|
-
|
4989
|
-
|
4990
|
-
|
4991
|
-
|
4992
|
-
|
4993
|
-
|
4994
|
-
|
4775
|
+
{
|
4776
|
+
name: 'lock',
|
4777
|
+
text: await trans('menu.lock'),
|
4778
|
+
icon: 'fa-light fa-lock',
|
4779
|
+
data: node,
|
4780
|
+
},
|
4781
|
+
],
|
4782
|
+
break: true,
|
4783
|
+
}, {
|
4784
|
+
name: 'copy',
|
4785
|
+
text: await trans('menu.make-copy'),
|
4786
|
+
icon: 'fa-light fa-copy',
|
4787
|
+
data: node,
|
4788
|
+
}, {
|
4789
|
+
name: 'copy-to',
|
4790
|
+
text: await trans('menu.copy-to'),
|
4791
|
+
icon: 'fa-light fa-copy',
|
4792
|
+
data: node,
|
4793
|
+
}, {
|
4794
|
+
name: 'move-to',
|
4795
|
+
text: await trans('menu.move-to'),
|
4796
|
+
icon: 'fa-light fa-arrow-right-arrow-left',
|
4797
|
+
break: true,
|
4798
|
+
data: node,
|
4799
|
+
}, {
|
4800
|
+
name: 'delete',
|
4801
|
+
text: await trans('menu.delete'),
|
4802
|
+
color: 'danger',
|
4803
|
+
icon: 'fa-light fa-trash',
|
4804
|
+
data: node,
|
4995
4805
|
});
|
4996
|
-
|
4997
|
-
|
4998
|
-
|
4999
|
-
|
5000
|
-
|
5001
|
-
|
4806
|
+
return items;
|
4807
|
+
},
|
4808
|
+
/**
|
4809
|
+
* Returns context menu items based on node type
|
4810
|
+
*/
|
4811
|
+
async getNodeContextMenuItems(node) {
|
4812
|
+
if (node.type === 'file') {
|
4813
|
+
return await this.getFileContextMenuItems(node);
|
5002
4814
|
}
|
5003
|
-
|
5004
|
-
|
5005
|
-
onBackButtonClick() {
|
5006
|
-
if (this.vm.isUpAvailable()) {
|
5007
|
-
this.vm.navigateToUp();
|
4815
|
+
else {
|
4816
|
+
return await this.getFolderContextMenuItems(node);
|
5008
4817
|
}
|
5009
|
-
}
|
5010
|
-
|
5011
|
-
|
5012
|
-
|
5013
|
-
|
5014
|
-
|
5015
|
-
|
5016
|
-
|
5017
|
-
|
5018
|
-
|
5019
|
-
|
5020
|
-
|
5021
|
-
|
5022
|
-
|
5023
|
-
|
5024
|
-
|
4818
|
+
},
|
4819
|
+
//#endregion
|
4820
|
+
//#region ---- Menu Actions ----
|
4821
|
+
/**
|
4822
|
+
* Opens a file
|
4823
|
+
*/
|
4824
|
+
async openFile(node) {
|
4825
|
+
await driveService.openFile(node);
|
4826
|
+
},
|
4827
|
+
/**
|
4828
|
+
* Handles all menu item clicks
|
4829
|
+
*/
|
4830
|
+
async handleMenuItemClick(name, data) {
|
4831
|
+
const node = data;
|
4832
|
+
switch (name) {
|
4833
|
+
case 'open-folder':
|
4834
|
+
this.navigateToFolder(node.id);
|
4835
|
+
break;
|
4836
|
+
case 'open-file':
|
4837
|
+
await this.openFile(node);
|
5025
4838
|
break;
|
5026
4839
|
case 'open-gallery':
|
5027
|
-
if (folderId) {
|
5028
|
-
await this.
|
4840
|
+
if (data.folderId != null) {
|
4841
|
+
await this.openGalleryWithFolderId();
|
4842
|
+
}
|
4843
|
+
else {
|
4844
|
+
await this.openGallery(node);
|
5029
4845
|
}
|
5030
4846
|
break;
|
4847
|
+
case 'download':
|
4848
|
+
this.downloadFile(node);
|
4849
|
+
break;
|
4850
|
+
case 'new-folder':
|
4851
|
+
await this.createFolder(node);
|
4852
|
+
break;
|
4853
|
+
case 'paste':
|
4854
|
+
//TODO: Handle paste operation
|
4855
|
+
break;
|
4856
|
+
case 'move-to':
|
4857
|
+
await this.moveTo(node);
|
4858
|
+
break;
|
4859
|
+
case 'copy-to':
|
4860
|
+
await this.copyTo(node);
|
4861
|
+
break;
|
4862
|
+
case 'rename':
|
4863
|
+
await this.renameNode(node);
|
4864
|
+
break;
|
4865
|
+
case 'properties':
|
4866
|
+
await this.showFolderProperty(node);
|
4867
|
+
break;
|
4868
|
+
case 'delete':
|
4869
|
+
await this.deleteNodes([node]);
|
4870
|
+
break;
|
4871
|
+
case 'refresh':
|
4872
|
+
await this.refresh();
|
4873
|
+
break;
|
4874
|
+
case 'copy':
|
4875
|
+
await this.makeCopy(node);
|
4876
|
+
break;
|
4877
|
+
/*
|
4878
|
+
case 'share':
|
4879
|
+
await this.share(node);
|
4880
|
+
break;
|
4881
|
+
case 'share-with-email':
|
4882
|
+
await this.shareWithEmail(node);
|
4883
|
+
break;
|
4884
|
+
case 'link':
|
4885
|
+
await this.link(node);
|
4886
|
+
break;
|
4887
|
+
*/
|
4888
|
+
case 'lock':
|
4889
|
+
await this.lock(node);
|
4890
|
+
break;
|
4891
|
+
case 'unlock':
|
4892
|
+
await this.unlock(node);
|
4893
|
+
break;
|
5031
4894
|
default:
|
5032
|
-
if (
|
5033
|
-
await this.
|
5034
|
-
this.
|
4895
|
+
if (name?.startsWith('upload.')) {
|
4896
|
+
await this.uploadFileByType(data.node?.id ?? store.currentNode()?.id, data.documentType.id);
|
4897
|
+
await this.refresh();
|
5035
4898
|
}
|
5036
4899
|
break;
|
5037
4900
|
}
|
5038
|
-
}
|
5039
|
-
|
5040
|
-
|
5041
|
-
|
5042
|
-
|
5043
|
-
|
5044
|
-
|
5045
|
-
|
5046
|
-
|
5047
|
-
|
5048
|
-
|
5049
|
-
|
5050
|
-
|
5051
|
-
|
5052
|
-
|
5053
|
-
}
|
5054
|
-
|
5055
|
-
|
5056
|
-
|
5057
|
-
|
5058
|
-
|
5059
|
-
|
5060
|
-
|
5061
|
-
|
5062
|
-
|
5063
|
-
|
5064
|
-
|
5065
|
-
|
5066
|
-
|
5067
|
-
|
5068
|
-
|
5069
|
-
|
5070
|
-
|
5071
|
-
|
5072
|
-
|
5073
|
-
|
5074
|
-
|
5075
|
-
|
5076
|
-
|
5077
|
-
|
5078
|
-
|
5079
|
-
|
5080
|
-
|
5081
|
-
|
5082
|
-
|
5083
|
-
|
5084
|
-
|
5085
|
-
|
5086
|
-
}
|
5087
|
-
|
5088
|
-
|
5089
|
-
|
5090
|
-
|
5091
|
-
|
5092
|
-
|
5093
|
-
|
5094
|
-
|
5095
|
-
|
5096
|
-
|
5097
|
-
|
5098
|
-
|
5099
|
-
|
4901
|
+
},
|
4902
|
+
/**
|
4903
|
+
* Downloads the specified file
|
4904
|
+
*/
|
4905
|
+
downloadFile(node) {
|
4906
|
+
driveService.downloadFile(node);
|
4907
|
+
},
|
4908
|
+
/**
|
4909
|
+
* Opens the gallery for a folder
|
4910
|
+
*/
|
4911
|
+
async openGallery(node) {
|
4912
|
+
await driveService.showFileViewerPopup(node, {
|
4913
|
+
folderVirtualFiles: store.files(),
|
4914
|
+
index: store.files().findIndex((f) => f.id === node.id),
|
4915
|
+
});
|
4916
|
+
},
|
4917
|
+
/**
|
4918
|
+
* Shows properties for a folder
|
4919
|
+
*/
|
4920
|
+
async showFolderProperty(node) {
|
4921
|
+
if (await driveService.showFolderEditDialog(node)) {
|
4922
|
+
await this.refresh();
|
4923
|
+
}
|
4924
|
+
},
|
4925
|
+
/**
|
4926
|
+
* Creates a new folder
|
4927
|
+
*/
|
4928
|
+
async createFolder(node) {
|
4929
|
+
const parentId = node?.id ?? store.currentNode()?.id;
|
4930
|
+
if (parentId) {
|
4931
|
+
const result = await driveService.showCreateFolderDialog(parentId);
|
4932
|
+
if (result) {
|
4933
|
+
await this.refresh();
|
4934
|
+
}
|
4935
|
+
}
|
4936
|
+
},
|
4937
|
+
/**
|
4938
|
+
* Renames a node
|
4939
|
+
*/
|
4940
|
+
async renameNode(node) {
|
4941
|
+
if (node) {
|
4942
|
+
const result = await driveService.showRenamePopup(node);
|
4943
|
+
if (result) {
|
4944
|
+
if (node.storageType == 'virtual') {
|
4945
|
+
const files = store.files();
|
4946
|
+
const updatedFiles = files.map((file) => {
|
4947
|
+
if (file.id === result.id) {
|
4948
|
+
return result;
|
4949
|
+
}
|
4950
|
+
return file;
|
4951
|
+
});
|
4952
|
+
this.virtualFolder(updatedFiles);
|
4953
|
+
}
|
4954
|
+
await this.refresh();
|
4955
|
+
}
|
4956
|
+
return result;
|
4957
|
+
}
|
4958
|
+
return;
|
4959
|
+
},
|
4960
|
+
/**
|
4961
|
+
* Makes a copy of a node
|
4962
|
+
*/
|
4963
|
+
async makeCopy(node) {
|
4964
|
+
if (node) {
|
4965
|
+
try {
|
4966
|
+
await driveService.copy(node);
|
4967
|
+
await this.refresh();
|
4968
|
+
}
|
4969
|
+
catch (error) {
|
4970
|
+
console.error('Error copying node:', error);
|
4971
|
+
}
|
4972
|
+
}
|
4973
|
+
},
|
4974
|
+
/**
|
4975
|
+
* Locks a node
|
4976
|
+
*/
|
4977
|
+
async lock(node) {
|
4978
|
+
await driveService.showLockDialog(node);
|
4979
|
+
},
|
4980
|
+
/**
|
4981
|
+
* Unlocks a node
|
4982
|
+
*/
|
4983
|
+
async unlock(node) {
|
4984
|
+
await driveService.showUnlockDialog(node);
|
4985
|
+
},
|
4986
|
+
/**
|
4987
|
+
* Moves a node to a different location
|
4988
|
+
*/
|
4989
|
+
async moveTo(node) {
|
4990
|
+
if (node) {
|
4991
|
+
const result = await driveService.moveTo({ browseMode: 'folder', node: node, scope: store.scope() });
|
4992
|
+
if (result) {
|
4993
|
+
await this.refresh();
|
4994
|
+
}
|
4995
|
+
}
|
4996
|
+
},
|
4997
|
+
/**
|
4998
|
+
* Copies a node to a different location
|
4999
|
+
*/
|
5000
|
+
async copyTo(node) {
|
5001
|
+
if (node) {
|
5002
|
+
const result = await driveService.copyTo({ browseMode: 'folder', node: node, scope: store.scope() });
|
5003
|
+
if (result) {
|
5004
|
+
await this.refresh();
|
5005
|
+
}
|
5006
|
+
}
|
5007
|
+
},
|
5008
|
+
/**
|
5009
|
+
* Uploads a file by type
|
5010
|
+
*/
|
5011
|
+
async uploadFileByType(folderId, documentTypeId) {
|
5012
|
+
await driveService.uploadFileByType(folderId, documentTypeId);
|
5013
|
+
await this.refresh();
|
5014
|
+
},
|
5015
|
+
//#endregion
|
5016
|
+
})));
|
5100
5017
|
|
5101
|
-
class
|
5018
|
+
class AXMDocumentExplorerComponent {
|
5102
5019
|
constructor() {
|
5103
|
-
super(...arguments);
|
5104
5020
|
this.vm = inject(AXPDocumentExplorerViewModel);
|
5105
|
-
this.
|
5106
|
-
this.
|
5107
|
-
this.
|
5108
|
-
this.
|
5109
|
-
this.
|
5110
|
-
this.
|
5111
|
-
this.
|
5112
|
-
this.
|
5113
|
-
this.
|
5114
|
-
this.
|
5115
|
-
this.
|
5116
|
-
|
5117
|
-
|
5118
|
-
|
5119
|
-
|
5120
|
-
|
5121
|
-
|
5122
|
-
|
5123
|
-
|
5124
|
-
|
5125
|
-
|
5126
|
-
|
5127
|
-
|
5128
|
-
|
5129
|
-
|
5130
|
-
filters: [
|
5131
|
-
{
|
5132
|
-
field: 'refRecordId',
|
5133
|
-
operator: {
|
5134
|
-
type: 'equal',
|
5135
|
-
},
|
5136
|
-
value: this.entityRecordId() ?? this.contextService.data()?.id,
|
5137
|
-
},
|
5138
|
-
{
|
5139
|
-
field: 'refEntity',
|
5140
|
-
operator: {
|
5141
|
-
type: 'equal',
|
5142
|
-
},
|
5143
|
-
value: this.entity(),
|
5144
|
-
},
|
5145
|
-
],
|
5146
|
-
},
|
5147
|
-
});
|
5148
|
-
const filesToDelete = oldFiles.filter((file) => !this.vm.files().some((f) => f.id === file.id));
|
5149
|
-
this.driveService.deleteNodes(filesToDelete);
|
5150
|
-
const files = this.vm.files();
|
5151
|
-
for (const file of files) {
|
5152
|
-
if (file.fileId && file.storageType == 'virtual') {
|
5153
|
-
//TODO: Check logic if correct or not
|
5154
|
-
if (file.fileId && file.fileId.startsWith('http')) {
|
5155
|
-
this.fileStorageService.commit(file.fileId);
|
5156
|
-
}
|
5157
|
-
this.driveService.createFile({
|
5158
|
-
fileId: file.fileId,
|
5159
|
-
name: file.name,
|
5160
|
-
parentId: '123',
|
5161
|
-
size: file.size,
|
5162
|
-
title: file.name,
|
5163
|
-
refEntity: this.entity(),
|
5164
|
-
refRecordId: this.entityRecordId(),
|
5165
|
-
});
|
5166
|
-
}
|
5021
|
+
this.contextMenu = viewChild('itemsContextMenu');
|
5022
|
+
this.rootContextMenu = viewChild('rootContextMenu');
|
5023
|
+
this.driveService = inject(AXMDocumentManagerService);
|
5024
|
+
this.translateService = inject(AXTranslationService);
|
5025
|
+
this.layout = inject(AXPLayoutThemeService);
|
5026
|
+
this.browseMode = input('file');
|
5027
|
+
this.viewMode = input();
|
5028
|
+
this.selectionMode = input('none');
|
5029
|
+
this.showContextMenu = input(true);
|
5030
|
+
this.view = signal(null);
|
5031
|
+
this.viewMap = {
|
5032
|
+
list: async () => (await import('./acorex-modules-document-management-list-view.component-BHEwRA3m.mjs')).AXMDocumentExplorerListViewComponent,
|
5033
|
+
'small-tiles': async () => (await import('./acorex-modules-document-management-small-tiles-view.component-cpc_xfbT.mjs')).AXMDocumentExplorerSmallTilesViewComponent,
|
5034
|
+
'large-tiles': async () => (await import('./acorex-modules-document-management-large-tiles-view.component-CwYwVxoG.mjs')).AXMDocumentExplorerLargeTilesViewComponent,
|
5035
|
+
details: async () => (await import('./acorex-modules-document-management-details-view.component-CvHIETNf.mjs')).AXMDocumentExplorerDetailsViewComponent,
|
5036
|
+
'large-icons': async () => (await import('./acorex-modules-document-management-large-icons-view.component-BuV7MPG5.mjs')).AXMDocumentExplorerLargeIconsViewComponent,
|
5037
|
+
'small-icons': async () => (await import('./acorex-modules-document-management-small-icons-view.component-CD5UORaq.mjs')).AXMDocumentExplorerSmallIconsViewComponent,
|
5038
|
+
'attachment': async () => (await import('./acorex-modules-document-management-attachment-widget.component-C1-gQepw.mjs')).AXMDocumentExplorerAttachmentComponent,
|
5039
|
+
};
|
5040
|
+
this.#effect = effect(() => {
|
5041
|
+
if (this.vm.loadingFolderId() == null) {
|
5042
|
+
setTimeout(() => {
|
5043
|
+
this.contextMenu()?.refresh();
|
5044
|
+
this.rootContextMenu()?.refresh();
|
5045
|
+
}, 300);
|
5167
5046
|
}
|
5168
|
-
}
|
5169
|
-
|
5170
|
-
|
5171
|
-
|
5172
|
-
super.ngOnInit();
|
5173
|
-
// Load document types if type names are provided
|
5174
|
-
if (this.documentTypeNames().length > 0) {
|
5175
|
-
try {
|
5176
|
-
// Get all document types using query
|
5177
|
-
const result = await this.documentTypeService.query({
|
5178
|
-
skip: 0,
|
5179
|
-
take: 100,
|
5180
|
-
});
|
5181
|
-
// Filter to only the types we need
|
5182
|
-
// TODO fix with contains filter
|
5183
|
-
const filteredTypes = result.items.filter((type) => this.documentTypeNames().includes(type.name));
|
5184
|
-
this.documentTypes.set(filteredTypes);
|
5047
|
+
});
|
5048
|
+
this.#effect2 = effect(() => {
|
5049
|
+
if (this.viewMode()) {
|
5050
|
+
this.vm.setViewMode(this.viewMode());
|
5185
5051
|
}
|
5186
|
-
|
5187
|
-
|
5188
|
-
this.documentTypes.set([]);
|
5052
|
+
if (this.selectionMode()) {
|
5053
|
+
this.vm.setSelectionMode(this.selectionMode());
|
5189
5054
|
}
|
5190
|
-
}
|
5191
|
-
const files = await this.driveService.getAllFiles({
|
5192
|
-
skip: 0,
|
5193
|
-
take: 1000,
|
5194
|
-
filter: {
|
5195
|
-
logic: 'and',
|
5196
|
-
filters: [
|
5197
|
-
{
|
5198
|
-
field: 'refRecordId',
|
5199
|
-
operator: {
|
5200
|
-
type: 'equal',
|
5201
|
-
},
|
5202
|
-
value: this.entityRecordId(),
|
5203
|
-
},
|
5204
|
-
{
|
5205
|
-
field: 'refEntity',
|
5206
|
-
operator: {
|
5207
|
-
type: 'equal',
|
5208
|
-
},
|
5209
|
-
value: this.entity(),
|
5210
|
-
},
|
5211
|
-
],
|
5212
|
-
},
|
5213
5055
|
});
|
5214
|
-
this
|
5215
|
-
|
5216
|
-
|
5217
|
-
|
5218
|
-
|
5219
|
-
const result = ((await this.documentExplorer()?.chooseFile(scope)) ?? []).map((item) => ({
|
5220
|
-
...item,
|
5221
|
-
id: AXPDataGenerator.uuid(),
|
5222
|
-
storageType: 'virtual',
|
5223
|
-
parentId: 'virtual',
|
5224
|
-
}));
|
5225
|
-
const exists = this.vm.files();
|
5226
|
-
await this.updateContents([...exists, ...result]);
|
5056
|
+
this.#effect3 = effect(async () => {
|
5057
|
+
const func = get$1(this.viewMap, this.vm.viewMode()) ?? this.viewMap['large-tiles'];
|
5058
|
+
const comp = await func();
|
5059
|
+
this.view.set(comp);
|
5060
|
+
});
|
5227
5061
|
}
|
5228
|
-
|
5229
|
-
|
5230
|
-
|
5231
|
-
|
5232
|
-
|
5233
|
-
|
5234
|
-
|
5235
|
-
|
5236
|
-
const allFiles = this.vm.files();
|
5237
|
-
for await (const file of files) {
|
5238
|
-
const f = await this.fileStorageService.save({
|
5239
|
-
file: file,
|
5240
|
-
category: '',
|
5241
|
-
refId: this.entityRecordId(),
|
5242
|
-
refType: this.entity(),
|
5243
|
-
});
|
5244
|
-
allFiles.push({
|
5245
|
-
id: f.fileId,
|
5246
|
-
fileId: f.fileId,
|
5247
|
-
name: file.name,
|
5248
|
-
size: f.size,
|
5249
|
-
parentId: 'virtual',
|
5250
|
-
type: 'file',
|
5251
|
-
storageType: 'virtual',
|
5252
|
-
description: undefined
|
5253
|
-
});
|
5254
|
-
}
|
5255
|
-
await this.updateContents(allFiles);
|
5062
|
+
#effect;
|
5063
|
+
#effect2;
|
5064
|
+
#effect3;
|
5065
|
+
//#region Menu and Context Menu
|
5066
|
+
async handleContextMenuOnOpening(e) {
|
5067
|
+
const node = get$1(e.targetElement, '__data__');
|
5068
|
+
if (!node) {
|
5069
|
+
return;
|
5256
5070
|
}
|
5071
|
+
// Get menu items from ViewModel
|
5072
|
+
const items = await this.vm.getNodeContextMenuItems(node);
|
5073
|
+
// Set items directly to the context menu
|
5074
|
+
e.items.push(...items);
|
5257
5075
|
}
|
5258
|
-
async
|
5259
|
-
|
5260
|
-
|
5261
|
-
this.
|
5262
|
-
|
5263
|
-
|
5264
|
-
|
5265
|
-
|
5266
|
-
|
5076
|
+
async handleContextMenuRootOnOpening(e) {
|
5077
|
+
//TODO: check async translate method in acorex
|
5078
|
+
const items = [
|
5079
|
+
...(await this.vm.getFolderAddMenuItems()).map((m) => ({
|
5080
|
+
...m,
|
5081
|
+
name: m.command?.name,
|
5082
|
+
data: m.command?.options,
|
5083
|
+
})),
|
5084
|
+
...(await this.vm.getFolderActionMenuItems()),
|
5085
|
+
];
|
5086
|
+
const mappedItems = items.map((m) => ({
|
5087
|
+
...m,
|
5088
|
+
text: m.title,
|
5089
|
+
}));
|
5090
|
+
e.items.push(...mappedItems);
|
5091
|
+
e.items[e.items.length - 1].break = false;
|
5267
5092
|
}
|
5268
|
-
async
|
5269
|
-
|
5270
|
-
|
5271
|
-
if (result) {
|
5272
|
-
const allFiles = this.vm.files();
|
5273
|
-
const f = await this.fileStorageService.save({
|
5274
|
-
file: result,
|
5275
|
-
category: '',
|
5276
|
-
refId: this.entityRecordId(),
|
5277
|
-
refType: this.entity(),
|
5278
|
-
});
|
5279
|
-
allFiles.push({
|
5280
|
-
id: f.fileId,
|
5281
|
-
fileId: f.fileId,
|
5282
|
-
name: result.name,
|
5283
|
-
size: f.size,
|
5284
|
-
parentId: 'virtual',
|
5285
|
-
type: 'file',
|
5286
|
-
storageType: 'virtual',
|
5287
|
-
});
|
5288
|
-
await this.updateContents(allFiles);
|
5289
|
-
setTimeout(() => console.log(this.vm.files()), 10);
|
5290
|
-
}
|
5291
|
-
}
|
5292
|
-
catch (error) {
|
5293
|
-
console.error('Error in action callback:', error);
|
5093
|
+
async handleContextMenuItemClick(e) {
|
5094
|
+
if (e.item.name) {
|
5095
|
+
await this.vm.handleMenuItemClick(e.item.name, e.item.data);
|
5294
5096
|
}
|
5295
5097
|
}
|
5296
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type:
|
5297
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.10", type:
|
5098
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AXMDocumentExplorerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
5099
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.10", type: AXMDocumentExplorerComponent, isStandalone: true, selector: "axm-document-explorer", inputs: { browseMode: { classPropertyName: "browseMode", publicName: "browseMode", isSignal: true, isRequired: false, transformFunction: null }, viewMode: { classPropertyName: "viewMode", publicName: "viewMode", isSignal: true, isRequired: false, transformFunction: null }, selectionMode: { classPropertyName: "selectionMode", publicName: "selectionMode", isSignal: true, isRequired: false, transformFunction: null }, showContextMenu: { classPropertyName: "showContextMenu", publicName: "showContextMenu", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "contextMenu", first: true, predicate: ["itemsContextMenu"], descendants: true, isSignal: true }, { propertyName: "rootContextMenu", first: true, predicate: ["rootContextMenu"], descendants: true, isSignal: true }], ngImport: i0, template: "<!-- Empty State -->\n<div class=\"view-container\">\n @if (vm.folders().length === 0 && vm.files().length === 0) {\n <div class=\"ax-flex ax-flex-col ax-items-center ax-justify-center ax-py-16 ax-h-full\">\n <ax-icon icon=\"fa-light fa-folder-open\" class=\"ax-text-6xl ax-mb-4\"></ax-icon>\n <h3 class=\"ax-text-xl ax-font-medium ax-mb-2\">No Items Found</h3>\n <p class=\"\">This folder is empty. Add some files or folders to get started.</p>\n </div>\n } @else {\n <ng-container [ngComponentOutlet]=\"view()\"></ng-container>\n }\n</div>\n\n<!-- Context Menu -->\n@if (showContextMenu()) {\n<!-- Item Context Menu-->\n<ax-context-menu\n #itemsContextMenu\n [target]=\"'.__explorer-item'\"\n [orientation]=\"'vertical'\"\n [closeOn]=\"'leave'\"\n (onItemClick)=\"handleContextMenuItemClick($event)\"\n (onOpening)=\"handleContextMenuOnOpening($event)\"\n>\n</ax-context-menu>\n<!-- Root Context Menu-->\n<ax-context-menu\n #rootContextMenu\n [target]=\"'.view-container'\"\n [orientation]=\"'vertical'\"\n [closeOn]=\"'leave'\"\n (onItemClick)=\"handleContextMenuItemClick($event)\"\n (onOpening)=\"handleContextMenuRootOnOpening($event)\"\n>\n</ax-context-menu>\n}\n", styles: ["axm-document-explorer{display:flex;height:max-content;min-height:100%;width:100%;flex-direction:row;gap:1rem}axm-document-explorer>.view-container{display:flex;flex:1 1 0%;-webkit-user-select:none;-moz-user-select:-moz-none;user-select:none;flex-direction:column;gap:1rem}axm-document-explorer .animation-duration-2s{--fa-animation-duration: 2s}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletContent", "ngComponentOutletNgModule", "ngComponentOutletNgModuleFactory"], exportAs: ["ngComponentOutlet"] }, { kind: "ngmodule", type: RouterModule }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i3$1.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "ngmodule", type: AXLoadingModule }, { kind: "ngmodule", type: AXFormatModule }, { kind: "ngmodule", type: AXDateTimeModule }, { kind: "ngmodule", type: AXMenuModule }, { kind: "component", type: i3$4.AXContextMenuComponent, selector: "ax-context-menu", inputs: ["orientation", "openOn", "closeOn", "items", "target"], outputs: ["onItemClick", "onOpening"] }], encapsulation: i0.ViewEncapsulation.None }); }
|
5298
5100
|
}
|
5299
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type:
|
5101
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AXMDocumentExplorerComponent, decorators: [{
|
5300
5102
|
type: Component,
|
5301
|
-
args: [{ selector: 'axm-document-
|
5103
|
+
args: [{ selector: 'axm-document-explorer', standalone: true, encapsulation: ViewEncapsulation.None, imports: [
|
5302
5104
|
CommonModule,
|
5303
|
-
|
5304
|
-
AXButtonComponent,
|
5305
|
-
AXDropdownButtonModule,
|
5306
|
-
AXDropdownModule,
|
5105
|
+
RouterModule,
|
5307
5106
|
AXDecoratorModule,
|
5308
|
-
|
5309
|
-
|
5310
|
-
|
5311
|
-
|
5107
|
+
AXLoadingModule,
|
5108
|
+
AXFormatModule,
|
5109
|
+
AXDateTimeModule,
|
5110
|
+
AXMenuModule,
|
5111
|
+
], template: "<!-- Empty State -->\n<div class=\"view-container\">\n @if (vm.folders().length === 0 && vm.files().length === 0) {\n <div class=\"ax-flex ax-flex-col ax-items-center ax-justify-center ax-py-16 ax-h-full\">\n <ax-icon icon=\"fa-light fa-folder-open\" class=\"ax-text-6xl ax-mb-4\"></ax-icon>\n <h3 class=\"ax-text-xl ax-font-medium ax-mb-2\">No Items Found</h3>\n <p class=\"\">This folder is empty. Add some files or folders to get started.</p>\n </div>\n } @else {\n <ng-container [ngComponentOutlet]=\"view()\"></ng-container>\n }\n</div>\n\n<!-- Context Menu -->\n@if (showContextMenu()) {\n<!-- Item Context Menu-->\n<ax-context-menu\n #itemsContextMenu\n [target]=\"'.__explorer-item'\"\n [orientation]=\"'vertical'\"\n [closeOn]=\"'leave'\"\n (onItemClick)=\"handleContextMenuItemClick($event)\"\n (onOpening)=\"handleContextMenuOnOpening($event)\"\n>\n</ax-context-menu>\n<!-- Root Context Menu-->\n<ax-context-menu\n #rootContextMenu\n [target]=\"'.view-container'\"\n [orientation]=\"'vertical'\"\n [closeOn]=\"'leave'\"\n (onItemClick)=\"handleContextMenuItemClick($event)\"\n (onOpening)=\"handleContextMenuRootOnOpening($event)\"\n>\n</ax-context-menu>\n}\n", styles: ["axm-document-explorer{display:flex;height:max-content;min-height:100%;width:100%;flex-direction:row;gap:1rem}axm-document-explorer>.view-container{display:flex;flex:1 1 0%;-webkit-user-select:none;-moz-user-select:-moz-none;user-select:none;flex-direction:column;gap:1rem}axm-document-explorer .animation-duration-2s{--fa-animation-duration: 2s}\n"] }]
|
5312
5112
|
}] });
|
5313
5113
|
|
5314
|
-
|
5315
|
-
|
5316
|
-
|
5317
|
-
|
5318
|
-
|
5319
|
-
|
5320
|
-
static { this.ɵ
|
5321
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.10", type: AXMDocumentAttachmentWidgetPrintComponent, isStandalone: true, selector: "ng-component", usesInheritance: true, ngImport: i0, template: ``, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
5114
|
+
class AXMFolderPathBreadcrumbsComponent {
|
5115
|
+
constructor() {
|
5116
|
+
this.vm = inject(AXPDocumentExplorerViewModel);
|
5117
|
+
this.layout = inject(AXPLayoutThemeService);
|
5118
|
+
}
|
5119
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AXMFolderPathBreadcrumbsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
5120
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.10", type: AXMFolderPathBreadcrumbsComponent, isStandalone: true, selector: "axm-folder-path-breadcrumbs", ngImport: i0, template: "<!-- Breadcrumbs Section -->\n<div class=\"__breadcrumb ax-xs\">\n <!-- Desktop Breadcrumb -->\n @for (item of vm.currentPath(); track item.id; let i = $index;let last = $last) {\n <!-- Navigation Button -->\n <ax-button look=\"blank\" (onClick)=\"vm.navigateToFolder(item.id)\" [text]=\"item.name\" [disabled]=\"last\">\n @if(i === 0) {\n <ax-icon icon=\"fa-light fa-cloud\"></ax-icon>\n }@else {\n <ax-icon icon=\"fa-light fa-folder-closed\"></ax-icon>\n }\n </ax-button>\n <!-- Separator -->\n @if(!last) {\n <i class=\"far fa-chevron-right rtl:ax-rotate-180 fa-fw fa-xs ax-me-2\"></i>\n }\n <!-- End Navigation Button -->\n }\n</div>\n", styles: [":host{display:flex;width:100%;align-items:center}:host .__nav{display:flex;flex-direction:row;align-items:center;gap:.25rem;border-inline-end-width:1px;padding-inline-start:.25rem;padding-inline-end:.5rem}:host .__breadcrumb{display:flex;flex-direction:row;flex-wrap:wrap;align-items:center;padding-inline-start:.5rem;padding-inline-end:.25rem}:host .__breadcrumb .ax-state-disabled button,:host .__breadcrumb .ax-state-loading button{cursor:default!important}\n"], dependencies: [{ kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i2$1.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "iconOnly", "type", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "loadingTextChange"] }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i3$1.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }] }); }
|
5322
5121
|
}
|
5323
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type:
|
5122
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AXMFolderPathBreadcrumbsComponent, decorators: [{
|
5324
5123
|
type: Component,
|
5325
|
-
args: [{
|
5326
|
-
|
5327
|
-
|
5328
|
-
|
5329
|
-
inputs: [],
|
5330
|
-
}]
|
5124
|
+
args: [{ selector: 'axm-folder-path-breadcrumbs', standalone: true, imports: [
|
5125
|
+
AXButtonModule,
|
5126
|
+
AXDecoratorModule,
|
5127
|
+
], template: "<!-- Breadcrumbs Section -->\n<div class=\"__breadcrumb ax-xs\">\n <!-- Desktop Breadcrumb -->\n @for (item of vm.currentPath(); track item.id; let i = $index;let last = $last) {\n <!-- Navigation Button -->\n <ax-button look=\"blank\" (onClick)=\"vm.navigateToFolder(item.id)\" [text]=\"item.name\" [disabled]=\"last\">\n @if(i === 0) {\n <ax-icon icon=\"fa-light fa-cloud\"></ax-icon>\n }@else {\n <ax-icon icon=\"fa-light fa-folder-closed\"></ax-icon>\n }\n </ax-button>\n <!-- Separator -->\n @if(!last) {\n <i class=\"far fa-chevron-right rtl:ax-rotate-180 fa-fw fa-xs ax-me-2\"></i>\n }\n <!-- End Navigation Button -->\n }\n</div>\n", styles: [":host{display:flex;width:100%;align-items:center}:host .__nav{display:flex;flex-direction:row;align-items:center;gap:.25rem;border-inline-end-width:1px;padding-inline-start:.25rem;padding-inline-end:.5rem}:host .__breadcrumb{display:flex;flex-direction:row;flex-wrap:wrap;align-items:center;padding-inline-start:.5rem;padding-inline-end:.25rem}:host .__breadcrumb .ax-state-disabled button,:host .__breadcrumb .ax-state-loading button{cursor:default!important}\n"] }]
|
5331
5128
|
}] });
|
5332
5129
|
|
5333
|
-
var
|
5130
|
+
var index = /*#__PURE__*/Object.freeze({
|
5334
5131
|
__proto__: null,
|
5335
|
-
|
5132
|
+
AXMDocumentTypeChooseFileComponent: AXMDocumentTypeChooseFileComponent,
|
5133
|
+
AXMFileViewerPopupComponent: AXMFileViewerPopupComponent,
|
5134
|
+
AXMFolderPathBreadcrumbsComponent: AXMFolderPathBreadcrumbsComponent
|
5336
5135
|
});
|
5337
5136
|
|
5338
|
-
class AXMDocumentAttachmentWidgetViewComponent extends AXPValueWidgetComponent {
|
5339
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AXMDocumentAttachmentWidgetViewComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
5340
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.10", type: AXMDocumentAttachmentWidgetViewComponent, isStandalone: true, selector: "axp-document-attachment-widget", usesInheritance: true, ngImport: i0, template: ``, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
5341
|
-
}
|
5342
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AXMDocumentAttachmentWidgetViewComponent, decorators: [{
|
5343
|
-
type: Component,
|
5344
|
-
args: [{
|
5345
|
-
selector: 'axp-document-attachment-widget',
|
5346
|
-
template: ``,
|
5347
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
5348
|
-
imports: [CommonModule],
|
5349
|
-
inputs: [],
|
5350
|
-
}]
|
5351
|
-
}] });
|
5352
|
-
|
5353
|
-
const AXMDocumentAttachmentWidget = {
|
5354
|
-
name: 'document-attachment-editor',
|
5355
|
-
title: 'DocumentAttachment',
|
5356
|
-
icon: 'fa-light fa-gallery',
|
5357
|
-
description: 'My custom widget',
|
5358
|
-
categories: AXP_WIDGETS_EDITOR_CATEGORY,
|
5359
|
-
type: 'editor',
|
5360
|
-
defaultFilterWidgetName: 'string-filter',
|
5361
|
-
properties: [AXP_NAME_PROPERTY, AXP_DATA_PATH_PROPERTY],
|
5362
|
-
components: {
|
5363
|
-
view: {
|
5364
|
-
component: () => Promise.resolve().then(function () { return documentAttachmentWidgetEdit_component; }).then((c) => c.AXMDocumentAttachmentWidgetEditComponent),
|
5365
|
-
},
|
5366
|
-
edit: {
|
5367
|
-
component: () => Promise.resolve().then(function () { return documentAttachmentWidgetEdit_component; }).then((c) => c.AXMDocumentAttachmentWidgetEditComponent),
|
5368
|
-
},
|
5369
|
-
column: {
|
5370
|
-
component: () => Promise.resolve().then(function () { return documentAttachmentWidgetColumn_component; }).then((c) => c.AXMDocumentAttachmentWidgetColumnComponent),
|
5371
|
-
},
|
5372
|
-
print: {
|
5373
|
-
component: () => Promise.resolve().then(function () { return documentAttachmentWidgetPrint_component; }).then((c) => c.AXMDocumentAttachmentWidgetPrintComponent),
|
5374
|
-
},
|
5375
|
-
designer: {
|
5376
|
-
component: () => Promise.resolve().then(function () { return documentAttachmentWidgetEdit_component; }).then((c) => c.AXMDocumentAttachmentWidgetEditComponent),
|
5377
|
-
},
|
5378
|
-
},
|
5379
|
-
};
|
5380
|
-
|
5381
|
-
class AXMCheckDocumentTypeWorkflowAction extends AXPWorkflowAction {
|
5382
|
-
async execute(context) {
|
5383
|
-
const documentType = context.getVariable('documentType');
|
5384
|
-
if (documentType) {
|
5385
|
-
context.setOutput('need-choose-document-type', false);
|
5386
|
-
}
|
5387
|
-
else {
|
5388
|
-
context.setOutput('need-choose-document-type', true);
|
5389
|
-
}
|
5390
|
-
}
|
5391
|
-
}
|
5392
|
-
class AXMChooseDocumentTypeWorkflowAction extends AXPWorkflowAction {
|
5393
|
-
constructor() {
|
5394
|
-
super(...arguments);
|
5395
|
-
this.popupService = inject(AXPopupService);
|
5396
|
-
}
|
5397
|
-
async execute(context) {
|
5398
|
-
const comp = (await Promise.resolve().then(function () { return index; })).AXMDocumentTypeChooseFileComponent;
|
5399
|
-
const result = await this.popupService.open(comp);
|
5400
|
-
if (result.data != null && result.data.documentTypeId != null) {
|
5401
|
-
context.setVariable('documentTypeId', result.data.documentTypeId);
|
5402
|
-
context.setOutput('isCanceled', false);
|
5403
|
-
}
|
5404
|
-
else {
|
5405
|
-
context.setOutput('isCanceled', true);
|
5406
|
-
}
|
5407
|
-
}
|
5408
|
-
}
|
5409
|
-
class AXMChooseFileWorkflowAction extends AXPWorkflowAction {
|
5410
|
-
constructor() {
|
5411
|
-
super(...arguments);
|
5412
|
-
this.documentTypeService = inject(AXMDocumentTypeService);
|
5413
|
-
this.uploadService = inject(AXUploaderService);
|
5414
|
-
}
|
5415
|
-
async execute(context) {
|
5416
|
-
var doc = context.getVariable('documentType');
|
5417
|
-
if (!doc) {
|
5418
|
-
const docId = context.getVariable('documentTypeId');
|
5419
|
-
doc = await this.documentTypeService.getOne(docId);
|
5420
|
-
}
|
5421
|
-
this.uploadService.browse({
|
5422
|
-
//accept: doc.type,
|
5423
|
-
multiple: doc.isMultiple,
|
5424
|
-
});
|
5425
|
-
}
|
5426
|
-
}
|
5427
|
-
const AXMUploadWorkflow = {
|
5428
|
-
startStepId: 'check-document-type',
|
5429
|
-
steps: {
|
5430
|
-
'check-document-type': {
|
5431
|
-
action: 'AXMCheckDocumentTypeWorkflowAction',
|
5432
|
-
nextSteps: [
|
5433
|
-
{
|
5434
|
-
conditions: [{ type: 'SINGLE', expression: 'context.getOutput("need-choose-document-type") == true' }],
|
5435
|
-
nextStepId: 'choose-document-type',
|
5436
|
-
},
|
5437
|
-
],
|
5438
|
-
},
|
5439
|
-
'choose-document-type': {
|
5440
|
-
action: 'AXMChooseDocumentTypeWorkflowAction',
|
5441
|
-
nextSteps: [
|
5442
|
-
{
|
5443
|
-
conditions: [{ type: 'SINGLE', expression: 'context.getOutput("isCanceled") == false' }],
|
5444
|
-
nextStepId: 'file-browser',
|
5445
|
-
},
|
5446
|
-
],
|
5447
|
-
},
|
5448
|
-
'file-browser': {
|
5449
|
-
action: 'AXMChooseFileWorkflowAction',
|
5450
|
-
nextSteps: [
|
5451
|
-
{
|
5452
|
-
conditions: [],
|
5453
|
-
nextStepId: 'dispatch-event',
|
5454
|
-
},
|
5455
|
-
],
|
5456
|
-
},
|
5457
|
-
},
|
5458
|
-
};
|
5459
|
-
|
5460
|
-
class AXMTaskBadgeProviderSample1 {
|
5461
|
-
constructor() {
|
5462
|
-
this.count = signal(0);
|
5463
|
-
this.key = 'badge-1';
|
5464
|
-
this.count.set(10);
|
5465
|
-
}
|
5466
|
-
}
|
5467
|
-
class AXMTaskBadgeProviderSample2 {
|
5468
|
-
constructor() {
|
5469
|
-
this.count = signal(5);
|
5470
|
-
this.key = 'badge-2';
|
5471
|
-
setInterval(() => {
|
5472
|
-
this.count.update(c => c + 1);
|
5473
|
-
}, 30000);
|
5474
|
-
}
|
5475
|
-
}
|
5476
|
-
|
5477
5137
|
class AXPFileUploaderWidgetExtensionComponent {
|
5478
5138
|
constructor() {
|
5479
5139
|
this.driveService = inject(AXMDocumentManagerService);
|
@@ -5486,7 +5146,7 @@ class AXPFileUploaderWidgetExtensionComponent {
|
|
5486
5146
|
const result = await this.driveService.showChooseFileDialog(scope);
|
5487
5147
|
const files = await Promise.all(result.map(async (item) => (await this.fileStorageService.getInfo(item.fileId)).binary));
|
5488
5148
|
console.log(files);
|
5489
|
-
this.host.setValue([...this.host.getValue(), ...files]);
|
5149
|
+
//this.host.setValue([...this.host.getValue(), ...files]);
|
5490
5150
|
}
|
5491
5151
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AXPFileUploaderWidgetExtensionComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
5492
5152
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.10", type: AXPFileUploaderWidgetExtensionComponent, isStandalone: true, selector: "axp-file-uploader-widget-extension", providers: [], ngImport: i0, template: `
|
@@ -5503,7 +5163,7 @@ class AXPFileUploaderWidgetExtensionComponent {
|
|
5503
5163
|
// Angular
|
5504
5164
|
CommonModule }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }, { kind: "ngmodule", type:
|
5505
5165
|
// ACoreX
|
5506
|
-
AXFormModule }, { kind: "ngmodule", type: AXTextBoxModule }, { kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i2$1.AXButtonItemComponent, selector: "ax-button-item", inputs: ["color", "disabled", "text", "selected", "divided", "data", "name"], outputs: ["onClick", "onFocus", "onBlur", "disabledChange"] }, { kind: "ngmodule", type: AXLabelModule }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i3$1.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "component", type: i3$1.AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-subtitle, ax-placeholder, ax-overlay" }, { kind: "ngmodule", type: AXCheckBoxModule }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "pipe", type:
|
5166
|
+
AXFormModule }, { kind: "ngmodule", type: AXTextBoxModule }, { kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i2$1.AXButtonItemComponent, selector: "ax-button-item", inputs: ["color", "disabled", "text", "selected", "divided", "data", "name"], outputs: ["onClick", "onFocus", "onBlur", "disabledChange"] }, { kind: "ngmodule", type: AXLabelModule }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i3$1.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "component", type: i3$1.AXDecoratorGenericComponent, selector: "ax-footer, ax-header, ax-content, ax-divider, ax-form-hint, ax-prefix, ax-suffix, ax-text, ax-title, ax-subtitle, ax-placeholder, ax-overlay" }, { kind: "ngmodule", type: AXCheckBoxModule }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "pipe", type: i3$2.AXTranslatorPipe, name: "translate" }], encapsulation: i0.ViewEncapsulation.None }); }
|
5507
5167
|
}
|
5508
5168
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImport: i0, type: AXPFileUploaderWidgetExtensionComponent, decorators: [{
|
5509
5169
|
type: Component,
|
@@ -5579,11 +5239,11 @@ function routesFacory() {
|
|
5579
5239
|
children: [
|
5580
5240
|
{
|
5581
5241
|
path: '',
|
5582
|
-
loadComponent: () =>
|
5242
|
+
loadComponent: () => import('./acorex-modules-document-management-drive.component-Crh10Z5J.mjs').then((c) => c.AXMDocumentDriveComponent),
|
5583
5243
|
},
|
5584
5244
|
{
|
5585
5245
|
path: ':id',
|
5586
|
-
loadComponent: () =>
|
5246
|
+
loadComponent: () => import('./acorex-modules-document-management-drive.component-Crh10Z5J.mjs').then((c) => c.AXMDocumentDriveComponent),
|
5587
5247
|
},
|
5588
5248
|
],
|
5589
5249
|
},
|
@@ -5628,7 +5288,7 @@ class AXMDocumentManagementModule {
|
|
5628
5288
|
provide: AXP_PERMISSION_DEFINITION_PROVIDER,
|
5629
5289
|
useFactory: async () => {
|
5630
5290
|
const injector = inject(Injector);
|
5631
|
-
const provider = (await import('./acorex-modules-document-management-permission-definition.provider-
|
5291
|
+
const provider = (await import('./acorex-modules-document-management-permission-definition.provider-B3qaYwRL.mjs')).AXMPermissionDefinitionProvider;
|
5632
5292
|
return new provider(injector);
|
5633
5293
|
},
|
5634
5294
|
multi: true,
|
@@ -5656,7 +5316,7 @@ class AXMDocumentManagementModule {
|
|
5656
5316
|
AXMDocumentManagementDocumentTypeEntityModule,
|
5657
5317
|
AXMDocumentManagementDocumentEntityModule,
|
5658
5318
|
AXPLayoutBuilderModule.forChild({
|
5659
|
-
widgets: [AXmFileTypeExtensionWidget
|
5319
|
+
widgets: [AXmFileTypeExtensionWidget],
|
5660
5320
|
}),
|
5661
5321
|
AXMFileTypeModule,
|
5662
5322
|
AXMediaViewerModule.forRoot(),
|
@@ -5683,7 +5343,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImpo
|
|
5683
5343
|
AXMDocumentManagementDocumentTypeEntityModule,
|
5684
5344
|
AXMDocumentManagementDocumentEntityModule,
|
5685
5345
|
AXPLayoutBuilderModule.forChild({
|
5686
|
-
widgets: [AXmFileTypeExtensionWidget
|
5346
|
+
widgets: [AXmFileTypeExtensionWidget],
|
5687
5347
|
}),
|
5688
5348
|
AXMFileTypeModule,
|
5689
5349
|
AXMediaViewerModule.forRoot(),
|
@@ -5728,7 +5388,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImpo
|
|
5728
5388
|
provide: AXP_PERMISSION_DEFINITION_PROVIDER,
|
5729
5389
|
useFactory: async () => {
|
5730
5390
|
const injector = inject(Injector);
|
5731
|
-
const provider = (await import('./acorex-modules-document-management-permission-definition.provider-
|
5391
|
+
const provider = (await import('./acorex-modules-document-management-permission-definition.provider-B3qaYwRL.mjs')).AXMPermissionDefinitionProvider;
|
5732
5392
|
return new provider(injector);
|
5733
5393
|
},
|
5734
5394
|
multi: true,
|
@@ -5756,5 +5416,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.10", ngImpo
|
|
5756
5416
|
* Generated bundle index. Do not edit.
|
5757
5417
|
*/
|
5758
5418
|
|
5759
|
-
export {
|
5760
|
-
//# sourceMappingURL=acorex-modules-document-management-acorex-modules-document-management-
|
5419
|
+
export { AXPDocumentExplorerViewModel as A, AXMFolderService as B, AXMFolderServiceImpl as C, AXMEntityProvider as D, AXMMenuProvider as E, AXMSearchCommandProvider as F, AXMSettingProvider as G, RootConfig as R, AXMDocumentManagerService as a, AXMDocumentExplorerComponent as b, AXMFolderPathBreadcrumbsComponent as c, AXMPermissionsKeys as d, AXMDocumentTypeService as e, AXMDocumentManagementModule as f, documentFactory as g, AXMDocumentManagementDocumentEntityModule as h, AXMDocumentService as i, AXMDocumentServiceImpl as j, documentTypeFactory as k, AXMDocumentManagementDocumentTypeEntityModule as l, AXMDocumentTypeServiceImpl as m, documentTypeMetaDefinitionfactory as n, AXMDocumentManagementDocumentTypeMetaDefinitionEntityModule as o, AXMDocumentManagementDocumentTypeMetaDefinitionEntityService as p, AXMDocumentManagementDocumentTypeMetaDefinitionEntityServiceImpl as q, documentTypeMetaValueFactory as r, AXMDocumentManagementDocumentTypeMetaValueEntityModule as s, AXMDocumentManagementDocumentTypeMetaValueEntityService as t, AXMDocumentManagementDocumentTypeMetaValueEntityServiceImpl as u, documentTypeStatusDefinitionFactory as v, AXMDocumentManagementDocumentTypeStatusDefinitionEntityModule as w, AXMDocumentManagementDocumentTypeStatusDefinitionEntityService as x, AXMDocumentManagementDocumentTypeStatusDefinitionEntityServiceImpl as y, folderFactory as z };
|
5420
|
+
//# sourceMappingURL=acorex-modules-document-management-acorex-modules-document-management-BATdoqJi.mjs.map
|