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.js
CHANGED
|
@@ -35,10 +35,10 @@ var Buttons_default = PrimaryButton;
|
|
|
35
35
|
|
|
36
36
|
// src/components/common/Modals.tsx
|
|
37
37
|
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
38
|
-
var Modal = ({ title, description, width, open, onClose, children }) => {
|
|
38
|
+
var Modal = ({ title, description, width = "max-w-lg", open, onClose, children }) => {
|
|
39
39
|
if (!open) return null;
|
|
40
|
-
return /* @__PURE__ */ jsx2("div", { className: "fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50", children: /* @__PURE__ */ jsxs("div", { className: `bg-white
|
|
41
|
-
/* @__PURE__ */ jsxs("div", { className: "flex
|
|
40
|
+
return /* @__PURE__ */ jsx2("div", { className: "fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50", children: /* @__PURE__ */ jsxs("div", { className: `bg-white rounded-lg p-6 mx-4 w-full ${width}`, children: [
|
|
41
|
+
/* @__PURE__ */ jsxs("div", { className: "flex justify-between items-start mb-6", children: [
|
|
42
42
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
43
43
|
/* @__PURE__ */ jsx2("h3", { className: "text-xl font-semibold text-tuatara flex items-center space-x-2", children: /* @__PURE__ */ jsx2("span", { children: title }) }),
|
|
44
44
|
description && /* @__PURE__ */ jsx2("p", { className: "text-sm text-gray-600 mt-1", children: description })
|
|
@@ -53,7 +53,7 @@ var Modal = ({ title, description, width, open, onClose, children }) => {
|
|
|
53
53
|
}
|
|
54
54
|
)
|
|
55
55
|
] }),
|
|
56
|
-
/* @__PURE__ */ jsx2("div", { className: "w-full max-h-[80vh] overflow-y-auto
|
|
56
|
+
/* @__PURE__ */ jsx2("div", { className: "w-full max-h-[80vh] overflow-y-auto", children })
|
|
57
57
|
] }) });
|
|
58
58
|
};
|
|
59
59
|
var Modals_default = Modal;
|
|
@@ -225,13 +225,98 @@ import {
|
|
|
225
225
|
User,
|
|
226
226
|
LogOut,
|
|
227
227
|
Menu,
|
|
228
|
-
X as
|
|
228
|
+
X as X3,
|
|
229
229
|
Palette,
|
|
230
230
|
DollarSign,
|
|
231
|
-
HelpCircle,
|
|
232
|
-
Building2
|
|
231
|
+
HelpCircle as HelpCircle2,
|
|
232
|
+
Building2,
|
|
233
|
+
LayoutGrid
|
|
233
234
|
} from "lucide-react";
|
|
234
235
|
|
|
236
|
+
// src/assets/modules-icons/crm-blue.svg
|
|
237
|
+
var crm_blue_default = "./crm-blue-5IUN7OWK.svg";
|
|
238
|
+
|
|
239
|
+
// src/assets/modules-icons/crmwhite.svg
|
|
240
|
+
var crmwhite_default = "./crmwhite-T4YVRCBY.svg";
|
|
241
|
+
|
|
242
|
+
// src/assets/modules-icons/marketingblue.svg
|
|
243
|
+
var marketingblue_default = "./marketingblue-M22Q2RVP.svg";
|
|
244
|
+
|
|
245
|
+
// src/assets/modules-icons/marketingblanc.svg
|
|
246
|
+
var marketingblanc_default = "./marketingblanc-VGLH2RYX.svg";
|
|
247
|
+
|
|
248
|
+
// src/assets/modules-icons/facilityblue.svg
|
|
249
|
+
var facilityblue_default = "./facilityblue-OSJ76HN4.svg";
|
|
250
|
+
|
|
251
|
+
// src/assets/modules-icons/facilityblanc.svg
|
|
252
|
+
var facilityblanc_default = "./facilityblanc-X2W5XOZF.svg";
|
|
253
|
+
|
|
254
|
+
// src/assets/modules-icons/security_managementblue.svg
|
|
255
|
+
var security_managementblue_default = "./security_managementblue-KPYN5QPS.svg";
|
|
256
|
+
|
|
257
|
+
// src/assets/modules-icons/security_managementblanc.svg
|
|
258
|
+
var security_managementblanc_default = "./security_managementblanc-44CBK332.svg";
|
|
259
|
+
|
|
260
|
+
// src/assets/modules-icons/thriveblue.svg
|
|
261
|
+
var thriveblue_default = "./thriveblue-MFDIWYWF.svg";
|
|
262
|
+
|
|
263
|
+
// src/assets/modules-icons/thriveblanc.svg
|
|
264
|
+
var thriveblanc_default = "./thriveblanc-C7YX45XG.svg";
|
|
265
|
+
|
|
266
|
+
// src/assets/modules-icons/wiseblues.svg
|
|
267
|
+
var wiseblues_default = "./wiseblues-MMOO253P.svg";
|
|
268
|
+
|
|
269
|
+
// src/assets/modules-icons/wiseblancs.svg
|
|
270
|
+
var wiseblancs_default = "./wiseblancs-W2M4CRXV.svg";
|
|
271
|
+
|
|
272
|
+
// src/assets/modules-icons/sopblues.svg
|
|
273
|
+
var sopblues_default = "./sopblues-MKSGDFK2.svg";
|
|
274
|
+
|
|
275
|
+
// src/assets/modules-icons/sopblancs.svg
|
|
276
|
+
var sopblancs_default = "./sopblancs-LQYRWDFF.svg";
|
|
277
|
+
|
|
278
|
+
// src/assets/modules-icons/invoicingblue.svg
|
|
279
|
+
var invoicingblue_default = "./invoicingblue-PGDRJHUT.svg";
|
|
280
|
+
|
|
281
|
+
// src/assets/modules-icons/invoicingblanc.svg
|
|
282
|
+
var invoicingblanc_default = "./invoicingblanc-OG4REEEI.svg";
|
|
283
|
+
|
|
284
|
+
// src/assets/modules-icons/accountingblue.svg
|
|
285
|
+
var accountingblue_default = "./accountingblue-KJT2COTJ.svg";
|
|
286
|
+
|
|
287
|
+
// src/assets/modules-icons/accountingblanc.svg
|
|
288
|
+
var accountingblanc_default = "./accountingblanc-HXO7ZL5C.svg";
|
|
289
|
+
|
|
290
|
+
// src/assets/modules-icons/assetblue.svg
|
|
291
|
+
var assetblue_default = "./assetblue-QVU5HCMT.svg";
|
|
292
|
+
|
|
293
|
+
// src/assets/modules-icons/assetblanc.svg
|
|
294
|
+
var assetblanc_default = "./assetblanc-G4JYFDCR.svg";
|
|
295
|
+
|
|
296
|
+
// src/assets/modules-icons/financeblue.svg
|
|
297
|
+
var financeblue_default = "./financeblue-C6ARC7XB.svg";
|
|
298
|
+
|
|
299
|
+
// src/assets/modules-icons/financeblanc.svg
|
|
300
|
+
var financeblanc_default = "./financeblanc-FFBP6VCU.svg";
|
|
301
|
+
|
|
302
|
+
// src/assets/modules-icons/collection_litigationblue.svg
|
|
303
|
+
var collection_litigationblue_default = "./collection_litigationblue-UNGB33BF.svg";
|
|
304
|
+
|
|
305
|
+
// src/assets/modules-icons/collection_litigationblanc.svg
|
|
306
|
+
var collection_litigationblanc_default = "./collection_litigationblanc-7NRNT2NJ.svg";
|
|
307
|
+
|
|
308
|
+
// src/assets/modules-icons/procurementblue.svg
|
|
309
|
+
var procurementblue_default = "./procurementblue-KXLG2CW4.svg";
|
|
310
|
+
|
|
311
|
+
// src/assets/modules-icons/procurementblanc.svg
|
|
312
|
+
var procurementblanc_default = "./procurementblanc-C3K6S2GP.svg";
|
|
313
|
+
|
|
314
|
+
// src/assets/modules-icons/human_capitalblue.svg
|
|
315
|
+
var human_capitalblue_default = "./human_capitalblue-IGF53KXL.svg";
|
|
316
|
+
|
|
317
|
+
// src/assets/modules-icons/human_capitalblanc.svg
|
|
318
|
+
var human_capitalblanc_default = "./human_capitalblanc-44P3SKKG.svg";
|
|
319
|
+
|
|
235
320
|
// src/utils/utils.ts
|
|
236
321
|
import { clsx } from "clsx";
|
|
237
322
|
import { twMerge } from "tailwind-merge";
|
|
@@ -691,6 +776,28 @@ var AuthServices = {
|
|
|
691
776
|
logout: () => FetchApi.post(`${API_BASE_URL}logout/`)
|
|
692
777
|
};
|
|
693
778
|
|
|
779
|
+
// src/services/VendorServices.ts
|
|
780
|
+
var VENDORS_API_URL = `${API_URL}/accounting/vendors/`;
|
|
781
|
+
var VendorServices = {
|
|
782
|
+
createVendor: (data, token) => {
|
|
783
|
+
const payload = { ...data };
|
|
784
|
+
if (!payload.logo) {
|
|
785
|
+
delete payload.logo;
|
|
786
|
+
}
|
|
787
|
+
return FetchApi.post(`${VENDORS_API_URL}`, payload, token);
|
|
788
|
+
},
|
|
789
|
+
getVendor: (id, token) => FetchApi.get(`${VENDORS_API_URL}${id}/`, token),
|
|
790
|
+
getVendors: (token, params) => FetchApi.get(`${VENDORS_API_URL}?${new URLSearchParams(params).toString()}`, token),
|
|
791
|
+
updateVendor: (id, data, token) => {
|
|
792
|
+
const payload = { ...data };
|
|
793
|
+
if (!payload.logo) {
|
|
794
|
+
delete payload.logo;
|
|
795
|
+
}
|
|
796
|
+
return FetchApi.put(`${VENDORS_API_URL}${id}/`, payload, token);
|
|
797
|
+
},
|
|
798
|
+
deleteVendor: (id, token) => FetchApi.delete(`${VENDORS_API_URL}${id}/`, token)
|
|
799
|
+
};
|
|
800
|
+
|
|
694
801
|
// src/contexts/SessionContext.tsx
|
|
695
802
|
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
696
803
|
var SessionContext = createContext2(void 0);
|
|
@@ -708,6 +815,47 @@ var SessionProvider = ({ children }) => {
|
|
|
708
815
|
const saved_center_id = localStorage.getItem("active_center_id") || "";
|
|
709
816
|
const [isLoading, setIsLoading] = useState2(true);
|
|
710
817
|
const [showAuthModal, setShowAuthModal] = useState2(false);
|
|
818
|
+
useEffect2(() => {
|
|
819
|
+
const params = new URLSearchParams(window.location.search);
|
|
820
|
+
const tkn = params.get("tkn");
|
|
821
|
+
if (tkn) {
|
|
822
|
+
localStorage.setItem("token", tkn);
|
|
823
|
+
setToken(tkn);
|
|
824
|
+
window.history.replaceState({}, document.title, window.location.pathname);
|
|
825
|
+
}
|
|
826
|
+
}, []);
|
|
827
|
+
const [vendors, setVendors] = useState2(() => {
|
|
828
|
+
const cacheKey = `vendors_cache_${activeBusinessEntity?.id || "default"}`;
|
|
829
|
+
const cached = sessionStorage.getItem(cacheKey);
|
|
830
|
+
return cached ? JSON.parse(cached) : [];
|
|
831
|
+
});
|
|
832
|
+
const [loadingVendors, setLoadingVendors] = useState2(false);
|
|
833
|
+
const loadVendors = async () => {
|
|
834
|
+
if (!token) {
|
|
835
|
+
console.error("Vous devez etre connect\xE9 pour voir les organisations");
|
|
836
|
+
return;
|
|
837
|
+
}
|
|
838
|
+
try {
|
|
839
|
+
setLoadingVendors(true);
|
|
840
|
+
const result = await VendorServices.getVendors(token, { business_entity_id: activeBusinessEntity?.id });
|
|
841
|
+
setVendors(result.data);
|
|
842
|
+
const cacheKey = `vendors_cache_${activeBusinessEntity?.id || "default"}`;
|
|
843
|
+
sessionStorage.setItem(cacheKey, JSON.stringify(result.data));
|
|
844
|
+
} catch (error) {
|
|
845
|
+
console.error(error);
|
|
846
|
+
} finally {
|
|
847
|
+
setLoadingVendors(false);
|
|
848
|
+
}
|
|
849
|
+
};
|
|
850
|
+
useEffect2(() => {
|
|
851
|
+
const cacheKey = `vendors_cache_${activeBusinessEntity?.id || "default"}`;
|
|
852
|
+
const cached = sessionStorage.getItem(cacheKey);
|
|
853
|
+
if (!cached) {
|
|
854
|
+
loadVendors();
|
|
855
|
+
} else {
|
|
856
|
+
setVendors(JSON.parse(cached));
|
|
857
|
+
}
|
|
858
|
+
}, [activeBusinessEntity?.id]);
|
|
711
859
|
useEffect2(() => {
|
|
712
860
|
const storedToken = localStorage.getItem("token");
|
|
713
861
|
if (storedToken) {
|
|
@@ -727,6 +875,7 @@ var SessionProvider = ({ children }) => {
|
|
|
727
875
|
AuthServices.getUserInformations(token).then((res) => {
|
|
728
876
|
const result = res;
|
|
729
877
|
if (result.success === true) {
|
|
878
|
+
console.log("USER LOGGED", result.data.user);
|
|
730
879
|
setLoggedUser(result.data.user);
|
|
731
880
|
setActiveBusinessEntity(result.data.user.centers_access.find((item) => parseInt(item.id) === parseInt(saved_center_id)) || result.data.user.centers_access[0] || null);
|
|
732
881
|
} else {
|
|
@@ -751,7 +900,12 @@ var SessionProvider = ({ children }) => {
|
|
|
751
900
|
login,
|
|
752
901
|
logout,
|
|
753
902
|
showAuthModal,
|
|
754
|
-
setShowAuthModal
|
|
903
|
+
setShowAuthModal,
|
|
904
|
+
vendors,
|
|
905
|
+
setVendors,
|
|
906
|
+
loadingVendors,
|
|
907
|
+
setLoadingVendors,
|
|
908
|
+
loadVendors
|
|
755
909
|
}, children });
|
|
756
910
|
};
|
|
757
911
|
|
|
@@ -784,7 +938,8 @@ var UserServices = {
|
|
|
784
938
|
|
|
785
939
|
// src/contexts/ToastContext.tsx
|
|
786
940
|
import { createContext as createContext3, useContext as useContext3, useState as useState3, useCallback } from "react";
|
|
787
|
-
import {
|
|
941
|
+
import { AlertTriangle, HelpCircle, AlertCircle, X } from "lucide-react";
|
|
942
|
+
import { jsx as jsx6, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
788
943
|
var ToastContext = createContext3(void 0);
|
|
789
944
|
var useToast = () => {
|
|
790
945
|
const context = useContext3(ToastContext);
|
|
@@ -795,6 +950,11 @@ var useToast = () => {
|
|
|
795
950
|
};
|
|
796
951
|
var ToastProvider = ({ children }) => {
|
|
797
952
|
const [toasts, setToasts] = useState3([]);
|
|
953
|
+
const [confirmState, setConfirmState] = useState3({
|
|
954
|
+
isOpen: false,
|
|
955
|
+
options: null,
|
|
956
|
+
resolve: null
|
|
957
|
+
});
|
|
798
958
|
const generateId = () => {
|
|
799
959
|
return Date.now().toString(36) + Math.random().toString(36).substr(2);
|
|
800
960
|
};
|
|
@@ -827,6 +987,26 @@ var ToastProvider = ({ children }) => {
|
|
|
827
987
|
const info = useCallback((message, duration) => {
|
|
828
988
|
addToast({ message, type: "info", duration });
|
|
829
989
|
}, [addToast]);
|
|
990
|
+
const confirm2 = useCallback((options) => {
|
|
991
|
+
return new Promise((resolve) => {
|
|
992
|
+
const normalizedOptions = typeof options === "string" ? { message: options } : options;
|
|
993
|
+
setConfirmState({
|
|
994
|
+
isOpen: true,
|
|
995
|
+
options: normalizedOptions,
|
|
996
|
+
resolve
|
|
997
|
+
});
|
|
998
|
+
});
|
|
999
|
+
}, []);
|
|
1000
|
+
const handleConfirm = useCallback((result) => {
|
|
1001
|
+
if (confirmState.resolve) {
|
|
1002
|
+
confirmState.resolve(result);
|
|
1003
|
+
}
|
|
1004
|
+
setConfirmState({
|
|
1005
|
+
isOpen: false,
|
|
1006
|
+
options: null,
|
|
1007
|
+
resolve: null
|
|
1008
|
+
});
|
|
1009
|
+
}, [confirmState.resolve]);
|
|
830
1010
|
const value = {
|
|
831
1011
|
toasts,
|
|
832
1012
|
addToast,
|
|
@@ -834,23 +1014,91 @@ var ToastProvider = ({ children }) => {
|
|
|
834
1014
|
success,
|
|
835
1015
|
error,
|
|
836
1016
|
warning,
|
|
837
|
-
info
|
|
1017
|
+
info,
|
|
1018
|
+
confirm: confirm2
|
|
838
1019
|
};
|
|
839
|
-
|
|
1020
|
+
const getConfirmTypeStyles = (type) => {
|
|
1021
|
+
switch (type) {
|
|
1022
|
+
case "danger":
|
|
1023
|
+
return {
|
|
1024
|
+
icon: /* @__PURE__ */ jsx6(AlertCircle, { className: "w-6 h-6 text-red-500" }),
|
|
1025
|
+
confirmBtnClass: "bg-red-600 hover:bg-red-700 text-white"
|
|
1026
|
+
};
|
|
1027
|
+
case "warning":
|
|
1028
|
+
return {
|
|
1029
|
+
icon: /* @__PURE__ */ jsx6(AlertTriangle, { className: "w-6 h-6 text-amber-500" }),
|
|
1030
|
+
confirmBtnClass: "bg-amber-600 hover:bg-amber-700 text-white"
|
|
1031
|
+
};
|
|
1032
|
+
case "info":
|
|
1033
|
+
default:
|
|
1034
|
+
return {
|
|
1035
|
+
icon: /* @__PURE__ */ jsx6(HelpCircle, { className: "w-6 h-6 text-blue-500" }),
|
|
1036
|
+
confirmBtnClass: "bg-blue-600 hover:bg-blue-700 text-white"
|
|
1037
|
+
};
|
|
1038
|
+
}
|
|
1039
|
+
};
|
|
1040
|
+
const typeStyles = confirmState.options ? getConfirmTypeStyles(confirmState.options.type) : getConfirmTypeStyles();
|
|
1041
|
+
return /* @__PURE__ */ jsxs3(ToastContext.Provider, { value, children: [
|
|
1042
|
+
children,
|
|
1043
|
+
confirmState.isOpen && confirmState.options && /* @__PURE__ */ jsxs3("div", { className: "fixed inset-0 z-[9999] flex items-center justify-center", children: [
|
|
1044
|
+
/* @__PURE__ */ jsx6(
|
|
1045
|
+
"div",
|
|
1046
|
+
{
|
|
1047
|
+
className: "absolute inset-0 bg-black/50 backdrop-blur-sm",
|
|
1048
|
+
onClick: () => handleConfirm(false)
|
|
1049
|
+
}
|
|
1050
|
+
),
|
|
1051
|
+
/* @__PURE__ */ jsxs3("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: [
|
|
1052
|
+
/* @__PURE__ */ jsxs3("div", { className: "flex items-start gap-4 p-6 pb-4", children: [
|
|
1053
|
+
/* @__PURE__ */ jsx6("div", { className: "flex-shrink-0 p-2 rounded-full bg-gray-100", children: typeStyles.icon }),
|
|
1054
|
+
/* @__PURE__ */ jsxs3("div", { className: "flex-1 min-w-0", children: [
|
|
1055
|
+
/* @__PURE__ */ jsx6("h3", { className: "text-lg font-semibold text-gray-900", children: confirmState.options.title || "Confirmation" }),
|
|
1056
|
+
/* @__PURE__ */ jsx6("p", { className: "mt-2 text-sm text-gray-600 whitespace-pre-wrap", children: confirmState.options.message })
|
|
1057
|
+
] }),
|
|
1058
|
+
/* @__PURE__ */ jsx6(
|
|
1059
|
+
"button",
|
|
1060
|
+
{
|
|
1061
|
+
onClick: () => handleConfirm(false),
|
|
1062
|
+
className: "flex-shrink-0 p-1 rounded-lg hover:bg-gray-100 transition-colors",
|
|
1063
|
+
children: /* @__PURE__ */ jsx6(X, { className: "w-5 h-5 text-gray-400" })
|
|
1064
|
+
}
|
|
1065
|
+
)
|
|
1066
|
+
] }),
|
|
1067
|
+
/* @__PURE__ */ jsxs3("div", { className: "flex justify-end gap-3 px-6 py-4 bg-gray-50 border-t border-gray-100", children: [
|
|
1068
|
+
/* @__PURE__ */ jsx6(
|
|
1069
|
+
"button",
|
|
1070
|
+
{
|
|
1071
|
+
onClick: () => handleConfirm(false),
|
|
1072
|
+
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",
|
|
1073
|
+
children: confirmState.options.cancelText || "Annuler"
|
|
1074
|
+
}
|
|
1075
|
+
),
|
|
1076
|
+
/* @__PURE__ */ jsx6(
|
|
1077
|
+
"button",
|
|
1078
|
+
{
|
|
1079
|
+
onClick: () => handleConfirm(true),
|
|
1080
|
+
className: `px-4 py-2 text-sm font-medium rounded-lg transition-colors ${typeStyles.confirmBtnClass}`,
|
|
1081
|
+
children: confirmState.options.confirmText || "Confirmer"
|
|
1082
|
+
}
|
|
1083
|
+
)
|
|
1084
|
+
] })
|
|
1085
|
+
] })
|
|
1086
|
+
] })
|
|
1087
|
+
] });
|
|
840
1088
|
};
|
|
841
1089
|
|
|
842
1090
|
// src/pages/ApprovalPreviewAnswer.tsx
|
|
843
1091
|
import { useState as useState4, useEffect as useEffect3 } from "react";
|
|
844
1092
|
|
|
845
1093
|
// src/components/common/Cards.tsx
|
|
846
|
-
import { jsx as jsx7, jsxs as
|
|
847
|
-
var RewiseBasicCard = ({ title, children }) => /* @__PURE__ */
|
|
1094
|
+
import { jsx as jsx7, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
1095
|
+
var RewiseBasicCard = ({ title, children }) => /* @__PURE__ */ jsxs4("div", { className: "bg-white rounded-lg ", children: [
|
|
848
1096
|
/* @__PURE__ */ jsx7("div", { className: "px-6 py-2 border-b border-gray-200", children: /* @__PURE__ */ jsx7("div", { className: "flex items-center space-x-4", children: title }) }),
|
|
849
1097
|
/* @__PURE__ */ jsx7("div", { className: "p-3", children })
|
|
850
1098
|
] });
|
|
851
1099
|
|
|
852
1100
|
// src/pages/ApprovalPreviewAnswer.tsx
|
|
853
|
-
import { X, Loader, Eye, FileText, Check, XCircle, Edit, CheckCircle, Clock, AlertCircle, User as UserIcon, Send } from "lucide-react";
|
|
1101
|
+
import { X as X2, Loader, Eye, FileText, Check, XCircle, Edit, CheckCircle, Clock, AlertCircle as AlertCircle2, User as UserIcon, Send } from "lucide-react";
|
|
854
1102
|
import { useParams, useSearchParams } from "react-router-dom";
|
|
855
1103
|
|
|
856
1104
|
// src/services/ApprovalServices.ts
|
|
@@ -908,7 +1156,7 @@ var ApprovalServices = {
|
|
|
908
1156
|
};
|
|
909
1157
|
|
|
910
1158
|
// src/pages/ApprovalPreviewAnswer.tsx
|
|
911
|
-
import { Fragment, jsx as jsx8, jsxs as
|
|
1159
|
+
import { Fragment, jsx as jsx8, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
912
1160
|
var ApprovalAnswerModal = ({ answer_id, link_token, object_detail }) => {
|
|
913
1161
|
const [answerId, setAnswerId] = useState4(answer_id);
|
|
914
1162
|
const [caseData, setCaseData] = useState4(object_detail);
|
|
@@ -1096,7 +1344,7 @@ var ApprovalPreviewAnswer = ({ loadCase, answerId, caseData }) => {
|
|
|
1096
1344
|
const statusDisplay = getAnswerStatusDisplay(approval.answer);
|
|
1097
1345
|
const userName = approval.user_detail ? `${approval.user_detail.first_name} ${approval.user_detail.last_name}`.trim() : approval.full_name || "Utilisateur inconnu";
|
|
1098
1346
|
const userEmail = approval.user_detail?.email || approval.email || "";
|
|
1099
|
-
return /* @__PURE__ */
|
|
1347
|
+
return /* @__PURE__ */ jsxs5("div", { className: "relative flex gap-3", children: [
|
|
1100
1348
|
!isLast && /* @__PURE__ */ jsx8("div", { className: "absolute left-[19px] top-[40px] bottom-[-16px] w-0.5 bg-gray-300" }),
|
|
1101
1349
|
/* @__PURE__ */ jsx8("div", { className: "relative flex-shrink-0", children: /* @__PURE__ */ jsx8(
|
|
1102
1350
|
"div",
|
|
@@ -1105,17 +1353,17 @@ var ApprovalPreviewAnswer = ({ loadCase, answerId, caseData }) => {
|
|
|
1105
1353
|
children: /* @__PURE__ */ jsx8(UserIcon, { className: `w-5 h-5 ${statusDisplay.textColor}` })
|
|
1106
1354
|
}
|
|
1107
1355
|
) }),
|
|
1108
|
-
/* @__PURE__ */ jsx8("div", { className: "flex-1 min-w-0 pb-6", children: /* @__PURE__ */
|
|
1109
|
-
/* @__PURE__ */
|
|
1356
|
+
/* @__PURE__ */ jsx8("div", { className: "flex-1 min-w-0 pb-6", children: /* @__PURE__ */ jsxs5("div", { className: `p-3 rounded-lg border ${statusDisplay.borderColor} ${statusDisplay.bgColor}`, children: [
|
|
1357
|
+
/* @__PURE__ */ jsxs5("div", { className: "flex items-start justify-between gap-2 mb-1", children: [
|
|
1110
1358
|
/* @__PURE__ */ jsx8("span", { className: "font-medium text-sm text-[#191919] truncate", children: userName }),
|
|
1111
|
-
/* @__PURE__ */
|
|
1359
|
+
/* @__PURE__ */ jsxs5("span", { className: `text-xs font-medium ${statusDisplay.textColor} whitespace-nowrap`, children: [
|
|
1112
1360
|
"Rang ",
|
|
1113
1361
|
approval.rank
|
|
1114
1362
|
] })
|
|
1115
1363
|
] }),
|
|
1116
1364
|
userEmail && /* @__PURE__ */ jsx8("p", { className: "text-xs text-gray-600 truncate mb-2", children: userEmail }),
|
|
1117
|
-
/* @__PURE__ */
|
|
1118
|
-
/* @__PURE__ */ jsx8("div", { className: "", children: /* @__PURE__ */
|
|
1365
|
+
/* @__PURE__ */ jsxs5("div", { className: "flex items-center gap-2 mb-1", children: [
|
|
1366
|
+
/* @__PURE__ */ jsx8("div", { className: "", children: /* @__PURE__ */ jsxs5("div", { className: `w-5 h-5 rounded-full bg-white border ${statusDisplay.borderColor} flex items-center justify-center`, children: [
|
|
1119
1367
|
approval.answer === "approved" && /* @__PURE__ */ jsx8(CheckCircle, { className: "w-3 h-3 text-green-600" }),
|
|
1120
1368
|
approval.answer === "refused" && /* @__PURE__ */ jsx8(XCircle, { className: "w-3 h-3 text-red-600" }),
|
|
1121
1369
|
approval.answer === "suggest-correction" && /* @__PURE__ */ jsx8(Edit, { className: "w-3 h-3 text-orange-600" }),
|
|
@@ -1123,7 +1371,7 @@ var ApprovalPreviewAnswer = ({ loadCase, answerId, caseData }) => {
|
|
|
1123
1371
|
] }) }),
|
|
1124
1372
|
/* @__PURE__ */ jsx8("span", { className: `text-xs font-medium ${statusDisplay.textColor}`, children: statusDisplay.label })
|
|
1125
1373
|
] }),
|
|
1126
|
-
approval.answered_at && /* @__PURE__ */ jsx8(Fragment, { children: /* @__PURE__ */
|
|
1374
|
+
approval.answered_at && /* @__PURE__ */ jsx8(Fragment, { children: /* @__PURE__ */ jsxs5("p", { className: "text-xs text-gray-500", children: [
|
|
1127
1375
|
"R\xE9pondu le ",
|
|
1128
1376
|
new Date(approval.answered_at).toLocaleDateString("fr-FR", {
|
|
1129
1377
|
day: "2-digit",
|
|
@@ -1131,7 +1379,7 @@ var ApprovalPreviewAnswer = ({ loadCase, answerId, caseData }) => {
|
|
|
1131
1379
|
year: "numeric"
|
|
1132
1380
|
})
|
|
1133
1381
|
] }) }),
|
|
1134
|
-
approval.note && /* @__PURE__ */ jsx8("div", { className: "mt-2 pt-2 border-t border-gray-300", children: /* @__PURE__ */
|
|
1382
|
+
approval.note && /* @__PURE__ */ jsx8("div", { className: "mt-2 pt-2 border-t border-gray-300", children: /* @__PURE__ */ jsxs5("p", { className: "text-xs text-gray-600 italic", children: [
|
|
1135
1383
|
'"',
|
|
1136
1384
|
approval.note,
|
|
1137
1385
|
'"'
|
|
@@ -1139,23 +1387,23 @@ var ApprovalPreviewAnswer = ({ loadCase, answerId, caseData }) => {
|
|
|
1139
1387
|
] }) })
|
|
1140
1388
|
] }, approval.id);
|
|
1141
1389
|
};
|
|
1142
|
-
return /* @__PURE__ */
|
|
1143
|
-
/* @__PURE__ */
|
|
1144
|
-
/* @__PURE__ */ jsx8("div", { className: "lg:col-span-4 space-y-6 ", children: /* @__PURE__ */
|
|
1145
|
-
caseData?.requester && /* @__PURE__ */
|
|
1146
|
-
/* @__PURE__ */
|
|
1390
|
+
return /* @__PURE__ */ jsxs5("div", { className: " rounded-lg bg-white shadow-sm", children: [
|
|
1391
|
+
/* @__PURE__ */ jsxs5("div", { className: "grid grid-cols-1 lg:grid-cols-12 gap-6 p-2", children: [
|
|
1392
|
+
/* @__PURE__ */ jsx8("div", { className: "lg:col-span-4 space-y-6 ", children: /* @__PURE__ */ jsxs5("div", { className: "p-4 border bg-gray-50 border-gray-200 rounded-lg", children: [
|
|
1393
|
+
caseData?.requester && /* @__PURE__ */ jsxs5("div", { className: "space-y-3", children: [
|
|
1394
|
+
/* @__PURE__ */ jsxs5("h3", { className: "text-lg font-semibold text-[#191919] flex items-center gap-2", children: [
|
|
1147
1395
|
/* @__PURE__ */ jsx8(Send, { className: "w-5 h-5 text-[#6A8A82]" }),
|
|
1148
1396
|
"Demandeur"
|
|
1149
1397
|
] }),
|
|
1150
|
-
/* @__PURE__ */
|
|
1398
|
+
/* @__PURE__ */ jsxs5("div", { className: "relative flex gap-3", children: [
|
|
1151
1399
|
(caseData.verifications && caseData.verifications.length > 0 || caseData.validations && caseData.validations.length > 0) && /* @__PURE__ */ jsx8("div", { className: "absolute left-[19px] top-[40px] bottom-[-24px] w-0.5 bg-gray-300" }),
|
|
1152
1400
|
/* @__PURE__ */ jsx8("div", { className: "relative flex-shrink-0", children: /* @__PURE__ */ jsx8("div", { className: "w-10 h-10 rounded-full bg-blue-50 border-2 border-blue-200 flex items-center justify-center", children: /* @__PURE__ */ jsx8(UserIcon, { className: "w-5 h-5 text-blue-700" }) }) }),
|
|
1153
|
-
/* @__PURE__ */ jsx8("div", { className: "flex-1 min-w-0 pb-6", children: /* @__PURE__ */
|
|
1401
|
+
/* @__PURE__ */ jsx8("div", { className: "flex-1 min-w-0 pb-6", children: /* @__PURE__ */ jsxs5("div", { className: "p-3 rounded-lg border border-blue-200 bg-blue-50", children: [
|
|
1154
1402
|
/* @__PURE__ */ jsx8("span", { className: "font-medium text-sm text-[#191919] block mb-1", children: `${caseData.requester.first_name} ${caseData.requester.last_name}`.trim() }),
|
|
1155
1403
|
caseData.requester.email && /* @__PURE__ */ jsx8("p", { className: "text-xs text-gray-600 truncate", children: caseData.requester.email }),
|
|
1156
|
-
/* @__PURE__ */
|
|
1404
|
+
/* @__PURE__ */ jsxs5("div", { className: "mt-2 mb-1 flex items-center gap-2", children: [
|
|
1157
1405
|
/* @__PURE__ */ jsx8("span", { className: "w-5 h-5 rounded-full bg-white border border-blue-200 flex items-center justify-center", children: /* @__PURE__ */ jsx8(Send, { className: "w-3 h-3 text-blue-600" }) }),
|
|
1158
|
-
/* @__PURE__ */
|
|
1406
|
+
/* @__PURE__ */ jsxs5("span", { className: "text-xs text-blue-700 font-medium", children: [
|
|
1159
1407
|
"Demande cr\xE9\xE9e le ",
|
|
1160
1408
|
new Date(caseData.created_at || "").toLocaleDateString("fr-FR", {
|
|
1161
1409
|
day: "2-digit",
|
|
@@ -1167,8 +1415,8 @@ var ApprovalPreviewAnswer = ({ loadCase, answerId, caseData }) => {
|
|
|
1167
1415
|
] }) })
|
|
1168
1416
|
] })
|
|
1169
1417
|
] }),
|
|
1170
|
-
caseData?.verifications && caseData.verifications.length > 0 && /* @__PURE__ */
|
|
1171
|
-
/* @__PURE__ */
|
|
1418
|
+
caseData?.verifications && caseData.verifications.length > 0 && /* @__PURE__ */ jsxs5("div", { className: "space-y-3", children: [
|
|
1419
|
+
/* @__PURE__ */ jsxs5("h3", { className: "text-lg font-semibold text-[#191919] flex items-center gap-2", children: [
|
|
1172
1420
|
/* @__PURE__ */ jsx8(FileText, { className: "w-5 h-5 text-[#6A8A82]" }),
|
|
1173
1421
|
"V\xE9rifications (",
|
|
1174
1422
|
caseData.verifications.length,
|
|
@@ -1183,8 +1431,8 @@ var ApprovalPreviewAnswer = ({ loadCase, answerId, caseData }) => {
|
|
|
1183
1431
|
)
|
|
1184
1432
|
) })
|
|
1185
1433
|
] }),
|
|
1186
|
-
caseData?.validations && caseData.validations.length > 0 && /* @__PURE__ */
|
|
1187
|
-
/* @__PURE__ */
|
|
1434
|
+
caseData?.validations && caseData.validations.length > 0 && /* @__PURE__ */ jsxs5("div", { className: "space-y-3", children: [
|
|
1435
|
+
/* @__PURE__ */ jsxs5("h3", { className: "text-lg font-semibold text-[#191919] flex items-center gap-2", children: [
|
|
1188
1436
|
/* @__PURE__ */ jsx8(CheckCircle, { className: "w-5 h-5 text-[#6A8A82]" }),
|
|
1189
1437
|
"Validations (",
|
|
1190
1438
|
caseData.validations.length,
|
|
@@ -1194,29 +1442,29 @@ var ApprovalPreviewAnswer = ({ loadCase, answerId, caseData }) => {
|
|
|
1194
1442
|
(validation, index, array) => renderApprovalPerson(validation, index, "validation", index === array.length - 1)
|
|
1195
1443
|
) })
|
|
1196
1444
|
] }),
|
|
1197
|
-
(!caseData?.verifications || caseData.verifications.length === 0) && (!caseData?.validations || caseData.validations.length === 0) && /* @__PURE__ */
|
|
1198
|
-
/* @__PURE__ */ jsx8(
|
|
1445
|
+
(!caseData?.verifications || caseData.verifications.length === 0) && (!caseData?.validations || caseData.validations.length === 0) && /* @__PURE__ */ jsxs5("div", { className: "text-center py-8 text-gray-500", children: [
|
|
1446
|
+
/* @__PURE__ */ jsx8(AlertCircle2, { className: "w-12 h-12 mx-auto mb-3 text-gray-400" }),
|
|
1199
1447
|
/* @__PURE__ */ jsx8("p", { className: "text-sm", children: "Aucune approbation requise" })
|
|
1200
1448
|
] })
|
|
1201
1449
|
] }) }),
|
|
1202
|
-
/* @__PURE__ */
|
|
1203
|
-
/* @__PURE__ */
|
|
1204
|
-
/* @__PURE__ */
|
|
1205
|
-
/* @__PURE__ */
|
|
1450
|
+
/* @__PURE__ */ jsxs5("div", { className: "lg:col-span-8 space-y-6", children: [
|
|
1451
|
+
/* @__PURE__ */ jsxs5("div", { className: "bg-gray-50 p-4 rounded-lg border border-gray-200", children: [
|
|
1452
|
+
/* @__PURE__ */ jsxs5("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
|
|
1453
|
+
/* @__PURE__ */ jsxs5("div", { children: [
|
|
1206
1454
|
/* @__PURE__ */ jsx8("label", { className: "text-xs font-medium text-gray-500 uppercase", children: "Titre" }),
|
|
1207
1455
|
/* @__PURE__ */ jsx8("p", { className: "text-sm text-[#191919] font-medium mt-1", children: caseData?.title || "N/A" })
|
|
1208
1456
|
] }),
|
|
1209
|
-
/* @__PURE__ */
|
|
1457
|
+
/* @__PURE__ */ jsxs5("div", { children: [
|
|
1210
1458
|
/* @__PURE__ */ jsx8("label", { className: "text-xs font-medium text-gray-500 uppercase", children: "Statut" }),
|
|
1211
1459
|
/* @__PURE__ */ jsx8("p", { className: "text-sm text-[#191919] font-medium mt-1 capitalize", children: caseData?.status || "N/A" })
|
|
1212
1460
|
] })
|
|
1213
1461
|
] }),
|
|
1214
|
-
caseData?.description && /* @__PURE__ */
|
|
1462
|
+
caseData?.description && /* @__PURE__ */ jsxs5("div", { className: "mt-3 pt-3 border-t border-gray-300", children: [
|
|
1215
1463
|
/* @__PURE__ */ jsx8("label", { className: "text-xs font-medium text-gray-500 uppercase", children: "Description" }),
|
|
1216
1464
|
/* @__PURE__ */ jsx8("p", { className: "text-sm text-[#191919] mt-1", children: caseData.description })
|
|
1217
1465
|
] })
|
|
1218
1466
|
] }),
|
|
1219
|
-
/* @__PURE__ */ jsx8("div", { className: "space-y-3", children: /* @__PURE__ */
|
|
1467
|
+
/* @__PURE__ */ jsx8("div", { className: "space-y-3", children: /* @__PURE__ */ jsxs5("div", { className: "prose max-w-none", children: [
|
|
1220
1468
|
/* @__PURE__ */ jsx8("h3", { className: "text-lg font-semibold text-[#191919] mb-4", children: "Aper\xE7u du document" }),
|
|
1221
1469
|
caseData?.html_content ? /* @__PURE__ */ jsx8(
|
|
1222
1470
|
"div",
|
|
@@ -1224,13 +1472,13 @@ var ApprovalPreviewAnswer = ({ loadCase, answerId, caseData }) => {
|
|
|
1224
1472
|
className: "border border-[#D9D9D9] rounded-lg p-6 bg-white",
|
|
1225
1473
|
dangerouslySetInnerHTML: { __html: caseData.html_content }
|
|
1226
1474
|
}
|
|
1227
|
-
) : /* @__PURE__ */
|
|
1475
|
+
) : /* @__PURE__ */ jsxs5("div", { className: "text-center py-12 border-2 border-dashed border-[#D9D9D9] rounded-lg bg-[#FAFAFA]", children: [
|
|
1228
1476
|
/* @__PURE__ */ jsx8(Eye, { className: "w-12 h-12 text-[#767676] mx-auto mb-4" }),
|
|
1229
1477
|
/* @__PURE__ */ jsx8("p", { className: "text-[#767676]", children: "Aucun aper\xE7u disponible" })
|
|
1230
1478
|
] })
|
|
1231
1479
|
] }) }),
|
|
1232
|
-
/* @__PURE__ */
|
|
1233
|
-
/* @__PURE__ */
|
|
1480
|
+
/* @__PURE__ */ jsxs5("div", { className: "flex flex-wrap gap-3 justify-end pt-6 border-t border-[#D9D9D9]", children: [
|
|
1481
|
+
/* @__PURE__ */ jsxs5(
|
|
1234
1482
|
SecondaryButton,
|
|
1235
1483
|
{
|
|
1236
1484
|
onClick: refuse,
|
|
@@ -1242,7 +1490,7 @@ var ApprovalPreviewAnswer = ({ loadCase, answerId, caseData }) => {
|
|
|
1242
1490
|
]
|
|
1243
1491
|
}
|
|
1244
1492
|
),
|
|
1245
|
-
/* @__PURE__ */
|
|
1493
|
+
/* @__PURE__ */ jsxs5(
|
|
1246
1494
|
SecondaryButton,
|
|
1247
1495
|
{
|
|
1248
1496
|
onClick: suggestCorrection,
|
|
@@ -1254,7 +1502,7 @@ var ApprovalPreviewAnswer = ({ loadCase, answerId, caseData }) => {
|
|
|
1254
1502
|
]
|
|
1255
1503
|
}
|
|
1256
1504
|
),
|
|
1257
|
-
/* @__PURE__ */
|
|
1505
|
+
/* @__PURE__ */ jsxs5(
|
|
1258
1506
|
Buttons_default,
|
|
1259
1507
|
{
|
|
1260
1508
|
onClick: accept,
|
|
@@ -1269,9 +1517,9 @@ var ApprovalPreviewAnswer = ({ loadCase, answerId, caseData }) => {
|
|
|
1269
1517
|
] })
|
|
1270
1518
|
] })
|
|
1271
1519
|
] }),
|
|
1272
|
-
showNoteModal && /* @__PURE__ */ jsx8("div", { className: "fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4", children: /* @__PURE__ */ jsx8("div", { className: "bg-white rounded-lg shadow-xl max-w-md w-full", children: /* @__PURE__ */
|
|
1273
|
-
/* @__PURE__ */
|
|
1274
|
-
/* @__PURE__ */
|
|
1520
|
+
showNoteModal && /* @__PURE__ */ jsx8("div", { className: "fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4", children: /* @__PURE__ */ jsx8("div", { className: "bg-white rounded-lg shadow-xl max-w-md w-full", children: /* @__PURE__ */ jsxs5("div", { className: "p-6", children: [
|
|
1521
|
+
/* @__PURE__ */ jsxs5("div", { className: "flex items-center justify-between mb-4", children: [
|
|
1522
|
+
/* @__PURE__ */ jsxs5("h3", { className: "text-lg font-semibold text-[#191919]", children: [
|
|
1275
1523
|
currentAction === "approve" && "Approuver la demande",
|
|
1276
1524
|
currentAction === "reject" && "Refuser la demande",
|
|
1277
1525
|
currentAction === "suggest" && "Sugg\xE9rer une correction"
|
|
@@ -1282,12 +1530,12 @@ var ApprovalPreviewAnswer = ({ loadCase, answerId, caseData }) => {
|
|
|
1282
1530
|
onClick: closeNoteModal,
|
|
1283
1531
|
disabled: submitting,
|
|
1284
1532
|
className: "text-gray-500 hover:text-[#6A8A82] transition-colors",
|
|
1285
|
-
children: /* @__PURE__ */ jsx8(
|
|
1533
|
+
children: /* @__PURE__ */ jsx8(X2, { className: "w-5 h-5" })
|
|
1286
1534
|
}
|
|
1287
1535
|
)
|
|
1288
1536
|
] }),
|
|
1289
|
-
/* @__PURE__ */
|
|
1290
|
-
/* @__PURE__ */
|
|
1537
|
+
/* @__PURE__ */ jsxs5("div", { className: "mb-4", children: [
|
|
1538
|
+
/* @__PURE__ */ jsxs5("label", { className: "block text-sm font-medium text-[#191919] mb-2", children: [
|
|
1291
1539
|
"Note ",
|
|
1292
1540
|
currentAction === "suggest" && "(obligatoire pour suggestion)",
|
|
1293
1541
|
":"
|
|
@@ -1304,7 +1552,7 @@ var ApprovalPreviewAnswer = ({ loadCase, answerId, caseData }) => {
|
|
|
1304
1552
|
}
|
|
1305
1553
|
)
|
|
1306
1554
|
] }),
|
|
1307
|
-
/* @__PURE__ */
|
|
1555
|
+
/* @__PURE__ */ jsxs5("div", { className: "flex gap-3 justify-end", children: [
|
|
1308
1556
|
/* @__PURE__ */ jsx8(
|
|
1309
1557
|
SecondaryButton,
|
|
1310
1558
|
{
|
|
@@ -1319,10 +1567,10 @@ var ApprovalPreviewAnswer = ({ loadCase, answerId, caseData }) => {
|
|
|
1319
1567
|
onClick: executeAction,
|
|
1320
1568
|
disabled: submitting || currentAction === "suggest" && !note.trim(),
|
|
1321
1569
|
classname: "flex items-center gap-2",
|
|
1322
|
-
children: submitting ? /* @__PURE__ */
|
|
1570
|
+
children: submitting ? /* @__PURE__ */ jsxs5(Fragment, { children: [
|
|
1323
1571
|
/* @__PURE__ */ jsx8(Loader, { className: "w-4 h-4 animate-spin" }),
|
|
1324
1572
|
"Traitement..."
|
|
1325
|
-
] }) : /* @__PURE__ */
|
|
1573
|
+
] }) : /* @__PURE__ */ jsxs5(Fragment, { children: [
|
|
1326
1574
|
currentAction === "approve" && /* @__PURE__ */ jsx8(Check, { className: "w-4 h-4" }),
|
|
1327
1575
|
currentAction === "reject" && /* @__PURE__ */ jsx8(XCircle, { className: "w-4 h-4" }),
|
|
1328
1576
|
currentAction === "suggest" && /* @__PURE__ */ jsx8(Edit, { className: "w-4 h-4" }),
|
|
@@ -1337,12 +1585,87 @@ var ApprovalPreviewAnswer = ({ loadCase, answerId, caseData }) => {
|
|
|
1337
1585
|
var ApprovalPreviewAnswer_default = ApprovalPreviewAnswer;
|
|
1338
1586
|
|
|
1339
1587
|
// src/components/layout/ModernDoubleSidebarLayout.tsx
|
|
1340
|
-
import { Fragment as Fragment2, jsx as jsx9, jsxs as
|
|
1588
|
+
import { Fragment as Fragment2, jsx as jsx9, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
1589
|
+
var MODULE_URLS = {
|
|
1590
|
+
production: {
|
|
1591
|
+
wiseConnect: "https://rewise.praedium-tech.com/admin/crm/trade-strategy/lead-insight/",
|
|
1592
|
+
wiseReach: "https://rewise.praedium-tech.com/admin/marketing/dashboard/",
|
|
1593
|
+
wiseOps: "https://wisefm.praedium-tech.com/",
|
|
1594
|
+
wiseGuard: "https://rewise.praedium-tech.com/admin/security/dashboard/",
|
|
1595
|
+
wiseThrive: "https://rewise.praedium-tech.com/admin/thrive/scorecard/dashboard/financial/",
|
|
1596
|
+
wiseView: "https://reporting.rewise.praedium-tech.com/",
|
|
1597
|
+
wiseProcess: "https://rewise.praedium-tech.com/workspace/sop-connect/",
|
|
1598
|
+
wiseBill: "https://rewise.praedium-tech.com/admin/invoicing/insight/summary/",
|
|
1599
|
+
wiseBooks: "https://rewise.praedium-tech.com/admin/accounting/client/invoice-queue/",
|
|
1600
|
+
wiseAsset: "#",
|
|
1601
|
+
wiseCash: "https://rewise.praedium-tech.com/admin/finance/dashboard/",
|
|
1602
|
+
wiseCollect: "https://rewise.praedium-tech.com/admin/recovery/collection/dashboard/",
|
|
1603
|
+
wiseProcure: "https://rewise.praedium-tech.com/admin/procurement/dashboard/one/",
|
|
1604
|
+
wiseHR: "https://rewise.praedium-tech.com/admin/human-capital/dashboard/"
|
|
1605
|
+
},
|
|
1606
|
+
development: {
|
|
1607
|
+
wiseConnect: "http://localhost:5173/admin/crm/trade-strategy/lead-insight/",
|
|
1608
|
+
wiseReach: "http://localhost:5173/admin/marketing/dashboard/",
|
|
1609
|
+
wiseOps: "http://localhost:5174/",
|
|
1610
|
+
wiseGuard: "http://localhost:5173/admin/security/dashboard/",
|
|
1611
|
+
wiseThrive: "http://localhost:5173/admin/thrive/scorecard/dashboard/financial/",
|
|
1612
|
+
wiseView: "http://localhost:5175/",
|
|
1613
|
+
wiseProcess: "http://localhost:5173/workspace/sop-connect/",
|
|
1614
|
+
wiseBill: "http://localhost:5173/admin/invoicing/insight/summary/",
|
|
1615
|
+
wiseBooks: "http://localhost:5173/admin/accounting/client/invoice-queue/",
|
|
1616
|
+
wiseAsset: "#",
|
|
1617
|
+
wiseCash: "http://localhost:5173/admin/finance/dashboard/",
|
|
1618
|
+
wiseCollect: "http://localhost:5173/admin/recovery/collection/dashboard/",
|
|
1619
|
+
wiseProcure: "http://localhost:5173/admin/procurement/dashboard/one/",
|
|
1620
|
+
wiseHR: "http://localhost:5173/admin/human-capital/dashboard/"
|
|
1621
|
+
}
|
|
1622
|
+
};
|
|
1623
|
+
var getModuleUrls = (token) => {
|
|
1624
|
+
const env = localStorage.getItem("env") || "prod";
|
|
1625
|
+
const urls = env === "localhost" ? MODULE_URLS.development : MODULE_URLS.production;
|
|
1626
|
+
return {
|
|
1627
|
+
...urls,
|
|
1628
|
+
wiseOps: token ? `${urls.wiseOps}?tkn=${token}` : urls.wiseOps
|
|
1629
|
+
};
|
|
1630
|
+
};
|
|
1631
|
+
var MODULE_CODE_MAP = {
|
|
1632
|
+
"CRM": "WiseConnect",
|
|
1633
|
+
"MARKETING": "WiseReach",
|
|
1634
|
+
"FACILITY": "WiseOps",
|
|
1635
|
+
"SECURITY": "WiseGuard",
|
|
1636
|
+
"THRIVE": "WiseThrive",
|
|
1637
|
+
"BI": "WiseView",
|
|
1638
|
+
"SOP": "WiseProcess",
|
|
1639
|
+
"BILLING": "WiseBill",
|
|
1640
|
+
"ACCOUNTING": "WiseBooks",
|
|
1641
|
+
"ASSET": "WiseAsset",
|
|
1642
|
+
"FINANCE": "WiseCash",
|
|
1643
|
+
"COLLECTION": "WiseCollect",
|
|
1644
|
+
"PURCHASE": "WiseProcure",
|
|
1645
|
+
"HR": "WiseHR"
|
|
1646
|
+
};
|
|
1341
1647
|
var RewiseLayout = ({ children, module_name = "Rewise", module_description = "Description du module", primaryMenuItems, secondaryMenuItems }) => {
|
|
1342
1648
|
const location = useLocation();
|
|
1343
1649
|
const navigate = useNavigate();
|
|
1344
1650
|
const { theme, themeType, setTheme } = useTheme();
|
|
1345
|
-
const { loggedUser, activeBusinessEntity, setActiveBusinessEntity } = useSession();
|
|
1651
|
+
const { loggedUser, token, activeBusinessEntity, setActiveBusinessEntity } = useSession();
|
|
1652
|
+
const moduleUrls = getModuleUrls(token || void 0);
|
|
1653
|
+
const getOrganizationModules = () => {
|
|
1654
|
+
if (!activeBusinessEntity) return [];
|
|
1655
|
+
const org = activeBusinessEntity.organization;
|
|
1656
|
+
if (typeof org === "object" && org !== null && "modules" in org) {
|
|
1657
|
+
return org.modules || [];
|
|
1658
|
+
}
|
|
1659
|
+
return [];
|
|
1660
|
+
};
|
|
1661
|
+
const organizationModules = getOrganizationModules();
|
|
1662
|
+
const organizationModuleCodes = organizationModules.map((m) => m.code);
|
|
1663
|
+
const isModuleAccessible = (moduleName) => {
|
|
1664
|
+
if (organizationModules.length === 0) return true;
|
|
1665
|
+
const moduleCode = Object.entries(MODULE_CODE_MAP).find(([_, name]) => name === moduleName)?.[0];
|
|
1666
|
+
if (!moduleCode) return true;
|
|
1667
|
+
return organizationModuleCodes.includes(moduleCode);
|
|
1668
|
+
};
|
|
1346
1669
|
const [primaryCollapsed, setPrimaryCollapsed] = useState5(false);
|
|
1347
1670
|
const [secondaryCollapsed, setSecondaryCollapsed] = useState5(false);
|
|
1348
1671
|
const [mobileMenuOpen, setMobileMenuOpen] = useState5(false);
|
|
@@ -1352,6 +1675,31 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "De
|
|
|
1352
1675
|
const [showUserMenu, setShowUserMenu] = useState5(false);
|
|
1353
1676
|
const [showThemeMenu, setShowThemeMenu] = useState5(false);
|
|
1354
1677
|
const [showCenterMenu, setShowCenterMenu] = useState5(false);
|
|
1678
|
+
const [showModulesMenu, setShowModulesMenu] = useState5(false);
|
|
1679
|
+
const [currentSlide, setCurrentSlide] = useState5(0);
|
|
1680
|
+
const slides = [
|
|
1681
|
+
{
|
|
1682
|
+
title: "Rappel \u2013 Gestion des jours de cong\xE9",
|
|
1683
|
+
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."
|
|
1684
|
+
},
|
|
1685
|
+
{
|
|
1686
|
+
title: "Nouveau \u2013 Mise \xE0 jour des proc\xE9dures",
|
|
1687
|
+
content: "Les nouvelles proc\xE9dures de validation sont maintenant disponibles. Consultez votre manuel utilisateur pour plus d'informations sur les changements."
|
|
1688
|
+
},
|
|
1689
|
+
{
|
|
1690
|
+
title: "Important \u2013 Formation obligatoire",
|
|
1691
|
+
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."
|
|
1692
|
+
}
|
|
1693
|
+
];
|
|
1694
|
+
const nextSlide = () => {
|
|
1695
|
+
setCurrentSlide((prev) => (prev + 1) % slides.length);
|
|
1696
|
+
};
|
|
1697
|
+
const prevSlide = () => {
|
|
1698
|
+
setCurrentSlide((prev) => (prev - 1 + slides.length) % slides.length);
|
|
1699
|
+
};
|
|
1700
|
+
const goToSlide = (index) => {
|
|
1701
|
+
setCurrentSlide(index);
|
|
1702
|
+
};
|
|
1355
1703
|
const [showApprovalModal, setShowApprovalModal] = useState5(false);
|
|
1356
1704
|
const [approvalAnswerDetail, setApprovalAnswerDetail] = useState5(null);
|
|
1357
1705
|
const [caseData, setCaseData] = useState5(null);
|
|
@@ -1375,6 +1723,7 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "De
|
|
|
1375
1723
|
setShowNotifications(false);
|
|
1376
1724
|
setShowUserMenu(false);
|
|
1377
1725
|
setShowThemeMenu(false);
|
|
1726
|
+
setShowModulesMenu(false);
|
|
1378
1727
|
setMobileMenuOpen(false);
|
|
1379
1728
|
}
|
|
1380
1729
|
};
|
|
@@ -1446,7 +1795,7 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "De
|
|
|
1446
1795
|
showError("Erreur lors du marquage de la notification comme lue");
|
|
1447
1796
|
}
|
|
1448
1797
|
};
|
|
1449
|
-
return /* @__PURE__ */
|
|
1798
|
+
return /* @__PURE__ */ jsxs6("div", { className: "flex h-screen bg-[var(--color-background)] overflow-hidden", children: [
|
|
1450
1799
|
/* @__PURE__ */ jsx9(
|
|
1451
1800
|
"a",
|
|
1452
1801
|
{
|
|
@@ -1455,7 +1804,7 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "De
|
|
|
1455
1804
|
children: "Aller au contenu principal"
|
|
1456
1805
|
}
|
|
1457
1806
|
),
|
|
1458
|
-
/* @__PURE__ */
|
|
1807
|
+
/* @__PURE__ */ jsxs6(
|
|
1459
1808
|
"aside",
|
|
1460
1809
|
{
|
|
1461
1810
|
className: cn(
|
|
@@ -1465,13 +1814,13 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "De
|
|
|
1465
1814
|
role: "navigation",
|
|
1466
1815
|
"aria-label": "Navigation principale",
|
|
1467
1816
|
children: [
|
|
1468
|
-
/* @__PURE__ */
|
|
1469
|
-
/* @__PURE__ */
|
|
1817
|
+
/* @__PURE__ */ jsxs6("div", { className: "h-16 flex items-center justify-between px-4 border-b border-[var(--color-sidebar-border)]", children: [
|
|
1818
|
+
/* @__PURE__ */ jsxs6("div", { className: cn(
|
|
1470
1819
|
"flex items-center gap-3",
|
|
1471
1820
|
primaryCollapsed && "justify-center"
|
|
1472
1821
|
), children: [
|
|
1473
1822
|
/* @__PURE__ */ jsx9("div", { className: "w-10 h-10 bg-[var(--color-primary)] rounded-lg flex items-center justify-center", children: /* @__PURE__ */ jsx9("span", { className: "text-[var(--color-background)] font-bold text-xl", children: "W" }) }),
|
|
1474
|
-
!primaryCollapsed && /* @__PURE__ */
|
|
1823
|
+
!primaryCollapsed && /* @__PURE__ */ jsxs6("div", { children: [
|
|
1475
1824
|
/* @__PURE__ */ jsx9("h1", { className: "text-[var(--color-sidebar-text)] font-bold text-lg", children: module_name }),
|
|
1476
1825
|
/* @__PURE__ */ jsx9("p", { className: "text-[var(--color-sidebar-text-secondary)] text-xs", children: module_description })
|
|
1477
1826
|
] })
|
|
@@ -1496,7 +1845,7 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "De
|
|
|
1496
1845
|
className: "flex-1 py-4 overflow-y-auto",
|
|
1497
1846
|
role: "menubar",
|
|
1498
1847
|
"aria-label": "Modules principaux",
|
|
1499
|
-
children: primaryMenuItems.map((item) => /* @__PURE__ */
|
|
1848
|
+
children: primaryMenuItems.map((item) => /* @__PURE__ */ jsxs6(
|
|
1500
1849
|
"button",
|
|
1501
1850
|
{
|
|
1502
1851
|
onClick: () => {
|
|
@@ -1521,7 +1870,7 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "De
|
|
|
1521
1870
|
"transition-colors",
|
|
1522
1871
|
isModuleActive(item.id) ? "text-[var(--color-primary)]" : "text-[var(--color-sidebar-text-secondary)] group-hover:text-[var(--color-sidebar-text)]"
|
|
1523
1872
|
), children: item.icon }),
|
|
1524
|
-
!primaryCollapsed && /* @__PURE__ */
|
|
1873
|
+
!primaryCollapsed && /* @__PURE__ */ jsxs6(Fragment2, { children: [
|
|
1525
1874
|
/* @__PURE__ */ jsx9("span", { className: cn(
|
|
1526
1875
|
"flex-1 text-left text-sm font-medium transition-colors",
|
|
1527
1876
|
isModuleActive(item.id) ? "text-[var(--color-sidebar-text)]" : "text-[var(--color-sidebar-text-secondary)] group-hover:text-[var(--color-sidebar-text)]"
|
|
@@ -1535,12 +1884,12 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "De
|
|
|
1535
1884
|
))
|
|
1536
1885
|
}
|
|
1537
1886
|
),
|
|
1538
|
-
/* @__PURE__ */ jsx9("div", { className: "p-4 border-t border-[var(--color-sidebar-border)]", children: /* @__PURE__ */
|
|
1887
|
+
/* @__PURE__ */ jsx9("div", { className: "p-4 border-t border-[var(--color-sidebar-border)]", children: /* @__PURE__ */ jsxs6("div", { className: cn(
|
|
1539
1888
|
"flex items-center gap-3",
|
|
1540
1889
|
primaryCollapsed && "justify-center"
|
|
1541
1890
|
), children: [
|
|
1542
1891
|
/* @__PURE__ */ jsx9("div", { className: "w-10 h-10 bg-[var(--color-primary)] rounded-full flex items-center justify-center", children: /* @__PURE__ */ jsx9(User, { className: "w-5 h-5 text-[var(--color-background)]" }) }),
|
|
1543
|
-
!primaryCollapsed && /* @__PURE__ */
|
|
1892
|
+
!primaryCollapsed && /* @__PURE__ */ jsxs6("div", { className: "flex-1", children: [
|
|
1544
1893
|
/* @__PURE__ */ jsx9("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" }),
|
|
1545
1894
|
/* @__PURE__ */ jsx9("p", { className: "text-xs text-[var(--color-sidebar-text-secondary)]", children: loggedUser?.email || "email@example.com" })
|
|
1546
1895
|
] })
|
|
@@ -1548,7 +1897,7 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "De
|
|
|
1548
1897
|
]
|
|
1549
1898
|
}
|
|
1550
1899
|
),
|
|
1551
|
-
secondaryMenuItems[selectedModule] && /* @__PURE__ */
|
|
1900
|
+
secondaryMenuItems[selectedModule] && /* @__PURE__ */ jsxs6(Fragment2, { children: [
|
|
1552
1901
|
secondaryCollapsed && /* @__PURE__ */ jsx9(
|
|
1553
1902
|
"button",
|
|
1554
1903
|
{
|
|
@@ -1558,7 +1907,7 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "De
|
|
|
1558
1907
|
children: /* @__PURE__ */ jsx9(ChevronRight, { className: "w-5 h-5 text-[var(--color-text-tertiary)]" })
|
|
1559
1908
|
}
|
|
1560
1909
|
),
|
|
1561
|
-
/* @__PURE__ */
|
|
1910
|
+
/* @__PURE__ */ jsxs6(
|
|
1562
1911
|
"aside",
|
|
1563
1912
|
{
|
|
1564
1913
|
className: cn(
|
|
@@ -1568,7 +1917,7 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "De
|
|
|
1568
1917
|
role: "navigation",
|
|
1569
1918
|
"aria-label": "Navigation secondaire",
|
|
1570
1919
|
children: [
|
|
1571
|
-
/* @__PURE__ */
|
|
1920
|
+
/* @__PURE__ */ jsxs6("div", { className: "h-16 flex items-center justify-between px-4 border-b border-[var(--color-border)]", children: [
|
|
1572
1921
|
/* @__PURE__ */ jsx9("h2", { className: "text-sm font-semibold text-[var(--color-text-secondary)] uppercase tracking-wider whitespace-nowrap", children: primaryMenuItems.find((item) => item.id === selectedModule)?.label }),
|
|
1573
1922
|
/* @__PURE__ */ jsx9(
|
|
1574
1923
|
"button",
|
|
@@ -1589,7 +1938,7 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "De
|
|
|
1589
1938
|
className: "flex-1 py-4 overflow-y-auto",
|
|
1590
1939
|
role: "menu",
|
|
1591
1940
|
"aria-label": "Sous-navigation",
|
|
1592
|
-
children: secondaryMenuItems[selectedModule]?.map((item) => /* @__PURE__ */
|
|
1941
|
+
children: secondaryMenuItems[selectedModule]?.map((item) => /* @__PURE__ */ jsxs6(
|
|
1593
1942
|
"button",
|
|
1594
1943
|
{
|
|
1595
1944
|
onClick: () => item.path && navigate(item.path),
|
|
@@ -1620,7 +1969,7 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "De
|
|
|
1620
1969
|
}
|
|
1621
1970
|
)
|
|
1622
1971
|
] }),
|
|
1623
|
-
mobileMenuOpen && /* @__PURE__ */
|
|
1972
|
+
mobileMenuOpen && /* @__PURE__ */ jsxs6(Fragment2, { children: [
|
|
1624
1973
|
/* @__PURE__ */ jsx9(
|
|
1625
1974
|
"div",
|
|
1626
1975
|
{
|
|
@@ -1629,7 +1978,7 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "De
|
|
|
1629
1978
|
"aria-hidden": "true"
|
|
1630
1979
|
}
|
|
1631
1980
|
),
|
|
1632
|
-
/* @__PURE__ */
|
|
1981
|
+
/* @__PURE__ */ jsxs6(
|
|
1633
1982
|
"aside",
|
|
1634
1983
|
{
|
|
1635
1984
|
className: "fixed left-0 top-0 w-80 h-full bg-[var(--color-sidebar-bg)] z-50 lg:hidden transform transition-transform duration-300 ease-in-out shadow-2xl",
|
|
@@ -1637,10 +1986,10 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "De
|
|
|
1637
1986
|
role: "navigation",
|
|
1638
1987
|
"aria-label": "Navigation mobile",
|
|
1639
1988
|
children: [
|
|
1640
|
-
/* @__PURE__ */
|
|
1641
|
-
/* @__PURE__ */
|
|
1989
|
+
/* @__PURE__ */ jsxs6("div", { className: "h-16 flex items-center justify-between px-4 border-b border-[var(--color-sidebar-border)]", children: [
|
|
1990
|
+
/* @__PURE__ */ jsxs6("div", { className: "flex items-center gap-3", children: [
|
|
1642
1991
|
/* @__PURE__ */ jsx9("div", { className: "w-10 h-10 bg-[var(--color-primary)] rounded-lg flex items-center justify-center", children: /* @__PURE__ */ jsx9("span", { className: "text-[var(--color-background)] font-bold text-xl", children: "W" }) }),
|
|
1643
|
-
/* @__PURE__ */
|
|
1992
|
+
/* @__PURE__ */ jsxs6("div", { children: [
|
|
1644
1993
|
/* @__PURE__ */ jsx9("h1", { className: "text-white font-bold text-lg", children: "WiseBook" }),
|
|
1645
1994
|
/* @__PURE__ */ jsx9("p", { className: "text-gray-400 text-xs", children: "ERP Next-Gen" })
|
|
1646
1995
|
] })
|
|
@@ -1651,12 +2000,12 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "De
|
|
|
1651
2000
|
onClick: () => setMobileMenuOpen(false),
|
|
1652
2001
|
className: "text-[var(--color-sidebar-text-secondary)]",
|
|
1653
2002
|
"aria-label": "Fermer le menu",
|
|
1654
|
-
children: /* @__PURE__ */ jsx9(
|
|
2003
|
+
children: /* @__PURE__ */ jsx9(X3, { className: "w-6 h-6" })
|
|
1655
2004
|
}
|
|
1656
2005
|
)
|
|
1657
2006
|
] }),
|
|
1658
|
-
/* @__PURE__ */ jsx9("nav", { className: "py-4", role: "menubar", children: primaryMenuItems.map((item) => /* @__PURE__ */
|
|
1659
|
-
/* @__PURE__ */
|
|
2007
|
+
/* @__PURE__ */ jsx9("nav", { className: "py-4", role: "menubar", children: primaryMenuItems.map((item) => /* @__PURE__ */ jsxs6("div", { children: [
|
|
2008
|
+
/* @__PURE__ */ jsxs6(
|
|
1660
2009
|
"button",
|
|
1661
2010
|
{
|
|
1662
2011
|
onClick: () => {
|
|
@@ -1687,7 +2036,7 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "De
|
|
|
1687
2036
|
]
|
|
1688
2037
|
}
|
|
1689
2038
|
),
|
|
1690
|
-
isModuleActive(item.id) && secondaryMenuItems[item.id] && /* @__PURE__ */ jsx9("div", { className: "bg-[var(--color-sidebar-submenu-bg)] py-2", children: secondaryMenuItems[item.id].map((subItem) => /* @__PURE__ */
|
|
2039
|
+
isModuleActive(item.id) && secondaryMenuItems[item.id] && /* @__PURE__ */ jsx9("div", { className: "bg-[var(--color-sidebar-submenu-bg)] py-2", children: secondaryMenuItems[item.id].map((subItem) => /* @__PURE__ */ jsxs6(
|
|
1691
2040
|
"button",
|
|
1692
2041
|
{
|
|
1693
2042
|
onClick: () => {
|
|
@@ -1715,14 +2064,14 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "De
|
|
|
1715
2064
|
}
|
|
1716
2065
|
)
|
|
1717
2066
|
] }),
|
|
1718
|
-
/* @__PURE__ */
|
|
1719
|
-
/* @__PURE__ */
|
|
2067
|
+
/* @__PURE__ */ jsxs6("div", { className: "flex-1 flex flex-col overflow-hidden", children: [
|
|
2068
|
+
/* @__PURE__ */ jsxs6(
|
|
1720
2069
|
"header",
|
|
1721
2070
|
{
|
|
1722
2071
|
className: "h-14 bg-[var(--color-background)] border-b border-[var(--color-border)] flex items-center justify-between px-3 lg:px-4",
|
|
1723
2072
|
role: "banner",
|
|
1724
2073
|
children: [
|
|
1725
|
-
/* @__PURE__ */
|
|
2074
|
+
/* @__PURE__ */ jsxs6("div", { className: "flex items-center gap-4 flex-1", children: [
|
|
1726
2075
|
/* @__PURE__ */ jsx9(
|
|
1727
2076
|
"button",
|
|
1728
2077
|
{
|
|
@@ -1737,7 +2086,7 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "De
|
|
|
1737
2086
|
{
|
|
1738
2087
|
className: "hidden sm:flex items-center gap-2 text-sm",
|
|
1739
2088
|
"aria-label": "Fil d'Ariane",
|
|
1740
|
-
children: getBreadcrumbs().map((crumb, index) => /* @__PURE__ */
|
|
2089
|
+
children: getBreadcrumbs().map((crumb, index) => /* @__PURE__ */ jsxs6(React4.Fragment, { children: [
|
|
1741
2090
|
index > 0 && /* @__PURE__ */ jsx9(ChevronRight, { className: "w-4 h-4 text-[var(--color-text-tertiary)]" }),
|
|
1742
2091
|
/* @__PURE__ */ jsx9(
|
|
1743
2092
|
"button",
|
|
@@ -1753,7 +2102,7 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "De
|
|
|
1753
2102
|
] }, crumb.path))
|
|
1754
2103
|
}
|
|
1755
2104
|
),
|
|
1756
|
-
/* @__PURE__ */
|
|
2105
|
+
/* @__PURE__ */ jsxs6("div", { className: "relative max-w-md flex-1 hidden lg:block", children: [
|
|
1757
2106
|
/* @__PURE__ */ jsx9(Search, { className: "absolute left-3 top-1/2 -translate-y-1/2 text-[var(--color-text-tertiary)] w-5 h-5" }),
|
|
1758
2107
|
/* @__PURE__ */ jsx9(
|
|
1759
2108
|
"input",
|
|
@@ -1769,9 +2118,20 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "De
|
|
|
1769
2118
|
)
|
|
1770
2119
|
] })
|
|
1771
2120
|
] }),
|
|
1772
|
-
/* @__PURE__ */
|
|
1773
|
-
|
|
1774
|
-
|
|
2121
|
+
/* @__PURE__ */ jsxs6("div", { className: "flex items-center gap-3", children: [
|
|
2122
|
+
/* @__PURE__ */ jsx9("div", { className: "relative", children: /* @__PURE__ */ jsx9(
|
|
2123
|
+
"button",
|
|
2124
|
+
{
|
|
2125
|
+
onClick: () => setShowModulesMenu(!showModulesMenu),
|
|
2126
|
+
className: "p-2 hover:bg-[var(--color-surface-hover)] rounded-lg transition-colors",
|
|
2127
|
+
title: "Acc\xE8s aux modules",
|
|
2128
|
+
"aria-label": "Menu des modules",
|
|
2129
|
+
"aria-expanded": showModulesMenu,
|
|
2130
|
+
children: /* @__PURE__ */ jsx9(LayoutGrid, { className: "w-5 h-5 text-[var(--color-text-secondary)]" })
|
|
2131
|
+
}
|
|
2132
|
+
) }),
|
|
2133
|
+
loggedUser?.centers_access && loggedUser.centers_access.length > 0 && /* @__PURE__ */ jsxs6("div", { className: "relative", children: [
|
|
2134
|
+
/* @__PURE__ */ jsxs6(
|
|
1775
2135
|
"button",
|
|
1776
2136
|
{
|
|
1777
2137
|
onClick: () => setShowCenterMenu(!showCenterMenu),
|
|
@@ -1795,9 +2155,9 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "De
|
|
|
1795
2155
|
className: "absolute right-0 mt-2 w-64 bg-[var(--color-background)] rounded-lg shadow-xl border border-[var(--color-border)] z-50 max-h-80 overflow-y-auto",
|
|
1796
2156
|
role: "menu",
|
|
1797
2157
|
"aria-label": "S\xE9lection du centre",
|
|
1798
|
-
children: /* @__PURE__ */
|
|
2158
|
+
children: /* @__PURE__ */ jsxs6("div", { className: "p-2", children: [
|
|
1799
2159
|
/* @__PURE__ */ jsx9("p", { className: "px-3 py-2 text-xs font-semibold text-[var(--color-text-tertiary)] uppercase", children: "Centres disponibles" }),
|
|
1800
|
-
loggedUser.centers_access.map((center) => /* @__PURE__ */
|
|
2160
|
+
loggedUser.centers_access.map((center) => /* @__PURE__ */ jsxs6(
|
|
1801
2161
|
"button",
|
|
1802
2162
|
{
|
|
1803
2163
|
onClick: () => {
|
|
@@ -1815,7 +2175,7 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "De
|
|
|
1815
2175
|
"w-5 h-5",
|
|
1816
2176
|
selectedCenterId === center.id ? "text-[var(--color-primary)]" : "text-[var(--color-text-tertiary)]"
|
|
1817
2177
|
) }),
|
|
1818
|
-
/* @__PURE__ */
|
|
2178
|
+
/* @__PURE__ */ jsxs6("div", { className: "text-left flex-1", children: [
|
|
1819
2179
|
/* @__PURE__ */ jsx9("p", { className: cn(
|
|
1820
2180
|
"text-sm font-medium",
|
|
1821
2181
|
selectedCenterId === center.id ? "text-[var(--color-primary)]" : "text-[var(--color-text-primary)]"
|
|
@@ -1830,7 +2190,7 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "De
|
|
|
1830
2190
|
}
|
|
1831
2191
|
)
|
|
1832
2192
|
] }),
|
|
1833
|
-
/* @__PURE__ */
|
|
2193
|
+
/* @__PURE__ */ jsxs6("div", { className: "relative", children: [
|
|
1834
2194
|
/* @__PURE__ */ jsx9(
|
|
1835
2195
|
"button",
|
|
1836
2196
|
{
|
|
@@ -1848,9 +2208,9 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "De
|
|
|
1848
2208
|
className: "absolute right-0 mt-2 w-64 bg-[var(--color-background)] rounded-lg shadow-xl border border-[var(--color-border)] z-50",
|
|
1849
2209
|
role: "menu",
|
|
1850
2210
|
"aria-label": "S\xE9lection du th\xE8me",
|
|
1851
|
-
children: /* @__PURE__ */
|
|
2211
|
+
children: /* @__PURE__ */ jsxs6("div", { className: "p-2", children: [
|
|
1852
2212
|
/* @__PURE__ */ jsx9("p", { className: "px-3 py-2 text-xs font-semibold text-[var(--color-text-tertiary)] uppercase", children: "Th\xE8mes disponibles" }),
|
|
1853
|
-
/* @__PURE__ */
|
|
2213
|
+
/* @__PURE__ */ jsxs6(
|
|
1854
2214
|
"button",
|
|
1855
2215
|
{
|
|
1856
2216
|
onClick: () => handleThemeChange("elegant"),
|
|
@@ -1861,14 +2221,14 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "De
|
|
|
1861
2221
|
role: "menuitem",
|
|
1862
2222
|
children: [
|
|
1863
2223
|
/* @__PURE__ */ jsx9("div", { className: "w-10 h-10 rounded-lg bg-gradient-to-br from-[var(--color-primary)] to-[var(--color-accent)]" }),
|
|
1864
|
-
/* @__PURE__ */
|
|
2224
|
+
/* @__PURE__ */ jsxs6("div", { className: "text-left", children: [
|
|
1865
2225
|
/* @__PURE__ */ jsx9("p", { className: "text-sm font-medium", children: "\xC9l\xE9gance Sobre" }),
|
|
1866
2226
|
/* @__PURE__ */ jsx9("p", { className: "text-xs text-[var(--color-text-tertiary)]", children: "Finance traditionnelle" })
|
|
1867
2227
|
] })
|
|
1868
2228
|
]
|
|
1869
2229
|
}
|
|
1870
2230
|
),
|
|
1871
|
-
/* @__PURE__ */
|
|
2231
|
+
/* @__PURE__ */ jsxs6(
|
|
1872
2232
|
"button",
|
|
1873
2233
|
{
|
|
1874
2234
|
onClick: () => handleThemeChange("fintech"),
|
|
@@ -1879,14 +2239,14 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "De
|
|
|
1879
2239
|
role: "menuitem",
|
|
1880
2240
|
children: [
|
|
1881
2241
|
/* @__PURE__ */ jsx9("div", { className: "w-10 h-10 rounded-lg bg-gradient-to-br from-[var(--color-success)] to-[var(--color-text-primary)]" }),
|
|
1882
|
-
/* @__PURE__ */
|
|
2242
|
+
/* @__PURE__ */ jsxs6("div", { className: "text-left", children: [
|
|
1883
2243
|
/* @__PURE__ */ jsx9("p", { className: "text-sm font-medium", children: "Modern Fintech" }),
|
|
1884
2244
|
/* @__PURE__ */ jsx9("p", { className: "text-xs text-[var(--color-text-tertiary)]", children: "Tableau de bord moderne" })
|
|
1885
2245
|
] })
|
|
1886
2246
|
]
|
|
1887
2247
|
}
|
|
1888
2248
|
),
|
|
1889
|
-
/* @__PURE__ */
|
|
2249
|
+
/* @__PURE__ */ jsxs6(
|
|
1890
2250
|
"button",
|
|
1891
2251
|
{
|
|
1892
2252
|
onClick: () => handleThemeChange("minimalist"),
|
|
@@ -1897,7 +2257,7 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "De
|
|
|
1897
2257
|
role: "menuitem",
|
|
1898
2258
|
children: [
|
|
1899
2259
|
/* @__PURE__ */ jsx9("div", { className: "w-10 h-10 rounded-lg bg-gradient-to-br from-[var(--color-text-secondary)] to-[var(--color-accent)]" }),
|
|
1900
|
-
/* @__PURE__ */
|
|
2260
|
+
/* @__PURE__ */ jsxs6("div", { className: "text-left", children: [
|
|
1901
2261
|
/* @__PURE__ */ jsx9("p", { className: "text-sm font-medium", children: "Minimaliste Premium" }),
|
|
1902
2262
|
/* @__PURE__ */ jsx9("p", { className: "text-xs text-[var(--color-text-tertiary)]", children: "\xC9l\xE9gance minimaliste" })
|
|
1903
2263
|
] })
|
|
@@ -1908,12 +2268,12 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "De
|
|
|
1908
2268
|
}
|
|
1909
2269
|
)
|
|
1910
2270
|
] }),
|
|
1911
|
-
/* @__PURE__ */
|
|
2271
|
+
/* @__PURE__ */ jsxs6("div", { className: "flex items-center px-3 py-1.5 bg-[var(--color-surface)] rounded-lg border border-[var(--color-border)]", children: [
|
|
1912
2272
|
/* @__PURE__ */ jsx9(DollarSign, { className: "w-4 h-4 text-[var(--color-primary)] mr-2" }),
|
|
1913
2273
|
/* @__PURE__ */ jsx9("span", { className: "text-sm font-medium text-[var(--color-text-primary)]", children: "FCFA" })
|
|
1914
2274
|
] }),
|
|
1915
|
-
/* @__PURE__ */
|
|
1916
|
-
/* @__PURE__ */
|
|
2275
|
+
/* @__PURE__ */ jsxs6("div", { className: "relative", children: [
|
|
2276
|
+
/* @__PURE__ */ jsxs6(
|
|
1917
2277
|
"button",
|
|
1918
2278
|
{
|
|
1919
2279
|
className: "relative p-2 hover:bg-[var(--color-surface-hover)] rounded-lg transition-colors",
|
|
@@ -1926,7 +2286,7 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "De
|
|
|
1926
2286
|
]
|
|
1927
2287
|
}
|
|
1928
2288
|
),
|
|
1929
|
-
showNotifications && /* @__PURE__ */
|
|
2289
|
+
showNotifications && /* @__PURE__ */ jsxs6(
|
|
1930
2290
|
"div",
|
|
1931
2291
|
{
|
|
1932
2292
|
className: "absolute right-0 mt-2 w-80 bg-[var(--color-background)] rounded-lg shadow-xl border border-[var(--color-border)] z-50 max-h-96 overflow-y-auto",
|
|
@@ -1942,7 +2302,7 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "De
|
|
|
1942
2302
|
!notif.read && "bg-[var(--color-primary-light)] bg-opacity-10"
|
|
1943
2303
|
),
|
|
1944
2304
|
onClick: () => markNotificationAsRead(notif.id),
|
|
1945
|
-
children: /* @__PURE__ */
|
|
2305
|
+
children: /* @__PURE__ */ jsxs6("div", { className: "flex items-start gap-3", children: [
|
|
1946
2306
|
/* @__PURE__ */ jsx9("div", { className: cn(
|
|
1947
2307
|
"w-2 h-2 rounded-full mt-2",
|
|
1948
2308
|
notif.type === "error" && "bg-[var(--color-error)]",
|
|
@@ -1950,7 +2310,7 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "De
|
|
|
1950
2310
|
notif.type === "success" && "bg-[var(--color-success)]",
|
|
1951
2311
|
notif.type === "info" && "bg-[var(--color-info)]"
|
|
1952
2312
|
) }),
|
|
1953
|
-
/* @__PURE__ */
|
|
2313
|
+
/* @__PURE__ */ jsxs6("div", { className: "flex-1", children: [
|
|
1954
2314
|
/* @__PURE__ */ jsx9("p", { className: "text-sm font-medium text-[var(--color-text-primary)]", children: notif.title }),
|
|
1955
2315
|
/* @__PURE__ */ jsx9("p", { className: "text-xs text-[var(--color-text-secondary)] mt-1", children: notif.message }),
|
|
1956
2316
|
/* @__PURE__ */ jsx9("p", { className: "text-xs text-[var(--color-text-tertiary)] mt-2" })
|
|
@@ -1963,7 +2323,7 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "De
|
|
|
1963
2323
|
}
|
|
1964
2324
|
)
|
|
1965
2325
|
] }),
|
|
1966
|
-
/* @__PURE__ */
|
|
2326
|
+
/* @__PURE__ */ jsxs6("div", { className: "relative", children: [
|
|
1967
2327
|
/* @__PURE__ */ jsx9(
|
|
1968
2328
|
"button",
|
|
1969
2329
|
{
|
|
@@ -1980,8 +2340,8 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "De
|
|
|
1980
2340
|
className: "absolute right-0 mt-2 w-56 bg-[var(--color-background)] rounded-lg shadow-xl border border-[var(--color-border)] z-50",
|
|
1981
2341
|
role: "menu",
|
|
1982
2342
|
"aria-label": "Menu utilisateur",
|
|
1983
|
-
children: /* @__PURE__ */
|
|
1984
|
-
/* @__PURE__ */
|
|
2343
|
+
children: /* @__PURE__ */ jsxs6("div", { className: "p-2", children: [
|
|
2344
|
+
/* @__PURE__ */ jsxs6(
|
|
1985
2345
|
"button",
|
|
1986
2346
|
{
|
|
1987
2347
|
className: "w-full flex items-center gap-3 px-3 py-2 rounded-lg hover:bg-[var(--color-surface-hover)] transition-colors",
|
|
@@ -1992,7 +2352,7 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "De
|
|
|
1992
2352
|
]
|
|
1993
2353
|
}
|
|
1994
2354
|
),
|
|
1995
|
-
/* @__PURE__ */
|
|
2355
|
+
/* @__PURE__ */ jsxs6(
|
|
1996
2356
|
"button",
|
|
1997
2357
|
{
|
|
1998
2358
|
onClick: () => {
|
|
@@ -2007,19 +2367,19 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "De
|
|
|
2007
2367
|
]
|
|
2008
2368
|
}
|
|
2009
2369
|
),
|
|
2010
|
-
/* @__PURE__ */
|
|
2370
|
+
/* @__PURE__ */ jsxs6(
|
|
2011
2371
|
"button",
|
|
2012
2372
|
{
|
|
2013
2373
|
className: "w-full flex items-center gap-3 px-3 py-2 rounded-lg hover:bg-[var(--color-surface-hover)] transition-colors",
|
|
2014
2374
|
role: "menuitem",
|
|
2015
2375
|
children: [
|
|
2016
|
-
/* @__PURE__ */ jsx9(
|
|
2376
|
+
/* @__PURE__ */ jsx9(HelpCircle2, { className: "w-4 h-4" }),
|
|
2017
2377
|
/* @__PURE__ */ jsx9("span", { className: "text-sm", children: "Aide" })
|
|
2018
2378
|
]
|
|
2019
2379
|
}
|
|
2020
2380
|
),
|
|
2021
2381
|
/* @__PURE__ */ jsx9("hr", { className: "my-2 border-[var(--color-border)]" }),
|
|
2022
|
-
/* @__PURE__ */
|
|
2382
|
+
/* @__PURE__ */ jsxs6(
|
|
2023
2383
|
"button",
|
|
2024
2384
|
{
|
|
2025
2385
|
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",
|
|
@@ -2048,6 +2408,223 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "De
|
|
|
2048
2408
|
}
|
|
2049
2409
|
)
|
|
2050
2410
|
] }),
|
|
2411
|
+
/* @__PURE__ */ jsx9(
|
|
2412
|
+
Modals_default,
|
|
2413
|
+
{
|
|
2414
|
+
title: "Modules REWISE",
|
|
2415
|
+
description: "Acc\xE9dez rapidement \xE0 tous les modules",
|
|
2416
|
+
width: "max-w-6xl",
|
|
2417
|
+
open: showModulesMenu,
|
|
2418
|
+
onClose: () => setShowModulesMenu(false),
|
|
2419
|
+
children: /* @__PURE__ */ jsxs6("div", { className: "space-y-6", children: [
|
|
2420
|
+
/* @__PURE__ */ jsxs6("div", { className: "flex flex-col lg:flex-row gap-4 lg:items-stretch", children: [
|
|
2421
|
+
/* @__PURE__ */ jsxs6("div", { className: "flex-[3] bg-[#D3E1F2] rounded-lg p-5 relative min-h-[160px]", children: [
|
|
2422
|
+
/* @__PURE__ */ jsx9("h2", { className: "text-lg font-semibold text-gray-800 mb-2 pr-8 line-clamp-2", children: slides[currentSlide].title }),
|
|
2423
|
+
/* @__PURE__ */ jsx9("p", { className: "text-gray-600 text-sm leading-relaxed line-clamp-3", children: slides[currentSlide].content }),
|
|
2424
|
+
/* @__PURE__ */ jsx9(
|
|
2425
|
+
"button",
|
|
2426
|
+
{
|
|
2427
|
+
onClick: prevSlide,
|
|
2428
|
+
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",
|
|
2429
|
+
children: "\u2039"
|
|
2430
|
+
}
|
|
2431
|
+
),
|
|
2432
|
+
/* @__PURE__ */ jsx9(
|
|
2433
|
+
"button",
|
|
2434
|
+
{
|
|
2435
|
+
onClick: nextSlide,
|
|
2436
|
+
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",
|
|
2437
|
+
children: "\u203A"
|
|
2438
|
+
}
|
|
2439
|
+
),
|
|
2440
|
+
/* @__PURE__ */ jsx9("div", { className: "absolute bottom-3 left-1/2 transform -translate-x-1/2 flex space-x-2", children: slides.map((_, index) => /* @__PURE__ */ jsx9(
|
|
2441
|
+
"button",
|
|
2442
|
+
{
|
|
2443
|
+
onClick: () => goToSlide(index),
|
|
2444
|
+
className: `w-2 h-2 rounded-full transition-colors ${index === currentSlide ? "bg-red-600" : "bg-white"}`
|
|
2445
|
+
},
|
|
2446
|
+
index
|
|
2447
|
+
)) })
|
|
2448
|
+
] }),
|
|
2449
|
+
/* @__PURE__ */ jsxs6("div", { className: "flex-[1] bg-white border border-gray-200 rounded-lg overflow-hidden flex flex-col", children: [
|
|
2450
|
+
/* @__PURE__ */ jsx9("div", { className: "bg-red-600 text-white px-4 py-2 flex-shrink-0", children: /* @__PURE__ */ jsx9("h3", { className: "font-semibold text-sm text-center", children: "Mes alertes" }) }),
|
|
2451
|
+
/* @__PURE__ */ jsx9("div", { className: "p-3 space-y-2 flex-1 overflow-y-auto", children: notifications.filter((n) => !n.read).length === 0 ? /* @__PURE__ */ jsx9("div", { className: "h-full flex items-center justify-center", children: /* @__PURE__ */ jsx9("p", { className: "text-center text-gray-500 text-xs", children: "Aucune alerte" }) }) : notifications.filter((n) => !n.read).slice(0, 5).map((notif) => /* @__PURE__ */ jsx9(
|
|
2452
|
+
"div",
|
|
2453
|
+
{
|
|
2454
|
+
className: "bg-gray-50 border border-gray-200 rounded p-2 cursor-pointer hover:bg-gray-100",
|
|
2455
|
+
onClick: () => markNotificationAsRead(notif.id),
|
|
2456
|
+
children: /* @__PURE__ */ jsxs6("div", { className: "flex items-start space-x-2", children: [
|
|
2457
|
+
/* @__PURE__ */ jsx9(Bell, { className: "w-3 h-3 text-gray-500 mt-0.5 flex-shrink-0" }),
|
|
2458
|
+
/* @__PURE__ */ jsxs6("div", { className: "flex-1 min-w-0", children: [
|
|
2459
|
+
/* @__PURE__ */ jsx9("h4", { className: "font-medium text-xs text-gray-800 truncate", children: notif.title }),
|
|
2460
|
+
/* @__PURE__ */ jsx9("p", { className: "text-xs text-gray-600 line-clamp-1", children: notif.message })
|
|
2461
|
+
] })
|
|
2462
|
+
] })
|
|
2463
|
+
},
|
|
2464
|
+
notif.id
|
|
2465
|
+
)) })
|
|
2466
|
+
] })
|
|
2467
|
+
] }),
|
|
2468
|
+
/* @__PURE__ */ jsxs6("div", { className: "flex flex-col lg:flex-row gap-6", children: [
|
|
2469
|
+
/* @__PURE__ */ jsxs6("div", { className: "flex-1 bg-white border border-gray-200 rounded-lg p-4 shadow-sm", children: [
|
|
2470
|
+
/* @__PURE__ */ jsx9("h3", { className: "text-lg font-semibold text-gray-800 mb-4", children: "Op\xE9rations" }),
|
|
2471
|
+
/* @__PURE__ */ jsx9("div", { className: "grid grid-cols-2 md:grid-cols-4 gap-3", children: [
|
|
2472
|
+
{ name: "WiseConnect", icon: crm_blue_default, iconWhite: crmwhite_default, url: moduleUrls.wiseConnect },
|
|
2473
|
+
{ name: "WiseReach", icon: marketingblue_default, iconWhite: marketingblanc_default, url: moduleUrls.wiseReach },
|
|
2474
|
+
{ name: "WiseOps", icon: facilityblue_default, iconWhite: facilityblanc_default, url: moduleUrls.wiseOps },
|
|
2475
|
+
{ name: "WiseGuard", icon: security_managementblue_default, iconWhite: security_managementblanc_default, url: moduleUrls.wiseGuard }
|
|
2476
|
+
].map((module) => /* @__PURE__ */ jsx9(
|
|
2477
|
+
"button",
|
|
2478
|
+
{
|
|
2479
|
+
onClick: () => {
|
|
2480
|
+
window.open(module.url, "_blank", "noopener,noreferrer");
|
|
2481
|
+
setShowModulesMenu(false);
|
|
2482
|
+
},
|
|
2483
|
+
className: "group p-4 rounded-lg bg-gray-100 hover:bg-[#4A5568] transition-all duration-200 text-center",
|
|
2484
|
+
children: /* @__PURE__ */ jsxs6("div", { className: "flex flex-col items-center", children: [
|
|
2485
|
+
/* @__PURE__ */ jsx9(
|
|
2486
|
+
"img",
|
|
2487
|
+
{
|
|
2488
|
+
src: module.icon,
|
|
2489
|
+
alt: module.name,
|
|
2490
|
+
className: "w-12 h-12 mb-2 group-hover:hidden"
|
|
2491
|
+
}
|
|
2492
|
+
),
|
|
2493
|
+
/* @__PURE__ */ jsx9(
|
|
2494
|
+
"img",
|
|
2495
|
+
{
|
|
2496
|
+
src: module.iconWhite,
|
|
2497
|
+
alt: module.name,
|
|
2498
|
+
className: "w-12 h-12 mb-2 hidden group-hover:block"
|
|
2499
|
+
}
|
|
2500
|
+
),
|
|
2501
|
+
/* @__PURE__ */ jsx9("span", { className: "text-sm font-medium text-gray-800 group-hover:text-white", children: module.name })
|
|
2502
|
+
] })
|
|
2503
|
+
},
|
|
2504
|
+
module.name
|
|
2505
|
+
)) })
|
|
2506
|
+
] }),
|
|
2507
|
+
/* @__PURE__ */ jsxs6("div", { className: "flex-1 bg-white border border-gray-200 rounded-lg p-4 shadow-sm", children: [
|
|
2508
|
+
/* @__PURE__ */ jsx9("h3", { className: "text-lg font-semibold text-gray-800 mb-4", children: "Performance" }),
|
|
2509
|
+
/* @__PURE__ */ jsx9("div", { className: "grid grid-cols-2 md:grid-cols-3 gap-3", children: [
|
|
2510
|
+
{ name: "WiseThrive", icon: thriveblue_default, iconWhite: thriveblanc_default, url: moduleUrls.wiseThrive },
|
|
2511
|
+
{ name: "WiseView", icon: wiseblues_default, iconWhite: wiseblancs_default, url: moduleUrls.wiseView },
|
|
2512
|
+
{ name: "WiseProcess", icon: sopblues_default, iconWhite: sopblancs_default, url: moduleUrls.wiseProcess }
|
|
2513
|
+
].map((module) => /* @__PURE__ */ jsx9(
|
|
2514
|
+
"button",
|
|
2515
|
+
{
|
|
2516
|
+
onClick: () => {
|
|
2517
|
+
window.open(module.url, "_blank", "noopener,noreferrer");
|
|
2518
|
+
setShowModulesMenu(false);
|
|
2519
|
+
},
|
|
2520
|
+
className: "group p-4 rounded-lg bg-gray-100 hover:bg-[#4A5568] transition-all duration-200 text-center",
|
|
2521
|
+
children: /* @__PURE__ */ jsxs6("div", { className: "flex flex-col items-center", children: [
|
|
2522
|
+
/* @__PURE__ */ jsx9(
|
|
2523
|
+
"img",
|
|
2524
|
+
{
|
|
2525
|
+
src: module.icon,
|
|
2526
|
+
alt: module.name,
|
|
2527
|
+
className: "w-12 h-12 mb-2 group-hover:hidden"
|
|
2528
|
+
}
|
|
2529
|
+
),
|
|
2530
|
+
/* @__PURE__ */ jsx9(
|
|
2531
|
+
"img",
|
|
2532
|
+
{
|
|
2533
|
+
src: module.iconWhite,
|
|
2534
|
+
alt: module.name,
|
|
2535
|
+
className: "w-12 h-12 mb-2 hidden group-hover:block"
|
|
2536
|
+
}
|
|
2537
|
+
),
|
|
2538
|
+
/* @__PURE__ */ jsx9("span", { className: "text-sm font-medium text-gray-800 group-hover:text-white", children: module.name })
|
|
2539
|
+
] })
|
|
2540
|
+
},
|
|
2541
|
+
module.name
|
|
2542
|
+
)) })
|
|
2543
|
+
] })
|
|
2544
|
+
] }),
|
|
2545
|
+
/* @__PURE__ */ jsxs6("div", { className: "bg-white border border-gray-200 rounded-lg p-4 shadow-sm", children: [
|
|
2546
|
+
/* @__PURE__ */ jsx9("h3", { className: "text-lg font-semibold text-gray-800 mb-4", children: "Fonctions Support" }),
|
|
2547
|
+
/* @__PURE__ */ jsxs6("div", { className: "flex flex-col lg:flex-row gap-4", children: [
|
|
2548
|
+
/* @__PURE__ */ jsx9("div", { className: "flex-[5] bg-gray-50 rounded-lg p-4", children: /* @__PURE__ */ jsx9("div", { className: "grid grid-cols-2 md:grid-cols-5 gap-3", children: [
|
|
2549
|
+
{ name: "WiseBill", icon: invoicingblue_default, iconWhite: invoicingblanc_default, url: moduleUrls.wiseBill },
|
|
2550
|
+
{ name: "WiseBooks", icon: accountingblue_default, iconWhite: accountingblanc_default, url: moduleUrls.wiseBooks },
|
|
2551
|
+
{ name: "WiseAsset", icon: assetblue_default, iconWhite: assetblanc_default, url: moduleUrls.wiseAsset },
|
|
2552
|
+
{ name: "WiseCash", icon: financeblue_default, iconWhite: financeblanc_default, url: moduleUrls.wiseCash },
|
|
2553
|
+
{ name: "WiseCollect", icon: collection_litigationblue_default, iconWhite: collection_litigationblanc_default, url: moduleUrls.wiseCollect }
|
|
2554
|
+
].map((module) => /* @__PURE__ */ jsx9(
|
|
2555
|
+
"button",
|
|
2556
|
+
{
|
|
2557
|
+
onClick: () => {
|
|
2558
|
+
if (module.url !== "#") {
|
|
2559
|
+
window.open(module.url, "_blank", "noopener,noreferrer");
|
|
2560
|
+
}
|
|
2561
|
+
setShowModulesMenu(false);
|
|
2562
|
+
},
|
|
2563
|
+
className: cn(
|
|
2564
|
+
"group p-4 rounded-lg bg-gray-100 hover:bg-[#4A5568] transition-all duration-200 text-center",
|
|
2565
|
+
module.url === "#" && "opacity-50 cursor-not-allowed hover:bg-gray-100"
|
|
2566
|
+
),
|
|
2567
|
+
disabled: module.url === "#",
|
|
2568
|
+
children: /* @__PURE__ */ jsxs6("div", { className: "flex flex-col items-center", children: [
|
|
2569
|
+
/* @__PURE__ */ jsx9(
|
|
2570
|
+
"img",
|
|
2571
|
+
{
|
|
2572
|
+
src: module.icon,
|
|
2573
|
+
alt: module.name,
|
|
2574
|
+
className: cn("w-12 h-12 mb-2", module.url !== "#" && "group-hover:hidden")
|
|
2575
|
+
}
|
|
2576
|
+
),
|
|
2577
|
+
module.url !== "#" && /* @__PURE__ */ jsx9(
|
|
2578
|
+
"img",
|
|
2579
|
+
{
|
|
2580
|
+
src: module.iconWhite,
|
|
2581
|
+
alt: module.name,
|
|
2582
|
+
className: "w-12 h-12 mb-2 hidden group-hover:block"
|
|
2583
|
+
}
|
|
2584
|
+
),
|
|
2585
|
+
/* @__PURE__ */ jsx9("span", { className: cn("text-sm font-medium text-gray-800", module.url !== "#" && "group-hover:text-white"), children: module.name })
|
|
2586
|
+
] })
|
|
2587
|
+
},
|
|
2588
|
+
module.name
|
|
2589
|
+
)) }) }),
|
|
2590
|
+
/* @__PURE__ */ jsx9("div", { className: "flex-[2] bg-gray-50 rounded-lg p-4", children: /* @__PURE__ */ jsx9("div", { className: "grid grid-cols-2 gap-3", children: [
|
|
2591
|
+
{ name: "WiseProcure", icon: procurementblue_default, iconWhite: procurementblanc_default, url: moduleUrls.wiseProcure },
|
|
2592
|
+
{ name: "WiseHR", icon: human_capitalblue_default, iconWhite: human_capitalblanc_default, url: moduleUrls.wiseHR }
|
|
2593
|
+
].map((module) => /* @__PURE__ */ jsx9(
|
|
2594
|
+
"button",
|
|
2595
|
+
{
|
|
2596
|
+
onClick: () => {
|
|
2597
|
+
window.open(module.url, "_blank", "noopener,noreferrer");
|
|
2598
|
+
setShowModulesMenu(false);
|
|
2599
|
+
},
|
|
2600
|
+
className: "group p-4 rounded-lg bg-gray-100 hover:bg-[#4A5568] transition-all duration-200 text-center",
|
|
2601
|
+
children: /* @__PURE__ */ jsxs6("div", { className: "flex flex-col items-center", children: [
|
|
2602
|
+
/* @__PURE__ */ jsx9(
|
|
2603
|
+
"img",
|
|
2604
|
+
{
|
|
2605
|
+
src: module.icon,
|
|
2606
|
+
alt: module.name,
|
|
2607
|
+
className: "w-12 h-12 mb-2 group-hover:hidden"
|
|
2608
|
+
}
|
|
2609
|
+
),
|
|
2610
|
+
/* @__PURE__ */ jsx9(
|
|
2611
|
+
"img",
|
|
2612
|
+
{
|
|
2613
|
+
src: module.iconWhite,
|
|
2614
|
+
alt: module.name,
|
|
2615
|
+
className: "w-12 h-12 mb-2 hidden group-hover:block"
|
|
2616
|
+
}
|
|
2617
|
+
),
|
|
2618
|
+
/* @__PURE__ */ jsx9("span", { className: "text-sm font-medium text-gray-800 group-hover:text-white", children: module.name })
|
|
2619
|
+
] })
|
|
2620
|
+
},
|
|
2621
|
+
module.name
|
|
2622
|
+
)) }) })
|
|
2623
|
+
] })
|
|
2624
|
+
] })
|
|
2625
|
+
] })
|
|
2626
|
+
}
|
|
2627
|
+
),
|
|
2051
2628
|
showApprovalModal && /* @__PURE__ */ jsx9(
|
|
2052
2629
|
Modals_default,
|
|
2053
2630
|
{
|
|
@@ -2071,8 +2648,8 @@ var ModernDoubleSidebarLayout_default = RewiseLayout;
|
|
|
2071
2648
|
|
|
2072
2649
|
// src/components/ui/Toast.tsx
|
|
2073
2650
|
import { useEffect as useEffect5, useState as useState6 } from "react";
|
|
2074
|
-
import { CheckCircle as CheckCircle2, XCircle as XCircle2, AlertTriangle, Info, X as
|
|
2075
|
-
import { jsx as jsx10, jsxs as
|
|
2651
|
+
import { CheckCircle as CheckCircle2, XCircle as XCircle2, AlertTriangle as AlertTriangle2, Info as Info2, X as X4 } from "lucide-react";
|
|
2652
|
+
import { jsx as jsx10, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
2076
2653
|
var ToastItem = ({ toast }) => {
|
|
2077
2654
|
const { removeToast } = useToast();
|
|
2078
2655
|
const [isVisible, setIsVisible] = useState6(false);
|
|
@@ -2094,9 +2671,9 @@ var ToastItem = ({ toast }) => {
|
|
|
2094
2671
|
case "error":
|
|
2095
2672
|
return /* @__PURE__ */ jsx10(XCircle2, { className: "w-5 h-5 text-red-600" });
|
|
2096
2673
|
case "warning":
|
|
2097
|
-
return /* @__PURE__ */ jsx10(
|
|
2674
|
+
return /* @__PURE__ */ jsx10(AlertTriangle2, { className: "w-5 h-5 text-yellow-600" });
|
|
2098
2675
|
case "info":
|
|
2099
|
-
return /* @__PURE__ */ jsx10(
|
|
2676
|
+
return /* @__PURE__ */ jsx10(Info2, { className: "w-5 h-5 text-blue-600" });
|
|
2100
2677
|
}
|
|
2101
2678
|
};
|
|
2102
2679
|
const getBackgroundColor = () => {
|
|
@@ -2111,7 +2688,7 @@ var ToastItem = ({ toast }) => {
|
|
|
2111
2688
|
return "bg-blue-50 border-blue-200";
|
|
2112
2689
|
}
|
|
2113
2690
|
};
|
|
2114
|
-
return /* @__PURE__ */
|
|
2691
|
+
return /* @__PURE__ */ jsxs7(
|
|
2115
2692
|
"div",
|
|
2116
2693
|
{
|
|
2117
2694
|
className: `
|
|
@@ -2129,7 +2706,7 @@ var ToastItem = ({ toast }) => {
|
|
|
2129
2706
|
{
|
|
2130
2707
|
onClick: handleClose,
|
|
2131
2708
|
className: "flex-shrink-0 ml-4 text-gray-400 hover:text-gray-600 transition-colors",
|
|
2132
|
-
children: /* @__PURE__ */ jsx10(
|
|
2709
|
+
children: /* @__PURE__ */ jsx10(X4, { className: "w-4 h-4" })
|
|
2133
2710
|
}
|
|
2134
2711
|
)
|
|
2135
2712
|
]
|
|
@@ -2145,7 +2722,7 @@ var Toast_default = ToastContainer;
|
|
|
2145
2722
|
// src/components/common/Pages.tsx
|
|
2146
2723
|
import { ChevronLeft as ChevronLeft2, Download, Menu as Menu2, Settings as Settings2 } from "lucide-react";
|
|
2147
2724
|
import { useState as useState7 } from "react";
|
|
2148
|
-
import { Fragment as Fragment3, jsx as jsx11, jsxs as
|
|
2725
|
+
import { Fragment as Fragment3, jsx as jsx11, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
2149
2726
|
var Pages = ({
|
|
2150
2727
|
title = "",
|
|
2151
2728
|
description = "",
|
|
@@ -2155,11 +2732,11 @@ var Pages = ({
|
|
|
2155
2732
|
children
|
|
2156
2733
|
}) => {
|
|
2157
2734
|
const [sidebarOpen, setSidebarOpen] = useState7(false);
|
|
2158
|
-
return /* @__PURE__ */
|
|
2159
|
-
/* @__PURE__ */
|
|
2160
|
-
/* @__PURE__ */
|
|
2161
|
-
/* @__PURE__ */
|
|
2162
|
-
/* @__PURE__ */ jsx11("div", { className: "flex items-center space-x-4", children: /* @__PURE__ */
|
|
2735
|
+
return /* @__PURE__ */ jsxs8("div", { className: "flex h-full bg-gray-100", children: [
|
|
2736
|
+
/* @__PURE__ */ jsxs8("div", { className: "flex-1 flex flex-col", children: [
|
|
2737
|
+
/* @__PURE__ */ jsxs8("div", { className: "bg-white border-b border-gray-200 p-6", children: [
|
|
2738
|
+
/* @__PURE__ */ jsxs8("div", { className: "flex items-center justify-between", children: [
|
|
2739
|
+
/* @__PURE__ */ jsx11("div", { className: "flex items-center space-x-4", children: /* @__PURE__ */ jsxs8("div", { children: [
|
|
2163
2740
|
/* @__PURE__ */ jsx11("h1", { className: "text-2xl font-bold text-gray-900", children: title }),
|
|
2164
2741
|
/* @__PURE__ */ jsx11("p", { className: "text-sm text-gray-600", children: description })
|
|
2165
2742
|
] }) }),
|
|
@@ -2169,8 +2746,8 @@ var Pages = ({
|
|
|
2169
2746
|
] }),
|
|
2170
2747
|
/* @__PURE__ */ jsx11("div", { className: "flex-1 p-6 space-y-6 min-h-[80vh]", children })
|
|
2171
2748
|
] }),
|
|
2172
|
-
sidebar && /* @__PURE__ */
|
|
2173
|
-
/* @__PURE__ */ jsx11("div", { className: "p-4 ", children: /* @__PURE__ */
|
|
2749
|
+
sidebar && /* @__PURE__ */ jsxs8("div", { className: `${sidebarOpen ? "w-80" : "w-16"} bg-[var(--color-surface)] border-r border-[var(--color-border)] transition-all duration-300 flex flex-col`, children: [
|
|
2750
|
+
/* @__PURE__ */ jsx11("div", { className: "p-4 ", children: /* @__PURE__ */ jsxs8("div", { className: "flex items-center justify-between", children: [
|
|
2174
2751
|
/* @__PURE__ */ jsx11("h2", { className: `font-semibold text-[var(--color-text-primary)] ${!sidebarOpen && "hidden"}`, children: "Classes SYSCOHADA" }),
|
|
2175
2752
|
/* @__PURE__ */ jsx11(
|
|
2176
2753
|
"button",
|
|
@@ -2197,12 +2774,12 @@ var Pages = ({
|
|
|
2197
2774
|
)
|
|
2198
2775
|
}
|
|
2199
2776
|
) }),
|
|
2200
|
-
sidebarOpen && /* @__PURE__ */ jsx11("div", { className: "p-4 border-t border-[var(--color-border)]", children: /* @__PURE__ */
|
|
2201
|
-
/* @__PURE__ */
|
|
2777
|
+
sidebarOpen && /* @__PURE__ */ jsx11("div", { className: "p-4 border-t border-[var(--color-border)]", children: /* @__PURE__ */ jsxs8("div", { className: "space-y-2", children: [
|
|
2778
|
+
/* @__PURE__ */ jsxs8("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: [
|
|
2202
2779
|
/* @__PURE__ */ jsx11(Download, { className: "w-4 h-4" }),
|
|
2203
2780
|
"Exporter le plan"
|
|
2204
2781
|
] }),
|
|
2205
|
-
/* @__PURE__ */
|
|
2782
|
+
/* @__PURE__ */ jsxs8("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: [
|
|
2206
2783
|
/* @__PURE__ */ jsx11(Settings2, { className: "w-4 h-4" }),
|
|
2207
2784
|
"Configuration"
|
|
2208
2785
|
] })
|
|
@@ -2213,17 +2790,361 @@ var Pages = ({
|
|
|
2213
2790
|
var Pages_default = Pages;
|
|
2214
2791
|
|
|
2215
2792
|
// src/components/common/FDrawer.tsx
|
|
2216
|
-
import { useEffect as useEffect6, useState as useState8 } from "react";
|
|
2793
|
+
import React7, { useEffect as useEffect6, useState as useState8, useRef } from "react";
|
|
2217
2794
|
import { useLocation as useLocation2, useNavigate as useNavigate2, useSearchParams as useSearchParams2, Link as Link2 } from "react-router-dom";
|
|
2218
|
-
import { ArrowDownAZ, ArrowDownUp, ArrowUpAZ, Download as Download2, Filter, MoreVertical, Printer, Search as Search2 } from "lucide-react";
|
|
2219
|
-
import { Fragment as Fragment4, jsx as jsx12, jsxs as
|
|
2795
|
+
import { ArrowDownAZ, ArrowDownUp, ArrowUpAZ, AlertCircle as AlertCircle3, CheckCircle2 as CheckCircle22, ChevronDown, Columns3, Copy, Download as Download2, FileSpreadsheet, Filter, Maximize2, Minimize2, MoreVertical, Plus, Printer, RefreshCw, Settings2 as Settings22, Trash2, Upload, X as X5, Search as Search2, SquareIcon } from "lucide-react";
|
|
2796
|
+
import { Fragment as Fragment4, jsx as jsx12, jsxs as jsxs9 } from "react/jsx-runtime";
|
|
2797
|
+
var ExcelImportModal = ({
|
|
2798
|
+
isOpen,
|
|
2799
|
+
onClose,
|
|
2800
|
+
importEndpoint,
|
|
2801
|
+
importFields,
|
|
2802
|
+
onSuccess
|
|
2803
|
+
}) => {
|
|
2804
|
+
const { activeBusinessEntity, token } = useSession();
|
|
2805
|
+
const fileInputRef = useRef(null);
|
|
2806
|
+
const [file, setFile] = useState8(null);
|
|
2807
|
+
const [columnMapping, setColumnMapping] = useState8([]);
|
|
2808
|
+
const [loading, setLoading] = useState8(false);
|
|
2809
|
+
const [errors, setErrors] = useState8([]);
|
|
2810
|
+
const [importResults, setImportResults] = useState8(null);
|
|
2811
|
+
const [currentStep, setCurrentStep] = useState8(1);
|
|
2812
|
+
const allFields = [...importFields.required, ...importFields.optional];
|
|
2813
|
+
const handleFileChange = (event) => {
|
|
2814
|
+
const selectedFile = event.target.files?.[0];
|
|
2815
|
+
if (selectedFile) {
|
|
2816
|
+
if (!selectedFile.name.match(/\.(xlsx|xls)$/)) {
|
|
2817
|
+
setErrors(["Veuillez s\xE9lectionner un fichier Excel (.xlsx ou .xls)"]);
|
|
2818
|
+
return;
|
|
2819
|
+
}
|
|
2820
|
+
setFile(selectedFile);
|
|
2821
|
+
setErrors([]);
|
|
2822
|
+
setImportResults(null);
|
|
2823
|
+
setColumnMapping([]);
|
|
2824
|
+
setCurrentStep(2);
|
|
2825
|
+
}
|
|
2826
|
+
};
|
|
2827
|
+
const addMappingRow = () => {
|
|
2828
|
+
const newLetter = String.fromCharCode(65 + columnMapping.length);
|
|
2829
|
+
setColumnMapping([...columnMapping, { letter: newLetter, field: "" }]);
|
|
2830
|
+
};
|
|
2831
|
+
const removeMappingRow = (index) => {
|
|
2832
|
+
setColumnMapping(columnMapping.filter((_, i) => i !== index));
|
|
2833
|
+
};
|
|
2834
|
+
const updateMappingLetter = (index, letter) => {
|
|
2835
|
+
const newMapping = [...columnMapping];
|
|
2836
|
+
newMapping[index].letter = letter.toUpperCase();
|
|
2837
|
+
setColumnMapping(newMapping);
|
|
2838
|
+
};
|
|
2839
|
+
const updateMappingField = (index, field) => {
|
|
2840
|
+
const newMapping = [...columnMapping];
|
|
2841
|
+
newMapping[index].field = field;
|
|
2842
|
+
setColumnMapping(newMapping);
|
|
2843
|
+
};
|
|
2844
|
+
const validateMapping = () => {
|
|
2845
|
+
const mappedFields = columnMapping.map((m) => m.field).filter((f) => f);
|
|
2846
|
+
const requiredFields = importFields.required.map((f) => f.value);
|
|
2847
|
+
const missingRequired = requiredFields.filter((field) => !mappedFields.includes(field));
|
|
2848
|
+
if (missingRequired.length > 0) {
|
|
2849
|
+
const missingLabels = missingRequired.map(
|
|
2850
|
+
(field) => allFields.find((f) => f.value === field)?.label || field
|
|
2851
|
+
);
|
|
2852
|
+
setErrors([`Champs obligatoires manquants : ${missingLabels.join(", ")}`]);
|
|
2853
|
+
return false;
|
|
2854
|
+
}
|
|
2855
|
+
const duplicates = mappedFields.filter(
|
|
2856
|
+
(field, index) => mappedFields.indexOf(field) !== index && field !== ""
|
|
2857
|
+
);
|
|
2858
|
+
if (duplicates.length > 0) {
|
|
2859
|
+
const duplicateLabels = [...new Set(duplicates)].map(
|
|
2860
|
+
(field) => allFields.find((f) => f.value === field)?.label || field
|
|
2861
|
+
);
|
|
2862
|
+
setErrors([`Champs en double : ${duplicateLabels.join(", ")}`]);
|
|
2863
|
+
return false;
|
|
2864
|
+
}
|
|
2865
|
+
setErrors([]);
|
|
2866
|
+
return true;
|
|
2867
|
+
};
|
|
2868
|
+
const executeImport = async () => {
|
|
2869
|
+
if (!validateMapping()) return;
|
|
2870
|
+
if (!file) return;
|
|
2871
|
+
setLoading(true);
|
|
2872
|
+
try {
|
|
2873
|
+
const formData = new FormData();
|
|
2874
|
+
formData.append("excel_file", file);
|
|
2875
|
+
const mapping = {};
|
|
2876
|
+
columnMapping.forEach(({ letter, field }) => {
|
|
2877
|
+
if (field) {
|
|
2878
|
+
mapping[letter] = field;
|
|
2879
|
+
}
|
|
2880
|
+
});
|
|
2881
|
+
formData.append("column_mapping", JSON.stringify(mapping));
|
|
2882
|
+
const response = await fetch(`${API_URL}${importEndpoint}?business_entity_id=${activeBusinessEntity?.id}`, {
|
|
2883
|
+
method: "POST",
|
|
2884
|
+
headers: {
|
|
2885
|
+
"Authorization": `token ${token}`
|
|
2886
|
+
},
|
|
2887
|
+
body: formData
|
|
2888
|
+
});
|
|
2889
|
+
const result = await response.json();
|
|
2890
|
+
if (result.success) {
|
|
2891
|
+
setImportResults(result);
|
|
2892
|
+
setCurrentStep(3);
|
|
2893
|
+
} else {
|
|
2894
|
+
setErrors([result.message?.default || "Erreur lors de l'importation"]);
|
|
2895
|
+
if (result.errors) {
|
|
2896
|
+
const errorMessages = Object.values(result.errors).flat();
|
|
2897
|
+
setErrors((prev) => [...prev, ...errorMessages]);
|
|
2898
|
+
}
|
|
2899
|
+
}
|
|
2900
|
+
} catch (error) {
|
|
2901
|
+
console.error("Erreur:", error);
|
|
2902
|
+
setErrors(["Une erreur est survenue lors de l'importation"]);
|
|
2903
|
+
} finally {
|
|
2904
|
+
setLoading(false);
|
|
2905
|
+
}
|
|
2906
|
+
};
|
|
2907
|
+
const resetModal = () => {
|
|
2908
|
+
setFile(null);
|
|
2909
|
+
setColumnMapping([]);
|
|
2910
|
+
setErrors([]);
|
|
2911
|
+
setImportResults(null);
|
|
2912
|
+
setCurrentStep(1);
|
|
2913
|
+
if (fileInputRef.current) {
|
|
2914
|
+
fileInputRef.current.value = "";
|
|
2915
|
+
}
|
|
2916
|
+
};
|
|
2917
|
+
const handleClose = () => {
|
|
2918
|
+
resetModal();
|
|
2919
|
+
onClose();
|
|
2920
|
+
};
|
|
2921
|
+
const handleSuccess = () => {
|
|
2922
|
+
if (onSuccess) onSuccess();
|
|
2923
|
+
handleClose();
|
|
2924
|
+
};
|
|
2925
|
+
if (!isOpen) return null;
|
|
2926
|
+
return /* @__PURE__ */ jsxs9("div", { className: "fixed inset-0 z-50 flex items-center justify-center", children: [
|
|
2927
|
+
/* @__PURE__ */ jsx12("div", { className: "absolute inset-0 bg-black/50", onClick: handleClose }),
|
|
2928
|
+
/* @__PURE__ */ jsxs9("div", { className: "relative bg-white rounded-xl shadow-2xl w-full max-w-2xl max-h-[90vh] overflow-hidden", children: [
|
|
2929
|
+
/* @__PURE__ */ jsxs9("div", { className: "flex items-center justify-between p-4 border-b border-gray-200", children: [
|
|
2930
|
+
/* @__PURE__ */ jsxs9("div", { className: "flex items-center gap-3", children: [
|
|
2931
|
+
/* @__PURE__ */ jsx12(FileSpreadsheet, { className: "h-6 w-6 text-green-600" }),
|
|
2932
|
+
/* @__PURE__ */ jsx12("h2", { className: "text-lg font-semibold text-gray-800", children: "Importation Excel" }),
|
|
2933
|
+
/* @__PURE__ */ jsxs9("span", { className: "text-sm text-gray-500", children: [
|
|
2934
|
+
"\xC9tape ",
|
|
2935
|
+
currentStep,
|
|
2936
|
+
"/3"
|
|
2937
|
+
] })
|
|
2938
|
+
] }),
|
|
2939
|
+
/* @__PURE__ */ jsx12("button", { type: "button", onClick: handleClose, className: "p-1 hover:bg-gray-100 rounded-lg", children: /* @__PURE__ */ jsx12(X5, { className: "h-5 w-5 text-gray-500" }) })
|
|
2940
|
+
] }),
|
|
2941
|
+
/* @__PURE__ */ jsx12("div", { className: "flex justify-center py-4 border-b border-gray-100", children: /* @__PURE__ */ jsx12("div", { className: "flex items-center gap-2", children: [1, 2, 3].map((step, index) => /* @__PURE__ */ jsxs9(React7.Fragment, { children: [
|
|
2942
|
+
/* @__PURE__ */ jsx12("div", { className: cn(
|
|
2943
|
+
"w-8 h-8 rounded-full flex items-center justify-center text-sm font-medium transition-colors",
|
|
2944
|
+
currentStep >= step ? "bg-[var(--color-primary)] text-white" : "bg-gray-200 text-gray-500"
|
|
2945
|
+
), children: currentStep > step ? /* @__PURE__ */ jsx12(CheckCircle22, { className: "h-5 w-5" }) : step }),
|
|
2946
|
+
index < 2 && /* @__PURE__ */ jsx12("div", { className: cn(
|
|
2947
|
+
"w-12 h-1 rounded",
|
|
2948
|
+
currentStep > step ? "bg-[var(--color-primary)]" : "bg-gray-200"
|
|
2949
|
+
) })
|
|
2950
|
+
] }, step)) }) }),
|
|
2951
|
+
/* @__PURE__ */ jsxs9("div", { className: "p-6 overflow-y-auto max-h-[60vh]", children: [
|
|
2952
|
+
errors.length > 0 && /* @__PURE__ */ jsx12("div", { className: "mb-4 p-4 bg-red-50 border border-red-200 rounded-lg", children: /* @__PURE__ */ jsxs9("div", { className: "flex items-start gap-2", children: [
|
|
2953
|
+
/* @__PURE__ */ jsx12(AlertCircle3, { className: "h-5 w-5 text-red-500 mt-0.5" }),
|
|
2954
|
+
/* @__PURE__ */ jsx12("div", { children: errors.map((error, index) => /* @__PURE__ */ jsx12("p", { className: "text-sm text-red-700", children: error }, index)) })
|
|
2955
|
+
] }) }),
|
|
2956
|
+
currentStep === 1 && /* @__PURE__ */ jsxs9("div", { className: "text-center py-8", children: [
|
|
2957
|
+
/* @__PURE__ */ jsx12(FileSpreadsheet, { className: "h-16 w-16 text-green-500 mx-auto mb-4" }),
|
|
2958
|
+
/* @__PURE__ */ jsx12("h3", { className: "text-lg font-medium text-gray-800 mb-2", children: "S\xE9lectionner un fichier Excel" }),
|
|
2959
|
+
/* @__PURE__ */ jsx12("p", { className: "text-sm text-gray-500 mb-6", children: "Formats accept\xE9s : .xlsx, .xls" }),
|
|
2960
|
+
/* @__PURE__ */ jsx12(
|
|
2961
|
+
"input",
|
|
2962
|
+
{
|
|
2963
|
+
ref: fileInputRef,
|
|
2964
|
+
type: "file",
|
|
2965
|
+
accept: ".xlsx,.xls",
|
|
2966
|
+
onChange: handleFileChange,
|
|
2967
|
+
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"
|
|
2968
|
+
}
|
|
2969
|
+
),
|
|
2970
|
+
file && /* @__PURE__ */ jsxs9("div", { className: "mt-4 p-3 bg-blue-50 rounded-lg text-left", children: [
|
|
2971
|
+
/* @__PURE__ */ jsxs9("p", { className: "text-sm text-blue-800", children: [
|
|
2972
|
+
/* @__PURE__ */ jsx12("strong", { children: "Fichier s\xE9lectionn\xE9 :" }),
|
|
2973
|
+
" ",
|
|
2974
|
+
file.name
|
|
2975
|
+
] }),
|
|
2976
|
+
/* @__PURE__ */ jsxs9("p", { className: "text-xs text-blue-600", children: [
|
|
2977
|
+
"Taille : ",
|
|
2978
|
+
(file.size / 1024 / 1024).toFixed(2),
|
|
2979
|
+
" MB"
|
|
2980
|
+
] })
|
|
2981
|
+
] })
|
|
2982
|
+
] }),
|
|
2983
|
+
currentStep === 2 && /* @__PURE__ */ jsxs9("div", { children: [
|
|
2984
|
+
/* @__PURE__ */ jsxs9("div", { className: "flex items-center justify-between mb-4", children: [
|
|
2985
|
+
/* @__PURE__ */ jsx12("h3", { className: "text-lg font-medium text-gray-800", children: "Configuration du mapping" }),
|
|
2986
|
+
/* @__PURE__ */ jsxs9(
|
|
2987
|
+
"button",
|
|
2988
|
+
{
|
|
2989
|
+
type: "button",
|
|
2990
|
+
onClick: addMappingRow,
|
|
2991
|
+
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)]",
|
|
2992
|
+
children: [
|
|
2993
|
+
/* @__PURE__ */ jsx12(Plus, { className: "h-4 w-4" }),
|
|
2994
|
+
" Ajouter"
|
|
2995
|
+
]
|
|
2996
|
+
}
|
|
2997
|
+
)
|
|
2998
|
+
] }),
|
|
2999
|
+
/* @__PURE__ */ jsx12("div", { className: "mb-4 p-3 bg-amber-50 border border-amber-200 rounded-lg", children: /* @__PURE__ */ jsxs9("p", { className: "text-sm text-amber-800", children: [
|
|
3000
|
+
/* @__PURE__ */ jsx12("strong", { children: "Instructions :" }),
|
|
3001
|
+
" Associez chaque lettre de colonne Excel au champ correspondant. Les champs marqu\xE9s d'un (*) sont obligatoires."
|
|
3002
|
+
] }) }),
|
|
3003
|
+
columnMapping.length === 0 ? /* @__PURE__ */ jsxs9("div", { className: "text-center py-8", children: [
|
|
3004
|
+
/* @__PURE__ */ jsx12("p", { className: "text-gray-500 mb-4", children: 'Cliquez sur "Ajouter" pour commencer le mapping' }),
|
|
3005
|
+
/* @__PURE__ */ jsxs9(
|
|
3006
|
+
"button",
|
|
3007
|
+
{
|
|
3008
|
+
type: "button",
|
|
3009
|
+
onClick: addMappingRow,
|
|
3010
|
+
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",
|
|
3011
|
+
children: [
|
|
3012
|
+
/* @__PURE__ */ jsx12(Plus, { className: "h-4 w-4" }),
|
|
3013
|
+
" Ajouter la premi\xE8re colonne"
|
|
3014
|
+
]
|
|
3015
|
+
}
|
|
3016
|
+
)
|
|
3017
|
+
] }) : /* @__PURE__ */ jsx12("div", { className: "space-y-3", children: columnMapping.map((mapping, index) => /* @__PURE__ */ jsxs9("div", { className: "flex items-center gap-3", children: [
|
|
3018
|
+
/* @__PURE__ */ jsxs9("div", { className: "w-20", children: [
|
|
3019
|
+
/* @__PURE__ */ jsx12("label", { className: "block text-xs text-gray-500 mb-1", children: "Colonne" }),
|
|
3020
|
+
/* @__PURE__ */ jsx12(
|
|
3021
|
+
"input",
|
|
3022
|
+
{
|
|
3023
|
+
type: "text",
|
|
3024
|
+
value: mapping.letter,
|
|
3025
|
+
onChange: (e) => updateMappingLetter(index, e.target.value),
|
|
3026
|
+
className: "w-full px-3 py-2 border border-gray-300 rounded-lg text-center uppercase",
|
|
3027
|
+
maxLength: 2
|
|
3028
|
+
}
|
|
3029
|
+
)
|
|
3030
|
+
] }),
|
|
3031
|
+
/* @__PURE__ */ jsxs9("div", { className: "flex-1", children: [
|
|
3032
|
+
/* @__PURE__ */ jsx12("label", { className: "block text-xs text-gray-500 mb-1", children: "Champ correspondant" }),
|
|
3033
|
+
/* @__PURE__ */ jsxs9(
|
|
3034
|
+
"select",
|
|
3035
|
+
{
|
|
3036
|
+
value: mapping.field,
|
|
3037
|
+
onChange: (e) => updateMappingField(index, e.target.value),
|
|
3038
|
+
className: "w-full px-3 py-2 border border-gray-300 rounded-lg bg-white",
|
|
3039
|
+
children: [
|
|
3040
|
+
/* @__PURE__ */ jsx12("option", { value: "", children: "-- S\xE9lectionner un champ --" }),
|
|
3041
|
+
/* @__PURE__ */ jsx12("optgroup", { label: "Champs obligatoires", children: importFields.required.map((field) => /* @__PURE__ */ jsx12("option", { value: field.value, children: field.label }, field.value)) }),
|
|
3042
|
+
/* @__PURE__ */ jsx12("optgroup", { label: "Champs optionnels", children: importFields.optional.map((field) => /* @__PURE__ */ jsx12("option", { value: field.value, children: field.label }, field.value)) })
|
|
3043
|
+
]
|
|
3044
|
+
}
|
|
3045
|
+
)
|
|
3046
|
+
] }),
|
|
3047
|
+
/* @__PURE__ */ jsx12(
|
|
3048
|
+
"button",
|
|
3049
|
+
{
|
|
3050
|
+
type: "button",
|
|
3051
|
+
onClick: () => removeMappingRow(index),
|
|
3052
|
+
className: "p-2 text-red-500 hover:bg-red-50 rounded-lg mt-5",
|
|
3053
|
+
children: /* @__PURE__ */ jsx12(Trash2, { className: "h-4 w-4" })
|
|
3054
|
+
}
|
|
3055
|
+
)
|
|
3056
|
+
] }, index)) }),
|
|
3057
|
+
columnMapping.length > 0 && /* @__PURE__ */ jsxs9("div", { className: "flex justify-between mt-6 pt-4 border-t border-gray-200", children: [
|
|
3058
|
+
/* @__PURE__ */ jsx12(
|
|
3059
|
+
"button",
|
|
3060
|
+
{
|
|
3061
|
+
type: "button",
|
|
3062
|
+
onClick: () => setCurrentStep(1),
|
|
3063
|
+
className: "px-4 py-2 text-gray-600 hover:bg-gray-100 rounded-lg",
|
|
3064
|
+
children: "Retour"
|
|
3065
|
+
}
|
|
3066
|
+
),
|
|
3067
|
+
/* @__PURE__ */ jsx12(
|
|
3068
|
+
"button",
|
|
3069
|
+
{
|
|
3070
|
+
type: "button",
|
|
3071
|
+
onClick: executeImport,
|
|
3072
|
+
disabled: loading,
|
|
3073
|
+
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",
|
|
3074
|
+
children: loading ? /* @__PURE__ */ jsxs9(Fragment4, { children: [
|
|
3075
|
+
/* @__PURE__ */ jsx12("div", { className: "animate-spin h-4 w-4 border-2 border-white border-t-transparent rounded-full" }),
|
|
3076
|
+
"Importation..."
|
|
3077
|
+
] }) : /* @__PURE__ */ jsxs9(Fragment4, { children: [
|
|
3078
|
+
/* @__PURE__ */ jsx12(Upload, { className: "h-4 w-4" }),
|
|
3079
|
+
"Lancer l'importation"
|
|
3080
|
+
] })
|
|
3081
|
+
}
|
|
3082
|
+
)
|
|
3083
|
+
] })
|
|
3084
|
+
] }),
|
|
3085
|
+
currentStep === 3 && importResults && /* @__PURE__ */ jsxs9("div", { className: "text-center py-4", children: [
|
|
3086
|
+
/* @__PURE__ */ jsx12(CheckCircle22, { className: "h-16 w-16 text-green-500 mx-auto mb-4" }),
|
|
3087
|
+
/* @__PURE__ */ jsx12("h3", { className: "text-lg font-medium text-gray-800 mb-6", children: "Importation termin\xE9e !" }),
|
|
3088
|
+
/* @__PURE__ */ jsxs9("div", { className: "grid grid-cols-4 gap-4 mb-6", children: [
|
|
3089
|
+
/* @__PURE__ */ jsxs9("div", { className: "p-4 bg-blue-50 rounded-lg", children: [
|
|
3090
|
+
/* @__PURE__ */ jsx12("p", { className: "text-2xl font-bold text-blue-600", children: importResults.results.total_rows }),
|
|
3091
|
+
/* @__PURE__ */ jsx12("p", { className: "text-xs text-blue-800", children: "Lignes lues" })
|
|
3092
|
+
] }),
|
|
3093
|
+
/* @__PURE__ */ jsxs9("div", { className: "p-4 bg-green-50 rounded-lg", children: [
|
|
3094
|
+
/* @__PURE__ */ jsx12("p", { className: "text-2xl font-bold text-green-600", children: importResults.results.saved_rows }),
|
|
3095
|
+
/* @__PURE__ */ jsx12("p", { className: "text-xs text-green-800", children: "Import\xE9es" })
|
|
3096
|
+
] }),
|
|
3097
|
+
/* @__PURE__ */ jsxs9("div", { className: "p-4 bg-amber-50 rounded-lg", children: [
|
|
3098
|
+
/* @__PURE__ */ jsx12("p", { className: "text-2xl font-bold text-amber-600", children: importResults.results.processed_rows - importResults.results.saved_rows }),
|
|
3099
|
+
/* @__PURE__ */ jsx12("p", { className: "text-xs text-amber-800", children: "Ignor\xE9es" })
|
|
3100
|
+
] }),
|
|
3101
|
+
/* @__PURE__ */ jsxs9("div", { className: "p-4 bg-red-50 rounded-lg", children: [
|
|
3102
|
+
/* @__PURE__ */ jsx12("p", { className: "text-2xl font-bold text-red-600", children: importResults.results.errors_count || 0 }),
|
|
3103
|
+
/* @__PURE__ */ jsx12("p", { className: "text-xs text-red-800", children: "Erreurs" })
|
|
3104
|
+
] })
|
|
3105
|
+
] }),
|
|
3106
|
+
importResults.data?.import_summary?.validation_errors && importResults.data.import_summary.validation_errors.length > 0 && /* @__PURE__ */ jsxs9("div", { className: "mb-6 p-4 bg-amber-50 border border-amber-200 rounded-lg text-left", children: [
|
|
3107
|
+
/* @__PURE__ */ jsx12("p", { className: "font-medium text-amber-800 mb-2", children: "Erreurs de validation :" }),
|
|
3108
|
+
/* @__PURE__ */ jsx12("ul", { className: "text-sm text-amber-700 space-y-1", children: importResults.data.import_summary.validation_errors.slice(0, 5).map((error, index) => /* @__PURE__ */ jsxs9("li", { children: [
|
|
3109
|
+
"Ligne ",
|
|
3110
|
+
error.row,
|
|
3111
|
+
" : ",
|
|
3112
|
+
Object.entries(error.errors).map(
|
|
3113
|
+
([field, messages]) => `${field}: ${messages.join(", ")}`
|
|
3114
|
+
).join("; ")
|
|
3115
|
+
] }, index)) }),
|
|
3116
|
+
importResults.data.import_summary.validation_errors.length > 5 && /* @__PURE__ */ jsxs9("p", { className: "text-xs text-amber-600 mt-2", children: [
|
|
3117
|
+
"... et ",
|
|
3118
|
+
importResults.data.import_summary.validation_errors.length - 5,
|
|
3119
|
+
" autres erreurs"
|
|
3120
|
+
] })
|
|
3121
|
+
] }),
|
|
3122
|
+
/* @__PURE__ */ jsx12(
|
|
3123
|
+
"button",
|
|
3124
|
+
{
|
|
3125
|
+
type: "button",
|
|
3126
|
+
onClick: handleSuccess,
|
|
3127
|
+
className: "px-6 py-2 bg-[var(--color-primary)] text-white rounded-lg hover:bg-[var(--color-primary-dark)]",
|
|
3128
|
+
children: "Terminer"
|
|
3129
|
+
}
|
|
3130
|
+
)
|
|
3131
|
+
] })
|
|
3132
|
+
] })
|
|
3133
|
+
] })
|
|
3134
|
+
] });
|
|
3135
|
+
};
|
|
2220
3136
|
var FDrawer = ({
|
|
2221
3137
|
children,
|
|
2222
3138
|
apiEndpoint,
|
|
2223
3139
|
columns,
|
|
2224
3140
|
actions,
|
|
2225
3141
|
ordering,
|
|
2226
|
-
toggle
|
|
3142
|
+
toggle,
|
|
3143
|
+
importEndpoint,
|
|
3144
|
+
importFields,
|
|
3145
|
+
onBulkDelete,
|
|
3146
|
+
onDuplicate,
|
|
3147
|
+
title
|
|
2227
3148
|
}) => {
|
|
2228
3149
|
const navigate = useNavigate2();
|
|
2229
3150
|
const [searchParams] = useSearchParams2();
|
|
@@ -2244,6 +3165,59 @@ var FDrawer = ({
|
|
|
2244
3165
|
current_page: null
|
|
2245
3166
|
});
|
|
2246
3167
|
const [searchQuery, setSearchQuery] = useState8("");
|
|
3168
|
+
const [debouncedSearchQuery, setDebouncedSearchQuery] = useState8("");
|
|
3169
|
+
const searchTimeoutRef = useRef(null);
|
|
3170
|
+
const [showFilterPanel, setShowFilterPanel] = useState8(false);
|
|
3171
|
+
const filterPanelRef = useRef(null);
|
|
3172
|
+
const [showImportModal, setShowImportModal] = useState8(false);
|
|
3173
|
+
const [showMoreOptions, setShowMoreOptions] = useState8(false);
|
|
3174
|
+
const moreOptionsRef = useRef(null);
|
|
3175
|
+
const [selectionMode, setSelectionMode] = useState8(false);
|
|
3176
|
+
const [selectedItems, setSelectedItems] = useState8([]);
|
|
3177
|
+
const [showColumnsPanel, setShowColumnsPanel] = useState8(false);
|
|
3178
|
+
const [visibleColumns, setVisibleColumns] = useState8(columns.map((c) => c.key));
|
|
3179
|
+
const columnsPanelRef = useRef(null);
|
|
3180
|
+
const [density, setDensity] = useState8("normal");
|
|
3181
|
+
const [isFullscreen, setIsFullscreen] = useState8(false);
|
|
3182
|
+
const tableContainerRef = useRef(null);
|
|
3183
|
+
useEffect6(() => {
|
|
3184
|
+
if (searchTimeoutRef.current) {
|
|
3185
|
+
clearTimeout(searchTimeoutRef.current);
|
|
3186
|
+
}
|
|
3187
|
+
searchTimeoutRef.current = setTimeout(() => {
|
|
3188
|
+
setDebouncedSearchQuery(searchQuery);
|
|
3189
|
+
}, 400);
|
|
3190
|
+
return () => {
|
|
3191
|
+
if (searchTimeoutRef.current) {
|
|
3192
|
+
clearTimeout(searchTimeoutRef.current);
|
|
3193
|
+
}
|
|
3194
|
+
};
|
|
3195
|
+
}, [searchQuery]);
|
|
3196
|
+
useEffect6(() => {
|
|
3197
|
+
setFilters((prev) => ({ ...prev, global_search: debouncedSearchQuery, page: 1 }));
|
|
3198
|
+
}, [debouncedSearchQuery]);
|
|
3199
|
+
useEffect6(() => {
|
|
3200
|
+
const handleClickOutside = (event) => {
|
|
3201
|
+
if (filterPanelRef.current && !filterPanelRef.current.contains(event.target)) {
|
|
3202
|
+
setShowFilterPanel(false);
|
|
3203
|
+
}
|
|
3204
|
+
if (moreOptionsRef.current && !moreOptionsRef.current.contains(event.target)) {
|
|
3205
|
+
setShowMoreOptions(false);
|
|
3206
|
+
}
|
|
3207
|
+
if (columnsPanelRef.current && !columnsPanelRef.current.contains(event.target)) {
|
|
3208
|
+
setShowColumnsPanel(false);
|
|
3209
|
+
}
|
|
3210
|
+
};
|
|
3211
|
+
document.addEventListener("mousedown", handleClickOutside);
|
|
3212
|
+
return () => document.removeEventListener("mousedown", handleClickOutside);
|
|
3213
|
+
}, []);
|
|
3214
|
+
useEffect6(() => {
|
|
3215
|
+
const handleFullscreenChange = () => {
|
|
3216
|
+
setIsFullscreen(!!document.fullscreenElement);
|
|
3217
|
+
};
|
|
3218
|
+
document.addEventListener("fullscreenchange", handleFullscreenChange);
|
|
3219
|
+
return () => document.removeEventListener("fullscreenchange", handleFullscreenChange);
|
|
3220
|
+
}, []);
|
|
2247
3221
|
const makeFilters = () => columns.reduce((acc, item) => {
|
|
2248
3222
|
acc[item.formule ? `${item.search_name}__icontains` : `${item.key}__icontains`] = "";
|
|
2249
3223
|
return acc;
|
|
@@ -2273,7 +3247,13 @@ var FDrawer = ({
|
|
|
2273
3247
|
}
|
|
2274
3248
|
};
|
|
2275
3249
|
useEffect6(() => {
|
|
2276
|
-
const
|
|
3250
|
+
const cleanFilters = {};
|
|
3251
|
+
Object.entries(filters).forEach(([key, value]) => {
|
|
3252
|
+
if (value !== "" && value !== null && value !== void 0) {
|
|
3253
|
+
cleanFilters[key] = String(value);
|
|
3254
|
+
}
|
|
3255
|
+
});
|
|
3256
|
+
const params = new URLSearchParams(cleanFilters).toString();
|
|
2277
3257
|
setQueryURL(`${API_URL}${apiEndpoint}?${params}`);
|
|
2278
3258
|
navigate(`${location.pathname}?${params}`);
|
|
2279
3259
|
}, [filters]);
|
|
@@ -2298,7 +3278,7 @@ var FDrawer = ({
|
|
|
2298
3278
|
}
|
|
2299
3279
|
);
|
|
2300
3280
|
case "number":
|
|
2301
|
-
return /* @__PURE__ */
|
|
3281
|
+
return /* @__PURE__ */ jsxs9("div", { className: "flex w-full gap-1", children: [
|
|
2302
3282
|
/* @__PURE__ */ jsx12(
|
|
2303
3283
|
"input",
|
|
2304
3284
|
{
|
|
@@ -2319,7 +3299,7 @@ var FDrawer = ({
|
|
|
2319
3299
|
)
|
|
2320
3300
|
] });
|
|
2321
3301
|
case "date":
|
|
2322
|
-
return /* @__PURE__ */
|
|
3302
|
+
return /* @__PURE__ */ jsxs9("div", { className: "flex w-full gap-1", children: [
|
|
2323
3303
|
/* @__PURE__ */ jsx12(
|
|
2324
3304
|
"input",
|
|
2325
3305
|
{
|
|
@@ -2357,63 +3337,403 @@ var FDrawer = ({
|
|
|
2357
3337
|
cellContent = new Date(item[column.key]).toLocaleDateString();
|
|
2358
3338
|
return /* @__PURE__ */ jsx12("td", { className: "px-6 py-4 whitespace-nowrap text-sm text-gray-500", children: cellContent }, column.key);
|
|
2359
3339
|
});
|
|
2360
|
-
|
|
2361
|
-
|
|
2362
|
-
|
|
3340
|
+
const handleExport = async () => {
|
|
3341
|
+
try {
|
|
3342
|
+
const exportParams = new URLSearchParams(filters);
|
|
3343
|
+
exportParams.set("export", "true");
|
|
3344
|
+
exportParams.set("all", "true");
|
|
3345
|
+
const exportURL = `${API_URL}${apiEndpoint}?${exportParams.toString()}`;
|
|
3346
|
+
const response = await fetch(exportURL, {
|
|
3347
|
+
method: "GET",
|
|
3348
|
+
headers: {
|
|
3349
|
+
"Authorization": `token ${token}`
|
|
3350
|
+
}
|
|
3351
|
+
});
|
|
3352
|
+
if (!response.ok) throw new Error("Erreur lors de l'export");
|
|
3353
|
+
const blob = await response.blob();
|
|
3354
|
+
const url = window.URL.createObjectURL(blob);
|
|
3355
|
+
const a = document.createElement("a");
|
|
3356
|
+
a.href = url;
|
|
3357
|
+
a.download = `export_${(/* @__PURE__ */ new Date()).toISOString().split("T")[0]}.xlsx`;
|
|
3358
|
+
document.body.appendChild(a);
|
|
3359
|
+
a.click();
|
|
3360
|
+
window.URL.revokeObjectURL(url);
|
|
3361
|
+
document.body.removeChild(a);
|
|
3362
|
+
} catch (error) {
|
|
3363
|
+
console.error("Erreur export:", error);
|
|
3364
|
+
}
|
|
3365
|
+
};
|
|
3366
|
+
const handlePrint = () => {
|
|
3367
|
+
const printContent = document.getElementById("fdrawer-table");
|
|
3368
|
+
if (!printContent) return;
|
|
3369
|
+
const printWindow = window.open("", "_blank");
|
|
3370
|
+
if (!printWindow) return;
|
|
3371
|
+
printWindow.document.write(`
|
|
3372
|
+
<html>
|
|
3373
|
+
<head>
|
|
3374
|
+
<title>Impression</title>
|
|
3375
|
+
<style>
|
|
3376
|
+
body { font-family: Arial, sans-serif; padding: 20px; }
|
|
3377
|
+
table { width: 100%; border-collapse: collapse; }
|
|
3378
|
+
th, td { border: 1px solid #ddd; padding: 8px; text-align: left; }
|
|
3379
|
+
th { background-color: #f5f5f5; font-weight: bold; }
|
|
3380
|
+
tr:nth-child(even) { background-color: #fafafa; }
|
|
3381
|
+
@media print {
|
|
3382
|
+
@page { margin: 1cm; }
|
|
3383
|
+
}
|
|
3384
|
+
</style>
|
|
3385
|
+
</head>
|
|
3386
|
+
<body>
|
|
3387
|
+
${printContent.outerHTML}
|
|
3388
|
+
</body>
|
|
3389
|
+
</html>
|
|
3390
|
+
`);
|
|
3391
|
+
printWindow.document.close();
|
|
3392
|
+
printWindow.print();
|
|
3393
|
+
};
|
|
3394
|
+
const resetFilters = () => {
|
|
3395
|
+
const cleanFilters = {
|
|
3396
|
+
...makeFilters(),
|
|
3397
|
+
business_entity_id: activeBusinessEntity?.id ?? null,
|
|
3398
|
+
order_by: order_by ?? "id",
|
|
3399
|
+
page: 1,
|
|
3400
|
+
global_search: ""
|
|
3401
|
+
};
|
|
3402
|
+
setFilters(cleanFilters);
|
|
3403
|
+
setSearchQuery("");
|
|
3404
|
+
setShowFilterPanel(false);
|
|
3405
|
+
};
|
|
3406
|
+
const getActiveFiltersCount = () => {
|
|
3407
|
+
let count = 0;
|
|
3408
|
+
Object.entries(filters).forEach(([key, value]) => {
|
|
3409
|
+
if (value && key !== "business_entity_id" && key !== "order_by" && key !== "page" && key !== "global_search") {
|
|
3410
|
+
count++;
|
|
3411
|
+
}
|
|
3412
|
+
});
|
|
3413
|
+
return count;
|
|
3414
|
+
};
|
|
3415
|
+
const activeFiltersCount = getActiveFiltersCount();
|
|
3416
|
+
const toggleSelectItem = (id) => {
|
|
3417
|
+
setSelectedItems(
|
|
3418
|
+
(prev) => prev.includes(id) ? prev.filter((i) => i !== id) : [...prev, id]
|
|
3419
|
+
);
|
|
3420
|
+
};
|
|
3421
|
+
const toggleSelectAll = () => {
|
|
3422
|
+
if (selectedItems.length === data.length) {
|
|
3423
|
+
setSelectedItems([]);
|
|
3424
|
+
} else {
|
|
3425
|
+
setSelectedItems(data.map((item) => item.id));
|
|
3426
|
+
}
|
|
3427
|
+
};
|
|
3428
|
+
const clearSelection = () => {
|
|
3429
|
+
setSelectedItems([]);
|
|
3430
|
+
setSelectionMode(false);
|
|
3431
|
+
};
|
|
3432
|
+
const handleBulkDelete = async () => {
|
|
3433
|
+
if (!onBulkDelete || selectedItems.length === 0) return;
|
|
3434
|
+
if (confirm(`Voulez-vous vraiment supprimer ${selectedItems.length} \xE9l\xE9ment(s) ?`)) {
|
|
3435
|
+
try {
|
|
3436
|
+
await onBulkDelete(selectedItems);
|
|
3437
|
+
clearSelection();
|
|
3438
|
+
getDataFilter();
|
|
3439
|
+
} catch (error) {
|
|
3440
|
+
console.error("Erreur lors de la suppression group\xE9e:", error);
|
|
3441
|
+
}
|
|
3442
|
+
}
|
|
3443
|
+
};
|
|
3444
|
+
const handleDuplicate = async (item) => {
|
|
3445
|
+
if (!onDuplicate) return;
|
|
3446
|
+
try {
|
|
3447
|
+
await onDuplicate(item);
|
|
3448
|
+
getDataFilter();
|
|
3449
|
+
} catch (error) {
|
|
3450
|
+
console.error("Erreur lors de la duplication:", error);
|
|
3451
|
+
}
|
|
3452
|
+
};
|
|
3453
|
+
const toggleColumnVisibility = (key) => {
|
|
3454
|
+
setVisibleColumns(
|
|
3455
|
+
(prev) => prev.includes(key) ? prev.filter((k) => k !== key) : [...prev, key]
|
|
3456
|
+
);
|
|
3457
|
+
};
|
|
3458
|
+
const toggleFullscreen = () => {
|
|
3459
|
+
if (!tableContainerRef.current) return;
|
|
3460
|
+
if (!document.fullscreenElement) {
|
|
3461
|
+
tableContainerRef.current.requestFullscreen();
|
|
3462
|
+
} else {
|
|
3463
|
+
document.exitFullscreen();
|
|
3464
|
+
}
|
|
3465
|
+
};
|
|
3466
|
+
const getDensityClasses = () => {
|
|
3467
|
+
switch (density) {
|
|
3468
|
+
case "compact":
|
|
3469
|
+
return { cell: "px-3 py-1", text: "text-xs" };
|
|
3470
|
+
case "comfortable":
|
|
3471
|
+
return { cell: "px-8 py-5", text: "text-base" };
|
|
3472
|
+
default:
|
|
3473
|
+
return { cell: "px-6 py-4", text: "text-sm" };
|
|
3474
|
+
}
|
|
3475
|
+
};
|
|
3476
|
+
const densityClasses = getDensityClasses();
|
|
3477
|
+
const visibleColumnsData = columns.filter((col) => visibleColumns.includes(col.key));
|
|
3478
|
+
return /* @__PURE__ */ jsxs9(Fragment4, { children: [
|
|
3479
|
+
/* @__PURE__ */ jsxs9("div", { className: "flex flex-wrap gap-4 mb-4", children: [
|
|
3480
|
+
/* @__PURE__ */ jsx12("div", { className: "flex-1 min-w-64", children: /* @__PURE__ */ jsxs9("div", { className: "relative", children: [
|
|
2363
3481
|
/* @__PURE__ */ jsx12(Search2, { className: "absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 h-4 w-4" }),
|
|
2364
3482
|
/* @__PURE__ */ jsx12(
|
|
2365
3483
|
"input",
|
|
2366
3484
|
{
|
|
2367
3485
|
type: "text",
|
|
2368
|
-
placeholder: "Rechercher
|
|
2369
|
-
className: "w-full pl-10 pr-
|
|
3486
|
+
placeholder: "Rechercher sur tous les champs...",
|
|
3487
|
+
className: "w-full pl-10 pr-10 py-2 border border-[#d1d7de] rounded-lg focus:ring-2 focus:ring-[#78a6d2] focus:border-transparent",
|
|
2370
3488
|
value: searchQuery,
|
|
2371
3489
|
onChange: (e) => setSearchQuery(e.target.value)
|
|
2372
3490
|
}
|
|
3491
|
+
),
|
|
3492
|
+
searchQuery && /* @__PURE__ */ jsx12(
|
|
3493
|
+
"button",
|
|
3494
|
+
{
|
|
3495
|
+
type: "button",
|
|
3496
|
+
onClick: () => setSearchQuery(""),
|
|
3497
|
+
className: "absolute right-3 top-1/2 transform -translate-y-1/2 text-gray-400 hover:text-gray-600",
|
|
3498
|
+
children: /* @__PURE__ */ jsx12(X5, { className: "h-4 w-4" })
|
|
3499
|
+
}
|
|
2373
3500
|
)
|
|
2374
3501
|
] }) }),
|
|
2375
|
-
/* @__PURE__ */
|
|
2376
|
-
Buttons_default,
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
},
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
]
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
3502
|
+
/* @__PURE__ */ jsxs9("div", { className: "relative", ref: filterPanelRef, children: [
|
|
3503
|
+
/* @__PURE__ */ jsxs9(Buttons_default, { onClick: () => setShowFilterPanel(!showFilterPanel), type: "button", children: [
|
|
3504
|
+
/* @__PURE__ */ jsx12(Filter, { className: "h-4 w-4 mr-2" }),
|
|
3505
|
+
"Filtres",
|
|
3506
|
+
activeFiltersCount > 0 && /* @__PURE__ */ jsx12("span", { className: "ml-2 bg-white text-[var(--color-primary)] rounded-full px-2 py-0.5 text-xs font-bold", children: activeFiltersCount }),
|
|
3507
|
+
/* @__PURE__ */ jsx12(ChevronDown, { className: cn("h-4 w-4 ml-1 transition-transform", showFilterPanel && "rotate-180") })
|
|
3508
|
+
] }),
|
|
3509
|
+
showFilterPanel && /* @__PURE__ */ jsxs9("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: [
|
|
3510
|
+
/* @__PURE__ */ jsxs9("div", { className: "p-4 border-b border-gray-200 flex items-center justify-between", children: [
|
|
3511
|
+
/* @__PURE__ */ jsx12("h3", { className: "font-semibold text-gray-800", children: "Filtres avanc\xE9s" }),
|
|
3512
|
+
/* @__PURE__ */ jsx12(
|
|
3513
|
+
"button",
|
|
3514
|
+
{
|
|
3515
|
+
type: "button",
|
|
3516
|
+
onClick: resetFilters,
|
|
3517
|
+
className: "text-sm text-blue-600 hover:text-blue-800",
|
|
3518
|
+
children: "R\xE9initialiser"
|
|
3519
|
+
}
|
|
3520
|
+
)
|
|
3521
|
+
] }),
|
|
3522
|
+
/* @__PURE__ */ jsx12("div", { className: "p-4 space-y-4", children: columns.filter((col) => col.filterable).map((column) => /* @__PURE__ */ jsxs9("div", { className: "space-y-1", children: [
|
|
3523
|
+
/* @__PURE__ */ jsx12("label", { className: "block text-sm font-medium text-gray-700", children: column.label }),
|
|
3524
|
+
renderColumnFilter(column)
|
|
3525
|
+
] }, column.key)) }),
|
|
3526
|
+
/* @__PURE__ */ jsx12("div", { className: "p-4 border-t border-gray-200 flex justify-end gap-2", children: /* @__PURE__ */ jsx12(
|
|
3527
|
+
"button",
|
|
3528
|
+
{
|
|
3529
|
+
type: "button",
|
|
3530
|
+
onClick: () => setShowFilterPanel(false),
|
|
3531
|
+
className: "px-4 py-2 text-sm text-gray-600 hover:bg-gray-100 rounded-lg",
|
|
3532
|
+
children: "Fermer"
|
|
3533
|
+
}
|
|
3534
|
+
) })
|
|
3535
|
+
] })
|
|
3536
|
+
] }),
|
|
3537
|
+
/* @__PURE__ */ jsxs9(Buttons_default, { onClick: handleExport, type: "button", children: [
|
|
3538
|
+
/* @__PURE__ */ jsx12(Download2, { className: "h-4 w-4 mr-2" }),
|
|
3539
|
+
"Exporter"
|
|
3540
|
+
] }),
|
|
3541
|
+
/* @__PURE__ */ jsxs9(Buttons_default, { onClick: handlePrint, type: "button", children: [
|
|
3542
|
+
/* @__PURE__ */ jsx12(Printer, { className: "h-4 w-4 mr-2" }),
|
|
3543
|
+
"Imprimer"
|
|
3544
|
+
] }),
|
|
3545
|
+
/* @__PURE__ */ jsxs9("div", { className: "relative", ref: moreOptionsRef, children: [
|
|
3546
|
+
/* @__PURE__ */ jsxs9(Buttons_default, { onClick: () => setShowMoreOptions(!showMoreOptions), type: "button", children: [
|
|
3547
|
+
/* @__PURE__ */ jsx12(Settings22, { className: "h-4 w-4 mr-2" }),
|
|
3548
|
+
"Plus",
|
|
3549
|
+
/* @__PURE__ */ jsx12(ChevronDown, { className: cn("h-4 w-4 ml-1 transition-transform", showMoreOptions && "rotate-180") })
|
|
3550
|
+
] }),
|
|
3551
|
+
showMoreOptions && /* @__PURE__ */ jsxs9("div", { className: "absolute right-0 mt-2 w-64 bg-white rounded-lg shadow-xl border border-gray-200 z-50 py-2", children: [
|
|
3552
|
+
/* @__PURE__ */ jsxs9(
|
|
3553
|
+
"button",
|
|
3554
|
+
{
|
|
3555
|
+
type: "button",
|
|
3556
|
+
onClick: () => {
|
|
3557
|
+
getDataFilter();
|
|
3558
|
+
setShowMoreOptions(false);
|
|
3559
|
+
},
|
|
3560
|
+
className: "w-full px-4 py-2 text-left text-sm text-gray-700 hover:bg-gray-50 flex items-center gap-3",
|
|
3561
|
+
children: [
|
|
3562
|
+
/* @__PURE__ */ jsx12(RefreshCw, { className: "h-4 w-4" }),
|
|
3563
|
+
"Actualiser les donn\xE9es"
|
|
3564
|
+
]
|
|
3565
|
+
}
|
|
3566
|
+
),
|
|
3567
|
+
importEndpoint && importFields && /* @__PURE__ */ jsxs9(
|
|
3568
|
+
"button",
|
|
3569
|
+
{
|
|
3570
|
+
type: "button",
|
|
3571
|
+
onClick: () => {
|
|
3572
|
+
setShowImportModal(true);
|
|
3573
|
+
setShowMoreOptions(false);
|
|
3574
|
+
},
|
|
3575
|
+
className: "w-full px-4 py-2 text-left text-sm text-gray-700 hover:bg-gray-50 flex items-center gap-3",
|
|
3576
|
+
children: [
|
|
3577
|
+
/* @__PURE__ */ jsx12(Upload, { className: "h-4 w-4" }),
|
|
3578
|
+
"Importer depuis Excel"
|
|
3579
|
+
]
|
|
3580
|
+
}
|
|
3581
|
+
),
|
|
3582
|
+
/* @__PURE__ */ jsx12("div", { className: "border-t border-gray-100 my-2" }),
|
|
3583
|
+
/* @__PURE__ */ jsxs9(
|
|
3584
|
+
"button",
|
|
3585
|
+
{
|
|
3586
|
+
type: "button",
|
|
3587
|
+
onClick: () => {
|
|
3588
|
+
setSelectionMode(!selectionMode);
|
|
3589
|
+
setShowMoreOptions(false);
|
|
3590
|
+
},
|
|
3591
|
+
className: "w-full px-4 py-2 text-left text-sm text-gray-700 hover:bg-gray-50 flex items-center gap-3",
|
|
3592
|
+
children: [
|
|
3593
|
+
/* @__PURE__ */ jsx12(SquareIcon, { className: "h-4 w-4" }),
|
|
3594
|
+
selectionMode ? "D\xE9sactiver la s\xE9lection" : "Mode s\xE9lection multiple"
|
|
3595
|
+
]
|
|
3596
|
+
}
|
|
3597
|
+
),
|
|
3598
|
+
/* @__PURE__ */ jsxs9(
|
|
3599
|
+
"button",
|
|
3600
|
+
{
|
|
3601
|
+
type: "button",
|
|
3602
|
+
onClick: () => {
|
|
3603
|
+
setShowColumnsPanel(true);
|
|
3604
|
+
setShowMoreOptions(false);
|
|
3605
|
+
},
|
|
3606
|
+
className: "w-full px-4 py-2 text-left text-sm text-gray-700 hover:bg-gray-50 flex items-center gap-3",
|
|
3607
|
+
children: [
|
|
3608
|
+
/* @__PURE__ */ jsx12(Columns3, { className: "h-4 w-4" }),
|
|
3609
|
+
"G\xE9rer les colonnes"
|
|
3610
|
+
]
|
|
3611
|
+
}
|
|
3612
|
+
),
|
|
3613
|
+
/* @__PURE__ */ jsx12("div", { className: "border-t border-gray-100 my-2" }),
|
|
3614
|
+
/* @__PURE__ */ jsxs9("div", { className: "px-4 py-2", children: [
|
|
3615
|
+
/* @__PURE__ */ jsx12("p", { className: "text-xs font-medium text-gray-500 mb-2", children: "Densit\xE9 d'affichage" }),
|
|
3616
|
+
/* @__PURE__ */ jsx12("div", { className: "flex gap-1", children: ["compact", "normal", "comfortable"].map((mode) => /* @__PURE__ */ jsx12(
|
|
3617
|
+
"button",
|
|
3618
|
+
{
|
|
3619
|
+
type: "button",
|
|
3620
|
+
onClick: () => setDensity(mode),
|
|
3621
|
+
className: cn(
|
|
3622
|
+
"flex-1 px-2 py-1 text-xs rounded transition-colors",
|
|
3623
|
+
density === mode ? "bg-[var(--color-primary)] text-white" : "bg-gray-100 text-gray-600 hover:bg-gray-200"
|
|
3624
|
+
),
|
|
3625
|
+
children: mode === "compact" ? "Compact" : mode === "normal" ? "Normal" : "Large"
|
|
3626
|
+
},
|
|
3627
|
+
mode
|
|
3628
|
+
)) })
|
|
3629
|
+
] }),
|
|
3630
|
+
/* @__PURE__ */ jsx12("div", { className: "border-t border-gray-100 my-2" }),
|
|
3631
|
+
/* @__PURE__ */ jsxs9(
|
|
3632
|
+
"button",
|
|
3633
|
+
{
|
|
3634
|
+
type: "button",
|
|
3635
|
+
onClick: () => {
|
|
3636
|
+
toggleFullscreen();
|
|
3637
|
+
setShowMoreOptions(false);
|
|
3638
|
+
},
|
|
3639
|
+
className: "w-full px-4 py-2 text-left text-sm text-gray-700 hover:bg-gray-50 flex items-center gap-3",
|
|
3640
|
+
children: [
|
|
3641
|
+
isFullscreen ? /* @__PURE__ */ jsx12(Minimize2, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx12(Maximize2, { className: "h-4 w-4" }),
|
|
3642
|
+
isFullscreen ? "Quitter le plein \xE9cran" : "Plein \xE9cran"
|
|
3643
|
+
]
|
|
3644
|
+
}
|
|
3645
|
+
)
|
|
3646
|
+
] })
|
|
3647
|
+
] })
|
|
3648
|
+
] }),
|
|
3649
|
+
showColumnsPanel && /* @__PURE__ */ jsxs9("div", { className: "fixed inset-0 z-50 flex items-center justify-center", children: [
|
|
3650
|
+
/* @__PURE__ */ jsx12("div", { className: "absolute inset-0 bg-black/30", onClick: () => setShowColumnsPanel(false) }),
|
|
3651
|
+
/* @__PURE__ */ jsxs9("div", { className: "relative bg-white rounded-xl shadow-2xl w-full max-w-md", ref: columnsPanelRef, children: [
|
|
3652
|
+
/* @__PURE__ */ jsxs9("div", { className: "flex items-center justify-between p-4 border-b border-gray-200", children: [
|
|
3653
|
+
/* @__PURE__ */ jsx12("h3", { className: "font-semibold text-gray-800", children: "Colonnes visibles" }),
|
|
3654
|
+
/* @__PURE__ */ jsx12("button", { type: "button", onClick: () => setShowColumnsPanel(false), className: "p-1 hover:bg-gray-100 rounded-lg", children: /* @__PURE__ */ jsx12(X5, { className: "h-5 w-5 text-gray-500" }) })
|
|
3655
|
+
] }),
|
|
3656
|
+
/* @__PURE__ */ jsx12("div", { className: "p-4 max-h-[60vh] overflow-y-auto", children: columns.map((column) => /* @__PURE__ */ jsxs9("label", { className: "flex items-center gap-3 py-2 cursor-pointer hover:bg-gray-50 px-2 rounded", children: [
|
|
3657
|
+
/* @__PURE__ */ jsx12(
|
|
3658
|
+
"input",
|
|
3659
|
+
{
|
|
3660
|
+
type: "checkbox",
|
|
3661
|
+
checked: visibleColumns.includes(column.key),
|
|
3662
|
+
onChange: () => toggleColumnVisibility(column.key),
|
|
3663
|
+
className: "w-4 h-4 text-[var(--color-primary)] rounded border-gray-300"
|
|
3664
|
+
}
|
|
3665
|
+
),
|
|
3666
|
+
/* @__PURE__ */ jsx12("span", { className: "text-sm text-gray-700", children: column.label })
|
|
3667
|
+
] }, column.key)) }),
|
|
3668
|
+
/* @__PURE__ */ jsxs9("div", { className: "p-4 border-t border-gray-200 flex justify-between", children: [
|
|
3669
|
+
/* @__PURE__ */ jsx12(
|
|
3670
|
+
"button",
|
|
3671
|
+
{
|
|
3672
|
+
type: "button",
|
|
3673
|
+
onClick: () => setVisibleColumns(columns.map((c) => c.key)),
|
|
3674
|
+
className: "text-sm text-blue-600 hover:text-blue-800",
|
|
3675
|
+
children: "Tout afficher"
|
|
3676
|
+
}
|
|
3677
|
+
),
|
|
3678
|
+
/* @__PURE__ */ jsx12(
|
|
3679
|
+
"button",
|
|
3680
|
+
{
|
|
3681
|
+
type: "button",
|
|
3682
|
+
onClick: () => setShowColumnsPanel(false),
|
|
3683
|
+
className: "px-4 py-2 bg-[var(--color-primary)] text-white rounded-lg text-sm",
|
|
3684
|
+
children: "Fermer"
|
|
3685
|
+
}
|
|
3686
|
+
)
|
|
3687
|
+
] })
|
|
3688
|
+
] })
|
|
3689
|
+
] }),
|
|
3690
|
+
selectionMode && selectedItems.length > 0 && /* @__PURE__ */ jsxs9("div", { className: "mb-4 p-3 bg-blue-50 border border-blue-200 rounded-lg flex items-center justify-between", children: [
|
|
3691
|
+
/* @__PURE__ */ jsx12("div", { className: "flex items-center gap-3", children: /* @__PURE__ */ jsxs9("span", { className: "text-sm font-medium text-blue-800", children: [
|
|
3692
|
+
selectedItems.length,
|
|
3693
|
+
" \xE9l\xE9ment(s) s\xE9lectionn\xE9(s)"
|
|
3694
|
+
] }) }),
|
|
3695
|
+
/* @__PURE__ */ jsxs9("div", { className: "flex items-center gap-2", children: [
|
|
3696
|
+
onBulkDelete && /* @__PURE__ */ jsxs9(
|
|
3697
|
+
"button",
|
|
3698
|
+
{
|
|
3699
|
+
type: "button",
|
|
3700
|
+
onClick: handleBulkDelete,
|
|
3701
|
+
className: "px-3 py-1.5 bg-red-500 text-white rounded-lg text-sm flex items-center gap-2 hover:bg-red-600",
|
|
3702
|
+
children: [
|
|
3703
|
+
/* @__PURE__ */ jsx12(Trash2, { className: "h-4 w-4" }),
|
|
3704
|
+
"Supprimer"
|
|
3705
|
+
]
|
|
3706
|
+
}
|
|
3707
|
+
),
|
|
3708
|
+
/* @__PURE__ */ jsx12(
|
|
3709
|
+
"button",
|
|
3710
|
+
{
|
|
3711
|
+
type: "button",
|
|
3712
|
+
onClick: clearSelection,
|
|
3713
|
+
className: "px-3 py-1.5 bg-gray-200 text-gray-700 rounded-lg text-sm hover:bg-gray-300",
|
|
3714
|
+
children: "Annuler"
|
|
3715
|
+
}
|
|
3716
|
+
)
|
|
3717
|
+
] })
|
|
2408
3718
|
] }),
|
|
2409
|
-
/* @__PURE__ */
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
3719
|
+
loading && /* @__PURE__ */ jsx12("div", { className: "flex justify-center py-4", children: /* @__PURE__ */ jsx12("div", { className: "animate-spin rounded-full h-8 w-8 border-b-2 border-[var(--color-primary)]" }) }),
|
|
3720
|
+
/* @__PURE__ */ jsx12("div", { ref: tableContainerRef, className: cn("bg-white", isFullscreen && "p-4"), children: /* @__PURE__ */ jsxs9("table", { id: "fdrawer-table", className: "w-full", children: [
|
|
3721
|
+
/* @__PURE__ */ jsx12("thead", { className: "bg-gray-50", children: /* @__PURE__ */ jsxs9("tr", { children: [
|
|
3722
|
+
selectionMode && /* @__PURE__ */ jsx12("th", { className: cn(densityClasses.cell, "text-left text-xs font-medium text-gray-500 uppercase tracking-wider"), children: /* @__PURE__ */ jsx12(
|
|
3723
|
+
"input",
|
|
3724
|
+
{
|
|
3725
|
+
type: "checkbox",
|
|
3726
|
+
checked: selectedItems.length === data.length && data.length > 0,
|
|
3727
|
+
onChange: toggleSelectAll,
|
|
3728
|
+
className: "w-4 h-4 text-[var(--color-primary)] rounded border-gray-300"
|
|
3729
|
+
}
|
|
3730
|
+
) }),
|
|
3731
|
+
visibleColumnsData.map((column) => /* @__PURE__ */ jsxs9("th", { className: cn(densityClasses.cell, "text-left text-xs font-medium text-gray-500 uppercase tracking-wider relative"), scope: "col", children: [
|
|
3732
|
+
/* @__PURE__ */ jsxs9("div", { className: "flex align-center items-center gap-2", children: [
|
|
2413
3733
|
/* @__PURE__ */ jsx12("span", { onClick: () => setShowFilters(showFilters === column.key ? "" : column.key), children: column.label }),
|
|
2414
3734
|
column.sortable && /* @__PURE__ */ jsx12(ArrowDownUp, { className: "h-4 w-4 cursor-pointer", onClick: () => setShowOrdering(showOrdering === column.key ? "" : column.key) })
|
|
2415
3735
|
] }),
|
|
2416
|
-
showOrdering === column.key && /* @__PURE__ */ jsx12("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__ */
|
|
3736
|
+
showOrdering === column.key && /* @__PURE__ */ jsx12("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__ */ jsxs9("div", { className: "p-2", children: [
|
|
2417
3737
|
/* @__PURE__ */ jsx12(
|
|
2418
3738
|
"button",
|
|
2419
3739
|
{
|
|
@@ -2425,7 +3745,7 @@ var FDrawer = ({
|
|
|
2425
3745
|
},
|
|
2426
3746
|
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)]"),
|
|
2427
3747
|
role: "menuitem",
|
|
2428
|
-
children: /* @__PURE__ */
|
|
3748
|
+
children: /* @__PURE__ */ jsxs9("div", { className: "text-left flex-1 flex items-center gap-2", children: [
|
|
2429
3749
|
/* @__PURE__ */ jsx12(ArrowUpAZ, { className: "h-4 w-4" }),
|
|
2430
3750
|
/* @__PURE__ */ jsx12("p", { className: cn("text-sm font-medium", order_by === column.key ? "text-[var(--color-primary)]" : "text-[var(--color-text-primary)]"), children: "Croissant" })
|
|
2431
3751
|
] })
|
|
@@ -2442,42 +3762,98 @@ var FDrawer = ({
|
|
|
2442
3762
|
},
|
|
2443
3763
|
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)]"),
|
|
2444
3764
|
role: "menuitem",
|
|
2445
|
-
children: /* @__PURE__ */
|
|
3765
|
+
children: /* @__PURE__ */ jsxs9("div", { className: "text-left flex-1 flex items-center gap-2", children: [
|
|
2446
3766
|
/* @__PURE__ */ jsx12(ArrowDownAZ, { className: "h-4 w-4" }),
|
|
2447
3767
|
/* @__PURE__ */ jsx12("p", { className: cn("text-sm font-medium", order_by === `-${column.key}` ? "text-[var(--color-primary)]" : "text-[var(--color-text-primary)]"), children: "D\xE9croissant" })
|
|
2448
3768
|
] })
|
|
2449
3769
|
}
|
|
2450
3770
|
)
|
|
2451
3771
|
] }) }),
|
|
2452
|
-
showFilters === column.key && /* @__PURE__ */
|
|
3772
|
+
showFilters === column.key && /* @__PURE__ */ jsxs9("div", { className: "absolute left-6 mt-2 w-[500px] bg-[var(--color-background)] rounded-lg shadow-xl border border-[var(--color-border)] z-50 max-h-80 overflow-y-auto", role: "menu", children: [
|
|
2453
3773
|
/* @__PURE__ */ jsx12("div", { className: "py-2 px-4", children: /* @__PURE__ */ jsx12("h3", { className: "font-semibold text-[var(--color-text-primary)]", children: "Filtrer" }) }),
|
|
2454
3774
|
/* @__PURE__ */ jsx12("div", { className: "pb-3 px-4", children: renderColumnFilter(column) })
|
|
2455
3775
|
] })
|
|
2456
3776
|
] }, column.key)),
|
|
2457
|
-
/* @__PURE__ */ jsx12("th", { className: "
|
|
3777
|
+
/* @__PURE__ */ jsx12("th", { className: cn(densityClasses.cell, "text-left text-xs font-medium text-gray-500 uppercase tracking-wider") })
|
|
2458
3778
|
] }) }),
|
|
2459
|
-
/* @__PURE__ */ jsx12("tbody", { className: "bg-white divide-y divide-gray-200", children: data.map((item) => /* @__PURE__ */
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
"
|
|
2464
|
-
|
|
2465
|
-
type: "button",
|
|
2466
|
-
onClick: () => setDropdownOpen(dropdownOpen === item.id ? null : item.id),
|
|
2467
|
-
className: "p-1 rounded-full hover:bg-gray-100 transition-colors",
|
|
2468
|
-
children: /* @__PURE__ */ jsx12(MoreVertical, { className: "w-4 h-4 text-gray-400" })
|
|
2469
|
-
}
|
|
3779
|
+
/* @__PURE__ */ jsx12("tbody", { className: "bg-white divide-y divide-gray-200", children: data.map((item) => /* @__PURE__ */ jsxs9(
|
|
3780
|
+
"tr",
|
|
3781
|
+
{
|
|
3782
|
+
className: cn(
|
|
3783
|
+
"hover:bg-gray-50 cursor-pointer",
|
|
3784
|
+
selectionMode && selectedItems.includes(item.id) && "bg-blue-50"
|
|
2470
3785
|
),
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
3786
|
+
children: [
|
|
3787
|
+
selectionMode && /* @__PURE__ */ jsx12("td", { className: cn(densityClasses.cell, "whitespace-nowrap", densityClasses.text, "text-gray-500"), children: /* @__PURE__ */ jsx12(
|
|
3788
|
+
"input",
|
|
3789
|
+
{
|
|
3790
|
+
type: "checkbox",
|
|
3791
|
+
checked: selectedItems.includes(item.id),
|
|
3792
|
+
onChange: () => toggleSelectItem(item.id),
|
|
3793
|
+
className: "w-4 h-4 text-[var(--color-primary)] rounded border-gray-300"
|
|
3794
|
+
}
|
|
3795
|
+
) }),
|
|
3796
|
+
visibleColumnsData.map((column) => {
|
|
3797
|
+
let cellContent = column.formule ? column.formule(item) : item[column.key];
|
|
3798
|
+
if (column.type === "date" && item[column.key])
|
|
3799
|
+
cellContent = new Date(item[column.key]).toLocaleDateString();
|
|
3800
|
+
return /* @__PURE__ */ jsx12("td", { className: cn(densityClasses.cell, "whitespace-nowrap", densityClasses.text, "text-gray-500"), children: cellContent }, column.key);
|
|
3801
|
+
}),
|
|
3802
|
+
/* @__PURE__ */ jsx12("td", { className: cn(densityClasses.cell, "whitespace-nowrap text-right", densityClasses.text, "font-medium"), children: /* @__PURE__ */ jsxs9("div", { className: "relative", children: [
|
|
3803
|
+
/* @__PURE__ */ jsx12(
|
|
3804
|
+
"button",
|
|
3805
|
+
{
|
|
3806
|
+
type: "button",
|
|
3807
|
+
onClick: () => setDropdownOpen(dropdownOpen === item.id ? null : item.id),
|
|
3808
|
+
className: "p-1 rounded-full hover:bg-gray-100 transition-colors",
|
|
3809
|
+
children: /* @__PURE__ */ jsx12(MoreVertical, { className: "w-4 h-4 text-gray-400" })
|
|
3810
|
+
}
|
|
3811
|
+
),
|
|
3812
|
+
dropdownOpen === item.id && /* @__PURE__ */ jsxs9("div", { className: "fixed right-3 mt-2 w-48 bg-white rounded-lg shadow-lg border border-gray-200 py-2 z-10", children: [
|
|
3813
|
+
actions.map(
|
|
3814
|
+
(action, index) => action.navigate ? /* @__PURE__ */ jsx12(Link2, { 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__ */ jsx12("button", { onClick: () => {
|
|
3815
|
+
action.onclick && action.onclick(item);
|
|
3816
|
+
setDropdownOpen(null);
|
|
3817
|
+
}, 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)
|
|
3818
|
+
),
|
|
3819
|
+
onDuplicate && /* @__PURE__ */ jsxs9(Fragment4, { children: [
|
|
3820
|
+
/* @__PURE__ */ jsx12("div", { className: "border-t border-gray-100 my-1" }),
|
|
3821
|
+
/* @__PURE__ */ jsxs9(
|
|
3822
|
+
"button",
|
|
3823
|
+
{
|
|
3824
|
+
onClick: () => {
|
|
3825
|
+
handleDuplicate(item);
|
|
3826
|
+
setDropdownOpen(null);
|
|
3827
|
+
},
|
|
3828
|
+
className: "w-full px-4 py-2 text-left text-sm text-gray-700 hover:bg-gray-50 flex items-center space-x-2",
|
|
3829
|
+
children: [
|
|
3830
|
+
/* @__PURE__ */ jsx12(Copy, { className: "h-4 w-4" }),
|
|
3831
|
+
/* @__PURE__ */ jsx12("span", { children: "Dupliquer" })
|
|
3832
|
+
]
|
|
3833
|
+
}
|
|
3834
|
+
)
|
|
3835
|
+
] })
|
|
3836
|
+
] })
|
|
3837
|
+
] }) })
|
|
3838
|
+
]
|
|
3839
|
+
},
|
|
3840
|
+
item.id
|
|
3841
|
+
)) })
|
|
3842
|
+
] }) }),
|
|
3843
|
+
/* @__PURE__ */ jsx12(Pagination, { reponseDetail, setQueryURL, filters: [filters, setFilters] }),
|
|
3844
|
+
importEndpoint && importFields && /* @__PURE__ */ jsx12(
|
|
3845
|
+
ExcelImportModal,
|
|
3846
|
+
{
|
|
3847
|
+
isOpen: showImportModal,
|
|
3848
|
+
onClose: () => setShowImportModal(false),
|
|
3849
|
+
importEndpoint,
|
|
3850
|
+
importFields,
|
|
3851
|
+
onSuccess: () => {
|
|
3852
|
+
setShowImportModal(false);
|
|
3853
|
+
getDataFilter();
|
|
3854
|
+
}
|
|
3855
|
+
}
|
|
3856
|
+
)
|
|
2481
3857
|
] });
|
|
2482
3858
|
};
|
|
2483
3859
|
var Pagination = ({
|
|
@@ -2523,15 +3899,15 @@ var Pagination = ({
|
|
|
2523
3899
|
if (newPage >= 1 && newPage <= total_pages)
|
|
2524
3900
|
setFilters({ ...filtersValue, page: newPage });
|
|
2525
3901
|
};
|
|
2526
|
-
return /* @__PURE__ */
|
|
2527
|
-
/* @__PURE__ */
|
|
3902
|
+
return /* @__PURE__ */ jsxs9("div", { className: "p-4 border-t border-[#E8E8E8] flex items-center justify-between", children: [
|
|
3903
|
+
/* @__PURE__ */ jsxs9("span", { className: "text-sm text-[#666666]", children: [
|
|
2528
3904
|
"Affichage de 1 \xE0 ",
|
|
2529
3905
|
results?.length ?? 0,
|
|
2530
3906
|
" sur ",
|
|
2531
3907
|
count ?? 0,
|
|
2532
3908
|
" entr\xE9es"
|
|
2533
3909
|
] }),
|
|
2534
|
-
/* @__PURE__ */ jsx12("nav", { children: /* @__PURE__ */
|
|
3910
|
+
/* @__PURE__ */ jsx12("nav", { children: /* @__PURE__ */ jsxs9("ul", { className: "flex items-center space-x-2 pagination", children: [
|
|
2535
3911
|
/* @__PURE__ */ jsx12("li", { className: `page-item ${previous === null ? "disabled" : ""}`, children: /* @__PURE__ */ jsx12(Link2, { className: "page-link px-3 py-1 border border-[#E8E8E8] rounded text-sm disabled:opacity-50", to: "#", onClick: () => handleChangePage("previous"), tabIndex: -1, "aria-disabled": previous === null, children: "Pr\xE9c\xE9dent" }) }),
|
|
2536
3912
|
pageItems,
|
|
2537
3913
|
/* @__PURE__ */ jsx12("li", { className: `page-item ${next === null ? "disabled" : ""}`, children: /* @__PURE__ */ jsx12(Link2, { className: "page-link px-3 py-1 border border-[#E8E8E8] rounded text-sm disabled:opacity-50", to: "#", onClick: () => handleChangePage("next"), "aria-disabled": next === null, children: "Suivant" }) }),
|
|
@@ -2553,9 +3929,9 @@ var Pagination = ({
|
|
|
2553
3929
|
import { useState as useState10, useEffect as useEffect8 } from "react";
|
|
2554
3930
|
|
|
2555
3931
|
// src/components/common/SearchableSelect.tsx
|
|
2556
|
-
import { useState as useState9, useRef, useEffect as useEffect7 } from "react";
|
|
2557
|
-
import { Search as Search3, ChevronDown, X as
|
|
2558
|
-
import { Fragment as Fragment5, jsx as jsx13, jsxs as
|
|
3932
|
+
import { useState as useState9, useRef as useRef2, useEffect as useEffect7 } from "react";
|
|
3933
|
+
import { Search as Search3, ChevronDown as ChevronDown2, X as X6, RefreshCw as RefreshCw2, Plus as Plus2 } from "lucide-react";
|
|
3934
|
+
import { Fragment as Fragment5, jsx as jsx13, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
2559
3935
|
var SearchableSelect = ({
|
|
2560
3936
|
options,
|
|
2561
3937
|
value,
|
|
@@ -2571,8 +3947,8 @@ var SearchableSelect = ({
|
|
|
2571
3947
|
}) => {
|
|
2572
3948
|
const [isOpen, setIsOpen] = useState9(false);
|
|
2573
3949
|
const [searchTerm, setSearchTerm] = useState9("");
|
|
2574
|
-
const dropdownRef =
|
|
2575
|
-
const inputRef =
|
|
3950
|
+
const dropdownRef = useRef2(null);
|
|
3951
|
+
const inputRef = useRef2(null);
|
|
2576
3952
|
const selectedOption = options.find((option) => option.value === value);
|
|
2577
3953
|
const defaultFilter = (option, searchTerm2) => {
|
|
2578
3954
|
return option.label.toLowerCase().includes(searchTerm2.toLowerCase());
|
|
@@ -2609,7 +3985,7 @@ var SearchableSelect = ({
|
|
|
2609
3985
|
}
|
|
2610
3986
|
}
|
|
2611
3987
|
};
|
|
2612
|
-
return /* @__PURE__ */
|
|
3988
|
+
return /* @__PURE__ */ jsxs10("div", { className: "relative", ref: dropdownRef, children: [
|
|
2613
3989
|
/* @__PURE__ */ jsx13(
|
|
2614
3990
|
"div",
|
|
2615
3991
|
{
|
|
@@ -2620,8 +3996,8 @@ var SearchableSelect = ({
|
|
|
2620
3996
|
${disabled ? "bg-gray-100 cursor-not-allowed" : "bg-white hover:border-gray-300"}
|
|
2621
3997
|
${isOpen ? "ring-2 ring-[#6B7C92] border-transparent" : ""}
|
|
2622
3998
|
`,
|
|
2623
|
-
children: /* @__PURE__ */
|
|
2624
|
-
/* @__PURE__ */ jsx13("div", { className: "flex items-center space-x-2 flex-1", children: selectedOption ? /* @__PURE__ */
|
|
3999
|
+
children: /* @__PURE__ */ jsxs10("div", { className: "flex items-center justify-between", children: [
|
|
4000
|
+
/* @__PURE__ */ jsx13("div", { className: "flex items-center space-x-2 flex-1", children: selectedOption ? /* @__PURE__ */ jsxs10(Fragment5, { children: [
|
|
2625
4001
|
selectedOption.image && /* @__PURE__ */ jsx13(
|
|
2626
4002
|
"img",
|
|
2627
4003
|
{
|
|
@@ -2632,18 +4008,18 @@ var SearchableSelect = ({
|
|
|
2632
4008
|
),
|
|
2633
4009
|
selectedOption.content || /* @__PURE__ */ jsx13("span", { className: "text-gray-900", children: selectedOption.label })
|
|
2634
4010
|
] }) : /* @__PURE__ */ jsx13("span", { className: "text-gray-400", children: placeholder }) }),
|
|
2635
|
-
/* @__PURE__ */
|
|
4011
|
+
/* @__PURE__ */ jsxs10("div", { className: "flex items-center space-x-2", children: [
|
|
2636
4012
|
allowClear && selectedOption && /* @__PURE__ */ jsx13(
|
|
2637
4013
|
"button",
|
|
2638
4014
|
{
|
|
2639
4015
|
onClick: handleClear,
|
|
2640
4016
|
className: "text-gray-400 hover:text-gray-600",
|
|
2641
4017
|
type: "button",
|
|
2642
|
-
children: /* @__PURE__ */ jsx13(
|
|
4018
|
+
children: /* @__PURE__ */ jsx13(X6, { size: 16 })
|
|
2643
4019
|
}
|
|
2644
4020
|
),
|
|
2645
4021
|
/* @__PURE__ */ jsx13(
|
|
2646
|
-
|
|
4022
|
+
ChevronDown2,
|
|
2647
4023
|
{
|
|
2648
4024
|
size: 16,
|
|
2649
4025
|
className: `text-gray-400 transition-transform ${isOpen ? "rotate-180" : ""}`
|
|
@@ -2653,9 +4029,9 @@ var SearchableSelect = ({
|
|
|
2653
4029
|
] })
|
|
2654
4030
|
}
|
|
2655
4031
|
),
|
|
2656
|
-
isOpen && /* @__PURE__ */
|
|
2657
|
-
/* @__PURE__ */
|
|
2658
|
-
/* @__PURE__ */
|
|
4032
|
+
isOpen && /* @__PURE__ */ jsxs10("div", { className: "absolute z-50 w-full mt-1 bg-white border border-gray-200 rounded-lg shadow-lg", children: [
|
|
4033
|
+
/* @__PURE__ */ jsxs10("div", { className: "p-3 border-b border-gray-200 flex", children: [
|
|
4034
|
+
/* @__PURE__ */ jsxs10("div", { className: "relative w-full", children: [
|
|
2659
4035
|
/* @__PURE__ */ jsx13(Search3, { className: "absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-4 h-4" }),
|
|
2660
4036
|
/* @__PURE__ */ jsx13(
|
|
2661
4037
|
"input",
|
|
@@ -2677,7 +4053,7 @@ var SearchableSelect = ({
|
|
|
2677
4053
|
disabled,
|
|
2678
4054
|
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",
|
|
2679
4055
|
title: "Rafra\xEEchir la liste",
|
|
2680
|
-
children: /* @__PURE__ */ jsx13(
|
|
4056
|
+
children: /* @__PURE__ */ jsx13(RefreshCw2, { className: `w-4 h-4 ${disabled ? "animate-spin" : ""}` })
|
|
2681
4057
|
}
|
|
2682
4058
|
),
|
|
2683
4059
|
addElement && /* @__PURE__ */ jsx13(
|
|
@@ -2687,11 +4063,11 @@ var SearchableSelect = ({
|
|
|
2687
4063
|
onClick: addElement,
|
|
2688
4064
|
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",
|
|
2689
4065
|
title: "Rafra\xEEchir la liste",
|
|
2690
|
-
children: /* @__PURE__ */ jsx13(
|
|
4066
|
+
children: /* @__PURE__ */ jsx13(Plus2, { className: "w-4 h-4" })
|
|
2691
4067
|
}
|
|
2692
4068
|
)
|
|
2693
4069
|
] }),
|
|
2694
|
-
/* @__PURE__ */ jsx13("div", { className: "max-h-60 overflow-y-auto", children: filteredOptions.length > 0 ? filteredOptions.map((option) => /* @__PURE__ */
|
|
4070
|
+
/* @__PURE__ */ jsx13("div", { className: "max-h-60 overflow-y-auto", children: filteredOptions.length > 0 ? filteredOptions.map((option) => /* @__PURE__ */ jsxs10(
|
|
2695
4071
|
"div",
|
|
2696
4072
|
{
|
|
2697
4073
|
onClick: () => handleSelect(option),
|
|
@@ -2715,8 +4091,8 @@ var SearchableSelect = ({
|
|
|
2715
4091
|
};
|
|
2716
4092
|
|
|
2717
4093
|
// src/components/common/ApprovalWorkflow.tsx
|
|
2718
|
-
import { X as
|
|
2719
|
-
import { Fragment as Fragment6, jsx as jsx14, jsxs as
|
|
4094
|
+
import { X as X7, Plus as Plus3, Trash2 as Trash22, Users, Loader as Loader2, RotateCcw, Ban, Eye as Eye3, FileText as FileText2, History } from "lucide-react";
|
|
4095
|
+
import { Fragment as Fragment6, jsx as jsx14, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
2720
4096
|
var ApprovalWorkflow = ({
|
|
2721
4097
|
process,
|
|
2722
4098
|
object_id,
|
|
@@ -2968,8 +4344,8 @@ var ApprovalWorkflow = ({
|
|
|
2968
4344
|
return users.map((user) => ({
|
|
2969
4345
|
value: user.id,
|
|
2970
4346
|
label: `${user.first_name} ${user.last_name}`,
|
|
2971
|
-
content: /* @__PURE__ */ jsx14("div", { className: "flex items-center space-x-3", children: /* @__PURE__ */
|
|
2972
|
-
/* @__PURE__ */
|
|
4347
|
+
content: /* @__PURE__ */ jsx14("div", { className: "flex items-center space-x-3", children: /* @__PURE__ */ jsxs11("div", { className: "flex-1", children: [
|
|
4348
|
+
/* @__PURE__ */ jsxs11("div", { className: "font-medium text-gray-900", children: [
|
|
2973
4349
|
user.first_name,
|
|
2974
4350
|
" ",
|
|
2975
4351
|
user.last_name
|
|
@@ -3004,8 +4380,8 @@ var ApprovalWorkflow = ({
|
|
|
3004
4380
|
rank: i + 1
|
|
3005
4381
|
})));
|
|
3006
4382
|
};
|
|
3007
|
-
return /* @__PURE__ */
|
|
3008
|
-
/* @__PURE__ */
|
|
4383
|
+
return /* @__PURE__ */ jsxs11("fieldset", { className: "border border-[#D9D9D9] rounded-lg p-4", children: [
|
|
4384
|
+
/* @__PURE__ */ jsxs11("div", { className: "flex items-center justify-between mb-4", children: [
|
|
3009
4385
|
/* @__PURE__ */ jsx14("legend", { className: "text-lg font-semibold text-[#191919] px-2", children: sectionTitle }),
|
|
3010
4386
|
!readOnly && /* @__PURE__ */ jsx14(
|
|
3011
4387
|
AddStageButton,
|
|
@@ -3018,12 +4394,12 @@ var ApprovalWorkflow = ({
|
|
|
3018
4394
|
}
|
|
3019
4395
|
)
|
|
3020
4396
|
] }),
|
|
3021
|
-
/* @__PURE__ */ jsx14("div", { className: "overflow-x-auto", children: stages.length === 0 ? /* @__PURE__ */
|
|
4397
|
+
/* @__PURE__ */ jsx14("div", { className: "overflow-x-auto", children: stages.length === 0 ? /* @__PURE__ */ jsxs11("div", { className: "text-center py-6 border-2 border-dashed border-[#D9D9D9] rounded-lg bg-[#FAFAFA]", children: [
|
|
3022
4398
|
/* @__PURE__ */ jsx14(Users, { className: "w-8 h-8 text-[#767676] mx-auto mb-4" }),
|
|
3023
4399
|
/* @__PURE__ */ jsx14("h3", { className: "text-lg font-medium text-[#191919] mb-2", children: "Aucune personne ajout\xE9e" }),
|
|
3024
4400
|
/* @__PURE__ */ jsx14("p", { className: "text-[#767676] mb-4", children: 'Cliquez sur le bouton "Ajouter une personne" pour commencer' })
|
|
3025
|
-
] }) : /* @__PURE__ */
|
|
3026
|
-
/* @__PURE__ */ jsx14("thead", { children: /* @__PURE__ */
|
|
4401
|
+
] }) : /* @__PURE__ */ jsxs11("table", { className: "w-full border-collapse", children: [
|
|
4402
|
+
/* @__PURE__ */ jsx14("thead", { children: /* @__PURE__ */ jsxs11("tr", { className: "bg-gray-100", children: [
|
|
3027
4403
|
/* @__PURE__ */ jsx14("th", { className: "border border-gray-300 px-2 py-2 text-left text-sm font-semibold w-10" }),
|
|
3028
4404
|
/* @__PURE__ */ jsx14("th", { className: "border border-gray-300 px-4 py-2 text-left text-sm font-semibold", children: "Etape" }),
|
|
3029
4405
|
/* @__PURE__ */ jsx14("th", { className: "border border-gray-300 px-4 py-2 text-left text-sm font-semibold", children: "Type" }),
|
|
@@ -3056,11 +4432,11 @@ var ApprovalWorkflow = ({
|
|
|
3056
4432
|
const renderTabContent = () => {
|
|
3057
4433
|
switch (activeTab) {
|
|
3058
4434
|
case "workflow":
|
|
3059
|
-
return /* @__PURE__ */
|
|
4435
|
+
return /* @__PURE__ */ jsxs11("div", { className: "space-y-6", children: [
|
|
3060
4436
|
renderStageSection("Verification", verification, setVerification, "verification"),
|
|
3061
4437
|
renderStageSection("Validation", validation, setValidation, "validation"),
|
|
3062
|
-
!readOnly && /* @__PURE__ */
|
|
3063
|
-
/* @__PURE__ */
|
|
4438
|
+
!readOnly && /* @__PURE__ */ jsxs11("div", { className: "flex justify-between pt-4 border-t border-[#D9D9D9]", children: [
|
|
4439
|
+
/* @__PURE__ */ jsxs11("div", { className: "flex gap-3", children: [
|
|
3064
4440
|
/* @__PURE__ */ jsx14(
|
|
3065
4441
|
SecondaryButton,
|
|
3066
4442
|
{
|
|
@@ -3069,8 +4445,8 @@ var ApprovalWorkflow = ({
|
|
|
3069
4445
|
children: "Retour"
|
|
3070
4446
|
}
|
|
3071
4447
|
),
|
|
3072
|
-
caseData?.id && formData.status !== "not-send" /* NOT_SEND */ && /* @__PURE__ */
|
|
3073
|
-
/* @__PURE__ */
|
|
4448
|
+
caseData?.id && formData.status !== "not-send" /* NOT_SEND */ && /* @__PURE__ */ jsxs11(Fragment6, { children: [
|
|
4449
|
+
/* @__PURE__ */ jsxs11(
|
|
3074
4450
|
SecondaryButton,
|
|
3075
4451
|
{
|
|
3076
4452
|
onClick: handleCancel,
|
|
@@ -3083,7 +4459,7 @@ var ApprovalWorkflow = ({
|
|
|
3083
4459
|
]
|
|
3084
4460
|
}
|
|
3085
4461
|
),
|
|
3086
|
-
/* @__PURE__ */
|
|
4462
|
+
/* @__PURE__ */ jsxs11(
|
|
3087
4463
|
SecondaryButton,
|
|
3088
4464
|
{
|
|
3089
4465
|
onClick: handleRestart,
|
|
@@ -3098,7 +4474,7 @@ var ApprovalWorkflow = ({
|
|
|
3098
4474
|
)
|
|
3099
4475
|
] })
|
|
3100
4476
|
] }),
|
|
3101
|
-
/* @__PURE__ */
|
|
4477
|
+
/* @__PURE__ */ jsxs11("div", { className: "flex gap-3", children: [
|
|
3102
4478
|
/* @__PURE__ */ jsx14(
|
|
3103
4479
|
Buttons_default,
|
|
3104
4480
|
{
|
|
@@ -3121,7 +4497,7 @@ var ApprovalWorkflow = ({
|
|
|
3121
4497
|
] })
|
|
3122
4498
|
] });
|
|
3123
4499
|
case "preview":
|
|
3124
|
-
return /* @__PURE__ */ jsx14("div", { className: "space-y-6", children: /* @__PURE__ */
|
|
4500
|
+
return /* @__PURE__ */ jsx14("div", { className: "space-y-6", children: /* @__PURE__ */ jsxs11("div", { className: "prose max-w-none", children: [
|
|
3125
4501
|
/* @__PURE__ */ jsx14("h3", { className: "text-lg font-semibold text-[#191919] mb-4", children: "Aper\xE7u du document" }),
|
|
3126
4502
|
caseData?.html_content ? /* @__PURE__ */ jsx14(
|
|
3127
4503
|
"div",
|
|
@@ -3129,20 +4505,20 @@ var ApprovalWorkflow = ({
|
|
|
3129
4505
|
className: "border border-[#D9D9D9] rounded-lg p-6 bg-white",
|
|
3130
4506
|
dangerouslySetInnerHTML: { __html: caseData.html_content }
|
|
3131
4507
|
}
|
|
3132
|
-
) : /* @__PURE__ */
|
|
3133
|
-
/* @__PURE__ */ jsx14(
|
|
4508
|
+
) : /* @__PURE__ */ jsxs11("div", { className: "text-center py-12 border-2 border-dashed border-[#D9D9D9] rounded-lg bg-[#FAFAFA]", children: [
|
|
4509
|
+
/* @__PURE__ */ jsx14(Eye3, { className: "w-12 h-12 text-[#767676] mx-auto mb-4" }),
|
|
3134
4510
|
/* @__PURE__ */ jsx14("p", { className: "text-[#767676]", children: "Aucun aper\xE7u disponible" })
|
|
3135
4511
|
] })
|
|
3136
4512
|
] }) });
|
|
3137
4513
|
case "history":
|
|
3138
|
-
return /* @__PURE__ */
|
|
4514
|
+
return /* @__PURE__ */ jsxs11("div", { className: "space-y-6", children: [
|
|
3139
4515
|
/* @__PURE__ */ jsx14("h3", { className: "text-lg font-semibold text-[#191919]", children: "Historique des versions" }),
|
|
3140
|
-
loadingHistory ? /* @__PURE__ */ jsx14("div", { className: "flex items-center justify-center py-12", children: /* @__PURE__ */ jsx14(Loader2, { className: "w-8 h-8 animate-spin text-[#6A8A82]" }) }) : history.length === 0 ? /* @__PURE__ */
|
|
4516
|
+
loadingHistory ? /* @__PURE__ */ jsx14("div", { className: "flex items-center justify-center py-12", children: /* @__PURE__ */ jsx14(Loader2, { className: "w-8 h-8 animate-spin text-[#6A8A82]" }) }) : history.length === 0 ? /* @__PURE__ */ jsxs11("div", { className: "text-center py-12 border-2 border-dashed border-[#D9D9D9] rounded-lg bg-[#FAFAFA]", children: [
|
|
3141
4517
|
/* @__PURE__ */ jsx14(History, { className: "w-12 h-12 text-[#767676] mx-auto mb-4" }),
|
|
3142
4518
|
/* @__PURE__ */ jsx14("p", { className: "text-[#767676]", children: "Aucun historique disponible" })
|
|
3143
|
-
] }) : /* @__PURE__ */ jsx14("div", { className: "space-y-4", children: history.map((item, index) => /* @__PURE__ */ jsx14("div", { className: "border border-[#D9D9D9] rounded-lg p-4 bg-white hover:shadow-md transition-shadow", children: /* @__PURE__ */ jsx14("div", { className: "flex items-start justify-between", children: /* @__PURE__ */
|
|
3144
|
-
/* @__PURE__ */
|
|
3145
|
-
/* @__PURE__ */
|
|
4519
|
+
] }) : /* @__PURE__ */ jsx14("div", { className: "space-y-4", children: history.map((item, index) => /* @__PURE__ */ jsx14("div", { className: "border border-[#D9D9D9] rounded-lg p-4 bg-white hover:shadow-md transition-shadow", children: /* @__PURE__ */ jsx14("div", { className: "flex items-start justify-between", children: /* @__PURE__ */ jsxs11("div", { className: "flex-1", children: [
|
|
4520
|
+
/* @__PURE__ */ jsxs11("div", { className: "flex items-center gap-3 mb-2", children: [
|
|
4521
|
+
/* @__PURE__ */ jsxs11("span", { className: "px-3 py-1 bg-[#6A8A82] text-white text-xs font-medium rounded-full", children: [
|
|
3146
4522
|
"Version ",
|
|
3147
4523
|
item.version
|
|
3148
4524
|
] }),
|
|
@@ -3150,8 +4526,8 @@ var ApprovalWorkflow = ({
|
|
|
3150
4526
|
] }),
|
|
3151
4527
|
/* @__PURE__ */ jsx14("h4", { className: "font-semibold text-[#191919] mb-1", children: item.title }),
|
|
3152
4528
|
/* @__PURE__ */ jsx14("p", { className: "text-sm text-[#767676] mb-2", children: item.description }),
|
|
3153
|
-
/* @__PURE__ */
|
|
3154
|
-
/* @__PURE__ */
|
|
4529
|
+
/* @__PURE__ */ jsxs11("div", { className: "flex items-center gap-4 text-xs text-[#767676]", children: [
|
|
4530
|
+
/* @__PURE__ */ jsxs11("span", { children: [
|
|
3155
4531
|
"Demand\xE9 par: ",
|
|
3156
4532
|
item.requested_by?.first_name,
|
|
3157
4533
|
" ",
|
|
@@ -3159,9 +4535,9 @@ var ApprovalWorkflow = ({
|
|
|
3159
4535
|
] }),
|
|
3160
4536
|
/* @__PURE__ */ jsx14("span", { children: "\u2022" }),
|
|
3161
4537
|
/* @__PURE__ */ jsx14("span", { children: new Date(item.created_at || "").toLocaleDateString("fr-FR") }),
|
|
3162
|
-
item.closed_at && /* @__PURE__ */
|
|
4538
|
+
item.closed_at && /* @__PURE__ */ jsxs11(Fragment6, { children: [
|
|
3163
4539
|
/* @__PURE__ */ jsx14("span", { children: "\u2022" }),
|
|
3164
|
-
/* @__PURE__ */
|
|
4540
|
+
/* @__PURE__ */ jsxs11("span", { children: [
|
|
3165
4541
|
"Cl\xF4tur\xE9 le: ",
|
|
3166
4542
|
new Date(item.closed_at).toLocaleDateString("fr-FR")
|
|
3167
4543
|
] })
|
|
@@ -3174,8 +4550,8 @@ var ApprovalWorkflow = ({
|
|
|
3174
4550
|
}
|
|
3175
4551
|
};
|
|
3176
4552
|
const formulaire = () => {
|
|
3177
|
-
return /* @__PURE__ */
|
|
3178
|
-
/* @__PURE__ */
|
|
4553
|
+
return /* @__PURE__ */ jsxs11("div", { children: [
|
|
4554
|
+
/* @__PURE__ */ jsxs11("div", { className: "grid grid-cols-1 md:grid-cols-3 gap-4", children: [
|
|
3179
4555
|
/* @__PURE__ */ jsx14("div", { className: "md:col-span-1", children: /* @__PURE__ */ jsx14(
|
|
3180
4556
|
TextInput,
|
|
3181
4557
|
{
|
|
@@ -3206,7 +4582,7 @@ var ApprovalWorkflow = ({
|
|
|
3206
4582
|
}
|
|
3207
4583
|
) })
|
|
3208
4584
|
] }),
|
|
3209
|
-
/* @__PURE__ */
|
|
4585
|
+
/* @__PURE__ */ jsxs11("div", { children: [
|
|
3210
4586
|
/* @__PURE__ */ jsx14("label", { className: "block text-[#191919] text-sm font-medium mb-2", children: "Description:" }),
|
|
3211
4587
|
/* @__PURE__ */ jsx14(
|
|
3212
4588
|
"textarea",
|
|
@@ -3221,8 +4597,8 @@ var ApprovalWorkflow = ({
|
|
|
3221
4597
|
}
|
|
3222
4598
|
)
|
|
3223
4599
|
] }),
|
|
3224
|
-
/* @__PURE__ */ jsx14("div", { className: "border-b border-[#D9D9D9] mb-6", children: /* @__PURE__ */
|
|
3225
|
-
/* @__PURE__ */
|
|
4600
|
+
/* @__PURE__ */ jsx14("div", { className: "border-b border-[#D9D9D9] mb-6", children: /* @__PURE__ */ jsxs11("nav", { className: "flex gap-1", children: [
|
|
4601
|
+
/* @__PURE__ */ jsxs11(
|
|
3226
4602
|
"button",
|
|
3227
4603
|
{
|
|
3228
4604
|
onClick: () => setActiveTab("workflow"),
|
|
@@ -3233,18 +4609,18 @@ var ApprovalWorkflow = ({
|
|
|
3233
4609
|
]
|
|
3234
4610
|
}
|
|
3235
4611
|
),
|
|
3236
|
-
/* @__PURE__ */
|
|
4612
|
+
/* @__PURE__ */ jsxs11(
|
|
3237
4613
|
"button",
|
|
3238
4614
|
{
|
|
3239
4615
|
onClick: () => setActiveTab("preview"),
|
|
3240
4616
|
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]"}`,
|
|
3241
4617
|
children: [
|
|
3242
|
-
/* @__PURE__ */ jsx14(
|
|
4618
|
+
/* @__PURE__ */ jsx14(Eye3, { className: "w-4 h-4" }),
|
|
3243
4619
|
"Aper\xE7u"
|
|
3244
4620
|
]
|
|
3245
4621
|
}
|
|
3246
4622
|
),
|
|
3247
|
-
/* @__PURE__ */
|
|
4623
|
+
/* @__PURE__ */ jsxs11(
|
|
3248
4624
|
"button",
|
|
3249
4625
|
{
|
|
3250
4626
|
onClick: () => setActiveTab("history"),
|
|
@@ -3260,7 +4636,7 @@ var ApprovalWorkflow = ({
|
|
|
3260
4636
|
] });
|
|
3261
4637
|
};
|
|
3262
4638
|
if (CustomBtn) {
|
|
3263
|
-
return /* @__PURE__ */
|
|
4639
|
+
return /* @__PURE__ */ jsxs11(Fragment6, { children: [
|
|
3264
4640
|
/* @__PURE__ */ jsx14(CustomBtn, { onClick: open_modal }),
|
|
3265
4641
|
/* @__PURE__ */ jsx14(Modals_default, { open: isOpen, onClose: close_modal, title, children: formulaire() })
|
|
3266
4642
|
] });
|
|
@@ -3268,14 +4644,14 @@ var ApprovalWorkflow = ({
|
|
|
3268
4644
|
return /* @__PURE__ */ jsx14(Fragment6, { children: /* @__PURE__ */ jsx14(
|
|
3269
4645
|
RewiseBasicCard,
|
|
3270
4646
|
{
|
|
3271
|
-
title: /* @__PURE__ */
|
|
4647
|
+
title: /* @__PURE__ */ jsxs11("div", { className: "flex items-center justify-between w-full", children: [
|
|
3272
4648
|
/* @__PURE__ */ jsx14("h2", { className: "text-xl font-semibold text-[#191919]", children: title }),
|
|
3273
4649
|
/* @__PURE__ */ jsx14(
|
|
3274
4650
|
"button",
|
|
3275
4651
|
{
|
|
3276
4652
|
className: "text-gray-500 hover:text-[#6A8A82] transition-colors",
|
|
3277
4653
|
onClick: () => window.history.back(),
|
|
3278
|
-
children: /* @__PURE__ */ jsx14(
|
|
4654
|
+
children: /* @__PURE__ */ jsx14(X7, { className: "w-5 h-5" })
|
|
3279
4655
|
}
|
|
3280
4656
|
)
|
|
3281
4657
|
] }),
|
|
@@ -3322,7 +4698,7 @@ var StageRow = ({
|
|
|
3322
4698
|
}
|
|
3323
4699
|
return /* @__PURE__ */ jsx14("span", { className: "text-gray-400 text-xs", children: "-" });
|
|
3324
4700
|
};
|
|
3325
|
-
return /* @__PURE__ */
|
|
4701
|
+
return /* @__PURE__ */ jsxs11("tr", { className: "hover:bg-gray-50", children: [
|
|
3326
4702
|
/* @__PURE__ */ jsx14("td", { className: "border border-gray-300 px-2 py-2 text-center", children: !readOnly && /* @__PURE__ */ jsx14(
|
|
3327
4703
|
"button",
|
|
3328
4704
|
{
|
|
@@ -3330,11 +4706,11 @@ var StageRow = ({
|
|
|
3330
4706
|
onClick: onRemove,
|
|
3331
4707
|
className: "text-[#B85450] hover:text-red-700 transition-colors",
|
|
3332
4708
|
title: "Supprimer",
|
|
3333
|
-
children: /* @__PURE__ */ jsx14(
|
|
4709
|
+
children: /* @__PURE__ */ jsx14(Trash22, { className: "w-4 h-4" })
|
|
3334
4710
|
}
|
|
3335
4711
|
) }),
|
|
3336
4712
|
/* @__PURE__ */ jsx14("td", { className: "border border-gray-300 px-4 py-2 text-center", children: index + 1 }),
|
|
3337
|
-
/* @__PURE__ */ jsx14("td", { className: "border border-gray-300 px-2 py-2", children: /* @__PURE__ */
|
|
4713
|
+
/* @__PURE__ */ jsx14("td", { className: "border border-gray-300 px-2 py-2", children: /* @__PURE__ */ jsxs11(
|
|
3338
4714
|
"select",
|
|
3339
4715
|
{
|
|
3340
4716
|
value: stage.space_answer,
|
|
@@ -3444,15 +4820,15 @@ var AddStageButton = ({
|
|
|
3444
4820
|
role: user.phonenumber || "-"
|
|
3445
4821
|
});
|
|
3446
4822
|
};
|
|
3447
|
-
return /* @__PURE__ */
|
|
3448
|
-
/* @__PURE__ */
|
|
4823
|
+
return /* @__PURE__ */ jsxs11(Fragment6, { children: [
|
|
4824
|
+
/* @__PURE__ */ jsxs11(
|
|
3449
4825
|
Buttons_default,
|
|
3450
4826
|
{
|
|
3451
4827
|
type: "button",
|
|
3452
4828
|
onClick: () => setShowModal(true),
|
|
3453
4829
|
classname: "gap-2",
|
|
3454
4830
|
children: [
|
|
3455
|
-
/* @__PURE__ */ jsx14(
|
|
4831
|
+
/* @__PURE__ */ jsx14(Plus3, { className: "w-4 h-4" }),
|
|
3456
4832
|
/* @__PURE__ */ jsx14("span", { children: "Ajouter une personne" })
|
|
3457
4833
|
]
|
|
3458
4834
|
}
|
|
@@ -3464,10 +4840,10 @@ var AddStageButton = ({
|
|
|
3464
4840
|
description: "S\xE9lectionnez un utilisateur interne ou ajoutez un validateur externe",
|
|
3465
4841
|
open: showModal,
|
|
3466
4842
|
onClose: () => setShowModal(false),
|
|
3467
|
-
children: /* @__PURE__ */
|
|
3468
|
-
/* @__PURE__ */
|
|
4843
|
+
children: /* @__PURE__ */ jsxs11("div", { className: "space-y-4 px-6 pb-6", children: [
|
|
4844
|
+
/* @__PURE__ */ jsxs11("div", { children: [
|
|
3469
4845
|
/* @__PURE__ */ jsx14("label", { className: "block text-sm font-medium text-[#191919] mb-2", children: "Type" }),
|
|
3470
|
-
/* @__PURE__ */
|
|
4846
|
+
/* @__PURE__ */ jsxs11(
|
|
3471
4847
|
"select",
|
|
3472
4848
|
{
|
|
3473
4849
|
value: newStage.space_answer,
|
|
@@ -3480,7 +4856,7 @@ var AddStageButton = ({
|
|
|
3480
4856
|
}
|
|
3481
4857
|
)
|
|
3482
4858
|
] }),
|
|
3483
|
-
/* @__PURE__ */
|
|
4859
|
+
/* @__PURE__ */ jsxs11("div", { children: [
|
|
3484
4860
|
/* @__PURE__ */ jsx14("label", { className: "block text-sm font-medium text-[#191919] mb-2", children: "Nom et pr\xE9noms" }),
|
|
3485
4861
|
newStage.space_answer === "internal" ? /* @__PURE__ */ jsx14(
|
|
3486
4862
|
SearchableSelect,
|
|
@@ -3504,7 +4880,7 @@ var AddStageButton = ({
|
|
|
3504
4880
|
}
|
|
3505
4881
|
)
|
|
3506
4882
|
] }),
|
|
3507
|
-
/* @__PURE__ */
|
|
4883
|
+
/* @__PURE__ */ jsxs11("div", { children: [
|
|
3508
4884
|
/* @__PURE__ */ jsx14("label", { className: "block text-sm font-medium text-[#191919] mb-2", children: "Email" }),
|
|
3509
4885
|
/* @__PURE__ */ jsx14(
|
|
3510
4886
|
"input",
|
|
@@ -3518,7 +4894,7 @@ var AddStageButton = ({
|
|
|
3518
4894
|
}
|
|
3519
4895
|
)
|
|
3520
4896
|
] }),
|
|
3521
|
-
newStage.space_answer === "internal" && /* @__PURE__ */
|
|
4897
|
+
newStage.space_answer === "internal" && /* @__PURE__ */ jsxs11("div", { children: [
|
|
3522
4898
|
/* @__PURE__ */ jsx14("label", { className: "block text-sm font-medium text-[#191919] mb-2", children: "Role" }),
|
|
3523
4899
|
/* @__PURE__ */ jsx14(
|
|
3524
4900
|
"input",
|
|
@@ -3530,7 +4906,7 @@ var AddStageButton = ({
|
|
|
3530
4906
|
}
|
|
3531
4907
|
)
|
|
3532
4908
|
] }),
|
|
3533
|
-
/* @__PURE__ */
|
|
4909
|
+
/* @__PURE__ */ jsxs11("div", { className: "flex justify-end gap-3 pt-4 border-t border-[#D9D9D9]", children: [
|
|
3534
4910
|
/* @__PURE__ */ jsx14(
|
|
3535
4911
|
SecondaryButton,
|
|
3536
4912
|
{
|
|
@@ -3560,7 +4936,7 @@ var ApprovalWorkflow_default = ApprovalWorkflow;
|
|
|
3560
4936
|
import { createContext as createContext4, useContext as useContext4, useState as useState11, useCallback as useCallback2 } from "react";
|
|
3561
4937
|
|
|
3562
4938
|
// src/components/common/Alert.tsx
|
|
3563
|
-
import { jsx as jsx15, jsxs as
|
|
4939
|
+
import { jsx as jsx15, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
3564
4940
|
var Alert = ({
|
|
3565
4941
|
title,
|
|
3566
4942
|
description,
|
|
@@ -3597,13 +4973,13 @@ var Alert = ({
|
|
|
3597
4973
|
return "bg-red-600 text-white hover:bg-red-700 focus:ring-red-500";
|
|
3598
4974
|
}
|
|
3599
4975
|
};
|
|
3600
|
-
return /* @__PURE__ */ jsx15("div", { className: "fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50", children: /* @__PURE__ */
|
|
4976
|
+
return /* @__PURE__ */ jsx15("div", { className: "fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50", children: /* @__PURE__ */ jsxs12("div", { className: "bg-white rounded-lg p-6 mx-4 w-full max-w-md shadow-xl", children: [
|
|
3601
4977
|
getIcon(),
|
|
3602
|
-
/* @__PURE__ */
|
|
4978
|
+
/* @__PURE__ */ jsxs12("div", { className: "mt-4 text-center", children: [
|
|
3603
4979
|
/* @__PURE__ */ jsx15("h3", { className: "text-lg font-semibold text-gray-900", children: title }),
|
|
3604
4980
|
description && /* @__PURE__ */ jsx15("p", { className: "mt-2 text-sm text-gray-600", children: description })
|
|
3605
4981
|
] }),
|
|
3606
|
-
/* @__PURE__ */
|
|
4982
|
+
/* @__PURE__ */ jsxs12("div", { className: "mt-6 flex flex-col-reverse sm:flex-row gap-3 sm:gap-4", children: [
|
|
3607
4983
|
/* @__PURE__ */ jsx15(
|
|
3608
4984
|
"button",
|
|
3609
4985
|
{
|
|
@@ -3628,7 +5004,7 @@ var Alert = ({
|
|
|
3628
5004
|
var Alert_default = Alert;
|
|
3629
5005
|
|
|
3630
5006
|
// src/contexts/AlertContext.tsx
|
|
3631
|
-
import { jsx as jsx16, jsxs as
|
|
5007
|
+
import { jsx as jsx16, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
3632
5008
|
var AlertContext = createContext4(void 0);
|
|
3633
5009
|
var AlertProvider = ({ children }) => {
|
|
3634
5010
|
const [alertState, setAlertState] = useState11({
|
|
@@ -3669,7 +5045,7 @@ var AlertProvider = ({ children }) => {
|
|
|
3669
5045
|
}
|
|
3670
5046
|
setAlertState((prev) => ({ ...prev, open: false }));
|
|
3671
5047
|
}, [alertState.resolve]);
|
|
3672
|
-
return /* @__PURE__ */
|
|
5048
|
+
return /* @__PURE__ */ jsxs13(AlertContext.Provider, { value: { showConfirmation, showAlert }, children: [
|
|
3673
5049
|
children,
|
|
3674
5050
|
/* @__PURE__ */ jsx16(
|
|
3675
5051
|
Alert_default,
|
|
@@ -3696,33 +5072,11 @@ var useAlert = () => {
|
|
|
3696
5072
|
};
|
|
3697
5073
|
|
|
3698
5074
|
// src/components/common/CommonSelect.tsx
|
|
3699
|
-
import { useEffect as
|
|
3700
|
-
|
|
3701
|
-
// src/services/VendorServices.ts
|
|
3702
|
-
var VENDORS_API_URL = `${API_URL}/accounting/vendors/`;
|
|
3703
|
-
var VendorServices = {
|
|
3704
|
-
createVendor: (data, token) => {
|
|
3705
|
-
const payload = { ...data };
|
|
3706
|
-
if (!payload.logo) {
|
|
3707
|
-
delete payload.logo;
|
|
3708
|
-
}
|
|
3709
|
-
return FetchApi.post(`${VENDORS_API_URL}`, payload, token);
|
|
3710
|
-
},
|
|
3711
|
-
getVendor: (id, token) => FetchApi.get(`${VENDORS_API_URL}${id}/`, token),
|
|
3712
|
-
getVendors: (token, params) => FetchApi.get(`${VENDORS_API_URL}?${new URLSearchParams(params).toString()}`, token),
|
|
3713
|
-
updateVendor: (id, data, token) => {
|
|
3714
|
-
const payload = { ...data };
|
|
3715
|
-
if (!payload.logo) {
|
|
3716
|
-
delete payload.logo;
|
|
3717
|
-
}
|
|
3718
|
-
return FetchApi.put(`${VENDORS_API_URL}${id}/`, payload, token);
|
|
3719
|
-
},
|
|
3720
|
-
deleteVendor: (id, token) => FetchApi.delete(`${VENDORS_API_URL}${id}/`, token)
|
|
3721
|
-
};
|
|
5075
|
+
import { useEffect as useEffect17, useState as useState27 } from "react";
|
|
3722
5076
|
|
|
3723
5077
|
// dist/index.js
|
|
3724
5078
|
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
3725
|
-
import { jsx as jsx22, jsxs as
|
|
5079
|
+
import { jsx as jsx22, jsxs as jsxs14 } from "react/jsx-runtime";
|
|
3726
5080
|
import { Link as Link3 } from "react-router-dom";
|
|
3727
5081
|
import { jsx as jsx32, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
3728
5082
|
import React42, { useState as useState52, useEffect as useEffect42 } from "react";
|
|
@@ -3736,11 +5090,12 @@ import {
|
|
|
3736
5090
|
User as User2,
|
|
3737
5091
|
LogOut as LogOut2,
|
|
3738
5092
|
Menu as Menu3,
|
|
3739
|
-
X as
|
|
5093
|
+
X as X32,
|
|
3740
5094
|
Palette as Palette2,
|
|
3741
5095
|
DollarSign as DollarSign2,
|
|
3742
|
-
HelpCircle as
|
|
3743
|
-
Building2 as Building22
|
|
5096
|
+
HelpCircle as HelpCircle22,
|
|
5097
|
+
Building2 as Building22,
|
|
5098
|
+
LayoutGrid as LayoutGrid2
|
|
3744
5099
|
} from "lucide-react";
|
|
3745
5100
|
import { clsx as clsx2 } from "clsx";
|
|
3746
5101
|
import { twMerge as twMerge2 } from "tailwind-merge";
|
|
@@ -3749,35 +5104,36 @@ import { jsx as jsx42 } from "react/jsx-runtime";
|
|
|
3749
5104
|
import { createContext as createContext22, useContext as useContext22, useEffect as useEffect22, useState as useState22 } from "react";
|
|
3750
5105
|
import { jsx as jsx52 } from "react/jsx-runtime";
|
|
3751
5106
|
import { createContext as createContext32, useContext as useContext32, useState as useState32, useCallback as useCallback3 } from "react";
|
|
3752
|
-
import {
|
|
5107
|
+
import { AlertTriangle as AlertTriangle3, HelpCircle as HelpCircle3, AlertCircle as AlertCircle4, X as X8 } from "lucide-react";
|
|
5108
|
+
import { jsx as jsx62, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
3753
5109
|
import { useState as useState42, useEffect as useEffect32 } from "react";
|
|
3754
|
-
import { jsx as jsx72, jsxs as
|
|
3755
|
-
import { X as
|
|
5110
|
+
import { jsx as jsx72, jsxs as jsxs42 } from "react/jsx-runtime";
|
|
5111
|
+
import { X as X22, Loader as Loader3, Eye as Eye4, FileText as FileText3, Check as Check2, XCircle as XCircle3, Edit as Edit2, CheckCircle as CheckCircle3, Clock as Clock2, AlertCircle as AlertCircle22, User as UserIcon2, Send as Send2 } from "lucide-react";
|
|
3756
5112
|
import { useParams as useParams2, useSearchParams as useSearchParams3 } from "react-router-dom";
|
|
3757
|
-
import { Fragment as Fragment7, jsx as jsx82, jsxs as
|
|
3758
|
-
import { Fragment as Fragment22, jsx as jsx92, jsxs as
|
|
5113
|
+
import { Fragment as Fragment7, jsx as jsx82, jsxs as jsxs52 } from "react/jsx-runtime";
|
|
5114
|
+
import { Fragment as Fragment22, jsx as jsx92, jsxs as jsxs62 } from "react/jsx-runtime";
|
|
3759
5115
|
import { useEffect as useEffect52, useState as useState62 } from "react";
|
|
3760
|
-
import { CheckCircle as
|
|
3761
|
-
import { jsx as jsx102, jsxs as
|
|
3762
|
-
import { ChevronLeft as ChevronLeft22, Download as Download3, Menu as Menu22, Settings as
|
|
5116
|
+
import { CheckCircle as CheckCircle23, XCircle as XCircle22, AlertTriangle as AlertTriangle22, Info as Info22, X as X42 } from "lucide-react";
|
|
5117
|
+
import { jsx as jsx102, jsxs as jsxs72 } from "react/jsx-runtime";
|
|
5118
|
+
import { ChevronLeft as ChevronLeft22, Download as Download3, Menu as Menu22, Settings as Settings23 } from "lucide-react";
|
|
3763
5119
|
import { useState as useState72 } from "react";
|
|
3764
|
-
import { Fragment as Fragment32, jsx as jsx112, jsxs as
|
|
3765
|
-
import { useEffect as useEffect62, useState as useState82 } from "react";
|
|
5120
|
+
import { Fragment as Fragment32, jsx as jsx112, jsxs as jsxs82 } from "react/jsx-runtime";
|
|
5121
|
+
import React72, { useEffect as useEffect62, useState as useState82, useRef as useRef3 } from "react";
|
|
3766
5122
|
import { useLocation as useLocation22, useNavigate as useNavigate22, useSearchParams as useSearchParams22, Link as Link22 } from "react-router-dom";
|
|
3767
|
-
import { ArrowDownAZ as ArrowDownAZ2, ArrowDownUp as ArrowDownUp2, ArrowUpAZ as ArrowUpAZ2, Download as Download22, Filter as Filter2, MoreVertical as MoreVertical2, Printer as Printer2, Search as Search22 } from "lucide-react";
|
|
3768
|
-
import { Fragment as Fragment42, jsx as jsx122, jsxs as
|
|
5123
|
+
import { ArrowDownAZ as ArrowDownAZ2, ArrowDownUp as ArrowDownUp2, ArrowUpAZ as ArrowUpAZ2, AlertCircle as AlertCircle32, CheckCircle2 as CheckCircle222, ChevronDown as ChevronDown3, Columns3 as Columns32, Copy as Copy2, Download as Download22, FileSpreadsheet as FileSpreadsheet2, Filter as Filter2, Maximize2 as Maximize22, Minimize2 as Minimize22, MoreVertical as MoreVertical2, Plus as Plus4, Printer as Printer2, RefreshCw as RefreshCw3, Settings2 as Settings222, Trash2 as Trash23, Upload as Upload2, X as X52, Search as Search22, SquareIcon as SquareIcon2 } from "lucide-react";
|
|
5124
|
+
import { Fragment as Fragment42, jsx as jsx122, jsxs as jsxs92 } from "react/jsx-runtime";
|
|
3769
5125
|
import { useState as useState102, useEffect as useEffect82 } from "react";
|
|
3770
|
-
import { useState as useState92, useRef as
|
|
3771
|
-
import { Search as Search32, ChevronDown as
|
|
3772
|
-
import { Fragment as Fragment52, jsx as jsx132, jsxs as
|
|
3773
|
-
import { X as
|
|
3774
|
-
import { Fragment as Fragment62, jsx as jsx142, jsxs as
|
|
5126
|
+
import { useState as useState92, useRef as useRef22, useEffect as useEffect72 } from "react";
|
|
5127
|
+
import { Search as Search32, ChevronDown as ChevronDown22, X as X62, RefreshCw as RefreshCw22, Plus as Plus22 } from "lucide-react";
|
|
5128
|
+
import { Fragment as Fragment52, jsx as jsx132, jsxs as jsxs102 } from "react/jsx-runtime";
|
|
5129
|
+
import { X as X72, Plus as Plus32, Trash2 as Trash222, Users as Users2, Loader as Loader22, RotateCcw as RotateCcw2, Ban as Ban2, Eye as Eye32, FileText as FileText22, History as History2 } from "lucide-react";
|
|
5130
|
+
import { Fragment as Fragment62, jsx as jsx142, jsxs as jsxs112 } from "react/jsx-runtime";
|
|
3775
5131
|
import { createContext as createContext42, useContext as useContext42, useState as useState112, useCallback as useCallback22 } from "react";
|
|
3776
|
-
import { jsx as jsx152, jsxs as
|
|
3777
|
-
import { jsx as jsx162, jsxs as
|
|
3778
|
-
import { useEffect as
|
|
5132
|
+
import { jsx as jsx152, jsxs as jsxs122 } from "react/jsx-runtime";
|
|
5133
|
+
import { jsx as jsx162, jsxs as jsxs132 } from "react/jsx-runtime";
|
|
5134
|
+
import { useEffect as useEffect16, useState as useState25 } from "react";
|
|
3779
5135
|
import { jsx as jsx172 } from "react/jsx-runtime";
|
|
3780
|
-
import { jsx as jsx222, jsxs as
|
|
5136
|
+
import { jsx as jsx222, jsxs as jsxs142 } from "react/jsx-runtime";
|
|
3781
5137
|
import { Link as Link32 } from "react-router-dom";
|
|
3782
5138
|
import { jsx as jsx322, jsxs as jsxs222 } from "react/jsx-runtime";
|
|
3783
5139
|
import React422, { useState as useState522, useEffect as useEffect422 } from "react";
|
|
@@ -3794,7 +5150,7 @@ import {
|
|
|
3794
5150
|
X as X222,
|
|
3795
5151
|
Palette as Palette22,
|
|
3796
5152
|
DollarSign as DollarSign22,
|
|
3797
|
-
HelpCircle as
|
|
5153
|
+
HelpCircle as HelpCircle32,
|
|
3798
5154
|
Building2 as Building222
|
|
3799
5155
|
} from "lucide-react";
|
|
3800
5156
|
import { clsx as clsx22 } from "clsx";
|
|
@@ -3807,14 +5163,14 @@ import { createContext as createContext322, useContext as useContext322, useStat
|
|
|
3807
5163
|
import { jsx as jsx622 } from "react/jsx-runtime";
|
|
3808
5164
|
import { useState as useState422, useEffect as useEffect322 } from "react";
|
|
3809
5165
|
import { jsx as jsx722, jsxs as jsxs322 } from "react/jsx-runtime";
|
|
3810
|
-
import { X as
|
|
5166
|
+
import { X as X82, Loader as Loader32, Eye as Eye42, FileText as FileText32, Check as Check22, XCircle as XCircle32, Edit as Edit22, CheckCircle as CheckCircle32, Clock as Clock22, AlertCircle as AlertCircle42, User as UserIcon22, Send as Send22 } from "lucide-react";
|
|
3811
5167
|
import { useParams as useParams22, useSearchParams as useSearchParams32 } from "react-router-dom";
|
|
3812
5168
|
import { Fragment as Fragment72, jsx as jsx822, jsxs as jsxs422 } from "react/jsx-runtime";
|
|
3813
5169
|
import { Fragment as Fragment222, jsx as jsx922, jsxs as jsxs522 } from "react/jsx-runtime";
|
|
3814
5170
|
import { useEffect as useEffect522, useState as useState622 } from "react";
|
|
3815
|
-
import { CheckCircle as
|
|
5171
|
+
import { CheckCircle as CheckCircle232, XCircle as XCircle222, AlertTriangle as AlertTriangle32, Info as Info3, X as X322 } from "lucide-react";
|
|
3816
5172
|
import { jsx as jsx1022, jsxs as jsxs622 } from "react/jsx-runtime";
|
|
3817
|
-
import { ChevronLeft as ChevronLeft222, Download as Download32, Menu as Menu222, Settings as
|
|
5173
|
+
import { ChevronLeft as ChevronLeft222, Download as Download32, Menu as Menu222, Settings as Settings232 } from "lucide-react";
|
|
3818
5174
|
import { useState as useState722 } from "react";
|
|
3819
5175
|
import { Fragment as Fragment322, jsx as jsx1122, jsxs as jsxs722 } from "react/jsx-runtime";
|
|
3820
5176
|
import { useEffect as useEffect622, useState as useState822 } from "react";
|
|
@@ -3822,15 +5178,15 @@ import { useLocation as useLocation222, useNavigate as useNavigate222, useSearch
|
|
|
3822
5178
|
import { ArrowDownAZ as ArrowDownAZ22, ArrowDownUp as ArrowDownUp22, ArrowUpAZ as ArrowUpAZ22, Download as Download222, Filter as Filter22, MoreVertical as MoreVertical22, Printer as Printer22, Search as Search222 } from "lucide-react";
|
|
3823
5179
|
import { Fragment as Fragment422, jsx as jsx1222, jsxs as jsxs822 } from "react/jsx-runtime";
|
|
3824
5180
|
import { useState as useState1022, useEffect as useEffect822 } from "react";
|
|
3825
|
-
import { useState as useState922, useRef as
|
|
3826
|
-
import { Search as Search322, ChevronDown as
|
|
5181
|
+
import { useState as useState922, useRef as useRef32, useEffect as useEffect722 } from "react";
|
|
5182
|
+
import { Search as Search322, ChevronDown as ChevronDown32, X as X422, RefreshCw as RefreshCw32, Plus as Plus42 } from "lucide-react";
|
|
3827
5183
|
import { Fragment as Fragment522, jsx as jsx1322, jsxs as jsxs922 } from "react/jsx-runtime";
|
|
3828
|
-
import { X as X522, Plus as Plus222, Trash2 as
|
|
5184
|
+
import { X as X522, Plus as Plus222, Trash2 as Trash232, Users as Users22, Loader as Loader222, RotateCcw as RotateCcw22, Ban as Ban22, Eye as Eye22, FileText as FileText222, History as History22 } from "lucide-react";
|
|
3829
5185
|
import { Fragment as Fragment622, jsx as jsx1422, jsxs as jsxs1022 } from "react/jsx-runtime";
|
|
3830
5186
|
import { createContext as createContext422, useContext as useContext422, useState as useState1122, useCallback as useCallback222 } from "react";
|
|
3831
5187
|
import { jsx as jsx1522, jsxs as jsxs1122 } from "react/jsx-runtime";
|
|
3832
5188
|
import { jsx as jsx1622, jsxs as jsxs1222 } from "react/jsx-runtime";
|
|
3833
|
-
import { useEffect as
|
|
5189
|
+
import { useEffect as useEffect15, useState as useState23 } from "react";
|
|
3834
5190
|
import { jsx as jsx1722 } from "react/jsx-runtime";
|
|
3835
5191
|
import { jsx as jsx2222, jsxs as jsxs1322 } from "react/jsx-runtime";
|
|
3836
5192
|
import { Link as Link322 } from "react-router-dom";
|
|
@@ -3880,12 +5236,12 @@ import { useState as useState10222, useEffect as useEffect8222 } from "react";
|
|
|
3880
5236
|
import { useState as useState9222, useRef as useRef222, useEffect as useEffect7222 } from "react";
|
|
3881
5237
|
import { Search as Search3222, ChevronDown as ChevronDown222, X as X4222, RefreshCw as RefreshCw222, Plus as Plus322 } from "lucide-react";
|
|
3882
5238
|
import { Fragment as Fragment5222, jsx as jsx13222, jsxs as jsxs9222 } from "react/jsx-runtime";
|
|
3883
|
-
import { X as X5222, Plus as Plus2222, Trash2 as Trash2222, Users as Users222, Loader as Loader2222, RotateCcw as RotateCcw222, Ban as Ban222, Eye as
|
|
5239
|
+
import { X as X5222, Plus as Plus2222, Trash2 as Trash2222, Users as Users222, Loader as Loader2222, RotateCcw as RotateCcw222, Ban as Ban222, Eye as Eye222, FileText as FileText2222, History as History222 } from "lucide-react";
|
|
3884
5240
|
import { Fragment as Fragment6222, jsx as jsx14222, jsxs as jsxs10222 } from "react/jsx-runtime";
|
|
3885
5241
|
import { createContext as createContext4222, useContext as useContext4222, useState as useState11222, useCallback as useCallback2222 } from "react";
|
|
3886
5242
|
import { jsx as jsx15222, jsxs as jsxs11222 } from "react/jsx-runtime";
|
|
3887
5243
|
import { jsx as jsx16222, jsxs as jsxs12222 } from "react/jsx-runtime";
|
|
3888
|
-
import { useEffect as
|
|
5244
|
+
import { useEffect as useEffect14, useState as useState20 } from "react";
|
|
3889
5245
|
import { jsx as jsx17222 } from "react/jsx-runtime";
|
|
3890
5246
|
import { jsx as jsx22222, jsxs as jsxs13222 } from "react/jsx-runtime";
|
|
3891
5247
|
import { Link as Link3222 } from "react-router-dom";
|
|
@@ -3933,15 +5289,180 @@ import { ArrowDownAZ as ArrowDownAZ2222, ArrowDownUp as ArrowDownUp2222, ArrowUp
|
|
|
3933
5289
|
import { Fragment as Fragment42222, jsx as jsx122222, jsxs as jsxs82222 } from "react/jsx-runtime";
|
|
3934
5290
|
import { useState as useState102222, useEffect as useEffect82222 } from "react";
|
|
3935
5291
|
import { useState as useState92222, useRef as useRef2222, useEffect as useEffect72222 } from "react";
|
|
3936
|
-
import { Search as Search32222, ChevronDown as ChevronDown2222, X as X42222 } from "lucide-react";
|
|
5292
|
+
import { Search as Search32222, ChevronDown as ChevronDown2222, X as X42222, RefreshCw as RefreshCw2222, Plus as Plus3222 } from "lucide-react";
|
|
3937
5293
|
import { Fragment as Fragment52222, jsx as jsx132222, jsxs as jsxs92222 } from "react/jsx-runtime";
|
|
3938
|
-
import { X as X52222, Plus as
|
|
5294
|
+
import { X as X52222, Plus as Plus22222, Trash2 as Trash22222, Users as Users2222, Loader as Loader22222, RotateCcw as RotateCcw2222, Ban as Ban2222, Eye as Eye2222, FileText as FileText22222, History as History2222 } from "lucide-react";
|
|
3939
5295
|
import { Fragment as Fragment62222, jsx as jsx142222, jsxs as jsxs102222 } from "react/jsx-runtime";
|
|
3940
5296
|
import { createContext as createContext42222, useContext as useContext42222, useState as useState112222, useCallback as useCallback22222 } from "react";
|
|
3941
5297
|
import { jsx as jsx152222, jsxs as jsxs112222 } from "react/jsx-runtime";
|
|
3942
5298
|
import { jsx as jsx162222, jsxs as jsxs122222 } from "react/jsx-runtime";
|
|
5299
|
+
import { useEffect as useEffect13, useState as useState18 } from "react";
|
|
5300
|
+
import { jsx as jsx172222 } from "react/jsx-runtime";
|
|
5301
|
+
import { jsx as jsx222222, jsxs as jsxs132222 } from "react/jsx-runtime";
|
|
5302
|
+
import { Link as Link32222 } from "react-router-dom";
|
|
5303
|
+
import { jsx as jsx322222, jsxs as jsxs222222 } from "react/jsx-runtime";
|
|
5304
|
+
import React422222, { useState as useState522222, useEffect as useEffect422222 } from "react";
|
|
5305
|
+
import { useLocation as useLocation32222, useNavigate as useNavigate32222 } from "react-router-dom";
|
|
5306
|
+
import {
|
|
5307
|
+
Settings as Settings32222,
|
|
5308
|
+
ChevronLeft as ChevronLeft32222,
|
|
5309
|
+
ChevronRight as ChevronRight22222,
|
|
5310
|
+
Search as Search42222,
|
|
5311
|
+
Bell as Bell22222,
|
|
5312
|
+
User as User22222,
|
|
5313
|
+
LogOut as LogOut22222,
|
|
5314
|
+
Menu as Menu32222,
|
|
5315
|
+
X as X222222,
|
|
5316
|
+
Palette as Palette22222,
|
|
5317
|
+
DollarSign as DollarSign22222,
|
|
5318
|
+
HelpCircle as HelpCircle22222,
|
|
5319
|
+
Building2 as Building222222
|
|
5320
|
+
} from "lucide-react";
|
|
5321
|
+
import { clsx as clsx22222 } from "clsx";
|
|
5322
|
+
import { twMerge as twMerge22222 } from "tailwind-merge";
|
|
5323
|
+
import { createContext as createContext52222, useContext as useContext52222, useState as useState122222, useEffect as useEffect92222 } from "react";
|
|
5324
|
+
import { jsx as jsx422222 } from "react/jsx-runtime";
|
|
5325
|
+
import { createContext as createContext222222, useContext as useContext222222, useEffect as useEffect222222, useState as useState222222 } from "react";
|
|
5326
|
+
import { jsx as jsx522222 } from "react/jsx-runtime";
|
|
5327
|
+
import { createContext as createContext322222, useContext as useContext322222, useState as useState322222, useCallback as useCallback32222 } from "react";
|
|
5328
|
+
import { jsx as jsx622222 } from "react/jsx-runtime";
|
|
5329
|
+
import { useState as useState422222, useEffect as useEffect322222 } from "react";
|
|
5330
|
+
import { jsx as jsx722222, jsxs as jsxs322222 } from "react/jsx-runtime";
|
|
5331
|
+
import { X as X62222, Loader as Loader32222, Eye as Eye32222, FileText as FileText32222, Check as Check22222, XCircle as XCircle32222, Edit as Edit22222, CheckCircle as CheckCircle32222, Clock as Clock22222, AlertCircle as AlertCircle22222, User as UserIcon22222, Send as Send22222 } from "lucide-react";
|
|
5332
|
+
import { useParams as useParams22222, useSearchParams as useSearchParams32222 } from "react-router-dom";
|
|
5333
|
+
import { Fragment as Fragment72222, jsx as jsx822222, jsxs as jsxs422222 } from "react/jsx-runtime";
|
|
5334
|
+
import { Fragment as Fragment222222, jsx as jsx922222, jsxs as jsxs522222 } from "react/jsx-runtime";
|
|
5335
|
+
import { useEffect as useEffect522222, useState as useState622222 } from "react";
|
|
5336
|
+
import { CheckCircle as CheckCircle222222, XCircle as XCircle222222, AlertTriangle as AlertTriangle22222, Info as Info22222, X as X322222 } from "lucide-react";
|
|
5337
|
+
import { jsx as jsx1022222, jsxs as jsxs622222 } from "react/jsx-runtime";
|
|
5338
|
+
import { ChevronLeft as ChevronLeft222222, Download as Download32222, Menu as Menu222222, Settings as Settings222222 } from "lucide-react";
|
|
5339
|
+
import { useState as useState722222 } from "react";
|
|
5340
|
+
import { Fragment as Fragment322222, jsx as jsx1122222, jsxs as jsxs722222 } from "react/jsx-runtime";
|
|
5341
|
+
import { useEffect as useEffect622222, useState as useState822222 } from "react";
|
|
5342
|
+
import { useLocation as useLocation222222, useNavigate as useNavigate222222, useSearchParams as useSearchParams222222, Link as Link222222 } from "react-router-dom";
|
|
5343
|
+
import { ArrowDownAZ as ArrowDownAZ22222, ArrowDownUp as ArrowDownUp22222, ArrowUpAZ as ArrowUpAZ22222, Download as Download222222, Filter as Filter22222, MoreVertical as MoreVertical22222, Printer as Printer22222, Search as Search222222 } from "lucide-react";
|
|
5344
|
+
import { Fragment as Fragment422222, jsx as jsx1222222, jsxs as jsxs822222 } from "react/jsx-runtime";
|
|
5345
|
+
import { useState as useState1022222, useEffect as useEffect822222 } from "react";
|
|
5346
|
+
import { useState as useState922222, useRef as useRef22222, useEffect as useEffect722222 } from "react";
|
|
5347
|
+
import { Search as Search322222, ChevronDown as ChevronDown22222, X as X422222, RefreshCw as RefreshCw22222, Plus as Plus32222 } from "lucide-react";
|
|
5348
|
+
import { Fragment as Fragment522222, jsx as jsx1322222, jsxs as jsxs922222 } from "react/jsx-runtime";
|
|
5349
|
+
import { X as X522222, Plus as Plus222222, Trash2 as Trash222222, Users as Users22222, Loader as Loader222222, RotateCcw as RotateCcw22222, Ban as Ban22222, Eye as Eye22222, FileText as FileText222222, History as History22222 } from "lucide-react";
|
|
5350
|
+
import { Fragment as Fragment622222, jsx as jsx1422222, jsxs as jsxs1022222 } from "react/jsx-runtime";
|
|
5351
|
+
import { createContext as createContext422222, useContext as useContext422222, useState as useState1122222, useCallback as useCallback222222 } from "react";
|
|
5352
|
+
import { jsx as jsx1522222, jsxs as jsxs1122222 } from "react/jsx-runtime";
|
|
5353
|
+
import { jsx as jsx1622222, jsxs as jsxs1222222 } from "react/jsx-runtime";
|
|
5354
|
+
import { useEffect as useEffect12, useState as useState16 } from "react";
|
|
5355
|
+
import { jsx as jsx1722222 } from "react/jsx-runtime";
|
|
5356
|
+
import { jsx as jsx2222222, jsxs as jsxs1322222 } from "react/jsx-runtime";
|
|
5357
|
+
import { Link as Link322222 } from "react-router-dom";
|
|
5358
|
+
import { jsx as jsx3222222, jsxs as jsxs2222222 } from "react/jsx-runtime";
|
|
5359
|
+
import React4222222, { useState as useState5222222, useEffect as useEffect4222222 } from "react";
|
|
5360
|
+
import { useLocation as useLocation322222, useNavigate as useNavigate322222 } from "react-router-dom";
|
|
5361
|
+
import {
|
|
5362
|
+
Settings as Settings322222,
|
|
5363
|
+
ChevronLeft as ChevronLeft322222,
|
|
5364
|
+
ChevronRight as ChevronRight222222,
|
|
5365
|
+
Search as Search422222,
|
|
5366
|
+
Bell as Bell222222,
|
|
5367
|
+
User as User222222,
|
|
5368
|
+
LogOut as LogOut222222,
|
|
5369
|
+
Menu as Menu322222,
|
|
5370
|
+
X as X2222222,
|
|
5371
|
+
Palette as Palette222222,
|
|
5372
|
+
DollarSign as DollarSign222222,
|
|
5373
|
+
HelpCircle as HelpCircle222222,
|
|
5374
|
+
Building2 as Building2222222
|
|
5375
|
+
} from "lucide-react";
|
|
5376
|
+
import { clsx as clsx222222 } from "clsx";
|
|
5377
|
+
import { twMerge as twMerge222222 } from "tailwind-merge";
|
|
5378
|
+
import { createContext as createContext522222, useContext as useContext522222, useState as useState1222222, useEffect as useEffect922222 } from "react";
|
|
5379
|
+
import { jsx as jsx4222222 } from "react/jsx-runtime";
|
|
5380
|
+
import { createContext as createContext2222222, useContext as useContext2222222, useEffect as useEffect2222222, useState as useState2222222 } from "react";
|
|
5381
|
+
import { jsx as jsx5222222 } from "react/jsx-runtime";
|
|
5382
|
+
import { createContext as createContext3222222, useContext as useContext3222222, useState as useState3222222, useCallback as useCallback322222 } from "react";
|
|
5383
|
+
import { jsx as jsx6222222 } from "react/jsx-runtime";
|
|
5384
|
+
import { useState as useState4222222, useEffect as useEffect3222222 } from "react";
|
|
5385
|
+
import { jsx as jsx7222222, jsxs as jsxs3222222 } from "react/jsx-runtime";
|
|
5386
|
+
import { X as X622222, Loader as Loader322222, Eye as Eye322222, FileText as FileText322222, Check as Check222222, XCircle as XCircle322222, Edit as Edit222222, CheckCircle as CheckCircle322222, Clock as Clock222222, AlertCircle as AlertCircle222222, User as UserIcon222222, Send as Send222222 } from "lucide-react";
|
|
5387
|
+
import { useParams as useParams222222, useSearchParams as useSearchParams322222 } from "react-router-dom";
|
|
5388
|
+
import { Fragment as Fragment722222, jsx as jsx8222222, jsxs as jsxs4222222 } from "react/jsx-runtime";
|
|
5389
|
+
import { Fragment as Fragment2222222, jsx as jsx9222222, jsxs as jsxs5222222 } from "react/jsx-runtime";
|
|
5390
|
+
import { useEffect as useEffect5222222, useState as useState6222222 } from "react";
|
|
5391
|
+
import { CheckCircle as CheckCircle2222222, XCircle as XCircle2222222, AlertTriangle as AlertTriangle222222, Info as Info222222, X as X3222222 } from "lucide-react";
|
|
5392
|
+
import { jsx as jsx10222222, jsxs as jsxs6222222 } from "react/jsx-runtime";
|
|
5393
|
+
import { ChevronLeft as ChevronLeft2222222, Download as Download322222, Menu as Menu2222222, Settings as Settings2222222 } from "lucide-react";
|
|
5394
|
+
import { useState as useState7222222 } from "react";
|
|
5395
|
+
import { Fragment as Fragment3222222, jsx as jsx11222222, jsxs as jsxs7222222 } from "react/jsx-runtime";
|
|
5396
|
+
import { useEffect as useEffect6222222, useState as useState8222222 } from "react";
|
|
5397
|
+
import { useLocation as useLocation2222222, useNavigate as useNavigate2222222, useSearchParams as useSearchParams2222222, Link as Link2222222 } from "react-router-dom";
|
|
5398
|
+
import { ArrowDownAZ as ArrowDownAZ222222, ArrowDownUp as ArrowDownUp222222, ArrowUpAZ as ArrowUpAZ222222, Download as Download2222222, Filter as Filter222222, MoreVertical as MoreVertical222222, Printer as Printer222222, Search as Search2222222 } from "lucide-react";
|
|
5399
|
+
import { Fragment as Fragment4222222, jsx as jsx12222222, jsxs as jsxs8222222 } from "react/jsx-runtime";
|
|
5400
|
+
import { useState as useState10222222, useEffect as useEffect8222222 } from "react";
|
|
5401
|
+
import { useState as useState9222222, useRef as useRef222222, useEffect as useEffect7222222 } from "react";
|
|
5402
|
+
import { Search as Search3222222, ChevronDown as ChevronDown222222, X as X4222222, RefreshCw as RefreshCw222222, Plus as Plus322222 } from "lucide-react";
|
|
5403
|
+
import { Fragment as Fragment5222222, jsx as jsx13222222, jsxs as jsxs9222222 } from "react/jsx-runtime";
|
|
5404
|
+
import { X as X5222222, Plus as Plus2222222, Trash2 as Trash2222222, Users as Users222222, Loader as Loader2222222, RotateCcw as RotateCcw222222, Ban as Ban222222, Eye as Eye222222, FileText as FileText2222222, History as History222222 } from "lucide-react";
|
|
5405
|
+
import { Fragment as Fragment6222222, jsx as jsx14222222, jsxs as jsxs10222222 } from "react/jsx-runtime";
|
|
5406
|
+
import { createContext as createContext4222222, useContext as useContext4222222, useState as useState11222222, useCallback as useCallback2222222 } from "react";
|
|
5407
|
+
import { jsx as jsx15222222, jsxs as jsxs11222222 } from "react/jsx-runtime";
|
|
5408
|
+
import { jsx as jsx16222222, jsxs as jsxs12222222 } from "react/jsx-runtime";
|
|
5409
|
+
import { useEffect as useEffect11, useState as useState14 } from "react";
|
|
5410
|
+
import { jsx as jsx17222222 } from "react/jsx-runtime";
|
|
5411
|
+
import { jsx as jsx22222222, jsxs as jsxs13222222 } from "react/jsx-runtime";
|
|
5412
|
+
import { Link as Link3222222 } from "react-router-dom";
|
|
5413
|
+
import { jsx as jsx32222222, jsxs as jsxs22222222 } from "react/jsx-runtime";
|
|
5414
|
+
import React42222222, { useState as useState52222222, useEffect as useEffect42222222 } from "react";
|
|
5415
|
+
import { useLocation as useLocation3222222, useNavigate as useNavigate3222222 } from "react-router-dom";
|
|
5416
|
+
import {
|
|
5417
|
+
Settings as Settings3222222,
|
|
5418
|
+
ChevronLeft as ChevronLeft3222222,
|
|
5419
|
+
ChevronRight as ChevronRight2222222,
|
|
5420
|
+
Search as Search4222222,
|
|
5421
|
+
Bell as Bell2222222,
|
|
5422
|
+
User as User2222222,
|
|
5423
|
+
LogOut as LogOut2222222,
|
|
5424
|
+
Menu as Menu3222222,
|
|
5425
|
+
X as X22222222,
|
|
5426
|
+
Palette as Palette2222222,
|
|
5427
|
+
DollarSign as DollarSign2222222,
|
|
5428
|
+
HelpCircle as HelpCircle2222222,
|
|
5429
|
+
Building2 as Building22222222
|
|
5430
|
+
} from "lucide-react";
|
|
5431
|
+
import { clsx as clsx2222222 } from "clsx";
|
|
5432
|
+
import { twMerge as twMerge2222222 } from "tailwind-merge";
|
|
5433
|
+
import { createContext as createContext5222222, useContext as useContext5222222, useState as useState12222222, useEffect as useEffect9222222 } from "react";
|
|
5434
|
+
import { jsx as jsx42222222 } from "react/jsx-runtime";
|
|
5435
|
+
import { createContext as createContext22222222, useContext as useContext22222222, useEffect as useEffect22222222, useState as useState22222222 } from "react";
|
|
5436
|
+
import { jsx as jsx52222222 } from "react/jsx-runtime";
|
|
5437
|
+
import { createContext as createContext32222222, useContext as useContext32222222, useState as useState32222222, useCallback as useCallback3222222 } from "react";
|
|
5438
|
+
import { jsx as jsx62222222 } from "react/jsx-runtime";
|
|
5439
|
+
import { useState as useState42222222, useEffect as useEffect32222222 } from "react";
|
|
5440
|
+
import { jsx as jsx72222222, jsxs as jsxs32222222 } from "react/jsx-runtime";
|
|
5441
|
+
import { X as X6222222, Loader as Loader3222222, Eye as Eye3222222, FileText as FileText3222222, Check as Check2222222, XCircle as XCircle3222222, Edit as Edit2222222, CheckCircle as CheckCircle3222222, Clock as Clock2222222, AlertCircle as AlertCircle2222222, User as UserIcon2222222, Send as Send2222222 } from "lucide-react";
|
|
5442
|
+
import { useParams as useParams2222222, useSearchParams as useSearchParams3222222 } from "react-router-dom";
|
|
5443
|
+
import { Fragment as Fragment7222222, jsx as jsx82222222, jsxs as jsxs42222222 } from "react/jsx-runtime";
|
|
5444
|
+
import { Fragment as Fragment22222222, jsx as jsx92222222, jsxs as jsxs52222222 } from "react/jsx-runtime";
|
|
5445
|
+
import { useEffect as useEffect52222222, useState as useState62222222 } from "react";
|
|
5446
|
+
import { CheckCircle as CheckCircle22222222, XCircle as XCircle22222222, AlertTriangle as AlertTriangle2222222, Info as Info2222222, X as X32222222 } from "lucide-react";
|
|
5447
|
+
import { jsx as jsx102222222, jsxs as jsxs62222222 } from "react/jsx-runtime";
|
|
5448
|
+
import { ChevronLeft as ChevronLeft22222222, Download as Download3222222, Menu as Menu22222222, Settings as Settings22222222 } from "lucide-react";
|
|
5449
|
+
import { useState as useState72222222 } from "react";
|
|
5450
|
+
import { Fragment as Fragment32222222, jsx as jsx112222222, jsxs as jsxs72222222 } from "react/jsx-runtime";
|
|
5451
|
+
import { useEffect as useEffect62222222, useState as useState82222222 } from "react";
|
|
5452
|
+
import { useLocation as useLocation22222222, useNavigate as useNavigate22222222, useSearchParams as useSearchParams22222222, Link as Link22222222 } from "react-router-dom";
|
|
5453
|
+
import { ArrowDownAZ as ArrowDownAZ2222222, ArrowDownUp as ArrowDownUp2222222, ArrowUpAZ as ArrowUpAZ2222222, Download as Download22222222, Filter as Filter2222222, MoreVertical as MoreVertical2222222, Printer as Printer2222222, Search as Search22222222 } from "lucide-react";
|
|
5454
|
+
import { Fragment as Fragment42222222, jsx as jsx122222222, jsxs as jsxs82222222 } from "react/jsx-runtime";
|
|
5455
|
+
import { useState as useState102222222, useEffect as useEffect82222222 } from "react";
|
|
5456
|
+
import { useState as useState92222222, useRef as useRef2222222, useEffect as useEffect72222222 } from "react";
|
|
5457
|
+
import { Search as Search32222222, ChevronDown as ChevronDown2222222, X as X42222222 } from "lucide-react";
|
|
5458
|
+
import { Fragment as Fragment52222222, jsx as jsx132222222, jsxs as jsxs92222222 } from "react/jsx-runtime";
|
|
5459
|
+
import { X as X52222222, Plus as Plus3222222, Trash2 as Trash22222222, Users as Users2222222, Loader as Loader22222222, RotateCcw as RotateCcw2222222, Ban as Ban2222222, Eye as Eye2222222, FileText as FileText22222222, History as History2222222 } from "lucide-react";
|
|
5460
|
+
import { Fragment as Fragment62222222, jsx as jsx142222222, jsxs as jsxs102222222 } from "react/jsx-runtime";
|
|
5461
|
+
import { createContext as createContext42222222, useContext as useContext42222222, useState as useState112222222, useCallback as useCallback22222222 } from "react";
|
|
5462
|
+
import { jsx as jsx152222222, jsxs as jsxs112222222 } from "react/jsx-runtime";
|
|
5463
|
+
import { jsx as jsx162222222, jsxs as jsxs122222222 } from "react/jsx-runtime";
|
|
3943
5464
|
import { useState as useState13 } from "react";
|
|
3944
|
-
import { jsx as jsx18, jsxs as
|
|
5465
|
+
import { jsx as jsx18, jsxs as jsxs1422 } from "react/jsx-runtime";
|
|
3945
5466
|
import { jsx as jsx19, jsxs as jsxs15 } from "react/jsx-runtime";
|
|
3946
5467
|
import { useState as useState15 } from "react";
|
|
3947
5468
|
import { jsx as jsx20, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
@@ -3951,6 +5472,18 @@ import { useState as useState17 } from "react";
|
|
|
3951
5472
|
import { jsx as jsx24, jsxs as jsxs18 } from "react/jsx-runtime";
|
|
3952
5473
|
import { jsx as jsx25, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
3953
5474
|
import { jsx as jsx26 } from "react/jsx-runtime";
|
|
5475
|
+
import { useState as useState19 } from "react";
|
|
5476
|
+
import { jsx as jsx27, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
5477
|
+
import { jsx as jsx28, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
5478
|
+
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
5479
|
+
import { useState as useState21 } from "react";
|
|
5480
|
+
import { jsx as jsx30, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
5481
|
+
import { jsx as jsx31, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
5482
|
+
import { jsx as jsx33 } from "react/jsx-runtime";
|
|
5483
|
+
import { useState as useState24 } from "react";
|
|
5484
|
+
import { jsx as jsx34, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
5485
|
+
import { jsx as jsx35, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
5486
|
+
import { jsx as jsx36 } from "react/jsx-runtime";
|
|
3954
5487
|
var PrimaryButton2 = ({
|
|
3955
5488
|
loading = false,
|
|
3956
5489
|
children,
|
|
@@ -3968,11 +5501,11 @@ var PrimaryButton2 = ({
|
|
|
3968
5501
|
}
|
|
3969
5502
|
);
|
|
3970
5503
|
var Buttons_default2 = PrimaryButton2;
|
|
3971
|
-
var Modal2 = ({ title, description, width, open, onClose, children }) => {
|
|
5504
|
+
var Modal2 = ({ title, description, width = "max-w-lg", open, onClose, children }) => {
|
|
3972
5505
|
if (!open) return null;
|
|
3973
|
-
return /* @__PURE__ */ jsx22("div", { className: "fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50", children: /* @__PURE__ */
|
|
3974
|
-
/* @__PURE__ */
|
|
3975
|
-
/* @__PURE__ */
|
|
5506
|
+
return /* @__PURE__ */ jsx22("div", { className: "fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50", children: /* @__PURE__ */ jsxs14("div", { className: `bg-white rounded-lg p-6 mx-4 w-full ${width}`, children: [
|
|
5507
|
+
/* @__PURE__ */ jsxs14("div", { className: "flex justify-between items-start mb-6", children: [
|
|
5508
|
+
/* @__PURE__ */ jsxs14("div", { children: [
|
|
3976
5509
|
/* @__PURE__ */ jsx22("h3", { className: "text-xl font-semibold text-tuatara flex items-center space-x-2", children: /* @__PURE__ */ jsx22("span", { children: title }) }),
|
|
3977
5510
|
description && /* @__PURE__ */ jsx22("p", { className: "text-sm text-gray-600 mt-1", children: description })
|
|
3978
5511
|
] }),
|
|
@@ -3986,7 +5519,7 @@ var Modal2 = ({ title, description, width, open, onClose, children }) => {
|
|
|
3986
5519
|
}
|
|
3987
5520
|
)
|
|
3988
5521
|
] }),
|
|
3989
|
-
/* @__PURE__ */ jsx22("div", { className: "w-full max-h-[80vh] overflow-y-auto
|
|
5522
|
+
/* @__PURE__ */ jsx22("div", { className: "w-full max-h-[80vh] overflow-y-auto", children })
|
|
3990
5523
|
] }) });
|
|
3991
5524
|
};
|
|
3992
5525
|
var Modals_default2 = Modal2;
|
|
@@ -4038,16 +5571,17 @@ var ADDRESS_IP2 = chooseEnv2 === "prod" ? "back.rewise.praeduim-tech.com" : "loc
|
|
|
4038
5571
|
var ADDRESS_IP_URL2 = chooseEnv2 === "prod" ? `https://${ADDRESS_IP2}/` : `http://${ADDRESS_IP2}/`;
|
|
4039
5572
|
var API_URL2 = `${ADDRESS_IP_URL2}api`;
|
|
4040
5573
|
var API_BASE_URL3 = `${API_URL2}/core/auth/`;
|
|
5574
|
+
var VENDORS_API_URL2 = `${API_URL2}/accounting/vendors/`;
|
|
4041
5575
|
var SessionContext2 = createContext22(void 0);
|
|
4042
5576
|
var API_BASE_URL22 = `${API_URL2}/core/auth/`;
|
|
4043
5577
|
var USERS_API_URL2 = `${API_URL2}/core/users/`;
|
|
4044
5578
|
var ToastContext2 = createContext32(void 0);
|
|
4045
5579
|
var APPROVAL_API_URL2 = `${API_URL2}/approvals/cases/`;
|
|
4046
5580
|
var AlertContext2 = createContext42(void 0);
|
|
4047
|
-
var VENDORS_API_URL2 = `${API_URL2}/accounting/vendors/`;
|
|
4048
5581
|
var ThemeContext22 = createContext52(void 0);
|
|
4049
|
-
var
|
|
4050
|
-
var
|
|
5582
|
+
var chooseEnv22 = localStorage.getItem("env") ?? "prod";
|
|
5583
|
+
var ADDRESS_IP22 = chooseEnv22 === "prod" ? "back.rewise.praeduim-tech.com" : "localhost:8000";
|
|
5584
|
+
var ADDRESS_IP_URL22 = chooseEnv22 === "prod" ? `https://${ADDRESS_IP22}/` : `http://${ADDRESS_IP22}/`;
|
|
4051
5585
|
var API_URL22 = `${ADDRESS_IP_URL22}api`;
|
|
4052
5586
|
var API_BASE_URL32 = `${API_URL22}/core/auth/`;
|
|
4053
5587
|
var SessionContext22 = createContext222(void 0);
|
|
@@ -4058,8 +5592,9 @@ var APPROVAL_API_URL22 = `${API_URL22}/approvals/cases/`;
|
|
|
4058
5592
|
var AlertContext22 = createContext422(void 0);
|
|
4059
5593
|
var VENDORS_API_URL22 = `${API_URL22}/accounting/vendors/`;
|
|
4060
5594
|
var ThemeContext222 = createContext522(void 0);
|
|
4061
|
-
var
|
|
4062
|
-
var
|
|
5595
|
+
var chooseEnv222 = localStorage.getItem("env") ?? "prod";
|
|
5596
|
+
var ADDRESS_IP222 = chooseEnv222 === "prod" ? "back.rewise.praeduim-tech.com" : "localhost:8000";
|
|
5597
|
+
var ADDRESS_IP_URL222 = chooseEnv222 === "prod" ? `https://${ADDRESS_IP222}/` : `http://${ADDRESS_IP222}/`;
|
|
4063
5598
|
var API_URL222 = `${ADDRESS_IP_URL222}api`;
|
|
4064
5599
|
var API_BASE_URL322 = `${API_URL222}/core/auth/`;
|
|
4065
5600
|
var SessionContext222 = createContext2222(void 0);
|
|
@@ -4070,8 +5605,9 @@ var APPROVAL_API_URL222 = `${API_URL222}/approvals/cases/`;
|
|
|
4070
5605
|
var AlertContext222 = createContext4222(void 0);
|
|
4071
5606
|
var VENDORS_API_URL222 = `${API_URL222}/accounting/vendors/`;
|
|
4072
5607
|
var ThemeContext2222 = createContext5222(void 0);
|
|
4073
|
-
var
|
|
4074
|
-
var
|
|
5608
|
+
var chooseEnv2222 = localStorage.getItem("env") ?? "prod";
|
|
5609
|
+
var ADDRESS_IP2222 = chooseEnv2222 === "prod" ? "back.rewise.praeduim-tech.com" : "localhost:8000";
|
|
5610
|
+
var ADDRESS_IP_URL2222 = chooseEnv2222 === "prod" ? `https://${ADDRESS_IP2222}/` : `http://${ADDRESS_IP2222}/`;
|
|
4075
5611
|
var API_URL2222 = `${ADDRESS_IP_URL2222}api`;
|
|
4076
5612
|
var API_BASE_URL3222 = `${API_URL2222}/core/auth/`;
|
|
4077
5613
|
var SessionContext2222 = createContext22222(void 0);
|
|
@@ -4080,22 +5616,70 @@ var USERS_API_URL2222 = `${API_URL2222}/core/users/`;
|
|
|
4080
5616
|
var ToastContext2222 = createContext32222(void 0);
|
|
4081
5617
|
var APPROVAL_API_URL2222 = `${API_URL2222}/approvals/cases/`;
|
|
4082
5618
|
var AlertContext2222 = createContext42222(void 0);
|
|
4083
|
-
var
|
|
4084
|
-
var
|
|
4085
|
-
var
|
|
4086
|
-
var
|
|
4087
|
-
var
|
|
4088
|
-
var
|
|
4089
|
-
var
|
|
4090
|
-
var
|
|
4091
|
-
var
|
|
4092
|
-
var
|
|
4093
|
-
var
|
|
4094
|
-
var
|
|
5619
|
+
var VENDORS_API_URL2222 = `${API_URL2222}/accounting/vendors/`;
|
|
5620
|
+
var ThemeContext22222 = createContext52222(void 0);
|
|
5621
|
+
var ADDRESS_IP22222 = "localhost:8000";
|
|
5622
|
+
var ADDRESS_IP_URL22222 = `http://${ADDRESS_IP22222}/`;
|
|
5623
|
+
var API_URL22222 = `${ADDRESS_IP_URL22222}api`;
|
|
5624
|
+
var API_BASE_URL32222 = `${API_URL22222}/core/auth/`;
|
|
5625
|
+
var SessionContext22222 = createContext222222(void 0);
|
|
5626
|
+
var API_BASE_URL222222 = `${API_URL22222}/core/auth/`;
|
|
5627
|
+
var USERS_API_URL22222 = `${API_URL22222}/core/users/`;
|
|
5628
|
+
var ToastContext22222 = createContext322222(void 0);
|
|
5629
|
+
var APPROVAL_API_URL22222 = `${API_URL22222}/approvals/cases/`;
|
|
5630
|
+
var AlertContext22222 = createContext422222(void 0);
|
|
5631
|
+
var VENDORS_API_URL22222 = `${API_URL22222}/accounting/vendors/`;
|
|
5632
|
+
var ThemeContext222222 = createContext522222(void 0);
|
|
5633
|
+
var ADDRESS_IP222222 = "localhost:8000";
|
|
5634
|
+
var ADDRESS_IP_URL222222 = `http://${ADDRESS_IP222222}/`;
|
|
5635
|
+
var API_URL222222 = `${ADDRESS_IP_URL222222}api`;
|
|
5636
|
+
var API_BASE_URL322222 = `${API_URL222222}/core/auth/`;
|
|
5637
|
+
var SessionContext222222 = createContext2222222(void 0);
|
|
5638
|
+
var API_BASE_URL2222222 = `${API_URL222222}/core/auth/`;
|
|
5639
|
+
var USERS_API_URL222222 = `${API_URL222222}/core/users/`;
|
|
5640
|
+
var ToastContext222222 = createContext3222222(void 0);
|
|
5641
|
+
var APPROVAL_API_URL222222 = `${API_URL222222}/approvals/cases/`;
|
|
5642
|
+
var AlertContext222222 = createContext4222222(void 0);
|
|
5643
|
+
var VENDORS_API_URL222222 = `${API_URL222222}/accounting/vendors/`;
|
|
5644
|
+
var ThemeContext2222222 = createContext5222222(void 0);
|
|
5645
|
+
var ADDRESS_IP2222222 = "localhost:8000";
|
|
5646
|
+
var ADDRESS_IP_URL2222222 = `http://${ADDRESS_IP2222222}/`;
|
|
5647
|
+
var API_URL2222222 = `${ADDRESS_IP_URL2222222}api`;
|
|
5648
|
+
var API_BASE_URL3222222 = `${API_URL2222222}/core/auth/`;
|
|
5649
|
+
var SessionContext2222222 = createContext22222222(void 0);
|
|
5650
|
+
var API_BASE_URL22222222 = `${API_URL2222222}/core/auth/`;
|
|
5651
|
+
var USERS_API_URL2222222 = `${API_URL2222222}/core/users/`;
|
|
5652
|
+
var ToastContext2222222 = createContext32222222(void 0);
|
|
5653
|
+
var APPROVAL_API_URL2222222 = `${API_URL2222222}/approvals/cases/`;
|
|
5654
|
+
var AlertContext2222222 = createContext42222222(void 0);
|
|
5655
|
+
var URI = `${API_URL222222}/core/departments/`;
|
|
5656
|
+
var URI2 = `${API_URL222222}/accounting/profit-or-cost-center/`;
|
|
5657
|
+
var COST_URI = `${API_URL222222}/accounting/cost-center/`;
|
|
5658
|
+
var PROFIT_URI = `${API_URL222222}/accounting/profit-center/`;
|
|
5659
|
+
var URI3 = `${API_URL22222}/core/departments/`;
|
|
5660
|
+
var URI4 = `${API_URL22222}/accounting/profit-or-cost-center/`;
|
|
5661
|
+
var COST_URI2 = `${API_URL22222}/accounting/cost-center/`;
|
|
5662
|
+
var PROFIT_URI2 = `${API_URL22222}/accounting/profit-center/`;
|
|
5663
|
+
var URI5 = `${API_URL2222}/core/departments/`;
|
|
5664
|
+
var URI6 = `${API_URL2222}/accounting/profit-or-cost-center/`;
|
|
5665
|
+
var COST_URI3 = `${API_URL2222}/accounting/cost-center/`;
|
|
5666
|
+
var PROFIT_URI3 = `${API_URL2222}/accounting/profit-center/`;
|
|
5667
|
+
var URI7 = `${API_URL222}/core/departments/`;
|
|
5668
|
+
var URI8 = `${API_URL222}/accounting/profit-or-cost-center/`;
|
|
5669
|
+
var COST_URI4 = `${API_URL222}/accounting/cost-center/`;
|
|
5670
|
+
var PROFIT_URI4 = `${API_URL222}/accounting/profit-center/`;
|
|
5671
|
+
var URI9 = `${API_URL22}/core/departments/`;
|
|
5672
|
+
var URI10 = `${API_URL22}/accounting/profit-or-cost-center/`;
|
|
5673
|
+
var COST_URI5 = `${API_URL22}/accounting/cost-center/`;
|
|
5674
|
+
var PROFIT_URI5 = `${API_URL22}/accounting/profit-center/`;
|
|
5675
|
+
var URI11 = `${API_URL2}/core/departments/`;
|
|
5676
|
+
var URI12 = `${API_URL2}/accounting/profit-or-cost-center/`;
|
|
5677
|
+
var COST_URI6 = `${API_URL2}/accounting/cost-center/`;
|
|
5678
|
+
var PROFIT_URI6 = `${API_URL2}/accounting/profit-center/`;
|
|
4095
5679
|
|
|
4096
5680
|
// src/components/common/FormVendor.tsx
|
|
4097
|
-
import { useState as
|
|
4098
|
-
import { jsx as
|
|
5681
|
+
import { useState as useState26 } from "react";
|
|
5682
|
+
import { jsx as jsx37, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
4099
5683
|
var MinimalVendorForm = ({
|
|
4100
5684
|
isOpen,
|
|
4101
5685
|
onClose,
|
|
@@ -4104,13 +5688,13 @@ var MinimalVendorForm = ({
|
|
|
4104
5688
|
refresh = () => {
|
|
4105
5689
|
}
|
|
4106
5690
|
}) => {
|
|
4107
|
-
const [formData, setFormData] =
|
|
5691
|
+
const [formData, setFormData] = useState26(object || {
|
|
4108
5692
|
from_module: from ?? null,
|
|
4109
5693
|
legal_name: "",
|
|
4110
5694
|
trading_name: ""
|
|
4111
5695
|
});
|
|
4112
|
-
const [errors, setErrors] =
|
|
4113
|
-
const [loading, setLoading] =
|
|
5696
|
+
const [errors, setErrors] = useState26({});
|
|
5697
|
+
const [loading, setLoading] = useState26(false);
|
|
4114
5698
|
const { token } = useSession();
|
|
4115
5699
|
const { success, error: showError } = useToast();
|
|
4116
5700
|
const handleInputChange = (e) => {
|
|
@@ -4169,7 +5753,7 @@ var MinimalVendorForm = ({
|
|
|
4169
5753
|
}
|
|
4170
5754
|
};
|
|
4171
5755
|
if (!isOpen) return null;
|
|
4172
|
-
return /* @__PURE__ */
|
|
5756
|
+
return /* @__PURE__ */ jsx37(
|
|
4173
5757
|
Modals_default2,
|
|
4174
5758
|
{
|
|
4175
5759
|
title: "Ajouter un fournisseur",
|
|
@@ -4177,9 +5761,9 @@ var MinimalVendorForm = ({
|
|
|
4177
5761
|
description: ``,
|
|
4178
5762
|
open: isOpen,
|
|
4179
5763
|
onClose,
|
|
4180
|
-
children: /* @__PURE__ */
|
|
4181
|
-
/* @__PURE__ */
|
|
4182
|
-
/* @__PURE__ */
|
|
5764
|
+
children: /* @__PURE__ */ jsxs27("form", { onSubmit: handleSubmit, className: "p-", children: [
|
|
5765
|
+
/* @__PURE__ */ jsx37("div", { className: "space-y-4", children: /* @__PURE__ */ jsxs27("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
|
|
5766
|
+
/* @__PURE__ */ jsx37(
|
|
4183
5767
|
TextInput2,
|
|
4184
5768
|
{
|
|
4185
5769
|
label: "Raison sociale",
|
|
@@ -4191,7 +5775,7 @@ var MinimalVendorForm = ({
|
|
|
4191
5775
|
onChange: handleInputChange
|
|
4192
5776
|
}
|
|
4193
5777
|
),
|
|
4194
|
-
/* @__PURE__ */
|
|
5778
|
+
/* @__PURE__ */ jsx37(
|
|
4195
5779
|
TextInput2,
|
|
4196
5780
|
{
|
|
4197
5781
|
label: "Nom commercial",
|
|
@@ -4202,8 +5786,8 @@ var MinimalVendorForm = ({
|
|
|
4202
5786
|
}
|
|
4203
5787
|
)
|
|
4204
5788
|
] }) }),
|
|
4205
|
-
/* @__PURE__ */
|
|
4206
|
-
/* @__PURE__ */
|
|
5789
|
+
/* @__PURE__ */ jsxs27("div", { className: "flex justify-between pt-6 mt-8", children: [
|
|
5790
|
+
/* @__PURE__ */ jsx37(
|
|
4207
5791
|
"button",
|
|
4208
5792
|
{
|
|
4209
5793
|
type: "button",
|
|
@@ -4212,7 +5796,7 @@ var MinimalVendorForm = ({
|
|
|
4212
5796
|
children: "Annuler"
|
|
4213
5797
|
}
|
|
4214
5798
|
),
|
|
4215
|
-
/* @__PURE__ */
|
|
5799
|
+
/* @__PURE__ */ jsx37(
|
|
4216
5800
|
Buttons_default2,
|
|
4217
5801
|
{
|
|
4218
5802
|
type: "button",
|
|
@@ -4228,43 +5812,43 @@ var MinimalVendorForm = ({
|
|
|
4228
5812
|
};
|
|
4229
5813
|
|
|
4230
5814
|
// src/services/DepartmentServices.ts
|
|
4231
|
-
var
|
|
5815
|
+
var URI13 = `${API_URL}/core/departments/`;
|
|
4232
5816
|
var DepartmentServices = {
|
|
4233
|
-
create: (data) => FetchApi.post(`${
|
|
4234
|
-
get: (id) => FetchApi.get(`${
|
|
4235
|
-
list: (params) => FetchApi.get(`${
|
|
4236
|
-
update: (id, data) => FetchApi.put(`${
|
|
4237
|
-
delete: (id) => FetchApi.delete(`${
|
|
5817
|
+
create: (data) => FetchApi.post(`${URI13}`, data),
|
|
5818
|
+
get: (id) => FetchApi.get(`${URI13}${id}/`),
|
|
5819
|
+
list: (params) => FetchApi.get(`${URI13}?${new URLSearchParams(params).toString()}`),
|
|
5820
|
+
update: (id, data) => FetchApi.put(`${URI13}${id}/`, data),
|
|
5821
|
+
delete: (id) => FetchApi.delete(`${URI13}${id}/`)
|
|
4238
5822
|
};
|
|
4239
5823
|
|
|
4240
5824
|
// src/services/ProfitCostsServices.ts
|
|
4241
|
-
var
|
|
4242
|
-
var
|
|
5825
|
+
var URI14 = `${API_URL}/accounting/profit-or-cost-center/`;
|
|
5826
|
+
var COST_URI7 = `${API_URL}/accounting/cost-center/`;
|
|
4243
5827
|
var CostServices = {
|
|
4244
|
-
create: (data) => FetchApi.post(`${
|
|
4245
|
-
get: (id) => FetchApi.get(`${
|
|
4246
|
-
list: (params) => FetchApi.get(`${
|
|
4247
|
-
update: (id, data) => FetchApi.put(`${
|
|
4248
|
-
delete: (id) => FetchApi.delete(`${
|
|
5828
|
+
create: (data) => FetchApi.post(`${COST_URI7}`, data),
|
|
5829
|
+
get: (id) => FetchApi.get(`${COST_URI7}${id}/`),
|
|
5830
|
+
list: (params) => FetchApi.get(`${COST_URI7}?${new URLSearchParams(params).toString()}`),
|
|
5831
|
+
update: (id, data) => FetchApi.put(`${COST_URI7}${id}/`, data),
|
|
5832
|
+
delete: (id) => FetchApi.delete(`${COST_URI7}${id}/`)
|
|
4249
5833
|
};
|
|
4250
|
-
var
|
|
5834
|
+
var PROFIT_URI7 = `${API_URL}/accounting/profit-center/`;
|
|
4251
5835
|
|
|
4252
5836
|
// src/components/common/CommonSelect.tsx
|
|
4253
|
-
import { jsx as
|
|
5837
|
+
import { jsx as jsx38, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
4254
5838
|
var SelectVendor = ({
|
|
4255
5839
|
value,
|
|
4256
5840
|
onSelect
|
|
4257
5841
|
}) => {
|
|
4258
|
-
const [showModal, setShowModal] =
|
|
4259
|
-
const [selectedVendor, setSelectedVendor] =
|
|
5842
|
+
const [showModal, setShowModal] = useState27(false);
|
|
5843
|
+
const [selectedVendor, setSelectedVendor] = useState27(null);
|
|
4260
5844
|
const { token, activeBusinessEntity } = useSession();
|
|
4261
|
-
const [vendors, setVendors] =
|
|
5845
|
+
const [vendors, setVendors] = useState27(() => {
|
|
4262
5846
|
const cacheKey = `vendors_cache_${activeBusinessEntity?.id || "default"}`;
|
|
4263
5847
|
const cached = sessionStorage.getItem(cacheKey);
|
|
4264
5848
|
return cached ? JSON.parse(cached) : [];
|
|
4265
5849
|
});
|
|
4266
|
-
const [loadingVendors, setLoadingVendors] =
|
|
4267
|
-
|
|
5850
|
+
const [loadingVendors, setLoadingVendors] = useState27(false);
|
|
5851
|
+
useEffect17(() => {
|
|
4268
5852
|
const cacheKey = `vendors_cache_${activeBusinessEntity?.id || "default"}`;
|
|
4269
5853
|
const cached = sessionStorage.getItem(cacheKey);
|
|
4270
5854
|
if (!cached) {
|
|
@@ -4302,9 +5886,9 @@ var SelectVendor = ({
|
|
|
4302
5886
|
sessionStorage.removeItem(cacheKey);
|
|
4303
5887
|
loadVendors();
|
|
4304
5888
|
};
|
|
4305
|
-
return /* @__PURE__ */
|
|
4306
|
-
/* @__PURE__ */
|
|
4307
|
-
/* @__PURE__ */
|
|
5889
|
+
return /* @__PURE__ */ jsxs28("div", { children: [
|
|
5890
|
+
/* @__PURE__ */ jsx38("div", { className: "flex justify-between ", children: /* @__PURE__ */ jsx38("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Ajouter un fournisseur" }) }),
|
|
5891
|
+
/* @__PURE__ */ jsx38(
|
|
4308
5892
|
SearchableSelect,
|
|
4309
5893
|
{
|
|
4310
5894
|
value,
|
|
@@ -4320,8 +5904,8 @@ var SelectVendor = ({
|
|
|
4320
5904
|
},
|
|
4321
5905
|
"fourni" + value
|
|
4322
5906
|
),
|
|
4323
|
-
loadingVendors && /* @__PURE__ */
|
|
4324
|
-
showModal && /* @__PURE__ */
|
|
5907
|
+
loadingVendors && /* @__PURE__ */ jsx38("p", { className: "text-sm text-gray-500 mt-2", children: "Chargement des fournisseurs..." }),
|
|
5908
|
+
showModal && /* @__PURE__ */ jsx38(
|
|
4325
5909
|
MinimalVendorForm,
|
|
4326
5910
|
{
|
|
4327
5911
|
object: selectedVendor,
|
|
@@ -4338,13 +5922,13 @@ var SelectUser = ({
|
|
|
4338
5922
|
onSelect
|
|
4339
5923
|
}) => {
|
|
4340
5924
|
const { token, activeBusinessEntity } = useSession();
|
|
4341
|
-
const [users, setUsers] =
|
|
5925
|
+
const [users, setUsers] = useState27(() => {
|
|
4342
5926
|
const cacheKey = `users_cache_${activeBusinessEntity?.id || "default"}`;
|
|
4343
5927
|
const cached = sessionStorage.getItem(cacheKey);
|
|
4344
5928
|
return cached ? JSON.parse(cached) : [];
|
|
4345
5929
|
});
|
|
4346
|
-
const [loading, setLoading] =
|
|
4347
|
-
|
|
5930
|
+
const [loading, setLoading] = useState27(false);
|
|
5931
|
+
useEffect17(() => {
|
|
4348
5932
|
const cacheKey = `users_cache_${activeBusinessEntity?.id || "default"}`;
|
|
4349
5933
|
const cached = sessionStorage.getItem(cacheKey);
|
|
4350
5934
|
if (!cached) {
|
|
@@ -4380,19 +5964,19 @@ var SelectUser = ({
|
|
|
4380
5964
|
return users.map((user) => ({
|
|
4381
5965
|
value: user.id,
|
|
4382
5966
|
label: `${user.first_name} ${user.last_name}`,
|
|
4383
|
-
content: /* @__PURE__ */
|
|
4384
|
-
/* @__PURE__ */
|
|
5967
|
+
content: /* @__PURE__ */ jsx38("div", { className: "flex items-center space-x-3", children: /* @__PURE__ */ jsxs28("div", { className: "flex-1", children: [
|
|
5968
|
+
/* @__PURE__ */ jsxs28("div", { className: "font-medium text-gray-900", children: [
|
|
4385
5969
|
user.first_name,
|
|
4386
5970
|
" ",
|
|
4387
5971
|
user.last_name
|
|
4388
5972
|
] }),
|
|
4389
|
-
/* @__PURE__ */
|
|
5973
|
+
/* @__PURE__ */ jsx38("div", { className: "text-sm text-gray-500", children: user.email })
|
|
4390
5974
|
] }) })
|
|
4391
5975
|
}));
|
|
4392
5976
|
};
|
|
4393
|
-
return /* @__PURE__ */
|
|
4394
|
-
/* @__PURE__ */
|
|
4395
|
-
/* @__PURE__ */
|
|
5977
|
+
return /* @__PURE__ */ jsxs28("div", { children: [
|
|
5978
|
+
/* @__PURE__ */ jsx38("div", { className: "flex justify-between ", children: /* @__PURE__ */ jsx38("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "S\xE9lectionner un utilisateur" }) }),
|
|
5979
|
+
/* @__PURE__ */ jsx38(
|
|
4396
5980
|
SearchableSelect,
|
|
4397
5981
|
{
|
|
4398
5982
|
value,
|
|
@@ -4405,7 +5989,7 @@ var SelectUser = ({
|
|
|
4405
5989
|
},
|
|
4406
5990
|
"user" + value
|
|
4407
5991
|
),
|
|
4408
|
-
loading && /* @__PURE__ */
|
|
5992
|
+
loading && /* @__PURE__ */ jsx38("p", { className: "text-sm text-gray-500 mt-2", children: "Chargement des utilisateurs..." })
|
|
4409
5993
|
] });
|
|
4410
5994
|
};
|
|
4411
5995
|
var SelectDepartment = ({
|
|
@@ -4413,13 +5997,13 @@ var SelectDepartment = ({
|
|
|
4413
5997
|
onSelect
|
|
4414
5998
|
}) => {
|
|
4415
5999
|
const { token, activeBusinessEntity } = useSession();
|
|
4416
|
-
const [departments, setDepartments] =
|
|
6000
|
+
const [departments, setDepartments] = useState27(() => {
|
|
4417
6001
|
const cacheKey = `departments_cache_${activeBusinessEntity?.id || "default"}`;
|
|
4418
6002
|
const cached = sessionStorage.getItem(cacheKey);
|
|
4419
6003
|
return cached ? JSON.parse(cached) : [];
|
|
4420
6004
|
});
|
|
4421
|
-
const [loading, setLoading] =
|
|
4422
|
-
|
|
6005
|
+
const [loading, setLoading] = useState27(false);
|
|
6006
|
+
useEffect17(() => {
|
|
4423
6007
|
const cacheKey = `departments_cache_${activeBusinessEntity?.id || "default"}`;
|
|
4424
6008
|
const cached = sessionStorage.getItem(cacheKey);
|
|
4425
6009
|
if (!cached) {
|
|
@@ -4455,9 +6039,9 @@ var SelectDepartment = ({
|
|
|
4455
6039
|
label: dept.name
|
|
4456
6040
|
}));
|
|
4457
6041
|
};
|
|
4458
|
-
return /* @__PURE__ */
|
|
4459
|
-
/* @__PURE__ */
|
|
4460
|
-
/* @__PURE__ */
|
|
6042
|
+
return /* @__PURE__ */ jsxs28("div", { children: [
|
|
6043
|
+
/* @__PURE__ */ jsx38("div", { className: "flex justify-between ", children: /* @__PURE__ */ jsx38("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "S\xE9lectionner un d\xE9partement" }) }),
|
|
6044
|
+
/* @__PURE__ */ jsx38(
|
|
4461
6045
|
SearchableSelect,
|
|
4462
6046
|
{
|
|
4463
6047
|
value,
|
|
@@ -4470,7 +6054,7 @@ var SelectDepartment = ({
|
|
|
4470
6054
|
},
|
|
4471
6055
|
"dept" + value
|
|
4472
6056
|
),
|
|
4473
|
-
loading && /* @__PURE__ */
|
|
6057
|
+
loading && /* @__PURE__ */ jsx38("p", { className: "text-sm text-gray-500 mt-2", children: "Chargement des d\xE9partements..." })
|
|
4474
6058
|
] });
|
|
4475
6059
|
};
|
|
4476
6060
|
var SelectCostCenter = ({
|
|
@@ -4478,13 +6062,13 @@ var SelectCostCenter = ({
|
|
|
4478
6062
|
onSelect
|
|
4479
6063
|
}) => {
|
|
4480
6064
|
const { token, activeBusinessEntity } = useSession();
|
|
4481
|
-
const [costCenters, setCostCenters] =
|
|
6065
|
+
const [costCenters, setCostCenters] = useState27(() => {
|
|
4482
6066
|
const cacheKey = `cost_centers_cache_${activeBusinessEntity?.id || "default"}`;
|
|
4483
6067
|
const cached = sessionStorage.getItem(cacheKey);
|
|
4484
6068
|
return cached ? JSON.parse(cached) : [];
|
|
4485
6069
|
});
|
|
4486
|
-
const [loading, setLoading] =
|
|
4487
|
-
|
|
6070
|
+
const [loading, setLoading] = useState27(false);
|
|
6071
|
+
useEffect17(() => {
|
|
4488
6072
|
const cacheKey = `cost_centers_cache_${activeBusinessEntity?.id || "default"}`;
|
|
4489
6073
|
const cached = sessionStorage.getItem(cacheKey);
|
|
4490
6074
|
if (!cached) {
|
|
@@ -4518,18 +6102,18 @@ var SelectCostCenter = ({
|
|
|
4518
6102
|
return costCenters.map((center) => ({
|
|
4519
6103
|
value: center.id,
|
|
4520
6104
|
label: `${center.code ? `[${center.code}] ` : ""}${center.name}`,
|
|
4521
|
-
content: /* @__PURE__ */
|
|
4522
|
-
/* @__PURE__ */
|
|
4523
|
-
center.code && /* @__PURE__ */
|
|
6105
|
+
content: /* @__PURE__ */ jsx38("div", { className: "flex items-center space-x-3", children: /* @__PURE__ */ jsxs28("div", { className: "flex-1", children: [
|
|
6106
|
+
/* @__PURE__ */ jsx38("div", { className: "font-medium text-gray-900", children: center.name }),
|
|
6107
|
+
center.code && /* @__PURE__ */ jsxs28("div", { className: "text-sm text-gray-500", children: [
|
|
4524
6108
|
"Code: ",
|
|
4525
6109
|
center.code
|
|
4526
6110
|
] })
|
|
4527
6111
|
] }) })
|
|
4528
6112
|
}));
|
|
4529
6113
|
};
|
|
4530
|
-
return /* @__PURE__ */
|
|
4531
|
-
/* @__PURE__ */
|
|
4532
|
-
/* @__PURE__ */
|
|
6114
|
+
return /* @__PURE__ */ jsxs28("div", { children: [
|
|
6115
|
+
/* @__PURE__ */ jsx38("div", { className: "flex justify-between ", children: /* @__PURE__ */ jsx38("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "S\xE9lectionner un centre de co\xFBt" }) }),
|
|
6116
|
+
/* @__PURE__ */ jsx38(
|
|
4533
6117
|
SearchableSelect,
|
|
4534
6118
|
{
|
|
4535
6119
|
value,
|
|
@@ -4542,12 +6126,12 @@ var SelectCostCenter = ({
|
|
|
4542
6126
|
},
|
|
4543
6127
|
"cost" + value
|
|
4544
6128
|
),
|
|
4545
|
-
loading && /* @__PURE__ */
|
|
6129
|
+
loading && /* @__PURE__ */ jsx38("p", { className: "text-sm text-gray-500 mt-2", children: "Chargement des centres de co\xFBt..." })
|
|
4546
6130
|
] });
|
|
4547
6131
|
};
|
|
4548
6132
|
|
|
4549
6133
|
// src/components/common/Choices.tsx
|
|
4550
|
-
import { jsx as
|
|
6134
|
+
import { jsx as jsx39 } from "react/jsx-runtime";
|
|
4551
6135
|
var CHOICES = {
|
|
4552
6136
|
INVOICE_TYPES: [
|
|
4553
6137
|
{ value: "sale", label: { fr: "Vente", en: "Sale", default: "Sale" } },
|
|
@@ -4805,7 +6389,7 @@ var InvoiceTypeSelector = ({
|
|
|
4805
6389
|
value: item.value,
|
|
4806
6390
|
label: item.label[language]
|
|
4807
6391
|
}));
|
|
4808
|
-
return /* @__PURE__ */
|
|
6392
|
+
return /* @__PURE__ */ jsx39(
|
|
4809
6393
|
SearchableSelect,
|
|
4810
6394
|
{
|
|
4811
6395
|
value,
|
|
@@ -4828,7 +6412,7 @@ var PaymentMethodSelector = ({
|
|
|
4828
6412
|
value: item.value,
|
|
4829
6413
|
label: item.label[language]
|
|
4830
6414
|
}));
|
|
4831
|
-
return /* @__PURE__ */
|
|
6415
|
+
return /* @__PURE__ */ jsx39(
|
|
4832
6416
|
SearchableSelect,
|
|
4833
6417
|
{
|
|
4834
6418
|
value,
|
|
@@ -4851,7 +6435,7 @@ var TemplateFNESelector = ({
|
|
|
4851
6435
|
value: item.value,
|
|
4852
6436
|
label: item.label[language]
|
|
4853
6437
|
}));
|
|
4854
|
-
return /* @__PURE__ */
|
|
6438
|
+
return /* @__PURE__ */ jsx39(
|
|
4855
6439
|
SearchableSelect,
|
|
4856
6440
|
{
|
|
4857
6441
|
value,
|
|
@@ -4874,7 +6458,7 @@ var ForeignCurrencySelector = ({
|
|
|
4874
6458
|
value: item.value,
|
|
4875
6459
|
label: item.label[language]
|
|
4876
6460
|
}));
|
|
4877
|
-
return /* @__PURE__ */
|
|
6461
|
+
return /* @__PURE__ */ jsx39(
|
|
4878
6462
|
SearchableSelect,
|
|
4879
6463
|
{
|
|
4880
6464
|
value,
|
|
@@ -4898,7 +6482,7 @@ var TaxSelector = ({
|
|
|
4898
6482
|
value: item.value,
|
|
4899
6483
|
label: item.label[language]
|
|
4900
6484
|
}));
|
|
4901
|
-
return /* @__PURE__ */
|
|
6485
|
+
return /* @__PURE__ */ jsx39(
|
|
4902
6486
|
SearchableSelect,
|
|
4903
6487
|
{
|
|
4904
6488
|
value,
|
|
@@ -4926,7 +6510,7 @@ var LegalFormSelector = ({
|
|
|
4926
6510
|
value: item.value,
|
|
4927
6511
|
label: item.label[language] ?? item.label.default
|
|
4928
6512
|
}));
|
|
4929
|
-
return /* @__PURE__ */
|
|
6513
|
+
return /* @__PURE__ */ jsx39(
|
|
4930
6514
|
SearchableSelect,
|
|
4931
6515
|
{
|
|
4932
6516
|
value,
|
|
@@ -4949,7 +6533,7 @@ var CountrySelector = ({
|
|
|
4949
6533
|
value: item.value,
|
|
4950
6534
|
label: item.label[language]
|
|
4951
6535
|
}));
|
|
4952
|
-
return /* @__PURE__ */
|
|
6536
|
+
return /* @__PURE__ */ jsx39(
|
|
4953
6537
|
SearchableSelect,
|
|
4954
6538
|
{
|
|
4955
6539
|
value,
|
|
@@ -4968,7 +6552,9 @@ export {
|
|
|
4968
6552
|
ApprovalAnswerModal,
|
|
4969
6553
|
ApprovalAnswerPage,
|
|
4970
6554
|
ApprovalPreviewAnswer_default as ApprovalPreviewAnswer,
|
|
6555
|
+
ApprovalServices,
|
|
4971
6556
|
ApprovalWorkflow_default as ApprovalWorkflow,
|
|
6557
|
+
AuthServices,
|
|
4972
6558
|
Choices_default as CHOICES,
|
|
4973
6559
|
CountrySelector,
|
|
4974
6560
|
DateInput,
|