@acorex/modules 19.2.15 → 19.2.17-next.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/common/README.md +3 -0
  2. package/common/index.d.ts +6 -0
  3. package/common/lib/common.module.d.ts +6 -0
  4. package/common/lib/const.d.ts +25 -0
  5. package/common/lib/entities/dashboard/dashboard.entity.d.ts +3 -0
  6. package/common/lib/entities/dashboard/dashboard.service.d.ts +10 -0
  7. package/common/lib/entities/dashboard/dashboard.types.d.ts +8 -0
  8. package/common/lib/entities/dashboard/index.d.ts +3 -0
  9. package/common/lib/entities/dashboard-widget-data/dashboard-widget-data.entity.d.ts +3 -0
  10. package/common/lib/entities/dashboard-widget-data/dashboard-widget-data.service.d.ts +10 -0
  11. package/common/lib/entities/dashboard-widget-data/dashboard-widget-data.types.d.ts +9 -0
  12. package/common/lib/entities/dashboard-widget-data/index.d.ts +3 -0
  13. package/common/lib/entities/index.d.ts +2 -0
  14. package/common/lib/entity.provider.d.ts +10 -0
  15. package/common/lib/features/home/dashboard-home.d.ts +5 -0
  16. package/common/lib/features/home/index.d.ts +1 -0
  17. package/common/lib/menu.provider.d.ts +5 -0
  18. package/common/lib/permission.provider.d.ts +4 -0
  19. package/common/lib/search-command.provider.d.ts +4 -0
  20. package/common/lib/setting.provider.d.ts +4 -0
  21. package/document-management/lib/entities/document/document.service.d.ts +7 -0
  22. package/document-management/lib/entities/folder/folder.service.d.ts +7 -0
  23. package/document-management/lib/features/document-explorer/components/rename-node-dialog/rename-node-dialog.component.d.ts +14 -0
  24. package/document-management/lib/features/document-explorer/document-explorer.component.d.ts +12 -9
  25. package/document-management/lib/features/document-explorer/document-explorer.viewmodel.d.ts +2 -2
  26. package/document-management/lib/features/drive/drive.component.d.ts +3 -2
  27. package/document-management/lib/features/shared/document-manager.service.d.ts +80 -1
  28. package/document-management/lib/features/shared/document-manager.types.d.ts +1 -1
  29. package/document-management/lib/features/widgets/document-attachment/document-attachment-widget-column.component.d.ts +6 -0
  30. package/document-management/lib/features/widgets/document-attachment/document-attachment-widget-edit.component.d.ts +6 -0
  31. package/document-management/lib/features/widgets/document-attachment/document-attachment-widget-filter.component.d.ts +6 -0
  32. package/document-management/lib/features/widgets/document-attachment/document-attachment-widget-print.component.d.ts +6 -0
  33. package/document-management/lib/features/widgets/document-attachment/document-attachment-widget-view.component.d.ts +6 -0
  34. package/document-management/lib/features/widgets/document-attachment/document-attachment-widget.config.d.ts +7 -0
  35. package/document-management/lib/features/widgets/document-attachment/index.d.ts +6 -0
  36. package/document-management/lib/features/widgets/index.d.ts +1 -0
  37. package/fesm2022/{acorex-modules-auth-acorex-modules-auth-CZ_nTBkL.mjs → acorex-modules-auth-acorex-modules-auth-DTje3YIv.mjs} +8 -8
  38. package/fesm2022/{acorex-modules-auth-acorex-modules-auth-CZ_nTBkL.mjs.map → acorex-modules-auth-acorex-modules-auth-DTje3YIv.mjs.map} +1 -1
  39. package/fesm2022/{acorex-modules-auth-app-chooser.component-CGSygSjS.mjs → acorex-modules-auth-app-chooser.component-CZxX5-T_.mjs} +2 -2
  40. package/fesm2022/{acorex-modules-auth-app-chooser.component-CGSygSjS.mjs.map → acorex-modules-auth-app-chooser.component-CZxX5-T_.mjs.map} +1 -1
  41. package/fesm2022/{acorex-modules-auth-login.module-B1sF3B_O.mjs → acorex-modules-auth-login.module-B9P2XpfQ.mjs} +4 -4
  42. package/fesm2022/{acorex-modules-auth-login.module-B1sF3B_O.mjs.map → acorex-modules-auth-login.module-B9P2XpfQ.mjs.map} +1 -1
  43. package/fesm2022/{acorex-modules-auth-master.layout-CK4nyS8D.mjs → acorex-modules-auth-master.layout-BYC0FYq1.mjs} +2 -2
  44. package/fesm2022/{acorex-modules-auth-master.layout-CK4nyS8D.mjs.map → acorex-modules-auth-master.layout-BYC0FYq1.mjs.map} +1 -1
  45. package/fesm2022/{acorex-modules-auth-password.component-DC_zi8bV.mjs → acorex-modules-auth-password.component-C7Yp-ioT.mjs} +2 -2
  46. package/fesm2022/{acorex-modules-auth-password.component-DC_zi8bV.mjs.map → acorex-modules-auth-password.component-C7Yp-ioT.mjs.map} +1 -1
  47. package/fesm2022/{acorex-modules-auth-password.component-DqvmIMDR.mjs → acorex-modules-auth-password.component-DzrYH4yM.mjs} +3 -3
  48. package/fesm2022/acorex-modules-auth-password.component-DzrYH4yM.mjs.map +1 -0
  49. package/fesm2022/{acorex-modules-auth-routes-DwHgPrDP.mjs → acorex-modules-auth-routes-Bu-xB4O6.mjs} +2 -2
  50. package/fesm2022/{acorex-modules-auth-routes-DwHgPrDP.mjs.map → acorex-modules-auth-routes-Bu-xB4O6.mjs.map} +1 -1
  51. package/fesm2022/{acorex-modules-auth-two-factor.module-BatKQRdJ.mjs → acorex-modules-auth-two-factor.module-YRh6_YcG.mjs} +2 -2
  52. package/fesm2022/{acorex-modules-auth-two-factor.module-BatKQRdJ.mjs.map → acorex-modules-auth-two-factor.module-YRh6_YcG.mjs.map} +1 -1
  53. package/fesm2022/acorex-modules-auth.mjs +1 -1
  54. package/fesm2022/acorex-modules-common-index-zaFxpV8u.mjs +14 -0
  55. package/fesm2022/acorex-modules-common-index-zaFxpV8u.mjs.map +1 -0
  56. package/fesm2022/acorex-modules-common.mjs +1095 -0
  57. package/fesm2022/acorex-modules-common.mjs.map +1 -0
  58. package/fesm2022/acorex-modules-document-management-acorex-modules-document-management-C9ZCejjs.mjs +4092 -0
  59. package/fesm2022/acorex-modules-document-management-acorex-modules-document-management-C9ZCejjs.mjs.map +1 -0
  60. package/fesm2022/acorex-modules-document-management-create-folder-dialog.component-BnRaCq_Q.mjs +92 -0
  61. package/fesm2022/acorex-modules-document-management-create-folder-dialog.component-BnRaCq_Q.mjs.map +1 -0
  62. package/fesm2022/acorex-modules-document-management-drive.component-Sz198sA6.mjs +165 -0
  63. package/fesm2022/acorex-modules-document-management-drive.component-Sz198sA6.mjs.map +1 -0
  64. package/fesm2022/acorex-modules-document-management-index--I8MGeDs.mjs +2 -0
  65. package/fesm2022/acorex-modules-document-management-index--I8MGeDs.mjs.map +1 -0
  66. package/fesm2022/acorex-modules-document-management-rename-node-dialog.component-EBf1XqU8.mjs +101 -0
  67. package/fesm2022/acorex-modules-document-management-rename-node-dialog.component-EBf1XqU8.mjs.map +1 -0
  68. package/fesm2022/acorex-modules-document-management.mjs +1 -3093
  69. package/fesm2022/acorex-modules-document-management.mjs.map +1 -1
  70. package/package.json +5 -1
  71. package/document-management/lib/features/drive/index.d.ts +0 -3
  72. package/fesm2022/acorex-modules-auth-password.component-DqvmIMDR.mjs.map +0 -1
  73. package/fesm2022/acorex-modules-document-management-drive.component-bjnFFaLS.mjs +0 -951
  74. package/fesm2022/acorex-modules-document-management-drive.component-bjnFFaLS.mjs.map +0 -1
