ptechcore_ui 1.0.8 → 1.0.9

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
@@ -1769,7 +1769,7 @@ var FDrawer = ({
1769
1769
  }, {});
1770
1770
  const preFilters = columns.length > 0 ? makeFilters() : [];
1771
1771
  const [filters, setFilters] = (0, import_react7.useState)(
1772
- () => Object.keys(allParams).length > 0 ? allParams : { ...preFilters, center_id: activeBusinessEntity?.id ?? null, order_by: order_by ?? "id", page: 1 }
1772
+ () => Object.keys(allParams).length > 0 ? allParams : { ...preFilters, business_entity_id: activeBusinessEntity?.id ?? null, order_by: order_by ?? "id", page: 1 }
1773
1773
  );
1774
1774
  const getDataFilter = async () => {
1775
1775
  setLoading(true);
@@ -1793,7 +1793,7 @@ var FDrawer = ({
1793
1793
  };
1794
1794
  (0, import_react7.useEffect)(() => {
1795
1795
  const params = new URLSearchParams(filters).toString();
1796
- setQueryURL(`${API_URL}${apiEndpoint}?${params}`);
1796
+ setQueryURL(`${API_URL}${apiEndpoint}?${params}&business_entity_id=${activeBusinessEntity?.id ?? ""}`);
1797
1797
  navigate(`${location.pathname}?${params}`);
1798
1798
  }, [filters]);
1799
1799
  (0, import_react7.useEffect)(() => {
@@ -1881,7 +1881,7 @@ var FDrawer = ({
1881
1881
  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: [
1882
1882
  /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "flex align-center items-center gap-2", children: [
1883
1883
  /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { onClick: () => setShowFilters(showFilters === column.key ? "" : column.key), children: column.label }),
1884
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.ArrowDownUp, { className: "h-4 w-4 cursor-pointer", onClick: () => setShowOrdering(showOrdering === column.key ? "" : column.key) })
1884
+ column.sortable && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_lucide_react4.ArrowDownUp, { className: "h-4 w-4 cursor-pointer", onClick: () => setShowOrdering(showOrdering === column.key ? "" : column.key) })
1885
1885
  ] }),
1886
1886
  showOrdering === column.key && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "absolute left-6 mt-2 bg-[var(--color-background)] rounded-lg shadow-xl border border-[var(--color-border)] z-50 max-h-80 overflow-y-auto", role: "menu", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "p-2", children: [
1887
1887
  /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
package/dist/index.d.cts CHANGED
@@ -214,8 +214,8 @@ type FDrawerColumn = {
214
214
  type FDrawerLineAction = {
215
215
  label: string;
216
216
  permission: string;
217
- navigate: string;
218
- onclick: (item: any) => any;
217
+ navigate?: string;
218
+ onclick?: (item: any) => any;
219
219
  };
220
220
  interface FDrawerProps {
221
221
  children?: React.ReactNode;
package/dist/index.d.ts CHANGED
@@ -214,8 +214,8 @@ type FDrawerColumn = {
214
214
  type FDrawerLineAction = {
215
215
  label: string;
216
216
  permission: string;
217
- navigate: string;
218
- onclick: (item: any) => any;
217
+ navigate?: string;
218
+ onclick?: (item: any) => any;
219
219
  };
220
220
  interface FDrawerProps {
221
221
  children?: React.ReactNode;
package/dist/index.js CHANGED
@@ -1730,7 +1730,7 @@ var FDrawer = ({
1730
1730
  }, {});
1731
1731
  const preFilters = columns.length > 0 ? makeFilters() : [];
1732
1732
  const [filters, setFilters] = useState7(
1733
- () => Object.keys(allParams).length > 0 ? allParams : { ...preFilters, center_id: activeBusinessEntity?.id ?? null, order_by: order_by ?? "id", page: 1 }
1733
+ () => Object.keys(allParams).length > 0 ? allParams : { ...preFilters, business_entity_id: activeBusinessEntity?.id ?? null, order_by: order_by ?? "id", page: 1 }
1734
1734
  );
1735
1735
  const getDataFilter = async () => {
1736
1736
  setLoading(true);
@@ -1754,7 +1754,7 @@ var FDrawer = ({
1754
1754
  };
1755
1755
  useEffect5(() => {
1756
1756
  const params = new URLSearchParams(filters).toString();
1757
- setQueryURL(`${API_URL}${apiEndpoint}?${params}`);
1757
+ setQueryURL(`${API_URL}${apiEndpoint}?${params}&business_entity_id=${activeBusinessEntity?.id ?? ""}`);
1758
1758
  navigate(`${location.pathname}?${params}`);
1759
1759
  }, [filters]);
1760
1760
  useEffect5(() => {
@@ -1842,7 +1842,7 @@ var FDrawer = ({
1842
1842
  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: [
1843
1843
  /* @__PURE__ */ jsxs6("div", { className: "flex align-center items-center gap-2", children: [
1844
1844
  /* @__PURE__ */ jsx10("span", { onClick: () => setShowFilters(showFilters === column.key ? "" : column.key), children: column.label }),
1845
- /* @__PURE__ */ jsx10(ArrowDownUp, { className: "h-4 w-4 cursor-pointer", onClick: () => setShowOrdering(showOrdering === column.key ? "" : column.key) })
1845
+ column.sortable && /* @__PURE__ */ jsx10(ArrowDownUp, { className: "h-4 w-4 cursor-pointer", onClick: () => setShowOrdering(showOrdering === column.key ? "" : column.key) })
1846
1846
  ] }),
1847
1847
  showOrdering === column.key && /* @__PURE__ */ jsx10("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__ */ jsxs6("div", { className: "p-2", children: [
1848
1848
  /* @__PURE__ */ jsx10(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ptechcore_ui",
3
- "version": "1.0.8",
3
+ "version": "1.0.9",
4
4
  "type": "module",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",