ptechcore_ui 1.0.18 → 1.0.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -3696,7 +3696,7 @@ var useAlert = () => {
3696
3696
  };
3697
3697
 
3698
3698
  // src/components/common/CommonSelect.tsx
3699
- import { useEffect as useEffect14, useState as useState20 } from "react";
3699
+ import { useEffect as useEffect15, useState as useState23 } from "react";
3700
3700
 
3701
3701
  // src/services/VendorServices.ts
3702
3702
  var VENDORS_API_URL = `${API_URL}/accounting/vendors/`;
@@ -3775,7 +3775,7 @@ import { Fragment as Fragment62, jsx as jsx142, jsxs as jsxs102 } from "react/js
3775
3775
  import { createContext as createContext42, useContext as useContext42, useState as useState112, useCallback as useCallback22 } from "react";
3776
3776
  import { jsx as jsx152, jsxs as jsxs112 } from "react/jsx-runtime";
3777
3777
  import { jsx as jsx162, jsxs as jsxs122 } from "react/jsx-runtime";
3778
- import { useEffect as useEffect13, useState as useState18 } from "react";
3778
+ import { useEffect as useEffect14, useState as useState20 } from "react";
3779
3779
  import { jsx as jsx172 } from "react/jsx-runtime";
3780
3780
  import { jsx as jsx222, jsxs as jsxs132 } from "react/jsx-runtime";
3781
3781
  import { Link as Link32 } from "react-router-dom";
@@ -3830,7 +3830,7 @@ import { Fragment as Fragment622, jsx as jsx1422, jsxs as jsxs1022 } from "react
3830
3830
  import { createContext as createContext422, useContext as useContext422, useState as useState1122, useCallback as useCallback222 } from "react";
3831
3831
  import { jsx as jsx1522, jsxs as jsxs1122 } from "react/jsx-runtime";
3832
3832
  import { jsx as jsx1622, jsxs as jsxs1222 } from "react/jsx-runtime";
3833
- import { useEffect as useEffect12, useState as useState16 } from "react";
3833
+ import { useEffect as useEffect13, useState as useState18 } from "react";
3834
3834
  import { jsx as jsx1722 } from "react/jsx-runtime";
3835
3835
  import { jsx as jsx2222, jsxs as jsxs1322 } from "react/jsx-runtime";
3836
3836
  import { Link as Link322 } from "react-router-dom";
@@ -3885,7 +3885,7 @@ import { Fragment as Fragment6222, jsx as jsx14222, jsxs as jsxs10222 } from "re
3885
3885
  import { createContext as createContext4222, useContext as useContext4222, useState as useState11222, useCallback as useCallback2222 } from "react";
3886
3886
  import { jsx as jsx15222, jsxs as jsxs11222 } from "react/jsx-runtime";
3887
3887
  import { jsx as jsx16222, jsxs as jsxs12222 } from "react/jsx-runtime";
3888
- import { useEffect as useEffect11, useState as useState14 } from "react";
3888
+ import { useEffect as useEffect12, useState as useState16 } from "react";
3889
3889
  import { jsx as jsx17222 } from "react/jsx-runtime";
3890
3890
  import { jsx as jsx22222, jsxs as jsxs13222 } from "react/jsx-runtime";
3891
3891
  import { Link as Link3222 } from "react-router-dom";
