ptechcore_ui 1.0.48 → 1.0.49

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -1010,6 +1010,8 @@ type ViewMode = 'grid' | 'list';
1010
1010
  interface FileManagerProps {
1011
1011
  data: FileItem[];
1012
1012
  rootName?: string;
1013
+ /** ID du dossier racine réel (code backend, ex: FO000001). Si fourni, utilisé à la place de '__root__' */
1014
+ rootFolderId?: string;
1013
1015
  onCreateFolder?: (name: string, parentId: string) => Promise<FileItem | void>;
1014
1016
  onUploadFiles?: (files: File[], parentId: string) => Promise<FileItem[] | void>;
1015
1017
  onRename?: (item: FileItem, newName: string) => Promise<void>;
@@ -1055,6 +1057,8 @@ interface FileManagerContextValue {
1055
1057
  pathHistory: FileItem[];
1056
1058
  selectedItems: FileItem[];
1057
1059
  viewMode: ViewMode;
1060
+ /** ID du dossier racine (code backend ou '__root__') */
1061
+ rootFolderId: string;
1058
1062
  contextMenu: {
1059
1063
  visible: boolean;
1060
1064
  position: ContextMenuPosition;
@@ -1484,6 +1488,41 @@ declare function getDownloadUrl(fileCode: string): string;
1484
1488
  * @returns URL complète
1485
1489
  */
1486
1490
  declare function getFileUrl(fileUrl: string): string;
1491
+ /**
1492
+ * Récupère le dossier ROOT d'un BusinessEntity.
1493
+ *
1494
+ * @param businessEntityId - ID du BusinessEntity
1495
+ * @returns Dossier ROOT
1496
+ *
1497
+ * @example
1498
+ * const rootFolder = await fileManagerApi.getRootFolder(1);
1499
+ */
1500
+ declare function getRootFolder(businessEntityId: string | number): Promise<BackendFolder | null>;
1501
+ /**
1502
+ * Récupère l'arborescence complète depuis le ROOT d'un BusinessEntity.
1503
+ *
1504
+ * Utilise le nouvel endpoint optimisé /folders/root_tree/ qui retourne
1505
+ * l'arborescence complète en une seule requête avec prefetch.
1506
+ *
1507
+ * @param businessEntityId - ID du BusinessEntity
1508
+ * @returns Arborescence complète depuis ROOT avec tous les dossiers et fichiers
1509
+ *
1510
+ * @example
1511
+ * const tree = await fileManagerApi.getRootTree(1);
1512
+ * // Retourne:
1513
+ * // {
1514
+ * // code: 'FO000001',
1515
+ * // name: 'Ma Société - Documents',
1516
+ * // folder_type: 'ROOT',
1517
+ * // children: [
1518
+ * // { name: 'Clients', folder_type: 'CATEGORY', children: [...], files: [...] },
1519
+ * // { name: 'Fournisseurs', ... },
1520
+ * // ...
1521
+ * // ],
1522
+ * // files: [...]
1523
+ * // }
1524
+ */
1525
+ declare function getRootTree(businessEntityId: string | number): Promise<BackendFolder | null>;
1487
1526
  /**
1488
1527
  * Service API pour la GED.
1489
1528
  *
@@ -1496,6 +1535,9 @@ declare function getFileUrl(fileUrl: string): string;
1496
1535
  *
1497
1536
  * // Uploader un fichier
1498
1537
  * const file = await fileManagerApi.uploadFile(myFile, 'FO000001');
1538
+ *
1539
+ * // Récupérer l'arborescence ROOT d'un BusinessEntity
1540
+ * const rootTree = await fileManagerApi.getRootTree(businessEntityId);
1499
1541
  */
1500
1542
  declare const fileManagerApi: {
1501
1543
  getEntityFolders: typeof getEntityFolders;
@@ -1504,6 +1546,8 @@ declare const fileManagerApi: {
1504
1546
  createFolder: typeof createFolder;
1505
1547
  renameFolder: typeof renameFolder;
1506
1548
  deleteFolder: typeof deleteFolder;
1549
+ getRootFolder: typeof getRootFolder;
1550
+ getRootTree: typeof getRootTree;
1507
1551
  getFolderFiles: typeof getFolderFiles;
1508
1552
  uploadFile: typeof uploadFile;
1509
1553
  uploadFiles: typeof uploadFiles;
package/dist/index.d.ts CHANGED
@@ -1010,6 +1010,8 @@ type ViewMode = 'grid' | 'list';
1010
1010
  interface FileManagerProps {
1011
1011
  data: FileItem[];
1012
1012
  rootName?: string;
1013
+ /** ID du dossier racine réel (code backend, ex: FO000001). Si fourni, utilisé à la place de '__root__' */
1014
+ rootFolderId?: string;
1013
1015
  onCreateFolder?: (name: string, parentId: string) => Promise<FileItem | void>;
1014
1016
  onUploadFiles?: (files: File[], parentId: string) => Promise<FileItem[] | void>;
1015
1017
  onRename?: (item: FileItem, newName: string) => Promise<void>;
@@ -1055,6 +1057,8 @@ interface FileManagerContextValue {
1055
1057
  pathHistory: FileItem[];
1056
1058
  selectedItems: FileItem[];
1057
1059
  viewMode: ViewMode;
1060
+ /** ID du dossier racine (code backend ou '__root__') */
1061
+ rootFolderId: string;
1058
1062
  contextMenu: {
1059
1063
  visible: boolean;
1060
1064
  position: ContextMenuPosition;
@@ -1484,6 +1488,41 @@ declare function getDownloadUrl(fileCode: string): string;
1484
1488
  * @returns URL complète
1485
1489
  */
1486
1490
  declare function getFileUrl(fileUrl: string): string;
1491
+ /**
1492
+ * Récupère le dossier ROOT d'un BusinessEntity.
1493
+ *
1494
+ * @param businessEntityId - ID du BusinessEntity
1495
+ * @returns Dossier ROOT
1496
+ *
1497
+ * @example
1498
+ * const rootFolder = await fileManagerApi.getRootFolder(1);
1499
+ */
1500
+ declare function getRootFolder(businessEntityId: string | number): Promise<BackendFolder | null>;
1501
+ /**
1502
+ * Récupère l'arborescence complète depuis le ROOT d'un BusinessEntity.
1503
+ *
1504
+ * Utilise le nouvel endpoint optimisé /folders/root_tree/ qui retourne
1505
+ * l'arborescence complète en une seule requête avec prefetch.
1506
+ *
1507
+ * @param businessEntityId - ID du BusinessEntity
1508
+ * @returns Arborescence complète depuis ROOT avec tous les dossiers et fichiers
1509
+ *
1510
+ * @example
1511
+ * const tree = await fileManagerApi.getRootTree(1);
1512
+ * // Retourne:
1513
+ * // {
1514
+ * // code: 'FO000001',
1515
+ * // name: 'Ma Société - Documents',
1516
+ * // folder_type: 'ROOT',
1517
+ * // children: [
1518
+ * // { name: 'Clients', folder_type: 'CATEGORY', children: [...], files: [...] },
1519
+ * // { name: 'Fournisseurs', ... },
1520
+ * // ...
1521
+ * // ],
1522
+ * // files: [...]
1523
+ * // }
1524
+ */
1525
+ declare function getRootTree(businessEntityId: string | number): Promise<BackendFolder | null>;
1487
1526
  /**
1488
1527
  * Service API pour la GED.
1489
1528
  *
@@ -1496,6 +1535,9 @@ declare function getFileUrl(fileUrl: string): string;
1496
1535
  *
1497
1536
  * // Uploader un fichier
1498
1537
  * const file = await fileManagerApi.uploadFile(myFile, 'FO000001');
1538
+ *
1539
+ * // Récupérer l'arborescence ROOT d'un BusinessEntity
1540
+ * const rootTree = await fileManagerApi.getRootTree(businessEntityId);
1499
1541
  */
1500
1542
  declare const fileManagerApi: {
1501
1543
  getEntityFolders: typeof getEntityFolders;
@@ -1504,6 +1546,8 @@ declare const fileManagerApi: {
1504
1546
  createFolder: typeof createFolder;
1505
1547
  renameFolder: typeof renameFolder;
1506
1548
  deleteFolder: typeof deleteFolder;
1549
+ getRootFolder: typeof getRootFolder;
1550
+ getRootTree: typeof getRootTree;
1507
1551
  getFolderFiles: typeof getFolderFiles;
1508
1552
  uploadFile: typeof uploadFile;
1509
1553
  uploadFiles: typeof uploadFiles;