ptechcore_ui 1.0.18 → 1.0.20
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/accountingblanc-HXO7ZL5C.svg +1 -0
- package/dist/accountingblue-KJT2COTJ.svg +1 -0
- package/dist/assetblanc-G4JYFDCR.svg +1 -0
- package/dist/assetblue-QVU5HCMT.svg +1 -0
- package/dist/collection_litigationblanc-7NRNT2NJ.svg +1 -0
- package/dist/collection_litigationblue-UNGB33BF.svg +1 -0
- package/dist/crm-blue-5IUN7OWK.svg +1 -0
- package/dist/crmwhite-T4YVRCBY.svg +1 -0
- package/dist/facilityblanc-X2W5XOZF.svg +1 -0
- package/dist/facilityblue-OSJ76HN4.svg +1 -0
- package/dist/financeblanc-FFBP6VCU.svg +1 -0
- package/dist/financeblue-C6ARC7XB.svg +1 -0
- package/dist/human_capitalblanc-44P3SKKG.svg +1 -0
- package/dist/human_capitalblue-IGF53KXL.svg +1 -0
- package/dist/index.cjs +1854 -310
- package/dist/index.d.cts +334 -39
- package/dist/index.d.ts +334 -39
- package/dist/index.js +2029 -443
- package/dist/invoicingblanc-OG4REEEI.svg +1 -0
- package/dist/invoicingblue-PGDRJHUT.svg +1 -0
- package/dist/marketingblanc-VGLH2RYX.svg +1 -0
- package/dist/marketingblue-M22Q2RVP.svg +1 -0
- package/dist/procurementblanc-C3K6S2GP.svg +1 -0
- package/dist/procurementblue-KXLG2CW4.svg +1 -0
- package/dist/security_managementblanc-44CBK332.svg +1 -0
- package/dist/security_managementblue-KPYN5QPS.svg +1 -0
- package/dist/sopblancs-LQYRWDFF.svg +1 -0
- package/dist/sopblues-MKSGDFK2.svg +1 -0
- package/dist/thriveblanc-C7YX45XG.svg +1 -0
- package/dist/thriveblue-MFDIWYWF.svg +1 -0
- package/dist/wiseblancs-W2M4CRXV.svg +1 -0
- package/dist/wiseblues-MMOO253P.svg +1 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -34,7 +34,9 @@ __export(index_exports, {
|
|
|
34
34
|
ApprovalAnswerModal: () => ApprovalAnswerModal,
|
|
35
35
|
ApprovalAnswerPage: () => ApprovalAnswerPage,
|
|
36
36
|
ApprovalPreviewAnswer: () => ApprovalPreviewAnswer_default,
|
|
37
|
+
ApprovalServices: () => ApprovalServices,
|
|
37
38
|
ApprovalWorkflow: () => ApprovalWorkflow_default,
|
|
39
|
+
AuthServices: () => AuthServices,
|
|
38
40
|
CHOICES: () => Choices_default,
|
|
39
41
|
CountrySelector: () => CountrySelector,
|
|
40
42
|
DateInput: () => DateInput,
|
|
@@ -108,10 +110,10 @@ var Buttons_default = PrimaryButton;
|
|
|
108
110
|
|
|
109
111
|
// src/components/common/Modals.tsx
|
|
110
112
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
111
|
-
var Modal = ({ title, description, width, open, onClose, children }) => {
|
|
113
|
+
var Modal = ({ title, description, width = "max-w-lg", open, onClose, children }) => {
|
|
112
114
|
if (!open) return null;
|
|
113
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: `bg-white
|
|
114
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "flex
|
|
115
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: `bg-white rounded-lg p-6 mx-4 w-full ${width}`, children: [
|
|
116
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "flex justify-between items-start mb-6", children: [
|
|
115
117
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { children: [
|
|
116
118
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("h3", { className: "text-xl font-semibold text-tuatara flex items-center space-x-2", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { children: title }) }),
|
|
117
119
|
description && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { className: "text-sm text-gray-600 mt-1", children: description })
|
|
@@ -126,7 +128,7 @@ var Modal = ({ title, description, width, open, onClose, children }) => {
|
|
|
126
128
|
}
|
|
127
129
|
)
|
|
128
130
|
] }),
|
|
129
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "w-full max-h-[80vh] overflow-y-auto
|
|
131
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "w-full max-h-[80vh] overflow-y-auto", children })
|
|
130
132
|
] }) });
|
|
131
133
|
};
|
|
132
134
|
var Modals_default = Modal;
|
|
@@ -289,7 +291,91 @@ var FileInput = ({
|
|
|
289
291
|
// src/components/layout/ModernDoubleSidebarLayout.tsx
|
|
290
292
|
var import_react5 = __toESM(require("react"), 1);
|
|
291
293
|
var import_react_router_dom3 = require("react-router-dom");
|
|
292
|
-
var
|
|
294
|
+
var import_lucide_react3 = require("lucide-react");
|
|
295
|
+
|
|
296
|
+
// src/assets/modules-icons/crm-blue.svg
|
|
297
|
+
var crm_blue_default = "./crm-blue-5IUN7OWK.svg";
|
|
298
|
+
|
|
299
|
+
// src/assets/modules-icons/crmwhite.svg
|
|
300
|
+
var crmwhite_default = "./crmwhite-T4YVRCBY.svg";
|
|
301
|
+
|
|
302
|
+
// src/assets/modules-icons/marketingblue.svg
|
|
303
|
+
var marketingblue_default = "./marketingblue-M22Q2RVP.svg";
|
|
304
|
+
|
|
305
|
+
// src/assets/modules-icons/marketingblanc.svg
|
|
306
|
+
var marketingblanc_default = "./marketingblanc-VGLH2RYX.svg";
|
|
307
|
+
|
|
308
|
+
// src/assets/modules-icons/facilityblue.svg
|
|
309
|
+
var facilityblue_default = "./facilityblue-OSJ76HN4.svg";
|
|
310
|
+
|
|
311
|
+
// src/assets/modules-icons/facilityblanc.svg
|
|
312
|
+
var facilityblanc_default = "./facilityblanc-X2W5XOZF.svg";
|
|
313
|
+
|
|
314
|
+
// src/assets/modules-icons/security_managementblue.svg
|
|
315
|
+
var security_managementblue_default = "./security_managementblue-KPYN5QPS.svg";
|
|
316
|
+
|
|
317
|
+
// src/assets/modules-icons/security_managementblanc.svg
|
|
318
|
+
var security_managementblanc_default = "./security_managementblanc-44CBK332.svg";
|
|
319
|
+
|
|
320
|
+
// src/assets/modules-icons/thriveblue.svg
|
|
321
|
+
var thriveblue_default = "./thriveblue-MFDIWYWF.svg";
|
|
322
|
+
|
|
323
|
+
// src/assets/modules-icons/thriveblanc.svg
|
|
324
|
+
var thriveblanc_default = "./thriveblanc-C7YX45XG.svg";
|
|
325
|
+
|
|
326
|
+
// src/assets/modules-icons/wiseblues.svg
|
|
327
|
+
var wiseblues_default = "./wiseblues-MMOO253P.svg";
|
|
328
|
+
|
|
329
|
+
// src/assets/modules-icons/wiseblancs.svg
|
|
330
|
+
var wiseblancs_default = "./wiseblancs-W2M4CRXV.svg";
|
|
331
|
+
|
|
332
|
+
// src/assets/modules-icons/sopblues.svg
|
|
333
|
+
var sopblues_default = "./sopblues-MKSGDFK2.svg";
|
|
334
|
+
|
|
335
|
+
// src/assets/modules-icons/sopblancs.svg
|
|
336
|
+
var sopblancs_default = "./sopblancs-LQYRWDFF.svg";
|
|
337
|
+
|
|
338
|
+
// src/assets/modules-icons/invoicingblue.svg
|
|
339
|
+
var invoicingblue_default = "./invoicingblue-PGDRJHUT.svg";
|
|
340
|
+
|
|
341
|
+
// src/assets/modules-icons/invoicingblanc.svg
|
|
342
|
+
var invoicingblanc_default = "./invoicingblanc-OG4REEEI.svg";
|
|
343
|
+
|
|
344
|
+
// src/assets/modules-icons/accountingblue.svg
|
|
345
|
+
var accountingblue_default = "./accountingblue-KJT2COTJ.svg";
|
|
346
|
+
|
|
347
|
+
// src/assets/modules-icons/accountingblanc.svg
|
|
348
|
+
var accountingblanc_default = "./accountingblanc-HXO7ZL5C.svg";
|
|
349
|
+
|
|
350
|
+
// src/assets/modules-icons/assetblue.svg
|
|
351
|
+
var assetblue_default = "./assetblue-QVU5HCMT.svg";
|
|
352
|
+
|
|
353
|
+
// src/assets/modules-icons/assetblanc.svg
|
|
354
|
+
var assetblanc_default = "./assetblanc-G4JYFDCR.svg";
|
|
355
|
+
|
|
356
|
+
// src/assets/modules-icons/financeblue.svg
|
|
357
|
+
var financeblue_default = "./financeblue-C6ARC7XB.svg";
|
|
358
|
+
|
|
359
|
+
// src/assets/modules-icons/financeblanc.svg
|
|
360
|
+
var financeblanc_default = "./financeblanc-FFBP6VCU.svg";
|
|
361
|
+
|
|
362
|
+
// src/assets/modules-icons/collection_litigationblue.svg
|
|
363
|
+
var collection_litigationblue_default = "./collection_litigationblue-UNGB33BF.svg";
|
|
364
|
+
|
|
365
|
+
// src/assets/modules-icons/collection_litigationblanc.svg
|
|
366
|
+
var collection_litigationblanc_default = "./collection_litigationblanc-7NRNT2NJ.svg";
|
|
367
|
+
|
|
368
|
+
// src/assets/modules-icons/procurementblue.svg
|
|
369
|
+
var procurementblue_default = "./procurementblue-KXLG2CW4.svg";
|
|
370
|
+
|
|
371
|
+
// src/assets/modules-icons/procurementblanc.svg
|
|
372
|
+
var procurementblanc_default = "./procurementblanc-C3K6S2GP.svg";
|
|
373
|
+
|
|
374
|
+
// src/assets/modules-icons/human_capitalblue.svg
|
|
375
|
+
var human_capitalblue_default = "./human_capitalblue-IGF53KXL.svg";
|
|
376
|
+
|
|
377
|
+
// src/assets/modules-icons/human_capitalblanc.svg
|
|
378
|
+
var human_capitalblanc_default = "./human_capitalblanc-44P3SKKG.svg";
|
|
293
379
|
|
|
294
380
|
// src/utils/utils.ts
|
|
295
381
|
var import_clsx = require("clsx");
|
|
@@ -750,6 +836,28 @@ var AuthServices = {
|
|
|
750
836
|
logout: () => FetchApi.post(`${API_BASE_URL}logout/`)
|
|
751
837
|
};
|
|
752
838
|
|
|
839
|
+
// src/services/VendorServices.ts
|
|
840
|
+
var VENDORS_API_URL = `${API_URL}/accounting/vendors/`;
|
|
841
|
+
var VendorServices = {
|
|
842
|
+
createVendor: (data, token) => {
|
|
843
|
+
const payload = { ...data };
|
|
844
|
+
if (!payload.logo) {
|
|
845
|
+
delete payload.logo;
|
|
846
|
+
}
|
|
847
|
+
return FetchApi.post(`${VENDORS_API_URL}`, payload, token);
|
|
848
|
+
},
|
|
849
|
+
getVendor: (id, token) => FetchApi.get(`${VENDORS_API_URL}${id}/`, token),
|
|
850
|
+
getVendors: (token, params) => FetchApi.get(`${VENDORS_API_URL}?${new URLSearchParams(params).toString()}`, token),
|
|
851
|
+
updateVendor: (id, data, token) => {
|
|
852
|
+
const payload = { ...data };
|
|
853
|
+
if (!payload.logo) {
|
|
854
|
+
delete payload.logo;
|
|
855
|
+
}
|
|
856
|
+
return FetchApi.put(`${VENDORS_API_URL}${id}/`, payload, token);
|
|
857
|
+
},
|
|
858
|
+
deleteVendor: (id, token) => FetchApi.delete(`${VENDORS_API_URL}${id}/`, token)
|
|
859
|
+
};
|
|
860
|
+
|
|
753
861
|
// src/contexts/SessionContext.tsx
|
|
754
862
|
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
755
863
|
var SessionContext = (0, import_react2.createContext)(void 0);
|
|
@@ -767,6 +875,47 @@ var SessionProvider = ({ children }) => {
|
|
|
767
875
|
const saved_center_id = localStorage.getItem("active_center_id") || "";
|
|
768
876
|
const [isLoading, setIsLoading] = (0, import_react2.useState)(true);
|
|
769
877
|
const [showAuthModal, setShowAuthModal] = (0, import_react2.useState)(false);
|
|
878
|
+
(0, import_react2.useEffect)(() => {
|
|
879
|
+
const params = new URLSearchParams(window.location.search);
|
|
880
|
+
const tkn = params.get("tkn");
|
|
881
|
+
if (tkn) {
|
|
882
|
+
localStorage.setItem("token", tkn);
|
|
883
|
+
setToken(tkn);
|
|
884
|
+
window.history.replaceState({}, document.title, window.location.pathname);
|
|
885
|
+
}
|
|
886
|
+
}, []);
|
|
887
|
+
const [vendors, setVendors] = (0, import_react2.useState)(() => {
|
|
888
|
+
const cacheKey = `vendors_cache_${activeBusinessEntity?.id || "default"}`;
|
|
889
|
+
const cached = sessionStorage.getItem(cacheKey);
|
|
890
|
+
return cached ? JSON.parse(cached) : [];
|
|
891
|
+
});
|
|
892
|
+
const [loadingVendors, setLoadingVendors] = (0, import_react2.useState)(false);
|
|
893
|
+
const loadVendors = async () => {
|
|
894
|
+
if (!token) {
|
|
895
|
+
console.error("Vous devez etre connect\xE9 pour voir les organisations");
|
|
896
|
+
return;
|
|
897
|
+
}
|
|
898
|
+
try {
|
|
899
|
+
setLoadingVendors(true);
|
|
900
|
+
const result = await VendorServices.getVendors(token, { business_entity_id: activeBusinessEntity?.id });
|
|
901
|
+
setVendors(result.data);
|
|
902
|
+
const cacheKey = `vendors_cache_${activeBusinessEntity?.id || "default"}`;
|
|
903
|
+
sessionStorage.setItem(cacheKey, JSON.stringify(result.data));
|
|
904
|
+
} catch (error) {
|
|
905
|
+
console.error(error);
|
|
906
|
+
} finally {
|
|
907
|
+
setLoadingVendors(false);
|
|
908
|
+
}
|
|
909
|
+
};
|
|
910
|
+
(0, import_react2.useEffect)(() => {
|
|
911
|
+
const cacheKey = `vendors_cache_${activeBusinessEntity?.id || "default"}`;
|
|
912
|
+
const cached = sessionStorage.getItem(cacheKey);
|
|
913
|
+
if (!cached) {
|
|
914
|
+
loadVendors();
|
|
915
|
+
} else {
|
|
916
|
+
setVendors(JSON.parse(cached));
|
|
917
|
+
}
|
|
918
|
+
}, [activeBusinessEntity?.id]);
|
|
770
919
|
(0, import_react2.useEffect)(() => {
|
|
771
920
|
const storedToken = localStorage.getItem("token");
|
|
772
921
|
if (storedToken) {
|
|
@@ -786,6 +935,7 @@ var SessionProvider = ({ children }) => {
|
|
|
786
935
|
AuthServices.getUserInformations(token).then((res) => {
|
|
787
936
|
const result = res;
|
|
788
937
|
if (result.success === true) {
|
|
938
|
+
console.log("USER LOGGED", result.data.user);
|
|
789
939
|
setLoggedUser(result.data.user);
|
|
790
940
|
setActiveBusinessEntity(result.data.user.centers_access.find((item) => parseInt(item.id) === parseInt(saved_center_id)) || result.data.user.centers_access[0] || null);
|
|
791
941
|
} else {
|
|
@@ -810,7 +960,12 @@ var SessionProvider = ({ children }) => {
|
|
|
810
960
|
login,
|
|
811
961
|
logout,
|
|
812
962
|
showAuthModal,
|
|
813
|
-
setShowAuthModal
|
|
963
|
+
setShowAuthModal,
|
|
964
|
+
vendors,
|
|
965
|
+
setVendors,
|
|
966
|
+
loadingVendors,
|
|
967
|
+
setLoadingVendors,
|
|
968
|
+
loadVendors
|
|
814
969
|
}, children });
|
|
815
970
|
};
|
|
816
971
|
|
|
@@ -843,6 +998,7 @@ var UserServices = {
|
|
|
843
998
|
|
|
844
999
|
// src/contexts/ToastContext.tsx
|
|
845
1000
|
var import_react3 = require("react");
|
|
1001
|
+
var import_lucide_react = require("lucide-react");
|
|
846
1002
|
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
847
1003
|
var ToastContext = (0, import_react3.createContext)(void 0);
|
|
848
1004
|
var useToast = () => {
|
|
@@ -854,6 +1010,11 @@ var useToast = () => {
|
|
|
854
1010
|
};
|
|
855
1011
|
var ToastProvider = ({ children }) => {
|
|
856
1012
|
const [toasts, setToasts] = (0, import_react3.useState)([]);
|
|
1013
|
+
const [confirmState, setConfirmState] = (0, import_react3.useState)({
|
|
1014
|
+
isOpen: false,
|
|
1015
|
+
options: null,
|
|
1016
|
+
resolve: null
|
|
1017
|
+
});
|
|
857
1018
|
const generateId = () => {
|
|
858
1019
|
return Date.now().toString(36) + Math.random().toString(36).substr(2);
|
|
859
1020
|
};
|
|
@@ -886,6 +1047,26 @@ var ToastProvider = ({ children }) => {
|
|
|
886
1047
|
const info = (0, import_react3.useCallback)((message, duration) => {
|
|
887
1048
|
addToast({ message, type: "info", duration });
|
|
888
1049
|
}, [addToast]);
|
|
1050
|
+
const confirm2 = (0, import_react3.useCallback)((options) => {
|
|
1051
|
+
return new Promise((resolve) => {
|
|
1052
|
+
const normalizedOptions = typeof options === "string" ? { message: options } : options;
|
|
1053
|
+
setConfirmState({
|
|
1054
|
+
isOpen: true,
|
|
1055
|
+
options: normalizedOptions,
|
|
1056
|
+
resolve
|
|
1057
|
+
});
|
|
1058
|
+
});
|
|
1059
|
+
}, []);
|
|
1060
|
+
const handleConfirm = (0, import_react3.useCallback)((result) => {
|
|
1061
|
+
if (confirmState.resolve) {
|
|
1062
|
+
confirmState.resolve(result);
|
|
1063
|
+
}
|
|
1064
|
+
setConfirmState({
|
|
1065
|
+
isOpen: false,
|
|
1066
|
+
options: null,
|
|
1067
|
+
resolve: null
|
|
1068
|
+
});
|
|
1069
|
+
}, [confirmState.resolve]);
|
|
889
1070
|
const value = {
|
|
890
1071
|
toasts,
|
|
891
1072
|
addToast,
|
|
@@ -893,9 +1074,77 @@ var ToastProvider = ({ children }) => {
|
|
|
893
1074
|
success,
|
|
894
1075
|
error,
|
|
895
1076
|
warning,
|
|
896
|
-
info
|
|
1077
|
+
info,
|
|
1078
|
+
confirm: confirm2
|
|
1079
|
+
};
|
|
1080
|
+
const getConfirmTypeStyles = (type) => {
|
|
1081
|
+
switch (type) {
|
|
1082
|
+
case "danger":
|
|
1083
|
+
return {
|
|
1084
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react.AlertCircle, { className: "w-6 h-6 text-red-500" }),
|
|
1085
|
+
confirmBtnClass: "bg-red-600 hover:bg-red-700 text-white"
|
|
1086
|
+
};
|
|
1087
|
+
case "warning":
|
|
1088
|
+
return {
|
|
1089
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react.AlertTriangle, { className: "w-6 h-6 text-amber-500" }),
|
|
1090
|
+
confirmBtnClass: "bg-amber-600 hover:bg-amber-700 text-white"
|
|
1091
|
+
};
|
|
1092
|
+
case "info":
|
|
1093
|
+
default:
|
|
1094
|
+
return {
|
|
1095
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react.HelpCircle, { className: "w-6 h-6 text-blue-500" }),
|
|
1096
|
+
confirmBtnClass: "bg-blue-600 hover:bg-blue-700 text-white"
|
|
1097
|
+
};
|
|
1098
|
+
}
|
|
897
1099
|
};
|
|
898
|
-
|
|
1100
|
+
const typeStyles = confirmState.options ? getConfirmTypeStyles(confirmState.options.type) : getConfirmTypeStyles();
|
|
1101
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(ToastContext.Provider, { value, children: [
|
|
1102
|
+
children,
|
|
1103
|
+
confirmState.isOpen && confirmState.options && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "fixed inset-0 z-[9999] flex items-center justify-center", children: [
|
|
1104
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1105
|
+
"div",
|
|
1106
|
+
{
|
|
1107
|
+
className: "absolute inset-0 bg-black/50 backdrop-blur-sm",
|
|
1108
|
+
onClick: () => handleConfirm(false)
|
|
1109
|
+
}
|
|
1110
|
+
),
|
|
1111
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "relative bg-white rounded-xl shadow-2xl max-w-md w-full mx-4 overflow-hidden animate-in fade-in zoom-in duration-200", children: [
|
|
1112
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "flex items-start gap-4 p-6 pb-4", children: [
|
|
1113
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: "flex-shrink-0 p-2 rounded-full bg-gray-100", children: typeStyles.icon }),
|
|
1114
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "flex-1 min-w-0", children: [
|
|
1115
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("h3", { className: "text-lg font-semibold text-gray-900", children: confirmState.options.title || "Confirmation" }),
|
|
1116
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "mt-2 text-sm text-gray-600 whitespace-pre-wrap", children: confirmState.options.message })
|
|
1117
|
+
] }),
|
|
1118
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1119
|
+
"button",
|
|
1120
|
+
{
|
|
1121
|
+
onClick: () => handleConfirm(false),
|
|
1122
|
+
className: "flex-shrink-0 p-1 rounded-lg hover:bg-gray-100 transition-colors",
|
|
1123
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_lucide_react.X, { className: "w-5 h-5 text-gray-400" })
|
|
1124
|
+
}
|
|
1125
|
+
)
|
|
1126
|
+
] }),
|
|
1127
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "flex justify-end gap-3 px-6 py-4 bg-gray-50 border-t border-gray-100", children: [
|
|
1128
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1129
|
+
"button",
|
|
1130
|
+
{
|
|
1131
|
+
onClick: () => handleConfirm(false),
|
|
1132
|
+
className: "px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-lg hover:bg-gray-50 transition-colors",
|
|
1133
|
+
children: confirmState.options.cancelText || "Annuler"
|
|
1134
|
+
}
|
|
1135
|
+
),
|
|
1136
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
1137
|
+
"button",
|
|
1138
|
+
{
|
|
1139
|
+
onClick: () => handleConfirm(true),
|
|
1140
|
+
className: `px-4 py-2 text-sm font-medium rounded-lg transition-colors ${typeStyles.confirmBtnClass}`,
|
|
1141
|
+
children: confirmState.options.confirmText || "Confirmer"
|
|
1142
|
+
}
|
|
1143
|
+
)
|
|
1144
|
+
] })
|
|
1145
|
+
] })
|
|
1146
|
+
] })
|
|
1147
|
+
] });
|
|
899
1148
|
};
|
|
900
1149
|
|
|
901
1150
|
// src/pages/ApprovalPreviewAnswer.tsx
|
|
@@ -909,7 +1158,7 @@ var RewiseBasicCard = ({ title, children }) => /* @__PURE__ */ (0, import_jsx_ru
|
|
|
909
1158
|
] });
|
|
910
1159
|
|
|
911
1160
|
// src/pages/ApprovalPreviewAnswer.tsx
|
|
912
|
-
var
|
|
1161
|
+
var import_lucide_react2 = require("lucide-react");
|
|
913
1162
|
var import_react_router_dom2 = require("react-router-dom");
|
|
914
1163
|
|
|
915
1164
|
// src/services/ApprovalServices.ts
|
|
@@ -1001,7 +1250,7 @@ var ApprovalAnswerModal = ({ answer_id, link_token, object_detail }) => {
|
|
|
1001
1250
|
}
|
|
1002
1251
|
};
|
|
1003
1252
|
if (loading) {
|
|
1004
|
-
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(RewiseBasicCard, { title: "Approbation - Pr\xE9visualisation", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "flex items-center justify-center py-12", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1253
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(RewiseBasicCard, { title: "Approbation - Pr\xE9visualisation", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "flex items-center justify-center py-12", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react2.Loader, { className: "w-8 h-8 animate-spin text-[#6A8A82]" }) }) });
|
|
1005
1254
|
} else {
|
|
1006
1255
|
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(ApprovalPreviewAnswer, { loadCase: loadData, answerId, caseData });
|
|
1007
1256
|
}
|
|
@@ -1045,7 +1294,7 @@ var ApprovalAnswerPage = () => {
|
|
|
1045
1294
|
};
|
|
1046
1295
|
const pageTitle = caseData?.title || "Approbation - Pr\xE9visualisation";
|
|
1047
1296
|
if (loading) {
|
|
1048
|
-
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(RewiseBasicCard, { title: "Approbation - Pr\xE9visualisation", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "flex items-center justify-center py-12", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1297
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(RewiseBasicCard, { title: "Approbation - Pr\xE9visualisation", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "flex items-center justify-center py-12", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react2.Loader, { className: "w-8 h-8 animate-spin text-[#6A8A82]" }) }) });
|
|
1049
1298
|
} else {
|
|
1050
1299
|
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "min-h-screen w-full bg-gray-100 mx-auto p-6", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "min-h-screen max-w-7xl mx-auto p-6", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1051
1300
|
RewiseBasicCard,
|
|
@@ -1118,7 +1367,7 @@ var ApprovalPreviewAnswer = ({ loadCase, answerId, caseData }) => {
|
|
|
1118
1367
|
switch (answer) {
|
|
1119
1368
|
case "approved":
|
|
1120
1369
|
return {
|
|
1121
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1370
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react2.CheckCircle, { className: "w-5 h-5 text-green-600" }),
|
|
1122
1371
|
label: "Approuv\xE9",
|
|
1123
1372
|
bgColor: "bg-green-50",
|
|
1124
1373
|
textColor: "text-green-700",
|
|
@@ -1126,7 +1375,7 @@ var ApprovalPreviewAnswer = ({ loadCase, answerId, caseData }) => {
|
|
|
1126
1375
|
};
|
|
1127
1376
|
case "refused":
|
|
1128
1377
|
return {
|
|
1129
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1378
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react2.XCircle, { className: "w-5 h-5 text-red-600" }),
|
|
1130
1379
|
label: "Refus\xE9",
|
|
1131
1380
|
bgColor: "bg-red-50",
|
|
1132
1381
|
textColor: "text-red-700",
|
|
@@ -1134,7 +1383,7 @@ var ApprovalPreviewAnswer = ({ loadCase, answerId, caseData }) => {
|
|
|
1134
1383
|
};
|
|
1135
1384
|
case "suggest-correction":
|
|
1136
1385
|
return {
|
|
1137
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1386
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react2.Edit, { className: "w-5 h-5 text-orange-600" }),
|
|
1138
1387
|
label: "Correction sugg\xE9r\xE9e",
|
|
1139
1388
|
bgColor: "bg-orange-50",
|
|
1140
1389
|
textColor: "text-orange-700",
|
|
@@ -1143,7 +1392,7 @@ var ApprovalPreviewAnswer = ({ loadCase, answerId, caseData }) => {
|
|
|
1143
1392
|
case "waiting":
|
|
1144
1393
|
default:
|
|
1145
1394
|
return {
|
|
1146
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1395
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react2.Clock, { className: "w-5 h-5 text-gray-500" }),
|
|
1147
1396
|
label: "En attente",
|
|
1148
1397
|
bgColor: "bg-gray-50",
|
|
1149
1398
|
textColor: "text-gray-700",
|
|
@@ -1161,7 +1410,7 @@ var ApprovalPreviewAnswer = ({ loadCase, answerId, caseData }) => {
|
|
|
1161
1410
|
"div",
|
|
1162
1411
|
{
|
|
1163
1412
|
className: `w-10 h-10 rounded-full ${statusDisplay.bgColor} border-2 ${statusDisplay.borderColor} flex items-center justify-center`,
|
|
1164
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1413
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react2.User, { className: `w-5 h-5 ${statusDisplay.textColor}` })
|
|
1165
1414
|
}
|
|
1166
1415
|
) }),
|
|
1167
1416
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "flex-1 min-w-0 pb-6", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: `p-3 rounded-lg border ${statusDisplay.borderColor} ${statusDisplay.bgColor}`, children: [
|
|
@@ -1175,10 +1424,10 @@ var ApprovalPreviewAnswer = ({ loadCase, answerId, caseData }) => {
|
|
|
1175
1424
|
userEmail && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { className: "text-xs text-gray-600 truncate mb-2", children: userEmail }),
|
|
1176
1425
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "flex items-center gap-2 mb-1", children: [
|
|
1177
1426
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: `w-5 h-5 rounded-full bg-white border ${statusDisplay.borderColor} flex items-center justify-center`, children: [
|
|
1178
|
-
approval.answer === "approved" && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1179
|
-
approval.answer === "refused" && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1180
|
-
approval.answer === "suggest-correction" && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1181
|
-
approval.answer === "waiting" && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1427
|
+
approval.answer === "approved" && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react2.CheckCircle, { className: "w-3 h-3 text-green-600" }),
|
|
1428
|
+
approval.answer === "refused" && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react2.XCircle, { className: "w-3 h-3 text-red-600" }),
|
|
1429
|
+
approval.answer === "suggest-correction" && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react2.Edit, { className: "w-3 h-3 text-orange-600" }),
|
|
1430
|
+
approval.answer === "waiting" && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react2.Clock, { className: "w-3 h-3 text-gray-500" })
|
|
1182
1431
|
] }) }),
|
|
1183
1432
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: `text-xs font-medium ${statusDisplay.textColor}`, children: statusDisplay.label })
|
|
1184
1433
|
] }),
|
|
@@ -1203,17 +1452,17 @@ var ApprovalPreviewAnswer = ({ loadCase, answerId, caseData }) => {
|
|
|
1203
1452
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "lg:col-span-4 space-y-6 ", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "p-4 border bg-gray-50 border-gray-200 rounded-lg", children: [
|
|
1204
1453
|
caseData?.requester && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "space-y-3", children: [
|
|
1205
1454
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("h3", { className: "text-lg font-semibold text-[#191919] flex items-center gap-2", children: [
|
|
1206
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1455
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react2.Send, { className: "w-5 h-5 text-[#6A8A82]" }),
|
|
1207
1456
|
"Demandeur"
|
|
1208
1457
|
] }),
|
|
1209
1458
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "relative flex gap-3", children: [
|
|
1210
1459
|
(caseData.verifications && caseData.verifications.length > 0 || caseData.validations && caseData.validations.length > 0) && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "absolute left-[19px] top-[40px] bottom-[-24px] w-0.5 bg-gray-300" }),
|
|
1211
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "relative flex-shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "w-10 h-10 rounded-full bg-blue-50 border-2 border-blue-200 flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1460
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "relative flex-shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "w-10 h-10 rounded-full bg-blue-50 border-2 border-blue-200 flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react2.User, { className: "w-5 h-5 text-blue-700" }) }) }),
|
|
1212
1461
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("div", { className: "flex-1 min-w-0 pb-6", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "p-3 rounded-lg border border-blue-200 bg-blue-50", children: [
|
|
1213
1462
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "font-medium text-sm text-[#191919] block mb-1", children: `${caseData.requester.first_name} ${caseData.requester.last_name}`.trim() }),
|
|
1214
1463
|
caseData.requester.email && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { className: "text-xs text-gray-600 truncate", children: caseData.requester.email }),
|
|
1215
1464
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "mt-2 mb-1 flex items-center gap-2", children: [
|
|
1216
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "w-5 h-5 rounded-full bg-white border border-blue-200 flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1465
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "w-5 h-5 rounded-full bg-white border border-blue-200 flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react2.Send, { className: "w-3 h-3 text-blue-600" }) }),
|
|
1217
1466
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { className: "text-xs text-blue-700 font-medium", children: [
|
|
1218
1467
|
"Demande cr\xE9\xE9e le ",
|
|
1219
1468
|
new Date(caseData.created_at || "").toLocaleDateString("fr-FR", {
|
|
@@ -1228,7 +1477,7 @@ var ApprovalPreviewAnswer = ({ loadCase, answerId, caseData }) => {
|
|
|
1228
1477
|
] }),
|
|
1229
1478
|
caseData?.verifications && caseData.verifications.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "space-y-3", children: [
|
|
1230
1479
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("h3", { className: "text-lg font-semibold text-[#191919] flex items-center gap-2", children: [
|
|
1231
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1480
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react2.FileText, { className: "w-5 h-5 text-[#6A8A82]" }),
|
|
1232
1481
|
"V\xE9rifications (",
|
|
1233
1482
|
caseData.verifications.length,
|
|
1234
1483
|
")"
|
|
@@ -1244,7 +1493,7 @@ var ApprovalPreviewAnswer = ({ loadCase, answerId, caseData }) => {
|
|
|
1244
1493
|
] }),
|
|
1245
1494
|
caseData?.validations && caseData.validations.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "space-y-3", children: [
|
|
1246
1495
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("h3", { className: "text-lg font-semibold text-[#191919] flex items-center gap-2", children: [
|
|
1247
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1496
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react2.CheckCircle, { className: "w-5 h-5 text-[#6A8A82]" }),
|
|
1248
1497
|
"Validations (",
|
|
1249
1498
|
caseData.validations.length,
|
|
1250
1499
|
")"
|
|
@@ -1254,7 +1503,7 @@ var ApprovalPreviewAnswer = ({ loadCase, answerId, caseData }) => {
|
|
|
1254
1503
|
) })
|
|
1255
1504
|
] }),
|
|
1256
1505
|
(!caseData?.verifications || caseData.verifications.length === 0) && (!caseData?.validations || caseData.validations.length === 0) && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "text-center py-8 text-gray-500", children: [
|
|
1257
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1506
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react2.AlertCircle, { className: "w-12 h-12 mx-auto mb-3 text-gray-400" }),
|
|
1258
1507
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { className: "text-sm", children: "Aucune approbation requise" })
|
|
1259
1508
|
] })
|
|
1260
1509
|
] }) }),
|
|
@@ -1284,7 +1533,7 @@ var ApprovalPreviewAnswer = ({ loadCase, answerId, caseData }) => {
|
|
|
1284
1533
|
dangerouslySetInnerHTML: { __html: caseData.html_content }
|
|
1285
1534
|
}
|
|
1286
1535
|
) : /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "text-center py-12 border-2 border-dashed border-[#D9D9D9] rounded-lg bg-[#FAFAFA]", children: [
|
|
1287
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1536
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react2.Eye, { className: "w-12 h-12 text-[#767676] mx-auto mb-4" }),
|
|
1288
1537
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { className: "text-[#767676]", children: "Aucun aper\xE7u disponible" })
|
|
1289
1538
|
] })
|
|
1290
1539
|
] }) }),
|
|
@@ -1296,7 +1545,7 @@ var ApprovalPreviewAnswer = ({ loadCase, answerId, caseData }) => {
|
|
|
1296
1545
|
disabled: submitting || caseData?.status !== "waiting",
|
|
1297
1546
|
classname: "flex items-center gap-2",
|
|
1298
1547
|
children: [
|
|
1299
|
-
submitting ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1548
|
+
submitting ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react2.Loader, { className: "w-4 h-4 animate-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react2.XCircle, { className: "w-4 h-4" }),
|
|
1300
1549
|
"Refuser"
|
|
1301
1550
|
]
|
|
1302
1551
|
}
|
|
@@ -1308,7 +1557,7 @@ var ApprovalPreviewAnswer = ({ loadCase, answerId, caseData }) => {
|
|
|
1308
1557
|
disabled: submitting || caseData?.status !== "waiting",
|
|
1309
1558
|
classname: "flex items-center gap-2",
|
|
1310
1559
|
children: [
|
|
1311
|
-
submitting ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1560
|
+
submitting ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react2.Loader, { className: "w-4 h-4 animate-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react2.Edit, { className: "w-4 h-4" }),
|
|
1312
1561
|
"Sugg\xE9rer une correction"
|
|
1313
1562
|
]
|
|
1314
1563
|
}
|
|
@@ -1320,7 +1569,7 @@ var ApprovalPreviewAnswer = ({ loadCase, answerId, caseData }) => {
|
|
|
1320
1569
|
disabled: submitting || caseData?.status !== "waiting",
|
|
1321
1570
|
classname: "flex items-center gap-2",
|
|
1322
1571
|
children: [
|
|
1323
|
-
submitting ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1572
|
+
submitting ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react2.Loader, { className: "w-4 h-4 animate-spin" }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react2.Check, { className: "w-4 h-4" }),
|
|
1324
1573
|
"Accepter"
|
|
1325
1574
|
]
|
|
1326
1575
|
}
|
|
@@ -1341,7 +1590,7 @@ var ApprovalPreviewAnswer = ({ loadCase, answerId, caseData }) => {
|
|
|
1341
1590
|
onClick: closeNoteModal,
|
|
1342
1591
|
disabled: submitting,
|
|
1343
1592
|
className: "text-gray-500 hover:text-[#6A8A82] transition-colors",
|
|
1344
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1593
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react2.X, { className: "w-5 h-5" })
|
|
1345
1594
|
}
|
|
1346
1595
|
)
|
|
1347
1596
|
] }),
|
|
@@ -1379,12 +1628,12 @@ var ApprovalPreviewAnswer = ({ loadCase, answerId, caseData }) => {
|
|
|
1379
1628
|
disabled: submitting || currentAction === "suggest" && !note.trim(),
|
|
1380
1629
|
classname: "flex items-center gap-2",
|
|
1381
1630
|
children: submitting ? /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
|
|
1382
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1631
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react2.Loader, { className: "w-4 h-4 animate-spin" }),
|
|
1383
1632
|
"Traitement..."
|
|
1384
1633
|
] }) : /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
|
|
1385
|
-
currentAction === "approve" && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1386
|
-
currentAction === "reject" && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1387
|
-
currentAction === "suggest" && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
1634
|
+
currentAction === "approve" && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react2.Check, { className: "w-4 h-4" }),
|
|
1635
|
+
currentAction === "reject" && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react2.XCircle, { className: "w-4 h-4" }),
|
|
1636
|
+
currentAction === "suggest" && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_lucide_react2.Edit, { className: "w-4 h-4" }),
|
|
1388
1637
|
"Confirmer"
|
|
1389
1638
|
] })
|
|
1390
1639
|
}
|
|
@@ -1397,11 +1646,86 @@ var ApprovalPreviewAnswer_default = ApprovalPreviewAnswer;
|
|
|
1397
1646
|
|
|
1398
1647
|
// src/components/layout/ModernDoubleSidebarLayout.tsx
|
|
1399
1648
|
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
1649
|
+
var MODULE_URLS = {
|
|
1650
|
+
production: {
|
|
1651
|
+
wiseConnect: "https://rewise.praedium-tech.com/admin/crm/trade-strategy/lead-insight/",
|
|
1652
|
+
wiseReach: "https://rewise.praedium-tech.com/admin/marketing/dashboard/",
|
|
1653
|
+
wiseOps: "https://wisefm.praedium-tech.com/",
|
|
1654
|
+
wiseGuard: "https://rewise.praedium-tech.com/admin/security/dashboard/",
|
|
1655
|
+
wiseThrive: "https://rewise.praedium-tech.com/admin/thrive/scorecard/dashboard/financial/",
|
|
1656
|
+
wiseView: "https://reporting.rewise.praedium-tech.com/",
|
|
1657
|
+
wiseProcess: "https://rewise.praedium-tech.com/workspace/sop-connect/",
|
|
1658
|
+
wiseBill: "https://rewise.praedium-tech.com/admin/invoicing/insight/summary/",
|
|
1659
|
+
wiseBooks: "https://rewise.praedium-tech.com/admin/accounting/client/invoice-queue/",
|
|
1660
|
+
wiseAsset: "#",
|
|
1661
|
+
wiseCash: "https://rewise.praedium-tech.com/admin/finance/dashboard/",
|
|
1662
|
+
wiseCollect: "https://rewise.praedium-tech.com/admin/recovery/collection/dashboard/",
|
|
1663
|
+
wiseProcure: "https://rewise.praedium-tech.com/admin/procurement/dashboard/one/",
|
|
1664
|
+
wiseHR: "https://rewise.praedium-tech.com/admin/human-capital/dashboard/"
|
|
1665
|
+
},
|
|
1666
|
+
development: {
|
|
1667
|
+
wiseConnect: "http://localhost:5173/admin/crm/trade-strategy/lead-insight/",
|
|
1668
|
+
wiseReach: "http://localhost:5173/admin/marketing/dashboard/",
|
|
1669
|
+
wiseOps: "http://localhost:5174/",
|
|
1670
|
+
wiseGuard: "http://localhost:5173/admin/security/dashboard/",
|
|
1671
|
+
wiseThrive: "http://localhost:5173/admin/thrive/scorecard/dashboard/financial/",
|
|
1672
|
+
wiseView: "http://localhost:5175/",
|
|
1673
|
+
wiseProcess: "http://localhost:5173/workspace/sop-connect/",
|
|
1674
|
+
wiseBill: "http://localhost:5173/admin/invoicing/insight/summary/",
|
|
1675
|
+
wiseBooks: "http://localhost:5173/admin/accounting/client/invoice-queue/",
|
|
1676
|
+
wiseAsset: "#",
|
|
1677
|
+
wiseCash: "http://localhost:5173/admin/finance/dashboard/",
|
|
1678
|
+
wiseCollect: "http://localhost:5173/admin/recovery/collection/dashboard/",
|
|
1679
|
+
wiseProcure: "http://localhost:5173/admin/procurement/dashboard/one/",
|
|
1680
|
+
wiseHR: "http://localhost:5173/admin/human-capital/dashboard/"
|
|
1681
|
+
}
|
|
1682
|
+
};
|
|
1683
|
+
var getModuleUrls = (token) => {
|
|
1684
|
+
const env = localStorage.getItem("env") || "prod";
|
|
1685
|
+
const urls = env === "localhost" ? MODULE_URLS.development : MODULE_URLS.production;
|
|
1686
|
+
return {
|
|
1687
|
+
...urls,
|
|
1688
|
+
wiseOps: token ? `${urls.wiseOps}?tkn=${token}` : urls.wiseOps
|
|
1689
|
+
};
|
|
1690
|
+
};
|
|
1691
|
+
var MODULE_CODE_MAP = {
|
|
1692
|
+
"CRM": "WiseConnect",
|
|
1693
|
+
"MARKETING": "WiseReach",
|
|
1694
|
+
"FACILITY": "WiseOps",
|
|
1695
|
+
"SECURITY": "WiseGuard",
|
|
1696
|
+
"THRIVE": "WiseThrive",
|
|
1697
|
+
"BI": "WiseView",
|
|
1698
|
+
"SOP": "WiseProcess",
|
|
1699
|
+
"BILLING": "WiseBill",
|
|
1700
|
+
"ACCOUNTING": "WiseBooks",
|
|
1701
|
+
"ASSET": "WiseAsset",
|
|
1702
|
+
"FINANCE": "WiseCash",
|
|
1703
|
+
"COLLECTION": "WiseCollect",
|
|
1704
|
+
"PURCHASE": "WiseProcure",
|
|
1705
|
+
"HR": "WiseHR"
|
|
1706
|
+
};
|
|
1400
1707
|
var RewiseLayout = ({ children, module_name = "Rewise", module_description = "Description du module", primaryMenuItems, secondaryMenuItems }) => {
|
|
1401
1708
|
const location = (0, import_react_router_dom3.useLocation)();
|
|
1402
1709
|
const navigate = (0, import_react_router_dom3.useNavigate)();
|
|
1403
1710
|
const { theme, themeType, setTheme } = useTheme();
|
|
1404
|
-
const { loggedUser, activeBusinessEntity, setActiveBusinessEntity } = useSession();
|
|
1711
|
+
const { loggedUser, token, activeBusinessEntity, setActiveBusinessEntity } = useSession();
|
|
1712
|
+
const moduleUrls = getModuleUrls(token || void 0);
|
|
1713
|
+
const getOrganizationModules = () => {
|
|
1714
|
+
if (!activeBusinessEntity) return [];
|
|
1715
|
+
const org = activeBusinessEntity.organization;
|
|
1716
|
+
if (typeof org === "object" && org !== null && "modules" in org) {
|
|
1717
|
+
return org.modules || [];
|
|
1718
|
+
}
|
|
1719
|
+
return [];
|
|
1720
|
+
};
|
|
1721
|
+
const organizationModules = getOrganizationModules();
|
|
1722
|
+
const organizationModuleCodes = organizationModules.map((m) => m.code);
|
|
1723
|
+
const isModuleAccessible = (moduleName) => {
|
|
1724
|
+
if (organizationModules.length === 0) return true;
|
|
1725
|
+
const moduleCode = Object.entries(MODULE_CODE_MAP).find(([_, name]) => name === moduleName)?.[0];
|
|
1726
|
+
if (!moduleCode) return true;
|
|
1727
|
+
return organizationModuleCodes.includes(moduleCode);
|
|
1728
|
+
};
|
|
1405
1729
|
const [primaryCollapsed, setPrimaryCollapsed] = (0, import_react5.useState)(false);
|
|
1406
1730
|
const [secondaryCollapsed, setSecondaryCollapsed] = (0, import_react5.useState)(false);
|
|
1407
1731
|
const [mobileMenuOpen, setMobileMenuOpen] = (0, import_react5.useState)(false);
|
|
@@ -1411,6 +1735,31 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "De
|
|
|
1411
1735
|
const [showUserMenu, setShowUserMenu] = (0, import_react5.useState)(false);
|
|
1412
1736
|
const [showThemeMenu, setShowThemeMenu] = (0, import_react5.useState)(false);
|
|
1413
1737
|
const [showCenterMenu, setShowCenterMenu] = (0, import_react5.useState)(false);
|
|
1738
|
+
const [showModulesMenu, setShowModulesMenu] = (0, import_react5.useState)(false);
|
|
1739
|
+
const [currentSlide, setCurrentSlide] = (0, import_react5.useState)(0);
|
|
1740
|
+
const slides = [
|
|
1741
|
+
{
|
|
1742
|
+
title: "Rappel \u2013 Gestion des jours de cong\xE9",
|
|
1743
|
+
content: "Pensez \xE0 planifier vos cong\xE9s \xE0 l'avance via votre espace personnel. Les demandes seront trait\xE9es selon les priorit\xE9s op\xE9rationnelles de chaque d\xE9partement."
|
|
1744
|
+
},
|
|
1745
|
+
{
|
|
1746
|
+
title: "Nouveau \u2013 Mise \xE0 jour des proc\xE9dures",
|
|
1747
|
+
content: "Les nouvelles proc\xE9dures de validation sont maintenant disponibles. Consultez votre manuel utilisateur pour plus d'informations sur les changements."
|
|
1748
|
+
},
|
|
1749
|
+
{
|
|
1750
|
+
title: "Important \u2013 Formation obligatoire",
|
|
1751
|
+
content: "Tous les employ\xE9s doivent compl\xE9ter la formation s\xE9curit\xE9 avant la fin du mois. Inscrivez-vous d\xE8s maintenant sur la plateforme de formation."
|
|
1752
|
+
}
|
|
1753
|
+
];
|
|
1754
|
+
const nextSlide = () => {
|
|
1755
|
+
setCurrentSlide((prev) => (prev + 1) % slides.length);
|
|
1756
|
+
};
|
|
1757
|
+
const prevSlide = () => {
|
|
1758
|
+
setCurrentSlide((prev) => (prev - 1 + slides.length) % slides.length);
|
|
1759
|
+
};
|
|
1760
|
+
const goToSlide = (index) => {
|
|
1761
|
+
setCurrentSlide(index);
|
|
1762
|
+
};
|
|
1414
1763
|
const [showApprovalModal, setShowApprovalModal] = (0, import_react5.useState)(false);
|
|
1415
1764
|
const [approvalAnswerDetail, setApprovalAnswerDetail] = (0, import_react5.useState)(null);
|
|
1416
1765
|
const [caseData, setCaseData] = (0, import_react5.useState)(null);
|
|
@@ -1434,6 +1783,7 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "De
|
|
|
1434
1783
|
setShowNotifications(false);
|
|
1435
1784
|
setShowUserMenu(false);
|
|
1436
1785
|
setShowThemeMenu(false);
|
|
1786
|
+
setShowModulesMenu(false);
|
|
1437
1787
|
setMobileMenuOpen(false);
|
|
1438
1788
|
}
|
|
1439
1789
|
};
|
|
@@ -1542,7 +1892,7 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "De
|
|
|
1542
1892
|
className: "text-[var(--color-sidebar-text-secondary)] hover:text-[var(--color-sidebar-text)] transition-colors",
|
|
1543
1893
|
"aria-label": primaryCollapsed ? "D\xE9velopper le menu" : "R\xE9duire le menu",
|
|
1544
1894
|
"aria-expanded": !primaryCollapsed,
|
|
1545
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1895
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react3.ChevronLeft, { className: cn(
|
|
1546
1896
|
"w-5 h-5 transition-transform",
|
|
1547
1897
|
primaryCollapsed && "rotate-180"
|
|
1548
1898
|
) })
|
|
@@ -1598,7 +1948,7 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "De
|
|
|
1598
1948
|
"flex items-center gap-3",
|
|
1599
1949
|
primaryCollapsed && "justify-center"
|
|
1600
1950
|
), children: [
|
|
1601
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "w-10 h-10 bg-[var(--color-primary)] rounded-full flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1951
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "w-10 h-10 bg-[var(--color-primary)] rounded-full flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react3.User, { className: "w-5 h-5 text-[var(--color-background)]" }) }),
|
|
1602
1952
|
!primaryCollapsed && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex-1", children: [
|
|
1603
1953
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "text-sm font-medium text-[var(--color-sidebar-text)]", children: loggedUser?.first_name && loggedUser?.last_name ? `${loggedUser.first_name} ${loggedUser.last_name}` : loggedUser?.username || "Utilisateur" }),
|
|
1604
1954
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "text-xs text-[var(--color-sidebar-text-secondary)]", children: loggedUser?.email || "email@example.com" })
|
|
@@ -1614,7 +1964,7 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "De
|
|
|
1614
1964
|
onClick: () => setSecondaryCollapsed(false),
|
|
1615
1965
|
className: "hidden lg:flex items-center justify-center w-12 h-full bg-[var(--color-background)] border-r border-[var(--color-border)] hover:bg-[var(--color-surface-hover)] transition-colors",
|
|
1616
1966
|
"aria-label": "Ouvrir le sous-menu",
|
|
1617
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1967
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react3.ChevronRight, { className: "w-5 h-5 text-[var(--color-text-tertiary)]" })
|
|
1618
1968
|
}
|
|
1619
1969
|
),
|
|
1620
1970
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
@@ -1635,7 +1985,7 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "De
|
|
|
1635
1985
|
onClick: () => setSecondaryCollapsed(!secondaryCollapsed),
|
|
1636
1986
|
className: "text-[var(--color-text-tertiary)] hover:text-[var(--color-text-primary)] flex-shrink-0",
|
|
1637
1987
|
"aria-label": secondaryCollapsed ? "D\xE9velopper le sous-menu" : "R\xE9duire le sous-menu",
|
|
1638
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1988
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react3.ChevronLeft, { className: cn(
|
|
1639
1989
|
"w-4 h-4 transition-transform",
|
|
1640
1990
|
secondaryCollapsed && "rotate-180"
|
|
1641
1991
|
) })
|
|
@@ -1710,7 +2060,7 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "De
|
|
|
1710
2060
|
onClick: () => setMobileMenuOpen(false),
|
|
1711
2061
|
className: "text-[var(--color-sidebar-text-secondary)]",
|
|
1712
2062
|
"aria-label": "Fermer le menu",
|
|
1713
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2063
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react3.X, { className: "w-6 h-6" })
|
|
1714
2064
|
}
|
|
1715
2065
|
)
|
|
1716
2066
|
] }),
|
|
@@ -1788,7 +2138,7 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "De
|
|
|
1788
2138
|
onClick: () => setMobileMenuOpen(true),
|
|
1789
2139
|
className: "lg:hidden text-[var(--color-text-primary)]",
|
|
1790
2140
|
"aria-label": "Ouvrir le menu mobile",
|
|
1791
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2141
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react3.Menu, { className: "w-6 h-6" })
|
|
1792
2142
|
}
|
|
1793
2143
|
),
|
|
1794
2144
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
@@ -1797,7 +2147,7 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "De
|
|
|
1797
2147
|
className: "hidden sm:flex items-center gap-2 text-sm",
|
|
1798
2148
|
"aria-label": "Fil d'Ariane",
|
|
1799
2149
|
children: getBreadcrumbs().map((crumb, index) => /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_react5.default.Fragment, { children: [
|
|
1800
|
-
index > 0 && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2150
|
+
index > 0 && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react3.ChevronRight, { className: "w-4 h-4 text-[var(--color-text-tertiary)]" }),
|
|
1801
2151
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1802
2152
|
"button",
|
|
1803
2153
|
{
|
|
@@ -1813,7 +2163,7 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "De
|
|
|
1813
2163
|
}
|
|
1814
2164
|
),
|
|
1815
2165
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "relative max-w-md flex-1 hidden lg:block", children: [
|
|
1816
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2166
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react3.Search, { className: "absolute left-3 top-1/2 -translate-y-1/2 text-[var(--color-text-tertiary)] w-5 h-5" }),
|
|
1817
2167
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
1818
2168
|
"input",
|
|
1819
2169
|
{
|
|
@@ -1829,6 +2179,17 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "De
|
|
|
1829
2179
|
] })
|
|
1830
2180
|
] }),
|
|
1831
2181
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
2182
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "relative", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2183
|
+
"button",
|
|
2184
|
+
{
|
|
2185
|
+
onClick: () => setShowModulesMenu(!showModulesMenu),
|
|
2186
|
+
className: "p-2 hover:bg-[var(--color-surface-hover)] rounded-lg transition-colors",
|
|
2187
|
+
title: "Acc\xE8s aux modules",
|
|
2188
|
+
"aria-label": "Menu des modules",
|
|
2189
|
+
"aria-expanded": showModulesMenu,
|
|
2190
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react3.LayoutGrid, { className: "w-5 h-5 text-[var(--color-text-secondary)]" })
|
|
2191
|
+
}
|
|
2192
|
+
) }),
|
|
1832
2193
|
loggedUser?.centers_access && loggedUser.centers_access.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "relative", children: [
|
|
1833
2194
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
1834
2195
|
"button",
|
|
@@ -1839,9 +2200,9 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "De
|
|
|
1839
2200
|
"aria-label": "S\xE9lecteur de centre",
|
|
1840
2201
|
"aria-expanded": showCenterMenu,
|
|
1841
2202
|
children: [
|
|
1842
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2203
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react3.Building2, { className: "w-4 h-4 text-[var(--color-primary)]" }),
|
|
1843
2204
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "text-sm font-medium text-[var(--color-text-primary)] hidden sm:block", children: loggedUser.centers_access.find((c) => c.id === activeBusinessEntity?.id)?.legal_name || "S\xE9lectionner" }),
|
|
1844
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2205
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react3.ChevronRight, { className: cn(
|
|
1845
2206
|
"w-4 h-4 text-[var(--color-text-tertiary)] transition-transform",
|
|
1846
2207
|
showCenterMenu && "rotate-90"
|
|
1847
2208
|
) })
|
|
@@ -1870,7 +2231,7 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "De
|
|
|
1870
2231
|
),
|
|
1871
2232
|
role: "menuitem",
|
|
1872
2233
|
children: [
|
|
1873
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2234
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react3.Building2, { className: cn(
|
|
1874
2235
|
"w-5 h-5",
|
|
1875
2236
|
selectedCenterId === center.id ? "text-[var(--color-primary)]" : "text-[var(--color-text-tertiary)]"
|
|
1876
2237
|
) }),
|
|
@@ -1898,7 +2259,7 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "De
|
|
|
1898
2259
|
title: "Changer le th\xE8me",
|
|
1899
2260
|
"aria-label": "S\xE9lecteur de th\xE8me",
|
|
1900
2261
|
"aria-expanded": showThemeMenu,
|
|
1901
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2262
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react3.Palette, { className: "w-5 h-5 text-[var(--color-text-secondary)]" })
|
|
1902
2263
|
}
|
|
1903
2264
|
),
|
|
1904
2265
|
showThemeMenu && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
@@ -1968,7 +2329,7 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "De
|
|
|
1968
2329
|
)
|
|
1969
2330
|
] }),
|
|
1970
2331
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex items-center px-3 py-1.5 bg-[var(--color-surface)] rounded-lg border border-[var(--color-border)]", children: [
|
|
1971
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2332
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react3.DollarSign, { className: "w-4 h-4 text-[var(--color-primary)] mr-2" }),
|
|
1972
2333
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "text-sm font-medium text-[var(--color-text-primary)]", children: "FCFA" })
|
|
1973
2334
|
] }),
|
|
1974
2335
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "relative", children: [
|
|
@@ -1980,7 +2341,7 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "De
|
|
|
1980
2341
|
"aria-label": `Notifications ${notifications.filter((n) => !n.read).length > 0 ? `(${notifications.filter((n) => !n.read).length} non lues)` : ""}`,
|
|
1981
2342
|
"aria-expanded": showNotifications,
|
|
1982
2343
|
children: [
|
|
1983
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2344
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react3.Bell, { className: "w-5 h-5 text-[var(--color-text-secondary)]" }),
|
|
1984
2345
|
notifications.filter((n) => !n.read).length > 0 && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "absolute top-1 right-1 w-2 h-2 bg-[var(--color-error)] rounded-full" })
|
|
1985
2346
|
]
|
|
1986
2347
|
}
|
|
@@ -2030,7 +2391,7 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "De
|
|
|
2030
2391
|
className: "flex items-center gap-2 p-2 hover:bg-[var(--color-surface-hover)] rounded-lg transition-colors",
|
|
2031
2392
|
"aria-label": "Menu utilisateur",
|
|
2032
2393
|
"aria-expanded": showUserMenu,
|
|
2033
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "w-8 h-8 bg-[var(--color-primary)] rounded-full flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2394
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "w-8 h-8 bg-[var(--color-primary)] rounded-full flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react3.User, { className: "w-4 h-4 text-[var(--color-background)]" }) })
|
|
2034
2395
|
}
|
|
2035
2396
|
),
|
|
2036
2397
|
showUserMenu && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
@@ -2046,7 +2407,7 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "De
|
|
|
2046
2407
|
className: "w-full flex items-center gap-3 px-3 py-2 rounded-lg hover:bg-[var(--color-surface-hover)] transition-colors",
|
|
2047
2408
|
role: "menuitem",
|
|
2048
2409
|
children: [
|
|
2049
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2410
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react3.User, { className: "w-4 h-4" }),
|
|
2050
2411
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "text-sm", children: "Mon profil" })
|
|
2051
2412
|
]
|
|
2052
2413
|
}
|
|
@@ -2061,7 +2422,7 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "De
|
|
|
2061
2422
|
className: "w-full flex items-center gap-3 px-3 py-2 rounded-lg hover:bg-[var(--color-surface-hover)] transition-colors",
|
|
2062
2423
|
role: "menuitem",
|
|
2063
2424
|
children: [
|
|
2064
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2425
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react3.Settings, { className: "w-4 h-4" }),
|
|
2065
2426
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "text-sm", children: "Param\xE8tres" })
|
|
2066
2427
|
]
|
|
2067
2428
|
}
|
|
@@ -2072,7 +2433,7 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "De
|
|
|
2072
2433
|
className: "w-full flex items-center gap-3 px-3 py-2 rounded-lg hover:bg-[var(--color-surface-hover)] transition-colors",
|
|
2073
2434
|
role: "menuitem",
|
|
2074
2435
|
children: [
|
|
2075
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2436
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react3.HelpCircle, { className: "w-4 h-4" }),
|
|
2076
2437
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "text-sm", children: "Aide" })
|
|
2077
2438
|
]
|
|
2078
2439
|
}
|
|
@@ -2084,7 +2445,7 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "De
|
|
|
2084
2445
|
className: "w-full flex items-center gap-3 px-3 py-2 rounded-lg hover:bg-[var(--color-surface-hover)] text-[var(--color-error)] transition-colors",
|
|
2085
2446
|
role: "menuitem",
|
|
2086
2447
|
children: [
|
|
2087
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2448
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react3.LogOut, { className: "w-4 h-4" }),
|
|
2088
2449
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "text-sm", children: "D\xE9connexion" })
|
|
2089
2450
|
]
|
|
2090
2451
|
}
|
|
@@ -2107,6 +2468,223 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "De
|
|
|
2107
2468
|
}
|
|
2108
2469
|
)
|
|
2109
2470
|
] }),
|
|
2471
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2472
|
+
Modals_default,
|
|
2473
|
+
{
|
|
2474
|
+
title: "Modules REWISE",
|
|
2475
|
+
description: "Acc\xE9dez rapidement \xE0 tous les modules",
|
|
2476
|
+
width: "max-w-6xl",
|
|
2477
|
+
open: showModulesMenu,
|
|
2478
|
+
onClose: () => setShowModulesMenu(false),
|
|
2479
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "space-y-6", children: [
|
|
2480
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex flex-col lg:flex-row gap-4 lg:items-stretch", children: [
|
|
2481
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex-[3] bg-[#D3E1F2] rounded-lg p-5 relative min-h-[160px]", children: [
|
|
2482
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("h2", { className: "text-lg font-semibold text-gray-800 mb-2 pr-8 line-clamp-2", children: slides[currentSlide].title }),
|
|
2483
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "text-gray-600 text-sm leading-relaxed line-clamp-3", children: slides[currentSlide].content }),
|
|
2484
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2485
|
+
"button",
|
|
2486
|
+
{
|
|
2487
|
+
onClick: prevSlide,
|
|
2488
|
+
className: "absolute left-2 top-1/2 transform -translate-y-1/2 w-6 h-6 bg-white/80 rounded-full flex items-center justify-center hover:bg-white transition-colors text-gray-600",
|
|
2489
|
+
children: "\u2039"
|
|
2490
|
+
}
|
|
2491
|
+
),
|
|
2492
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2493
|
+
"button",
|
|
2494
|
+
{
|
|
2495
|
+
onClick: nextSlide,
|
|
2496
|
+
className: "absolute right-2 top-1/2 transform -translate-y-1/2 w-6 h-6 bg-white/80 rounded-full flex items-center justify-center hover:bg-white transition-colors text-gray-600",
|
|
2497
|
+
children: "\u203A"
|
|
2498
|
+
}
|
|
2499
|
+
),
|
|
2500
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "absolute bottom-3 left-1/2 transform -translate-x-1/2 flex space-x-2", children: slides.map((_, index) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2501
|
+
"button",
|
|
2502
|
+
{
|
|
2503
|
+
onClick: () => goToSlide(index),
|
|
2504
|
+
className: `w-2 h-2 rounded-full transition-colors ${index === currentSlide ? "bg-red-600" : "bg-white"}`
|
|
2505
|
+
},
|
|
2506
|
+
index
|
|
2507
|
+
)) })
|
|
2508
|
+
] }),
|
|
2509
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex-[1] bg-white border border-gray-200 rounded-lg overflow-hidden flex flex-col", children: [
|
|
2510
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "bg-red-600 text-white px-4 py-2 flex-shrink-0", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("h3", { className: "font-semibold text-sm text-center", children: "Mes alertes" }) }),
|
|
2511
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "p-3 space-y-2 flex-1 overflow-y-auto", children: notifications.filter((n) => !n.read).length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "h-full flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "text-center text-gray-500 text-xs", children: "Aucune alerte" }) }) : notifications.filter((n) => !n.read).slice(0, 5).map((notif) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2512
|
+
"div",
|
|
2513
|
+
{
|
|
2514
|
+
className: "bg-gray-50 border border-gray-200 rounded p-2 cursor-pointer hover:bg-gray-100",
|
|
2515
|
+
onClick: () => markNotificationAsRead(notif.id),
|
|
2516
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex items-start space-x-2", children: [
|
|
2517
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_lucide_react3.Bell, { className: "w-3 h-3 text-gray-500 mt-0.5 flex-shrink-0" }),
|
|
2518
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex-1 min-w-0", children: [
|
|
2519
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("h4", { className: "font-medium text-xs text-gray-800 truncate", children: notif.title }),
|
|
2520
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "text-xs text-gray-600 line-clamp-1", children: notif.message })
|
|
2521
|
+
] })
|
|
2522
|
+
] })
|
|
2523
|
+
},
|
|
2524
|
+
notif.id
|
|
2525
|
+
)) })
|
|
2526
|
+
] })
|
|
2527
|
+
] }),
|
|
2528
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex flex-col lg:flex-row gap-6", children: [
|
|
2529
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex-1 bg-white border border-gray-200 rounded-lg p-4 shadow-sm", children: [
|
|
2530
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("h3", { className: "text-lg font-semibold text-gray-800 mb-4", children: "Op\xE9rations" }),
|
|
2531
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "grid grid-cols-2 md:grid-cols-4 gap-3", children: [
|
|
2532
|
+
{ name: "WiseConnect", icon: crm_blue_default, iconWhite: crmwhite_default, url: moduleUrls.wiseConnect },
|
|
2533
|
+
{ name: "WiseReach", icon: marketingblue_default, iconWhite: marketingblanc_default, url: moduleUrls.wiseReach },
|
|
2534
|
+
{ name: "WiseOps", icon: facilityblue_default, iconWhite: facilityblanc_default, url: moduleUrls.wiseOps },
|
|
2535
|
+
{ name: "WiseGuard", icon: security_managementblue_default, iconWhite: security_managementblanc_default, url: moduleUrls.wiseGuard }
|
|
2536
|
+
].map((module2) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2537
|
+
"button",
|
|
2538
|
+
{
|
|
2539
|
+
onClick: () => {
|
|
2540
|
+
window.open(module2.url, "_blank", "noopener,noreferrer");
|
|
2541
|
+
setShowModulesMenu(false);
|
|
2542
|
+
},
|
|
2543
|
+
className: "group p-4 rounded-lg bg-gray-100 hover:bg-[#4A5568] transition-all duration-200 text-center",
|
|
2544
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex flex-col items-center", children: [
|
|
2545
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2546
|
+
"img",
|
|
2547
|
+
{
|
|
2548
|
+
src: module2.icon,
|
|
2549
|
+
alt: module2.name,
|
|
2550
|
+
className: "w-12 h-12 mb-2 group-hover:hidden"
|
|
2551
|
+
}
|
|
2552
|
+
),
|
|
2553
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2554
|
+
"img",
|
|
2555
|
+
{
|
|
2556
|
+
src: module2.iconWhite,
|
|
2557
|
+
alt: module2.name,
|
|
2558
|
+
className: "w-12 h-12 mb-2 hidden group-hover:block"
|
|
2559
|
+
}
|
|
2560
|
+
),
|
|
2561
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "text-sm font-medium text-gray-800 group-hover:text-white", children: module2.name })
|
|
2562
|
+
] })
|
|
2563
|
+
},
|
|
2564
|
+
module2.name
|
|
2565
|
+
)) })
|
|
2566
|
+
] }),
|
|
2567
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex-1 bg-white border border-gray-200 rounded-lg p-4 shadow-sm", children: [
|
|
2568
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("h3", { className: "text-lg font-semibold text-gray-800 mb-4", children: "Performance" }),
|
|
2569
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "grid grid-cols-2 md:grid-cols-3 gap-3", children: [
|
|
2570
|
+
{ name: "WiseThrive", icon: thriveblue_default, iconWhite: thriveblanc_default, url: moduleUrls.wiseThrive },
|
|
2571
|
+
{ name: "WiseView", icon: wiseblues_default, iconWhite: wiseblancs_default, url: moduleUrls.wiseView },
|
|
2572
|
+
{ name: "WiseProcess", icon: sopblues_default, iconWhite: sopblancs_default, url: moduleUrls.wiseProcess }
|
|
2573
|
+
].map((module2) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2574
|
+
"button",
|
|
2575
|
+
{
|
|
2576
|
+
onClick: () => {
|
|
2577
|
+
window.open(module2.url, "_blank", "noopener,noreferrer");
|
|
2578
|
+
setShowModulesMenu(false);
|
|
2579
|
+
},
|
|
2580
|
+
className: "group p-4 rounded-lg bg-gray-100 hover:bg-[#4A5568] transition-all duration-200 text-center",
|
|
2581
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex flex-col items-center", children: [
|
|
2582
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2583
|
+
"img",
|
|
2584
|
+
{
|
|
2585
|
+
src: module2.icon,
|
|
2586
|
+
alt: module2.name,
|
|
2587
|
+
className: "w-12 h-12 mb-2 group-hover:hidden"
|
|
2588
|
+
}
|
|
2589
|
+
),
|
|
2590
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2591
|
+
"img",
|
|
2592
|
+
{
|
|
2593
|
+
src: module2.iconWhite,
|
|
2594
|
+
alt: module2.name,
|
|
2595
|
+
className: "w-12 h-12 mb-2 hidden group-hover:block"
|
|
2596
|
+
}
|
|
2597
|
+
),
|
|
2598
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "text-sm font-medium text-gray-800 group-hover:text-white", children: module2.name })
|
|
2599
|
+
] })
|
|
2600
|
+
},
|
|
2601
|
+
module2.name
|
|
2602
|
+
)) })
|
|
2603
|
+
] })
|
|
2604
|
+
] }),
|
|
2605
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "bg-white border border-gray-200 rounded-lg p-4 shadow-sm", children: [
|
|
2606
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("h3", { className: "text-lg font-semibold text-gray-800 mb-4", children: "Fonctions Support" }),
|
|
2607
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex flex-col lg:flex-row gap-4", children: [
|
|
2608
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "flex-[5] bg-gray-50 rounded-lg p-4", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "grid grid-cols-2 md:grid-cols-5 gap-3", children: [
|
|
2609
|
+
{ name: "WiseBill", icon: invoicingblue_default, iconWhite: invoicingblanc_default, url: moduleUrls.wiseBill },
|
|
2610
|
+
{ name: "WiseBooks", icon: accountingblue_default, iconWhite: accountingblanc_default, url: moduleUrls.wiseBooks },
|
|
2611
|
+
{ name: "WiseAsset", icon: assetblue_default, iconWhite: assetblanc_default, url: moduleUrls.wiseAsset },
|
|
2612
|
+
{ name: "WiseCash", icon: financeblue_default, iconWhite: financeblanc_default, url: moduleUrls.wiseCash },
|
|
2613
|
+
{ name: "WiseCollect", icon: collection_litigationblue_default, iconWhite: collection_litigationblanc_default, url: moduleUrls.wiseCollect }
|
|
2614
|
+
].map((module2) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2615
|
+
"button",
|
|
2616
|
+
{
|
|
2617
|
+
onClick: () => {
|
|
2618
|
+
if (module2.url !== "#") {
|
|
2619
|
+
window.open(module2.url, "_blank", "noopener,noreferrer");
|
|
2620
|
+
}
|
|
2621
|
+
setShowModulesMenu(false);
|
|
2622
|
+
},
|
|
2623
|
+
className: cn(
|
|
2624
|
+
"group p-4 rounded-lg bg-gray-100 hover:bg-[#4A5568] transition-all duration-200 text-center",
|
|
2625
|
+
module2.url === "#" && "opacity-50 cursor-not-allowed hover:bg-gray-100"
|
|
2626
|
+
),
|
|
2627
|
+
disabled: module2.url === "#",
|
|
2628
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex flex-col items-center", children: [
|
|
2629
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2630
|
+
"img",
|
|
2631
|
+
{
|
|
2632
|
+
src: module2.icon,
|
|
2633
|
+
alt: module2.name,
|
|
2634
|
+
className: cn("w-12 h-12 mb-2", module2.url !== "#" && "group-hover:hidden")
|
|
2635
|
+
}
|
|
2636
|
+
),
|
|
2637
|
+
module2.url !== "#" && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2638
|
+
"img",
|
|
2639
|
+
{
|
|
2640
|
+
src: module2.iconWhite,
|
|
2641
|
+
alt: module2.name,
|
|
2642
|
+
className: "w-12 h-12 mb-2 hidden group-hover:block"
|
|
2643
|
+
}
|
|
2644
|
+
),
|
|
2645
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: cn("text-sm font-medium text-gray-800", module2.url !== "#" && "group-hover:text-white"), children: module2.name })
|
|
2646
|
+
] })
|
|
2647
|
+
},
|
|
2648
|
+
module2.name
|
|
2649
|
+
)) }) }),
|
|
2650
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "flex-[2] bg-gray-50 rounded-lg p-4", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "grid grid-cols-2 gap-3", children: [
|
|
2651
|
+
{ name: "WiseProcure", icon: procurementblue_default, iconWhite: procurementblanc_default, url: moduleUrls.wiseProcure },
|
|
2652
|
+
{ name: "WiseHR", icon: human_capitalblue_default, iconWhite: human_capitalblanc_default, url: moduleUrls.wiseHR }
|
|
2653
|
+
].map((module2) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2654
|
+
"button",
|
|
2655
|
+
{
|
|
2656
|
+
onClick: () => {
|
|
2657
|
+
window.open(module2.url, "_blank", "noopener,noreferrer");
|
|
2658
|
+
setShowModulesMenu(false);
|
|
2659
|
+
},
|
|
2660
|
+
className: "group p-4 rounded-lg bg-gray-100 hover:bg-[#4A5568] transition-all duration-200 text-center",
|
|
2661
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "flex flex-col items-center", children: [
|
|
2662
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2663
|
+
"img",
|
|
2664
|
+
{
|
|
2665
|
+
src: module2.icon,
|
|
2666
|
+
alt: module2.name,
|
|
2667
|
+
className: "w-12 h-12 mb-2 group-hover:hidden"
|
|
2668
|
+
}
|
|
2669
|
+
),
|
|
2670
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2671
|
+
"img",
|
|
2672
|
+
{
|
|
2673
|
+
src: module2.iconWhite,
|
|
2674
|
+
alt: module2.name,
|
|
2675
|
+
className: "w-12 h-12 mb-2 hidden group-hover:block"
|
|
2676
|
+
}
|
|
2677
|
+
),
|
|
2678
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "text-sm font-medium text-gray-800 group-hover:text-white", children: module2.name })
|
|
2679
|
+
] })
|
|
2680
|
+
},
|
|
2681
|
+
module2.name
|
|
2682
|
+
)) }) })
|
|
2683
|
+
] })
|
|
2684
|
+
] })
|
|
2685
|
+
] })
|
|
2686
|
+
}
|
|
2687
|
+
),
|
|
2110
2688
|
showApprovalModal && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
2111
2689
|
Modals_default,
|
|
2112
2690
|
{
|
|
@@ -2130,7 +2708,7 @@ var ModernDoubleSidebarLayout_default = RewiseLayout;
|
|
|
2130
2708
|
|
|
2131
2709
|
// src/components/ui/Toast.tsx
|
|
2132
2710
|
var import_react6 = require("react");
|
|
2133
|
-
var
|
|
2711
|
+
var import_lucide_react4 = require("lucide-react");
|
|
2134
2712
|
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
2135
2713
|
var ToastItem = ({ toast }) => {
|
|
2136
2714
|
const { removeToast } = useToast();
|
|
@@ -2149,13 +2727,13 @@ var ToastItem = ({ toast }) => {
|
|
|
2149
2727
|
const getIcon = () => {
|
|
2150
2728
|
switch (toast.type) {
|
|
2151
2729
|
case "success":
|
|
2152
|
-
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
2730
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.CheckCircle, { className: "w-5 h-5 text-green-600" });
|
|
2153
2731
|
case "error":
|
|
2154
|
-
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
2732
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.XCircle, { className: "w-5 h-5 text-red-600" });
|
|
2155
2733
|
case "warning":
|
|
2156
|
-
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
2734
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.AlertTriangle, { className: "w-5 h-5 text-yellow-600" });
|
|
2157
2735
|
case "info":
|
|
2158
|
-
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
2736
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.Info, { className: "w-5 h-5 text-blue-600" });
|
|
2159
2737
|
}
|
|
2160
2738
|
};
|
|
2161
2739
|
const getBackgroundColor = () => {
|
|
@@ -2188,7 +2766,7 @@ var ToastItem = ({ toast }) => {
|
|
|
2188
2766
|
{
|
|
2189
2767
|
onClick: handleClose,
|
|
2190
2768
|
className: "flex-shrink-0 ml-4 text-gray-400 hover:text-gray-600 transition-colors",
|
|
2191
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
2769
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.X, { className: "w-4 h-4" })
|
|
2192
2770
|
}
|
|
2193
2771
|
)
|
|
2194
2772
|
]
|
|
@@ -2202,7 +2780,7 @@ var ToastContainer = () => {
|
|
|
2202
2780
|
var Toast_default = ToastContainer;
|
|
2203
2781
|
|
|
2204
2782
|
// src/components/common/Pages.tsx
|
|
2205
|
-
var
|
|
2783
|
+
var import_lucide_react5 = require("lucide-react");
|
|
2206
2784
|
var import_react7 = require("react");
|
|
2207
2785
|
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
2208
2786
|
var Pages = ({
|
|
@@ -2237,7 +2815,7 @@ var Pages = ({
|
|
|
2237
2815
|
onClick: () => setSidebarOpen(!sidebarOpen),
|
|
2238
2816
|
className: "p-2 hover:bg-[var(--color-surface-hover)] rounded-lg transition-colors",
|
|
2239
2817
|
"aria-label": sidebarOpen ? "R\xE9duire" : "Ouvrir",
|
|
2240
|
-
children: sidebarOpen ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
2818
|
+
children: sidebarOpen ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react5.ChevronLeft, { className: "w-5 h-5" }) : /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react5.Menu, { className: "w-5 h-5" })
|
|
2241
2819
|
}
|
|
2242
2820
|
)
|
|
2243
2821
|
] }) }),
|
|
@@ -2258,11 +2836,11 @@ var Pages = ({
|
|
|
2258
2836
|
) }),
|
|
2259
2837
|
sidebarOpen && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "p-4 border-t border-[var(--color-border)]", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "space-y-2", children: [
|
|
2260
2838
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("button", { className: "w-full px-3 py-2 bg-[var(--color-background)] rounded-lg text-sm text-[var(--color-text-secondary)] hover:bg-[var(--color-surface-hover)] transition-colors flex items-center gap-2", children: [
|
|
2261
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
2839
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react5.Download, { className: "w-4 h-4" }),
|
|
2262
2840
|
"Exporter le plan"
|
|
2263
2841
|
] }),
|
|
2264
2842
|
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("button", { className: "w-full px-3 py-2 bg-[var(--color-background)] rounded-lg text-sm text-[var(--color-text-secondary)] hover:bg-[var(--color-surface-hover)] transition-colors flex items-center gap-2", children: [
|
|
2265
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
2843
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_lucide_react5.Settings, { className: "w-4 h-4" }),
|
|
2266
2844
|
"Configuration"
|
|
2267
2845
|
] })
|
|
2268
2846
|
] }) })
|
|
@@ -2272,19 +2850,363 @@ var Pages = ({
|
|
|
2272
2850
|
var Pages_default = Pages;
|
|
2273
2851
|
|
|
2274
2852
|
// src/components/common/FDrawer.tsx
|
|
2275
|
-
var import_react8 = require("react");
|
|
2853
|
+
var import_react8 = __toESM(require("react"), 1);
|
|
2276
2854
|
var import_react_router_dom4 = require("react-router-dom");
|
|
2277
|
-
var
|
|
2855
|
+
var import_lucide_react6 = require("lucide-react");
|
|
2278
2856
|
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
2279
|
-
var
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
toggle
|
|
2857
|
+
var ExcelImportModal = ({
|
|
2858
|
+
isOpen,
|
|
2859
|
+
onClose,
|
|
2860
|
+
importEndpoint,
|
|
2861
|
+
importFields,
|
|
2862
|
+
onSuccess
|
|
2286
2863
|
}) => {
|
|
2287
|
-
const
|
|
2864
|
+
const { activeBusinessEntity, token } = useSession();
|
|
2865
|
+
const fileInputRef = (0, import_react8.useRef)(null);
|
|
2866
|
+
const [file, setFile] = (0, import_react8.useState)(null);
|
|
2867
|
+
const [columnMapping, setColumnMapping] = (0, import_react8.useState)([]);
|
|
2868
|
+
const [loading, setLoading] = (0, import_react8.useState)(false);
|
|
2869
|
+
const [errors, setErrors] = (0, import_react8.useState)([]);
|
|
2870
|
+
const [importResults, setImportResults] = (0, import_react8.useState)(null);
|
|
2871
|
+
const [currentStep, setCurrentStep] = (0, import_react8.useState)(1);
|
|
2872
|
+
const allFields = [...importFields.required, ...importFields.optional];
|
|
2873
|
+
const handleFileChange = (event) => {
|
|
2874
|
+
const selectedFile = event.target.files?.[0];
|
|
2875
|
+
if (selectedFile) {
|
|
2876
|
+
if (!selectedFile.name.match(/\.(xlsx|xls)$/)) {
|
|
2877
|
+
setErrors(["Veuillez s\xE9lectionner un fichier Excel (.xlsx ou .xls)"]);
|
|
2878
|
+
return;
|
|
2879
|
+
}
|
|
2880
|
+
setFile(selectedFile);
|
|
2881
|
+
setErrors([]);
|
|
2882
|
+
setImportResults(null);
|
|
2883
|
+
setColumnMapping([]);
|
|
2884
|
+
setCurrentStep(2);
|
|
2885
|
+
}
|
|
2886
|
+
};
|
|
2887
|
+
const addMappingRow = () => {
|
|
2888
|
+
const newLetter = String.fromCharCode(65 + columnMapping.length);
|
|
2889
|
+
setColumnMapping([...columnMapping, { letter: newLetter, field: "" }]);
|
|
2890
|
+
};
|
|
2891
|
+
const removeMappingRow = (index) => {
|
|
2892
|
+
setColumnMapping(columnMapping.filter((_, i) => i !== index));
|
|
2893
|
+
};
|
|
2894
|
+
const updateMappingLetter = (index, letter) => {
|
|
2895
|
+
const newMapping = [...columnMapping];
|
|
2896
|
+
newMapping[index].letter = letter.toUpperCase();
|
|
2897
|
+
setColumnMapping(newMapping);
|
|
2898
|
+
};
|
|
2899
|
+
const updateMappingField = (index, field) => {
|
|
2900
|
+
const newMapping = [...columnMapping];
|
|
2901
|
+
newMapping[index].field = field;
|
|
2902
|
+
setColumnMapping(newMapping);
|
|
2903
|
+
};
|
|
2904
|
+
const validateMapping = () => {
|
|
2905
|
+
const mappedFields = columnMapping.map((m) => m.field).filter((f) => f);
|
|
2906
|
+
const requiredFields = importFields.required.map((f) => f.value);
|
|
2907
|
+
const missingRequired = requiredFields.filter((field) => !mappedFields.includes(field));
|
|
2908
|
+
if (missingRequired.length > 0) {
|
|
2909
|
+
const missingLabels = missingRequired.map(
|
|
2910
|
+
(field) => allFields.find((f) => f.value === field)?.label || field
|
|
2911
|
+
);
|
|
2912
|
+
setErrors([`Champs obligatoires manquants : ${missingLabels.join(", ")}`]);
|
|
2913
|
+
return false;
|
|
2914
|
+
}
|
|
2915
|
+
const duplicates = mappedFields.filter(
|
|
2916
|
+
(field, index) => mappedFields.indexOf(field) !== index && field !== ""
|
|
2917
|
+
);
|
|
2918
|
+
if (duplicates.length > 0) {
|
|
2919
|
+
const duplicateLabels = [...new Set(duplicates)].map(
|
|
2920
|
+
(field) => allFields.find((f) => f.value === field)?.label || field
|
|
2921
|
+
);
|
|
2922
|
+
setErrors([`Champs en double : ${duplicateLabels.join(", ")}`]);
|
|
2923
|
+
return false;
|
|
2924
|
+
}
|
|
2925
|
+
setErrors([]);
|
|
2926
|
+
return true;
|
|
2927
|
+
};
|
|
2928
|
+
const executeImport = async () => {
|
|
2929
|
+
if (!validateMapping()) return;
|
|
2930
|
+
if (!file) return;
|
|
2931
|
+
setLoading(true);
|
|
2932
|
+
try {
|
|
2933
|
+
const formData = new FormData();
|
|
2934
|
+
formData.append("excel_file", file);
|
|
2935
|
+
const mapping = {};
|
|
2936
|
+
columnMapping.forEach(({ letter, field }) => {
|
|
2937
|
+
if (field) {
|
|
2938
|
+
mapping[letter] = field;
|
|
2939
|
+
}
|
|
2940
|
+
});
|
|
2941
|
+
formData.append("column_mapping", JSON.stringify(mapping));
|
|
2942
|
+
const response = await fetch(`${API_URL}${importEndpoint}?business_entity_id=${activeBusinessEntity?.id}`, {
|
|
2943
|
+
method: "POST",
|
|
2944
|
+
headers: {
|
|
2945
|
+
"Authorization": `token ${token}`
|
|
2946
|
+
},
|
|
2947
|
+
body: formData
|
|
2948
|
+
});
|
|
2949
|
+
const result = await response.json();
|
|
2950
|
+
if (result.success) {
|
|
2951
|
+
setImportResults(result);
|
|
2952
|
+
setCurrentStep(3);
|
|
2953
|
+
} else {
|
|
2954
|
+
setErrors([result.message?.default || "Erreur lors de l'importation"]);
|
|
2955
|
+
if (result.errors) {
|
|
2956
|
+
const errorMessages = Object.values(result.errors).flat();
|
|
2957
|
+
setErrors((prev) => [...prev, ...errorMessages]);
|
|
2958
|
+
}
|
|
2959
|
+
}
|
|
2960
|
+
} catch (error) {
|
|
2961
|
+
console.error("Erreur:", error);
|
|
2962
|
+
setErrors(["Une erreur est survenue lors de l'importation"]);
|
|
2963
|
+
} finally {
|
|
2964
|
+
setLoading(false);
|
|
2965
|
+
}
|
|
2966
|
+
};
|
|
2967
|
+
const resetModal = () => {
|
|
2968
|
+
setFile(null);
|
|
2969
|
+
setColumnMapping([]);
|
|
2970
|
+
setErrors([]);
|
|
2971
|
+
setImportResults(null);
|
|
2972
|
+
setCurrentStep(1);
|
|
2973
|
+
if (fileInputRef.current) {
|
|
2974
|
+
fileInputRef.current.value = "";
|
|
2975
|
+
}
|
|
2976
|
+
};
|
|
2977
|
+
const handleClose = () => {
|
|
2978
|
+
resetModal();
|
|
2979
|
+
onClose();
|
|
2980
|
+
};
|
|
2981
|
+
const handleSuccess = () => {
|
|
2982
|
+
if (onSuccess) onSuccess();
|
|
2983
|
+
handleClose();
|
|
2984
|
+
};
|
|
2985
|
+
if (!isOpen) return null;
|
|
2986
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "fixed inset-0 z-50 flex items-center justify-center", children: [
|
|
2987
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "absolute inset-0 bg-black/50", onClick: handleClose }),
|
|
2988
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "relative bg-white rounded-xl shadow-2xl w-full max-w-2xl max-h-[90vh] overflow-hidden", children: [
|
|
2989
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex items-center justify-between p-4 border-b border-gray-200", children: [
|
|
2990
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
2991
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react6.FileSpreadsheet, { className: "h-6 w-6 text-green-600" }),
|
|
2992
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("h2", { className: "text-lg font-semibold text-gray-800", children: "Importation Excel" }),
|
|
2993
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { className: "text-sm text-gray-500", children: [
|
|
2994
|
+
"\xC9tape ",
|
|
2995
|
+
currentStep,
|
|
2996
|
+
"/3"
|
|
2997
|
+
] })
|
|
2998
|
+
] }),
|
|
2999
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("button", { type: "button", onClick: handleClose, className: "p-1 hover:bg-gray-100 rounded-lg", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react6.X, { className: "h-5 w-5 text-gray-500" }) })
|
|
3000
|
+
] }),
|
|
3001
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "flex justify-center py-4 border-b border-gray-100", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "flex items-center gap-2", children: [1, 2, 3].map((step, index) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_react8.default.Fragment, { children: [
|
|
3002
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: cn(
|
|
3003
|
+
"w-8 h-8 rounded-full flex items-center justify-center text-sm font-medium transition-colors",
|
|
3004
|
+
currentStep >= step ? "bg-[var(--color-primary)] text-white" : "bg-gray-200 text-gray-500"
|
|
3005
|
+
), children: currentStep > step ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react6.CheckCircle2, { className: "h-5 w-5" }) : step }),
|
|
3006
|
+
index < 2 && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: cn(
|
|
3007
|
+
"w-12 h-1 rounded",
|
|
3008
|
+
currentStep > step ? "bg-[var(--color-primary)]" : "bg-gray-200"
|
|
3009
|
+
) })
|
|
3010
|
+
] }, step)) }) }),
|
|
3011
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "p-6 overflow-y-auto max-h-[60vh]", children: [
|
|
3012
|
+
errors.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "mb-4 p-4 bg-red-50 border border-red-200 rounded-lg", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex items-start gap-2", children: [
|
|
3013
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react6.AlertCircle, { className: "h-5 w-5 text-red-500 mt-0.5" }),
|
|
3014
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { children: errors.map((error, index) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "text-sm text-red-700", children: error }, index)) })
|
|
3015
|
+
] }) }),
|
|
3016
|
+
currentStep === 1 && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "text-center py-8", children: [
|
|
3017
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react6.FileSpreadsheet, { className: "h-16 w-16 text-green-500 mx-auto mb-4" }),
|
|
3018
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("h3", { className: "text-lg font-medium text-gray-800 mb-2", children: "S\xE9lectionner un fichier Excel" }),
|
|
3019
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "text-sm text-gray-500 mb-6", children: "Formats accept\xE9s : .xlsx, .xls" }),
|
|
3020
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
3021
|
+
"input",
|
|
3022
|
+
{
|
|
3023
|
+
ref: fileInputRef,
|
|
3024
|
+
type: "file",
|
|
3025
|
+
accept: ".xlsx,.xls",
|
|
3026
|
+
onChange: handleFileChange,
|
|
3027
|
+
className: "block w-full text-sm text-gray-500 file:mr-4 file:py-2 file:px-4 file:rounded-lg file:border-0 file:text-sm file:font-medium file:bg-[var(--color-primary)] file:text-white hover:file:bg-[var(--color-primary-dark)] cursor-pointer"
|
|
3028
|
+
}
|
|
3029
|
+
),
|
|
3030
|
+
file && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "mt-4 p-3 bg-blue-50 rounded-lg text-left", children: [
|
|
3031
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("p", { className: "text-sm text-blue-800", children: [
|
|
3032
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("strong", { children: "Fichier s\xE9lectionn\xE9 :" }),
|
|
3033
|
+
" ",
|
|
3034
|
+
file.name
|
|
3035
|
+
] }),
|
|
3036
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("p", { className: "text-xs text-blue-600", children: [
|
|
3037
|
+
"Taille : ",
|
|
3038
|
+
(file.size / 1024 / 1024).toFixed(2),
|
|
3039
|
+
" MB"
|
|
3040
|
+
] })
|
|
3041
|
+
] })
|
|
3042
|
+
] }),
|
|
3043
|
+
currentStep === 2 && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { children: [
|
|
3044
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex items-center justify-between mb-4", children: [
|
|
3045
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("h3", { className: "text-lg font-medium text-gray-800", children: "Configuration du mapping" }),
|
|
3046
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
3047
|
+
"button",
|
|
3048
|
+
{
|
|
3049
|
+
type: "button",
|
|
3050
|
+
onClick: addMappingRow,
|
|
3051
|
+
className: "flex items-center gap-1 px-3 py-1.5 bg-[var(--color-primary)] text-white rounded-lg text-sm hover:bg-[var(--color-primary-dark)]",
|
|
3052
|
+
children: [
|
|
3053
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react6.Plus, { className: "h-4 w-4" }),
|
|
3054
|
+
" Ajouter"
|
|
3055
|
+
]
|
|
3056
|
+
}
|
|
3057
|
+
)
|
|
3058
|
+
] }),
|
|
3059
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "mb-4 p-3 bg-amber-50 border border-amber-200 rounded-lg", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("p", { className: "text-sm text-amber-800", children: [
|
|
3060
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("strong", { children: "Instructions :" }),
|
|
3061
|
+
" Associez chaque lettre de colonne Excel au champ correspondant. Les champs marqu\xE9s d'un (*) sont obligatoires."
|
|
3062
|
+
] }) }),
|
|
3063
|
+
columnMapping.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "text-center py-8", children: [
|
|
3064
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "text-gray-500 mb-4", children: 'Cliquez sur "Ajouter" pour commencer le mapping' }),
|
|
3065
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
3066
|
+
"button",
|
|
3067
|
+
{
|
|
3068
|
+
type: "button",
|
|
3069
|
+
onClick: addMappingRow,
|
|
3070
|
+
className: "flex items-center gap-2 mx-auto px-4 py-2 border border-gray-300 rounded-lg text-gray-700 hover:bg-gray-50",
|
|
3071
|
+
children: [
|
|
3072
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react6.Plus, { className: "h-4 w-4" }),
|
|
3073
|
+
" Ajouter la premi\xE8re colonne"
|
|
3074
|
+
]
|
|
3075
|
+
}
|
|
3076
|
+
)
|
|
3077
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "space-y-3", children: columnMapping.map((mapping, index) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex items-center gap-3", children: [
|
|
3078
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "w-20", children: [
|
|
3079
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("label", { className: "block text-xs text-gray-500 mb-1", children: "Colonne" }),
|
|
3080
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
3081
|
+
"input",
|
|
3082
|
+
{
|
|
3083
|
+
type: "text",
|
|
3084
|
+
value: mapping.letter,
|
|
3085
|
+
onChange: (e) => updateMappingLetter(index, e.target.value),
|
|
3086
|
+
className: "w-full px-3 py-2 border border-gray-300 rounded-lg text-center uppercase",
|
|
3087
|
+
maxLength: 2
|
|
3088
|
+
}
|
|
3089
|
+
)
|
|
3090
|
+
] }),
|
|
3091
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex-1", children: [
|
|
3092
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("label", { className: "block text-xs text-gray-500 mb-1", children: "Champ correspondant" }),
|
|
3093
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
3094
|
+
"select",
|
|
3095
|
+
{
|
|
3096
|
+
value: mapping.field,
|
|
3097
|
+
onChange: (e) => updateMappingField(index, e.target.value),
|
|
3098
|
+
className: "w-full px-3 py-2 border border-gray-300 rounded-lg bg-white",
|
|
3099
|
+
children: [
|
|
3100
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("option", { value: "", children: "-- S\xE9lectionner un champ --" }),
|
|
3101
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("optgroup", { label: "Champs obligatoires", children: importFields.required.map((field) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("option", { value: field.value, children: field.label }, field.value)) }),
|
|
3102
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("optgroup", { label: "Champs optionnels", children: importFields.optional.map((field) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("option", { value: field.value, children: field.label }, field.value)) })
|
|
3103
|
+
]
|
|
3104
|
+
}
|
|
3105
|
+
)
|
|
3106
|
+
] }),
|
|
3107
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
3108
|
+
"button",
|
|
3109
|
+
{
|
|
3110
|
+
type: "button",
|
|
3111
|
+
onClick: () => removeMappingRow(index),
|
|
3112
|
+
className: "p-2 text-red-500 hover:bg-red-50 rounded-lg mt-5",
|
|
3113
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react6.Trash2, { className: "h-4 w-4" })
|
|
3114
|
+
}
|
|
3115
|
+
)
|
|
3116
|
+
] }, index)) }),
|
|
3117
|
+
columnMapping.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex justify-between mt-6 pt-4 border-t border-gray-200", children: [
|
|
3118
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
3119
|
+
"button",
|
|
3120
|
+
{
|
|
3121
|
+
type: "button",
|
|
3122
|
+
onClick: () => setCurrentStep(1),
|
|
3123
|
+
className: "px-4 py-2 text-gray-600 hover:bg-gray-100 rounded-lg",
|
|
3124
|
+
children: "Retour"
|
|
3125
|
+
}
|
|
3126
|
+
),
|
|
3127
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
3128
|
+
"button",
|
|
3129
|
+
{
|
|
3130
|
+
type: "button",
|
|
3131
|
+
onClick: executeImport,
|
|
3132
|
+
disabled: loading,
|
|
3133
|
+
className: "flex items-center gap-2 px-4 py-2 bg-[var(--color-primary)] text-white rounded-lg hover:bg-[var(--color-primary-dark)] disabled:opacity-50",
|
|
3134
|
+
children: loading ? /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
|
|
3135
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "animate-spin h-4 w-4 border-2 border-white border-t-transparent rounded-full" }),
|
|
3136
|
+
"Importation..."
|
|
3137
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
|
|
3138
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react6.Upload, { className: "h-4 w-4" }),
|
|
3139
|
+
"Lancer l'importation"
|
|
3140
|
+
] })
|
|
3141
|
+
}
|
|
3142
|
+
)
|
|
3143
|
+
] })
|
|
3144
|
+
] }),
|
|
3145
|
+
currentStep === 3 && importResults && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "text-center py-4", children: [
|
|
3146
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react6.CheckCircle2, { className: "h-16 w-16 text-green-500 mx-auto mb-4" }),
|
|
3147
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("h3", { className: "text-lg font-medium text-gray-800 mb-6", children: "Importation termin\xE9e !" }),
|
|
3148
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "grid grid-cols-4 gap-4 mb-6", children: [
|
|
3149
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "p-4 bg-blue-50 rounded-lg", children: [
|
|
3150
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "text-2xl font-bold text-blue-600", children: importResults.results.total_rows }),
|
|
3151
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "text-xs text-blue-800", children: "Lignes lues" })
|
|
3152
|
+
] }),
|
|
3153
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "p-4 bg-green-50 rounded-lg", children: [
|
|
3154
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "text-2xl font-bold text-green-600", children: importResults.results.saved_rows }),
|
|
3155
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "text-xs text-green-800", children: "Import\xE9es" })
|
|
3156
|
+
] }),
|
|
3157
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "p-4 bg-amber-50 rounded-lg", children: [
|
|
3158
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "text-2xl font-bold text-amber-600", children: importResults.results.processed_rows - importResults.results.saved_rows }),
|
|
3159
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "text-xs text-amber-800", children: "Ignor\xE9es" })
|
|
3160
|
+
] }),
|
|
3161
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "p-4 bg-red-50 rounded-lg", children: [
|
|
3162
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "text-2xl font-bold text-red-600", children: importResults.results.errors_count || 0 }),
|
|
3163
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "text-xs text-red-800", children: "Erreurs" })
|
|
3164
|
+
] })
|
|
3165
|
+
] }),
|
|
3166
|
+
importResults.data?.import_summary?.validation_errors && importResults.data.import_summary.validation_errors.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "mb-6 p-4 bg-amber-50 border border-amber-200 rounded-lg text-left", children: [
|
|
3167
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "font-medium text-amber-800 mb-2", children: "Erreurs de validation :" }),
|
|
3168
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("ul", { className: "text-sm text-amber-700 space-y-1", children: importResults.data.import_summary.validation_errors.slice(0, 5).map((error, index) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("li", { children: [
|
|
3169
|
+
"Ligne ",
|
|
3170
|
+
error.row,
|
|
3171
|
+
" : ",
|
|
3172
|
+
Object.entries(error.errors).map(
|
|
3173
|
+
([field, messages]) => `${field}: ${messages.join(", ")}`
|
|
3174
|
+
).join("; ")
|
|
3175
|
+
] }, index)) }),
|
|
3176
|
+
importResults.data.import_summary.validation_errors.length > 5 && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("p", { className: "text-xs text-amber-600 mt-2", children: [
|
|
3177
|
+
"... et ",
|
|
3178
|
+
importResults.data.import_summary.validation_errors.length - 5,
|
|
3179
|
+
" autres erreurs"
|
|
3180
|
+
] })
|
|
3181
|
+
] }),
|
|
3182
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
3183
|
+
"button",
|
|
3184
|
+
{
|
|
3185
|
+
type: "button",
|
|
3186
|
+
onClick: handleSuccess,
|
|
3187
|
+
className: "px-6 py-2 bg-[var(--color-primary)] text-white rounded-lg hover:bg-[var(--color-primary-dark)]",
|
|
3188
|
+
children: "Terminer"
|
|
3189
|
+
}
|
|
3190
|
+
)
|
|
3191
|
+
] })
|
|
3192
|
+
] })
|
|
3193
|
+
] })
|
|
3194
|
+
] });
|
|
3195
|
+
};
|
|
3196
|
+
var FDrawer = ({
|
|
3197
|
+
children,
|
|
3198
|
+
apiEndpoint,
|
|
3199
|
+
columns,
|
|
3200
|
+
actions,
|
|
3201
|
+
ordering,
|
|
3202
|
+
toggle,
|
|
3203
|
+
importEndpoint,
|
|
3204
|
+
importFields,
|
|
3205
|
+
onBulkDelete,
|
|
3206
|
+
onDuplicate,
|
|
3207
|
+
title
|
|
3208
|
+
}) => {
|
|
3209
|
+
const navigate = (0, import_react_router_dom4.useNavigate)();
|
|
2288
3210
|
const [searchParams] = (0, import_react_router_dom4.useSearchParams)();
|
|
2289
3211
|
const location = (0, import_react_router_dom4.useLocation)();
|
|
2290
3212
|
const allParams = Object.fromEntries([...searchParams]);
|
|
@@ -2303,6 +3225,59 @@ var FDrawer = ({
|
|
|
2303
3225
|
current_page: null
|
|
2304
3226
|
});
|
|
2305
3227
|
const [searchQuery, setSearchQuery] = (0, import_react8.useState)("");
|
|
3228
|
+
const [debouncedSearchQuery, setDebouncedSearchQuery] = (0, import_react8.useState)("");
|
|
3229
|
+
const searchTimeoutRef = (0, import_react8.useRef)(null);
|
|
3230
|
+
const [showFilterPanel, setShowFilterPanel] = (0, import_react8.useState)(false);
|
|
3231
|
+
const filterPanelRef = (0, import_react8.useRef)(null);
|
|
3232
|
+
const [showImportModal, setShowImportModal] = (0, import_react8.useState)(false);
|
|
3233
|
+
const [showMoreOptions, setShowMoreOptions] = (0, import_react8.useState)(false);
|
|
3234
|
+
const moreOptionsRef = (0, import_react8.useRef)(null);
|
|
3235
|
+
const [selectionMode, setSelectionMode] = (0, import_react8.useState)(false);
|
|
3236
|
+
const [selectedItems, setSelectedItems] = (0, import_react8.useState)([]);
|
|
3237
|
+
const [showColumnsPanel, setShowColumnsPanel] = (0, import_react8.useState)(false);
|
|
3238
|
+
const [visibleColumns, setVisibleColumns] = (0, import_react8.useState)(columns.map((c) => c.key));
|
|
3239
|
+
const columnsPanelRef = (0, import_react8.useRef)(null);
|
|
3240
|
+
const [density, setDensity] = (0, import_react8.useState)("normal");
|
|
3241
|
+
const [isFullscreen, setIsFullscreen] = (0, import_react8.useState)(false);
|
|
3242
|
+
const tableContainerRef = (0, import_react8.useRef)(null);
|
|
3243
|
+
(0, import_react8.useEffect)(() => {
|
|
3244
|
+
if (searchTimeoutRef.current) {
|
|
3245
|
+
clearTimeout(searchTimeoutRef.current);
|
|
3246
|
+
}
|
|
3247
|
+
searchTimeoutRef.current = setTimeout(() => {
|
|
3248
|
+
setDebouncedSearchQuery(searchQuery);
|
|
3249
|
+
}, 400);
|
|
3250
|
+
return () => {
|
|
3251
|
+
if (searchTimeoutRef.current) {
|
|
3252
|
+
clearTimeout(searchTimeoutRef.current);
|
|
3253
|
+
}
|
|
3254
|
+
};
|
|
3255
|
+
}, [searchQuery]);
|
|
3256
|
+
(0, import_react8.useEffect)(() => {
|
|
3257
|
+
setFilters((prev) => ({ ...prev, global_search: debouncedSearchQuery, page: 1 }));
|
|
3258
|
+
}, [debouncedSearchQuery]);
|
|
3259
|
+
(0, import_react8.useEffect)(() => {
|
|
3260
|
+
const handleClickOutside = (event) => {
|
|
3261
|
+
if (filterPanelRef.current && !filterPanelRef.current.contains(event.target)) {
|
|
3262
|
+
setShowFilterPanel(false);
|
|
3263
|
+
}
|
|
3264
|
+
if (moreOptionsRef.current && !moreOptionsRef.current.contains(event.target)) {
|
|
3265
|
+
setShowMoreOptions(false);
|
|
3266
|
+
}
|
|
3267
|
+
if (columnsPanelRef.current && !columnsPanelRef.current.contains(event.target)) {
|
|
3268
|
+
setShowColumnsPanel(false);
|
|
3269
|
+
}
|
|
3270
|
+
};
|
|
3271
|
+
document.addEventListener("mousedown", handleClickOutside);
|
|
3272
|
+
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
3273
|
+
}, []);
|
|
3274
|
+
(0, import_react8.useEffect)(() => {
|
|
3275
|
+
const handleFullscreenChange = () => {
|
|
3276
|
+
setIsFullscreen(!!document.fullscreenElement);
|
|
3277
|
+
};
|
|
3278
|
+
document.addEventListener("fullscreenchange", handleFullscreenChange);
|
|
3279
|
+
return () => document.removeEventListener("fullscreenchange", handleFullscreenChange);
|
|
3280
|
+
}, []);
|
|
2306
3281
|
const makeFilters = () => columns.reduce((acc, item) => {
|
|
2307
3282
|
acc[item.formule ? `${item.search_name}__icontains` : `${item.key}__icontains`] = "";
|
|
2308
3283
|
return acc;
|
|
@@ -2332,7 +3307,13 @@ var FDrawer = ({
|
|
|
2332
3307
|
}
|
|
2333
3308
|
};
|
|
2334
3309
|
(0, import_react8.useEffect)(() => {
|
|
2335
|
-
const
|
|
3310
|
+
const cleanFilters = {};
|
|
3311
|
+
Object.entries(filters).forEach(([key, value]) => {
|
|
3312
|
+
if (value !== "" && value !== null && value !== void 0) {
|
|
3313
|
+
cleanFilters[key] = String(value);
|
|
3314
|
+
}
|
|
3315
|
+
});
|
|
3316
|
+
const params = new URLSearchParams(cleanFilters).toString();
|
|
2336
3317
|
setQueryURL(`${API_URL}${apiEndpoint}?${params}`);
|
|
2337
3318
|
navigate(`${location.pathname}?${params}`);
|
|
2338
3319
|
}, [filters]);
|
|
@@ -2416,61 +3397,401 @@ var FDrawer = ({
|
|
|
2416
3397
|
cellContent = new Date(item[column.key]).toLocaleDateString();
|
|
2417
3398
|
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("td", { className: "px-6 py-4 whitespace-nowrap text-sm text-gray-500", children: cellContent }, column.key);
|
|
2418
3399
|
});
|
|
3400
|
+
const handleExport = async () => {
|
|
3401
|
+
try {
|
|
3402
|
+
const exportParams = new URLSearchParams(filters);
|
|
3403
|
+
exportParams.set("export", "true");
|
|
3404
|
+
exportParams.set("all", "true");
|
|
3405
|
+
const exportURL = `${API_URL}${apiEndpoint}?${exportParams.toString()}`;
|
|
3406
|
+
const response = await fetch(exportURL, {
|
|
3407
|
+
method: "GET",
|
|
3408
|
+
headers: {
|
|
3409
|
+
"Authorization": `token ${token}`
|
|
3410
|
+
}
|
|
3411
|
+
});
|
|
3412
|
+
if (!response.ok) throw new Error("Erreur lors de l'export");
|
|
3413
|
+
const blob = await response.blob();
|
|
3414
|
+
const url = window.URL.createObjectURL(blob);
|
|
3415
|
+
const a = document.createElement("a");
|
|
3416
|
+
a.href = url;
|
|
3417
|
+
a.download = `export_${(/* @__PURE__ */ new Date()).toISOString().split("T")[0]}.xlsx`;
|
|
3418
|
+
document.body.appendChild(a);
|
|
3419
|
+
a.click();
|
|
3420
|
+
window.URL.revokeObjectURL(url);
|
|
3421
|
+
document.body.removeChild(a);
|
|
3422
|
+
} catch (error) {
|
|
3423
|
+
console.error("Erreur export:", error);
|
|
3424
|
+
}
|
|
3425
|
+
};
|
|
3426
|
+
const handlePrint = () => {
|
|
3427
|
+
const printContent = document.getElementById("fdrawer-table");
|
|
3428
|
+
if (!printContent) return;
|
|
3429
|
+
const printWindow = window.open("", "_blank");
|
|
3430
|
+
if (!printWindow) return;
|
|
3431
|
+
printWindow.document.write(`
|
|
3432
|
+
<html>
|
|
3433
|
+
<head>
|
|
3434
|
+
<title>Impression</title>
|
|
3435
|
+
<style>
|
|
3436
|
+
body { font-family: Arial, sans-serif; padding: 20px; }
|
|
3437
|
+
table { width: 100%; border-collapse: collapse; }
|
|
3438
|
+
th, td { border: 1px solid #ddd; padding: 8px; text-align: left; }
|
|
3439
|
+
th { background-color: #f5f5f5; font-weight: bold; }
|
|
3440
|
+
tr:nth-child(even) { background-color: #fafafa; }
|
|
3441
|
+
@media print {
|
|
3442
|
+
@page { margin: 1cm; }
|
|
3443
|
+
}
|
|
3444
|
+
</style>
|
|
3445
|
+
</head>
|
|
3446
|
+
<body>
|
|
3447
|
+
${printContent.outerHTML}
|
|
3448
|
+
</body>
|
|
3449
|
+
</html>
|
|
3450
|
+
`);
|
|
3451
|
+
printWindow.document.close();
|
|
3452
|
+
printWindow.print();
|
|
3453
|
+
};
|
|
3454
|
+
const resetFilters = () => {
|
|
3455
|
+
const cleanFilters = {
|
|
3456
|
+
...makeFilters(),
|
|
3457
|
+
business_entity_id: activeBusinessEntity?.id ?? null,
|
|
3458
|
+
order_by: order_by ?? "id",
|
|
3459
|
+
page: 1,
|
|
3460
|
+
global_search: ""
|
|
3461
|
+
};
|
|
3462
|
+
setFilters(cleanFilters);
|
|
3463
|
+
setSearchQuery("");
|
|
3464
|
+
setShowFilterPanel(false);
|
|
3465
|
+
};
|
|
3466
|
+
const getActiveFiltersCount = () => {
|
|
3467
|
+
let count = 0;
|
|
3468
|
+
Object.entries(filters).forEach(([key, value]) => {
|
|
3469
|
+
if (value && key !== "business_entity_id" && key !== "order_by" && key !== "page" && key !== "global_search") {
|
|
3470
|
+
count++;
|
|
3471
|
+
}
|
|
3472
|
+
});
|
|
3473
|
+
return count;
|
|
3474
|
+
};
|
|
3475
|
+
const activeFiltersCount = getActiveFiltersCount();
|
|
3476
|
+
const toggleSelectItem = (id) => {
|
|
3477
|
+
setSelectedItems(
|
|
3478
|
+
(prev) => prev.includes(id) ? prev.filter((i) => i !== id) : [...prev, id]
|
|
3479
|
+
);
|
|
3480
|
+
};
|
|
3481
|
+
const toggleSelectAll = () => {
|
|
3482
|
+
if (selectedItems.length === data.length) {
|
|
3483
|
+
setSelectedItems([]);
|
|
3484
|
+
} else {
|
|
3485
|
+
setSelectedItems(data.map((item) => item.id));
|
|
3486
|
+
}
|
|
3487
|
+
};
|
|
3488
|
+
const clearSelection = () => {
|
|
3489
|
+
setSelectedItems([]);
|
|
3490
|
+
setSelectionMode(false);
|
|
3491
|
+
};
|
|
3492
|
+
const handleBulkDelete = async () => {
|
|
3493
|
+
if (!onBulkDelete || selectedItems.length === 0) return;
|
|
3494
|
+
if (confirm(`Voulez-vous vraiment supprimer ${selectedItems.length} \xE9l\xE9ment(s) ?`)) {
|
|
3495
|
+
try {
|
|
3496
|
+
await onBulkDelete(selectedItems);
|
|
3497
|
+
clearSelection();
|
|
3498
|
+
getDataFilter();
|
|
3499
|
+
} catch (error) {
|
|
3500
|
+
console.error("Erreur lors de la suppression group\xE9e:", error);
|
|
3501
|
+
}
|
|
3502
|
+
}
|
|
3503
|
+
};
|
|
3504
|
+
const handleDuplicate = async (item) => {
|
|
3505
|
+
if (!onDuplicate) return;
|
|
3506
|
+
try {
|
|
3507
|
+
await onDuplicate(item);
|
|
3508
|
+
getDataFilter();
|
|
3509
|
+
} catch (error) {
|
|
3510
|
+
console.error("Erreur lors de la duplication:", error);
|
|
3511
|
+
}
|
|
3512
|
+
};
|
|
3513
|
+
const toggleColumnVisibility = (key) => {
|
|
3514
|
+
setVisibleColumns(
|
|
3515
|
+
(prev) => prev.includes(key) ? prev.filter((k) => k !== key) : [...prev, key]
|
|
3516
|
+
);
|
|
3517
|
+
};
|
|
3518
|
+
const toggleFullscreen = () => {
|
|
3519
|
+
if (!tableContainerRef.current) return;
|
|
3520
|
+
if (!document.fullscreenElement) {
|
|
3521
|
+
tableContainerRef.current.requestFullscreen();
|
|
3522
|
+
} else {
|
|
3523
|
+
document.exitFullscreen();
|
|
3524
|
+
}
|
|
3525
|
+
};
|
|
3526
|
+
const getDensityClasses = () => {
|
|
3527
|
+
switch (density) {
|
|
3528
|
+
case "compact":
|
|
3529
|
+
return { cell: "px-3 py-1", text: "text-xs" };
|
|
3530
|
+
case "comfortable":
|
|
3531
|
+
return { cell: "px-8 py-5", text: "text-base" };
|
|
3532
|
+
default:
|
|
3533
|
+
return { cell: "px-6 py-4", text: "text-sm" };
|
|
3534
|
+
}
|
|
3535
|
+
};
|
|
3536
|
+
const densityClasses = getDensityClasses();
|
|
3537
|
+
const visibleColumnsData = columns.filter((col) => visibleColumns.includes(col.key));
|
|
2419
3538
|
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
|
|
2420
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex flex-wrap gap-4", children: [
|
|
3539
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex flex-wrap gap-4 mb-4", children: [
|
|
2421
3540
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "flex-1 min-w-64", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "relative", children: [
|
|
2422
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
3541
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react6.Search, { className: "absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 h-4 w-4" }),
|
|
2423
3542
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
2424
3543
|
"input",
|
|
2425
3544
|
{
|
|
2426
3545
|
type: "text",
|
|
2427
|
-
placeholder: "Rechercher
|
|
2428
|
-
className: "w-full pl-10 pr-
|
|
3546
|
+
placeholder: "Rechercher sur tous les champs...",
|
|
3547
|
+
className: "w-full pl-10 pr-10 py-2 border border-[#d1d7de] rounded-lg focus:ring-2 focus:ring-[#78a6d2] focus:border-transparent",
|
|
2429
3548
|
value: searchQuery,
|
|
2430
3549
|
onChange: (e) => setSearchQuery(e.target.value)
|
|
2431
3550
|
}
|
|
3551
|
+
),
|
|
3552
|
+
searchQuery && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
3553
|
+
"button",
|
|
3554
|
+
{
|
|
3555
|
+
type: "button",
|
|
3556
|
+
onClick: () => setSearchQuery(""),
|
|
3557
|
+
className: "absolute right-3 top-1/2 transform -translate-y-1/2 text-gray-400 hover:text-gray-600",
|
|
3558
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react6.X, { className: "h-4 w-4" })
|
|
3559
|
+
}
|
|
2432
3560
|
)
|
|
2433
3561
|
] }) }),
|
|
2434
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
2435
|
-
Buttons_default,
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
},
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
]
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
|
|
2466
|
-
|
|
3562
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "relative", ref: filterPanelRef, children: [
|
|
3563
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(Buttons_default, { onClick: () => setShowFilterPanel(!showFilterPanel), type: "button", children: [
|
|
3564
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react6.Filter, { className: "h-4 w-4 mr-2" }),
|
|
3565
|
+
"Filtres",
|
|
3566
|
+
activeFiltersCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "ml-2 bg-white text-[var(--color-primary)] rounded-full px-2 py-0.5 text-xs font-bold", children: activeFiltersCount }),
|
|
3567
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react6.ChevronDown, { className: cn("h-4 w-4 ml-1 transition-transform", showFilterPanel && "rotate-180") })
|
|
3568
|
+
] }),
|
|
3569
|
+
showFilterPanel && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "absolute right-0 mt-2 w-[400px] bg-white rounded-lg shadow-xl border border-gray-200 z-50 max-h-[70vh] overflow-y-auto", children: [
|
|
3570
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "p-4 border-b border-gray-200 flex items-center justify-between", children: [
|
|
3571
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("h3", { className: "font-semibold text-gray-800", children: "Filtres avanc\xE9s" }),
|
|
3572
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
3573
|
+
"button",
|
|
3574
|
+
{
|
|
3575
|
+
type: "button",
|
|
3576
|
+
onClick: resetFilters,
|
|
3577
|
+
className: "text-sm text-blue-600 hover:text-blue-800",
|
|
3578
|
+
children: "R\xE9initialiser"
|
|
3579
|
+
}
|
|
3580
|
+
)
|
|
3581
|
+
] }),
|
|
3582
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "p-4 space-y-4", children: columns.filter((col) => col.filterable).map((column) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "space-y-1", children: [
|
|
3583
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("label", { className: "block text-sm font-medium text-gray-700", children: column.label }),
|
|
3584
|
+
renderColumnFilter(column)
|
|
3585
|
+
] }, column.key)) }),
|
|
3586
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "p-4 border-t border-gray-200 flex justify-end gap-2", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
3587
|
+
"button",
|
|
3588
|
+
{
|
|
3589
|
+
type: "button",
|
|
3590
|
+
onClick: () => setShowFilterPanel(false),
|
|
3591
|
+
className: "px-4 py-2 text-sm text-gray-600 hover:bg-gray-100 rounded-lg",
|
|
3592
|
+
children: "Fermer"
|
|
3593
|
+
}
|
|
3594
|
+
) })
|
|
3595
|
+
] })
|
|
3596
|
+
] }),
|
|
3597
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(Buttons_default, { onClick: handleExport, type: "button", children: [
|
|
3598
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react6.Download, { className: "h-4 w-4 mr-2" }),
|
|
3599
|
+
"Exporter"
|
|
3600
|
+
] }),
|
|
3601
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(Buttons_default, { onClick: handlePrint, type: "button", children: [
|
|
3602
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react6.Printer, { className: "h-4 w-4 mr-2" }),
|
|
3603
|
+
"Imprimer"
|
|
3604
|
+
] }),
|
|
3605
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "relative", ref: moreOptionsRef, children: [
|
|
3606
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(Buttons_default, { onClick: () => setShowMoreOptions(!showMoreOptions), type: "button", children: [
|
|
3607
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react6.Settings2, { className: "h-4 w-4 mr-2" }),
|
|
3608
|
+
"Plus",
|
|
3609
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react6.ChevronDown, { className: cn("h-4 w-4 ml-1 transition-transform", showMoreOptions && "rotate-180") })
|
|
3610
|
+
] }),
|
|
3611
|
+
showMoreOptions && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "absolute right-0 mt-2 w-64 bg-white rounded-lg shadow-xl border border-gray-200 z-50 py-2", children: [
|
|
3612
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
3613
|
+
"button",
|
|
3614
|
+
{
|
|
3615
|
+
type: "button",
|
|
3616
|
+
onClick: () => {
|
|
3617
|
+
getDataFilter();
|
|
3618
|
+
setShowMoreOptions(false);
|
|
3619
|
+
},
|
|
3620
|
+
className: "w-full px-4 py-2 text-left text-sm text-gray-700 hover:bg-gray-50 flex items-center gap-3",
|
|
3621
|
+
children: [
|
|
3622
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react6.RefreshCw, { className: "h-4 w-4" }),
|
|
3623
|
+
"Actualiser les donn\xE9es"
|
|
3624
|
+
]
|
|
3625
|
+
}
|
|
3626
|
+
),
|
|
3627
|
+
importEndpoint && importFields && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
3628
|
+
"button",
|
|
3629
|
+
{
|
|
3630
|
+
type: "button",
|
|
3631
|
+
onClick: () => {
|
|
3632
|
+
setShowImportModal(true);
|
|
3633
|
+
setShowMoreOptions(false);
|
|
3634
|
+
},
|
|
3635
|
+
className: "w-full px-4 py-2 text-left text-sm text-gray-700 hover:bg-gray-50 flex items-center gap-3",
|
|
3636
|
+
children: [
|
|
3637
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react6.Upload, { className: "h-4 w-4" }),
|
|
3638
|
+
"Importer depuis Excel"
|
|
3639
|
+
]
|
|
3640
|
+
}
|
|
3641
|
+
),
|
|
3642
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "border-t border-gray-100 my-2" }),
|
|
3643
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
3644
|
+
"button",
|
|
3645
|
+
{
|
|
3646
|
+
type: "button",
|
|
3647
|
+
onClick: () => {
|
|
3648
|
+
setSelectionMode(!selectionMode);
|
|
3649
|
+
setShowMoreOptions(false);
|
|
3650
|
+
},
|
|
3651
|
+
className: "w-full px-4 py-2 text-left text-sm text-gray-700 hover:bg-gray-50 flex items-center gap-3",
|
|
3652
|
+
children: [
|
|
3653
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react6.SquareIcon, { className: "h-4 w-4" }),
|
|
3654
|
+
selectionMode ? "D\xE9sactiver la s\xE9lection" : "Mode s\xE9lection multiple"
|
|
3655
|
+
]
|
|
3656
|
+
}
|
|
3657
|
+
),
|
|
3658
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
3659
|
+
"button",
|
|
3660
|
+
{
|
|
3661
|
+
type: "button",
|
|
3662
|
+
onClick: () => {
|
|
3663
|
+
setShowColumnsPanel(true);
|
|
3664
|
+
setShowMoreOptions(false);
|
|
3665
|
+
},
|
|
3666
|
+
className: "w-full px-4 py-2 text-left text-sm text-gray-700 hover:bg-gray-50 flex items-center gap-3",
|
|
3667
|
+
children: [
|
|
3668
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react6.Columns3, { className: "h-4 w-4" }),
|
|
3669
|
+
"G\xE9rer les colonnes"
|
|
3670
|
+
]
|
|
3671
|
+
}
|
|
3672
|
+
),
|
|
3673
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "border-t border-gray-100 my-2" }),
|
|
3674
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "px-4 py-2", children: [
|
|
3675
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "text-xs font-medium text-gray-500 mb-2", children: "Densit\xE9 d'affichage" }),
|
|
3676
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "flex gap-1", children: ["compact", "normal", "comfortable"].map((mode) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
3677
|
+
"button",
|
|
3678
|
+
{
|
|
3679
|
+
type: "button",
|
|
3680
|
+
onClick: () => setDensity(mode),
|
|
3681
|
+
className: cn(
|
|
3682
|
+
"flex-1 px-2 py-1 text-xs rounded transition-colors",
|
|
3683
|
+
density === mode ? "bg-[var(--color-primary)] text-white" : "bg-gray-100 text-gray-600 hover:bg-gray-200"
|
|
3684
|
+
),
|
|
3685
|
+
children: mode === "compact" ? "Compact" : mode === "normal" ? "Normal" : "Large"
|
|
3686
|
+
},
|
|
3687
|
+
mode
|
|
3688
|
+
)) })
|
|
3689
|
+
] }),
|
|
3690
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "border-t border-gray-100 my-2" }),
|
|
3691
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
3692
|
+
"button",
|
|
3693
|
+
{
|
|
3694
|
+
type: "button",
|
|
3695
|
+
onClick: () => {
|
|
3696
|
+
toggleFullscreen();
|
|
3697
|
+
setShowMoreOptions(false);
|
|
3698
|
+
},
|
|
3699
|
+
className: "w-full px-4 py-2 text-left text-sm text-gray-700 hover:bg-gray-50 flex items-center gap-3",
|
|
3700
|
+
children: [
|
|
3701
|
+
isFullscreen ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react6.Minimize2, { className: "h-4 w-4" }) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react6.Maximize2, { className: "h-4 w-4" }),
|
|
3702
|
+
isFullscreen ? "Quitter le plein \xE9cran" : "Plein \xE9cran"
|
|
3703
|
+
]
|
|
3704
|
+
}
|
|
3705
|
+
)
|
|
3706
|
+
] })
|
|
3707
|
+
] })
|
|
3708
|
+
] }),
|
|
3709
|
+
showColumnsPanel && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "fixed inset-0 z-50 flex items-center justify-center", children: [
|
|
3710
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "absolute inset-0 bg-black/30", onClick: () => setShowColumnsPanel(false) }),
|
|
3711
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "relative bg-white rounded-xl shadow-2xl w-full max-w-md", ref: columnsPanelRef, children: [
|
|
3712
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex items-center justify-between p-4 border-b border-gray-200", children: [
|
|
3713
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("h3", { className: "font-semibold text-gray-800", children: "Colonnes visibles" }),
|
|
3714
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("button", { type: "button", onClick: () => setShowColumnsPanel(false), className: "p-1 hover:bg-gray-100 rounded-lg", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react6.X, { className: "h-5 w-5 text-gray-500" }) })
|
|
3715
|
+
] }),
|
|
3716
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "p-4 max-h-[60vh] overflow-y-auto", children: columns.map((column) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("label", { className: "flex items-center gap-3 py-2 cursor-pointer hover:bg-gray-50 px-2 rounded", children: [
|
|
3717
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
3718
|
+
"input",
|
|
3719
|
+
{
|
|
3720
|
+
type: "checkbox",
|
|
3721
|
+
checked: visibleColumns.includes(column.key),
|
|
3722
|
+
onChange: () => toggleColumnVisibility(column.key),
|
|
3723
|
+
className: "w-4 h-4 text-[var(--color-primary)] rounded border-gray-300"
|
|
3724
|
+
}
|
|
3725
|
+
),
|
|
3726
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "text-sm text-gray-700", children: column.label })
|
|
3727
|
+
] }, column.key)) }),
|
|
3728
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "p-4 border-t border-gray-200 flex justify-between", children: [
|
|
3729
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
3730
|
+
"button",
|
|
3731
|
+
{
|
|
3732
|
+
type: "button",
|
|
3733
|
+
onClick: () => setVisibleColumns(columns.map((c) => c.key)),
|
|
3734
|
+
className: "text-sm text-blue-600 hover:text-blue-800",
|
|
3735
|
+
children: "Tout afficher"
|
|
3736
|
+
}
|
|
3737
|
+
),
|
|
3738
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
3739
|
+
"button",
|
|
3740
|
+
{
|
|
3741
|
+
type: "button",
|
|
3742
|
+
onClick: () => setShowColumnsPanel(false),
|
|
3743
|
+
className: "px-4 py-2 bg-[var(--color-primary)] text-white rounded-lg text-sm",
|
|
3744
|
+
children: "Fermer"
|
|
3745
|
+
}
|
|
3746
|
+
)
|
|
3747
|
+
] })
|
|
3748
|
+
] })
|
|
3749
|
+
] }),
|
|
3750
|
+
selectionMode && selectedItems.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "mb-4 p-3 bg-blue-50 border border-blue-200 rounded-lg flex items-center justify-between", children: [
|
|
3751
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "flex items-center gap-3", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { className: "text-sm font-medium text-blue-800", children: [
|
|
3752
|
+
selectedItems.length,
|
|
3753
|
+
" \xE9l\xE9ment(s) s\xE9lectionn\xE9(s)"
|
|
3754
|
+
] }) }),
|
|
3755
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex items-center gap-2", children: [
|
|
3756
|
+
onBulkDelete && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
3757
|
+
"button",
|
|
3758
|
+
{
|
|
3759
|
+
type: "button",
|
|
3760
|
+
onClick: handleBulkDelete,
|
|
3761
|
+
className: "px-3 py-1.5 bg-red-500 text-white rounded-lg text-sm flex items-center gap-2 hover:bg-red-600",
|
|
3762
|
+
children: [
|
|
3763
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react6.Trash2, { className: "h-4 w-4" }),
|
|
3764
|
+
"Supprimer"
|
|
3765
|
+
]
|
|
3766
|
+
}
|
|
3767
|
+
),
|
|
3768
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
3769
|
+
"button",
|
|
3770
|
+
{
|
|
3771
|
+
type: "button",
|
|
3772
|
+
onClick: clearSelection,
|
|
3773
|
+
className: "px-3 py-1.5 bg-gray-200 text-gray-700 rounded-lg text-sm hover:bg-gray-300",
|
|
3774
|
+
children: "Annuler"
|
|
3775
|
+
}
|
|
3776
|
+
)
|
|
3777
|
+
] })
|
|
2467
3778
|
] }),
|
|
2468
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.
|
|
3779
|
+
loading && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "flex justify-center py-4", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "animate-spin rounded-full h-8 w-8 border-b-2 border-[var(--color-primary)]" }) }),
|
|
3780
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { ref: tableContainerRef, className: cn("bg-white", isFullscreen && "p-4"), children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("table", { id: "fdrawer-table", className: "w-full", children: [
|
|
2469
3781
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("thead", { className: "bg-gray-50", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("tr", { children: [
|
|
2470
|
-
|
|
3782
|
+
selectionMode && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("th", { className: cn(densityClasses.cell, "text-left text-xs font-medium text-gray-500 uppercase tracking-wider"), children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
3783
|
+
"input",
|
|
3784
|
+
{
|
|
3785
|
+
type: "checkbox",
|
|
3786
|
+
checked: selectedItems.length === data.length && data.length > 0,
|
|
3787
|
+
onChange: toggleSelectAll,
|
|
3788
|
+
className: "w-4 h-4 text-[var(--color-primary)] rounded border-gray-300"
|
|
3789
|
+
}
|
|
3790
|
+
) }),
|
|
3791
|
+
visibleColumnsData.map((column) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("th", { className: cn(densityClasses.cell, "text-left text-xs font-medium text-gray-500 uppercase tracking-wider relative"), scope: "col", children: [
|
|
2471
3792
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex align-center items-center gap-2", children: [
|
|
2472
3793
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { onClick: () => setShowFilters(showFilters === column.key ? "" : column.key), children: column.label }),
|
|
2473
|
-
column.sortable && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
3794
|
+
column.sortable && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react6.ArrowDownUp, { className: "h-4 w-4 cursor-pointer", onClick: () => setShowOrdering(showOrdering === column.key ? "" : column.key) })
|
|
2474
3795
|
] }),
|
|
2475
3796
|
showOrdering === column.key && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "absolute left-6 mt-2 bg-[var(--color-background)] rounded-lg shadow-xl border border-[var(--color-border)] z-50 max-h-80 overflow-y-auto", role: "menu", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "p-2", children: [
|
|
2476
3797
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
@@ -2485,7 +3806,7 @@ var FDrawer = ({
|
|
|
2485
3806
|
className: cn("w-full flex items-center gap-3 px-3 py-1 border-b rounded-lg hover:bg-[var(--color-surface-hover)] transition-colors", order_by === column.key && "bg-[var(--color-primary-light)]"),
|
|
2486
3807
|
role: "menuitem",
|
|
2487
3808
|
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "text-left flex-1 flex items-center gap-2", children: [
|
|
2488
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
3809
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react6.ArrowUpAZ, { className: "h-4 w-4" }),
|
|
2489
3810
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: cn("text-sm font-medium", order_by === column.key ? "text-[var(--color-primary)]" : "text-[var(--color-text-primary)]"), children: "Croissant" })
|
|
2490
3811
|
] })
|
|
2491
3812
|
}
|
|
@@ -2502,7 +3823,7 @@ var FDrawer = ({
|
|
|
2502
3823
|
className: cn("w-full flex items-center gap-3 px-3 py-2 rounded-lg hover:bg-[var(--color-surface-hover)] transition-colors", order_by === `-${column.key}` && "bg-[var(--color-primary-light)]"),
|
|
2503
3824
|
role: "menuitem",
|
|
2504
3825
|
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "text-left flex-1 flex items-center gap-2", children: [
|
|
2505
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
3826
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react6.ArrowDownAZ, { className: "h-4 w-4" }),
|
|
2506
3827
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: cn("text-sm font-medium", order_by === `-${column.key}` ? "text-[var(--color-primary)]" : "text-[var(--color-text-primary)]"), children: "D\xE9croissant" })
|
|
2507
3828
|
] })
|
|
2508
3829
|
}
|
|
@@ -2513,30 +3834,86 @@ var FDrawer = ({
|
|
|
2513
3834
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "pb-3 px-4", children: renderColumnFilter(column) })
|
|
2514
3835
|
] })
|
|
2515
3836
|
] }, column.key)),
|
|
2516
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("th", { className: "
|
|
3837
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("th", { className: cn(densityClasses.cell, "text-left text-xs font-medium text-gray-500 uppercase tracking-wider") })
|
|
2517
3838
|
] }) }),
|
|
2518
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("tbody", { className: "bg-white divide-y divide-gray-200", children: data.map((item) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
"
|
|
2523
|
-
|
|
2524
|
-
type: "button",
|
|
2525
|
-
onClick: () => setDropdownOpen(dropdownOpen === item.id ? null : item.id),
|
|
2526
|
-
className: "p-1 rounded-full hover:bg-gray-100 transition-colors",
|
|
2527
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react5.MoreVertical, { className: "w-4 h-4 text-gray-400" })
|
|
2528
|
-
}
|
|
3839
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("tbody", { className: "bg-white divide-y divide-gray-200", children: data.map((item) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
3840
|
+
"tr",
|
|
3841
|
+
{
|
|
3842
|
+
className: cn(
|
|
3843
|
+
"hover:bg-gray-50 cursor-pointer",
|
|
3844
|
+
selectionMode && selectedItems.includes(item.id) && "bg-blue-50"
|
|
2529
3845
|
),
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
|
|
3846
|
+
children: [
|
|
3847
|
+
selectionMode && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("td", { className: cn(densityClasses.cell, "whitespace-nowrap", densityClasses.text, "text-gray-500"), children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
3848
|
+
"input",
|
|
3849
|
+
{
|
|
3850
|
+
type: "checkbox",
|
|
3851
|
+
checked: selectedItems.includes(item.id),
|
|
3852
|
+
onChange: () => toggleSelectItem(item.id),
|
|
3853
|
+
className: "w-4 h-4 text-[var(--color-primary)] rounded border-gray-300"
|
|
3854
|
+
}
|
|
3855
|
+
) }),
|
|
3856
|
+
visibleColumnsData.map((column) => {
|
|
3857
|
+
let cellContent = column.formule ? column.formule(item) : item[column.key];
|
|
3858
|
+
if (column.type === "date" && item[column.key])
|
|
3859
|
+
cellContent = new Date(item[column.key]).toLocaleDateString();
|
|
3860
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("td", { className: cn(densityClasses.cell, "whitespace-nowrap", densityClasses.text, "text-gray-500"), children: cellContent }, column.key);
|
|
3861
|
+
}),
|
|
3862
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("td", { className: cn(densityClasses.cell, "whitespace-nowrap text-right", densityClasses.text, "font-medium"), children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "relative", children: [
|
|
3863
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
3864
|
+
"button",
|
|
3865
|
+
{
|
|
3866
|
+
type: "button",
|
|
3867
|
+
onClick: () => setDropdownOpen(dropdownOpen === item.id ? null : item.id),
|
|
3868
|
+
className: "p-1 rounded-full hover:bg-gray-100 transition-colors",
|
|
3869
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react6.MoreVertical, { className: "w-4 h-4 text-gray-400" })
|
|
3870
|
+
}
|
|
3871
|
+
),
|
|
3872
|
+
dropdownOpen === item.id && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "fixed right-3 mt-2 w-48 bg-white rounded-lg shadow-lg border border-gray-200 py-2 z-10", children: [
|
|
3873
|
+
actions.map(
|
|
3874
|
+
(action, index) => action.navigate ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_react_router_dom4.Link, { to: action.navigate, className: "w-full px-4 py-2 text-left text-sm text-gray-700 hover:bg-gray-50 flex items-center space-x-2", children: action.label }, index) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("button", { onClick: () => {
|
|
3875
|
+
action.onclick && action.onclick(item);
|
|
3876
|
+
setDropdownOpen(null);
|
|
3877
|
+
}, className: "w-full px-4 py-2 text-left text-sm text-gray-700 hover:bg-gray-50 flex items-center space-x-2", children: action.label }, index)
|
|
3878
|
+
),
|
|
3879
|
+
onDuplicate && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
|
|
3880
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "border-t border-gray-100 my-1" }),
|
|
3881
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
3882
|
+
"button",
|
|
3883
|
+
{
|
|
3884
|
+
onClick: () => {
|
|
3885
|
+
handleDuplicate(item);
|
|
3886
|
+
setDropdownOpen(null);
|
|
3887
|
+
},
|
|
3888
|
+
className: "w-full px-4 py-2 text-left text-sm text-gray-700 hover:bg-gray-50 flex items-center space-x-2",
|
|
3889
|
+
children: [
|
|
3890
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react6.Copy, { className: "h-4 w-4" }),
|
|
3891
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { children: "Dupliquer" })
|
|
3892
|
+
]
|
|
3893
|
+
}
|
|
3894
|
+
)
|
|
3895
|
+
] })
|
|
3896
|
+
] })
|
|
3897
|
+
] }) })
|
|
3898
|
+
]
|
|
3899
|
+
},
|
|
3900
|
+
item.id
|
|
3901
|
+
)) })
|
|
3902
|
+
] }) }),
|
|
3903
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Pagination, { reponseDetail, setQueryURL, filters: [filters, setFilters] }),
|
|
3904
|
+
importEndpoint && importFields && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
3905
|
+
ExcelImportModal,
|
|
3906
|
+
{
|
|
3907
|
+
isOpen: showImportModal,
|
|
3908
|
+
onClose: () => setShowImportModal(false),
|
|
3909
|
+
importEndpoint,
|
|
3910
|
+
importFields,
|
|
3911
|
+
onSuccess: () => {
|
|
3912
|
+
setShowImportModal(false);
|
|
3913
|
+
getDataFilter();
|
|
3914
|
+
}
|
|
3915
|
+
}
|
|
3916
|
+
)
|
|
2540
3917
|
] });
|
|
2541
3918
|
};
|
|
2542
3919
|
var Pagination = ({
|
|
@@ -2613,7 +3990,7 @@ var import_react10 = require("react");
|
|
|
2613
3990
|
|
|
2614
3991
|
// src/components/common/SearchableSelect.tsx
|
|
2615
3992
|
var import_react9 = require("react");
|
|
2616
|
-
var
|
|
3993
|
+
var import_lucide_react7 = require("lucide-react");
|
|
2617
3994
|
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
2618
3995
|
var SearchableSelect = ({
|
|
2619
3996
|
options,
|
|
@@ -2698,11 +4075,11 @@ var SearchableSelect = ({
|
|
|
2698
4075
|
onClick: handleClear,
|
|
2699
4076
|
className: "text-gray-400 hover:text-gray-600",
|
|
2700
4077
|
type: "button",
|
|
2701
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
4078
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react7.X, { size: 16 })
|
|
2702
4079
|
}
|
|
2703
4080
|
),
|
|
2704
4081
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
2705
|
-
|
|
4082
|
+
import_lucide_react7.ChevronDown,
|
|
2706
4083
|
{
|
|
2707
4084
|
size: 16,
|
|
2708
4085
|
className: `text-gray-400 transition-transform ${isOpen ? "rotate-180" : ""}`
|
|
@@ -2715,7 +4092,7 @@ var SearchableSelect = ({
|
|
|
2715
4092
|
isOpen && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "absolute z-50 w-full mt-1 bg-white border border-gray-200 rounded-lg shadow-lg", children: [
|
|
2716
4093
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "p-3 border-b border-gray-200 flex", children: [
|
|
2717
4094
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "relative w-full", children: [
|
|
2718
|
-
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
4095
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react7.Search, { className: "absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-4 h-4" }),
|
|
2719
4096
|
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
2720
4097
|
"input",
|
|
2721
4098
|
{
|
|
@@ -2736,7 +4113,7 @@ var SearchableSelect = ({
|
|
|
2736
4113
|
disabled,
|
|
2737
4114
|
className: "px-3 py-2 border border-gray-300 text-gray-700 rounded-lg hover:bg-gray-50 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",
|
|
2738
4115
|
title: "Rafra\xEEchir la liste",
|
|
2739
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
4116
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react7.RefreshCw, { className: `w-4 h-4 ${disabled ? "animate-spin" : ""}` })
|
|
2740
4117
|
}
|
|
2741
4118
|
),
|
|
2742
4119
|
addElement && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
@@ -2746,7 +4123,7 @@ var SearchableSelect = ({
|
|
|
2746
4123
|
onClick: addElement,
|
|
2747
4124
|
className: "px-3 py-2 border border-gray-300 text-gray-700 rounded-lg hover:bg-gray-50 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",
|
|
2748
4125
|
title: "Rafra\xEEchir la liste",
|
|
2749
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
4126
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_lucide_react7.Plus, { className: "w-4 h-4" })
|
|
2750
4127
|
}
|
|
2751
4128
|
)
|
|
2752
4129
|
] }),
|
|
@@ -2774,7 +4151,7 @@ var SearchableSelect = ({
|
|
|
2774
4151
|
};
|
|
2775
4152
|
|
|
2776
4153
|
// src/components/common/ApprovalWorkflow.tsx
|
|
2777
|
-
var
|
|
4154
|
+
var import_lucide_react8 = require("lucide-react");
|
|
2778
4155
|
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
2779
4156
|
var ApprovalWorkflow = ({
|
|
2780
4157
|
process,
|
|
@@ -3078,7 +4455,7 @@ var ApprovalWorkflow = ({
|
|
|
3078
4455
|
)
|
|
3079
4456
|
] }),
|
|
3080
4457
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "overflow-x-auto", children: stages.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "text-center py-6 border-2 border-dashed border-[#D9D9D9] rounded-lg bg-[#FAFAFA]", children: [
|
|
3081
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
4458
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react8.Users, { className: "w-8 h-8 text-[#767676] mx-auto mb-4" }),
|
|
3082
4459
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("h3", { className: "text-lg font-medium text-[#191919] mb-2", children: "Aucune personne ajout\xE9e" }),
|
|
3083
4460
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "text-[#767676] mb-4", children: 'Cliquez sur le bouton "Ajouter une personne" pour commencer' })
|
|
3084
4461
|
] }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("table", { className: "w-full border-collapse", children: [
|
|
@@ -3110,7 +4487,7 @@ var ApprovalWorkflow = ({
|
|
|
3110
4487
|
] });
|
|
3111
4488
|
};
|
|
3112
4489
|
if (loading) {
|
|
3113
|
-
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(RewiseBasicCard, { title, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "flex items-center justify-center py-12", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
4490
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(RewiseBasicCard, { title, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "flex items-center justify-center py-12", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react8.Loader, { className: "w-8 h-8 animate-spin text-[#6A8A82]" }) }) });
|
|
3114
4491
|
}
|
|
3115
4492
|
const renderTabContent = () => {
|
|
3116
4493
|
switch (activeTab) {
|
|
@@ -3137,7 +4514,7 @@ var ApprovalWorkflow = ({
|
|
|
3137
4514
|
type: "button",
|
|
3138
4515
|
classname: "flex items-center gap-2",
|
|
3139
4516
|
children: [
|
|
3140
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
4517
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react8.Ban, { className: "w-4 h-4" }),
|
|
3141
4518
|
canceling ? "Annulation..." : "Annuler la demande"
|
|
3142
4519
|
]
|
|
3143
4520
|
}
|
|
@@ -3150,7 +4527,7 @@ var ApprovalWorkflow = ({
|
|
|
3150
4527
|
type: "button",
|
|
3151
4528
|
classname: "flex items-center gap-2",
|
|
3152
4529
|
children: [
|
|
3153
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
4530
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react8.RotateCcw, { className: "w-4 h-4" }),
|
|
3154
4531
|
restarting ? "Red\xE9marrage..." : "Recommencer"
|
|
3155
4532
|
]
|
|
3156
4533
|
}
|
|
@@ -3189,15 +4566,15 @@ var ApprovalWorkflow = ({
|
|
|
3189
4566
|
dangerouslySetInnerHTML: { __html: caseData.html_content }
|
|
3190
4567
|
}
|
|
3191
4568
|
) : /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "text-center py-12 border-2 border-dashed border-[#D9D9D9] rounded-lg bg-[#FAFAFA]", children: [
|
|
3192
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
4569
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react8.Eye, { className: "w-12 h-12 text-[#767676] mx-auto mb-4" }),
|
|
3193
4570
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "text-[#767676]", children: "Aucun aper\xE7u disponible" })
|
|
3194
4571
|
] })
|
|
3195
4572
|
] }) });
|
|
3196
4573
|
case "history":
|
|
3197
4574
|
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "space-y-6", children: [
|
|
3198
4575
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("h3", { className: "text-lg font-semibold text-[#191919]", children: "Historique des versions" }),
|
|
3199
|
-
loadingHistory ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "flex items-center justify-center py-12", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
3200
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
4576
|
+
loadingHistory ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "flex items-center justify-center py-12", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react8.Loader, { className: "w-8 h-8 animate-spin text-[#6A8A82]" }) }) : history.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "text-center py-12 border-2 border-dashed border-[#D9D9D9] rounded-lg bg-[#FAFAFA]", children: [
|
|
4577
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react8.History, { className: "w-12 h-12 text-[#767676] mx-auto mb-4" }),
|
|
3201
4578
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "text-[#767676]", children: "Aucun historique disponible" })
|
|
3202
4579
|
] }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "space-y-4", children: history.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "border border-[#D9D9D9] rounded-lg p-4 bg-white hover:shadow-md transition-shadow", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "flex items-start justify-between", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex-1", children: [
|
|
3203
4580
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "flex items-center gap-3 mb-2", children: [
|
|
@@ -3287,7 +4664,7 @@ var ApprovalWorkflow = ({
|
|
|
3287
4664
|
onClick: () => setActiveTab("workflow"),
|
|
3288
4665
|
className: `px-4 py-3 text-sm font-medium transition-colors flex items-center gap-2 ${activeTab === "workflow" ? "border-b-2 border-[#6A8A82] text-[#6A8A82]" : "text-[#767676] hover:text-[#191919]"}`,
|
|
3289
4666
|
children: [
|
|
3290
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
4667
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react8.FileText, { className: "w-4 h-4" }),
|
|
3291
4668
|
"Workflow"
|
|
3292
4669
|
]
|
|
3293
4670
|
}
|
|
@@ -3298,7 +4675,7 @@ var ApprovalWorkflow = ({
|
|
|
3298
4675
|
onClick: () => setActiveTab("preview"),
|
|
3299
4676
|
className: `px-4 py-3 text-sm font-medium transition-colors flex items-center gap-2 ${activeTab === "preview" ? "border-b-2 border-[#6A8A82] text-[#6A8A82]" : "text-[#767676] hover:text-[#191919]"}`,
|
|
3300
4677
|
children: [
|
|
3301
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
4678
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react8.Eye, { className: "w-4 h-4" }),
|
|
3302
4679
|
"Aper\xE7u"
|
|
3303
4680
|
]
|
|
3304
4681
|
}
|
|
@@ -3309,7 +4686,7 @@ var ApprovalWorkflow = ({
|
|
|
3309
4686
|
onClick: () => setActiveTab("history"),
|
|
3310
4687
|
className: `px-4 py-3 text-sm font-medium transition-colors flex items-center gap-2 ${activeTab === "history" ? "border-b-2 border-[#6A8A82] text-[#6A8A82]" : "text-[#767676] hover:text-[#191919]"}`,
|
|
3311
4688
|
children: [
|
|
3312
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
4689
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react8.History, { className: "w-4 h-4" }),
|
|
3313
4690
|
"Historique"
|
|
3314
4691
|
]
|
|
3315
4692
|
}
|
|
@@ -3334,7 +4711,7 @@ var ApprovalWorkflow = ({
|
|
|
3334
4711
|
{
|
|
3335
4712
|
className: "text-gray-500 hover:text-[#6A8A82] transition-colors",
|
|
3336
4713
|
onClick: () => window.history.back(),
|
|
3337
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
4714
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react8.X, { className: "w-5 h-5" })
|
|
3338
4715
|
}
|
|
3339
4716
|
)
|
|
3340
4717
|
] }),
|
|
@@ -3389,7 +4766,7 @@ var StageRow = ({
|
|
|
3389
4766
|
onClick: onRemove,
|
|
3390
4767
|
className: "text-[#B85450] hover:text-red-700 transition-colors",
|
|
3391
4768
|
title: "Supprimer",
|
|
3392
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
4769
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react8.Trash2, { className: "w-4 h-4" })
|
|
3393
4770
|
}
|
|
3394
4771
|
) }),
|
|
3395
4772
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("td", { className: "border border-gray-300 px-4 py-2 text-center", children: index + 1 }),
|
|
@@ -3511,7 +4888,7 @@ var AddStageButton = ({
|
|
|
3511
4888
|
onClick: () => setShowModal(true),
|
|
3512
4889
|
classname: "gap-2",
|
|
3513
4890
|
children: [
|
|
3514
|
-
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
4891
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_lucide_react8.Plus, { className: "w-4 h-4" }),
|
|
3515
4892
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { children: "Ajouter une personne" })
|
|
3516
4893
|
]
|
|
3517
4894
|
}
|
|
@@ -3755,29 +5132,7 @@ var useAlert = () => {
|
|
|
3755
5132
|
};
|
|
3756
5133
|
|
|
3757
5134
|
// src/components/common/CommonSelect.tsx
|
|
3758
|
-
var
|
|
3759
|
-
|
|
3760
|
-
// src/services/VendorServices.ts
|
|
3761
|
-
var VENDORS_API_URL = `${API_URL}/accounting/vendors/`;
|
|
3762
|
-
var VendorServices = {
|
|
3763
|
-
createVendor: (data, token) => {
|
|
3764
|
-
const payload = { ...data };
|
|
3765
|
-
if (!payload.logo) {
|
|
3766
|
-
delete payload.logo;
|
|
3767
|
-
}
|
|
3768
|
-
return FetchApi.post(`${VENDORS_API_URL}`, payload, token);
|
|
3769
|
-
},
|
|
3770
|
-
getVendor: (id, token) => FetchApi.get(`${VENDORS_API_URL}${id}/`, token),
|
|
3771
|
-
getVendors: (token, params) => FetchApi.get(`${VENDORS_API_URL}?${new URLSearchParams(params).toString()}`, token),
|
|
3772
|
-
updateVendor: (id, data, token) => {
|
|
3773
|
-
const payload = { ...data };
|
|
3774
|
-
if (!payload.logo) {
|
|
3775
|
-
delete payload.logo;
|
|
3776
|
-
}
|
|
3777
|
-
return FetchApi.put(`${VENDORS_API_URL}${id}/`, payload, token);
|
|
3778
|
-
},
|
|
3779
|
-
deleteVendor: (id, token) => FetchApi.delete(`${VENDORS_API_URL}${id}/`, token)
|
|
3780
|
-
};
|
|
5135
|
+
var import_react102 = require("react");
|
|
3781
5136
|
|
|
3782
5137
|
// dist/index.js
|
|
3783
5138
|
var import_jsx_runtime17 = require("react/jsx-runtime");
|
|
@@ -3786,7 +5141,7 @@ var import_react_router_dom5 = require("react-router-dom");
|
|
|
3786
5141
|
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
3787
5142
|
var import_react12 = __toESM(require("react"), 1);
|
|
3788
5143
|
var import_react_router_dom6 = require("react-router-dom");
|
|
3789
|
-
var
|
|
5144
|
+
var import_lucide_react9 = require("lucide-react");
|
|
3790
5145
|
var import_clsx2 = require("clsx");
|
|
3791
5146
|
var import_tailwind_merge2 = require("tailwind-merge");
|
|
3792
5147
|
var import_react13 = require("react");
|
|
@@ -3794,28 +5149,29 @@ var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
|
3794
5149
|
var import_react14 = require("react");
|
|
3795
5150
|
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
3796
5151
|
var import_react15 = require("react");
|
|
5152
|
+
var import_lucide_react10 = require("lucide-react");
|
|
3797
5153
|
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
3798
5154
|
var import_react16 = require("react");
|
|
3799
5155
|
var import_jsx_runtime23 = require("react/jsx-runtime");
|
|
3800
|
-
var
|
|
5156
|
+
var import_lucide_react11 = require("lucide-react");
|
|
3801
5157
|
var import_react_router_dom7 = require("react-router-dom");
|
|
3802
5158
|
var import_jsx_runtime24 = require("react/jsx-runtime");
|
|
3803
5159
|
var import_jsx_runtime25 = require("react/jsx-runtime");
|
|
3804
5160
|
var import_react17 = require("react");
|
|
3805
|
-
var
|
|
5161
|
+
var import_lucide_react12 = require("lucide-react");
|
|
3806
5162
|
var import_jsx_runtime26 = require("react/jsx-runtime");
|
|
3807
|
-
var
|
|
5163
|
+
var import_lucide_react13 = require("lucide-react");
|
|
3808
5164
|
var import_react18 = require("react");
|
|
3809
5165
|
var import_jsx_runtime27 = require("react/jsx-runtime");
|
|
3810
|
-
var import_react19 = require("react");
|
|
5166
|
+
var import_react19 = __toESM(require("react"), 1);
|
|
3811
5167
|
var import_react_router_dom8 = require("react-router-dom");
|
|
3812
|
-
var
|
|
5168
|
+
var import_lucide_react14 = require("lucide-react");
|
|
3813
5169
|
var import_jsx_runtime28 = require("react/jsx-runtime");
|
|
3814
5170
|
var import_react20 = require("react");
|
|
3815
5171
|
var import_react21 = require("react");
|
|
3816
|
-
var
|
|
5172
|
+
var import_lucide_react15 = require("lucide-react");
|
|
3817
5173
|
var import_jsx_runtime29 = require("react/jsx-runtime");
|
|
3818
|
-
var
|
|
5174
|
+
var import_lucide_react16 = require("lucide-react");
|
|
3819
5175
|
var import_jsx_runtime30 = require("react/jsx-runtime");
|
|
3820
5176
|
var import_react22 = require("react");
|
|
3821
5177
|
var import_jsx_runtime31 = require("react/jsx-runtime");
|
|
@@ -3827,7 +5183,7 @@ var import_react_router_dom9 = require("react-router-dom");
|
|
|
3827
5183
|
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
3828
5184
|
var import_react24 = __toESM(require("react"), 1);
|
|
3829
5185
|
var import_react_router_dom10 = require("react-router-dom");
|
|
3830
|
-
var
|
|
5186
|
+
var import_lucide_react17 = require("lucide-react");
|
|
3831
5187
|
var import_clsx3 = require("clsx");
|
|
3832
5188
|
var import_tailwind_merge3 = require("tailwind-merge");
|
|
3833
5189
|
var import_react25 = require("react");
|
|
@@ -3838,25 +5194,25 @@ var import_react27 = require("react");
|
|
|
3838
5194
|
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
3839
5195
|
var import_react28 = require("react");
|
|
3840
5196
|
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
3841
|
-
var
|
|
5197
|
+
var import_lucide_react18 = require("lucide-react");
|
|
3842
5198
|
var import_react_router_dom11 = require("react-router-dom");
|
|
3843
5199
|
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
3844
5200
|
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
3845
5201
|
var import_react29 = require("react");
|
|
3846
|
-
var
|
|
5202
|
+
var import_lucide_react19 = require("lucide-react");
|
|
3847
5203
|
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
3848
|
-
var
|
|
5204
|
+
var import_lucide_react20 = require("lucide-react");
|
|
3849
5205
|
var import_react30 = require("react");
|
|
3850
5206
|
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
3851
5207
|
var import_react31 = require("react");
|
|
3852
5208
|
var import_react_router_dom12 = require("react-router-dom");
|
|
3853
|
-
var
|
|
5209
|
+
var import_lucide_react21 = require("lucide-react");
|
|
3854
5210
|
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
3855
5211
|
var import_react32 = require("react");
|
|
3856
5212
|
var import_react33 = require("react");
|
|
3857
|
-
var
|
|
5213
|
+
var import_lucide_react22 = require("lucide-react");
|
|
3858
5214
|
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
3859
|
-
var
|
|
5215
|
+
var import_lucide_react23 = require("lucide-react");
|
|
3860
5216
|
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
3861
5217
|
var import_react34 = require("react");
|
|
3862
5218
|
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
@@ -3868,7 +5224,7 @@ var import_react_router_dom13 = require("react-router-dom");
|
|
|
3868
5224
|
var import_jsx_runtime51 = require("react/jsx-runtime");
|
|
3869
5225
|
var import_react36 = __toESM(require("react"), 1);
|
|
3870
5226
|
var import_react_router_dom14 = require("react-router-dom");
|
|
3871
|
-
var
|
|
5227
|
+
var import_lucide_react24 = require("lucide-react");
|
|
3872
5228
|
var import_clsx4 = require("clsx");
|
|
3873
5229
|
var import_tailwind_merge4 = require("tailwind-merge");
|
|
3874
5230
|
var import_react37 = require("react");
|
|
@@ -3879,25 +5235,25 @@ var import_react39 = require("react");
|
|
|
3879
5235
|
var import_jsx_runtime54 = require("react/jsx-runtime");
|
|
3880
5236
|
var import_react40 = require("react");
|
|
3881
5237
|
var import_jsx_runtime55 = require("react/jsx-runtime");
|
|
3882
|
-
var
|
|
5238
|
+
var import_lucide_react25 = require("lucide-react");
|
|
3883
5239
|
var import_react_router_dom15 = require("react-router-dom");
|
|
3884
5240
|
var import_jsx_runtime56 = require("react/jsx-runtime");
|
|
3885
5241
|
var import_jsx_runtime57 = require("react/jsx-runtime");
|
|
3886
5242
|
var import_react41 = require("react");
|
|
3887
|
-
var
|
|
5243
|
+
var import_lucide_react26 = require("lucide-react");
|
|
3888
5244
|
var import_jsx_runtime58 = require("react/jsx-runtime");
|
|
3889
|
-
var
|
|
5245
|
+
var import_lucide_react27 = require("lucide-react");
|
|
3890
5246
|
var import_react42 = require("react");
|
|
3891
5247
|
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
3892
5248
|
var import_react43 = require("react");
|
|
3893
5249
|
var import_react_router_dom16 = require("react-router-dom");
|
|
3894
|
-
var
|
|
5250
|
+
var import_lucide_react28 = require("lucide-react");
|
|
3895
5251
|
var import_jsx_runtime60 = require("react/jsx-runtime");
|
|
3896
5252
|
var import_react44 = require("react");
|
|
3897
5253
|
var import_react45 = require("react");
|
|
3898
|
-
var
|
|
5254
|
+
var import_lucide_react29 = require("lucide-react");
|
|
3899
5255
|
var import_jsx_runtime61 = require("react/jsx-runtime");
|
|
3900
|
-
var
|
|
5256
|
+
var import_lucide_react30 = require("lucide-react");
|
|
3901
5257
|
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
3902
5258
|
var import_react46 = require("react");
|
|
3903
5259
|
var import_jsx_runtime63 = require("react/jsx-runtime");
|
|
@@ -3909,7 +5265,7 @@ var import_react_router_dom17 = require("react-router-dom");
|
|
|
3909
5265
|
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
3910
5266
|
var import_react48 = __toESM(require("react"), 1);
|
|
3911
5267
|
var import_react_router_dom18 = require("react-router-dom");
|
|
3912
|
-
var
|
|
5268
|
+
var import_lucide_react31 = require("lucide-react");
|
|
3913
5269
|
var import_clsx5 = require("clsx");
|
|
3914
5270
|
var import_tailwind_merge5 = require("tailwind-merge");
|
|
3915
5271
|
var import_react49 = require("react");
|
|
@@ -3920,25 +5276,25 @@ var import_react51 = require("react");
|
|
|
3920
5276
|
var import_jsx_runtime70 = require("react/jsx-runtime");
|
|
3921
5277
|
var import_react52 = require("react");
|
|
3922
5278
|
var import_jsx_runtime71 = require("react/jsx-runtime");
|
|
3923
|
-
var
|
|
5279
|
+
var import_lucide_react32 = require("lucide-react");
|
|
3924
5280
|
var import_react_router_dom19 = require("react-router-dom");
|
|
3925
5281
|
var import_jsx_runtime72 = require("react/jsx-runtime");
|
|
3926
5282
|
var import_jsx_runtime73 = require("react/jsx-runtime");
|
|
3927
5283
|
var import_react53 = require("react");
|
|
3928
|
-
var
|
|
5284
|
+
var import_lucide_react33 = require("lucide-react");
|
|
3929
5285
|
var import_jsx_runtime74 = require("react/jsx-runtime");
|
|
3930
|
-
var
|
|
5286
|
+
var import_lucide_react34 = require("lucide-react");
|
|
3931
5287
|
var import_react54 = require("react");
|
|
3932
5288
|
var import_jsx_runtime75 = require("react/jsx-runtime");
|
|
3933
5289
|
var import_react55 = require("react");
|
|
3934
5290
|
var import_react_router_dom20 = require("react-router-dom");
|
|
3935
|
-
var
|
|
5291
|
+
var import_lucide_react35 = require("lucide-react");
|
|
3936
5292
|
var import_jsx_runtime76 = require("react/jsx-runtime");
|
|
3937
5293
|
var import_react56 = require("react");
|
|
3938
5294
|
var import_react57 = require("react");
|
|
3939
|
-
var
|
|
5295
|
+
var import_lucide_react36 = require("lucide-react");
|
|
3940
5296
|
var import_jsx_runtime77 = require("react/jsx-runtime");
|
|
3941
|
-
var
|
|
5297
|
+
var import_lucide_react37 = require("lucide-react");
|
|
3942
5298
|
var import_jsx_runtime78 = require("react/jsx-runtime");
|
|
3943
5299
|
var import_react58 = require("react");
|
|
3944
5300
|
var import_jsx_runtime79 = require("react/jsx-runtime");
|
|
@@ -3946,14 +5302,149 @@ var import_jsx_runtime80 = require("react/jsx-runtime");
|
|
|
3946
5302
|
var import_react59 = require("react");
|
|
3947
5303
|
var import_jsx_runtime81 = require("react/jsx-runtime");
|
|
3948
5304
|
var import_jsx_runtime82 = require("react/jsx-runtime");
|
|
3949
|
-
var
|
|
5305
|
+
var import_react_router_dom21 = require("react-router-dom");
|
|
3950
5306
|
var import_jsx_runtime83 = require("react/jsx-runtime");
|
|
5307
|
+
var import_react60 = __toESM(require("react"), 1);
|
|
5308
|
+
var import_react_router_dom22 = require("react-router-dom");
|
|
5309
|
+
var import_lucide_react38 = require("lucide-react");
|
|
5310
|
+
var import_clsx6 = require("clsx");
|
|
5311
|
+
var import_tailwind_merge6 = require("tailwind-merge");
|
|
5312
|
+
var import_react61 = require("react");
|
|
3951
5313
|
var import_jsx_runtime84 = require("react/jsx-runtime");
|
|
5314
|
+
var import_react62 = require("react");
|
|
3952
5315
|
var import_jsx_runtime85 = require("react/jsx-runtime");
|
|
3953
|
-
var
|
|
5316
|
+
var import_react63 = require("react");
|
|
3954
5317
|
var import_jsx_runtime86 = require("react/jsx-runtime");
|
|
5318
|
+
var import_react64 = require("react");
|
|
3955
5319
|
var import_jsx_runtime87 = require("react/jsx-runtime");
|
|
5320
|
+
var import_lucide_react39 = require("lucide-react");
|
|
5321
|
+
var import_react_router_dom23 = require("react-router-dom");
|
|
3956
5322
|
var import_jsx_runtime88 = require("react/jsx-runtime");
|
|
5323
|
+
var import_jsx_runtime89 = require("react/jsx-runtime");
|
|
5324
|
+
var import_react65 = require("react");
|
|
5325
|
+
var import_lucide_react40 = require("lucide-react");
|
|
5326
|
+
var import_jsx_runtime90 = require("react/jsx-runtime");
|
|
5327
|
+
var import_lucide_react41 = require("lucide-react");
|
|
5328
|
+
var import_react66 = require("react");
|
|
5329
|
+
var import_jsx_runtime91 = require("react/jsx-runtime");
|
|
5330
|
+
var import_react67 = require("react");
|
|
5331
|
+
var import_react_router_dom24 = require("react-router-dom");
|
|
5332
|
+
var import_lucide_react42 = require("lucide-react");
|
|
5333
|
+
var import_jsx_runtime92 = require("react/jsx-runtime");
|
|
5334
|
+
var import_react68 = require("react");
|
|
5335
|
+
var import_react69 = require("react");
|
|
5336
|
+
var import_lucide_react43 = require("lucide-react");
|
|
5337
|
+
var import_jsx_runtime93 = require("react/jsx-runtime");
|
|
5338
|
+
var import_lucide_react44 = require("lucide-react");
|
|
5339
|
+
var import_jsx_runtime94 = require("react/jsx-runtime");
|
|
5340
|
+
var import_react70 = require("react");
|
|
5341
|
+
var import_jsx_runtime95 = require("react/jsx-runtime");
|
|
5342
|
+
var import_jsx_runtime96 = require("react/jsx-runtime");
|
|
5343
|
+
var import_react71 = require("react");
|
|
5344
|
+
var import_jsx_runtime97 = require("react/jsx-runtime");
|
|
5345
|
+
var import_jsx_runtime98 = require("react/jsx-runtime");
|
|
5346
|
+
var import_react_router_dom25 = require("react-router-dom");
|
|
5347
|
+
var import_jsx_runtime99 = require("react/jsx-runtime");
|
|
5348
|
+
var import_react72 = __toESM(require("react"), 1);
|
|
5349
|
+
var import_react_router_dom26 = require("react-router-dom");
|
|
5350
|
+
var import_lucide_react45 = require("lucide-react");
|
|
5351
|
+
var import_clsx7 = require("clsx");
|
|
5352
|
+
var import_tailwind_merge7 = require("tailwind-merge");
|
|
5353
|
+
var import_react73 = require("react");
|
|
5354
|
+
var import_jsx_runtime100 = require("react/jsx-runtime");
|
|
5355
|
+
var import_react74 = require("react");
|
|
5356
|
+
var import_jsx_runtime101 = require("react/jsx-runtime");
|
|
5357
|
+
var import_react75 = require("react");
|
|
5358
|
+
var import_jsx_runtime102 = require("react/jsx-runtime");
|
|
5359
|
+
var import_react76 = require("react");
|
|
5360
|
+
var import_jsx_runtime103 = require("react/jsx-runtime");
|
|
5361
|
+
var import_lucide_react46 = require("lucide-react");
|
|
5362
|
+
var import_react_router_dom27 = require("react-router-dom");
|
|
5363
|
+
var import_jsx_runtime104 = require("react/jsx-runtime");
|
|
5364
|
+
var import_jsx_runtime105 = require("react/jsx-runtime");
|
|
5365
|
+
var import_react77 = require("react");
|
|
5366
|
+
var import_lucide_react47 = require("lucide-react");
|
|
5367
|
+
var import_jsx_runtime106 = require("react/jsx-runtime");
|
|
5368
|
+
var import_lucide_react48 = require("lucide-react");
|
|
5369
|
+
var import_react78 = require("react");
|
|
5370
|
+
var import_jsx_runtime107 = require("react/jsx-runtime");
|
|
5371
|
+
var import_react79 = require("react");
|
|
5372
|
+
var import_react_router_dom28 = require("react-router-dom");
|
|
5373
|
+
var import_lucide_react49 = require("lucide-react");
|
|
5374
|
+
var import_jsx_runtime108 = require("react/jsx-runtime");
|
|
5375
|
+
var import_react80 = require("react");
|
|
5376
|
+
var import_react81 = require("react");
|
|
5377
|
+
var import_lucide_react50 = require("lucide-react");
|
|
5378
|
+
var import_jsx_runtime109 = require("react/jsx-runtime");
|
|
5379
|
+
var import_lucide_react51 = require("lucide-react");
|
|
5380
|
+
var import_jsx_runtime110 = require("react/jsx-runtime");
|
|
5381
|
+
var import_react82 = require("react");
|
|
5382
|
+
var import_jsx_runtime111 = require("react/jsx-runtime");
|
|
5383
|
+
var import_jsx_runtime112 = require("react/jsx-runtime");
|
|
5384
|
+
var import_react83 = require("react");
|
|
5385
|
+
var import_jsx_runtime113 = require("react/jsx-runtime");
|
|
5386
|
+
var import_jsx_runtime114 = require("react/jsx-runtime");
|
|
5387
|
+
var import_react_router_dom29 = require("react-router-dom");
|
|
5388
|
+
var import_jsx_runtime115 = require("react/jsx-runtime");
|
|
5389
|
+
var import_react84 = __toESM(require("react"), 1);
|
|
5390
|
+
var import_react_router_dom30 = require("react-router-dom");
|
|
5391
|
+
var import_lucide_react52 = require("lucide-react");
|
|
5392
|
+
var import_clsx8 = require("clsx");
|
|
5393
|
+
var import_tailwind_merge8 = require("tailwind-merge");
|
|
5394
|
+
var import_react85 = require("react");
|
|
5395
|
+
var import_jsx_runtime116 = require("react/jsx-runtime");
|
|
5396
|
+
var import_react86 = require("react");
|
|
5397
|
+
var import_jsx_runtime117 = require("react/jsx-runtime");
|
|
5398
|
+
var import_react87 = require("react");
|
|
5399
|
+
var import_jsx_runtime118 = require("react/jsx-runtime");
|
|
5400
|
+
var import_react88 = require("react");
|
|
5401
|
+
var import_jsx_runtime119 = require("react/jsx-runtime");
|
|
5402
|
+
var import_lucide_react53 = require("lucide-react");
|
|
5403
|
+
var import_react_router_dom31 = require("react-router-dom");
|
|
5404
|
+
var import_jsx_runtime120 = require("react/jsx-runtime");
|
|
5405
|
+
var import_jsx_runtime121 = require("react/jsx-runtime");
|
|
5406
|
+
var import_react89 = require("react");
|
|
5407
|
+
var import_lucide_react54 = require("lucide-react");
|
|
5408
|
+
var import_jsx_runtime122 = require("react/jsx-runtime");
|
|
5409
|
+
var import_lucide_react55 = require("lucide-react");
|
|
5410
|
+
var import_react90 = require("react");
|
|
5411
|
+
var import_jsx_runtime123 = require("react/jsx-runtime");
|
|
5412
|
+
var import_react91 = require("react");
|
|
5413
|
+
var import_react_router_dom32 = require("react-router-dom");
|
|
5414
|
+
var import_lucide_react56 = require("lucide-react");
|
|
5415
|
+
var import_jsx_runtime124 = require("react/jsx-runtime");
|
|
5416
|
+
var import_react92 = require("react");
|
|
5417
|
+
var import_react93 = require("react");
|
|
5418
|
+
var import_lucide_react57 = require("lucide-react");
|
|
5419
|
+
var import_jsx_runtime125 = require("react/jsx-runtime");
|
|
5420
|
+
var import_lucide_react58 = require("lucide-react");
|
|
5421
|
+
var import_jsx_runtime126 = require("react/jsx-runtime");
|
|
5422
|
+
var import_react94 = require("react");
|
|
5423
|
+
var import_jsx_runtime127 = require("react/jsx-runtime");
|
|
5424
|
+
var import_jsx_runtime128 = require("react/jsx-runtime");
|
|
5425
|
+
var import_react95 = require("react");
|
|
5426
|
+
var import_jsx_runtime129 = require("react/jsx-runtime");
|
|
5427
|
+
var import_jsx_runtime130 = require("react/jsx-runtime");
|
|
5428
|
+
var import_react96 = require("react");
|
|
5429
|
+
var import_jsx_runtime131 = require("react/jsx-runtime");
|
|
5430
|
+
var import_jsx_runtime132 = require("react/jsx-runtime");
|
|
5431
|
+
var import_jsx_runtime133 = require("react/jsx-runtime");
|
|
5432
|
+
var import_react97 = require("react");
|
|
5433
|
+
var import_jsx_runtime134 = require("react/jsx-runtime");
|
|
5434
|
+
var import_jsx_runtime135 = require("react/jsx-runtime");
|
|
5435
|
+
var import_jsx_runtime136 = require("react/jsx-runtime");
|
|
5436
|
+
var import_react98 = require("react");
|
|
5437
|
+
var import_jsx_runtime137 = require("react/jsx-runtime");
|
|
5438
|
+
var import_jsx_runtime138 = require("react/jsx-runtime");
|
|
5439
|
+
var import_jsx_runtime139 = require("react/jsx-runtime");
|
|
5440
|
+
var import_react99 = require("react");
|
|
5441
|
+
var import_jsx_runtime140 = require("react/jsx-runtime");
|
|
5442
|
+
var import_jsx_runtime141 = require("react/jsx-runtime");
|
|
5443
|
+
var import_jsx_runtime142 = require("react/jsx-runtime");
|
|
5444
|
+
var import_react100 = require("react");
|
|
5445
|
+
var import_jsx_runtime143 = require("react/jsx-runtime");
|
|
5446
|
+
var import_jsx_runtime144 = require("react/jsx-runtime");
|
|
5447
|
+
var import_jsx_runtime145 = require("react/jsx-runtime");
|
|
3957
5448
|
var PrimaryButton2 = ({
|
|
3958
5449
|
loading = false,
|
|
3959
5450
|
children,
|
|
@@ -3971,10 +5462,10 @@ var PrimaryButton2 = ({
|
|
|
3971
5462
|
}
|
|
3972
5463
|
);
|
|
3973
5464
|
var Buttons_default2 = PrimaryButton2;
|
|
3974
|
-
var Modal2 = ({ title, description, width, open, onClose, children }) => {
|
|
5465
|
+
var Modal2 = ({ title, description, width = "max-w-lg", open, onClose, children }) => {
|
|
3975
5466
|
if (!open) return null;
|
|
3976
|
-
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: `bg-white
|
|
3977
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex
|
|
5467
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: `bg-white rounded-lg p-6 mx-4 w-full ${width}`, children: [
|
|
5468
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { className: "flex justify-between items-start mb-6", children: [
|
|
3978
5469
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("div", { children: [
|
|
3979
5470
|
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("h3", { className: "text-xl font-semibold text-tuatara flex items-center space-x-2", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("span", { children: title }) }),
|
|
3980
5471
|
description && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("p", { className: "text-sm text-gray-600 mt-1", children: description })
|
|
@@ -3989,7 +5480,7 @@ var Modal2 = ({ title, description, width, open, onClose, children }) => {
|
|
|
3989
5480
|
}
|
|
3990
5481
|
)
|
|
3991
5482
|
] }),
|
|
3992
|
-
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "w-full max-h-[80vh] overflow-y-auto
|
|
5483
|
+
/* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { className: "w-full max-h-[80vh] overflow-y-auto", children })
|
|
3993
5484
|
] }) });
|
|
3994
5485
|
};
|
|
3995
5486
|
var Modals_default2 = Modal2;
|
|
@@ -4041,16 +5532,17 @@ var ADDRESS_IP2 = chooseEnv2 === "prod" ? "back.rewise.praeduim-tech.com" : "loc
|
|
|
4041
5532
|
var ADDRESS_IP_URL2 = chooseEnv2 === "prod" ? `https://${ADDRESS_IP2}/` : `http://${ADDRESS_IP2}/`;
|
|
4042
5533
|
var API_URL2 = `${ADDRESS_IP_URL2}api`;
|
|
4043
5534
|
var API_BASE_URL3 = `${API_URL2}/core/auth/`;
|
|
5535
|
+
var VENDORS_API_URL2 = `${API_URL2}/accounting/vendors/`;
|
|
4044
5536
|
var SessionContext2 = (0, import_react14.createContext)(void 0);
|
|
4045
5537
|
var API_BASE_URL22 = `${API_URL2}/core/auth/`;
|
|
4046
5538
|
var USERS_API_URL2 = `${API_URL2}/core/users/`;
|
|
4047
5539
|
var ToastContext2 = (0, import_react15.createContext)(void 0);
|
|
4048
5540
|
var APPROVAL_API_URL2 = `${API_URL2}/approvals/cases/`;
|
|
4049
5541
|
var AlertContext2 = (0, import_react22.createContext)(void 0);
|
|
4050
|
-
var VENDORS_API_URL2 = `${API_URL2}/accounting/vendors/`;
|
|
4051
5542
|
var ThemeContext22 = (0, import_react25.createContext)(void 0);
|
|
4052
|
-
var
|
|
4053
|
-
var
|
|
5543
|
+
var chooseEnv22 = localStorage.getItem("env") ?? "prod";
|
|
5544
|
+
var ADDRESS_IP22 = chooseEnv22 === "prod" ? "back.rewise.praeduim-tech.com" : "localhost:8000";
|
|
5545
|
+
var ADDRESS_IP_URL22 = chooseEnv22 === "prod" ? `https://${ADDRESS_IP22}/` : `http://${ADDRESS_IP22}/`;
|
|
4054
5546
|
var API_URL22 = `${ADDRESS_IP_URL22}api`;
|
|
4055
5547
|
var API_BASE_URL32 = `${API_URL22}/core/auth/`;
|
|
4056
5548
|
var SessionContext22 = (0, import_react26.createContext)(void 0);
|
|
@@ -4061,8 +5553,9 @@ var APPROVAL_API_URL22 = `${API_URL22}/approvals/cases/`;
|
|
|
4061
5553
|
var AlertContext22 = (0, import_react34.createContext)(void 0);
|
|
4062
5554
|
var VENDORS_API_URL22 = `${API_URL22}/accounting/vendors/`;
|
|
4063
5555
|
var ThemeContext222 = (0, import_react37.createContext)(void 0);
|
|
4064
|
-
var
|
|
4065
|
-
var
|
|
5556
|
+
var chooseEnv222 = localStorage.getItem("env") ?? "prod";
|
|
5557
|
+
var ADDRESS_IP222 = chooseEnv222 === "prod" ? "back.rewise.praeduim-tech.com" : "localhost:8000";
|
|
5558
|
+
var ADDRESS_IP_URL222 = chooseEnv222 === "prod" ? `https://${ADDRESS_IP222}/` : `http://${ADDRESS_IP222}/`;
|
|
4066
5559
|
var API_URL222 = `${ADDRESS_IP_URL222}api`;
|
|
4067
5560
|
var API_BASE_URL322 = `${API_URL222}/core/auth/`;
|
|
4068
5561
|
var SessionContext222 = (0, import_react38.createContext)(void 0);
|
|
@@ -4073,8 +5566,9 @@ var APPROVAL_API_URL222 = `${API_URL222}/approvals/cases/`;
|
|
|
4073
5566
|
var AlertContext222 = (0, import_react46.createContext)(void 0);
|
|
4074
5567
|
var VENDORS_API_URL222 = `${API_URL222}/accounting/vendors/`;
|
|
4075
5568
|
var ThemeContext2222 = (0, import_react49.createContext)(void 0);
|
|
4076
|
-
var
|
|
4077
|
-
var
|
|
5569
|
+
var chooseEnv2222 = localStorage.getItem("env") ?? "prod";
|
|
5570
|
+
var ADDRESS_IP2222 = chooseEnv2222 === "prod" ? "back.rewise.praeduim-tech.com" : "localhost:8000";
|
|
5571
|
+
var ADDRESS_IP_URL2222 = chooseEnv2222 === "prod" ? `https://${ADDRESS_IP2222}/` : `http://${ADDRESS_IP2222}/`;
|
|
4078
5572
|
var API_URL2222 = `${ADDRESS_IP_URL2222}api`;
|
|
4079
5573
|
var API_BASE_URL3222 = `${API_URL2222}/core/auth/`;
|
|
4080
5574
|
var SessionContext2222 = (0, import_react50.createContext)(void 0);
|
|
@@ -4083,22 +5577,70 @@ var USERS_API_URL2222 = `${API_URL2222}/core/users/`;
|
|
|
4083
5577
|
var ToastContext2222 = (0, import_react51.createContext)(void 0);
|
|
4084
5578
|
var APPROVAL_API_URL2222 = `${API_URL2222}/approvals/cases/`;
|
|
4085
5579
|
var AlertContext2222 = (0, import_react58.createContext)(void 0);
|
|
4086
|
-
var
|
|
4087
|
-
var
|
|
4088
|
-
var
|
|
4089
|
-
var
|
|
4090
|
-
var
|
|
4091
|
-
var
|
|
4092
|
-
var
|
|
4093
|
-
var
|
|
4094
|
-
var
|
|
4095
|
-
var
|
|
4096
|
-
var
|
|
4097
|
-
var
|
|
5580
|
+
var VENDORS_API_URL2222 = `${API_URL2222}/accounting/vendors/`;
|
|
5581
|
+
var ThemeContext22222 = (0, import_react61.createContext)(void 0);
|
|
5582
|
+
var ADDRESS_IP22222 = "localhost:8000";
|
|
5583
|
+
var ADDRESS_IP_URL22222 = `http://${ADDRESS_IP22222}/`;
|
|
5584
|
+
var API_URL22222 = `${ADDRESS_IP_URL22222}api`;
|
|
5585
|
+
var API_BASE_URL32222 = `${API_URL22222}/core/auth/`;
|
|
5586
|
+
var SessionContext22222 = (0, import_react62.createContext)(void 0);
|
|
5587
|
+
var API_BASE_URL222222 = `${API_URL22222}/core/auth/`;
|
|
5588
|
+
var USERS_API_URL22222 = `${API_URL22222}/core/users/`;
|
|
5589
|
+
var ToastContext22222 = (0, import_react63.createContext)(void 0);
|
|
5590
|
+
var APPROVAL_API_URL22222 = `${API_URL22222}/approvals/cases/`;
|
|
5591
|
+
var AlertContext22222 = (0, import_react70.createContext)(void 0);
|
|
5592
|
+
var VENDORS_API_URL22222 = `${API_URL22222}/accounting/vendors/`;
|
|
5593
|
+
var ThemeContext222222 = (0, import_react73.createContext)(void 0);
|
|
5594
|
+
var ADDRESS_IP222222 = "localhost:8000";
|
|
5595
|
+
var ADDRESS_IP_URL222222 = `http://${ADDRESS_IP222222}/`;
|
|
5596
|
+
var API_URL222222 = `${ADDRESS_IP_URL222222}api`;
|
|
5597
|
+
var API_BASE_URL322222 = `${API_URL222222}/core/auth/`;
|
|
5598
|
+
var SessionContext222222 = (0, import_react74.createContext)(void 0);
|
|
5599
|
+
var API_BASE_URL2222222 = `${API_URL222222}/core/auth/`;
|
|
5600
|
+
var USERS_API_URL222222 = `${API_URL222222}/core/users/`;
|
|
5601
|
+
var ToastContext222222 = (0, import_react75.createContext)(void 0);
|
|
5602
|
+
var APPROVAL_API_URL222222 = `${API_URL222222}/approvals/cases/`;
|
|
5603
|
+
var AlertContext222222 = (0, import_react82.createContext)(void 0);
|
|
5604
|
+
var VENDORS_API_URL222222 = `${API_URL222222}/accounting/vendors/`;
|
|
5605
|
+
var ThemeContext2222222 = (0, import_react85.createContext)(void 0);
|
|
5606
|
+
var ADDRESS_IP2222222 = "localhost:8000";
|
|
5607
|
+
var ADDRESS_IP_URL2222222 = `http://${ADDRESS_IP2222222}/`;
|
|
5608
|
+
var API_URL2222222 = `${ADDRESS_IP_URL2222222}api`;
|
|
5609
|
+
var API_BASE_URL3222222 = `${API_URL2222222}/core/auth/`;
|
|
5610
|
+
var SessionContext2222222 = (0, import_react86.createContext)(void 0);
|
|
5611
|
+
var API_BASE_URL22222222 = `${API_URL2222222}/core/auth/`;
|
|
5612
|
+
var USERS_API_URL2222222 = `${API_URL2222222}/core/users/`;
|
|
5613
|
+
var ToastContext2222222 = (0, import_react87.createContext)(void 0);
|
|
5614
|
+
var APPROVAL_API_URL2222222 = `${API_URL2222222}/approvals/cases/`;
|
|
5615
|
+
var AlertContext2222222 = (0, import_react94.createContext)(void 0);
|
|
5616
|
+
var URI = `${API_URL222222}/core/departments/`;
|
|
5617
|
+
var URI2 = `${API_URL222222}/accounting/profit-or-cost-center/`;
|
|
5618
|
+
var COST_URI = `${API_URL222222}/accounting/cost-center/`;
|
|
5619
|
+
var PROFIT_URI = `${API_URL222222}/accounting/profit-center/`;
|
|
5620
|
+
var URI3 = `${API_URL22222}/core/departments/`;
|
|
5621
|
+
var URI4 = `${API_URL22222}/accounting/profit-or-cost-center/`;
|
|
5622
|
+
var COST_URI2 = `${API_URL22222}/accounting/cost-center/`;
|
|
5623
|
+
var PROFIT_URI2 = `${API_URL22222}/accounting/profit-center/`;
|
|
5624
|
+
var URI5 = `${API_URL2222}/core/departments/`;
|
|
5625
|
+
var URI6 = `${API_URL2222}/accounting/profit-or-cost-center/`;
|
|
5626
|
+
var COST_URI3 = `${API_URL2222}/accounting/cost-center/`;
|
|
5627
|
+
var PROFIT_URI3 = `${API_URL2222}/accounting/profit-center/`;
|
|
5628
|
+
var URI7 = `${API_URL222}/core/departments/`;
|
|
5629
|
+
var URI8 = `${API_URL222}/accounting/profit-or-cost-center/`;
|
|
5630
|
+
var COST_URI4 = `${API_URL222}/accounting/cost-center/`;
|
|
5631
|
+
var PROFIT_URI4 = `${API_URL222}/accounting/profit-center/`;
|
|
5632
|
+
var URI9 = `${API_URL22}/core/departments/`;
|
|
5633
|
+
var URI10 = `${API_URL22}/accounting/profit-or-cost-center/`;
|
|
5634
|
+
var COST_URI5 = `${API_URL22}/accounting/cost-center/`;
|
|
5635
|
+
var PROFIT_URI5 = `${API_URL22}/accounting/profit-center/`;
|
|
5636
|
+
var URI11 = `${API_URL2}/core/departments/`;
|
|
5637
|
+
var URI12 = `${API_URL2}/accounting/profit-or-cost-center/`;
|
|
5638
|
+
var COST_URI6 = `${API_URL2}/accounting/cost-center/`;
|
|
5639
|
+
var PROFIT_URI6 = `${API_URL2}/accounting/profit-center/`;
|
|
4098
5640
|
|
|
4099
5641
|
// src/components/common/FormVendor.tsx
|
|
4100
|
-
var
|
|
4101
|
-
var
|
|
5642
|
+
var import_react101 = require("react");
|
|
5643
|
+
var import_jsx_runtime146 = require("react/jsx-runtime");
|
|
4102
5644
|
var MinimalVendorForm = ({
|
|
4103
5645
|
isOpen,
|
|
4104
5646
|
onClose,
|
|
@@ -4107,13 +5649,13 @@ var MinimalVendorForm = ({
|
|
|
4107
5649
|
refresh = () => {
|
|
4108
5650
|
}
|
|
4109
5651
|
}) => {
|
|
4110
|
-
const [formData, setFormData] = (0,
|
|
5652
|
+
const [formData, setFormData] = (0, import_react101.useState)(object || {
|
|
4111
5653
|
from_module: from ?? null,
|
|
4112
5654
|
legal_name: "",
|
|
4113
5655
|
trading_name: ""
|
|
4114
5656
|
});
|
|
4115
|
-
const [errors, setErrors] = (0,
|
|
4116
|
-
const [loading, setLoading] = (0,
|
|
5657
|
+
const [errors, setErrors] = (0, import_react101.useState)({});
|
|
5658
|
+
const [loading, setLoading] = (0, import_react101.useState)(false);
|
|
4117
5659
|
const { token } = useSession();
|
|
4118
5660
|
const { success, error: showError } = useToast();
|
|
4119
5661
|
const handleInputChange = (e) => {
|
|
@@ -4172,7 +5714,7 @@ var MinimalVendorForm = ({
|
|
|
4172
5714
|
}
|
|
4173
5715
|
};
|
|
4174
5716
|
if (!isOpen) return null;
|
|
4175
|
-
return /* @__PURE__ */ (0,
|
|
5717
|
+
return /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(
|
|
4176
5718
|
Modals_default2,
|
|
4177
5719
|
{
|
|
4178
5720
|
title: "Ajouter un fournisseur",
|
|
@@ -4180,9 +5722,9 @@ var MinimalVendorForm = ({
|
|
|
4180
5722
|
description: ``,
|
|
4181
5723
|
open: isOpen,
|
|
4182
5724
|
onClose,
|
|
4183
|
-
children: /* @__PURE__ */ (0,
|
|
4184
|
-
/* @__PURE__ */ (0,
|
|
4185
|
-
/* @__PURE__ */ (0,
|
|
5725
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime146.jsxs)("form", { onSubmit: handleSubmit, className: "p-", children: [
|
|
5726
|
+
/* @__PURE__ */ (0, import_jsx_runtime146.jsx)("div", { className: "space-y-4", children: /* @__PURE__ */ (0, import_jsx_runtime146.jsxs)("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
|
|
5727
|
+
/* @__PURE__ */ (0, import_jsx_runtime146.jsx)(
|
|
4186
5728
|
TextInput2,
|
|
4187
5729
|
{
|
|
4188
5730
|
label: "Raison sociale",
|
|
@@ -4194,7 +5736,7 @@ var MinimalVendorForm = ({
|
|
|
4194
5736
|
onChange: handleInputChange
|
|
4195
5737
|
}
|
|
4196
5738
|
),
|
|
4197
|
-
/* @__PURE__ */ (0,
|
|
5739
|
+
/* @__PURE__ */ (0, import_jsx_runtime146.jsx)(
|
|
4198
5740
|
TextInput2,
|
|
4199
5741
|
{
|
|
4200
5742
|
label: "Nom commercial",
|
|
@@ -4205,8 +5747,8 @@ var MinimalVendorForm = ({
|
|
|
4205
5747
|
}
|
|
4206
5748
|
)
|
|
4207
5749
|
] }) }),
|
|
4208
|
-
/* @__PURE__ */ (0,
|
|
4209
|
-
/* @__PURE__ */ (0,
|
|
5750
|
+
/* @__PURE__ */ (0, import_jsx_runtime146.jsxs)("div", { className: "flex justify-between pt-6 mt-8", children: [
|
|
5751
|
+
/* @__PURE__ */ (0, import_jsx_runtime146.jsx)(
|
|
4210
5752
|
"button",
|
|
4211
5753
|
{
|
|
4212
5754
|
type: "button",
|
|
@@ -4215,7 +5757,7 @@ var MinimalVendorForm = ({
|
|
|
4215
5757
|
children: "Annuler"
|
|
4216
5758
|
}
|
|
4217
5759
|
),
|
|
4218
|
-
/* @__PURE__ */ (0,
|
|
5760
|
+
/* @__PURE__ */ (0, import_jsx_runtime146.jsx)(
|
|
4219
5761
|
Buttons_default2,
|
|
4220
5762
|
{
|
|
4221
5763
|
type: "button",
|
|
@@ -4231,43 +5773,43 @@ var MinimalVendorForm = ({
|
|
|
4231
5773
|
};
|
|
4232
5774
|
|
|
4233
5775
|
// src/services/DepartmentServices.ts
|
|
4234
|
-
var
|
|
5776
|
+
var URI13 = `${API_URL}/core/departments/`;
|
|
4235
5777
|
var DepartmentServices = {
|
|
4236
|
-
create: (data) => FetchApi.post(`${
|
|
4237
|
-
get: (id) => FetchApi.get(`${
|
|
4238
|
-
list: (params) => FetchApi.get(`${
|
|
4239
|
-
update: (id, data) => FetchApi.put(`${
|
|
4240
|
-
delete: (id) => FetchApi.delete(`${
|
|
5778
|
+
create: (data) => FetchApi.post(`${URI13}`, data),
|
|
5779
|
+
get: (id) => FetchApi.get(`${URI13}${id}/`),
|
|
5780
|
+
list: (params) => FetchApi.get(`${URI13}?${new URLSearchParams(params).toString()}`),
|
|
5781
|
+
update: (id, data) => FetchApi.put(`${URI13}${id}/`, data),
|
|
5782
|
+
delete: (id) => FetchApi.delete(`${URI13}${id}/`)
|
|
4241
5783
|
};
|
|
4242
5784
|
|
|
4243
5785
|
// src/services/ProfitCostsServices.ts
|
|
4244
|
-
var
|
|
4245
|
-
var
|
|
5786
|
+
var URI14 = `${API_URL}/accounting/profit-or-cost-center/`;
|
|
5787
|
+
var COST_URI7 = `${API_URL}/accounting/cost-center/`;
|
|
4246
5788
|
var CostServices = {
|
|
4247
|
-
create: (data) => FetchApi.post(`${
|
|
4248
|
-
get: (id) => FetchApi.get(`${
|
|
4249
|
-
list: (params) => FetchApi.get(`${
|
|
4250
|
-
update: (id, data) => FetchApi.put(`${
|
|
4251
|
-
delete: (id) => FetchApi.delete(`${
|
|
5789
|
+
create: (data) => FetchApi.post(`${COST_URI7}`, data),
|
|
5790
|
+
get: (id) => FetchApi.get(`${COST_URI7}${id}/`),
|
|
5791
|
+
list: (params) => FetchApi.get(`${COST_URI7}?${new URLSearchParams(params).toString()}`),
|
|
5792
|
+
update: (id, data) => FetchApi.put(`${COST_URI7}${id}/`, data),
|
|
5793
|
+
delete: (id) => FetchApi.delete(`${COST_URI7}${id}/`)
|
|
4252
5794
|
};
|
|
4253
|
-
var
|
|
5795
|
+
var PROFIT_URI7 = `${API_URL}/accounting/profit-center/`;
|
|
4254
5796
|
|
|
4255
5797
|
// src/components/common/CommonSelect.tsx
|
|
4256
|
-
var
|
|
5798
|
+
var import_jsx_runtime147 = require("react/jsx-runtime");
|
|
4257
5799
|
var SelectVendor = ({
|
|
4258
5800
|
value,
|
|
4259
5801
|
onSelect
|
|
4260
5802
|
}) => {
|
|
4261
|
-
const [showModal, setShowModal] = (0,
|
|
4262
|
-
const [selectedVendor, setSelectedVendor] = (0,
|
|
5803
|
+
const [showModal, setShowModal] = (0, import_react102.useState)(false);
|
|
5804
|
+
const [selectedVendor, setSelectedVendor] = (0, import_react102.useState)(null);
|
|
4263
5805
|
const { token, activeBusinessEntity } = useSession();
|
|
4264
|
-
const [vendors, setVendors] = (0,
|
|
5806
|
+
const [vendors, setVendors] = (0, import_react102.useState)(() => {
|
|
4265
5807
|
const cacheKey = `vendors_cache_${activeBusinessEntity?.id || "default"}`;
|
|
4266
5808
|
const cached = sessionStorage.getItem(cacheKey);
|
|
4267
5809
|
return cached ? JSON.parse(cached) : [];
|
|
4268
5810
|
});
|
|
4269
|
-
const [loadingVendors, setLoadingVendors] = (0,
|
|
4270
|
-
(0,
|
|
5811
|
+
const [loadingVendors, setLoadingVendors] = (0, import_react102.useState)(false);
|
|
5812
|
+
(0, import_react102.useEffect)(() => {
|
|
4271
5813
|
const cacheKey = `vendors_cache_${activeBusinessEntity?.id || "default"}`;
|
|
4272
5814
|
const cached = sessionStorage.getItem(cacheKey);
|
|
4273
5815
|
if (!cached) {
|
|
@@ -4305,9 +5847,9 @@ var SelectVendor = ({
|
|
|
4305
5847
|
sessionStorage.removeItem(cacheKey);
|
|
4306
5848
|
loadVendors();
|
|
4307
5849
|
};
|
|
4308
|
-
return /* @__PURE__ */ (0,
|
|
4309
|
-
/* @__PURE__ */ (0,
|
|
4310
|
-
/* @__PURE__ */ (0,
|
|
5850
|
+
return /* @__PURE__ */ (0, import_jsx_runtime147.jsxs)("div", { children: [
|
|
5851
|
+
/* @__PURE__ */ (0, import_jsx_runtime147.jsx)("div", { className: "flex justify-between ", children: /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Ajouter un fournisseur" }) }),
|
|
5852
|
+
/* @__PURE__ */ (0, import_jsx_runtime147.jsx)(
|
|
4311
5853
|
SearchableSelect,
|
|
4312
5854
|
{
|
|
4313
5855
|
value,
|
|
@@ -4323,8 +5865,8 @@ var SelectVendor = ({
|
|
|
4323
5865
|
},
|
|
4324
5866
|
"fourni" + value
|
|
4325
5867
|
),
|
|
4326
|
-
loadingVendors && /* @__PURE__ */ (0,
|
|
4327
|
-
showModal && /* @__PURE__ */ (0,
|
|
5868
|
+
loadingVendors && /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("p", { className: "text-sm text-gray-500 mt-2", children: "Chargement des fournisseurs..." }),
|
|
5869
|
+
showModal && /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(
|
|
4328
5870
|
MinimalVendorForm,
|
|
4329
5871
|
{
|
|
4330
5872
|
object: selectedVendor,
|
|
@@ -4341,13 +5883,13 @@ var SelectUser = ({
|
|
|
4341
5883
|
onSelect
|
|
4342
5884
|
}) => {
|
|
4343
5885
|
const { token, activeBusinessEntity } = useSession();
|
|
4344
|
-
const [users, setUsers] = (0,
|
|
5886
|
+
const [users, setUsers] = (0, import_react102.useState)(() => {
|
|
4345
5887
|
const cacheKey = `users_cache_${activeBusinessEntity?.id || "default"}`;
|
|
4346
5888
|
const cached = sessionStorage.getItem(cacheKey);
|
|
4347
5889
|
return cached ? JSON.parse(cached) : [];
|
|
4348
5890
|
});
|
|
4349
|
-
const [loading, setLoading] = (0,
|
|
4350
|
-
(0,
|
|
5891
|
+
const [loading, setLoading] = (0, import_react102.useState)(false);
|
|
5892
|
+
(0, import_react102.useEffect)(() => {
|
|
4351
5893
|
const cacheKey = `users_cache_${activeBusinessEntity?.id || "default"}`;
|
|
4352
5894
|
const cached = sessionStorage.getItem(cacheKey);
|
|
4353
5895
|
if (!cached) {
|
|
@@ -4383,19 +5925,19 @@ var SelectUser = ({
|
|
|
4383
5925
|
return users.map((user) => ({
|
|
4384
5926
|
value: user.id,
|
|
4385
5927
|
label: `${user.first_name} ${user.last_name}`,
|
|
4386
|
-
content: /* @__PURE__ */ (0,
|
|
4387
|
-
/* @__PURE__ */ (0,
|
|
5928
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("div", { className: "flex items-center space-x-3", children: /* @__PURE__ */ (0, import_jsx_runtime147.jsxs)("div", { className: "flex-1", children: [
|
|
5929
|
+
/* @__PURE__ */ (0, import_jsx_runtime147.jsxs)("div", { className: "font-medium text-gray-900", children: [
|
|
4388
5930
|
user.first_name,
|
|
4389
5931
|
" ",
|
|
4390
5932
|
user.last_name
|
|
4391
5933
|
] }),
|
|
4392
|
-
/* @__PURE__ */ (0,
|
|
5934
|
+
/* @__PURE__ */ (0, import_jsx_runtime147.jsx)("div", { className: "text-sm text-gray-500", children: user.email })
|
|
4393
5935
|
] }) })
|
|
4394
5936
|
}));
|
|
4395
5937
|
};
|
|
4396
|
-
return /* @__PURE__ */ (0,
|
|
4397
|
-
/* @__PURE__ */ (0,
|
|
4398
|
-
/* @__PURE__ */ (0,
|
|
5938
|
+
return /* @__PURE__ */ (0, import_jsx_runtime147.jsxs)("div", { children: [
|
|
5939
|
+
/* @__PURE__ */ (0, import_jsx_runtime147.jsx)("div", { className: "flex justify-between ", children: /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "S\xE9lectionner un utilisateur" }) }),
|
|
5940
|
+
/* @__PURE__ */ (0, import_jsx_runtime147.jsx)(
|
|
4399
5941
|
SearchableSelect,
|
|
4400
5942
|
{
|
|
4401
5943
|
value,
|
|
@@ -4408,7 +5950,7 @@ var SelectUser = ({
|
|
|
4408
5950
|
},
|
|
4409
5951
|
"user" + value
|
|
4410
5952
|
),
|
|
4411
|
-
loading && /* @__PURE__ */ (0,
|
|
5953
|
+
loading && /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("p", { className: "text-sm text-gray-500 mt-2", children: "Chargement des utilisateurs..." })
|
|
4412
5954
|
] });
|
|
4413
5955
|
};
|
|
4414
5956
|
var SelectDepartment = ({
|
|
@@ -4416,13 +5958,13 @@ var SelectDepartment = ({
|
|
|
4416
5958
|
onSelect
|
|
4417
5959
|
}) => {
|
|
4418
5960
|
const { token, activeBusinessEntity } = useSession();
|
|
4419
|
-
const [departments, setDepartments] = (0,
|
|
5961
|
+
const [departments, setDepartments] = (0, import_react102.useState)(() => {
|
|
4420
5962
|
const cacheKey = `departments_cache_${activeBusinessEntity?.id || "default"}`;
|
|
4421
5963
|
const cached = sessionStorage.getItem(cacheKey);
|
|
4422
5964
|
return cached ? JSON.parse(cached) : [];
|
|
4423
5965
|
});
|
|
4424
|
-
const [loading, setLoading] = (0,
|
|
4425
|
-
(0,
|
|
5966
|
+
const [loading, setLoading] = (0, import_react102.useState)(false);
|
|
5967
|
+
(0, import_react102.useEffect)(() => {
|
|
4426
5968
|
const cacheKey = `departments_cache_${activeBusinessEntity?.id || "default"}`;
|
|
4427
5969
|
const cached = sessionStorage.getItem(cacheKey);
|
|
4428
5970
|
if (!cached) {
|
|
@@ -4458,9 +6000,9 @@ var SelectDepartment = ({
|
|
|
4458
6000
|
label: dept.name
|
|
4459
6001
|
}));
|
|
4460
6002
|
};
|
|
4461
|
-
return /* @__PURE__ */ (0,
|
|
4462
|
-
/* @__PURE__ */ (0,
|
|
4463
|
-
/* @__PURE__ */ (0,
|
|
6003
|
+
return /* @__PURE__ */ (0, import_jsx_runtime147.jsxs)("div", { children: [
|
|
6004
|
+
/* @__PURE__ */ (0, import_jsx_runtime147.jsx)("div", { className: "flex justify-between ", children: /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "S\xE9lectionner un d\xE9partement" }) }),
|
|
6005
|
+
/* @__PURE__ */ (0, import_jsx_runtime147.jsx)(
|
|
4464
6006
|
SearchableSelect,
|
|
4465
6007
|
{
|
|
4466
6008
|
value,
|
|
@@ -4473,7 +6015,7 @@ var SelectDepartment = ({
|
|
|
4473
6015
|
},
|
|
4474
6016
|
"dept" + value
|
|
4475
6017
|
),
|
|
4476
|
-
loading && /* @__PURE__ */ (0,
|
|
6018
|
+
loading && /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("p", { className: "text-sm text-gray-500 mt-2", children: "Chargement des d\xE9partements..." })
|
|
4477
6019
|
] });
|
|
4478
6020
|
};
|
|
4479
6021
|
var SelectCostCenter = ({
|
|
@@ -4481,13 +6023,13 @@ var SelectCostCenter = ({
|
|
|
4481
6023
|
onSelect
|
|
4482
6024
|
}) => {
|
|
4483
6025
|
const { token, activeBusinessEntity } = useSession();
|
|
4484
|
-
const [costCenters, setCostCenters] = (0,
|
|
6026
|
+
const [costCenters, setCostCenters] = (0, import_react102.useState)(() => {
|
|
4485
6027
|
const cacheKey = `cost_centers_cache_${activeBusinessEntity?.id || "default"}`;
|
|
4486
6028
|
const cached = sessionStorage.getItem(cacheKey);
|
|
4487
6029
|
return cached ? JSON.parse(cached) : [];
|
|
4488
6030
|
});
|
|
4489
|
-
const [loading, setLoading] = (0,
|
|
4490
|
-
(0,
|
|
6031
|
+
const [loading, setLoading] = (0, import_react102.useState)(false);
|
|
6032
|
+
(0, import_react102.useEffect)(() => {
|
|
4491
6033
|
const cacheKey = `cost_centers_cache_${activeBusinessEntity?.id || "default"}`;
|
|
4492
6034
|
const cached = sessionStorage.getItem(cacheKey);
|
|
4493
6035
|
if (!cached) {
|
|
@@ -4521,18 +6063,18 @@ var SelectCostCenter = ({
|
|
|
4521
6063
|
return costCenters.map((center) => ({
|
|
4522
6064
|
value: center.id,
|
|
4523
6065
|
label: `${center.code ? `[${center.code}] ` : ""}${center.name}`,
|
|
4524
|
-
content: /* @__PURE__ */ (0,
|
|
4525
|
-
/* @__PURE__ */ (0,
|
|
4526
|
-
center.code && /* @__PURE__ */ (0,
|
|
6066
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("div", { className: "flex items-center space-x-3", children: /* @__PURE__ */ (0, import_jsx_runtime147.jsxs)("div", { className: "flex-1", children: [
|
|
6067
|
+
/* @__PURE__ */ (0, import_jsx_runtime147.jsx)("div", { className: "font-medium text-gray-900", children: center.name }),
|
|
6068
|
+
center.code && /* @__PURE__ */ (0, import_jsx_runtime147.jsxs)("div", { className: "text-sm text-gray-500", children: [
|
|
4527
6069
|
"Code: ",
|
|
4528
6070
|
center.code
|
|
4529
6071
|
] })
|
|
4530
6072
|
] }) })
|
|
4531
6073
|
}));
|
|
4532
6074
|
};
|
|
4533
|
-
return /* @__PURE__ */ (0,
|
|
4534
|
-
/* @__PURE__ */ (0,
|
|
4535
|
-
/* @__PURE__ */ (0,
|
|
6075
|
+
return /* @__PURE__ */ (0, import_jsx_runtime147.jsxs)("div", { children: [
|
|
6076
|
+
/* @__PURE__ */ (0, import_jsx_runtime147.jsx)("div", { className: "flex justify-between ", children: /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "S\xE9lectionner un centre de co\xFBt" }) }),
|
|
6077
|
+
/* @__PURE__ */ (0, import_jsx_runtime147.jsx)(
|
|
4536
6078
|
SearchableSelect,
|
|
4537
6079
|
{
|
|
4538
6080
|
value,
|
|
@@ -4545,12 +6087,12 @@ var SelectCostCenter = ({
|
|
|
4545
6087
|
},
|
|
4546
6088
|
"cost" + value
|
|
4547
6089
|
),
|
|
4548
|
-
loading && /* @__PURE__ */ (0,
|
|
6090
|
+
loading && /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("p", { className: "text-sm text-gray-500 mt-2", children: "Chargement des centres de co\xFBt..." })
|
|
4549
6091
|
] });
|
|
4550
6092
|
};
|
|
4551
6093
|
|
|
4552
6094
|
// src/components/common/Choices.tsx
|
|
4553
|
-
var
|
|
6095
|
+
var import_jsx_runtime148 = require("react/jsx-runtime");
|
|
4554
6096
|
var CHOICES = {
|
|
4555
6097
|
INVOICE_TYPES: [
|
|
4556
6098
|
{ value: "sale", label: { fr: "Vente", en: "Sale", default: "Sale" } },
|
|
@@ -4808,7 +6350,7 @@ var InvoiceTypeSelector = ({
|
|
|
4808
6350
|
value: item.value,
|
|
4809
6351
|
label: item.label[language]
|
|
4810
6352
|
}));
|
|
4811
|
-
return /* @__PURE__ */ (0,
|
|
6353
|
+
return /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(
|
|
4812
6354
|
SearchableSelect,
|
|
4813
6355
|
{
|
|
4814
6356
|
value,
|
|
@@ -4831,7 +6373,7 @@ var PaymentMethodSelector = ({
|
|
|
4831
6373
|
value: item.value,
|
|
4832
6374
|
label: item.label[language]
|
|
4833
6375
|
}));
|
|
4834
|
-
return /* @__PURE__ */ (0,
|
|
6376
|
+
return /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(
|
|
4835
6377
|
SearchableSelect,
|
|
4836
6378
|
{
|
|
4837
6379
|
value,
|
|
@@ -4854,7 +6396,7 @@ var TemplateFNESelector = ({
|
|
|
4854
6396
|
value: item.value,
|
|
4855
6397
|
label: item.label[language]
|
|
4856
6398
|
}));
|
|
4857
|
-
return /* @__PURE__ */ (0,
|
|
6399
|
+
return /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(
|
|
4858
6400
|
SearchableSelect,
|
|
4859
6401
|
{
|
|
4860
6402
|
value,
|
|
@@ -4877,7 +6419,7 @@ var ForeignCurrencySelector = ({
|
|
|
4877
6419
|
value: item.value,
|
|
4878
6420
|
label: item.label[language]
|
|
4879
6421
|
}));
|
|
4880
|
-
return /* @__PURE__ */ (0,
|
|
6422
|
+
return /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(
|
|
4881
6423
|
SearchableSelect,
|
|
4882
6424
|
{
|
|
4883
6425
|
value,
|
|
@@ -4901,7 +6443,7 @@ var TaxSelector = ({
|
|
|
4901
6443
|
value: item.value,
|
|
4902
6444
|
label: item.label[language]
|
|
4903
6445
|
}));
|
|
4904
|
-
return /* @__PURE__ */ (0,
|
|
6446
|
+
return /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(
|
|
4905
6447
|
SearchableSelect,
|
|
4906
6448
|
{
|
|
4907
6449
|
value,
|
|
@@ -4929,7 +6471,7 @@ var LegalFormSelector = ({
|
|
|
4929
6471
|
value: item.value,
|
|
4930
6472
|
label: item.label[language] ?? item.label.default
|
|
4931
6473
|
}));
|
|
4932
|
-
return /* @__PURE__ */ (0,
|
|
6474
|
+
return /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(
|
|
4933
6475
|
SearchableSelect,
|
|
4934
6476
|
{
|
|
4935
6477
|
value,
|
|
@@ -4952,7 +6494,7 @@ var CountrySelector = ({
|
|
|
4952
6494
|
value: item.value,
|
|
4953
6495
|
label: item.label[language]
|
|
4954
6496
|
}));
|
|
4955
|
-
return /* @__PURE__ */ (0,
|
|
6497
|
+
return /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(
|
|
4956
6498
|
SearchableSelect,
|
|
4957
6499
|
{
|
|
4958
6500
|
value,
|
|
@@ -4972,7 +6514,9 @@ var CountrySelector = ({
|
|
|
4972
6514
|
ApprovalAnswerModal,
|
|
4973
6515
|
ApprovalAnswerPage,
|
|
4974
6516
|
ApprovalPreviewAnswer,
|
|
6517
|
+
ApprovalServices,
|
|
4975
6518
|
ApprovalWorkflow,
|
|
6519
|
+
AuthServices,
|
|
4976
6520
|
CHOICES,
|
|
4977
6521
|
CountrySelector,
|
|
4978
6522
|
DateInput,
|