@@ -3933,13 +3933,68 @@ import { ArrowDownAZ as ArrowDownAZ2222, ArrowDownUp as ArrowDownUp2222, ArrowUp
3933
3933
  import { Fragment as Fragment42222, jsx as jsx122222, jsxs as jsxs82222 } from "react/jsx-runtime";
3934
3934
  import { useState as useState102222, useEffect as useEffect82222 } from "react";
3935
3935
  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";
3936
+ import { Search as Search32222, ChevronDown as ChevronDown2222, X as X42222, RefreshCw as RefreshCw2222, Plus as Plus3222 } from "lucide-react";
3937
3937
  import { Fragment as Fragment52222, jsx as jsx132222, jsxs as jsxs92222 } from "react/jsx-runtime";
3938
- import { X as X52222, Plus as Plus3222, Trash2 as Trash22222, Users as Users2222, Loader as Loader22222, RotateCcw as RotateCcw2222, Ban as Ban2222, Eye as Eye22222, FileText as FileText22222, History as History2222 } from "lucide-react";
3938
+ import { X as X52222, Plus as Plus22222, Trash2 as Trash22222, Users as Users2222, Loader as Loader22222, RotateCcw as RotateCcw2222, Ban as Ban2222, Eye as Eye22222, FileText as FileText22222, History as History2222 } from "lucide-react";
3939
3939
  import { Fragment as Fragment62222, jsx as jsx142222, jsxs as jsxs102222 } from "react/jsx-runtime";
3940
3940
  import { createContext as createContext42222, useContext as useContext42222, useState as useState112222, useCallback as useCallback22222 } from "react";
3941
3941
  import { jsx as jsx152222, jsxs as jsxs112222 } from "react/jsx-runtime";
3942
3942
  import { jsx as jsx162222, jsxs as jsxs122222 } from "react/jsx-runtime";
3943
+ import { useEffect as useEffect11, useState as useState14 } from "react";
3944
+ import { jsx as jsx172222 } from "react/jsx-runtime";
3945
+ import { jsx as jsx222222, jsxs as jsxs132222 } from "react/jsx-runtime";
3946
+ import { Link as Link32222 } from "react-router-dom";
3947
+ import { jsx as jsx322222, jsxs as jsxs222222 } from "react/jsx-runtime";
3948
+ import React422222, { useState as useState522222, useEffect as useEffect422222 } from "react";
3949
+ import { useLocation as useLocation32222, useNavigate as useNavigate32222 } from "react-router-dom";
3950
+ import {
3951
+ Settings as Settings32222,
3952
+ ChevronLeft as ChevronLeft32222,
3953
+ ChevronRight as ChevronRight22222,
3954
+ Search as Search42222,
3955
+ Bell as Bell22222,
3956
+ User as User22222,
3957
+ LogOut as LogOut22222,
3958
+ Menu as Menu32222,
3959
+ X as X222222,
3960
+ Palette as Palette22222,
3961
+ DollarSign as DollarSign22222,
3962
+ HelpCircle as HelpCircle22222,
3963
+ Building2 as Building222222
3964
+ } from "lucide-react";
3965
+ import { clsx as clsx22222 } from "clsx";
3966
+ import { twMerge as twMerge22222 } from "tailwind-merge";
3967
+ import { createContext as createContext52222, useContext as useContext52222, useState as useState122222, useEffect as useEffect92222 } from "react";
3968
+ import { jsx as jsx422222 } from "react/jsx-runtime";
3969
+ import { createContext as createContext222222, useContext as useContext222222, useEffect as useEffect222222, useState as useState222222 } from "react";
3970
+ import { jsx as jsx522222 } from "react/jsx-runtime";
3971
+ import { createContext as createContext322222, useContext as useContext322222, useState as useState322222, useCallback as useCallback32222 } from "react";
3972
+ import { jsx as jsx622222 } from "react/jsx-runtime";
3973
+ import { useState as useState422222, useEffect as useEffect322222 } from "react";
3974
+ import { jsx as jsx722222, jsxs as jsxs322222 } from "react/jsx-runtime";
3975
+ 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";
3976
+ import { useParams as useParams22222, useSearchParams as useSearchParams32222 } from "react-router-dom";
3977
+ import { Fragment as Fragment72222, jsx as jsx822222, jsxs as jsxs422222 } from "react/jsx-runtime";
3978
+ import { Fragment as Fragment222222, jsx as jsx922222, jsxs as jsxs522222 } from "react/jsx-runtime";
3979
+ import { useEffect as useEffect522222, useState as useState622222 } from "react";
3980
+ import { CheckCircle as CheckCircle222222, XCircle as XCircle222222, AlertTriangle as AlertTriangle22222, Info as Info22222, X as X322222 } from "lucide-react";
3981
+ import { jsx as jsx1022222, jsxs as jsxs622222 } from "react/jsx-runtime";
3982
+ import { ChevronLeft as ChevronLeft222222, Download as Download32222, Menu as Menu222222, Settings as Settings222222 } from "lucide-react";
3983
+ import { useState as useState722222 } from "react";
3984
+ import { Fragment as Fragment322222, jsx as jsx1122222, jsxs as jsxs722222 } from "react/jsx-runtime";
3985
+ import { useEffect as useEffect622222, useState as useState822222 } from "react";
3986
+ import { useLocation as useLocation222222, useNavigate as useNavigate222222, useSearchParams as useSearchParams222222, Link as Link222222 } from "react-router-dom";
3987
+ 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";
3988
+ import { Fragment as Fragment422222, jsx as jsx1222222, jsxs as jsxs822222 } from "react/jsx-runtime";
3989
+ import { useState as useState1022222, useEffect as useEffect822222 } from "react";
3990
+ import { useState as useState922222, useRef as useRef22222, useEffect as useEffect722222 } from "react";
3991
+ import { Search as Search322222, ChevronDown as ChevronDown22222, X as X422222 } from "lucide-react";
3992
+ import { Fragment as Fragment522222, jsx as jsx1322222, jsxs as jsxs922222 } from "react/jsx-runtime";
3993
+ import { X as X522222, Plus as Plus32222, Trash2 as Trash222222, Users as Users22222, Loader as Loader222222, RotateCcw as RotateCcw22222, Ban as Ban22222, Eye as Eye222222, FileText as FileText222222, History as History22222 } from "lucide-react";
3994
+ import { Fragment as Fragment622222, jsx as jsx1422222, jsxs as jsxs1022222 } from "react/jsx-runtime";
3995
+ import { createContext as createContext422222, useContext as useContext422222, useState as useState1122222, useCallback as useCallback222222 } from "react";
3996
+ import { jsx as jsx1522222, jsxs as jsxs1122222 } from "react/jsx-runtime";
3997
+ import { jsx as jsx1622222, jsxs as jsxs1222222 } from "react/jsx-runtime";
3943
3998
  import { useState as useState13 } from "react";
3944
3999
  import { jsx as jsx18, jsxs as jsxs14 } from "react/jsx-runtime";
3945
4000
  import { jsx as jsx19, jsxs as jsxs15 } from "react/jsx-runtime";
@@ -3951,6 +4006,10 @@ import { useState as useState17 } from "react";
3951
4006
  import { jsx as jsx24, jsxs as jsxs18 } from "react/jsx-runtime";
3952
4007
  import { jsx as jsx25, jsxs as jsxs19 } from "react/jsx-runtime";
3953
4008
  import { jsx as jsx26 } from "react/jsx-runtime";
4009
+ import { useState as useState19 } from "react";
4010
+ import { jsx as jsx27, jsxs as jsxs20 } from "react/jsx-runtime";
4011
+ import { jsx as jsx28, jsxs as jsxs21 } from "react/jsx-runtime";
4012
+ import { jsx as jsx29 } from "react/jsx-runtime";
3954
4013
  var PrimaryButton2 = ({
3955
4014
  loading = false,
3956
4015
  children,
@@ -4046,8 +4105,9 @@ var APPROVAL_API_URL2 = `${API_URL2}/approvals/cases/`;
4046
4105
  var AlertContext2 = createContext42(void 0);
4047
4106
  var VENDORS_API_URL2 = `${API_URL2}/accounting/vendors/`;
4048
4107
  var ThemeContext22 = createContext52(void 0);
4049
- var ADDRESS_IP22 = "localhost:8000";
4050
- var ADDRESS_IP_URL22 = `http://${ADDRESS_IP22}/`;
4108
+ var chooseEnv22 = localStorage.getItem("env") ?? "prod";
4109
+ var ADDRESS_IP22 = chooseEnv22 === "prod" ? "back.rewise.praeduim-tech.com" : "localhost:8000";
4110
+ var ADDRESS_IP_URL22 = chooseEnv22 === "prod" ? `https://${ADDRESS_IP22}/` : `http://${ADDRESS_IP22}/`;
4051
4111
  var API_URL22 = `${ADDRESS_IP_URL22}api`;
4052
4112
  var API_BASE_URL32 = `${API_URL22}/core/auth/`;
4053
4113
  var SessionContext22 = createContext222(void 0);
@@ -4080,22 +4140,38 @@ var USERS_API_URL2222 = `${API_URL2222}/core/users/`;
4080
4140
  var ToastContext2222 = createContext32222(void 0);
4081
4141
  var APPROVAL_API_URL2222 = `${API_URL2222}/approvals/cases/`;
4082
4142
  var AlertContext2222 = createContext42222(void 0);
4083
- var URI = `${API_URL222}/core/departments/`;
4084
- var URI2 = `${API_URL222}/accounting/profit-or-cost-center/`;
4085
- var COST_URI = `${API_URL222}/accounting/cost-center/`;
4086
- var PROFIT_URI = `${API_URL222}/accounting/profit-center/`;
4087
- var URI3 = `${API_URL22}/core/departments/`;
4088
- var URI4 = `${API_URL22}/accounting/profit-or-cost-center/`;
4089
- var COST_URI2 = `${API_URL22}/accounting/cost-center/`;
4090
- var PROFIT_URI2 = `${API_URL22}/accounting/profit-center/`;
4091
- var URI5 = `${API_URL2}/core/departments/`;
4092
- var URI6 = `${API_URL2}/accounting/profit-or-cost-center/`;
4093
- var COST_URI3 = `${API_URL2}/accounting/cost-center/`;
4094
- var PROFIT_URI3 = `${API_URL2}/accounting/profit-center/`;
4143
+ var VENDORS_API_URL2222 = `${API_URL2222}/accounting/vendors/`;
4144
+ var ThemeContext22222 = createContext52222(void 0);
4145
+ var ADDRESS_IP22222 = "localhost:8000";
4146
+ var ADDRESS_IP_URL22222 = `http://${ADDRESS_IP22222}/`;
4147
+ var API_URL22222 = `${ADDRESS_IP_URL22222}api`;
4148
+ var API_BASE_URL32222 = `${API_URL22222}/core/auth/`;
4149
+ var SessionContext22222 = createContext222222(void 0);
4150
+ var API_BASE_URL222222 = `${API_URL22222}/core/auth/`;
4151
+ var USERS_API_URL22222 = `${API_URL22222}/core/users/`;
4152
+ var ToastContext22222 = createContext322222(void 0);
4153
+ var APPROVAL_API_URL22222 = `${API_URL22222}/approvals/cases/`;
4154
+ var AlertContext22222 = createContext422222(void 0);
4155
+ var URI = `${API_URL2222}/core/departments/`;
4156
+ var URI2 = `${API_URL2222}/accounting/profit-or-cost-center/`;
4157
+ var COST_URI = `${API_URL2222}/accounting/cost-center/`;
4158
+ var PROFIT_URI = `${API_URL2222}/accounting/profit-center/`;
4159
+ var URI3 = `${API_URL222}/core/departments/`;
4160
+ var URI4 = `${API_URL222}/accounting/profit-or-cost-center/`;
4161
+ var COST_URI2 = `${API_URL222}/accounting/cost-center/`;
4162
+ var PROFIT_URI2 = `${API_URL222}/accounting/profit-center/`;
4163
+ var URI5 = `${API_URL22}/core/departments/`;
4164
+ var URI6 = `${API_URL22}/accounting/profit-or-cost-center/`;
4165
+ var COST_URI3 = `${API_URL22}/accounting/cost-center/`;
4166
+ var PROFIT_URI3 = `${API_URL22}/accounting/profit-center/`;
4167
+ var URI7 = `${API_URL2}/core/departments/`;
4168
+ var URI8 = `${API_URL2}/accounting/profit-or-cost-center/`;
4169
+ var COST_URI4 = `${API_URL2}/accounting/cost-center/`;
4170
+ var PROFIT_URI4 = `${API_URL2}/accounting/profit-center/`;
4095
4171
 
4096
4172
  // src/components/common/FormVendor.tsx
4097
- import { useState as useState19 } from "react";
4098
- import { jsx as jsx27, jsxs as jsxs20 } from "react/jsx-runtime";
4173
+ import { useState as useState21 } from "react";
4174
+ import { jsx as jsx30, jsxs as jsxs23 } from "react/jsx-runtime";
4099
4175
  var MinimalVendorForm = ({
4100
4176
  isOpen,
4101
4177
  onClose,
@@ -4104,13 +4180,13 @@ var MinimalVendorForm = ({
4104
4180
  refresh = () => {
4105
4181
  }
4106
4182
  }) => {
4107
- const [formData, setFormData] = useState19(object || {
4183
+ const [formData, setFormData] = useState21(object || {
4108
4184
  from_module: from ?? null,
4109
4185
  legal_name: "",
4110
4186
  trading_name: ""
4111
4187
  });
4112
- const [errors, setErrors] = useState19({});
4113
- const [loading, setLoading] = useState19(false);
4188
+ const [errors, setErrors] = useState21({});
4189
+ const [loading, setLoading] = useState21(false);
4114
4190
  const { token } = useSession();
4115
4191
  const { success, error: showError } = useToast();
4116
4192
  const handleInputChange = (e) => {
@@ -4169,7 +4245,7 @@ var MinimalVendorForm = ({
4169
4245
  }
4170
4246
  };
4171
4247
  if (!isOpen) return null;
4172
- return /* @__PURE__ */ jsx27(
4248
+ return /* @__PURE__ */ jsx30(
4173
4249
  Modals_default2,
4174
4250
  {
4175
4251
  title: "Ajouter un fournisseur",
@@ -4177,9 +4253,9 @@ var MinimalVendorForm = ({
4177
4253
  description: ``,
4178
4254
  open: isOpen,
4179
4255
  onClose,
4180
- children: /* @__PURE__ */ jsxs20("form", { onSubmit: handleSubmit, className: "p-", children: [
4181
- /* @__PURE__ */ jsx27("div", { className: "space-y-4", children: /* @__PURE__ */ jsxs20("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
4182
- /* @__PURE__ */ jsx27(
4256
+ children: /* @__PURE__ */ jsxs23("form", { onSubmit: handleSubmit, className: "p-", children: [
4257
+ /* @__PURE__ */ jsx30("div", { className: "space-y-4", children: /* @__PURE__ */ jsxs23("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
4258
+ /* @__PURE__ */ jsx30(
4183
4259
  TextInput2,
4184
4260
  {
4185
4261
  label: "Raison sociale",
@@ -4191,7 +4267,7 @@ var MinimalVendorForm = ({
4191
4267
  onChange: handleInputChange
4192
4268
  }
4193
4269
  ),
4194
- /* @__PURE__ */ jsx27(
4270
+ /* @__PURE__ */ jsx30(
4195
4271
  TextInput2,
4196
4272
  {
4197
4273
  label: "Nom commercial",
@@ -4202,8 +4278,8 @@ var MinimalVendorForm = ({
4202
4278
  }
4203
4279
  )
4204
4280
  ] }) }),
4205
- /* @__PURE__ */ jsxs20("div", { className: "flex justify-between pt-6 mt-8", children: [
4206
- /* @__PURE__ */ jsx27(
4281
+ /* @__PURE__ */ jsxs23("div", { className: "flex justify-between pt-6 mt-8", children: [
4282
+ /* @__PURE__ */ jsx30(
4207
4283
  "button",
4208
4284
  {
4209
4285
  type: "button",
@@ -4212,7 +4288,7 @@ var MinimalVendorForm = ({
4212
4288
  children: "Annuler"
4213
4289
  }
4214
4290
  ),
4215
- /* @__PURE__ */ jsx27(
4291
+ /* @__PURE__ */ jsx30(
4216
4292
  Buttons_default2,
4217
4293
  {
4218
4294
  type: "button",
@@ -4228,43 +4304,43 @@ var MinimalVendorForm = ({
4228
4304
  };
4229
4305
 
4230
4306
  // src/services/DepartmentServices.ts
4231
- var URI7 = `${API_URL}/core/departments/`;
4307
+ var URI9 = `${API_URL}/core/departments/`;
4232
4308
  var DepartmentServices = {
4233
- create: (data) => FetchApi.post(`${URI7}`, data),
4234
- get: (id) => FetchApi.get(`${URI7}${id}/`),
4235
- list: (params) => FetchApi.get(`${URI7}?${new URLSearchParams(params).toString()}`),
4236
- update: (id, data) => FetchApi.put(`${URI7}${id}/`, data),
4237
- delete: (id) => FetchApi.delete(`${URI7}${id}/`)
4309
+ create: (data) => FetchApi.post(`${URI9}`, data),
4310
+ get: (id) => FetchApi.get(`${URI9}${id}/`),
4311
+ list: (params) => FetchApi.get(`${URI9}?${new URLSearchParams(params).toString()}`),
4312
+ update: (id, data) => FetchApi.put(`${URI9}${id}/`, data),
4313
+ delete: (id) => FetchApi.delete(`${URI9}${id}/`)
4238
4314
  };
4239
4315
 
4240
4316
  // src/services/ProfitCostsServices.ts
4241
- var URI8 = `${API_URL}/accounting/profit-or-cost-center/`;
4242
- var COST_URI4 = `${API_URL}/accounting/cost-center/`;
4317
+ var URI10 = `${API_URL}/accounting/profit-or-cost-center/`;
4318
+ var COST_URI5 = `${API_URL}/accounting/cost-center/`;
4243
4319
  var CostServices = {
4244
- create: (data) => FetchApi.post(`${COST_URI4}`, data),
4245
- get: (id) => FetchApi.get(`${COST_URI4}${id}/`),
4246
- list: (params) => FetchApi.get(`${COST_URI4}?${new URLSearchParams(params).toString()}`),
4247
- update: (id, data) => FetchApi.put(`${COST_URI4}${id}/`, data),
4248
- delete: (id) => FetchApi.delete(`${COST_URI4}${id}/`)
4320
+ create: (data) => FetchApi.post(`${COST_URI5}`, data),
4321
+ get: (id) => FetchApi.get(`${COST_URI5}${id}/`),
4322
+ list: (params) => FetchApi.get(`${COST_URI5}?${new URLSearchParams(params).toString()}`),
4323
+ update: (id, data) => FetchApi.put(`${COST_URI5}${id}/`, data),
4324
+ delete: (id) => FetchApi.delete(`${COST_URI5}${id}/`)
4249
4325
  };
4250
- var PROFIT_URI4 = `${API_URL}/accounting/profit-center/`;
4326
+ var PROFIT_URI5 = `${API_URL}/accounting/profit-center/`;
4251
4327
 
4252
4328
  // src/components/common/CommonSelect.tsx
4253
- import { jsx as jsx28, jsxs as jsxs21 } from "react/jsx-runtime";
4329
+ import { jsx as jsx31, jsxs as jsxs24 } from "react/jsx-runtime";
4254
4330
  var SelectVendor = ({
4255
4331
  value,
4256
4332
  onSelect
4257
4333
  }) => {
4258
- const [showModal, setShowModal] = useState20(false);
4259
- const [selectedVendor, setSelectedVendor] = useState20(null);
4334
+ const [showModal, setShowModal] = useState23(false);
4335
+ const [selectedVendor, setSelectedVendor] = useState23(null);
4260
4336
  const { token, activeBusinessEntity } = useSession();
4261
- const [vendors, setVendors] = useState20(() => {
4337
+ const [vendors, setVendors] = useState23(() => {
4262
4338
  const cacheKey = `vendors_cache_${activeBusinessEntity?.id || "default"}`;
4263
4339
  const cached = sessionStorage.getItem(cacheKey);
4264
4340
  return cached ? JSON.parse(cached) : [];
4265
4341
  });
4266
- const [loadingVendors, setLoadingVendors] = useState20(false);
4267
- useEffect14(() => {
4342
+ const [loadingVendors, setLoadingVendors] = useState23(false);
4343
+ useEffect15(() => {
4268
4344
  const cacheKey = `vendors_cache_${activeBusinessEntity?.id || "default"}`;
4269
4345
  const cached = sessionStorage.getItem(cacheKey);
4270
4346
  if (!cached) {
@@ -4302,9 +4378,9 @@ var SelectVendor = ({
4302
4378
  sessionStorage.removeItem(cacheKey);
4303
4379
  loadVendors();
4304
4380
  };
4305
- return /* @__PURE__ */ jsxs21("div", { children: [
4306
- /* @__PURE__ */ jsx28("div", { className: "flex justify-between ", children: /* @__PURE__ */ jsx28("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Ajouter un fournisseur" }) }),
4307
- /* @__PURE__ */ jsx28(
4381
+ return /* @__PURE__ */ jsxs24("div", { children: [
4382
+ /* @__PURE__ */ jsx31("div", { className: "flex justify-between ", children: /* @__PURE__ */ jsx31("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Ajouter un fournisseur" }) }),
4383
+ /* @__PURE__ */ jsx31(
4308
4384
  SearchableSelect,
4309
4385
  {
4310
4386
  value,
@@ -4320,8 +4396,8 @@ var SelectVendor = ({
4320
4396
  },
4321
4397
  "fourni" + value
4322
4398
  ),
4323
- loadingVendors && /* @__PURE__ */ jsx28("p", { className: "text-sm text-gray-500 mt-2", children: "Chargement des fournisseurs..." }),
4324
- showModal && /* @__PURE__ */ jsx28(
4399
+ loadingVendors && /* @__PURE__ */ jsx31("p", { className: "text-sm text-gray-500 mt-2", children: "Chargement des fournisseurs..." }),
4400
+ showModal && /* @__PURE__ */ jsx31(
4325
4401
  MinimalVendorForm,
4326
4402
  {
4327
4403
  object: selectedVendor,
@@ -4338,13 +4414,13 @@ var SelectUser = ({
4338
4414
  onSelect
4339
4415
  }) => {
4340
4416
  const { token, activeBusinessEntity } = useSession();
4341
- const [users, setUsers] = useState20(() => {
4417
+ const [users, setUsers] = useState23(() => {
4342
4418
  const cacheKey = `users_cache_${activeBusinessEntity?.id || "default"}`;
4343
4419
  const cached = sessionStorage.getItem(cacheKey);
4344
4420
  return cached ? JSON.parse(cached) : [];
4345
4421
  });
4346
- const [loading, setLoading] = useState20(false);
4347
- useEffect14(() => {
4422
+ const [loading, setLoading] = useState23(false);
4423
+ useEffect15(() => {
4348
4424
  const cacheKey = `users_cache_${activeBusinessEntity?.id || "default"}`;
4349
4425
  const cached = sessionStorage.getItem(cacheKey);
4350
4426
  if (!cached) {
@@ -4380,19 +4456,19 @@ var SelectUser = ({
4380
4456
  return users.map((user) => ({
4381
4457
  value: user.id,
4382
4458
  label: `${user.first_name} ${user.last_name}`,
4383
- content: /* @__PURE__ */ jsx28("div", { className: "flex items-center space-x-3", children: /* @__PURE__ */ jsxs21("div", { className: "flex-1", children: [
4384
- /* @__PURE__ */ jsxs21("div", { className: "font-medium text-gray-900", children: [
4459
+ content: /* @__PURE__ */ jsx31("div", { className: "flex items-center space-x-3", children: /* @__PURE__ */ jsxs24("div", { className: "flex-1", children: [
4460
+ /* @__PURE__ */ jsxs24("div", { className: "font-medium text-gray-900", children: [
4385
4461
  user.first_name,
4386
4462
  " ",
4387
4463
  user.last_name
4388
4464
  ] }),
4389
- /* @__PURE__ */ jsx28("div", { className: "text-sm text-gray-500", children: user.email })
4465
+ /* @__PURE__ */ jsx31("div", { className: "text-sm text-gray-500", children: user.email })
4390
4466
  ] }) })
4391
4467
  }));
4392
4468
  };
4393
- return /* @__PURE__ */ jsxs21("div", { children: [
4394
- /* @__PURE__ */ jsx28("div", { className: "flex justify-between ", children: /* @__PURE__ */ jsx28("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "S\xE9lectionner un utilisateur" }) }),
4395
- /* @__PURE__ */ jsx28(
4469
+ return /* @__PURE__ */ jsxs24("div", { children: [
4470
+ /* @__PURE__ */ jsx31("div", { className: "flex justify-between ", children: /* @__PURE__ */ jsx31("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "S\xE9lectionner un utilisateur" }) }),
4471
+ /* @__PURE__ */ jsx31(
4396
4472
  SearchableSelect,
4397
4473
  {
4398
4474
  value,
@@ -4405,7 +4481,7 @@ var SelectUser = ({
4405
4481
  },
4406
4482
  "user" + value
4407
4483
  ),
4408
- loading && /* @__PURE__ */ jsx28("p", { className: "text-sm text-gray-500 mt-2", children: "Chargement des utilisateurs..." })
4484
+ loading && /* @__PURE__ */ jsx31("p", { className: "text-sm text-gray-500 mt-2", children: "Chargement des utilisateurs..." })
4409
4485
  ] });
4410
4486
  };
4411
4487
  var SelectDepartment = ({
@@ -4413,13 +4489,13 @@ var SelectDepartment = ({
4413
4489
  onSelect
4414
4490
  }) => {
4415
4491
  const { token, activeBusinessEntity } = useSession();
4416
- const [departments, setDepartments] = useState20(() => {
4492
+ const [departments, setDepartments] = useState23(() => {
4417
4493
  const cacheKey = `departments_cache_${activeBusinessEntity?.id || "default"}`;
4418
4494
  const cached = sessionStorage.getItem(cacheKey);
4419
4495
  return cached ? JSON.parse(cached) : [];
4420
4496
  });
4421
- const [loading, setLoading] = useState20(false);
4422
- useEffect14(() => {
4497
+ const [loading, setLoading] = useState23(false);
4498
+ useEffect15(() => {
4423
4499
  const cacheKey = `departments_cache_${activeBusinessEntity?.id || "default"}`;
4424
4500
  const cached = sessionStorage.getItem(cacheKey);
4425
4501
  if (!cached) {
@@ -4455,9 +4531,9 @@ var SelectDepartment = ({
4455
4531
  label: dept.name
4456
4532
  }));
4457
4533
  };
4458
- return /* @__PURE__ */ jsxs21("div", { children: [
4459
- /* @__PURE__ */ jsx28("div", { className: "flex justify-between ", children: /* @__PURE__ */ jsx28("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "S\xE9lectionner un d\xE9partement" }) }),
4460
- /* @__PURE__ */ jsx28(
4534
+ return /* @__PURE__ */ jsxs24("div", { children: [
4535
+ /* @__PURE__ */ jsx31("div", { className: "flex justify-between ", children: /* @__PURE__ */ jsx31("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "S\xE9lectionner un d\xE9partement" }) }),
4536
+ /* @__PURE__ */ jsx31(
4461
4537
  SearchableSelect,
4462
4538
  {
4463
4539
  value,
@@ -4470,7 +4546,7 @@ var SelectDepartment = ({
4470
4546
  },
4471
4547
  "dept" + value
4472
4548
  ),
4473
- loading && /* @__PURE__ */ jsx28("p", { className: "text-sm text-gray-500 mt-2", children: "Chargement des d\xE9partements..." })
4549
+ loading && /* @__PURE__ */ jsx31("p", { className: "text-sm text-gray-500 mt-2", children: "Chargement des d\xE9partements..." })
4474
4550
  ] });
4475
4551
  };
4476
4552
  var SelectCostCenter = ({
@@ -4478,13 +4554,13 @@ var SelectCostCenter = ({
4478
4554
  onSelect
4479
4555
  }) => {
4480
4556
  const { token, activeBusinessEntity } = useSession();
4481
- const [costCenters, setCostCenters] = useState20(() => {
4557
+ const [costCenters, setCostCenters] = useState23(() => {
4482
4558
  const cacheKey = `cost_centers_cache_${activeBusinessEntity?.id || "default"}`;
4483
4559
  const cached = sessionStorage.getItem(cacheKey);
4484
4560
  return cached ? JSON.parse(cached) : [];
4485
4561
  });
4486
- const [loading, setLoading] = useState20(false);
4487
- useEffect14(() => {
4562
+ const [loading, setLoading] = useState23(false);
4563
+ useEffect15(() => {
4488
4564
  const cacheKey = `cost_centers_cache_${activeBusinessEntity?.id || "default"}`;
4489
4565
  const cached = sessionStorage.getItem(cacheKey);
4490
4566
  if (!cached) {
@@ -4518,18 +4594,18 @@ var SelectCostCenter = ({
4518
4594
  return costCenters.map((center) => ({
4519
4595
  value: center.id,
4520
4596
  label: `${center.code ? `[${center.code}] ` : ""}${center.name}`,
4521
- content: /* @__PURE__ */ jsx28("div", { className: "flex items-center space-x-3", children: /* @__PURE__ */ jsxs21("div", { className: "flex-1", children: [
4522
- /* @__PURE__ */ jsx28("div", { className: "font-medium text-gray-900", children: center.name }),
4523
- center.code && /* @__PURE__ */ jsxs21("div", { className: "text-sm text-gray-500", children: [
4597
+ content: /* @__PURE__ */ jsx31("div", { className: "flex items-center space-x-3", children: /* @__PURE__ */ jsxs24("div", { className: "flex-1", children: [
4598
+ /* @__PURE__ */ jsx31("div", { className: "font-medium text-gray-900", children: center.name }),
4599
+ center.code && /* @__PURE__ */ jsxs24("div", { className: "text-sm text-gray-500", children: [
4524
4600
  "Code: ",
4525
4601
  center.code
4526
4602
  ] })
4527
4603
  ] }) })
4528
4604
  }));
4529
4605
  };
4530
- return /* @__PURE__ */ jsxs21("div", { children: [
4531
- /* @__PURE__ */ jsx28("div", { className: "flex justify-between ", children: /* @__PURE__ */ jsx28("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "S\xE9lectionner un centre de co\xFBt" }) }),
4532
- /* @__PURE__ */ jsx28(
4606
+ return /* @__PURE__ */ jsxs24("div", { children: [
4607
+ /* @__PURE__ */ jsx31("div", { className: "flex justify-between ", children: /* @__PURE__ */ jsx31("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "S\xE9lectionner un centre de co\xFBt" }) }),
4608
+ /* @__PURE__ */ jsx31(
4533
4609
  SearchableSelect,
4534
4610
  {
4535
4611
  value,
@@ -4542,12 +4618,12 @@ var SelectCostCenter = ({
4542
4618
  },
4543
4619
  "cost" + value
4544
4620
  ),
4545
- loading && /* @__PURE__ */ jsx28("p", { className: "text-sm text-gray-500 mt-2", children: "Chargement des centres de co\xFBt..." })
4621
+ loading && /* @__PURE__ */ jsx31("p", { className: "text-sm text-gray-500 mt-2", children: "Chargement des centres de co\xFBt..." })
4546
4622
  ] });
4547
4623
  };
4548
4624
 
4549
4625
  // src/components/common/Choices.tsx
4550
- import { jsx as jsx29 } from "react/jsx-runtime";
4626
+ import { jsx as jsx33 } from "react/jsx-runtime";
4551
4627
  var CHOICES = {
4552
4628
  INVOICE_TYPES: [
4553
4629
  { value: "sale", label: { fr: "Vente", en: "Sale", default: "Sale" } },
@@ -4805,7 +4881,7 @@ var InvoiceTypeSelector = ({
4805
4881
  value: item.value,
4806
4882
  label: item.label[language]
4807
4883
  }));
4808
- return /* @__PURE__ */ jsx29(
4884
+ return /* @__PURE__ */ jsx33(
4809
4885
  SearchableSelect,
4810
4886
  {
4811
4887
  value,
@@ -4828,7 +4904,7 @@ var PaymentMethodSelector = ({
4828
4904
  value: item.value,
4829
4905
  label: item.label[language]
4830
4906
  }));
4831
- return /* @__PURE__ */ jsx29(
4907
+ return /* @__PURE__ */ jsx33(
4832
4908
  SearchableSelect,
4833
4909
  {
4834
4910
  value,
@@ -4851,7 +4927,7 @@ var TemplateFNESelector = ({
4851
4927
  value: item.value,
4852
4928
  label: item.label[language]
4853
4929
  }));
4854
- return /* @__PURE__ */ jsx29(
4930
+ return /* @__PURE__ */ jsx33(
4855
4931
  SearchableSelect,
4856
4932
  {
4857
4933
  value,
@@ -4874,7 +4950,7 @@ var ForeignCurrencySelector = ({
4874
4950
  value: item.value,
4875
4951
  label: item.label[language]
4876
4952
  }));
4877
- return /* @__PURE__ */ jsx29(
4953
+ return /* @__PURE__ */ jsx33(
4878
4954
  SearchableSelect,
4879
4955
  {
4880
4956
  value,
@@ -4898,7 +4974,7 @@ var TaxSelector = ({
4898
4974
  value: item.value,
4899
4975
  label: item.label[language]
4900
4976
  }));
4901
- return /* @__PURE__ */ jsx29(
4977
+ return /* @__PURE__ */ jsx33(
4902
4978
  SearchableSelect,
4903
4979
  {
4904
4980
  value,
@@ -4926,7 +5002,7 @@ var LegalFormSelector = ({
4926
5002
  value: item.value,
4927
5003
  label: item.label[language] ?? item.label.default
4928
5004
  }));
4929
- return /* @__PURE__ */ jsx29(
5005
+ return /* @__PURE__ */ jsx33(
4930
5006
  SearchableSelect,
4931
5007
  {
4932
5008
  value,
@@ -4949,7 +5025,7 @@ var CountrySelector = ({
4949
5025
  value: item.value,
4950
5026
  label: item.label[language]
4951
5027
  }));
4952
- return /* @__PURE__ */ jsx29(
5028
+ return /* @__PURE__ */ jsx33(
4953
5029
  SearchableSelect,
4954
5030
  {
4955
5031
  value,
@@ -4968,7 +5044,9 @@ export {
4968
5044
  ApprovalAnswerModal,
4969
5045
  ApprovalAnswerPage,
4970
5046
  ApprovalPreviewAnswer_default as ApprovalPreviewAnswer,
5047
+ ApprovalServices,
4971
5048
  ApprovalWorkflow_default as ApprovalWorkflow,
5049
+ AuthServices,
4972
5050
  Choices_default as CHOICES,
4973
5051
  CountrySelector,
4974
5052
  DateInput,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ptechcore_ui",
3
- "version": "1.0.18",
3
+ "version": "1.0.19",
4
4
  "type": "module",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",