@@ -1,951 +0,0 @@
1
- import { AXBadgeModule } from '@acorex/components/badge';
2
- import * as i6 from '@acorex/components/breadcrumbs';
3
- import { AXBreadcrumbsModule } from '@acorex/components/breadcrumbs';
4
- import * as i2$1 from '@acorex/components/button';
5
- import { AXButtonModule } from '@acorex/components/button';
6
- import { AXButtonGroupModule } from '@acorex/components/button-group';
7
- import * as i5 from '@acorex/components/decorators';
8
- import { AXDecoratorModule } from '@acorex/components/decorators';
9
- import * as i3$1 from '@acorex/components/dropdown';
10
- import { AXDropdownModule } from '@acorex/components/dropdown';
11
- import { AXDropdownButtonModule } from '@acorex/components/dropdown-button';
12
- import * as i10 from '@acorex/components/loading';
13
- import { AXLoadingModule } from '@acorex/components/loading';
14
- import * as i4$2 from '@acorex/components/menu';
15
- import { AXMenuModule } from '@acorex/components/menu';
16
- import * as i9 from '@acorex/core/translation';
17
- import { AXTranslationModule, AXTranslationService } from '@acorex/core/translation';
18
- import { AXPSimplePageLayout } from '@acorex/platform/themes/default';
19
- import * as i7$1 from '@acorex/components/search-box';
20
- import { AXSearchBoxModule } from '@acorex/components/search-box';
21
- import { AXDateTimeModule } from '@acorex/core/date-time';
22
- import { AXFileModule } from '@acorex/core/file';
23
- import * as i3 from '@acorex/core/format';
24
- import { AXFormatModule } from '@acorex/core/format';
25
- import { AXPSettingScope, AXPFileTypeProviderService, AXPSettingService } from '@acorex/platform/common';
26
- import { AXPLayoutThemeService, AXPThemeLayoutBlockComponent, AXPThemeLayoutHeaderTemplateComponent, AXPThemeLayoutActionsComponent, AXPThemeLayoutPagePrimaryActionsComponent, AXPThemeLayoutPageSecondaryActionsComponent, AXPThemeLayoutToolbarComponent, AXPThemeLayoutFooterComponent } from '@acorex/platform/themes/shared';
27
- import * as i1 from '@angular/common';
28
- import { CommonModule } from '@angular/common';
29
- import * as i0 from '@angular/core';
30
- import { inject, model, Component, Injectable, computed, viewChild, effect, signal, untracked, ChangeDetectionStrategy, ViewEncapsulation } from '@angular/core';
31
- import { RouterModule, Router, ActivatedRoute } from '@angular/router';
32
- import { AXMFolderService, AXMDocumentService, RootConfig } from './acorex-modules-document-management.mjs';
33
- import { AXPopupService } from '@acorex/components/popup';
34
- import { AXPSessionService } from '@acorex/platform/auth';
35
- import { AXPDataGenerator, AXPElementDataDirective } from '@acorex/platform/core';
36
- import * as i8 from '@acorex/components/color-box';
37
- import { AXColorBoxModule } from '@acorex/components/color-box';
38
- import * as i7 from '@acorex/components/form';
39
- import { AXFormModule } from '@acorex/components/form';
40
- import * as i4$1 from '@acorex/components/label';
41
- import { AXLabelModule } from '@acorex/components/label';
42
- import { AXBasePageComponent } from '@acorex/components/page';
43
- import * as i4 from '@acorex/components/text-box';
44
- import { AXTextBoxModule } from '@acorex/components/text-box';
45
- import * as i2 from '@angular/forms';
46
- import { FormsModule } from '@angular/forms';
47
- import { signalStore, withState, withComputed, withMethods, patchState } from '@ngrx/signals';
48
- import { get } from 'lodash-es';
49
-
50
- class AXMCreateFolderDialog extends AXBasePageComponent {
51
- constructor() {
52
- super(...arguments);
53
- this.driveService = inject(AXMDocumentManagerService);
54
- this.name = model('');
55
- this.color = model('#FFFFFF');
56
- this.description = model('');
57
- }
58
- async handleSubmitButton(form) {
59
- this.isLoading = true;
60
- const validated = await form.validate();
61
- if (validated.result) {
62
- try {
63
- const folder = await this.driveService.createFolder({
64
- name: this.name(),
65
- color: this.color(),
66
- parentId: this.parentId,
67
- description: this.description(),
68
- });
69
- this.close({
70
- result: true,
71
- folder,
72
- });
73
- }
74
- catch (error) {
75
- console.error('Error creating folder:', error);
76
- }
77
- finally {
78
- this.isLoading = false;
79
- }
80
- }
81
- else {
82
- this.isLoading = false;
83
- }
84
- }
85
- onCancel() {
86
- this.close({
87
- result: false,
88
- });
89
- }
90
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMCreateFolderDialog, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
91
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.3", type: AXMCreateFolderDialog, isStandalone: true, selector: "ax-create-folder-dialog", inputs: { name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, description: { classPropertyName: "description", publicName: "description", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { name: "nameChange", color: "colorChange", description: "descriptionChange" }, usesInheritance: true, ngImport: i0, template: "<div class=\"ax-p-4\">\n <ax-form #form>\n <div class=\"ax-flex ax-flex-col ax-gap-4\">\n <ax-form-field>\n <ax-label>\n {{ 'name' | translate | async }}\n </ax-label>\n <ax-text-box [(ngModel)]=\"name\" class=\"ax-input ax-w-full\">\n <ax-validation-rule rule=\"required\"></ax-validation-rule>\n </ax-text-box>\n </ax-form-field>\n <ax-form-field>\n <ax-label>\n {{ 'description' | translate | async }}\n </ax-label>\n <ax-text-box [(ngModel)]=\"description\" class=\"ax-input ax-w-full\"> </ax-text-box>\n </ax-form-field>\n <ax-form-field>\n <ax-label>\n {{ 'color' | translate | async }}\n </ax-label>\n <ax-color-box [(ngModel)]=\"color\" class=\"ax-w-full\">\n <ax-validation-rule rule=\"required\"></ax-validation-rule>\n </ax-color-box>\n </ax-form-field>\n <div class=\"ax-flex ax-justify-end ax-gap-2\"></div>\n </div>\n </ax-form>\n</div>\n<ax-footer>\n <ax-suffix>\n <ax-button (onClick)=\"onCancel()\" [text]=\"'cancel' | translate | async\"></ax-button>\n <ax-button look=\"solid\" color=\"primary\" (onClick)=\"handleSubmitButton(form)\" [text]=\"'save' | translate | async\">\n @if(isLoading) {\n <ax-loading> </ax-loading>\n }\n </ax-button>\n </ax-suffix>\n</ax-footer>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { 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:
92
- //
93
- AXDecoratorModule }, { kind: "component", type: i5.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: AXTextBoxModule }, { kind: "component", type: i4.AXTextBoxComponent, selector: "ax-text-box", inputs: ["disabled", "tabIndex", "readonly", "value", "state", "name", "id", "placeholder", "maxLength", "allowNull", "type", "autoComplete", "look", "mask-options", "class"], outputs: ["onBlur", "onFocus", "valueChange", "stateChange", "onValueChanged", "readonlyChange", "disabledChange", "onKeyDown", "onKeyUp", "onKeyPress"] }, { kind: "ngmodule", type: AXLabelModule }, { kind: "component", type: i4$1.AXLabelComponent, selector: "ax-label", inputs: ["required", "for"], outputs: ["requiredChange"] }, { kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i2$1.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "type", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "loadingTextChange"] }, { kind: "ngmodule", type: AXFormModule }, { kind: "component", type: i7.AXFormFieldComponent, selector: "ax-form-field", inputs: ["labelMode"] }, { kind: "component", type: i7.AXFormComponent, selector: "ax-form", inputs: ["labelMode", "look", "messageStyle", "updateOn"], outputs: ["onValidate", "updateOnChange"] }, { kind: "directive", type: i7.AXValidationRuleDirective, selector: "ax-validation-rule", inputs: ["rule", "options", "message"] }, { kind: "ngmodule", type: AXColorBoxModule }, { kind: "component", type: i8.AXColorBoxComponent, selector: "ax-color-box", inputs: ["disabled", "readonly", "tabIndex", "placeholder", "minValue", "maxValue", "value", "state", "name", "id", "type", "look", "showBadge", "showValue", "showClearButton", "showIcon"], outputs: ["valueChange", "stateChange", "onValueChanged", "onBlur", "onFocus", "readonlyChange", "disabledChange"] }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "pipe", type: i9.AXTranslatorPipe, name: "translate" }, { kind: "ngmodule", type: AXLoadingModule }, { kind: "component", type: i10.AXLoadingComponent, selector: "ax-loading", inputs: ["visible", "type", "context"], outputs: ["visibleChange"] }] }); }
94
- }
95
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMCreateFolderDialog, decorators: [{
96
- type: Component,
97
- args: [{ selector: 'ax-create-folder-dialog', standalone: true, imports: [
98
- CommonModule,
99
- FormsModule,
100
- //
101
- AXDecoratorModule,
102
- AXTextBoxModule,
103
- AXLabelModule,
104
- AXButtonModule,
105
- AXFormModule,
106
- AXColorBoxModule,
107
- AXTranslationModule,
108
- AXLoadingModule,
109
- ], template: "<div class=\"ax-p-4\">\n <ax-form #form>\n <div class=\"ax-flex ax-flex-col ax-gap-4\">\n <ax-form-field>\n <ax-label>\n {{ 'name' | translate | async }}\n </ax-label>\n <ax-text-box [(ngModel)]=\"name\" class=\"ax-input ax-w-full\">\n <ax-validation-rule rule=\"required\"></ax-validation-rule>\n </ax-text-box>\n </ax-form-field>\n <ax-form-field>\n <ax-label>\n {{ 'description' | translate | async }}\n </ax-label>\n <ax-text-box [(ngModel)]=\"description\" class=\"ax-input ax-w-full\"> </ax-text-box>\n </ax-form-field>\n <ax-form-field>\n <ax-label>\n {{ 'color' | translate | async }}\n </ax-label>\n <ax-color-box [(ngModel)]=\"color\" class=\"ax-w-full\">\n <ax-validation-rule rule=\"required\"></ax-validation-rule>\n </ax-color-box>\n </ax-form-field>\n <div class=\"ax-flex ax-justify-end ax-gap-2\"></div>\n </div>\n </ax-form>\n</div>\n<ax-footer>\n <ax-suffix>\n <ax-button (onClick)=\"onCancel()\" [text]=\"'cancel' | translate | async\"></ax-button>\n <ax-button look=\"solid\" color=\"primary\" (onClick)=\"handleSubmitButton(form)\" [text]=\"'save' | translate | async\">\n @if(isLoading) {\n <ax-loading> </ax-loading>\n }\n </ax-button>\n </ax-suffix>\n</ax-footer>\n" }]
110
- }] });
111
-
112
- var AXMDriveScope;
113
- (function (AXMDriveScope) {
114
- AXMDriveScope["Platform"] = "P";
115
- AXMDriveScope["Tenant"] = "T";
116
- AXMDriveScope["User"] = "U";
117
- })(AXMDriveScope || (AXMDriveScope = {}));
118
-
119
- /**
120
- * Service for handling document drive operations
121
- */
122
- class AXMDocumentManagerService {
123
- constructor() {
124
- this.folderService = inject(AXMFolderService);
125
- this.sessionService = inject(AXPSessionService);
126
- this.documentService = inject(AXMDocumentService);
127
- this.popupService = inject(AXPopupService);
128
- this.scopedDriveCache = new Map();
129
- }
130
- scope(scope, options) {
131
- const cacheKey = this.getScopeCacheKey(scope, options);
132
- if (!this.scopedDriveCache.has(cacheKey)) {
133
- this.scopedDriveCache.set(cacheKey, new ScopedDriveService(this, scope, options));
134
- }
135
- return this.scopedDriveCache.get(cacheKey);
136
- }
137
- getScopeCacheKey(scope, options) {
138
- // در آینده می‌توان این را برای کش کردن بر اساس ترکیب scope و options گسترش داد
139
- return scope;
140
- }
141
- /**
142
- * Gets the platform root folder (top-level folder)
143
- * @returns Root folder for the platform
144
- */
145
- async getPlatformRootFolder() {
146
- const result = await this.folderService.query({
147
- skip: 0,
148
- take: 1,
149
- filter: {
150
- operator: null,
151
- logic: 'and',
152
- filters: [
153
- { field: 'parentId', operator: { type: 'isNull' } },
154
- { field: 'tenantId', operator: { type: 'isNull' } },
155
- { field: 'userId', operator: { type: 'isNull' } },
156
- ],
157
- },
158
- });
159
- if (result.items.length === 0) {
160
- throw new Error('Platform root folder not found');
161
- }
162
- return result.items[0];
163
- }
164
- /**
165
- * Gets the tenant root folder
166
- * @param rootFolderId The platform root folder ID
167
- * @param tenantId The tenant ID
168
- * @returns Tenant root folder
169
- */
170
- async getTenantRootFolder(rootFolderId, tenantId) {
171
- if (!tenantId) {
172
- throw new Error('Tenant ID is required');
173
- }
174
- const result = await this.folderService.query({
175
- skip: 0,
176
- take: 1,
177
- filter: {
178
- operator: null,
179
- logic: 'and',
180
- filters: [
181
- { field: 'parentId', operator: { type: 'equal' }, value: rootFolderId },
182
- { field: 'tenantId', operator: { type: 'equal' }, value: tenantId },
183
- { field: 'userId', operator: { type: 'isNull' } },
184
- ],
185
- },
186
- });
187
- if (result.items.length === 0) {
188
- throw new Error('Tenant root folder not found');
189
- }
190
- return result.items[0];
191
- }
192
- /**
193
- * Gets the user root folder
194
- * @param tenantFolderId The tenant folder ID
195
- * @param tenantId The tenant ID
196
- * @param userId The user ID
197
- * @returns User root folder
198
- */
199
- async getUserRootFolder(tenantFolderId, tenantId, userId) {
200
- if (!tenantId || !userId) {
201
- throw new Error('Both Tenant ID and User ID are required');
202
- }
203
- const result = await this.folderService.query({
204
- skip: 0,
205
- take: 1,
206
- filter: {
207
- operator: null,
208
- logic: 'and',
209
- filters: [
210
- { field: 'parentId', operator: { type: 'equal' }, value: tenantFolderId },
211
- { field: 'tenantId', operator: { type: 'equal' }, value: tenantId },
212
- { field: 'userId', operator: { type: 'equal' }, value: userId },
213
- ],
214
- },
215
- });
216
- if (result.items.length === 0) {
217
- throw new Error('User root folder not found');
218
- }
219
- return result.items[0];
220
- }
221
- mapFolderDtoToFolderNode(folder) {
222
- return {
223
- id: folder.id,
224
- name: folder.name,
225
- type: 'folder',
226
- parentId: folder.parentId || null,
227
- lastModified: folder.updatedAt,
228
- children: [
229
- ...(folder.folders?.map((child) => ({
230
- id: child.id,
231
- name: child.name,
232
- type: 'folder',
233
- parentId: child.parentId || null,
234
- lastModified: child.updatedAt,
235
- size: AXPDataGenerator.number(50, 9000000),
236
- })) || []),
237
- ...(folder.documents?.map((doc) => ({
238
- id: doc.id,
239
- name: doc.name,
240
- type: 'file',
241
- parentId: doc.parentId,
242
- lastModified: AXPDataGenerator.date(),
243
- size: AXPDataGenerator.number(50, 9000000),
244
- })) || []),
245
- ],
246
- };
247
- }
248
- async buildPath(node) {
249
- if (node.type === 'file') {
250
- return (await this.documentService.getPath(node.id)).map(this.mapFolderDtoToFolderNode);
251
- }
252
- return (await this.folderService.getPath(node.id)).map(this.mapFolderDtoToFolderNode);
253
- }
254
- async findNodeById(id) {
255
- const findNode = (nodes) => {
256
- for (const node of nodes) {
257
- if (node.id === id) {
258
- return node;
259
- }
260
- if (node.children) {
261
- const found = findNode(node.children);
262
- if (found)
263
- return found;
264
- }
265
- }
266
- return null;
267
- };
268
- return findNode([(await this.getRoot(AXMDriveScope.Platform)).result]);
269
- }
270
- /**
271
- * Gets the root folder based on the specified scope
272
- * @param scope The drive scope (Platform, Tenant, User)
273
- * @param options Optional parameters for tenant and user IDs
274
- * @returns Root folder for the specified scope
275
- */
276
- async getRoot(scope, options) {
277
- const rootFolder = await this.getPlatformRootFolder();
278
- let result;
279
- switch (scope) {
280
- case AXMDriveScope.Platform:
281
- result = this.mapFolderDtoToFolderNode(rootFolder);
282
- break;
283
- case AXMDriveScope.Tenant: {
284
- if (!options?.tenantId) {
285
- throw new Error('Tenant ID is required for tenant scope');
286
- }
287
- const tenantRoot = await this.getTenantRootFolder(rootFolder.id, options.tenantId);
288
- result = this.mapFolderDtoToFolderNode(tenantRoot);
289
- break;
290
- }
291
- case AXMDriveScope.User: {
292
- if (!options?.tenantId || !options?.userId) {
293
- throw new Error('Both Tenant ID and User ID are required for user scope');
294
- }
295
- const tenantFolder = await this.getTenantRootFolder(rootFolder.id, options.tenantId);
296
- const userRoot = await this.getUserRootFolder(tenantFolder.id, options.tenantId, options.userId);
297
- result = this.mapFolderDtoToFolderNode(userRoot);
298
- break;
299
- }
300
- default:
301
- throw new Error(`Invalid scope: ${scope}`);
302
- }
303
- const path = await this.buildPath(result);
304
- return { path, result };
305
- }
306
- /**
307
- * Gets a specific folder by ID
308
- * @param folderId The folder ID to retrieve
309
- * @returns The requested folder
310
- */
311
- async getFolder(folderId) {
312
- if (!folderId) {
313
- throw new Error('Folder ID is required');
314
- }
315
- const folder = await this.folderService.getOne(folderId);
316
- if (!folder) {
317
- throw new Error('Folder not found');
318
- }
319
- const result = this.mapFolderDtoToFolderNode(folder);
320
- const path = await this.buildPath(result);
321
- return { path, result };
322
- }
323
- async createFolder(data) {
324
- const now = new Date();
325
- const currentUser = this.sessionService.user;
326
- const folderToCreate = {
327
- ...data,
328
- createdAt: now,
329
- updatedAt: now,
330
- createdBy: currentUser?.id?.toString() ?? 'system',
331
- updatedBy: currentUser?.id?.toString() ?? 'system',
332
- isSystem: false,
333
- isHidden: false,
334
- isDeleted: false,
335
- };
336
- const createdFolder = await this.folderService.insertOne(folderToCreate);
337
- const folder = await this.folderService.getOne(createdFolder);
338
- return this.mapFolderDtoToFolderNode(folder);
339
- }
340
- async updateFolder(folderId, data) {
341
- const currentUser = this.sessionService.user;
342
- const updateData = {
343
- ...data,
344
- updatedBy: currentUser?.id?.toString() ?? 'system',
345
- updatedAt: new Date(),
346
- };
347
- await this.folderService.updateOne(folderId, updateData);
348
- const updatedFolder = await this.folderService.getOne(folderId);
349
- return this.mapFolderDtoToFolderNode(updatedFolder);
350
- }
351
- async deleteFolder(folderId) {
352
- await this.folderService.deleteOne(folderId);
353
- }
354
- async getAvailableSpace() {
355
- // For now, return a fixed value of 100GB (56 * 1024 * 1024 * 1024 bytes)
356
- // This should be replaced with actual storage quota logic when implemented
357
- return 56 * 1024 * 1024 * 1024;
358
- }
359
- mapFileToNode(file) {
360
- return {
361
- id: file.id,
362
- name: file.name,
363
- type: 'file',
364
- parentId: file.parentId,
365
- lastModified: new Date(),
366
- };
367
- }
368
- async createFile(data) {
369
- const fileId = await this.documentService.insertOne(data);
370
- const file = await this.documentService.getOne(fileId);
371
- return this.mapFileToNode(file);
372
- }
373
- async updateFile(fileId, data) {
374
- const updatedFile = await this.documentService.updateOne(fileId, data);
375
- return this.mapFileToNode(updatedFile);
376
- }
377
- async deleteFile(fileId) {
378
- await this.documentService.deleteOne(fileId);
379
- }
380
- async deleteNodes(nodeIds) {
381
- for (const nodeId of nodeIds) {
382
- try {
383
- await this.deleteFolder(nodeId);
384
- }
385
- catch {
386
- try {
387
- await this.deleteFile(nodeId);
388
- }
389
- catch (error) {
390
- console.error(`Failed to delete node with id ${nodeId}:`, error);
391
- }
392
- }
393
- }
394
- }
395
- async showCreateFolderDialog(parentId) {
396
- const popup = await this.popupService.open(AXMCreateFolderDialog, {
397
- title: 't("actions.create-folder")',
398
- data: {
399
- parentId,
400
- },
401
- });
402
- return popup.data?.folder;
403
- }
404
- async rename(node) { }
405
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMDocumentManagerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
406
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMDocumentManagerService, providedIn: 'root' }); }
407
- }
408
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMDocumentManagerService, decorators: [{
409
- type: Injectable,
410
- args: [{
411
- providedIn: 'root',
412
- }]
413
- }] });
414
- class ScopedDriveService {
415
- constructor(parent, scope, options) {
416
- this.parent = parent;
417
- this.scope = scope;
418
- this.options = options;
419
- this.validateScopeOptions();
420
- }
421
- validateScopeOptions() {
422
- switch (this.scope) {
423
- case AXMDriveScope.Tenant:
424
- if (!this.options?.tenantId) {
425
- throw new Error('Tenant ID is required for tenant scope');
426
- }
427
- break;
428
- case AXMDriveScope.User:
429
- if (!this.options?.tenantId || !this.options?.userId) {
430
- throw new Error('Both Tenant ID and User ID are required for user scope');
431
- }
432
- break;
433
- }
434
- }
435
- async getRoot() {
436
- return this.parent.getRoot(this.scope, this.options);
437
- }
438
- async getFolder(folderId) {
439
- return this.parent.getFolder(folderId);
440
- }
441
- async createFolder(data) {
442
- const folderData = {
443
- ...data,
444
- tenantId: this.options?.tenantId,
445
- userId: this.options?.userId,
446
- };
447
- return this.parent.createFolder(folderData);
448
- }
449
- async updateFolder(folderId, data) {
450
- return this.parent.updateFolder(folderId, data);
451
- }
452
- async deleteFolder(folderId) {
453
- return this.parent.deleteFolder(folderId);
454
- }
455
- async getAvailableSpace() {
456
- return this.parent.getAvailableSpace();
457
- }
458
- }
459
-
460
- var AXPDocumentExplorerSettings;
461
- (function (AXPDocumentExplorerSettings) {
462
- AXPDocumentExplorerSettings["ViewMode"] = "document-explorer:layout:view-mode";
463
- AXPDocumentExplorerSettings["SortField"] = "document-explorer:layout:sort-field";
464
- AXPDocumentExplorerSettings["SortDirection"] = "document-explorer:layout:sort-direction";
465
- })(AXPDocumentExplorerSettings || (AXPDocumentExplorerSettings = {}));
466
-
467
- const AXPDocumentExplorerViewModel = signalStore({ providedIn: 'root' }, withState(() => ({
468
- // View State
469
- viewMode: 'grid',
470
- isLoading: false,
471
- // Navigation State
472
- currentPath: [],
473
- currentNode: null,
474
- loadingFolderId: null,
475
- navigatingFolderId: null,
476
- // Sort State
477
- sortField: 'name',
478
- sortDirection: 'asc',
479
- // Content State
480
- folders: [],
481
- files: [],
482
- itemsCount: 0,
483
- availableSpace: 0,
484
- // Drive State
485
- currentDrive: null,
486
- // File Type State
487
- fileTypes: [],
488
- })), withComputed((store) => ({
489
- isRoot: computed(() => {
490
- const node = store.currentNode();
491
- return node?.id === 'root' || !node?.parentId;
492
- }),
493
- breadcrumb: computed(() => store.currentPath()),
494
- currentFolder: computed(() => store.currentNode()),
495
- currentFolderContents: computed(() => ({
496
- folders: store.folders(),
497
- files: store.files(),
498
- })),
499
- parentFolder: computed(() => {
500
- const currentNode = store.currentNode();
501
- return currentNode?.parentId ? store.folders().find(folder => folder.id === currentNode.parentId) : null;
502
- }),
503
- isGridView: computed(() => store.viewMode() === 'grid'),
504
- isListView: computed(() => store.viewMode() === 'list'),
505
- })), withMethods((store, fileTypeService = inject(AXPFileTypeProviderService), driveService = inject(AXMDocumentManagerService), settingService = inject(AXPSettingService)) => ({
506
- async initialize(path = 'root') {
507
- // Load file types
508
- const fileTypes = await fileTypeService.items();
509
- patchState(store, { fileTypes });
510
- // Load initial settings
511
- const viewMode = await settingService.get(AXPDocumentExplorerSettings.ViewMode);
512
- const sortField = await settingService.get(AXPDocumentExplorerSettings.SortField);
513
- const sortDirection = await settingService.get(AXPDocumentExplorerSettings.SortDirection);
514
- patchState(store, {
515
- viewMode: viewMode || 'grid',
516
- sortField: sortField || 'name',
517
- sortDirection: sortDirection || 'asc'
518
- });
519
- },
520
- _load: async (folderId) => {
521
- patchState(store, { loadingFolderId: folderId, isLoading: true });
522
- await new Promise(resolve => setTimeout(resolve, 100));
523
- try {
524
- const node = await driveService.getFolder(folderId);
525
- patchState(store, {
526
- currentNode: node.result,
527
- currentPath: node.path,
528
- folders: node.result.children?.filter((item) => item.type === 'folder') || [],
529
- files: node.result.children?.filter((item) => item.type === 'file') || [],
530
- itemsCount: node.result.children?.length || 0,
531
- availableSpace: await driveService.getAvailableSpace(),
532
- loadingFolderId: null,
533
- isLoading: false,
534
- navigatingFolderId: null
535
- });
536
- }
537
- catch (error) {
538
- patchState(store, {
539
- loadingFolderId: null,
540
- isLoading: false
541
- });
542
- throw error;
543
- }
544
- },
545
- navigateToFolder(folderId) {
546
- patchState(store, { navigatingFolderId: folderId });
547
- },
548
- async loadFolderContents(folderId) {
549
- await this._load(folderId);
550
- },
551
- setViewMode(mode) {
552
- patchState(store, { viewMode: mode });
553
- settingService.scope(AXPSettingScope.User).set(AXPDocumentExplorerSettings.ViewMode, mode);
554
- },
555
- setSortField(field) {
556
- patchState(store, { sortField: field });
557
- settingService.scope(AXPSettingScope.User).set(AXPDocumentExplorerSettings.SortField, field);
558
- },
559
- setSortDirection(direction) {
560
- patchState(store, { sortDirection: direction });
561
- settingService.scope(AXPSettingScope.User).set(AXPDocumentExplorerSettings.SortDirection, direction);
562
- },
563
- setDrive(scope) {
564
- patchState(store, { currentDrive: scope });
565
- },
566
- isLoadingFolder(folderId) {
567
- return store.loadingFolderId() === folderId;
568
- },
569
- getFileInfo(fileName) {
570
- const fileTypes = store.fileTypes();
571
- const extension = fileName.split('.').pop()?.toLowerCase() || '';
572
- const extensions = fileTypes.flatMap(type => type.extensions);
573
- const fileType = extensions.find(e => e.name === extension);
574
- return {
575
- icon: fileType?.icon || 'fa-light fa-file',
576
- type: fileType?.name || 'Unknown'
577
- };
578
- },
579
- sortItems(items) {
580
- const field = store.sortField();
581
- const direction = store.sortDirection();
582
- return [...items].sort((a, b) => {
583
- let comparison = 0;
584
- switch (field) {
585
- case 'name':
586
- comparison = a.name.localeCompare(b.name);
587
- break;
588
- case 'modified':
589
- const aDate = a.lastModified ? new Date(a.lastModified) : new Date(0);
590
- const bDate = b.lastModified ? new Date(b.lastModified) : new Date(0);
591
- comparison = aDate.getTime() - bDate.getTime();
592
- break;
593
- case 'size':
594
- comparison = (a.size || 0) - (b.size || 0);
595
- break;
596
- }
597
- return direction === 'asc' ? comparison : -comparison;
598
- });
599
- },
600
- async refresh() {
601
- const currentFolder = store.currentNode();
602
- if (currentFolder) {
603
- await this._load(currentFolder.id);
604
- }
605
- }
606
- })));
607
-
608
- class AXMDocumentExplorerComponent {
609
- constructor() {
610
- this.vm = inject(AXPDocumentExplorerViewModel);
611
- this.contextMenu = viewChild('itemsContextMenu');
612
- this.rootContextMenu = viewChild('rootContextMenu');
613
- this.driveService = inject(AXMDocumentManagerService);
614
- this.translateService = inject(AXTranslationService);
615
- this.#effect = effect(() => {
616
- const navigatingFolderId = this.vm.loadingFolderId();
617
- if (!navigatingFolderId) {
618
- setTimeout(() => {
619
- this.contextMenu()?.refresh();
620
- this.rootContextMenu()?.refresh();
621
- }, 100);
622
- }
623
- });
624
- }
625
- #effect;
626
- handleNavigateToFolder(folderId) {
627
- this.vm.navigateToFolder(folderId);
628
- }
629
- // Context Menu Handlers
630
- async handleContextMenuOnOpening(e) {
631
- const node = get(e.targetElement, '__data__');
632
- if (!node) {
633
- return;
634
- }
635
- const allowedAddItems = node.type === 'folder';
636
- const allowDelete = true;
637
- const isPasteAvailable = true;
638
- const allowPaste = false;
639
- const open = node.type == 'file' ? [
640
- {
641
- name: 'open-file',
642
- text: 'Open',
643
- icon: this.vm.getFileInfo(node.name).icon,
644
- data: node,
645
- },
646
- {
647
- name: 'download',
648
- text: 'Download',
649
- icon: 'fa-light fa-download',
650
- data: node,
651
- },
652
- ] : [
653
- {
654
- name: 'open-folder',
655
- text: 'Open',
656
- icon: 'fa-light fa-folder-open',
657
- data: node,
658
- },
659
- {
660
- name: 'upload-file',
661
- text: 'Upload File',
662
- icon: 'fa-light fa-file-arrow-up',
663
- break: true,
664
- data: this.vm.currentFolder(),
665
- },
666
- ];
667
- const info = {
668
- name: node.type == 'file' ? 'file-info' : 'folder-info',
669
- text: 'Information',
670
- icon: 'fa-light fa-circle-info',
671
- items: [
672
- {
673
- name: 'rename',
674
- text: 'Rename',
675
- icon: 'fa-light fa-pencil',
676
- data: node,
677
- },
678
- {
679
- name: 'properties',
680
- text: 'Properties',
681
- icon: 'fa-light fa-memo-circle-info',
682
- break: true,
683
- data: node,
684
- },
685
- {
686
- name: 'lock ',
687
- text: 'Lock',
688
- icon: 'fa-light fa-lock',
689
- data: node,
690
- }
691
- ],
692
- break: true,
693
- };
694
- e.items = [
695
- ...open,
696
- {
697
- name: 'share',
698
- text: 'Share',
699
- icon: 'fa-light fa-share-nodes',
700
- items: [
701
- {
702
- name: 'share',
703
- text: 'Share',
704
- icon: 'fa-light fa-users',
705
- },
706
- {
707
- name: 'share-with-email',
708
- text: 'Share with email',
709
- icon: 'fa-light fa-envelope',
710
- },
711
- {
712
- name: 'link',
713
- text: 'Link',
714
- icon: 'fa-light fa-link',
715
- }
716
- ],
717
- break: true,
718
- },
719
- info,
720
- {
721
- name: 'copy',
722
- text: 'Make a copy',
723
- icon: 'fa-light fa-copy',
724
- data: node,
725
- },
726
- {
727
- name: 'copy-to',
728
- text: 'Copy to',
729
- icon: 'fa-light fa-copy',
730
- data: node,
731
- },
732
- {
733
- name: 'move-to',
734
- text: 'Move to',
735
- icon: 'fa-light fa-arrow-right-arrow-left',
736
- break: true,
737
- data: node,
738
- },
739
- {
740
- name: 'delete',
741
- text: 'Delete',
742
- color: 'danger',
743
- icon: 'fa-light fa-trash',
744
- data: node,
745
- }
746
- ];
747
- }
748
- handleContextMenuRootOnOpening(e) {
749
- //TODO: check async translate method in acorex
750
- const scope = RootConfig.config.i18n;
751
- e.items = [
752
- {
753
- name: 'new-folder',
754
- text: this.translateService.translateSync('actions.create-folder', { scope }),
755
- icon: 'fa-light fa-folder-plus',
756
- },
757
- {
758
- name: 'upload-file',
759
- text: this.translateService.translateSync('actions.upload-file', { scope }),
760
- icon: 'fa-light fa-file-arrow-up',
761
- break: true,
762
- },
763
- {
764
- name: 'refresh',
765
- text: 'Refresh',
766
- icon: 'fa-light fa-rotate-right',
767
- break: true,
768
- },
769
- {
770
- name: 'delete',
771
- text: 'Delete',
772
- color: 'danger',
773
- icon: 'fa-light fa-trash',
774
- },
775
- ];
776
- }
777
- async handleContextMenuItemClick(e) {
778
- const node = e.item.data;
779
- switch (e.item.name) {
780
- case 'open-folder':
781
- this.handleNavigateToFolder(node.id);
782
- break;
783
- case 'new-folder':
784
- await this.createFolder(node);
785
- // Handle new folder creation
786
- break;
787
- case 'upload-file':
788
- await this.uploadFile(node);
789
- break;
790
- case 'paste':
791
- // Handle paste operation
792
- break;
793
- case 'delete':
794
- // Handle delete operation
795
- break;
796
- case 'refresh':
797
- this.vm.refresh();
798
- break;
799
- }
800
- }
801
- async createFolder(node) {
802
- const folderId = node?.id ?? this.vm.currentFolder()?.id;
803
- if (folderId) {
804
- const result = await this.driveService.showCreateFolderDialog(this.vm.currentFolder()?.id);
805
- if (result) {
806
- await this.vm.refresh();
807
- }
808
- }
809
- }
810
- async uploadFile(node) {
811
- const folderId = node?.id ?? this.vm.currentFolder()?.id;
812
- if (folderId) {
813
- // const result = await this.driveService.showCreateFolderDialog(this.vm.currentFolder()?.id);
814
- // if (result) {
815
- // await this.vm.refresh();
816
- // }
817
- }
818
- }
819
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMDocumentExplorerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
820
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.3", type: AXMDocumentExplorerComponent, isStandalone: true, selector: "axp-document-explorer", viewQueries: [{ propertyName: "contextMenu", first: true, predicate: ["itemsContextMenu"], descendants: true, isSignal: true }, { propertyName: "rootContextMenu", first: true, predicate: ["rootContextMenu"], descendants: true, isSignal: true }], ngImport: i0, template: "<!-- Content -->\n<div class=\"content\">\n <!-- Empty State -->\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 <!-- Grid View -->\n @if (vm.isGridView()) {\n <!-- Folders Section -->\n @if (vm.folders().length > 0) {\n <div class=\"section\">\n <h3 class=\"section-title\">Folders</h3>\n <div class=\"items-grid\">\n @for (folder of vm.folders(); track folder.id) {\n <ng-container [ngTemplateOutlet]=\"gridFolderTemplate\" [ngTemplateOutletContext]=\"{ $implicit: folder }\">\n </ng-container>\n }\n </div>\n </div>\n }\n\n <!-- Files Section -->\n @if (vm.files().length > 0) {\n <div class=\"section\">\n <h3 class=\"section-title\">Files</h3>\n <div class=\"items-grid\">\n @for (file of vm.files(); track file.id) {\n <ng-container [ngTemplateOutlet]=\"gridFileTemplate\" [ngTemplateOutletContext]=\"{ $implicit: file }\">\n </ng-container>\n }\n </div>\n </div>\n }\n <!-- Grid View End -->\n }\n\n <!-- List View -->\n @if (vm.isListView()) {\n <div class=\"list-view\">\n <table class=\"items-table\">\n <thead>\n <tr>\n <th class=\"name-column\">Name</th>\n <th class=\"type-column\">Type</th>\n <th class=\"size-column\">Size</th>\n <th class=\"date-column\">Last Modified</th>\n </tr>\n </thead>\n <tbody>\n @for (folder of vm.folders(); track folder.id) {\n <ng-container [ngTemplateOutlet]=\"listFolderTemplate\" [ngTemplateOutletContext]=\"{ $implicit: folder }\">\n </ng-container>\n } @for (file of vm.files(); track file.id) {\n <ng-container [ngTemplateOutlet]=\"listFileTemplate\" [ngTemplateOutletContext]=\"{ $implicit: file }\">\n </ng-container>\n }\n </tbody>\n </table>\n </div>\n } }\n</div>\n\n<!-- Grid View Templates -->\n<ng-template #gridFolderTemplate let-folder>\n <div\n class=\"ax-group ax-cursor-pointer axp-explorer-item\"\n [axp-data]=\"folder\"\n (dblclick)=\"handleNavigateToFolder(folder.id)\"\n >\n <div class=\"ax-flex ax-flex-col ax-items-center ax-p-4 ax-rounded-lg ax-border ax-lighter-surface\">\n <div class=\"ax-text-yellow-400 ax-mb-2\" style=\"--fa-animation-duration: 2s\">\n @if (vm.isLoadingFolder(folder.id)) {\n <ng-container [ngTemplateOutlet]=\"folderLoading\"> </ng-container>\n } @else {\n <ax-icon icon=\"fa-light fa-folder-closed\" class=\"ax-text-3xl\"></ax-icon>\n }\n </div>\n <span class=\"ax-text-sm ax-truncate ax-w-full ax-text-center\">{{ folder.name }}</span>\n </div>\n </div>\n</ng-template>\n\n<ng-template #gridFileTemplate let-file>\n <div class=\"ax-group ax-cursor-pointer axp-explorer-item\" [axp-data]=\"file\">\n <div\n class=\"ax-flex ax-flex-col ax-items-center ax-p-4 ax-rounded-lg ax-border ax-border-gray-200 group-hover:ax-bg-gray-50\"\n >\n <div class=\"file-icon\">\n @let fileInfo = vm.getFileInfo(file.name);\n <i class=\"fa-fw {{ fileInfo.icon }}\"></i>\n <span>{{ fileInfo.type }}</span>\n </div>\n <div class=\"ax-flex ax-flex-col ax-items-center ax-gap-1 ax-mt-2\">\n <span class=\"ax-text-xs\">{{ file.size | format : 'filesize' | async }} </span>\n <span class=\"ax-text-xs\">{{ file.lastModified | format : 'datetime' : { format: 'datetime' } | async }}</span>\n </div>\n </div>\n </div>\n</ng-template>\n\n<!-- List View Templates -->\n<ng-template #listFolderTemplate let-folder>\n <tr class=\"folder-row\" (dblclick)=\"handleNavigateToFolder(folder.id)\">\n <td class=\"name-column axp-explorer-item\" [axp-data]=\"folder\">\n <div class=\"item-name\">\n @if (vm.isLoadingFolder(folder.id)) {\n <ng-container [ngTemplateOutlet]=\"folderLoading\"> </ng-container>\n } @else {\n <i class=\"fas fa-folder-closed\"></i>\n }\n <span>{{ folder.name }}</span>\n </div>\n </td>\n <td class=\"type-column axp-explorer-item\" [axp-data]=\"folder\">Folder</td>\n <td class=\"size-column axp-explorer-item\" [axp-data]=\"folder\">{{ folder.size | format : 'filesize' | async }}</td>\n <td class=\"date-column axp-explorer-item\" [axp-data]=\"folder\">\n {{ folder.lastModified | format : 'datetime' : { format: 'datetime' } | async }}\n </td>\n </tr>\n</ng-template>\n\n<ng-template #listFileTemplate let-file>\n <tr class=\"file-row\">\n @let fileInfo = vm.getFileInfo(file.name);\n <td class=\"name-column axp-explorer-item\" [axp-data]=\"file\">\n <div class=\"item-name\">\n <i class=\"fa-fw {{ fileInfo.icon }}\"></i>\n <span>{{ file.name }}</span>\n </div>\n </td>\n <td class=\"type-column axp-explorer-item\" [axp-data]=\"file\">{{ fileInfo.type }}</td>\n <td class=\"size-column axp-explorer-item\" [axp-data]=\"file\">{{ file.size | format : 'filesize' | async }}</td>\n <td class=\"date-column axp-explorer-item\" [axp-data]=\"file\">\n {{ file.lastModified | format : 'datetime' : { format: 'datetime' } | async }}\n </td>\n </tr>\n</ng-template>\n\n<ng-template #folderLoading>\n <i class=\"fa-light fa-spinner fa-spin-pulse ax-text-2xl\"></i>\n</ng-template>\n\n<!-- Context Menu-->\n<ax-context-menu\n #itemsContextMenu\n [target]=\"'.axp-explorer-item'\"\n [orientation]=\"'vertical'\"\n [closeOn]=\"'leave'\"\n (onItemClick)=\"handleContextMenuItemClick($event)\"\n (onOpening)=\"handleContextMenuOnOpening($event)\"\n>\n</ax-context-menu>\n\n<ax-context-menu\n #rootContextMenu\n [target]=\"'axp-document-explorer'\"\n [orientation]=\"'vertical'\"\n [closeOn]=\"'leave'\"\n (onItemClick)=\"handleContextMenuItemClick($event)\"\n (onOpening)=\"handleContextMenuRootOnOpening($event)\"\n>\n</ax-context-menu>\n", styles: [":host{display:flex;height:100%;flex:1 1 0%;flex-direction:column;gap:1rem}:host .content{flex:1 1 0%;-webkit-user-select:none;-moz-user-select:-moz-none;user-select:none;overflow-y:auto}:host .content .loading-state{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1rem;padding:2rem}:host .content .loading-state i{font-size:1.5rem;line-height:2rem}:host .content .section{margin-bottom:2rem}:host .content .section:last-child{margin-bottom:0}:host .content .section .section-title{margin-bottom:1rem;font-size:1.125rem;line-height:1.75rem;font-weight:500}:host .content .section .items-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:1rem}:host .content .list-view .items-table{width:100%;border-collapse:collapse}:host .content .list-view .items-table th{border-bottom-width:1px;padding:.75rem;text-align:start;font-weight:500;background-color:rgb(var(--ax-sys-color-surface));color:rgb(var(--ax-sys-color-on-surface));border-color:rgb(var(--ax-sys-color-border-surface))}:host .content .list-view .items-table th.name-column{width:50%}:host .content .list-view .items-table th.type-column{width:20%}:host .content .list-view .items-table th.size-column{width:15%}:host .content .list-view .items-table th.date-column{width:15%}:host .content .list-view .items-table td{border-bottom-width:1px;--tw-border-opacity: 1;border-color:rgba(var(--ax-sys-color-border-surface),var(--tw-border-opacity, 1));padding:.75rem}:host .content .list-view .items-table td.name-column .item-name{display:flex;align-items:center;gap:.5rem}:host .content .list-view .items-table td.name-column .item-name i{font-size:1.25rem;line-height:1.75rem}:host .content .list-view .items-table tr{cursor:pointer;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}:host .content .list-view .items-table tr:hover{--tw-bg-opacity: 1;background-color:rgba(var(--ax-sys-color-lighter-surface),var(--tw-bg-opacity, 1))}:host .content .list-view .items-table tr.folder-row td .item-name i{--tw-text-opacity: 1;color:rgb(234 179 8 / var(--tw-text-opacity, 1))}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "ngmodule", type: RouterModule }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i5.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "ngmodule", type: AXLoadingModule }, { kind: "ngmodule", type: AXFormatModule }, { kind: "pipe", type: i3.AXFormatPipe, name: "format" }, { kind: "ngmodule", type: AXDateTimeModule }, { kind: "ngmodule", type: AXMenuModule }, { kind: "component", type: i4$2.AXContextMenuComponent, selector: "ax-context-menu", inputs: ["orientation", "openOn", "closeOn", "items", "target"], outputs: ["onItemClick", "onOpening"] }, { kind: "directive", type: AXPElementDataDirective, selector: "[axp-data]", inputs: ["axp-data", "axp-data-path"] }] }); }
821
- }
822
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMDocumentExplorerComponent, decorators: [{
823
- type: Component,
824
- args: [{ selector: 'axp-document-explorer', standalone: true, imports: [CommonModule, RouterModule, AXDecoratorModule, AXLoadingModule, AXFormatModule, AXDateTimeModule, AXMenuModule, AXPElementDataDirective], template: "<!-- Content -->\n<div class=\"content\">\n <!-- Empty State -->\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 <!-- Grid View -->\n @if (vm.isGridView()) {\n <!-- Folders Section -->\n @if (vm.folders().length > 0) {\n <div class=\"section\">\n <h3 class=\"section-title\">Folders</h3>\n <div class=\"items-grid\">\n @for (folder of vm.folders(); track folder.id) {\n <ng-container [ngTemplateOutlet]=\"gridFolderTemplate\" [ngTemplateOutletContext]=\"{ $implicit: folder }\">\n </ng-container>\n }\n </div>\n </div>\n }\n\n <!-- Files Section -->\n @if (vm.files().length > 0) {\n <div class=\"section\">\n <h3 class=\"section-title\">Files</h3>\n <div class=\"items-grid\">\n @for (file of vm.files(); track file.id) {\n <ng-container [ngTemplateOutlet]=\"gridFileTemplate\" [ngTemplateOutletContext]=\"{ $implicit: file }\">\n </ng-container>\n }\n </div>\n </div>\n }\n <!-- Grid View End -->\n }\n\n <!-- List View -->\n @if (vm.isListView()) {\n <div class=\"list-view\">\n <table class=\"items-table\">\n <thead>\n <tr>\n <th class=\"name-column\">Name</th>\n <th class=\"type-column\">Type</th>\n <th class=\"size-column\">Size</th>\n <th class=\"date-column\">Last Modified</th>\n </tr>\n </thead>\n <tbody>\n @for (folder of vm.folders(); track folder.id) {\n <ng-container [ngTemplateOutlet]=\"listFolderTemplate\" [ngTemplateOutletContext]=\"{ $implicit: folder }\">\n </ng-container>\n } @for (file of vm.files(); track file.id) {\n <ng-container [ngTemplateOutlet]=\"listFileTemplate\" [ngTemplateOutletContext]=\"{ $implicit: file }\">\n </ng-container>\n }\n </tbody>\n </table>\n </div>\n } }\n</div>\n\n<!-- Grid View Templates -->\n<ng-template #gridFolderTemplate let-folder>\n <div\n class=\"ax-group ax-cursor-pointer axp-explorer-item\"\n [axp-data]=\"folder\"\n (dblclick)=\"handleNavigateToFolder(folder.id)\"\n >\n <div class=\"ax-flex ax-flex-col ax-items-center ax-p-4 ax-rounded-lg ax-border ax-lighter-surface\">\n <div class=\"ax-text-yellow-400 ax-mb-2\" style=\"--fa-animation-duration: 2s\">\n @if (vm.isLoadingFolder(folder.id)) {\n <ng-container [ngTemplateOutlet]=\"folderLoading\"> </ng-container>\n } @else {\n <ax-icon icon=\"fa-light fa-folder-closed\" class=\"ax-text-3xl\"></ax-icon>\n }\n </div>\n <span class=\"ax-text-sm ax-truncate ax-w-full ax-text-center\">{{ folder.name }}</span>\n </div>\n </div>\n</ng-template>\n\n<ng-template #gridFileTemplate let-file>\n <div class=\"ax-group ax-cursor-pointer axp-explorer-item\" [axp-data]=\"file\">\n <div\n class=\"ax-flex ax-flex-col ax-items-center ax-p-4 ax-rounded-lg ax-border ax-border-gray-200 group-hover:ax-bg-gray-50\"\n >\n <div class=\"file-icon\">\n @let fileInfo = vm.getFileInfo(file.name);\n <i class=\"fa-fw {{ fileInfo.icon }}\"></i>\n <span>{{ fileInfo.type }}</span>\n </div>\n <div class=\"ax-flex ax-flex-col ax-items-center ax-gap-1 ax-mt-2\">\n <span class=\"ax-text-xs\">{{ file.size | format : 'filesize' | async }} </span>\n <span class=\"ax-text-xs\">{{ file.lastModified | format : 'datetime' : { format: 'datetime' } | async }}</span>\n </div>\n </div>\n </div>\n</ng-template>\n\n<!-- List View Templates -->\n<ng-template #listFolderTemplate let-folder>\n <tr class=\"folder-row\" (dblclick)=\"handleNavigateToFolder(folder.id)\">\n <td class=\"name-column axp-explorer-item\" [axp-data]=\"folder\">\n <div class=\"item-name\">\n @if (vm.isLoadingFolder(folder.id)) {\n <ng-container [ngTemplateOutlet]=\"folderLoading\"> </ng-container>\n } @else {\n <i class=\"fas fa-folder-closed\"></i>\n }\n <span>{{ folder.name }}</span>\n </div>\n </td>\n <td class=\"type-column axp-explorer-item\" [axp-data]=\"folder\">Folder</td>\n <td class=\"size-column axp-explorer-item\" [axp-data]=\"folder\">{{ folder.size | format : 'filesize' | async }}</td>\n <td class=\"date-column axp-explorer-item\" [axp-data]=\"folder\">\n {{ folder.lastModified | format : 'datetime' : { format: 'datetime' } | async }}\n </td>\n </tr>\n</ng-template>\n\n<ng-template #listFileTemplate let-file>\n <tr class=\"file-row\">\n @let fileInfo = vm.getFileInfo(file.name);\n <td class=\"name-column axp-explorer-item\" [axp-data]=\"file\">\n <div class=\"item-name\">\n <i class=\"fa-fw {{ fileInfo.icon }}\"></i>\n <span>{{ file.name }}</span>\n </div>\n </td>\n <td class=\"type-column axp-explorer-item\" [axp-data]=\"file\">{{ fileInfo.type }}</td>\n <td class=\"size-column axp-explorer-item\" [axp-data]=\"file\">{{ file.size | format : 'filesize' | async }}</td>\n <td class=\"date-column axp-explorer-item\" [axp-data]=\"file\">\n {{ file.lastModified | format : 'datetime' : { format: 'datetime' } | async }}\n </td>\n </tr>\n</ng-template>\n\n<ng-template #folderLoading>\n <i class=\"fa-light fa-spinner fa-spin-pulse ax-text-2xl\"></i>\n</ng-template>\n\n<!-- Context Menu-->\n<ax-context-menu\n #itemsContextMenu\n [target]=\"'.axp-explorer-item'\"\n [orientation]=\"'vertical'\"\n [closeOn]=\"'leave'\"\n (onItemClick)=\"handleContextMenuItemClick($event)\"\n (onOpening)=\"handleContextMenuOnOpening($event)\"\n>\n</ax-context-menu>\n\n<ax-context-menu\n #rootContextMenu\n [target]=\"'axp-document-explorer'\"\n [orientation]=\"'vertical'\"\n [closeOn]=\"'leave'\"\n (onItemClick)=\"handleContextMenuItemClick($event)\"\n (onOpening)=\"handleContextMenuRootOnOpening($event)\"\n>\n</ax-context-menu>\n", styles: [":host{display:flex;height:100%;flex:1 1 0%;flex-direction:column;gap:1rem}:host .content{flex:1 1 0%;-webkit-user-select:none;-moz-user-select:-moz-none;user-select:none;overflow-y:auto}:host .content .loading-state{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1rem;padding:2rem}:host .content .loading-state i{font-size:1.5rem;line-height:2rem}:host .content .section{margin-bottom:2rem}:host .content .section:last-child{margin-bottom:0}:host .content .section .section-title{margin-bottom:1rem;font-size:1.125rem;line-height:1.75rem;font-weight:500}:host .content .section .items-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:1rem}:host .content .list-view .items-table{width:100%;border-collapse:collapse}:host .content .list-view .items-table th{border-bottom-width:1px;padding:.75rem;text-align:start;font-weight:500;background-color:rgb(var(--ax-sys-color-surface));color:rgb(var(--ax-sys-color-on-surface));border-color:rgb(var(--ax-sys-color-border-surface))}:host .content .list-view .items-table th.name-column{width:50%}:host .content .list-view .items-table th.type-column{width:20%}:host .content .list-view .items-table th.size-column{width:15%}:host .content .list-view .items-table th.date-column{width:15%}:host .content .list-view .items-table td{border-bottom-width:1px;--tw-border-opacity: 1;border-color:rgba(var(--ax-sys-color-border-surface),var(--tw-border-opacity, 1));padding:.75rem}:host .content .list-view .items-table td.name-column .item-name{display:flex;align-items:center;gap:.5rem}:host .content .list-view .items-table td.name-column .item-name i{font-size:1.25rem;line-height:1.75rem}:host .content .list-view .items-table tr{cursor:pointer;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}:host .content .list-view .items-table tr:hover{--tw-bg-opacity: 1;background-color:rgba(var(--ax-sys-color-lighter-surface),var(--tw-bg-opacity, 1))}:host .content .list-view .items-table tr.folder-row td .item-name i{--tw-text-opacity: 1;color:rgb(234 179 8 / var(--tw-text-opacity, 1))}\n"] }]
825
- }] });
826
-
827
- class AXMDocumentDriveComponent {
828
- constructor() {
829
- this.layout = inject(AXPLayoutThemeService);
830
- this.rootConfig = RootConfig;
831
- this.fileTypeService = inject(AXPFileTypeProviderService);
832
- this.driveService = inject(AXMDocumentManagerService);
833
- this.vm = inject(AXPDocumentExplorerViewModel);
834
- this.router = inject(Router);
835
- this.activatedRoute = inject(ActivatedRoute);
836
- this.sessionService = inject(AXPSessionService);
837
- this.filterItems = signal([]);
838
- this.selectedFilter = signal('all');
839
- this.sortItems = signal([
840
- { key: 'name', textKey: 'actions.sort-by-name', icon: 'fa-light fa-font' },
841
- { key: 'modified', textKey: 'actions.sort-by-date', icon: 'fa-light fa-calendar' },
842
- { key: 'size', textKey: 'actions.sort-by-size', icon: 'fa-light fa-weight-hanging' },
843
- ]);
844
- this.documentExplorer = viewChild(AXMDocumentExplorerComponent);
845
- this.selectedSort = computed(() => {
846
- const items = this.sortItems();
847
- return items.find((item) => item.key === this.vm.sortField()) || items[0];
848
- });
849
- this.#navigateEffect = effect(() => {
850
- const navigatingFolderId = this.vm.navigatingFolderId();
851
- if (navigatingFolderId) {
852
- this.handleNavigateToFolder(navigatingFolderId);
853
- }
854
- });
855
- this.#loadingEffect = effect(() => {
856
- const isLoading = this.vm.isLoading();
857
- untracked(() => {
858
- this.layout.setNavigationLoading(isLoading);
859
- });
860
- });
861
- }
862
- #navigateEffect;
863
- #loadingEffect;
864
- async ngOnInit() {
865
- await this.loadFilterItems();
866
- await this.vm.initialize();
867
- // Subscribe to route changes
868
- this.activatedRoute.paramMap.subscribe(async (params) => {
869
- this.loadDrive();
870
- });
871
- }
872
- async loadDrive() {
873
- const folderId = this.activatedRoute.snapshot.paramMap.get('id');
874
- if (folderId) {
875
- await this.vm.loadFolderContents(folderId);
876
- }
877
- else {
878
- const root = await this.driveService.getRoot(AXMDriveScope.Platform);
879
- if (root.result) {
880
- await this.router.navigate([`${this.sessionService.application?.name}/drive/my/${root.result.id}`], { replaceUrl: true });
881
- }
882
- }
883
- }
884
- async loadFilterItems() {
885
- const types = await this.fileTypeService.items();
886
- const items = [
887
- { key: 'all', textKey: 'file-types.all', icon: 'fa-light fa-folder-closed' },
888
- ...types.map((type) => ({
889
- key: type.name,
890
- textKey: `file-types.${type.name}`,
891
- icon: type.icon || 'fa-light fa-file',
892
- })),
893
- ];
894
- this.filterItems.set(items);
895
- }
896
- setFilter(key) {
897
- this.selectedFilter.set(key);
898
- }
899
- getFilterIcon() {
900
- if (this.selectedFilter() === 'all') {
901
- return 'fa-light fa-folder-closed';
902
- }
903
- const item = this.filterItems().find((item) => item.key === this.selectedFilter());
904
- return item?.icon || 'fa-light fa-file';
905
- }
906
- getFilterText() {
907
- if (this.selectedFilter() === 'all') {
908
- return 'file-types.all';
909
- }
910
- const item = this.filterItems().find((item) => item.key === this.selectedFilter());
911
- return item?.textKey || 'file-types.all';
912
- }
913
- handleNavigateToFolder(folderId) {
914
- this.router.navigate([`${this.sessionService.application?.name}/drive/my/${folderId}`]);
915
- }
916
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMDocumentDriveComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
917
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.3", type: AXMDocumentDriveComponent, isStandalone: true, selector: "axp-document-drive", providers: [AXPDocumentExplorerViewModel], viewQueries: [{ propertyName: "documentExplorer", first: true, predicate: AXMDocumentExplorerComponent, descendants: true, isSignal: true }], ngImport: i0, template: "<!-- Main Layout -->\n<axp-layout-simple-page *translate=\"let t\">\n <!-- Header Section -->\n <axp-layout-header>\n <!-- Title Section -->\n <axp-layout-title>\n @if(vm.isRoot()) {\n {{ t('my-drive.title', { scope: rootConfig.config.i18n }) | async }}\n }@else {\n {{ vm.currentFolder()?.name }}\n }\n </axp-layout-title>\n\n <!-- Description Section -->\n <axp-layout-description>\n {{\n t('my-drive.description', {\n scope: rootConfig.config.i18n,\n params: {\n count: vm.itemsCount(),\n size: vm.availableSpace() | format : 'filesize' | async\n }\n }) | async\n }}\n </axp-layout-description>\n\n <!-- Actions Section -->\n <axp-layout-actions>\n <!-- Primary Actions -->\n <axp-layout-actions-primary>\n <!-- Upload Dropdown -->\n <ax-button [text]=\"t('actions.add-item', { scope: rootConfig.config.i18n }) | async\" [color]=\"'primary'\">\n <ax-prefix>\n <ax-icon icon=\"fa-light fa-plus\"></ax-icon>\n </ax-prefix>\n <ax-dropdown-panel>\n <ax-button-item-list>\n <ax-button-item\n (onClick)=\"documentExplorer()?.createFolder()\"\n [text]=\"(t('actions.create-folder', { scope: rootConfig.config.i18n }) | async)!\"\n >\n <ax-prefix>\n <ax-icon icon=\"fa-light fa-folder-plus\"></ax-icon>\n </ax-prefix>\n </ax-button-item>\n <ax-divider></ax-divider>\n <ax-button-item \n (onClick)=\"documentExplorer()?.uploadFile()\"\n [text]=\"(t('actions.upload-file', { scope: rootConfig.config.i18n }) | async)!\">\n <ax-prefix>\n <ax-icon icon=\"fa-light fa-file-arrow-up\"></ax-icon>\n </ax-prefix>\n </ax-button-item>\n </ax-button-item-list>\n </ax-dropdown-panel>\n </ax-button>\n </axp-layout-actions-primary>\n\n <!-- Secondary Actions -->\n <axp-layout-actions-secondary>\n <ax-button-item [text]=\"(t('actions.fa-share', { scope: rootConfig.config.i18n }) | async)!\">\n <ax-prefix>\n <ax-icon icon=\"fa-light fa-share-nodes\"></ax-icon>\n </ax-prefix>\n </ax-button-item>\n </axp-layout-actions-secondary>\n </axp-layout-actions>\n\n <!-- Breadcrumbs Section -->\n <axp-layout-breadcrumbs>\n <ax-breadcrumbs [class.ax-hidden]=\"layout.isSmall()\">\n <ng-template #divider>\n <i class=\"fa-regular fa-slash-forward\"></i>\n </ng-template>\n <ax-breadcrumbs-item> {{ t('home') | async }} </ax-breadcrumbs-item>\n <ax-breadcrumbs-item> {{ t('profile.title', { scope: 'auth' }) | async }} </ax-breadcrumbs-item>\n </ax-breadcrumbs>\n </axp-layout-breadcrumbs>\n\n <!-- Toolbar Section -->\n <axp-layout-toolbar>\n <!-- Left Side Toolbar -->\n <axp-layout-prefix>\n <!-- Filter Dropdown -->\n <ax-button [text]=\"t(getFilterText(), { scope: rootConfig.config.i18n }) | async\">\n <ax-prefix>\n <ax-icon [icon]=\"getFilterIcon()\"></ax-icon>\n </ax-prefix>\n\n <ax-dropdown-panel>\n <ax-button-item-list class=\"ax-p-2\">\n @for(item of filterItems(); track item.key) {\n <ax-button-item\n (onClick)=\"setFilter(item.key)\"\n [text]=\"(t(item.textKey, { scope: rootConfig.config.i18n }) | async)!\"\n >\n <ax-prefix>\n <ax-icon [icon]=\"item.icon\"></ax-icon>\n </ax-prefix>\n </ax-button-item>\n }\n </ax-button-item-list>\n </ax-dropdown-panel>\n </ax-button>\n\n <!-- Search Box -->\n <ax-search-box class=\"ax-w-72\" [placeholder]=\"t('actions.search', { scope: rootConfig.config.i18n }) | async\"\n ><ax-clear-button></ax-clear-button\n ></ax-search-box>\n </axp-layout-prefix>\n\n <!-- Right Side Toolbar -->\n <axp-layout-suffix>\n <!-- Sort Dropdown -->\n <ax-button>\n <ax-icon\n [icon]=\"'fa-light fa-arrow-' + (vm.sortDirection() === 'asc' ? 'up' : 'down') + '-wide-short'\"\n ></ax-icon>\n <ax-dropdown-panel>\n <ax-button-item-list>\n <!-- Sort By Options -->\n @for(item of sortItems(); track item.key) {\n <ax-button-item\n [text]=\"(t(item.textKey, { scope: rootConfig.config.i18n }) | async)!\"\n (onClick)=\"vm.setSortField(item.key)\"\n [selected]=\"vm.sortField() === item.key\"\n >\n <ax-prefix>\n <ax-icon [icon]=\"item.icon\"></ax-icon>\n </ax-prefix>\n </ax-button-item>\n }\n <ax-divider></ax-divider>\n <!-- Sort Direction Options -->\n <ax-button-item\n [text]=\"(t('actions.sort-ascending', { scope: rootConfig.config.i18n }) | async)!\"\n [selected]=\"vm.sortDirection() === 'asc'\"\n (onClick)=\"vm.setSortDirection('asc')\"\n >\n <ax-prefix>\n <ax-icon icon=\"fa-light fa-arrow-up-wide-short\"></ax-icon>\n </ax-prefix>\n </ax-button-item>\n <ax-button-item\n [text]=\"(t('actions.sort-descending', { scope: rootConfig.config.i18n }) | async)!\"\n [selected]=\"vm.sortDirection() === 'desc'\"\n (onClick)=\"vm.setSortDirection('desc')\"\n >\n <ax-prefix>\n <ax-icon icon=\"fa-light fa-arrow-down-wide-short\"></ax-icon>\n </ax-prefix>\n </ax-button-item>\n </ax-button-item-list>\n </ax-dropdown-panel>\n </ax-button>\n\n <!-- View Mode Toggle -->\n <ax-button>\n @if(vm.isGridView()) {\n <ax-icon icon=\"fa-light fa-grid-2\"></ax-icon>\n }@else {\n <ax-icon icon=\"fa-light fa-list\"></ax-icon>\n }\n <ax-dropdown-panel>\n <ax-button-item-list>\n <ax-button-item\n [text]=\"(t('actions.grid-view', { scope: rootConfig.config.i18n }) | async)!\"\n [selected]=\"vm.isGridView()\"\n (onClick)=\"vm.setViewMode('grid')\"\n >\n <ax-prefix>\n <ax-icon icon=\"fa-light fa-grid-2\"></ax-icon>\n </ax-prefix>\n </ax-button-item>\n <ax-button-item\n [text]=\"(t('actions.list-view', { scope: rootConfig.config.i18n }) | async)!\"\n (onClick)=\"vm.setViewMode('list')\"\n [selected]=\"vm.isListView()\"\n >\n <ax-prefix>\n <ax-icon icon=\"fa-light fa-list\"></ax-icon>\n </ax-prefix>\n </ax-button-item>\n </ax-button-item-list>\n </ax-dropdown-panel>\n </ax-button>\n </axp-layout-suffix>\n </axp-layout-toolbar>\n </axp-layout-header>\n\n <!-- Content Section -->\n <axp-layout-content class=\"ax-overflow-hidden ax-flex ax-flex-col ax-flex-1\">\n <axp-document-explorer></axp-document-explorer>\n </axp-layout-content>\n\n <!-- Footer Section -->\n <axp-layout-footer>\n <axp-layout-prefix>\n <div class=\"breadcrumb ax-xs\">\n @for (item of vm.currentPath(); track item.id; let i = $index;let last = $last) {\n <!-- Navigation Button -->\n <ax-button look=\"blank\" (onClick)=\"handleNavigateToFolder(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=\"fa-regular fa-chevron-right fa-fw fa-xs\"></i>\n } }\n </div>\n </axp-layout-prefix>\n\n <axp-layout-suffix> </axp-layout-suffix>\n </axp-layout-footer>\n</axp-layout-simple-page>\n", styles: [".breadcrumb{display:flex;flex-direction:row;align-items:center;gap:.25rem}.breadcrumb .ax-state-disabled button,.breadcrumb .ax-state-loading button{cursor:default!important}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "ngmodule", type: RouterModule }, { kind: "ngmodule", type: AXMenuModule }, { kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i2$1.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "type", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "loadingTextChange"] }, { kind: "component", type: i2$1.AXButtonItemComponent, selector: "ax-button-item", inputs: ["color", "disabled", "text", "selected", "divided", "data", "name"], outputs: ["onClick", "onFocus", "onBlur", "disabledChange"] }, { kind: "component", type: i2$1.AXButtonItemListComponent, selector: "ax-button-item-list", inputs: ["items"], outputs: ["onItemClick"] }, { kind: "ngmodule", type: AXButtonGroupModule }, { kind: "ngmodule", type: AXDropdownButtonModule }, { kind: "ngmodule", type: AXDropdownModule }, { kind: "component", type: i3$1.AXDropdownPanelComponent, selector: "ax-dropdown-panel", inputs: ["isOpen", "fitParent", "dropdownWidth", "position", "placement", "_target", "adaptivityEnabled"], outputs: ["onOpened", "onClosed"] }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "directive", type: i9.AXTranslatorDirective, selector: "[translate]" }, { kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i5.AXDecoratorIconComponent, selector: "ax-icon", inputs: ["icon"] }, { kind: "component", type: i5.AXDecoratorClearButtonComponent, selector: "ax-clear-button", inputs: ["icon"] }, { kind: "component", type: i5.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: AXLoadingModule }, { kind: "ngmodule", type: AXBreadcrumbsModule }, { kind: "component", type: i6.AXBreadCrumbsComponent, selector: "ax-breadcrumbs" }, { kind: "component", type: i6.AXBreadCrumbsItemComponent, selector: "ax-breadcrumbs-item", inputs: ["disabled", "active"] }, { kind: "ngmodule", type: AXBadgeModule }, { kind: "ngmodule", type: AXSearchBoxModule }, { kind: "component", type: i7$1.AXSearchBoxComponent, selector: "ax-search-box", inputs: ["disabled", "readonly", "tabIndex", "placeholder", "value", "state", "name", "id", "look", "class", "delayTime", "type"], outputs: ["valueChange", "stateChange", "onValueChanged", "onBlur", "onFocus", "readonlyChange", "disabledChange", "onKeyDown", "onKeyUp", "onKeyPress"] }, { kind: "ngmodule", type: AXFormatModule }, { kind: "pipe", type: i3.AXFormatPipe, name: "format" }, { kind: "ngmodule", type: AXFileModule }, { kind: "component", type: AXPSimplePageLayout, selector: "axp-layout-simple-page" }, { kind: "component", type: AXPThemeLayoutBlockComponent, selector: " axp-layout-content, axp-layout-header-container, axp-layout-side-container, axp-layout-sections, axp-layout-section-container, axp-layout-body, axp-layout-prefix, axp-layout-suffix, axp-layout-title, axp-layout-nav-button, axp-layout-description, axp-layout-title-bar, axp-layout-breadcrumbs, axp-layout-list-action, " }, { kind: "component", type: AXPThemeLayoutHeaderTemplateComponent, selector: "axp-layout-header" }, { kind: "component", type: AXPThemeLayoutActionsComponent, selector: "axp-layout-actions" }, { kind: "component", type: AXPThemeLayoutPagePrimaryActionsComponent, selector: "axp-layout-actions-primary" }, { kind: "component", type: AXPThemeLayoutPageSecondaryActionsComponent, selector: "axp-layout-actions-secondary" }, { kind: "component", type: AXPThemeLayoutToolbarComponent, selector: "axp-layout-toolbar" }, { kind: "component", type: AXPThemeLayoutFooterComponent, selector: "axp-layout-footer" }, { kind: "ngmodule", type: AXDateTimeModule }, { kind: "component", type: AXMDocumentExplorerComponent, selector: "axp-document-explorer" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
918
- }
919
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.3", ngImport: i0, type: AXMDocumentDriveComponent, decorators: [{
920
- type: Component,
921
- args: [{ selector: 'axp-document-drive', standalone: true, imports: [
922
- CommonModule,
923
- RouterModule,
924
- AXMenuModule,
925
- AXButtonModule,
926
- AXButtonGroupModule,
927
- AXDropdownButtonModule,
928
- AXDropdownModule,
929
- AXTranslationModule,
930
- AXDecoratorModule,
931
- AXLoadingModule,
932
- AXBreadcrumbsModule,
933
- AXBadgeModule,
934
- AXSearchBoxModule,
935
- AXFormatModule,
936
- AXFileModule,
937
- AXPSimplePageLayout,
938
- AXPThemeLayoutBlockComponent,
939
- AXPThemeLayoutHeaderTemplateComponent,
940
- AXPThemeLayoutActionsComponent,
941
- AXPThemeLayoutPagePrimaryActionsComponent,
942
- AXPThemeLayoutPageSecondaryActionsComponent,
943
- AXPThemeLayoutToolbarComponent,
944
- AXPThemeLayoutFooterComponent,
945
- AXDateTimeModule,
946
- AXMDocumentExplorerComponent
947
- ], changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, providers: [AXPDocumentExplorerViewModel], template: "<!-- Main Layout -->\n<axp-layout-simple-page *translate=\"let t\">\n <!-- Header Section -->\n <axp-layout-header>\n <!-- Title Section -->\n <axp-layout-title>\n @if(vm.isRoot()) {\n {{ t('my-drive.title', { scope: rootConfig.config.i18n }) | async }}\n }@else {\n {{ vm.currentFolder()?.name }}\n }\n </axp-layout-title>\n\n <!-- Description Section -->\n <axp-layout-description>\n {{\n t('my-drive.description', {\n scope: rootConfig.config.i18n,\n params: {\n count: vm.itemsCount(),\n size: vm.availableSpace() | format : 'filesize' | async\n }\n }) | async\n }}\n </axp-layout-description>\n\n <!-- Actions Section -->\n <axp-layout-actions>\n <!-- Primary Actions -->\n <axp-layout-actions-primary>\n <!-- Upload Dropdown -->\n <ax-button [text]=\"t('actions.add-item', { scope: rootConfig.config.i18n }) | async\" [color]=\"'primary'\">\n <ax-prefix>\n <ax-icon icon=\"fa-light fa-plus\"></ax-icon>\n </ax-prefix>\n <ax-dropdown-panel>\n <ax-button-item-list>\n <ax-button-item\n (onClick)=\"documentExplorer()?.createFolder()\"\n [text]=\"(t('actions.create-folder', { scope: rootConfig.config.i18n }) | async)!\"\n >\n <ax-prefix>\n <ax-icon icon=\"fa-light fa-folder-plus\"></ax-icon>\n </ax-prefix>\n </ax-button-item>\n <ax-divider></ax-divider>\n <ax-button-item \n (onClick)=\"documentExplorer()?.uploadFile()\"\n [text]=\"(t('actions.upload-file', { scope: rootConfig.config.i18n }) | async)!\">\n <ax-prefix>\n <ax-icon icon=\"fa-light fa-file-arrow-up\"></ax-icon>\n </ax-prefix>\n </ax-button-item>\n </ax-button-item-list>\n </ax-dropdown-panel>\n </ax-button>\n </axp-layout-actions-primary>\n\n <!-- Secondary Actions -->\n <axp-layout-actions-secondary>\n <ax-button-item [text]=\"(t('actions.fa-share', { scope: rootConfig.config.i18n }) | async)!\">\n <ax-prefix>\n <ax-icon icon=\"fa-light fa-share-nodes\"></ax-icon>\n </ax-prefix>\n </ax-button-item>\n </axp-layout-actions-secondary>\n </axp-layout-actions>\n\n <!-- Breadcrumbs Section -->\n <axp-layout-breadcrumbs>\n <ax-breadcrumbs [class.ax-hidden]=\"layout.isSmall()\">\n <ng-template #divider>\n <i class=\"fa-regular fa-slash-forward\"></i>\n </ng-template>\n <ax-breadcrumbs-item> {{ t('home') | async }} </ax-breadcrumbs-item>\n <ax-breadcrumbs-item> {{ t('profile.title', { scope: 'auth' }) | async }} </ax-breadcrumbs-item>\n </ax-breadcrumbs>\n </axp-layout-breadcrumbs>\n\n <!-- Toolbar Section -->\n <axp-layout-toolbar>\n <!-- Left Side Toolbar -->\n <axp-layout-prefix>\n <!-- Filter Dropdown -->\n <ax-button [text]=\"t(getFilterText(), { scope: rootConfig.config.i18n }) | async\">\n <ax-prefix>\n <ax-icon [icon]=\"getFilterIcon()\"></ax-icon>\n </ax-prefix>\n\n <ax-dropdown-panel>\n <ax-button-item-list class=\"ax-p-2\">\n @for(item of filterItems(); track item.key) {\n <ax-button-item\n (onClick)=\"setFilter(item.key)\"\n [text]=\"(t(item.textKey, { scope: rootConfig.config.i18n }) | async)!\"\n >\n <ax-prefix>\n <ax-icon [icon]=\"item.icon\"></ax-icon>\n </ax-prefix>\n </ax-button-item>\n }\n </ax-button-item-list>\n </ax-dropdown-panel>\n </ax-button>\n\n <!-- Search Box -->\n <ax-search-box class=\"ax-w-72\" [placeholder]=\"t('actions.search', { scope: rootConfig.config.i18n }) | async\"\n ><ax-clear-button></ax-clear-button\n ></ax-search-box>\n </axp-layout-prefix>\n\n <!-- Right Side Toolbar -->\n <axp-layout-suffix>\n <!-- Sort Dropdown -->\n <ax-button>\n <ax-icon\n [icon]=\"'fa-light fa-arrow-' + (vm.sortDirection() === 'asc' ? 'up' : 'down') + '-wide-short'\"\n ></ax-icon>\n <ax-dropdown-panel>\n <ax-button-item-list>\n <!-- Sort By Options -->\n @for(item of sortItems(); track item.key) {\n <ax-button-item\n [text]=\"(t(item.textKey, { scope: rootConfig.config.i18n }) | async)!\"\n (onClick)=\"vm.setSortField(item.key)\"\n [selected]=\"vm.sortField() === item.key\"\n >\n <ax-prefix>\n <ax-icon [icon]=\"item.icon\"></ax-icon>\n </ax-prefix>\n </ax-button-item>\n }\n <ax-divider></ax-divider>\n <!-- Sort Direction Options -->\n <ax-button-item\n [text]=\"(t('actions.sort-ascending', { scope: rootConfig.config.i18n }) | async)!\"\n [selected]=\"vm.sortDirection() === 'asc'\"\n (onClick)=\"vm.setSortDirection('asc')\"\n >\n <ax-prefix>\n <ax-icon icon=\"fa-light fa-arrow-up-wide-short\"></ax-icon>\n </ax-prefix>\n </ax-button-item>\n <ax-button-item\n [text]=\"(t('actions.sort-descending', { scope: rootConfig.config.i18n }) | async)!\"\n [selected]=\"vm.sortDirection() === 'desc'\"\n (onClick)=\"vm.setSortDirection('desc')\"\n >\n <ax-prefix>\n <ax-icon icon=\"fa-light fa-arrow-down-wide-short\"></ax-icon>\n </ax-prefix>\n </ax-button-item>\n </ax-button-item-list>\n </ax-dropdown-panel>\n </ax-button>\n\n <!-- View Mode Toggle -->\n <ax-button>\n @if(vm.isGridView()) {\n <ax-icon icon=\"fa-light fa-grid-2\"></ax-icon>\n }@else {\n <ax-icon icon=\"fa-light fa-list\"></ax-icon>\n }\n <ax-dropdown-panel>\n <ax-button-item-list>\n <ax-button-item\n [text]=\"(t('actions.grid-view', { scope: rootConfig.config.i18n }) | async)!\"\n [selected]=\"vm.isGridView()\"\n (onClick)=\"vm.setViewMode('grid')\"\n >\n <ax-prefix>\n <ax-icon icon=\"fa-light fa-grid-2\"></ax-icon>\n </ax-prefix>\n </ax-button-item>\n <ax-button-item\n [text]=\"(t('actions.list-view', { scope: rootConfig.config.i18n }) | async)!\"\n (onClick)=\"vm.setViewMode('list')\"\n [selected]=\"vm.isListView()\"\n >\n <ax-prefix>\n <ax-icon icon=\"fa-light fa-list\"></ax-icon>\n </ax-prefix>\n </ax-button-item>\n </ax-button-item-list>\n </ax-dropdown-panel>\n </ax-button>\n </axp-layout-suffix>\n </axp-layout-toolbar>\n </axp-layout-header>\n\n <!-- Content Section -->\n <axp-layout-content class=\"ax-overflow-hidden ax-flex ax-flex-col ax-flex-1\">\n <axp-document-explorer></axp-document-explorer>\n </axp-layout-content>\n\n <!-- Footer Section -->\n <axp-layout-footer>\n <axp-layout-prefix>\n <div class=\"breadcrumb ax-xs\">\n @for (item of vm.currentPath(); track item.id; let i = $index;let last = $last) {\n <!-- Navigation Button -->\n <ax-button look=\"blank\" (onClick)=\"handleNavigateToFolder(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=\"fa-regular fa-chevron-right fa-fw fa-xs\"></i>\n } }\n </div>\n </axp-layout-prefix>\n\n <axp-layout-suffix> </axp-layout-suffix>\n </axp-layout-footer>\n</axp-layout-simple-page>\n", styles: [".breadcrumb{display:flex;flex-direction:row;align-items:center;gap:.25rem}.breadcrumb .ax-state-disabled button,.breadcrumb .ax-state-loading button{cursor:default!important}\n"] }]
948
- }] });
949
-
950
- export { AXMDocumentDriveComponent };
951
- //# sourceMappingURL=acorex-modules-document-management-drive.component-bjnFFaLS.mjs.map