ptechcore_ui 1.0.23 → 1.0.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.
- package/dist/index.cjs +1122 -4
- package/dist/index.d.cts +110 -1
- package/dist/index.d.ts +110 -1
- package/dist/index.js +1128 -4
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -43,6 +43,8 @@ __export(index_exports, {
|
|
|
43
43
|
FDrawer: () => FDrawer,
|
|
44
44
|
FetchApi: () => FetchApi,
|
|
45
45
|
FileInput: () => FileInput,
|
|
46
|
+
FileManager: () => FileManager,
|
|
47
|
+
FileManagerProvider: () => FileManagerProvider,
|
|
46
48
|
ForeignCurrencySelector: () => ForeignCurrencySelector,
|
|
47
49
|
InputField: () => InputField,
|
|
48
50
|
InvoiceTypeSelector: () => InvoiceTypeSelector,
|
|
@@ -67,7 +69,11 @@ __export(index_exports, {
|
|
|
67
69
|
ToastContainer: () => Toast_default,
|
|
68
70
|
ToastProvider: () => ToastProvider,
|
|
69
71
|
UserServices: () => UserServices,
|
|
72
|
+
formatDate: () => formatDate,
|
|
73
|
+
formatFileSize: () => formatFileSize,
|
|
74
|
+
getFileIcon: () => getFileIcon,
|
|
70
75
|
useAlert: () => useAlert,
|
|
76
|
+
useFileManager: () => useFileManager,
|
|
71
77
|
useSession: () => useSession,
|
|
72
78
|
useToast: () => useToast
|
|
73
79
|
});
|
|
@@ -759,7 +765,7 @@ var import_react2 = require("react");
|
|
|
759
765
|
|
|
760
766
|
// src/services/api.ts
|
|
761
767
|
var chooseEnv = localStorage.getItem("env") ?? "prod";
|
|
762
|
-
var ADDRESS_IP = chooseEnv === "prod" ? "
|
|
768
|
+
var ADDRESS_IP = chooseEnv === "prod" ? "backend-core.rewise.praedium-tech.com" : "localhost:8000";
|
|
763
769
|
var ADDRESS_IP_URL = chooseEnv === "prod" ? `https://${ADDRESS_IP}/` : `http://${ADDRESS_IP}/`;
|
|
764
770
|
var API_URL = `${ADDRESS_IP_URL}api`;
|
|
765
771
|
var FetchApi = class {
|
|
@@ -1708,13 +1714,13 @@ var MODULE_URLS = {
|
|
|
1708
1714
|
wiseAsset: "#",
|
|
1709
1715
|
wiseCash: "https://rewise.praedium-tech.com/admin/finance/dashboard/",
|
|
1710
1716
|
wiseCollect: "https://rewise.praedium-tech.com/admin/recovery/collection/dashboard/",
|
|
1711
|
-
wiseProcure: "https://
|
|
1717
|
+
wiseProcure: "https://wiseprocure.praedium-tech.com/",
|
|
1712
1718
|
wiseHR: "https://rewise.praedium-tech.com/admin/human-capital/dashboard/"
|
|
1713
1719
|
},
|
|
1714
1720
|
development: {
|
|
1715
1721
|
wiseConnect: "http://localhost:5173/admin/crm/trade-strategy/lead-insight/",
|
|
1716
1722
|
wiseReach: "http://localhost:5173/admin/marketing/dashboard/",
|
|
1717
|
-
wiseOps: "http://localhost:
|
|
1723
|
+
wiseOps: "http://localhost:5173/",
|
|
1718
1724
|
wiseGuard: "http://localhost:5173/admin/security/dashboard/",
|
|
1719
1725
|
wiseThrive: "http://localhost:5173/admin/thrive/scorecard/dashboard/financial/",
|
|
1720
1726
|
wiseView: "http://localhost:5175/",
|
|
@@ -1733,7 +1739,8 @@ var getModuleUrls = (token) => {
|
|
|
1733
1739
|
const urls = env === "localhost" ? MODULE_URLS.development : MODULE_URLS.production;
|
|
1734
1740
|
return {
|
|
1735
1741
|
...urls,
|
|
1736
|
-
wiseOps: token ? `${urls.wiseOps}?tkn=${token}` : urls.wiseOps
|
|
1742
|
+
wiseOps: token ? `${urls.wiseOps}?tkn=${token}` : urls.wiseOps,
|
|
1743
|
+
wiseProcure: token ? `${urls.wiseProcure}?tkn=${token}` : urls.wiseProcure
|
|
1737
1744
|
};
|
|
1738
1745
|
};
|
|
1739
1746
|
var MODULE_CODE_MAP = {
|
|
@@ -6650,6 +6657,1111 @@ var CountrySelector = ({
|
|
|
6650
6657
|
`country-${value}`
|
|
6651
6658
|
);
|
|
6652
6659
|
};
|
|
6660
|
+
|
|
6661
|
+
// src/components/common/FileManager/FileManager.tsx
|
|
6662
|
+
var import_react20 = require("react");
|
|
6663
|
+
var import_lucide_react16 = require("lucide-react");
|
|
6664
|
+
|
|
6665
|
+
// src/components/common/FileManager/FileManagerContext.tsx
|
|
6666
|
+
var import_react14 = require("react");
|
|
6667
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
6668
|
+
var defaultTexts = {
|
|
6669
|
+
createFolder: "Cr\xE9er un dossier",
|
|
6670
|
+
uploadFiles: "Uploader des fichiers",
|
|
6671
|
+
rename: "Renommer",
|
|
6672
|
+
delete: "Supprimer",
|
|
6673
|
+
download: "T\xE9l\xE9charger",
|
|
6674
|
+
open: "Ouvrir",
|
|
6675
|
+
deselectAll: "Tout d\xE9s\xE9lectionner",
|
|
6676
|
+
newFolderName: "Nom du dossier",
|
|
6677
|
+
confirmDelete: "Voulez-vous vraiment supprimer",
|
|
6678
|
+
noFiles: "Aucun fichier",
|
|
6679
|
+
dropFilesHere: "D\xE9posez vos fichiers ici",
|
|
6680
|
+
cancel: "Annuler",
|
|
6681
|
+
confirm: "Confirmer"
|
|
6682
|
+
};
|
|
6683
|
+
var FileManagerContext = (0, import_react14.createContext)(null);
|
|
6684
|
+
var useFileManager = () => {
|
|
6685
|
+
const context = (0, import_react14.useContext)(FileManagerContext);
|
|
6686
|
+
if (!context) {
|
|
6687
|
+
throw new Error("useFileManager must be used within a FileManagerProvider");
|
|
6688
|
+
}
|
|
6689
|
+
return context;
|
|
6690
|
+
};
|
|
6691
|
+
var FileManagerProvider = ({
|
|
6692
|
+
children,
|
|
6693
|
+
data,
|
|
6694
|
+
rootName = "Fichiers",
|
|
6695
|
+
viewMode: initialViewMode = "grid",
|
|
6696
|
+
allowMultiSelect = true,
|
|
6697
|
+
allowUpload = true,
|
|
6698
|
+
allowCreateFolder = true,
|
|
6699
|
+
allowRename = true,
|
|
6700
|
+
allowDelete = true,
|
|
6701
|
+
allowDownload = true,
|
|
6702
|
+
texts: customTexts = {},
|
|
6703
|
+
onCreateFolder,
|
|
6704
|
+
onUploadFiles,
|
|
6705
|
+
onRename,
|
|
6706
|
+
onDelete,
|
|
6707
|
+
onDownload,
|
|
6708
|
+
onOpen,
|
|
6709
|
+
onSelect
|
|
6710
|
+
}) => {
|
|
6711
|
+
const rootFolder = (0, import_react14.useMemo)(
|
|
6712
|
+
() => ({
|
|
6713
|
+
id: "__root__",
|
|
6714
|
+
name: rootName,
|
|
6715
|
+
type: "folder",
|
|
6716
|
+
path: "/",
|
|
6717
|
+
children: data
|
|
6718
|
+
}),
|
|
6719
|
+
[data, rootName]
|
|
6720
|
+
);
|
|
6721
|
+
const [currentFolder, setCurrentFolder] = (0, import_react14.useState)(rootFolder);
|
|
6722
|
+
const [pathHistory, setPathHistory] = (0, import_react14.useState)([rootFolder]);
|
|
6723
|
+
const [selectedItems, setSelectedItems] = (0, import_react14.useState)([]);
|
|
6724
|
+
const [viewMode, setViewMode] = (0, import_react14.useState)(initialViewMode);
|
|
6725
|
+
const [renamingItem, setRenamingItem] = (0, import_react14.useState)(null);
|
|
6726
|
+
const [contextMenu, setContextMenu] = (0, import_react14.useState)({
|
|
6727
|
+
visible: false,
|
|
6728
|
+
position: { x: 0, y: 0 },
|
|
6729
|
+
item: null
|
|
6730
|
+
});
|
|
6731
|
+
const texts = (0, import_react14.useMemo)(() => ({ ...defaultTexts, ...customTexts }), [customTexts]);
|
|
6732
|
+
const currentFolderContents = (0, import_react14.useMemo)(() => {
|
|
6733
|
+
return currentFolder?.children || [];
|
|
6734
|
+
}, [currentFolder]);
|
|
6735
|
+
const navigateToFolder = (0, import_react14.useCallback)(
|
|
6736
|
+
(folder) => {
|
|
6737
|
+
if (!folder) {
|
|
6738
|
+
setCurrentFolder(rootFolder);
|
|
6739
|
+
setPathHistory([rootFolder]);
|
|
6740
|
+
} else {
|
|
6741
|
+
setCurrentFolder(folder);
|
|
6742
|
+
setPathHistory((prev) => [...prev, folder]);
|
|
6743
|
+
}
|
|
6744
|
+
setSelectedItems([]);
|
|
6745
|
+
setContextMenu({ visible: false, position: { x: 0, y: 0 }, item: null });
|
|
6746
|
+
},
|
|
6747
|
+
[rootFolder]
|
|
6748
|
+
);
|
|
6749
|
+
const navigateBack = (0, import_react14.useCallback)(() => {
|
|
6750
|
+
if (pathHistory.length > 1) {
|
|
6751
|
+
const newHistory = [...pathHistory];
|
|
6752
|
+
newHistory.pop();
|
|
6753
|
+
const previousFolder = newHistory[newHistory.length - 1];
|
|
6754
|
+
setCurrentFolder(previousFolder);
|
|
6755
|
+
setPathHistory(newHistory);
|
|
6756
|
+
setSelectedItems([]);
|
|
6757
|
+
}
|
|
6758
|
+
}, [pathHistory]);
|
|
6759
|
+
const navigateToPath = (0, import_react14.useCallback)(
|
|
6760
|
+
(index) => {
|
|
6761
|
+
if (index < pathHistory.length - 1) {
|
|
6762
|
+
const newHistory = pathHistory.slice(0, index + 1);
|
|
6763
|
+
setCurrentFolder(newHistory[newHistory.length - 1]);
|
|
6764
|
+
setPathHistory(newHistory);
|
|
6765
|
+
setSelectedItems([]);
|
|
6766
|
+
}
|
|
6767
|
+
},
|
|
6768
|
+
[pathHistory]
|
|
6769
|
+
);
|
|
6770
|
+
const selectItem = (0, import_react14.useCallback)(
|
|
6771
|
+
(item, multiSelect = false) => {
|
|
6772
|
+
setSelectedItems((prev) => {
|
|
6773
|
+
if (multiSelect && allowMultiSelect) {
|
|
6774
|
+
const isSelected = prev.some((i) => i.id === item.id);
|
|
6775
|
+
if (isSelected) {
|
|
6776
|
+
return prev.filter((i) => i.id !== item.id);
|
|
6777
|
+
}
|
|
6778
|
+
return [...prev, item];
|
|
6779
|
+
}
|
|
6780
|
+
return [item];
|
|
6781
|
+
});
|
|
6782
|
+
if (onSelect) {
|
|
6783
|
+
const newSelection = allowMultiSelect && multiSelect ? selectedItems.some((i) => i.id === item.id) ? selectedItems.filter((i) => i.id !== item.id) : [...selectedItems, item] : [item];
|
|
6784
|
+
onSelect(newSelection);
|
|
6785
|
+
}
|
|
6786
|
+
},
|
|
6787
|
+
[allowMultiSelect, onSelect, selectedItems]
|
|
6788
|
+
);
|
|
6789
|
+
const deselectAll = (0, import_react14.useCallback)(() => {
|
|
6790
|
+
setSelectedItems([]);
|
|
6791
|
+
if (onSelect) {
|
|
6792
|
+
onSelect([]);
|
|
6793
|
+
}
|
|
6794
|
+
}, [onSelect]);
|
|
6795
|
+
const showContextMenu = (0, import_react14.useCallback)((item, position) => {
|
|
6796
|
+
setContextMenu({
|
|
6797
|
+
visible: true,
|
|
6798
|
+
position,
|
|
6799
|
+
item
|
|
6800
|
+
});
|
|
6801
|
+
}, []);
|
|
6802
|
+
const hideContextMenu = (0, import_react14.useCallback)(() => {
|
|
6803
|
+
setContextMenu((prev) => ({ ...prev, visible: false }));
|
|
6804
|
+
}, []);
|
|
6805
|
+
const startRenaming = (0, import_react14.useCallback)((item) => {
|
|
6806
|
+
setRenamingItem(item);
|
|
6807
|
+
hideContextMenu();
|
|
6808
|
+
}, [hideContextMenu]);
|
|
6809
|
+
const stopRenaming = (0, import_react14.useCallback)(() => {
|
|
6810
|
+
setRenamingItem(null);
|
|
6811
|
+
}, []);
|
|
6812
|
+
const contextValue = (0, import_react14.useMemo)(
|
|
6813
|
+
() => ({
|
|
6814
|
+
data,
|
|
6815
|
+
currentFolder,
|
|
6816
|
+
currentFolderContents,
|
|
6817
|
+
pathHistory,
|
|
6818
|
+
selectedItems,
|
|
6819
|
+
viewMode,
|
|
6820
|
+
contextMenu,
|
|
6821
|
+
renamingItem,
|
|
6822
|
+
navigateToFolder,
|
|
6823
|
+
navigateBack,
|
|
6824
|
+
navigateToPath,
|
|
6825
|
+
selectItem,
|
|
6826
|
+
deselectAll,
|
|
6827
|
+
setViewMode,
|
|
6828
|
+
showContextMenu,
|
|
6829
|
+
hideContextMenu,
|
|
6830
|
+
startRenaming,
|
|
6831
|
+
stopRenaming,
|
|
6832
|
+
onCreateFolder,
|
|
6833
|
+
onUploadFiles,
|
|
6834
|
+
onRename,
|
|
6835
|
+
onDelete,
|
|
6836
|
+
onDownload,
|
|
6837
|
+
onOpen,
|
|
6838
|
+
allowUpload,
|
|
6839
|
+
allowCreateFolder,
|
|
6840
|
+
allowRename,
|
|
6841
|
+
allowDelete,
|
|
6842
|
+
allowDownload,
|
|
6843
|
+
allowMultiSelect,
|
|
6844
|
+
texts
|
|
6845
|
+
}),
|
|
6846
|
+
[
|
|
6847
|
+
data,
|
|
6848
|
+
currentFolder,
|
|
6849
|
+
currentFolderContents,
|
|
6850
|
+
pathHistory,
|
|
6851
|
+
selectedItems,
|
|
6852
|
+
viewMode,
|
|
6853
|
+
contextMenu,
|
|
6854
|
+
renamingItem,
|
|
6855
|
+
navigateToFolder,
|
|
6856
|
+
navigateBack,
|
|
6857
|
+
navigateToPath,
|
|
6858
|
+
selectItem,
|
|
6859
|
+
deselectAll,
|
|
6860
|
+
showContextMenu,
|
|
6861
|
+
hideContextMenu,
|
|
6862
|
+
startRenaming,
|
|
6863
|
+
stopRenaming,
|
|
6864
|
+
onCreateFolder,
|
|
6865
|
+
onUploadFiles,
|
|
6866
|
+
onRename,
|
|
6867
|
+
onDelete,
|
|
6868
|
+
onDownload,
|
|
6869
|
+
onOpen,
|
|
6870
|
+
allowUpload,
|
|
6871
|
+
allowCreateFolder,
|
|
6872
|
+
allowRename,
|
|
6873
|
+
allowDelete,
|
|
6874
|
+
allowDownload,
|
|
6875
|
+
allowMultiSelect,
|
|
6876
|
+
texts
|
|
6877
|
+
]
|
|
6878
|
+
);
|
|
6879
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(FileManagerContext.Provider, { value: contextValue, children });
|
|
6880
|
+
};
|
|
6881
|
+
|
|
6882
|
+
// src/components/common/FileManager/components/FolderTree.tsx
|
|
6883
|
+
var import_react15 = require("react");
|
|
6884
|
+
var import_lucide_react9 = require("lucide-react");
|
|
6885
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
6886
|
+
var FolderTreeItem = ({ item, level }) => {
|
|
6887
|
+
const { currentFolder, navigateToFolder, pathHistory } = useFileManager();
|
|
6888
|
+
const [isExpanded, setIsExpanded] = (0, import_react15.useState)(
|
|
6889
|
+
pathHistory.some((f) => f.id === item.id) || level === 0
|
|
6890
|
+
);
|
|
6891
|
+
const isSelected = currentFolder?.id === item.id;
|
|
6892
|
+
const hasChildren = item.children?.some((child) => child.type === "folder");
|
|
6893
|
+
const folderChildren = item.children?.filter((child) => child.type === "folder") || [];
|
|
6894
|
+
const handleToggle = (e) => {
|
|
6895
|
+
e.stopPropagation();
|
|
6896
|
+
setIsExpanded(!isExpanded);
|
|
6897
|
+
};
|
|
6898
|
+
const handleClick = () => {
|
|
6899
|
+
navigateToFolder(item);
|
|
6900
|
+
if (!isExpanded) {
|
|
6901
|
+
setIsExpanded(true);
|
|
6902
|
+
}
|
|
6903
|
+
};
|
|
6904
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { children: [
|
|
6905
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
6906
|
+
"div",
|
|
6907
|
+
{
|
|
6908
|
+
className: cn(
|
|
6909
|
+
"flex items-center gap-1 py-1.5 px-2 rounded-lg cursor-pointer transition-colors",
|
|
6910
|
+
"hover:bg-gray-100 dark:hover:bg-gray-800",
|
|
6911
|
+
isSelected && "bg-blue-50 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300"
|
|
6912
|
+
),
|
|
6913
|
+
style: { paddingLeft: `${level * 12 + 8}px` },
|
|
6914
|
+
onClick: handleClick,
|
|
6915
|
+
children: [
|
|
6916
|
+
hasChildren ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
6917
|
+
"button",
|
|
6918
|
+
{
|
|
6919
|
+
onClick: handleToggle,
|
|
6920
|
+
className: "p-0.5 hover:bg-gray-200 dark:hover:bg-gray-700 rounded",
|
|
6921
|
+
children: isExpanded ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.ChevronDown, { className: "w-4 h-4 text-gray-500 dark:text-gray-400" }) : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.ChevronRight, { className: "w-4 h-4 text-gray-500 dark:text-gray-400" })
|
|
6922
|
+
}
|
|
6923
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: "w-5" }),
|
|
6924
|
+
isExpanded ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.FolderOpen, { className: "w-4 h-4 text-yellow-500 flex-shrink-0" }) : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.Folder, { className: "w-4 h-4 text-yellow-500 flex-shrink-0" }),
|
|
6925
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
6926
|
+
"span",
|
|
6927
|
+
{
|
|
6928
|
+
className: cn(
|
|
6929
|
+
"text-sm truncate",
|
|
6930
|
+
isSelected ? "font-medium" : "text-gray-700 dark:text-gray-300"
|
|
6931
|
+
),
|
|
6932
|
+
children: item.name
|
|
6933
|
+
}
|
|
6934
|
+
)
|
|
6935
|
+
]
|
|
6936
|
+
}
|
|
6937
|
+
),
|
|
6938
|
+
isExpanded && folderChildren.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { children: folderChildren.map((child) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(FolderTreeItem, { item: child, level: level + 1 }, child.id)) })
|
|
6939
|
+
] });
|
|
6940
|
+
};
|
|
6941
|
+
var FolderTree = () => {
|
|
6942
|
+
const { data, currentFolder, navigateToFolder } = useFileManager();
|
|
6943
|
+
const rootItem = {
|
|
6944
|
+
id: "__root__",
|
|
6945
|
+
name: "Fichiers",
|
|
6946
|
+
type: "folder",
|
|
6947
|
+
path: "/",
|
|
6948
|
+
children: data
|
|
6949
|
+
};
|
|
6950
|
+
const isRootSelected = currentFolder?.id === "__root__";
|
|
6951
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)("div", { className: "h-full overflow-y-auto py-2", children: [
|
|
6952
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
6953
|
+
"div",
|
|
6954
|
+
{
|
|
6955
|
+
className: cn(
|
|
6956
|
+
"flex items-center gap-2 py-1.5 px-3 rounded-lg cursor-pointer transition-colors mb-1",
|
|
6957
|
+
"hover:bg-gray-100 dark:hover:bg-gray-800",
|
|
6958
|
+
isRootSelected && "bg-blue-50 dark:bg-blue-900/30 text-blue-700 dark:text-blue-300"
|
|
6959
|
+
),
|
|
6960
|
+
onClick: () => navigateToFolder(rootItem),
|
|
6961
|
+
children: [
|
|
6962
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_lucide_react9.Folder, { className: "w-4 h-4 text-yellow-500" }),
|
|
6963
|
+
/* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { className: cn("text-sm", isRootSelected && "font-medium"), children: rootItem.name })
|
|
6964
|
+
]
|
|
6965
|
+
}
|
|
6966
|
+
),
|
|
6967
|
+
data.filter((item) => item.type === "folder").map((folder) => /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(FolderTreeItem, { item: folder, level: 1 }, folder.id))
|
|
6968
|
+
] });
|
|
6969
|
+
};
|
|
6970
|
+
|
|
6971
|
+
// src/components/common/FileManager/components/FileGrid.tsx
|
|
6972
|
+
var import_lucide_react11 = require("lucide-react");
|
|
6973
|
+
|
|
6974
|
+
// src/components/common/FileManager/components/FileCard.tsx
|
|
6975
|
+
var import_react16 = require("react");
|
|
6976
|
+
|
|
6977
|
+
// src/components/common/FileManager/utils.ts
|
|
6978
|
+
var import_lucide_react10 = require("lucide-react");
|
|
6979
|
+
var getFileIcon = (mimeType, isFolder, isOpen) => {
|
|
6980
|
+
if (isFolder) {
|
|
6981
|
+
return isOpen ? import_lucide_react10.FolderOpen : import_lucide_react10.Folder;
|
|
6982
|
+
}
|
|
6983
|
+
if (!mimeType) {
|
|
6984
|
+
return import_lucide_react10.File;
|
|
6985
|
+
}
|
|
6986
|
+
const type = mimeType.toLowerCase();
|
|
6987
|
+
if (type.startsWith("image/")) {
|
|
6988
|
+
return import_lucide_react10.FileImage;
|
|
6989
|
+
}
|
|
6990
|
+
if (type === "application/pdf") {
|
|
6991
|
+
return import_lucide_react10.FileText;
|
|
6992
|
+
}
|
|
6993
|
+
if (type === "application/msword" || type === "application/vnd.openxmlformats-officedocument.wordprocessingml.document" || type.includes("word")) {
|
|
6994
|
+
return import_lucide_react10.FileType;
|
|
6995
|
+
}
|
|
6996
|
+
if (type === "application/vnd.ms-excel" || type === "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" || type.includes("excel") || type.includes("spreadsheet")) {
|
|
6997
|
+
return import_lucide_react10.FileSpreadsheet;
|
|
6998
|
+
}
|
|
6999
|
+
if (type === "application/vnd.ms-powerpoint" || type === "application/vnd.openxmlformats-officedocument.presentationml.presentation" || type.includes("powerpoint") || type.includes("presentation")) {
|
|
7000
|
+
return import_lucide_react10.FileType;
|
|
7001
|
+
}
|
|
7002
|
+
if (type === "application/zip" || type === "application/x-rar-compressed" || type === "application/x-7z-compressed" || type === "application/gzip" || type.includes("archive") || type.includes("compressed")) {
|
|
7003
|
+
return import_lucide_react10.FileArchive;
|
|
7004
|
+
}
|
|
7005
|
+
if (type.startsWith("video/")) {
|
|
7006
|
+
return import_lucide_react10.FileVideo;
|
|
7007
|
+
}
|
|
7008
|
+
if (type.startsWith("audio/")) {
|
|
7009
|
+
return import_lucide_react10.FileAudio;
|
|
7010
|
+
}
|
|
7011
|
+
if (type.includes("javascript") || type.includes("typescript") || type.includes("json") || type.includes("xml") || type.includes("html") || type.includes("css")) {
|
|
7012
|
+
return import_lucide_react10.FileCode;
|
|
7013
|
+
}
|
|
7014
|
+
if (type.startsWith("text/")) {
|
|
7015
|
+
return import_lucide_react10.FileText;
|
|
7016
|
+
}
|
|
7017
|
+
return import_lucide_react10.File;
|
|
7018
|
+
};
|
|
7019
|
+
var formatFileSize = (bytes) => {
|
|
7020
|
+
if (bytes === void 0 || bytes === null) {
|
|
7021
|
+
return "-";
|
|
7022
|
+
}
|
|
7023
|
+
if (bytes === 0) {
|
|
7024
|
+
return "0 B";
|
|
7025
|
+
}
|
|
7026
|
+
const units = ["B", "KB", "MB", "GB", "TB"];
|
|
7027
|
+
const k = 1024;
|
|
7028
|
+
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
7029
|
+
return `${parseFloat((bytes / Math.pow(k, i)).toFixed(1))} ${units[i]}`;
|
|
7030
|
+
};
|
|
7031
|
+
var formatDate = (date) => {
|
|
7032
|
+
if (!date) {
|
|
7033
|
+
return "-";
|
|
7034
|
+
}
|
|
7035
|
+
const d = typeof date === "string" ? new Date(date) : date;
|
|
7036
|
+
if (isNaN(d.getTime())) {
|
|
7037
|
+
return "-";
|
|
7038
|
+
}
|
|
7039
|
+
return d.toLocaleDateString("fr-FR", {
|
|
7040
|
+
day: "2-digit",
|
|
7041
|
+
month: "2-digit",
|
|
7042
|
+
year: "numeric"
|
|
7043
|
+
});
|
|
7044
|
+
};
|
|
7045
|
+
|
|
7046
|
+
// src/components/common/FileManager/components/FileCard.tsx
|
|
7047
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
7048
|
+
var FileCard = ({ item, variant = "grid" }) => {
|
|
7049
|
+
const {
|
|
7050
|
+
selectedItems,
|
|
7051
|
+
selectItem,
|
|
7052
|
+
navigateToFolder,
|
|
7053
|
+
showContextMenu,
|
|
7054
|
+
renamingItem,
|
|
7055
|
+
stopRenaming,
|
|
7056
|
+
onRename,
|
|
7057
|
+
onOpen,
|
|
7058
|
+
onDownload,
|
|
7059
|
+
allowRename
|
|
7060
|
+
} = useFileManager();
|
|
7061
|
+
const [renameValue, setRenameValue] = (0, import_react16.useState)(item.name);
|
|
7062
|
+
const inputRef = (0, import_react16.useRef)(null);
|
|
7063
|
+
const isSelected = selectedItems.some((i) => i.id === item.id);
|
|
7064
|
+
const isRenaming = renamingItem?.id === item.id;
|
|
7065
|
+
const isFolder = item.type === "folder";
|
|
7066
|
+
const Icon = getFileIcon(item.mimeType, isFolder);
|
|
7067
|
+
(0, import_react16.useEffect)(() => {
|
|
7068
|
+
if (isRenaming && inputRef.current) {
|
|
7069
|
+
inputRef.current.focus();
|
|
7070
|
+
inputRef.current.select();
|
|
7071
|
+
}
|
|
7072
|
+
}, [isRenaming]);
|
|
7073
|
+
(0, import_react16.useEffect)(() => {
|
|
7074
|
+
setRenameValue(item.name);
|
|
7075
|
+
}, [item.name]);
|
|
7076
|
+
const handleClick = (e) => {
|
|
7077
|
+
e.stopPropagation();
|
|
7078
|
+
selectItem(item, e.ctrlKey || e.metaKey);
|
|
7079
|
+
};
|
|
7080
|
+
const handleDoubleClick = (e) => {
|
|
7081
|
+
e.stopPropagation();
|
|
7082
|
+
if (isFolder) {
|
|
7083
|
+
navigateToFolder(item);
|
|
7084
|
+
} else {
|
|
7085
|
+
if (onOpen) {
|
|
7086
|
+
onOpen(item);
|
|
7087
|
+
} else if (onDownload) {
|
|
7088
|
+
onDownload(item);
|
|
7089
|
+
}
|
|
7090
|
+
}
|
|
7091
|
+
};
|
|
7092
|
+
const handleContextMenu = (e) => {
|
|
7093
|
+
e.preventDefault();
|
|
7094
|
+
e.stopPropagation();
|
|
7095
|
+
showContextMenu(item, { x: e.clientX, y: e.clientY });
|
|
7096
|
+
};
|
|
7097
|
+
const handleRenameSubmit = async () => {
|
|
7098
|
+
if (renameValue.trim() && renameValue !== item.name && onRename && allowRename) {
|
|
7099
|
+
try {
|
|
7100
|
+
await onRename(item, renameValue.trim());
|
|
7101
|
+
} catch (error) {
|
|
7102
|
+
setRenameValue(item.name);
|
|
7103
|
+
}
|
|
7104
|
+
} else {
|
|
7105
|
+
setRenameValue(item.name);
|
|
7106
|
+
}
|
|
7107
|
+
stopRenaming();
|
|
7108
|
+
};
|
|
7109
|
+
const handleRenameKeyDown = (e) => {
|
|
7110
|
+
if (e.key === "Enter") {
|
|
7111
|
+
handleRenameSubmit();
|
|
7112
|
+
} else if (e.key === "Escape") {
|
|
7113
|
+
setRenameValue(item.name);
|
|
7114
|
+
stopRenaming();
|
|
7115
|
+
}
|
|
7116
|
+
};
|
|
7117
|
+
if (variant === "list") {
|
|
7118
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
7119
|
+
"div",
|
|
7120
|
+
{
|
|
7121
|
+
className: cn(
|
|
7122
|
+
"flex items-center gap-3 px-3 py-2 rounded-lg cursor-pointer transition-all duration-200",
|
|
7123
|
+
"hover:bg-gray-100 dark:hover:bg-gray-800",
|
|
7124
|
+
isSelected && "bg-blue-50 dark:bg-blue-900/30 ring-1 ring-blue-500"
|
|
7125
|
+
),
|
|
7126
|
+
onClick: handleClick,
|
|
7127
|
+
onDoubleClick: handleDoubleClick,
|
|
7128
|
+
onContextMenu: handleContextMenu,
|
|
7129
|
+
children: [
|
|
7130
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
7131
|
+
Icon,
|
|
7132
|
+
{
|
|
7133
|
+
className: cn(
|
|
7134
|
+
"w-5 h-5 flex-shrink-0",
|
|
7135
|
+
isFolder ? "text-yellow-500" : "text-gray-500 dark:text-gray-400"
|
|
7136
|
+
)
|
|
7137
|
+
}
|
|
7138
|
+
),
|
|
7139
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "flex-1 min-w-0", children: isRenaming ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
7140
|
+
"input",
|
|
7141
|
+
{
|
|
7142
|
+
ref: inputRef,
|
|
7143
|
+
type: "text",
|
|
7144
|
+
value: renameValue,
|
|
7145
|
+
onChange: (e) => setRenameValue(e.target.value),
|
|
7146
|
+
onBlur: handleRenameSubmit,
|
|
7147
|
+
onKeyDown: handleRenameKeyDown,
|
|
7148
|
+
className: "w-full px-2 py-0.5 text-sm border border-blue-500 rounded outline-none bg-white dark:bg-gray-900",
|
|
7149
|
+
onClick: (e) => e.stopPropagation()
|
|
7150
|
+
}
|
|
7151
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "block truncate text-sm text-gray-900 dark:text-gray-100", children: item.name }) }),
|
|
7152
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "text-xs text-gray-500 dark:text-gray-400 w-20 text-right", children: !isFolder && formatFileSize(item.size) }),
|
|
7153
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "text-xs text-gray-500 dark:text-gray-400 w-24 text-right", children: formatDate(item.updatedAt || item.createdAt) })
|
|
7154
|
+
]
|
|
7155
|
+
}
|
|
7156
|
+
);
|
|
7157
|
+
}
|
|
7158
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
|
|
7159
|
+
"div",
|
|
7160
|
+
{
|
|
7161
|
+
className: cn(
|
|
7162
|
+
"flex flex-col items-center p-3 rounded-xl cursor-pointer transition-all duration-200",
|
|
7163
|
+
"hover:bg-gray-100 dark:hover:bg-gray-800",
|
|
7164
|
+
isSelected && "bg-blue-50 dark:bg-blue-900/30 ring-2 ring-blue-500"
|
|
7165
|
+
),
|
|
7166
|
+
onClick: handleClick,
|
|
7167
|
+
onDoubleClick: handleDoubleClick,
|
|
7168
|
+
onContextMenu: handleContextMenu,
|
|
7169
|
+
children: [
|
|
7170
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "w-16 h-16 flex items-center justify-center mb-2", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
7171
|
+
Icon,
|
|
7172
|
+
{
|
|
7173
|
+
className: cn(
|
|
7174
|
+
"w-12 h-12",
|
|
7175
|
+
isFolder ? "text-yellow-500" : "text-gray-500 dark:text-gray-400"
|
|
7176
|
+
)
|
|
7177
|
+
}
|
|
7178
|
+
) }),
|
|
7179
|
+
/* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: "w-full text-center", children: isRenaming ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
7180
|
+
"input",
|
|
7181
|
+
{
|
|
7182
|
+
ref: inputRef,
|
|
7183
|
+
type: "text",
|
|
7184
|
+
value: renameValue,
|
|
7185
|
+
onChange: (e) => setRenameValue(e.target.value),
|
|
7186
|
+
onBlur: handleRenameSubmit,
|
|
7187
|
+
onKeyDown: handleRenameKeyDown,
|
|
7188
|
+
className: "w-full px-2 py-0.5 text-xs border border-blue-500 rounded outline-none text-center bg-white dark:bg-gray-900",
|
|
7189
|
+
onClick: (e) => e.stopPropagation()
|
|
7190
|
+
}
|
|
7191
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "block text-xs text-gray-900 dark:text-gray-100 truncate px-1", children: item.name }) }),
|
|
7192
|
+
!isFolder && /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: "text-[10px] text-gray-500 dark:text-gray-400 mt-1", children: formatFileSize(item.size) })
|
|
7193
|
+
]
|
|
7194
|
+
}
|
|
7195
|
+
);
|
|
7196
|
+
};
|
|
7197
|
+
|
|
7198
|
+
// src/components/common/FileManager/components/FileGrid.tsx
|
|
7199
|
+
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
7200
|
+
var FileGrid = () => {
|
|
7201
|
+
const { currentFolderContents, texts, deselectAll, hideContextMenu } = useFileManager();
|
|
7202
|
+
const sortedItems = [...currentFolderContents].sort((a, b) => {
|
|
7203
|
+
if (a.type === "folder" && b.type !== "folder") return -1;
|
|
7204
|
+
if (a.type !== "folder" && b.type === "folder") return 1;
|
|
7205
|
+
return a.name.localeCompare(b.name);
|
|
7206
|
+
});
|
|
7207
|
+
const handleContainerClick = () => {
|
|
7208
|
+
deselectAll();
|
|
7209
|
+
hideContextMenu();
|
|
7210
|
+
};
|
|
7211
|
+
if (sortedItems.length === 0) {
|
|
7212
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
|
|
7213
|
+
"div",
|
|
7214
|
+
{
|
|
7215
|
+
className: "flex-1 flex flex-col items-center justify-center text-gray-500 dark:text-gray-400 p-8",
|
|
7216
|
+
onClick: handleContainerClick,
|
|
7217
|
+
children: [
|
|
7218
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_lucide_react11.FolderPlus, { className: "w-16 h-16 mb-4 opacity-50" }),
|
|
7219
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { className: "text-lg", children: texts.noFiles }),
|
|
7220
|
+
/* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", { className: "text-sm mt-2", children: texts.dropFilesHere })
|
|
7221
|
+
]
|
|
7222
|
+
}
|
|
7223
|
+
);
|
|
7224
|
+
}
|
|
7225
|
+
return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
|
|
7226
|
+
"div",
|
|
7227
|
+
{
|
|
7228
|
+
className: "flex-1 overflow-y-auto p-4",
|
|
7229
|
+
onClick: handleContainerClick,
|
|
7230
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: "grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 xl:grid-cols-6 gap-2", children: sortedItems.map((item) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(FileCard, { item, variant: "grid" }, item.id)) })
|
|
7231
|
+
}
|
|
7232
|
+
);
|
|
7233
|
+
};
|
|
7234
|
+
|
|
7235
|
+
// src/components/common/FileManager/components/FileList.tsx
|
|
7236
|
+
var import_lucide_react12 = require("lucide-react");
|
|
7237
|
+
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
7238
|
+
var FileList = () => {
|
|
7239
|
+
const { currentFolderContents, texts, deselectAll, hideContextMenu } = useFileManager();
|
|
7240
|
+
const sortedItems = [...currentFolderContents].sort((a, b) => {
|
|
7241
|
+
if (a.type === "folder" && b.type !== "folder") return -1;
|
|
7242
|
+
if (a.type !== "folder" && b.type === "folder") return 1;
|
|
7243
|
+
return a.name.localeCompare(b.name);
|
|
7244
|
+
});
|
|
7245
|
+
const handleContainerClick = () => {
|
|
7246
|
+
deselectAll();
|
|
7247
|
+
hideContextMenu();
|
|
7248
|
+
};
|
|
7249
|
+
if (sortedItems.length === 0) {
|
|
7250
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
7251
|
+
"div",
|
|
7252
|
+
{
|
|
7253
|
+
className: "flex-1 flex flex-col items-center justify-center text-gray-500 dark:text-gray-400 p-8",
|
|
7254
|
+
onClick: handleContainerClick,
|
|
7255
|
+
children: [
|
|
7256
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_lucide_react12.FolderPlus, { className: "w-16 h-16 mb-4 opacity-50" }),
|
|
7257
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "text-lg", children: texts.noFiles }),
|
|
7258
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("p", { className: "text-sm mt-2", children: texts.dropFilesHere })
|
|
7259
|
+
]
|
|
7260
|
+
}
|
|
7261
|
+
);
|
|
7262
|
+
}
|
|
7263
|
+
return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
|
|
7264
|
+
"div",
|
|
7265
|
+
{
|
|
7266
|
+
className: "flex-1 overflow-y-auto p-4",
|
|
7267
|
+
onClick: handleContainerClick,
|
|
7268
|
+
children: [
|
|
7269
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: "flex items-center gap-3 px-3 py-2 text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider border-b border-gray-200 dark:border-gray-700 mb-2", children: [
|
|
7270
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "w-5" }),
|
|
7271
|
+
" ",
|
|
7272
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "flex-1", children: "Nom" }),
|
|
7273
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "w-20 text-right", children: "Taille" }),
|
|
7274
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { className: "w-24 text-right", children: "Modifi\xE9" })
|
|
7275
|
+
] }),
|
|
7276
|
+
/* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: "space-y-1", children: sortedItems.map((item) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(FileCard, { item, variant: "list" }, item.id)) })
|
|
7277
|
+
]
|
|
7278
|
+
}
|
|
7279
|
+
);
|
|
7280
|
+
};
|
|
7281
|
+
|
|
7282
|
+
// src/components/common/FileManager/components/Breadcrumb.tsx
|
|
7283
|
+
var import_react17 = __toESM(require("react"), 1);
|
|
7284
|
+
var import_lucide_react13 = require("lucide-react");
|
|
7285
|
+
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
7286
|
+
var Breadcrumb = () => {
|
|
7287
|
+
const { pathHistory, navigateBack, navigateToPath } = useFileManager();
|
|
7288
|
+
return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: "flex items-center gap-1 px-2 py-2 bg-gray-50 dark:bg-gray-800/50 rounded-lg", children: [
|
|
7289
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
7290
|
+
"button",
|
|
7291
|
+
{
|
|
7292
|
+
onClick: navigateBack,
|
|
7293
|
+
disabled: pathHistory.length <= 1,
|
|
7294
|
+
className: cn(
|
|
7295
|
+
"p-1.5 rounded-md transition-colors",
|
|
7296
|
+
pathHistory.length > 1 ? "hover:bg-gray-200 dark:hover:bg-gray-700 text-gray-700 dark:text-gray-300" : "text-gray-400 dark:text-gray-600 cursor-not-allowed"
|
|
7297
|
+
),
|
|
7298
|
+
title: "Retour",
|
|
7299
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react13.ChevronLeft, { className: "w-4 h-4" })
|
|
7300
|
+
}
|
|
7301
|
+
),
|
|
7302
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: "flex items-center gap-1 overflow-x-auto scrollbar-thin", children: pathHistory.map((folder, index) => /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(import_react17.default.Fragment, { children: [
|
|
7303
|
+
index > 0 && /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_lucide_react13.ChevronRight, { className: "w-4 h-4 text-gray-400 dark:text-gray-600 flex-shrink-0" }),
|
|
7304
|
+
/* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
|
|
7305
|
+
"button",
|
|
7306
|
+
{
|
|
7307
|
+
onClick: () => navigateToPath(index),
|
|
7308
|
+
className: cn(
|
|
7309
|
+
"px-2 py-1 text-sm rounded-md transition-colors whitespace-nowrap",
|
|
7310
|
+
index === pathHistory.length - 1 ? "text-gray-900 dark:text-gray-100 font-medium" : "text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-gray-100 hover:bg-gray-200 dark:hover:bg-gray-700"
|
|
7311
|
+
),
|
|
7312
|
+
children: folder.name
|
|
7313
|
+
}
|
|
7314
|
+
)
|
|
7315
|
+
] }, folder.id)) })
|
|
7316
|
+
] });
|
|
7317
|
+
};
|
|
7318
|
+
|
|
7319
|
+
// src/components/common/FileManager/components/Toolbar.tsx
|
|
7320
|
+
var import_react18 = __toESM(require("react"), 1);
|
|
7321
|
+
var import_lucide_react14 = require("lucide-react");
|
|
7322
|
+
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
7323
|
+
var CreateFolderModal = ({
|
|
7324
|
+
isOpen,
|
|
7325
|
+
onClose,
|
|
7326
|
+
onSubmit,
|
|
7327
|
+
texts
|
|
7328
|
+
}) => {
|
|
7329
|
+
const [folderName, setFolderName] = (0, import_react18.useState)("");
|
|
7330
|
+
const inputRef = (0, import_react18.useRef)(null);
|
|
7331
|
+
import_react18.default.useEffect(() => {
|
|
7332
|
+
if (isOpen && inputRef.current) {
|
|
7333
|
+
inputRef.current.focus();
|
|
7334
|
+
}
|
|
7335
|
+
if (!isOpen) {
|
|
7336
|
+
setFolderName("");
|
|
7337
|
+
}
|
|
7338
|
+
}, [isOpen]);
|
|
7339
|
+
const handleSubmit = (e) => {
|
|
7340
|
+
e.preventDefault();
|
|
7341
|
+
if (folderName.trim()) {
|
|
7342
|
+
onSubmit(folderName.trim());
|
|
7343
|
+
setFolderName("");
|
|
7344
|
+
onClose();
|
|
7345
|
+
}
|
|
7346
|
+
};
|
|
7347
|
+
if (!isOpen) return null;
|
|
7348
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "fixed inset-0 z-50 flex items-center justify-center bg-black/50", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "bg-white dark:bg-gray-900 rounded-xl shadow-xl p-6 w-full max-w-md mx-4", children: [
|
|
7349
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex items-center justify-between mb-4", children: [
|
|
7350
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("h3", { className: "text-lg font-semibold text-gray-900 dark:text-gray-100", children: texts.createFolder }),
|
|
7351
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
7352
|
+
"button",
|
|
7353
|
+
{
|
|
7354
|
+
onClick: onClose,
|
|
7355
|
+
className: "p-1 rounded-md hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors",
|
|
7356
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_lucide_react14.X, { className: "w-5 h-5 text-gray-500" })
|
|
7357
|
+
}
|
|
7358
|
+
)
|
|
7359
|
+
] }),
|
|
7360
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("form", { onSubmit: handleSubmit, children: [
|
|
7361
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-2", children: texts.newFolderName }),
|
|
7362
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
7363
|
+
"input",
|
|
7364
|
+
{
|
|
7365
|
+
ref: inputRef,
|
|
7366
|
+
type: "text",
|
|
7367
|
+
value: folderName,
|
|
7368
|
+
onChange: (e) => setFolderName(e.target.value),
|
|
7369
|
+
className: "w-full px-3 py-2 border border-gray-300 dark:border-gray-700 rounded-lg\r\n bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100\r\n focus:ring-2 focus:ring-blue-500 focus:border-blue-500 outline-none",
|
|
7370
|
+
placeholder: "Nouveau dossier"
|
|
7371
|
+
}
|
|
7372
|
+
),
|
|
7373
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex justify-end gap-3 mt-6", children: [
|
|
7374
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
7375
|
+
"button",
|
|
7376
|
+
{
|
|
7377
|
+
type: "button",
|
|
7378
|
+
onClick: onClose,
|
|
7379
|
+
className: "px-4 py-2 text-sm font-medium text-gray-700 dark:text-gray-300\r\n hover:bg-gray-100 dark:hover:bg-gray-800 rounded-lg transition-colors",
|
|
7380
|
+
children: texts.cancel
|
|
7381
|
+
}
|
|
7382
|
+
),
|
|
7383
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
7384
|
+
"button",
|
|
7385
|
+
{
|
|
7386
|
+
type: "submit",
|
|
7387
|
+
disabled: !folderName.trim(),
|
|
7388
|
+
className: cn(
|
|
7389
|
+
"px-4 py-2 text-sm font-medium text-white rounded-lg transition-colors",
|
|
7390
|
+
folderName.trim() ? "bg-blue-600 hover:bg-blue-700" : "bg-gray-400 cursor-not-allowed"
|
|
7391
|
+
),
|
|
7392
|
+
children: texts.confirm
|
|
7393
|
+
}
|
|
7394
|
+
)
|
|
7395
|
+
] })
|
|
7396
|
+
] })
|
|
7397
|
+
] }) });
|
|
7398
|
+
};
|
|
7399
|
+
var Toolbar = () => {
|
|
7400
|
+
const {
|
|
7401
|
+
currentFolder,
|
|
7402
|
+
selectedItems,
|
|
7403
|
+
viewMode,
|
|
7404
|
+
setViewMode,
|
|
7405
|
+
deselectAll,
|
|
7406
|
+
onCreateFolder,
|
|
7407
|
+
onUploadFiles,
|
|
7408
|
+
allowCreateFolder,
|
|
7409
|
+
allowUpload,
|
|
7410
|
+
texts
|
|
7411
|
+
} = useFileManager();
|
|
7412
|
+
const [showCreateModal, setShowCreateModal] = (0, import_react18.useState)(false);
|
|
7413
|
+
const fileInputRef = (0, import_react18.useRef)(null);
|
|
7414
|
+
const handleCreateFolder = async (name) => {
|
|
7415
|
+
if (onCreateFolder && currentFolder) {
|
|
7416
|
+
try {
|
|
7417
|
+
await onCreateFolder(name, currentFolder.id);
|
|
7418
|
+
} catch (error) {
|
|
7419
|
+
console.error("Create folder failed:", error);
|
|
7420
|
+
}
|
|
7421
|
+
}
|
|
7422
|
+
};
|
|
7423
|
+
const handleUploadClick = () => {
|
|
7424
|
+
fileInputRef.current?.click();
|
|
7425
|
+
};
|
|
7426
|
+
const handleFileChange = async (e) => {
|
|
7427
|
+
const files = e.target.files;
|
|
7428
|
+
if (files && files.length > 0 && onUploadFiles && currentFolder) {
|
|
7429
|
+
try {
|
|
7430
|
+
await onUploadFiles(Array.from(files), currentFolder.id);
|
|
7431
|
+
} catch (error) {
|
|
7432
|
+
console.error("Upload failed:", error);
|
|
7433
|
+
}
|
|
7434
|
+
}
|
|
7435
|
+
if (fileInputRef.current) {
|
|
7436
|
+
fileInputRef.current.value = "";
|
|
7437
|
+
}
|
|
7438
|
+
};
|
|
7439
|
+
return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_jsx_runtime26.Fragment, { children: [
|
|
7440
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex items-center justify-between gap-4 flex-wrap", children: [
|
|
7441
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
7442
|
+
allowCreateFolder && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
7443
|
+
"button",
|
|
7444
|
+
{
|
|
7445
|
+
onClick: () => setShowCreateModal(true),
|
|
7446
|
+
className: cn(
|
|
7447
|
+
"flex items-center gap-2 px-3 py-2 text-sm font-medium rounded-lg transition-colors",
|
|
7448
|
+
"bg-gray-100 dark:bg-gray-800 text-gray-700 dark:text-gray-300",
|
|
7449
|
+
"hover:bg-gray-200 dark:hover:bg-gray-700"
|
|
7450
|
+
),
|
|
7451
|
+
children: [
|
|
7452
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_lucide_react14.FolderPlus, { className: "w-4 h-4" }),
|
|
7453
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "hidden sm:inline", children: texts.createFolder })
|
|
7454
|
+
]
|
|
7455
|
+
}
|
|
7456
|
+
),
|
|
7457
|
+
allowUpload && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_jsx_runtime26.Fragment, { children: [
|
|
7458
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
7459
|
+
"button",
|
|
7460
|
+
{
|
|
7461
|
+
onClick: handleUploadClick,
|
|
7462
|
+
className: cn(
|
|
7463
|
+
"flex items-center gap-2 px-3 py-2 text-sm font-medium rounded-lg transition-colors",
|
|
7464
|
+
"bg-blue-600 text-white hover:bg-blue-700"
|
|
7465
|
+
),
|
|
7466
|
+
children: [
|
|
7467
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_lucide_react14.Upload, { className: "w-4 h-4" }),
|
|
7468
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { className: "hidden sm:inline", children: texts.uploadFiles })
|
|
7469
|
+
]
|
|
7470
|
+
}
|
|
7471
|
+
),
|
|
7472
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
7473
|
+
"input",
|
|
7474
|
+
{
|
|
7475
|
+
ref: fileInputRef,
|
|
7476
|
+
type: "file",
|
|
7477
|
+
multiple: true,
|
|
7478
|
+
onChange: handleFileChange,
|
|
7479
|
+
className: "hidden",
|
|
7480
|
+
accept: ".jpg,.jpeg,.png,.gif,.pdf,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.txt,.csv,.zip,.rar"
|
|
7481
|
+
}
|
|
7482
|
+
)
|
|
7483
|
+
] })
|
|
7484
|
+
] }),
|
|
7485
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
7486
|
+
selectedItems.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(
|
|
7487
|
+
"button",
|
|
7488
|
+
{
|
|
7489
|
+
onClick: deselectAll,
|
|
7490
|
+
className: "flex items-center gap-2 px-3 py-2 text-sm text-gray-600 dark:text-gray-400\r\n hover:text-gray-900 dark:hover:text-gray-100 transition-colors",
|
|
7491
|
+
children: [
|
|
7492
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_lucide_react14.X, { className: "w-4 h-4" }),
|
|
7493
|
+
texts.deselectAll,
|
|
7494
|
+
" (",
|
|
7495
|
+
selectedItems.length,
|
|
7496
|
+
")"
|
|
7497
|
+
]
|
|
7498
|
+
}
|
|
7499
|
+
),
|
|
7500
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: "flex items-center bg-gray-100 dark:bg-gray-800 rounded-lg p-1", children: [
|
|
7501
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
7502
|
+
"button",
|
|
7503
|
+
{
|
|
7504
|
+
onClick: () => setViewMode("grid"),
|
|
7505
|
+
className: cn(
|
|
7506
|
+
"p-1.5 rounded-md transition-colors",
|
|
7507
|
+
viewMode === "grid" ? "bg-white dark:bg-gray-700 shadow-sm text-gray-900 dark:text-gray-100" : "text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200"
|
|
7508
|
+
),
|
|
7509
|
+
title: "Vue grille",
|
|
7510
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_lucide_react14.Grid, { className: "w-4 h-4" })
|
|
7511
|
+
}
|
|
7512
|
+
),
|
|
7513
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
7514
|
+
"button",
|
|
7515
|
+
{
|
|
7516
|
+
onClick: () => setViewMode("list"),
|
|
7517
|
+
className: cn(
|
|
7518
|
+
"p-1.5 rounded-md transition-colors",
|
|
7519
|
+
viewMode === "list" ? "bg-white dark:bg-gray-700 shadow-sm text-gray-900 dark:text-gray-100" : "text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200"
|
|
7520
|
+
),
|
|
7521
|
+
title: "Vue liste",
|
|
7522
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_lucide_react14.List, { className: "w-4 h-4" })
|
|
7523
|
+
}
|
|
7524
|
+
)
|
|
7525
|
+
] })
|
|
7526
|
+
] })
|
|
7527
|
+
] }),
|
|
7528
|
+
/* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
|
|
7529
|
+
CreateFolderModal,
|
|
7530
|
+
{
|
|
7531
|
+
isOpen: showCreateModal,
|
|
7532
|
+
onClose: () => setShowCreateModal(false),
|
|
7533
|
+
onSubmit: handleCreateFolder,
|
|
7534
|
+
texts
|
|
7535
|
+
}
|
|
7536
|
+
)
|
|
7537
|
+
] });
|
|
7538
|
+
};
|
|
7539
|
+
|
|
7540
|
+
// src/components/common/FileManager/components/ContextMenu.tsx
|
|
7541
|
+
var import_react19 = require("react");
|
|
7542
|
+
var import_lucide_react15 = require("lucide-react");
|
|
7543
|
+
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
7544
|
+
var ContextMenu = () => {
|
|
7545
|
+
const {
|
|
7546
|
+
contextMenu,
|
|
7547
|
+
hideContextMenu,
|
|
7548
|
+
navigateToFolder,
|
|
7549
|
+
startRenaming,
|
|
7550
|
+
onDownload,
|
|
7551
|
+
onDelete,
|
|
7552
|
+
onOpen,
|
|
7553
|
+
allowRename,
|
|
7554
|
+
allowDelete,
|
|
7555
|
+
allowDownload,
|
|
7556
|
+
texts
|
|
7557
|
+
} = useFileManager();
|
|
7558
|
+
const menuRef = (0, import_react19.useRef)(null);
|
|
7559
|
+
(0, import_react19.useEffect)(() => {
|
|
7560
|
+
const handleClickOutside = (e) => {
|
|
7561
|
+
if (menuRef.current && !menuRef.current.contains(e.target)) {
|
|
7562
|
+
hideContextMenu();
|
|
7563
|
+
}
|
|
7564
|
+
};
|
|
7565
|
+
const handleEscape = (e) => {
|
|
7566
|
+
if (e.key === "Escape") {
|
|
7567
|
+
hideContextMenu();
|
|
7568
|
+
}
|
|
7569
|
+
};
|
|
7570
|
+
if (contextMenu.visible) {
|
|
7571
|
+
document.addEventListener("mousedown", handleClickOutside);
|
|
7572
|
+
document.addEventListener("keydown", handleEscape);
|
|
7573
|
+
}
|
|
7574
|
+
return () => {
|
|
7575
|
+
document.removeEventListener("mousedown", handleClickOutside);
|
|
7576
|
+
document.removeEventListener("keydown", handleEscape);
|
|
7577
|
+
};
|
|
7578
|
+
}, [contextMenu.visible, hideContextMenu]);
|
|
7579
|
+
if (!contextMenu.visible || !contextMenu.item) {
|
|
7580
|
+
return null;
|
|
7581
|
+
}
|
|
7582
|
+
const { item, position } = contextMenu;
|
|
7583
|
+
const isFolder = item.type === "folder";
|
|
7584
|
+
const handleOpen = () => {
|
|
7585
|
+
if (isFolder) {
|
|
7586
|
+
navigateToFolder(item);
|
|
7587
|
+
} else if (onOpen) {
|
|
7588
|
+
onOpen(item);
|
|
7589
|
+
} else if (onDownload) {
|
|
7590
|
+
onDownload(item);
|
|
7591
|
+
}
|
|
7592
|
+
hideContextMenu();
|
|
7593
|
+
};
|
|
7594
|
+
const handleRename = () => {
|
|
7595
|
+
startRenaming(item);
|
|
7596
|
+
};
|
|
7597
|
+
const handleDownload = () => {
|
|
7598
|
+
if (onDownload) {
|
|
7599
|
+
onDownload(item);
|
|
7600
|
+
}
|
|
7601
|
+
hideContextMenu();
|
|
7602
|
+
};
|
|
7603
|
+
const handleDelete = async () => {
|
|
7604
|
+
if (onDelete) {
|
|
7605
|
+
try {
|
|
7606
|
+
await onDelete(item);
|
|
7607
|
+
} catch (error) {
|
|
7608
|
+
console.error("Delete failed:", error);
|
|
7609
|
+
}
|
|
7610
|
+
}
|
|
7611
|
+
hideContextMenu();
|
|
7612
|
+
};
|
|
7613
|
+
const menuStyle = {
|
|
7614
|
+
position: "fixed",
|
|
7615
|
+
top: position.y,
|
|
7616
|
+
left: position.x,
|
|
7617
|
+
zIndex: 9999
|
|
7618
|
+
};
|
|
7619
|
+
if (typeof window !== "undefined") {
|
|
7620
|
+
const menuWidth = 180;
|
|
7621
|
+
const menuHeight = 200;
|
|
7622
|
+
if (position.x + menuWidth > window.innerWidth) {
|
|
7623
|
+
menuStyle.left = position.x - menuWidth;
|
|
7624
|
+
}
|
|
7625
|
+
if (position.y + menuHeight > window.innerHeight) {
|
|
7626
|
+
menuStyle.top = position.y - menuHeight;
|
|
7627
|
+
}
|
|
7628
|
+
}
|
|
7629
|
+
return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
7630
|
+
"div",
|
|
7631
|
+
{
|
|
7632
|
+
ref: menuRef,
|
|
7633
|
+
style: menuStyle,
|
|
7634
|
+
className: "bg-white dark:bg-gray-900 rounded-lg shadow-lg border border-gray-200 dark:border-gray-700 py-1 min-w-[160px]",
|
|
7635
|
+
children: [
|
|
7636
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
7637
|
+
"button",
|
|
7638
|
+
{
|
|
7639
|
+
onClick: handleOpen,
|
|
7640
|
+
className: cn(
|
|
7641
|
+
"w-full flex items-center gap-3 px-4 py-2 text-sm text-left",
|
|
7642
|
+
"text-gray-700 dark:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors"
|
|
7643
|
+
),
|
|
7644
|
+
children: [
|
|
7645
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react15.FolderOpen, { className: "w-4 h-4" }),
|
|
7646
|
+
texts.open
|
|
7647
|
+
]
|
|
7648
|
+
}
|
|
7649
|
+
),
|
|
7650
|
+
allowRename && /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
7651
|
+
"button",
|
|
7652
|
+
{
|
|
7653
|
+
onClick: handleRename,
|
|
7654
|
+
className: cn(
|
|
7655
|
+
"w-full flex items-center gap-3 px-4 py-2 text-sm text-left",
|
|
7656
|
+
"text-gray-700 dark:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors"
|
|
7657
|
+
),
|
|
7658
|
+
children: [
|
|
7659
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react15.Edit3, { className: "w-4 h-4" }),
|
|
7660
|
+
texts.rename
|
|
7661
|
+
]
|
|
7662
|
+
}
|
|
7663
|
+
),
|
|
7664
|
+
allowDownload && /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
7665
|
+
"button",
|
|
7666
|
+
{
|
|
7667
|
+
onClick: handleDownload,
|
|
7668
|
+
className: cn(
|
|
7669
|
+
"w-full flex items-center gap-3 px-4 py-2 text-sm text-left",
|
|
7670
|
+
"text-gray-700 dark:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors"
|
|
7671
|
+
),
|
|
7672
|
+
children: [
|
|
7673
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react15.Download, { className: "w-4 h-4" }),
|
|
7674
|
+
texts.download
|
|
7675
|
+
]
|
|
7676
|
+
}
|
|
7677
|
+
),
|
|
7678
|
+
allowDelete && /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_jsx_runtime27.Fragment, { children: [
|
|
7679
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)("div", { className: "border-t border-gray-200 dark:border-gray-700 my-1" }),
|
|
7680
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
|
|
7681
|
+
"button",
|
|
7682
|
+
{
|
|
7683
|
+
onClick: handleDelete,
|
|
7684
|
+
className: cn(
|
|
7685
|
+
"w-full flex items-center gap-3 px-4 py-2 text-sm text-left",
|
|
7686
|
+
"text-red-600 dark:text-red-400 hover:bg-red-50 dark:hover:bg-red-900/20 transition-colors"
|
|
7687
|
+
),
|
|
7688
|
+
children: [
|
|
7689
|
+
/* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_lucide_react15.Trash2, { className: "w-4 h-4" }),
|
|
7690
|
+
texts.delete
|
|
7691
|
+
]
|
|
7692
|
+
}
|
|
7693
|
+
)
|
|
7694
|
+
] })
|
|
7695
|
+
]
|
|
7696
|
+
}
|
|
7697
|
+
);
|
|
7698
|
+
};
|
|
7699
|
+
|
|
7700
|
+
// src/components/common/FileManager/FileManager.tsx
|
|
7701
|
+
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
7702
|
+
var FileManagerContent = ({ className }) => {
|
|
7703
|
+
const { viewMode, hideContextMenu } = useFileManager();
|
|
7704
|
+
const [sidebarOpen, setSidebarOpen] = (0, import_react20.useState)(false);
|
|
7705
|
+
const handleMainClick = () => {
|
|
7706
|
+
hideContextMenu();
|
|
7707
|
+
};
|
|
7708
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
7709
|
+
"div",
|
|
7710
|
+
{
|
|
7711
|
+
className: cn(
|
|
7712
|
+
"flex h-full bg-white dark:bg-gray-900 rounded-xl border border-gray-200 dark:border-gray-800 overflow-hidden",
|
|
7713
|
+
className
|
|
7714
|
+
),
|
|
7715
|
+
onClick: handleMainClick,
|
|
7716
|
+
children: [
|
|
7717
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
7718
|
+
"button",
|
|
7719
|
+
{
|
|
7720
|
+
onClick: (e) => {
|
|
7721
|
+
e.stopPropagation();
|
|
7722
|
+
setSidebarOpen(!sidebarOpen);
|
|
7723
|
+
},
|
|
7724
|
+
className: "md:hidden fixed bottom-4 left-4 z-50 p-3 bg-blue-600 text-white rounded-full shadow-lg hover:bg-blue-700 transition-colors",
|
|
7725
|
+
children: sidebarOpen ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_lucide_react16.X, { className: "w-6 h-6" }) : /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_lucide_react16.Menu, { className: "w-6 h-6" })
|
|
7726
|
+
}
|
|
7727
|
+
),
|
|
7728
|
+
sidebarOpen && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
|
|
7729
|
+
"div",
|
|
7730
|
+
{
|
|
7731
|
+
className: "md:hidden fixed inset-0 bg-black/50 z-40",
|
|
7732
|
+
onClick: () => setSidebarOpen(false)
|
|
7733
|
+
}
|
|
7734
|
+
),
|
|
7735
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
|
|
7736
|
+
"aside",
|
|
7737
|
+
{
|
|
7738
|
+
className: cn(
|
|
7739
|
+
"w-64 border-r border-gray-200 dark:border-gray-800 bg-gray-50 dark:bg-gray-900/50 flex-shrink-0",
|
|
7740
|
+
"md:relative md:translate-x-0",
|
|
7741
|
+
"fixed inset-y-0 left-0 z-50 transition-transform duration-300",
|
|
7742
|
+
sidebarOpen ? "translate-x-0" : "-translate-x-full md:translate-x-0"
|
|
7743
|
+
),
|
|
7744
|
+
children: [
|
|
7745
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "p-3 border-b border-gray-200 dark:border-gray-800", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("h2", { className: "text-sm font-semibold text-gray-900 dark:text-gray-100", children: "Dossiers" }) }),
|
|
7746
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(FolderTree, {})
|
|
7747
|
+
]
|
|
7748
|
+
}
|
|
7749
|
+
),
|
|
7750
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("main", { className: "flex-1 flex flex-col min-w-0", children: [
|
|
7751
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("header", { className: "p-4 border-b border-gray-200 dark:border-gray-800 space-y-3", children: [
|
|
7752
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Toolbar, {}),
|
|
7753
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Breadcrumb, {})
|
|
7754
|
+
] }),
|
|
7755
|
+
viewMode === "grid" ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(FileGrid, {}) : /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(FileList, {})
|
|
7756
|
+
] }),
|
|
7757
|
+
/* @__PURE__ */ (0, import_jsx_runtime28.jsx)(ContextMenu, {})
|
|
7758
|
+
]
|
|
7759
|
+
}
|
|
7760
|
+
);
|
|
7761
|
+
};
|
|
7762
|
+
var FileManager = (props) => {
|
|
7763
|
+
return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(FileManagerProvider, { ...props, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(FileManagerContent, { className: props.className }) });
|
|
7764
|
+
};
|
|
6653
7765
|
// Annotate the CommonJS export names for ESM import in node:
|
|
6654
7766
|
0 && (module.exports = {
|
|
6655
7767
|
Alert,
|
|
@@ -6666,6 +7778,8 @@ var CountrySelector = ({
|
|
|
6666
7778
|
FDrawer,
|
|
6667
7779
|
FetchApi,
|
|
6668
7780
|
FileInput,
|
|
7781
|
+
FileManager,
|
|
7782
|
+
FileManagerProvider,
|
|
6669
7783
|
ForeignCurrencySelector,
|
|
6670
7784
|
InputField,
|
|
6671
7785
|
InvoiceTypeSelector,
|
|
@@ -6690,7 +7804,11 @@ var CountrySelector = ({
|
|
|
6690
7804
|
ToastContainer,
|
|
6691
7805
|
ToastProvider,
|
|
6692
7806
|
UserServices,
|
|
7807
|
+
formatDate,
|
|
7808
|
+
formatFileSize,
|
|
7809
|
+
getFileIcon,
|
|
6693
7810
|
useAlert,
|
|
7811
|
+
useFileManager,
|
|
6694
7812
|
useSession,
|
|
6695
7813
|
useToast
|
|
6696
7814
|
});
|