@acorex/modules 21.0.0-next.13 → 21.0.0-next.15

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 (39) hide show
  1. package/document-management/index.d.ts +93 -115
  2. package/fesm2022/{acorex-modules-auth-acorex-modules-auth-DHSmTid9.mjs → acorex-modules-auth-acorex-modules-auth-CZuDhBx5.mjs} +15 -15
  3. package/fesm2022/acorex-modules-auth-acorex-modules-auth-CZuDhBx5.mjs.map +1 -0
  4. package/fesm2022/{acorex-modules-auth-app-chooser.component-BgnYEXEl.mjs → acorex-modules-auth-app-chooser.component-DJE47I8p.mjs} +2 -2
  5. package/fesm2022/{acorex-modules-auth-app-chooser.component-BgnYEXEl.mjs.map → acorex-modules-auth-app-chooser.component-DJE47I8p.mjs.map} +1 -1
  6. package/fesm2022/{acorex-modules-auth-login.module-BvhI4dAz.mjs → acorex-modules-auth-login.module-CI_lkyb7.mjs} +4 -4
  7. package/fesm2022/{acorex-modules-auth-login.module-BvhI4dAz.mjs.map → acorex-modules-auth-login.module-CI_lkyb7.mjs.map} +1 -1
  8. package/fesm2022/{acorex-modules-auth-master.layout-D4zZR1Gr.mjs → acorex-modules-auth-master.layout-CdY380qS.mjs} +2 -2
  9. package/fesm2022/{acorex-modules-auth-master.layout-D4zZR1Gr.mjs.map → acorex-modules-auth-master.layout-CdY380qS.mjs.map} +1 -1
  10. package/fesm2022/{acorex-modules-auth-oauth-callback.component-DniYj9Tx.mjs → acorex-modules-auth-oauth-callback.component-BvPk9b3e.mjs} +2 -2
  11. package/fesm2022/{acorex-modules-auth-oauth-callback.component-DniYj9Tx.mjs.map → acorex-modules-auth-oauth-callback.component-BvPk9b3e.mjs.map} +1 -1
  12. package/fesm2022/{acorex-modules-auth-password.component-mvQ4KY3g.mjs → acorex-modules-auth-password.component-CefISnvd.mjs} +2 -2
  13. package/fesm2022/{acorex-modules-auth-password.component-mvQ4KY3g.mjs.map → acorex-modules-auth-password.component-CefISnvd.mjs.map} +1 -1
  14. package/fesm2022/{acorex-modules-auth-password.component-CZkZAj32.mjs → acorex-modules-auth-password.component-Dw_v_EFQ.mjs} +2 -2
  15. package/fesm2022/{acorex-modules-auth-password.component-CZkZAj32.mjs.map → acorex-modules-auth-password.component-Dw_v_EFQ.mjs.map} +1 -1
  16. package/fesm2022/{acorex-modules-auth-routes-6Ulmk7si.mjs → acorex-modules-auth-routes-CwcJHbAi.mjs} +2 -2
  17. package/fesm2022/{acorex-modules-auth-routes-6Ulmk7si.mjs.map → acorex-modules-auth-routes-CwcJHbAi.mjs.map} +1 -1
  18. package/fesm2022/{acorex-modules-auth-tenant-chooser.component-3OkOSTkm.mjs → acorex-modules-auth-tenant-chooser.component-DFhTYEDt.mjs} +2 -2
  19. package/fesm2022/{acorex-modules-auth-tenant-chooser.component-3OkOSTkm.mjs.map → acorex-modules-auth-tenant-chooser.component-DFhTYEDt.mjs.map} +1 -1
  20. package/fesm2022/{acorex-modules-auth-two-factor.module-DtrVmYAu.mjs → acorex-modules-auth-two-factor.module-BOZB6sLo.mjs} +2 -2
  21. package/fesm2022/{acorex-modules-auth-two-factor.module-DtrVmYAu.mjs.map → acorex-modules-auth-two-factor.module-BOZB6sLo.mjs.map} +1 -1
  22. package/fesm2022/{acorex-modules-auth-user-sessions.component-Co18_D9H.mjs → acorex-modules-auth-user-sessions.component-BnrnXg4G.mjs} +2 -2
  23. package/fesm2022/{acorex-modules-auth-user-sessions.component-Co18_D9H.mjs.map → acorex-modules-auth-user-sessions.component-BnrnXg4G.mjs.map} +1 -1
  24. package/fesm2022/acorex-modules-auth.mjs +1 -1
  25. package/fesm2022/acorex-modules-common.mjs +1 -1
  26. package/fesm2022/acorex-modules-common.mjs.map +1 -1
  27. package/fesm2022/{acorex-modules-document-management-drive-choose.component-ovwhHP2n.mjs → acorex-modules-document-management-drive-choose.component-BOeZ9mpL.mjs} +3 -7
  28. package/fesm2022/acorex-modules-document-management-drive-choose.component-BOeZ9mpL.mjs.map +1 -0
  29. package/fesm2022/acorex-modules-document-management.mjs +162 -288
  30. package/fesm2022/acorex-modules-document-management.mjs.map +1 -1
  31. package/fesm2022/acorex-modules-notification-management.mjs +1 -1
  32. package/fesm2022/acorex-modules-notification-management.mjs.map +1 -1
  33. package/fesm2022/{acorex-modules-task-management-task-board.page-B_S373L-.mjs → acorex-modules-task-management-task-board.page-t-iBvKOh.mjs} +3 -3
  34. package/fesm2022/acorex-modules-task-management-task-board.page-t-iBvKOh.mjs.map +1 -0
  35. package/fesm2022/acorex-modules-task-management.mjs +1 -1
  36. package/package.json +6 -6
  37. package/fesm2022/acorex-modules-auth-acorex-modules-auth-DHSmTid9.mjs.map +0 -1
  38. package/fesm2022/acorex-modules-document-management-drive-choose.component-ovwhHP2n.mjs.map +0 -1
  39. package/fesm2022/acorex-modules-task-management-task-board.page-B_S373L-.mjs.map +0 -1
