@acorex/modules 20.6.0-next.24 → 20.6.0-next.25

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 (27) hide show
  1. package/fesm2022/{acorex-modules-document-management-acorex-modules-document-management-Dg8SVY4R.mjs → acorex-modules-document-management-acorex-modules-document-management-ByRPA5To.mjs} +100 -20
  2. package/fesm2022/acorex-modules-document-management-acorex-modules-document-management-ByRPA5To.mjs.map +1 -0
  3. package/fesm2022/{acorex-modules-document-management-attachment-widget.component-zFZApYr5.mjs → acorex-modules-document-management-attachment-widget.component-BDHk-Ukz.mjs} +2 -2
  4. package/fesm2022/{acorex-modules-document-management-attachment-widget.component-zFZApYr5.mjs.map → acorex-modules-document-management-attachment-widget.component-BDHk-Ukz.mjs.map} +1 -1
  5. package/fesm2022/{acorex-modules-document-management-details-view.component-CBmWHsVg.mjs → acorex-modules-document-management-details-view.component-BMg9EyVx.mjs} +2 -2
  6. package/fesm2022/{acorex-modules-document-management-details-view.component-CBmWHsVg.mjs.map → acorex-modules-document-management-details-view.component-BMg9EyVx.mjs.map} +1 -1
  7. package/fesm2022/{acorex-modules-document-management-document-signature-popup.component-0C1OmnNz.mjs → acorex-modules-document-management-document-signature-popup.component-DNy7uxsA.mjs} +2 -2
  8. package/fesm2022/{acorex-modules-document-management-document-signature-popup.component-0C1OmnNz.mjs.map → acorex-modules-document-management-document-signature-popup.component-DNy7uxsA.mjs.map} +1 -1
  9. package/fesm2022/{acorex-modules-document-management-drive-choose.component-Cgi4gVUo.mjs → acorex-modules-document-management-drive-choose.component-DwPBtiFH.mjs} +2 -2
  10. package/fesm2022/{acorex-modules-document-management-drive-choose.component-Cgi4gVUo.mjs.map → acorex-modules-document-management-drive-choose.component-DwPBtiFH.mjs.map} +1 -1
  11. package/fesm2022/{acorex-modules-document-management-drive.component-qqJtfLVN.mjs → acorex-modules-document-management-drive.component-Dn6qh_iW.mjs} +2 -2
  12. package/fesm2022/{acorex-modules-document-management-drive.component-qqJtfLVN.mjs.map → acorex-modules-document-management-drive.component-Dn6qh_iW.mjs.map} +1 -1
  13. package/fesm2022/{acorex-modules-document-management-large-icons-view.component-CiTXhe9q.mjs → acorex-modules-document-management-large-icons-view.component-DeS61K-Y.mjs} +2 -2
  14. package/fesm2022/{acorex-modules-document-management-large-icons-view.component-CiTXhe9q.mjs.map → acorex-modules-document-management-large-icons-view.component-DeS61K-Y.mjs.map} +1 -1
  15. package/fesm2022/{acorex-modules-document-management-large-tiles-view.component-C-xJAD2U.mjs → acorex-modules-document-management-large-tiles-view.component-3rWSoRv7.mjs} +2 -2
  16. package/fesm2022/{acorex-modules-document-management-large-tiles-view.component-C-xJAD2U.mjs.map → acorex-modules-document-management-large-tiles-view.component-3rWSoRv7.mjs.map} +1 -1
  17. package/fesm2022/{acorex-modules-document-management-list-view.component-CALsnuCI.mjs → acorex-modules-document-management-list-view.component-BVaTJLOt.mjs} +2 -2
  18. package/fesm2022/{acorex-modules-document-management-list-view.component-CALsnuCI.mjs.map → acorex-modules-document-management-list-view.component-BVaTJLOt.mjs.map} +1 -1
  19. package/fesm2022/{acorex-modules-document-management-permission-definition.provider-7NpKb9FT.mjs → acorex-modules-document-management-permission-definition.provider-BHfKnNtN.mjs} +2 -2
  20. package/fesm2022/{acorex-modules-document-management-permission-definition.provider-7NpKb9FT.mjs.map → acorex-modules-document-management-permission-definition.provider-BHfKnNtN.mjs.map} +1 -1
  21. package/fesm2022/{acorex-modules-document-management-small-icons-view.component-Cx7ON87O.mjs → acorex-modules-document-management-small-icons-view.component-DGzv9OY0.mjs} +2 -2
  22. package/fesm2022/{acorex-modules-document-management-small-icons-view.component-Cx7ON87O.mjs.map → acorex-modules-document-management-small-icons-view.component-DGzv9OY0.mjs.map} +1 -1
  23. package/fesm2022/{acorex-modules-document-management-small-tiles-view.component-DXLfLnZh.mjs → acorex-modules-document-management-small-tiles-view.component-sQkuW5Z7.mjs} +2 -2
  24. package/fesm2022/{acorex-modules-document-management-small-tiles-view.component-DXLfLnZh.mjs.map → acorex-modules-document-management-small-tiles-view.component-sQkuW5Z7.mjs.map} +1 -1
  25. package/fesm2022/acorex-modules-document-management.mjs +1 -1
  26. package/package.json +14 -14
  27. package/fesm2022/acorex-modules-document-management-acorex-modules-document-management-Dg8SVY4R.mjs.map +0 -1
