ptechcore_ui 1.0.9 → 1.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -960,6 +960,7 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "De
960
960
  onClick: () => {
961
961
  if (item.path) {
962
962
  navigate(item.path);
963
+ setSecondaryCollapsed(false);
963
964
  } else {
964
965
  setSelectedModule(item.id);
965
966
  }
@@ -1763,6 +1764,7 @@ var FDrawer = ({
1763
1764
  next: null,
1764
1765
  current_page: null
1765
1766
  });
1767
+ const [searchQuery, setSearchQuery] = (0, import_react7.useState)("");
1766
1768
  const makeFilters = () => columns.reduce((acc, item) => {
1767
1769
  acc[item.formule ? `${item.search_name}__icontains` : `${item.key}__icontains`] = "";
1768
1770
  return acc;
@@ -1793,10 +1795,11 @@ var FDrawer = ({
1793
1795
  };
1794
1796
  (0, import_react7.useEffect)(() => {
1795
1797
  const params = new URLSearchParams(filters).toString();
1796
- setQueryURL(`${API_URL}${apiEndpoint}?${params}&business_entity_id=${activeBusinessEntity?.id ?? ""}`);
1798
+ setQueryURL(`${API_URL}${apiEndpoint}?${params}`);
1797
1799
  navigate(`${location.pathname}?${params}`);
1798
1800
  }, [filters]);
1799
1801
  (0, import_react7.useEffect)(() => {
1802
+ if (!activeBusinessEntity) return;
1800
1803
  getDataFilter();
1801
1804
  }, [activeBusinessEntity, queryURL, toggle]);
1802
1805
  const renderColumnFilter = (column) => {
@@ -1876,6 +1879,54 @@ var FDrawer = ({
1876
1879
  return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("td", { className: "px-6 py-4 whitespace-nowrap text-sm text-gray-500", children: cellContent }, column.key);
1877
1880
  });
1878
1881
  return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
1882
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex flex-wrap gap-4", children: [
1883
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "flex-1 min-w-64", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "relative", children: [
1884
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.Search, { className: "absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 h-4 w-4" }),
1885
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
1886
+ "input",
1887
+ {
1888
+ type: "text",
1889
+ placeholder: "Rechercher une demande...",
1890
+ className: "w-full pl-10 pr-4 py-2 border border-[#d1d7de] rounded-lg focus:ring-2 focus:ring-[#78a6d2] focus:border-transparent",
1891
+ value: searchQuery,
1892
+ onChange: (e) => setSearchQuery(e.target.value)
1893
+ }
1894
+ )
1895
+ ] }) }),
1896
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
1897
+ Buttons_default,
1898
+ {
1899
+ onClick: () => {
1900
+ },
1901
+ children: [
1902
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.Filter, { className: "h-4 w-4 mr-2" }),
1903
+ "Filtres"
1904
+ ]
1905
+ }
1906
+ ),
1907
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
1908
+ Buttons_default,
1909
+ {
1910
+ onClick: () => {
1911
+ },
1912
+ children: [
1913
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.Download, { className: "h-4 w-4 mr-2" }),
1914
+ "Exporter"
1915
+ ]
1916
+ }
1917
+ ),
1918
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
1919
+ Buttons_default,
1920
+ {
1921
+ onClick: () => {
1922
+ },
1923
+ children: [
1924
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.Printer, { className: "h-4 w-4 mr-2" }),
1925
+ "Imprimer"
1926
+ ]
1927
+ }
1928
+ )
1929
+ ] }),
1879
1930
  /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("table", { className: "w-full", children: [
1880
1931
  /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("thead", { className: "bg-gray-50", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("tr", { children: [
1881
1932
  columns.map((column) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("th", { className: "px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider relative", scope: "col", children: [
package/dist/index.js CHANGED
@@ -921,6 +921,7 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "De
921
921
  onClick: () => {
922
922
  if (item.path) {
923
923
  navigate(item.path);
924
+ setSecondaryCollapsed(false);
924
925
  } else {
925
926
  setSelectedModule(item.id);
926
927
  }
@@ -1696,7 +1697,7 @@ var UserServices = {
1696
1697
  // src/components/common/FDrawer.tsx
1697
1698
  import { useEffect as useEffect5, useState as useState7 } from "react";
1698
1699
  import { useLocation as useLocation2, useNavigate as useNavigate2, useSearchParams, Link as Link2 } from "react-router-dom";
1699
- import { ArrowDownAZ, ArrowDownUp, ArrowUpAZ, MoreVertical } from "lucide-react";
1700
+ import { ArrowDownAZ, ArrowDownUp, ArrowUpAZ, Download as Download2, Filter, MoreVertical, Printer, Search as Search2 } from "lucide-react";
1700
1701
  import { Fragment as Fragment3, jsx as jsx10, jsxs as jsxs6 } from "react/jsx-runtime";
1701
1702
  var FDrawer = ({
1702
1703
  children,
@@ -1724,6 +1725,7 @@ var FDrawer = ({
1724
1725
  next: null,
1725
1726
  current_page: null
1726
1727
  });
1728
+ const [searchQuery, setSearchQuery] = useState7("");
1727
1729
  const makeFilters = () => columns.reduce((acc, item) => {
1728
1730
  acc[item.formule ? `${item.search_name}__icontains` : `${item.key}__icontains`] = "";
1729
1731
  return acc;
@@ -1754,10 +1756,11 @@ var FDrawer = ({
1754
1756
  };
1755
1757
  useEffect5(() => {
1756
1758
  const params = new URLSearchParams(filters).toString();
1757
- setQueryURL(`${API_URL}${apiEndpoint}?${params}&business_entity_id=${activeBusinessEntity?.id ?? ""}`);
1759
+ setQueryURL(`${API_URL}${apiEndpoint}?${params}`);
1758
1760
  navigate(`${location.pathname}?${params}`);
1759
1761
  }, [filters]);
1760
1762
  useEffect5(() => {
1763
+ if (!activeBusinessEntity) return;
1761
1764
  getDataFilter();
1762
1765
  }, [activeBusinessEntity, queryURL, toggle]);
1763
1766
  const renderColumnFilter = (column) => {
@@ -1837,6 +1840,54 @@ var FDrawer = ({
1837
1840
  return /* @__PURE__ */ jsx10("td", { className: "px-6 py-4 whitespace-nowrap text-sm text-gray-500", children: cellContent }, column.key);
1838
1841
  });
1839
1842
  return /* @__PURE__ */ jsxs6(Fragment3, { children: [
1843
+ /* @__PURE__ */ jsxs6("div", { className: "flex flex-wrap gap-4", children: [
1844
+ /* @__PURE__ */ jsx10("div", { className: "flex-1 min-w-64", children: /* @__PURE__ */ jsxs6("div", { className: "relative", children: [
1845
+ /* @__PURE__ */ jsx10(Search2, { className: "absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 h-4 w-4" }),
1846
+ /* @__PURE__ */ jsx10(
1847
+ "input",
1848
+ {
1849
+ type: "text",
1850
+ placeholder: "Rechercher une demande...",
1851
+ className: "w-full pl-10 pr-4 py-2 border border-[#d1d7de] rounded-lg focus:ring-2 focus:ring-[#78a6d2] focus:border-transparent",
1852
+ value: searchQuery,
1853
+ onChange: (e) => setSearchQuery(e.target.value)
1854
+ }
1855
+ )
1856
+ ] }) }),
1857
+ /* @__PURE__ */ jsxs6(
1858
+ Buttons_default,
1859
+ {
1860
+ onClick: () => {
1861
+ },
1862
+ children: [
1863
+ /* @__PURE__ */ jsx10(Filter, { className: "h-4 w-4 mr-2" }),
1864
+ "Filtres"
1865
+ ]
1866
+ }
1867
+ ),
1868
+ /* @__PURE__ */ jsxs6(
1869
+ Buttons_default,
1870
+ {
1871
+ onClick: () => {
1872
+ },
1873
+ children: [
1874
+ /* @__PURE__ */ jsx10(Download2, { className: "h-4 w-4 mr-2" }),
1875
+ "Exporter"
1876
+ ]
1877
+ }
1878
+ ),
1879
+ /* @__PURE__ */ jsxs6(
1880
+ Buttons_default,
1881
+ {
1882
+ onClick: () => {
1883
+ },
1884
+ children: [
1885
+ /* @__PURE__ */ jsx10(Printer, { className: "h-4 w-4 mr-2" }),
1886
+ "Imprimer"
1887
+ ]
1888
+ }
1889
+ )
1890
+ ] }),
1840
1891
  /* @__PURE__ */ jsxs6("table", { className: "w-full", children: [
1841
1892
  /* @__PURE__ */ jsx10("thead", { className: "bg-gray-50", children: /* @__PURE__ */ jsxs6("tr", { children: [
1842
1893
  columns.map((column) => /* @__PURE__ */ jsxs6("th", { className: "px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider relative", scope: "col", children: [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ptechcore_ui",
3
- "version": "1.0.9",
3
+ "version": "1.0.10",
4
4
  "type": "module",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",