@@ -26,6 +26,13 @@ import { FormsModule } from '@angular/forms';
26
26
  import get from 'lodash-es/get';
27
27
  import set from 'lodash-es/set';
28
28
  import { AXP_NAME_PROPERTY, AXP_DATA_PATH_PROPERTY } from '@acorex/platform/layout/widgets';
29
+ import { AXDialogService } from '@acorex/components/dialog';
30
+ import { AXPopupService } from '@acorex/components/popup';
31
+ import { AXPLayoutBuilderService } from '@acorex/platform/layout/builder';
32
+ import * as i3$1 from '@acorex/platform/workflow';
33
+ import { AXPWorkflowService, AXPWorkflowAction, AXPWorkflowModule } from '@acorex/platform/workflow';
34
+ import { AXFileService, AXFileModule } from '@acorex/core/file';
35
+ import { castArray, get as get$1, set as set$1 } from 'lodash-es';
29
36
  import * as i2$2 from '@acorex/components/media-viewer';
30
37
  import { AXMediaViewerModule } from '@acorex/components/media-viewer';
31
38
  import * as i1$1 from '@acorex/components/button';
@@ -41,13 +48,6 @@ import { AXPStateMessageComponent, AXPThemeLayoutBlockComponent } from '@acorex/
41
48
  import { AXPLayoutThemeService } from '@acorex/platform/themes/shared';
42
49
  import * as i1$2 from '@angular/common';
43
50
  import { CommonModule } from '@angular/common';
44
- import { castArray, get as get$1, set as set$1 } from 'lodash-es';
45
- import { AXDialogService } from '@acorex/components/dialog';
46
- import { AXPopupService } from '@acorex/components/popup';
47
- import { AXPLayoutBuilderService } from '@acorex/platform/layout/builder';
48
- import * as i3$1 from '@acorex/platform/workflow';
49
- import { AXPWorkflowService, AXPWorkflowAction, AXPWorkflowModule } from '@acorex/platform/workflow';
50
- import { AXFileService, AXFileModule } from '@acorex/core/file';
51
51
  import { signalStore, withState, withComputed, withMethods, patchState } from '@ngrx/signals';
52
52
  import { AXUploaderService } from '@acorex/cdk/uploader';
53
53
  import { AXBadgeModule } from '@acorex/components/badge';
@@ -1753,85 +1753,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
1753
1753
  }]
1754
1754
  }] });
1755
1755
 