@@ -5757,6 +5757,77 @@ class AXMDocumentManagerService {
5757
5757
  const extension = originalName.substring(lastDotIndex);
5758
5758
  return `${nameWithoutExt} copy${extension}`;
5759
5759
  }
5760
+ /**
5761
+ * Prepares file for copy operation by downloading from storage and converting to blob source
5762
+ * This method takes an existing AXPFileListItem (or fileId string) and prepares it for re-upload
5763
+ * by downloading the file from storage and changing source to blob with uploading status
5764
+ */
5765
+ async prepareFileForCopy(fileId, fileName) {
5766
+ try {
5767
+ // Extract fileId string from the source
5768
+ let fileIdString;
5769
+ let existingFileItem;
5770
+ if (typeof fileId === 'string') {
5771
+ fileIdString = fileId;
5772
+ }
5773
+ else if (fileId && typeof fileId === 'object') {
5774
+ // If it's already an AXPFileListItem with source.kind === 'fileId'
5775
+ if (fileId.source?.kind === 'fileId' && typeof fileId.source.value === 'string') {
5776
+ fileIdString = fileId.source.value;
5777
+ existingFileItem = fileId;
5778
+ }
5779
+ else if (fileId.id && typeof fileId.id === 'string') {
5780
+ fileIdString = fileId.id;
5781
+ existingFileItem = fileId;
5782
+ }
5783
+ else if (fileId.fileId && typeof fileId.fileId === 'string') {
5784
+ fileIdString = fileId.fileId;
5785
+ }
5786
+ }
5787
+ if (!fileIdString) {
5788
+ console.warn('Could not extract fileId from:', fileId);
5789
+ return undefined;
5790
+ }
5791
+ // Get file info from file storage service using source.value
5792
+ const fileInfo = await this.fileService.getInfo(fileIdString);
5793
+ if (!fileInfo) {
5794
+ throw new Error(`File not found in storage: ${fileIdString}`);
5795
+ }
5796
+ // Get binary data
5797
+ const binary = fileInfo.binary;
5798
+ if (!binary) {
5799
+ throw new Error(`File binary data not available for: ${fileIdString}`);
5800
+ }
5801
+ // Create blob from binary (in case it's not already a Blob)
5802
+ const blob = binary instanceof Blob ? binary : new Blob([binary], { type: fileInfo.mimeType });
5803
+ // If we have an existing file item, clone it and update source and status
5804
+ if (existingFileItem) {
5805
+ return {
5806
+ ...existingFileItem,
5807
+ status: 'uploading',
5808
+ source: {
5809
+ kind: 'blob',
5810
+ value: blob,
5811
+ },
5812
+ };
5813
+ }
5814
+ // Otherwise create a new AXPFileListItem
5815
+ return {
5816
+ id: fileInfo.fileId,
5817
+ name: fileName ?? fileInfo.name ?? 'unknown',
5818
+ size: fileInfo.size,
5819
+ status: 'uploading',
5820
+ source: {
5821
+ kind: 'blob',
5822
+ value: blob,
5823
+ },
5824
+ };
5825
+ }
5826
+ catch (error) {
5827
+ console.error('Error preparing file for copy:', error);
5828
+ throw error;
5829
+ }
5830
+ }
5760
5831
  //#endregion
5761
5832
  //#region ---- Root and Folder Operations ----
5762
5833
  /**
@@ -5950,10 +6021,14 @@ class AXMDocumentManagerService {
5950
6021
  // Create a document model from the original with the new name
5951
6022
  // Extract needed properties without id
5952
6023
  const { id, ...fileDataWithoutId } = originalFile;
6024
+ debugger;
6025
+ // Prepare file for copy by downloading from storage and converting to blob source
6026
+ const fileListItem = await this.prepareFileForCopy(originalFile.fileId, newName);
5953
6027
  const fileData = {
5954
6028
  ...fileDataWithoutId,
5955
6029
  name: newName,
5956
6030
  title: newName,
6031
+ fileId: fileListItem,
5957
6032
  };
5958
6033
  // Create the new file
5959
6034
  return await this.createFile(fileData);
@@ -5982,7 +6057,7 @@ class AXMDocumentManagerService {
5982
6057
  * Moves a node to another location
5983
6058
  */
5984
6059
  async moveTo(options) {
5985
- const comp = (await import('./acorex-modules-document-management-drive-choose.component-Cgi4gVUo.mjs')).AXMDocumentDriveChooseComponent;
6060
+ const comp = (await import('./acorex-modules-document-management-drive-choose.component-DwPBtiFH.mjs')).AXMDocumentDriveChooseComponent;
5986
6061
  const popup = await this.popupService.open(comp, {
5987
6062
  title: `Choose ${options.browseMode == 'file' ? 'File' : 'Folder'}`,
5988
6063
  data: {
@@ -6015,7 +6090,7 @@ class AXMDocumentManagerService {
6015
6090
  * Copies a node to another location
6016
6091
  */
6017
6092
  async copyTo(options) {
6018
- const comp = (await import('./acorex-modules-document-management-drive-choose.component-Cgi4gVUo.mjs')).AXMDocumentDriveChooseComponent;
6093
+ const comp = (await import('./acorex-modules-document-management-drive-choose.component-DwPBtiFH.mjs')).AXMDocumentDriveChooseComponent;
6019
6094
  const popup = await this.popupService.open(comp, {
6020
6095
  title: `Choose ${options.browseMode == 'file' ? 'File' : 'Folder'}`,
6021
6096
  data: {
@@ -6038,15 +6113,20 @@ class AXMDocumentManagerService {
6038
6113
  });
6039
6114
  }
6040
6115
  else {
6116
+ // Get the original file to copy its data
6117
+ const originalFile = await this.documentService.getOne(options.node.id);
6118
+ if (!originalFile) {
6119
+ throw new Error(`File with ID ${options.node.id} not found`);
6120
+ }
6121
+ // Prepare file for copy by downloading from storage and converting to blob source
6122
+ const fileListItem = await this.prepareFileForCopy(originalFile.fileId, options.node.name);
6041
6123
  await this.createFile({
6042
6124
  title: options.node.name,
6043
6125
  name: options.node.name,
6044
6126
  parentId: selectedFolder.id,
6045
- //TODO upload file to file storage
6046
- fileId: '',
6047
- size: 0,
6127
+ fileId: fileListItem,
6128
+ size: originalFile.size ?? options.node.size ?? 0,
6048
6129
  documentType: options.node.documentTypes[0],
6049
- // TODO
6050
6130
  status: 'Draft',
6051
6131
  });
6052
6132
  }
@@ -6463,7 +6543,7 @@ class AXMDocumentManagerService {
6463
6543
  * Shows choose file dialog
6464
6544
  */
6465
6545
  async showChooseFileDialog(scope) {
6466
- const comp = (await import('./acorex-modules-document-management-drive-choose.component-Cgi4gVUo.mjs')).AXMDocumentDriveChooseComponent;
6546
+ const comp = (await import('./acorex-modules-document-management-drive-choose.component-DwPBtiFH.mjs')).AXMDocumentDriveChooseComponent;
6467
6547
  const result = await this.popupService.open(comp, {
6468
6548
  title: await this.translate.translateAsync('@document-management:actions.choose-from-drive'),
6469
6549
  data: {
@@ -7671,13 +7751,13 @@ class AXMDocumentExplorerComponent {
7671
7751
  this.showContextMenu = input(true, ...(ngDevMode ? [{ debugName: "showContextMenu" }] : []));
7672
7752
  this.view = signal(null, ...(ngDevMode ? [{ debugName: "view" }] : []));
7673
7753
  this.viewMap = {
7674
- list: async () => (await import('./acorex-modules-document-management-list-view.component-CALsnuCI.mjs')).AXMDocumentExplorerListViewComponent,
7675
- 'small-tiles': async () => (await import('./acorex-modules-document-management-small-tiles-view.component-DXLfLnZh.mjs')).AXMDocumentExplorerSmallTilesViewComponent,
7676
- 'large-tiles': async () => (await import('./acorex-modules-document-management-large-tiles-view.component-C-xJAD2U.mjs')).AXMDocumentExplorerLargeTilesViewComponent,
7677
- details: async () => (await import('./acorex-modules-document-management-details-view.component-CBmWHsVg.mjs')).AXMDocumentExplorerDetailsViewComponent,
7678
- 'large-icons': async () => (await import('./acorex-modules-document-management-large-icons-view.component-CiTXhe9q.mjs')).AXMDocumentExplorerLargeIconsViewComponent,
7679
- 'small-icons': async () => (await import('./acorex-modules-document-management-small-icons-view.component-Cx7ON87O.mjs')).AXMDocumentExplorerSmallIconsViewComponent,
7680
- 'attachment': async () => (await import('./acorex-modules-document-management-attachment-widget.component-zFZApYr5.mjs')).AXMDocumentExplorerAttachmentComponent,
7754
+ list: async () => (await import('./acorex-modules-document-management-list-view.component-BVaTJLOt.mjs')).AXMDocumentExplorerListViewComponent,
7755
+ 'small-tiles': async () => (await import('./acorex-modules-document-management-small-tiles-view.component-sQkuW5Z7.mjs')).AXMDocumentExplorerSmallTilesViewComponent,
7756
+ 'large-tiles': async () => (await import('./acorex-modules-document-management-large-tiles-view.component-3rWSoRv7.mjs')).AXMDocumentExplorerLargeTilesViewComponent,
7757
+ details: async () => (await import('./acorex-modules-document-management-details-view.component-BMg9EyVx.mjs')).AXMDocumentExplorerDetailsViewComponent,
7758
+ 'large-icons': async () => (await import('./acorex-modules-document-management-large-icons-view.component-DeS61K-Y.mjs')).AXMDocumentExplorerLargeIconsViewComponent,
7759
+ 'small-icons': async () => (await import('./acorex-modules-document-management-small-icons-view.component-DGzv9OY0.mjs')).AXMDocumentExplorerSmallIconsViewComponent,
7760
+ 'attachment': async () => (await import('./acorex-modules-document-management-attachment-widget.component-BDHk-Ukz.mjs')).AXMDocumentExplorerAttachmentComponent,
7681
7761
  };
7682
7762
  this.#effect = effect(() => {
7683
7763
  if (this.vm.loadingFolderId() == null) {
@@ -8263,7 +8343,7 @@ class AXMDocumentSignaturePopupAction extends AXPWorkflowAction {
8263
8343
  const documentId = context.getVariable('options.id');
8264
8344
  const documentTitle = context.getVariable('options.title');
8265
8345
  const fileId = context.getVariable('options.fileId');
8266
- const comp = await import('./acorex-modules-document-management-document-signature-popup.component-0C1OmnNz.mjs')
8346
+ const comp = await import('./acorex-modules-document-management-document-signature-popup.component-DNy7uxsA.mjs')
8267
8347
  .then(x => x.AXMDocumentSignaturePopupComponent);
8268
8348
  console.log(fileId);
8269
8349
  const result = await this.popupService.open(comp, {
@@ -9175,11 +9255,11 @@ function routesFacory() {
9175
9255
  children: [
9176
9256
  {
9177
9257
  path: '',
9178
- loadComponent: () => import('./acorex-modules-document-management-drive.component-qqJtfLVN.mjs').then((c) => c.AXMDocumentDriveComponent),
9258
+ loadComponent: () => import('./acorex-modules-document-management-drive.component-Dn6qh_iW.mjs').then((c) => c.AXMDocumentDriveComponent),
9179
9259
  },
9180
9260
  {
9181
9261
  path: ':id',
9182
- loadComponent: () => import('./acorex-modules-document-management-drive.component-qqJtfLVN.mjs').then((c) => c.AXMDocumentDriveComponent),
9262
+ loadComponent: () => import('./acorex-modules-document-management-drive.component-Dn6qh_iW.mjs').then((c) => c.AXMDocumentDriveComponent),
9183
9263
  },
9184
9264
  ],
9185
9265
  },
@@ -9224,7 +9304,7 @@ class AXMDocumentManagementModule {
9224
9304
  provide: AXP_PERMISSION_DEFINITION_PROVIDER,
9225
9305
  useFactory: async () => {
9226
9306
  const injector = inject(Injector);
9227
- const provider = (await import('./acorex-modules-document-management-permission-definition.provider-7NpKb9FT.mjs')).AXMPermissionDefinitionProvider;
9307
+ const provider = (await import('./acorex-modules-document-management-permission-definition.provider-BHfKnNtN.mjs')).AXMPermissionDefinitionProvider;
9228
9308
  return new provider(injector);
9229
9309
  },
9230
9310
  multi: true,
@@ -9362,7 +9442,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImpo
9362
9442
  provide: AXP_PERMISSION_DEFINITION_PROVIDER,
9363
9443
  useFactory: async () => {
9364
9444
  const injector = inject(Injector);
9365
- const provider = (await import('./acorex-modules-document-management-permission-definition.provider-7NpKb9FT.mjs')).AXMPermissionDefinitionProvider;
9445
+ const provider = (await import('./acorex-modules-document-management-permission-definition.provider-BHfKnNtN.mjs')).AXMPermissionDefinitionProvider;
9366
9446
  return new provider(injector);
9367
9447
  },
9368
9448
  multi: true,
@@ -9403,4 +9483,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.12", ngImpo
9403
9483
  */
9404
9484
 
9405
9485
  export { AXPDocumentExplorerViewModel as A, AXMDocumentManagementDocumentTypeStatusDefinitionEntityService as B, AXMDocumentManagementDocumentTypeStatusDefinitionEntityServiceImpl as C, documentRelatedFactory as D, folderFactory as E, AXMFolderService as F, AXMFolderServiceImpl as G, AXMFolderEntityModule as H, reviewFactory as I, AXMReviewService as J, AXMReviewServiceImpl as K, AXMReviewEntityModule as L, distributionFactory as M, AXMDistributionService as N, AXMDistributionServiceImpl as O, AXMDistributionEntityModule as P, distributionInteractionFactory as Q, RootConfig as R, AXMDistributionInteractionServiceImpl as S, AXMDistributionInteractionEntityModule as T, AXMDocumentReletedEntityModule as U, AXMEntityProvider as V, AXMMenuProvider as W, AXMSearchCommandProvider as X, AXMSettingProvider as Y, AXMDocumentManagerService as a, AXMDocumentExplorerComponent as b, AXMPermissionsKeys as c, AXMDistributionInteractionService as d, AXMFolderPathBreadcrumbsComponent as e, AXMDocumentManagementModule as f, documentFactory as g, AXMDocumentManagementDocumentEntityModule as h, AXMDocumentService as i, AXMDocumentServiceImpl as j, getNextStatus as k, canTransition as l, documentTypeFactory as m, AXMDocumentManagementDocumentTypeEntityModule as n, AXMDocumentTypeService as o, AXMDocumentTypeServiceImpl as p, documentTypeMetaDefinitionfactory as q, AXMDocumentManagementDocumentTypeMetaDefinitionEntityModule as r, AXMDocumentManagementDocumentTypeMetaDefinitionEntityService as s, AXMDocumentManagementDocumentTypeMetaDefinitionEntityServiceImpl as t, documentTypeMetaValueFactory as u, AXMDocumentManagementDocumentTypeMetaValueEntityModule as v, AXMDocumentManagementDocumentTypeMetaValueEntityService as w, AXMDocumentManagementDocumentTypeMetaValueEntityServiceImpl as x, documentTypeStatusDefinitionFactory as y, AXMDocumentManagementDocumentTypeStatusDefinitionEntityModule as z };
9406
- //# sourceMappingURL=acorex-modules-document-management-acorex-modules-document-management-Dg8SVY4R.mjs.map
9486
+ //# sourceMappingURL=acorex-modules-document-management-acorex-modules-document-management-ByRPA5To.mjs.map