1756
- //#region ---- Imports ----
1757
- //#endregion
1758
- /**
1759
- * File gallery popup component that displays files using the gallery widget.
1760
- * This component replaces the old file-viewer-popup and uses the same
1761
- * gallery widget pattern as test8.
1762
- */
1763
- class AXMFileGalleryPopupComponent extends AXBasePageComponent {
1764
- constructor() {
1765
- super(...arguments);
1766
- //#region ---- Class Properties ----
1767
- /** File list items received from popup data */
1768
- this.files = signal([], ...(ngDevMode ? [{ debugName: "files" }] : []));
1769
- /** Starting index for the media viewer */
1770
- this.startIndex = 0;
1771
- /** Widget context for the gallery */
1772
- this.context = signal({}, ...(ngDevMode ? [{ debugName: "context" }] : []));
1773
- //#endregion
1774
- //#region ---- Computed Properties ----
1775
- /**
1776
- * Gallery widget node configuration
1777
- */
1778
- this.galleryNode = computed(() => ({
1779
- type: 'gallery',
1780
- path: 'galleryFiles',
1781
- defaultValue: this.files(),
1782
- options: {
1783
- thumbnail: true,
1784
- header: true,
1785
- fileInfo: true,
1786
- fullScreenButton: true,
1787
- allowUpload: false,
1788
- height: '100%',
1789
- },
1790
- }), ...(ngDevMode ? [{ debugName: "galleryNode" }] : []));
1791
- }
1792
- //#endregion
1793
- //#region ---- UI Handlers ----
1794
- /**
1795
- * Close the popup
1796
- */
1797
- onClose() {
1798
- this.close();
1799
- }
1800
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AXMFileGalleryPopupComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
1801
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.16", type: AXMFileGalleryPopupComponent, isStandalone: true, selector: "axm-file-gallery-popup", usesInheritance: true, ngImport: i0, template: `
1802
- <ax-content>
1803
- <axp-widgets-container class="ax-block ax-h-full" [context]="context()">
1804
- <ng-container axp-widget-renderer [node]="galleryNode()" [mode]="'edit'"></ng-container>
1805
- </axp-widgets-container>
1806
- </ax-content>
1807
- <ax-footer>
1808
- <ax-suffix>
1809
- <ax-button [text]="'close'" (click)="onClose()" />
1810
- </ax-suffix>
1811
- </ax-footer>
1812
- `, isInline: true, styles: [":host{display:block;height:100%}ax-content{height:calc(100% - 60px)}\n"], dependencies: [{ kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i4$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: AXButtonModule }, { kind: "component", type: i1$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: AXPWidgetCoreModule }, { 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", "onLoad"], exportAs: ["widgetRenderer"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
1813
- }
1814
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AXMFileGalleryPopupComponent, decorators: [{
1815
- type: Component,
1816
- args: [{ selector: 'axm-file-gallery-popup', template: `
1817
- <ax-content>
1818
- <axp-widgets-container class="ax-block ax-h-full" [context]="context()">
1819
- <ng-container axp-widget-renderer [node]="galleryNode()" [mode]="'edit'"></ng-container>
1820
- </axp-widgets-container>
1821
- </ax-content>
1822
- <ax-footer>
1823
- <ax-suffix>
1824
- <ax-button [text]="'close'" (click)="onClose()" />
1825
- </ax-suffix>
1826
- </ax-footer>
1827
- `, changeDetection: ChangeDetectionStrategy.OnPush, imports: [AXDecoratorModule, AXButtonModule, AXPWidgetCoreModule], styles: [":host{display:block;height:100%}ax-content{height:calc(100% - 60px)}\n"] }]
1828
- }] });
1829
-
1830
- var fileGalleryPopup_component = /*#__PURE__*/Object.freeze({
1831
- __proto__: null,
1832
- AXMFileGalleryPopupComponent: AXMFileGalleryPopupComponent
1833
- });
1834
-
1835
1756
  class AXPDocumentManagementService {
1836
1757
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AXPDocumentManagementService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
1837
1758
  static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AXPDocumentManagementService }); }
@@ -2204,12 +2125,25 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
2204
2125
 
2205
2126
  //#region ---- Imports ----
2206
2127
  //#endregion
2207
- //#region ---- Service Implementation ----
2128
+ //#region ---- Contract (Abstract Service) ----
2208
2129
  /**
2209
- * Service for handling document drive operations
2130
+ * Contract for document drive service. Inject this token; implementation is provided by the module.
2210
2131
  */
2211
2132
  class AXMDocumentManagerService {
2133
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AXMDocumentManagerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
2134
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AXMDocumentManagerService }); }
2135
+ }
2136
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AXMDocumentManagerService, decorators: [{
2137
+ type: Injectable
2138
+ }] });
2139
+ //#endregion
2140
+ //#region ---- Service Implementation ----
2141
+ /**
2142
+ * Default implementation of document drive service.
2143
+ */
2144
+ class AXMDocumentManagerServiceImpl extends AXMDocumentManagerService {
2212
2145
  constructor() {
2146
+ super(...arguments);
2213
2147
  //#region ---- Services & Dependencies ----
2214
2148
  this.folderService = inject(AXMFolderService);
2215
2149
  this.sessionService = inject(AXPSessionService);
@@ -2259,98 +2193,14 @@ class AXMDocumentManagerService {
2259
2193
  //#endregion
2260
2194
  //#region ---- Scope Management Methods ----
2261
2195
  /**
2262
- * Creates a scoped drive service for the specified platform scope
2263
- */
2264
- scope(scope, options) {
2265
- const cacheKey = this.getScopeCacheKey(scope, options);
2266
- if (!this.scopedDriveCache.has(cacheKey)) {
2267
- this.scopedDriveCache.set(cacheKey, new ScopedDriveService(this, scope, options));
2268
- }
2269
- return this.scopedDriveCache.get(cacheKey);
2270
- }
2271
- /**
2272
- * Generates a cache key for the scoped drive service
2273
- */
2274
- getScopeCacheKey(scope, options) {
2275
- return scope;
2276
- }
2277
- //#endregion
2278
- //#region ---- Private Helper Methods ----
2279
- /**
2280
- * Gets the platform root folder (top-level folder)
2196
+ * Creates a scoped drive service for the specified platform scope.
2197
+ * Backend resolves tenant/user from request context (client sends only scope).
2281
2198
  */
2282
- async getPlatformRootFolder() {
2283
- const result = await this.folderService.query({
2284
- skip: 0,
2285
- take: 1,
2286
- filter: {
2287
- operator: null,
2288
- logic: 'and',
2289
- filters: [
2290
- { field: 'parentId', operator: { type: 'isNull' } },
2291
- { field: 'ownershipInfo.tenantId', operator: { type: 'isNull' } },
2292
- { field: 'ownershipInfo.userId', operator: { type: 'isNull' } },
2293
- ],
2294
- },
2295
- });
2296
- if (result.items.length === 0) {
2297
- throw new Error('Platform root folder not found');
2199
+ scope(scope) {
2200
+ if (!this.scopedDriveCache.has(scope)) {
2201
+ this.scopedDriveCache.set(scope, new ScopedDriveService(this, scope));
2298
2202
  }
2299
- return result.items[0];
2300
- }
2301
- /**
2302
- * Gets the tenant root folder
2303
- */
2304
- async getTenantRootFolder(rootFolder, tenantId) {
2305
- if (!tenantId) {
2306
- throw new Error('Tenant ID is required');
2307
- }
2308
- const result = await this.folderService.query({
2309
- skip: 0,
2310
- take: 1,
2311
- filter: {
2312
- operator: null,
2313
- logic: 'and',
2314
- filters: this.filterMiddlewareService.transformFilters([
2315
- {
2316
- field: 'parentId',
2317
- operator: { type: 'equal' },
2318
- value: rootFolder.folders?.find((f) => f.title === 'Tenants')?.id,
2319
- },
2320
- { field: 'ownershipInfo.tenantId', operator: { type: 'equal' }, value: tenantId },
2321
- { field: 'ownershipInfo.userId', operator: { type: 'isNull' } },
2322
- ]),
2323
- },
2324
- });
2325
- if (result.items.length === 0) {
2326
- throw new Error('Tenant root folder not found');
2327
- }
2328
- return result.items[0];
2329
- }
2330
- /**
2331
- * Gets the user root folder
2332
- */
2333
- async getUserRootFolder(tenantFolderId, tenantId, userId) {
2334
- if (!tenantId || !userId) {
2335
- throw new Error('Both Tenant ID and User ID are required');
2336
- }
2337
- const result = await this.folderService.query({
2338
- skip: 0,
2339
- take: 1,
2340
- filter: {
2341
- operator: null,
2342
- logic: 'and',
2343
- filters: this.filterMiddlewareService.transformFilters([
2344
- { field: 'parentId', operator: { type: 'equal' }, value: tenantFolderId },
2345
- { field: 'ownershipInfo.tenantId', operator: { type: 'equal' }, value: tenantId },
2346
- { field: 'ownershipInfo.userId', operator: { type: 'equal' }, value: userId },
2347
- ]),
2348
- },
2349
- });
2350
- if (result.items.length === 0) {
2351
- throw new Error('User root folder not found');
2352
- }
2353
- return result.items[0];
2203
+ return this.scopedDriveCache.get(scope);
2354
2204
  }
2355
2205
  /**
2356
2206
  * Maps file entity to document explorer node
@@ -2520,45 +2370,20 @@ class AXMDocumentManagerService {
2520
2370
  //#endregion
2521
2371
  //#region ---- Root and Folder Operations ----
2522
2372
  /**
2523
- * Gets the root folder based on the specified scope
2373
+ * Gets the root folder for the given scope.
2374
+ * Backend returns only the root folder; path is built here for the explorer.
2524
2375
  */
2525
- async getRoot(scope, options) {
2526
- const rootFolder = await this.getPlatformRootFolder();
2527
- let result;
2528
- let path = [];
2529
- switch (scope) {
2530
- case AXPPlatformScope.Platform:
2531
- result = this.mapFolderDtoToFolderNode(rootFolder);
2532
- path = await this.buildPath(result);
2533
- break;
2534
- case AXPPlatformScope.Tenant: {
2535
- if (!options?.tenantId) {
2536
- throw new Error('Tenant ID is required for tenant scope');
2537
- }
2538
- const tenantRoot = await this.getTenantRootFolder(rootFolder, options.tenantId);
2539
- result = this.mapFolderDtoToFolderNode(tenantRoot);
2540
- path = await this.buildPath(result, tenantRoot.id);
2541
- break;
2542
- }
2543
- case AXPPlatformScope.User: {
2544
- if (!options?.tenantId || !options?.userId) {
2545
- throw new Error('Both Tenant ID and User ID are required for user scope');
2546
- }
2547
- const tenantFolder = await this.getTenantRootFolder(rootFolder, options.tenantId);
2548
- const userRoot = await this.getUserRootFolder(tenantFolder.folders?.find((f) => f.title === 'Users')?.id, options.tenantId, options.userId);
2549
- result = this.mapFolderDtoToFolderNode(userRoot);
2550
- path = await this.buildPath(result, userRoot.id);
2551
- break;
2552
- }
2553
- default:
2554
- throw new Error(`Invalid scope: ${scope}`);
2555
- }
2376
+ async getRoot(scope) {
2377
+ const rootFolder = await this.documentManagementService.getRoot(scope);
2378
+ const result = this.mapFolderDtoToFolderNode(rootFolder);
2379
+ const path = await this.buildPath(result);
2556
2380
  return { path, result };
2557
2381
  }
2558
2382
  /**
2559
- * Gets a specific folder by ID
2383
+ * Gets a specific folder by ID.
2384
+ * Root for path is resolved from current session (security: only scope is used).
2560
2385
  */
2561
- async getFolder(scope, folderId, options) {
2386
+ async getFolder(scope, folderId) {
2562
2387
  if (!folderId) {
2563
2388
  throw new Error('Folder ID is required');
2564
2389
  }
@@ -2567,7 +2392,7 @@ class AXMDocumentManagerService {
2567
2392
  throw new Error('Folder not found');
2568
2393
  }
2569
2394
  const result = this.mapFolderDtoToFolderNode(folder);
2570
- const path = await this.buildPath(result, (await this.getRoot(scope, options)).result.id);
2395
+ const path = await this.buildPath(result, (await this.getRoot(scope)).result.id);
2571
2396
  return { path, result };
2572
2397
  }
2573
2398
  /**
@@ -2848,7 +2673,7 @@ class AXMDocumentManagerService {
2848
2673
  * Moves a node to another location
2849
2674
  */
2850
2675
  async moveTo(options) {
2851
- const comp = (await import('./acorex-modules-document-management-drive-choose.component-ovwhHP2n.mjs')).AXMDocumentDriveChooseComponent;
2676
+ const comp = (await import('./acorex-modules-document-management-drive-choose.component-BOeZ9mpL.mjs')).AXMDocumentDriveChooseComponent;
2852
2677
  const popup = await this.popupService.open(comp, {
2853
2678
  title: `Choose ${options.browseMode == 'file' ? 'File' : 'Folder'}`,
2854
2679
  data: {
@@ -2881,7 +2706,7 @@ class AXMDocumentManagerService {
2881
2706
  * Copies a node to another location
2882
2707
  */
2883
2708
  async copyTo(options) {
2884
- const comp = (await import('./acorex-modules-document-management-drive-choose.component-ovwhHP2n.mjs')).AXMDocumentDriveChooseComponent;
2709
+ const comp = (await import('./acorex-modules-document-management-drive-choose.component-BOeZ9mpL.mjs')).AXMDocumentDriveChooseComponent;
2885
2710
  const popup = await this.popupService.open(comp, {
2886
2711
  title: `Choose ${options.browseMode == 'file' ? 'File' : 'Folder'}`,
2887
2712
  data: {
@@ -2936,27 +2761,29 @@ class AXMDocumentManagerService {
2936
2761
  //#endregion
2937
2762
  //#region ---- Search Operations ----
2938
2763
  /**
2939
- * Searches for folders by term within a scope
2764
+ * Searches for folders by term within a scope.
2765
+ * Root is resolved from current session when folderId is not provided.
2940
2766
  */
2941
2767
  async searchFolders(searchTerm, scope, options) {
2942
2768
  const { result: rootNode } = options?.folderId
2943
- ? await this.getFolder(scope, options.folderId, options)
2944
- : await this.getRoot(scope, options);
2769
+ ? await this.getFolder(scope, options.folderId)
2770
+ : await this.getRoot(scope);
2945
2771
  const folders = await this.documentManagementService.searchFolders(searchTerm, rootNode.id);
2946
2772
  return folders.map((folder) => this.mapFolderDtoToFolderNode(folder));
2947
2773
  }
2948
2774
  /**
2949
- * Searches for files by term within a scope
2775
+ * Searches for files by term within a scope.
2776
+ * Root is resolved from current session when folderId is not provided.
2950
2777
  */
2951
2778
  async searchFiles(searchTerm, scope, options) {
2952
2779
  const { result: rootNode } = options?.folderId
2953
- ? await this.getFolder(scope, options.folderId, options)
2954
- : await this.getRoot(scope, options);
2780
+ ? await this.getFolder(scope, options.folderId)
2781
+ : await this.getRoot(scope);
2955
2782
  const files = await this.documentManagementService.searchFiles(searchTerm, rootNode.id);
2956
2783
  return files.map((file) => this.mapFileToNode(file));
2957
2784
  }
2958
2785
  /**
2959
- * Searches for both files and folders by term within a scope
2786
+ * Searches for both files and folders by term within a scope.
2960
2787
  */
2961
2788
  async searchNodes(searchTerm, scope, options) {
2962
2789
  const [folders, files] = await Promise.all([
@@ -3322,7 +3149,7 @@ class AXMDocumentManagerService {
3322
3149
  * Shows choose file dialog
3323
3150
  */
3324
3151
  async showChooseFileDialog(scope) {
3325
- const comp = (await import('./acorex-modules-document-management-drive-choose.component-ovwhHP2n.mjs')).AXMDocumentDriveChooseComponent;
3152
+ const comp = (await import('./acorex-modules-document-management-drive-choose.component-BOeZ9mpL.mjs')).AXMDocumentDriveChooseComponent;
3326
3153
  const result = await this.popupService.open(comp, {
3327
3154
  title: await this.translate.translateAsync('@document-management:actions.choose-from-drive'),
3328
3155
  data: {
@@ -3344,7 +3171,7 @@ class AXMDocumentManagerService {
3344
3171
  if (!item.name || item.type !== 'file')
3345
3172
  return false;
3346
3173
  const ext = item.name.split('.').pop()?.toLowerCase();
3347
- return ext && AXMDocumentManagerService.GALLERY_EXTENSIONS.includes(ext);
3174
+ return ext && AXMDocumentManagerServiceImpl.GALLERY_EXTENSIONS.includes(ext);
3348
3175
  });
3349
3176
  }
3350
3177
  /**
@@ -3361,7 +3188,7 @@ class AXMDocumentManagerService {
3361
3188
  if (!item.name)
3362
3189
  return false;
3363
3190
  const ext = item.name.split('.').pop()?.toLowerCase();
3364
- return ext && AXMDocumentManagerService.GALLERY_EXTENSIONS.includes(ext);
3191
+ return ext && AXMDocumentManagerServiceImpl.GALLERY_EXTENSIONS.includes(ext);
3365
3192
  });
3366
3193
  // Convert documents to AXPFileListItem[] format for the gallery widget
3367
3194
  const fileListItems = filteredDocuments.map((doc) => {
@@ -3401,71 +3228,43 @@ class AXMDocumentManagerService {
3401
3228
  return node;
3402
3229
  }
3403
3230
  }
3404
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AXMDocumentManagerService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
3405
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AXMDocumentManagerService, providedIn: 'root' }); }
3231
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AXMDocumentManagerServiceImpl, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
3232
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AXMDocumentManagerServiceImpl }); }
3406
3233
  }
3407
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AXMDocumentManagerService, decorators: [{
3408
- type: Injectable,
3409
- args: [{
3410
- providedIn: 'root',
3411
- }]
3234
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AXMDocumentManagerServiceImpl, decorators: [{
3235
+ type: Injectable
3412
3236
  }] });
3413
3237
  //#endregion
3414
3238
  //#region ---- Scoped Drive Service ----
3415
3239
  /**
3416
- * Scoped drive service for specific platform scopes
3240
+ * Scoped drive service for specific platform scopes.
3241
+ * Backend resolves tenant/user from request context (client sends only scope).
3417
3242
  */
3418
3243
  class ScopedDriveService {
3419
3244
  //#region ---- Constructor ----
3420
- constructor(parent, scope, options) {
3245
+ constructor(parent, scope) {
3421
3246
  this.parent = parent;
3422
3247
  this.scope = scope;
3423
- this.options = options;
3424
- this.validateScopeOptions();
3425
- }
3426
- //#endregion
3427
- //#region ---- Validation Methods ----
3428
- /**
3429
- * Validates the scope options are appropriate for the selected scope
3430
- */
3431
- validateScopeOptions() {
3432
- switch (this.scope) {
3433
- case AXPPlatformScope.Tenant:
3434
- if (!this.options?.tenantId) {
3435
- throw new Error('Tenant ID is required for tenant scope');
3436
- }
3437
- break;
3438
- case AXPPlatformScope.User:
3439
- if (!this.options?.tenantId || !this.options?.userId) {
3440
- throw new Error('Both Tenant ID and User ID are required for user scope');
3441
- }
3442
- break;
3443
- }
3444
3248
  }
3445
3249
  //#endregion
3446
3250
  //#region ---- Scoped Operations ----
3447
3251
  /**
3448
- * Gets root folder for this scope
3252
+ * Gets root folder for this scope (tenant/user from session).
3449
3253
  */
3450
3254
  async getRoot() {
3451
- return this.parent.getRoot(this.scope, this.options);
3255
+ return this.parent.getRoot(this.scope);
3452
3256
  }
3453
3257
  /**
3454
- * Gets folder for this scope
3258
+ * Gets folder for this scope.
3455
3259
  */
3456
3260
  async getFolder(folderId) {
3457
- return this.parent.getFolder(this.scope, folderId, this.options);
3261
+ return this.parent.getFolder(this.scope, folderId);
3458
3262
  }
3459
3263
  /**
3460
- * Creates folder in this scope
3264
+ * Creates folder in this scope. Backend sets tenant/user from request context.
3461
3265
  */
3462
3266
  async createFolder(data) {
3463
- const folderData = {
3464
- ...data,
3465
- tenantId: this.options?.tenantId,
3466
- userId: this.options?.userId,
3467
- };
3468
- return this.parent.createFolder(folderData);
3267
+ return this.parent.createFolder(data);
3469
3268
  }
3470
3269
  /**
3471
3270
  * Updates folder in this scope
@@ -3488,33 +3287,108 @@ class ScopedDriveService {
3488
3287
  /**
3489
3288
  * Searches folders in this scope
3490
3289
  */
3491
- async searchFolders(searchTerm) {
3492
- this.validateScopeOptions();
3493
- return this.parent.searchFolders(searchTerm, this.scope, this.options);
3290
+ async searchFolders(searchTerm, options) {
3291
+ return this.parent.searchFolders(searchTerm, this.scope, options);
3494
3292
  }
3495
3293
  /**
3496
3294
  * Searches files in this scope
3497
3295
  */
3498
- async searchFiles(searchTerm) {
3499
- this.validateScopeOptions();
3500
- return this.parent.searchFiles(searchTerm, this.scope, this.options);
3296
+ async searchFiles(searchTerm, options) {
3297
+ return this.parent.searchFiles(searchTerm, this.scope, options);
3501
3298
  }
3502
3299
  /**
3503
3300
  * Searches nodes in this scope
3504
3301
  */
3505
- async searchNodes(searchTerm) {
3506
- this.validateScopeOptions();
3507
- return this.parent.searchNodes(searchTerm, this.scope, this.options);
3302
+ async searchNodes(searchTerm, options) {
3303
+ return this.parent.searchNodes(searchTerm, this.scope, options);
3508
3304
  }
3509
3305
  /**
3510
3306
  * Creates a copy of a node in this scope
3511
3307
  */
3512
3308
  async copy(node) {
3513
- this.validateScopeOptions();
3514
3309
  return this.parent.copy(node);
3515
3310
  }
3516
3311
  }
3517
3312
 
3313
+ //#region ---- Imports ----
3314
+ //#endregion
3315
+ /**
3316
+ * File gallery popup component that displays files using the gallery widget.
3317
+ * This component replaces the old file-viewer-popup and uses the same
3318
+ * gallery widget pattern as test8.
3319
+ */
3320
+ class AXMFileGalleryPopupComponent extends AXBasePageComponent {
3321
+ constructor() {
3322
+ super(...arguments);
3323
+ //#region ---- Class Properties ----
3324
+ /** File list items received from popup data */
3325
+ this.files = signal([], ...(ngDevMode ? [{ debugName: "files" }] : []));
3326
+ /** Starting index for the media viewer */
3327
+ this.startIndex = 0;
3328
+ /** Widget context for the gallery */
3329
+ this.context = signal({}, ...(ngDevMode ? [{ debugName: "context" }] : []));
3330
+ //#endregion
3331
+ //#region ---- Computed Properties ----
3332
+ /**
3333
+ * Gallery widget node configuration
3334
+ */
3335
+ this.galleryNode = computed(() => ({
3336
+ type: 'gallery',
3337
+ path: 'galleryFiles',
3338
+ defaultValue: this.files(),
3339
+ options: {
3340
+ thumbnail: true,
3341
+ header: true,
3342
+ fileInfo: true,
3343
+ fullScreenButton: true,
3344
+ allowUpload: false,
3345
+ height: '100%',
3346
+ },
3347
+ }), ...(ngDevMode ? [{ debugName: "galleryNode" }] : []));
3348
+ }
3349
+ //#endregion
3350
+ //#region ---- UI Handlers ----
3351
+ /**
3352
+ * Close the popup
3353
+ */
3354
+ onClose() {
3355
+ this.close();
3356
+ }
3357
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AXMFileGalleryPopupComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
3358
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.16", type: AXMFileGalleryPopupComponent, isStandalone: true, selector: "axm-file-gallery-popup", usesInheritance: true, ngImport: i0, template: `
3359
+ <ax-content>
3360
+ <axp-widgets-container class="ax-block ax-h-full" [context]="context()">
3361
+ <ng-container axp-widget-renderer [node]="galleryNode()" [mode]="'edit'"></ng-container>
3362
+ </axp-widgets-container>
3363
+ </ax-content>
3364
+ <ax-footer>
3365
+ <ax-suffix>
3366
+ <ax-button [text]="'close'" (click)="onClose()" />
3367
+ </ax-suffix>
3368
+ </ax-footer>
3369
+ `, isInline: true, styles: [":host{display:block;height:100%}ax-content{height:calc(100% - 60px)}\n"], dependencies: [{ kind: "ngmodule", type: AXDecoratorModule }, { kind: "component", type: i4$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: AXButtonModule }, { kind: "component", type: i1$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: AXPWidgetCoreModule }, { 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", "onLoad"], exportAs: ["widgetRenderer"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
3370
+ }
3371
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: AXMFileGalleryPopupComponent, decorators: [{
3372
+ type: Component,
3373
+ args: [{ selector: 'axm-file-gallery-popup', template: `
3374
+ <ax-content>
3375
+ <axp-widgets-container class="ax-block ax-h-full" [context]="context()">
3376
+ <ng-container axp-widget-renderer [node]="galleryNode()" [mode]="'edit'"></ng-container>
3377
+ </axp-widgets-container>
3378
+ </ax-content>
3379
+ <ax-footer>
3380
+ <ax-suffix>
3381
+ <ax-button [text]="'close'" (click)="onClose()" />
3382
+ </ax-suffix>
3383
+ </ax-footer>
3384
+ `, changeDetection: ChangeDetectionStrategy.OnPush, imports: [AXDecoratorModule, AXButtonModule, AXPWidgetCoreModule], styles: [":host{display:block;height:100%}ax-content{height:calc(100% - 60px)}\n"] }]
3385
+ }] });
3386
+
3387
+ var fileGalleryPopup_component = /*#__PURE__*/Object.freeze({
3388
+ __proto__: null,
3389
+ AXMFileGalleryPopupComponent: AXMFileGalleryPopupComponent
3390
+ });
3391
+
3518
3392
  var AXPDocumentExplorerSettings;
3519
3393
  (function (AXPDocumentExplorerSettings) {
3520
3394
  AXPDocumentExplorerSettings["ViewMode"] = "DocumentManagement:Setting:DocumentExplorer.Layout.ViewMode";
@@ -3583,7 +3457,7 @@ const AXPDocumentExplorerViewModel = signalStore({ providedIn: 'root' }, withSta
3583
3457
  isMultiSelect: computed(() => store.selectionMode() === 'multiple'),
3584
3458
  selectedNode: computed(() => store.selectedNodes()[0] ?? null),
3585
3459
  isDetailPanelOpen: computed(() => store.detailPanel()),
3586
- })), withMethods((store, fileTypeService = inject(AXPFileTypeProviderService), documentTypeService = inject(AXMDocumentTypeService), driveService = inject(AXMDocumentManagerService), settingsService = inject(AXPSettingsService), sessionService = inject(AXPSessionService), translateService = inject(AXTranslationService), lockService = inject(AXPLockService)) => ({
3460
+ })), withMethods((store, fileTypeService = inject(AXPFileTypeProviderService), driveService = inject(AXMDocumentManagerService), settingsService = inject(AXPSettingsService), translateService = inject(AXTranslationService), lockService = inject(AXPLockService)) => ({
3587
3461
  async initialize(options) {
3588
3462
  // Load file types
3589
3463
  const fileTypes = await fileTypeService.items();
@@ -3610,10 +3484,7 @@ const AXPDocumentExplorerViewModel = signalStore({ providedIn: 'root' }, withSta
3610
3484
  patchState(store, { loadingFolderId: folderId, isLoading: true });
3611
3485
  await new Promise((resolve) => setTimeout(resolve, 100));
3612
3486
  try {
3613
- const node = await driveService.getFolder(store.scope(), folderId, {
3614
- tenantId: sessionService.tenant?.id,
3615
- userId: sessionService.user?.id,
3616
- });
3487
+ const node = await driveService.getFolder(store.scope(), folderId);
3617
3488
  // Sort with direction
3618
3489
  const sortField = store.sortField();
3619
3490
  const sortDirection = store.sortDirection();
@@ -5474,6 +5345,10 @@ class AXMDocumentManagementModule {
5474
5345
  provide: AXMFolderService,
5475
5346
  useClass: AXMFolderServiceImpl,
5476
5347
  },
5348
+ {
5349
+ provide: AXMDocumentManagerService,
5350
+ useClass: AXMDocumentManagerServiceImpl,
5351
+ },
5477
5352
  ], imports: [AXMDriveChooseModule,
5478
5353
  // Entity Modules
5479
5354
  AXMDocumentManagementDocumentTypeEntityModule,
@@ -5574,6 +5449,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
5574
5449
  provide: AXMFolderService,
5575
5450
  useClass: AXMFolderServiceImpl,
5576
5451
  },
5452
+ {
5453
+ provide: AXMDocumentManagerService,
5454
+ useClass: AXMDocumentManagerServiceImpl,
5455
+ },
5577
5456
  ],
5578
5457
  }]
5579
5458
  }] });
@@ -5763,8 +5642,6 @@ class AXMDocumentDriveComponent extends AXPPageLayoutBaseComponent {
5763
5642
  this.previousFolderId = currentNode?.id ?? null;
5764
5643
  }
5765
5644
  const result = await this.driveService.searchNodes(searchValue, this.vm.scope(), {
5766
- tenantId: this.sessionService.tenant?.id,
5767
- userId: this.sessionService.user?.id,
5768
5645
  folderId: this.vm.isVirtual() ? (this.previousFolderId ?? undefined) : (this.vm.currentNode()?.id ?? undefined),
5769
5646
  });
5770
5647
  // Get the folder ID to use as parentId for the virtual folder
@@ -5801,10 +5678,7 @@ class AXMDocumentDriveComponent extends AXPPageLayoutBaseComponent {
5801
5678
  }
5802
5679
  else {
5803
5680
  // TODO: get root from tenant or user by scope
5804
- const root = await this.driveService.getRoot(this.vm.scope(), {
5805
- tenantId: this.sessionService.tenant?.id,
5806
- userId: this.sessionService.user?.id,
5807
- });
5681
+ const root = await this.driveService.getRoot(this.vm.scope());
5808
5682
  if (root.result) {
5809
5683
  await this.router.navigate([
5810
5684
  `${this.sessionService.application?.name}/drive/${resolvePlatformScopeName(this.vm.scope())}/${root.result.id}`,
@@ -6049,5 +5923,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
6049
5923
  * Generated bundle index. Do not edit.
6050
5924
  */
6051
5925
 
6052
- export { AXMArchiveFileTypeProvider, AXMAudioFileTypeProvider, AXMCodeFileTypeProvider, AXMDocumentDriveComponent, AXMDocumentExplorerComponent, AXMDocumentFileTypeProvider, AXMDocumentManagementDocumentTypeEntityModule, AXMDocumentManagementModule, AXMDocumentManagerService, AXMDocumentService, AXMDocumentServiceImpl, AXMDocumentTypeService, AXMDocumentTypeServiceImpl, AXMEntityProvider, AXMFileGalleryPopupComponent, AXMFileTypeExtensionWidgetColumnComponent, AXMFileTypeExtensionWidgetDesignerComponent, AXMFileTypeExtensionWidgetEditComponent, AXMFileTypeExtensionWidgetViewComponent, AXMFileTypeModule, AXMFolderPathBreadcrumbsComponent, AXMFolderService, AXMFolderServiceImpl, AXMImageFileTypeProvider, AXMMenuProvider, AXMPermissionsKeys, AXMSearchCommandProvider, AXMSettingProvider, AXMVideoFileTypeProvider, AXPDocumentExplorerSettings, AXPDocumentExplorerViewModel, AXPDocumentManagementFeatureKeys, AXPDocumentManagementMenuKeys, AXPDocumentManagementService, AXmFileTypeExtensionWidget, RootConfig, ScopedDriveService, documentEntityFactory, documentTypeFactory, folderEntityFactory };
5926
+ export { AXMArchiveFileTypeProvider, AXMAudioFileTypeProvider, AXMCodeFileTypeProvider, AXMDocumentDriveComponent, AXMDocumentExplorerComponent, AXMDocumentFileTypeProvider, AXMDocumentManagementDocumentTypeEntityModule, AXMDocumentManagementModule, AXMDocumentManagerService, AXMDocumentManagerServiceImpl, AXMDocumentService, AXMDocumentServiceImpl, AXMDocumentTypeService, AXMDocumentTypeServiceImpl, AXMEntityProvider, AXMFileGalleryPopupComponent, AXMFileTypeExtensionWidgetColumnComponent, AXMFileTypeExtensionWidgetDesignerComponent, AXMFileTypeExtensionWidgetEditComponent, AXMFileTypeExtensionWidgetViewComponent, AXMFileTypeModule, AXMFolderPathBreadcrumbsComponent, AXMFolderService, AXMFolderServiceImpl, AXMImageFileTypeProvider, AXMMenuProvider, AXMPermissionsKeys, AXMSearchCommandProvider, AXMSettingProvider, AXMVideoFileTypeProvider, AXPDocumentExplorerSettings, AXPDocumentExplorerViewModel, AXPDocumentManagementFeatureKeys, AXPDocumentManagementMenuKeys, AXPDocumentManagementService, AXmFileTypeExtensionWidget, RootConfig, ScopedDriveService, documentEntityFactory, documentTypeFactory, folderEntityFactory };
6053
5927
  //# sourceMappingURL=acorex-modules-document-management.mjs.map