@juv/codego-react-ui 3.1.4 → 3.1.5

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
@@ -4904,7 +4904,7 @@ Input.displayName = "Input";
4904
4904
 
4905
4905
  // src/components/ui/data-grid.tsx
4906
4906
  var import_jsx_runtime28 = require("react/jsx-runtime");
4907
- function useServerDataGrid({ url, params, encrypt, key }) {
4907
+ function useServerDataGrid({ url, params, encrypt, key, decryptPayloadLog }) {
4908
4908
  const [data, setData] = React24.useState([]);
4909
4909
  const [columns, setColumns] = React24.useState([]);
4910
4910
  const [currentPage, setCurrentPage] = React24.useState(1);
@@ -4919,6 +4919,7 @@ function useServerDataGrid({ url, params, encrypt, key }) {
4919
4919
  import_axios.default.get(url, { params: { ...params, page: currentPage } }).then(({ data: res }) => {
4920
4920
  if (cancelled) return;
4921
4921
  const payload = encrypt ? decryptLaravelPayload(res, key) : res;
4922
+ if (encrypt && decryptPayloadLog) console.log("[useServerDataGrid] decrypted payload:", payload);
4922
4923
  setData(payload.data);
4923
4924
  const rawTotal = payload.total;
4924
4925
  const rawPerPage = payload.per_page;
@@ -4952,7 +4953,7 @@ function useServerDataGrid({ url, params, encrypt, key }) {
4952
4953
  return () => {
4953
4954
  cancelled = true;
4954
4955
  };
4955
- }, [url, currentPage, tick, JSON.stringify(params)]);
4956
+ }, [url, currentPage, tick, JSON.stringify(params), encrypt, decryptPayloadLog]);
4956
4957
  return {
4957
4958
  data,
4958
4959
  columns,
@@ -9568,7 +9569,7 @@ var import_react_dom2 = require("react-dom");
9568
9569
  var import_axios2 = __toESM(require("axios"), 1);
9569
9570
  var import_lucide_react28 = require("lucide-react");
9570
9571
  var import_jsx_runtime55 = require("react/jsx-runtime");
9571
- function useServerTable({ url, params, encrypt, key }) {
9572
+ function useServerTable({ url, params, encrypt, key, decryptPayloadLog }) {
9572
9573
  const [data, setData] = React44.useState([]);
9573
9574
  const [columns, setColumns] = React44.useState([]);
9574
9575
  const [currentPage, setCurrentPage] = React44.useState(1);
@@ -9585,6 +9586,7 @@ function useServerTable({ url, params, encrypt, key }) {
9585
9586
  }).then(({ data: res }) => {
9586
9587
  if (cancelled) return;
9587
9588
  const payload = encrypt ? decryptLaravelPayload(res, key) : res;
9589
+ if (encrypt && decryptPayloadLog) console.log("[useServerTable] decrypted payload:", payload);
9588
9590
  setData(payload.data);
9589
9591
  const rawTotal = payload.total;
9590
9592
  const rawPerPage = payload.per_page;
@@ -9618,7 +9620,7 @@ function useServerTable({ url, params, encrypt, key }) {
9618
9620
  return () => {
9619
9621
  cancelled = true;
9620
9622
  };
9621
- }, [url, currentPage, tick, JSON.stringify(params)]);
9623
+ }, [url, currentPage, tick, JSON.stringify(params), encrypt, decryptPayloadLog]);
9622
9624
  return {
9623
9625
  data,
9624
9626
  columns,
package/dist/index.d.cts CHANGED
@@ -365,6 +365,8 @@ interface UseServerTableOptions {
365
365
  encrypt?: boolean;
366
366
  /** Laravel APP_KEY used for decryption. Pass import.meta.env["VITE_LARAVEL_KEY"] */
367
367
  key?: string;
368
+ /** If true, logs the decrypted payload to the console */
369
+ decryptPayloadLog?: boolean;
368
370
  }
369
371
  interface UseServerTableReturn<T> {
370
372
  data: T[];
@@ -382,7 +384,7 @@ interface ServerPaginationProp {
382
384
  currentPage: number;
383
385
  goToPage: (page: number) => void;
384
386
  }
385
- declare function useServerTable<T extends Record<string, any>>({ url, params, encrypt, key }: UseServerTableOptions): UseServerTableReturn<T>;
387
+ declare function useServerTable<T extends Record<string, any>>({ url, params, encrypt, key, decryptPayloadLog }: UseServerTableOptions): UseServerTableReturn<T>;
386
388
  type ActionFieldType = "input" | "password" | "textarea" | "checkbox" | "toggle" | "select" | "radio" | "slider" | "tag-input" | "otp" | "combobox" | "color-picker" | "date-range" | "rich-text" | "file-upload" | "repeater";
387
389
  interface ActionField {
388
390
  key: string;
@@ -473,6 +475,8 @@ interface UseServerDataGridOptions {
473
475
  encrypt?: boolean;
474
476
  /** Laravel APP_KEY used for decryption. Pass import.meta.env["VITE_LARAVEL_KEY"] */
475
477
  key?: string;
478
+ /** If true, logs the decrypted payload to the console */
479
+ decryptPayloadLog?: boolean;
476
480
  }
477
481
  interface UseServerDataGridReturn<T> {
478
482
  data: T[];
@@ -485,7 +489,7 @@ interface UseServerDataGridReturn<T> {
485
489
  goToPage: (page: number) => void;
486
490
  reload: () => void;
487
491
  }
488
- declare function useServerDataGrid<T extends Record<string, any>>({ url, params, encrypt, key }: UseServerDataGridOptions): UseServerDataGridReturn<T>;
492
+ declare function useServerDataGrid<T extends Record<string, any>>({ url, params, encrypt, key, decryptPayloadLog }: UseServerDataGridOptions): UseServerDataGridReturn<T>;
489
493
  type SortDir = "asc" | "desc" | null;
490
494
  interface DataGridColumn<T> {
491
495
  key: keyof T | string;
package/dist/index.d.ts CHANGED
@@ -365,6 +365,8 @@ interface UseServerTableOptions {
365
365
  encrypt?: boolean;
366
366
  /** Laravel APP_KEY used for decryption. Pass import.meta.env["VITE_LARAVEL_KEY"] */
367
367
  key?: string;
368
+ /** If true, logs the decrypted payload to the console */
369
+ decryptPayloadLog?: boolean;
368
370
  }
369
371
  interface UseServerTableReturn<T> {
370
372
  data: T[];
@@ -382,7 +384,7 @@ interface ServerPaginationProp {
382
384
  currentPage: number;
383
385
  goToPage: (page: number) => void;
384
386
  }
385
- declare function useServerTable<T extends Record<string, any>>({ url, params, encrypt, key }: UseServerTableOptions): UseServerTableReturn<T>;
387
+ declare function useServerTable<T extends Record<string, any>>({ url, params, encrypt, key, decryptPayloadLog }: UseServerTableOptions): UseServerTableReturn<T>;
386
388
  type ActionFieldType = "input" | "password" | "textarea" | "checkbox" | "toggle" | "select" | "radio" | "slider" | "tag-input" | "otp" | "combobox" | "color-picker" | "date-range" | "rich-text" | "file-upload" | "repeater";
387
389
  interface ActionField {
388
390
  key: string;
@@ -473,6 +475,8 @@ interface UseServerDataGridOptions {
473
475
  encrypt?: boolean;
474
476
  /** Laravel APP_KEY used for decryption. Pass import.meta.env["VITE_LARAVEL_KEY"] */
475
477
  key?: string;
478
+ /** If true, logs the decrypted payload to the console */
479
+ decryptPayloadLog?: boolean;
476
480
  }
477
481
  interface UseServerDataGridReturn<T> {
478
482
  data: T[];
@@ -485,7 +489,7 @@ interface UseServerDataGridReturn<T> {
485
489
  goToPage: (page: number) => void;
486
490
  reload: () => void;
487
491
  }
488
- declare function useServerDataGrid<T extends Record<string, any>>({ url, params, encrypt, key }: UseServerDataGridOptions): UseServerDataGridReturn<T>;
492
+ declare function useServerDataGrid<T extends Record<string, any>>({ url, params, encrypt, key, decryptPayloadLog }: UseServerDataGridOptions): UseServerDataGridReturn<T>;
489
493
  type SortDir = "asc" | "desc" | null;
490
494
  interface DataGridColumn<T> {
491
495
  key: keyof T | string;
@@ -68028,7 +68028,7 @@ ${n2.shaderPreludeCode.vertexSource}`, define: n2.shaderDefine }, defaultProject
68028
68028
 
68029
68029
  // src/components/ui/data-grid.tsx
68030
68030
  var import_jsx_runtime28 = __toESM(require_jsx_runtime(), 1);
68031
- function useServerDataGrid({ url: url2, params, encrypt, key }) {
68031
+ function useServerDataGrid({ url: url2, params, encrypt, key, decryptPayloadLog }) {
68032
68032
  const [data, setData] = React24.useState([]);
68033
68033
  const [columns, setColumns] = React24.useState([]);
68034
68034
  const [currentPage, setCurrentPage] = React24.useState(1);
@@ -68043,6 +68043,7 @@ ${n2.shaderPreludeCode.vertexSource}`, define: n2.shaderDefine }, defaultProject
68043
68043
  axios_default.get(url2, { params: { ...params, page: currentPage } }).then(({ data: res }) => {
68044
68044
  if (cancelled) return;
68045
68045
  const payload = encrypt ? decryptLaravelPayload(res, key) : res;
68046
+ if (encrypt && decryptPayloadLog) console.log("[useServerDataGrid] decrypted payload:", payload);
68046
68047
  setData(payload.data);
68047
68048
  const rawTotal = payload.total;
68048
68049
  const rawPerPage = payload.per_page;
@@ -68076,7 +68077,7 @@ ${n2.shaderPreludeCode.vertexSource}`, define: n2.shaderDefine }, defaultProject
68076
68077
  return () => {
68077
68078
  cancelled = true;
68078
68079
  };
68079
- }, [url2, currentPage, tick, JSON.stringify(params)]);
68080
+ }, [url2, currentPage, tick, JSON.stringify(params), encrypt, decryptPayloadLog]);
68080
68081
  return {
68081
68082
  data,
68082
68083
  columns,
@@ -73103,7 +73104,7 @@ ${n2.shaderPreludeCode.vertexSource}`, define: n2.shaderDefine }, defaultProject
73103
73104
  var React46 = __toESM(require_react(), 1);
73104
73105
  var import_react_dom3 = __toESM(require_react_dom(), 1);
73105
73106
  var import_jsx_runtime55 = __toESM(require_jsx_runtime(), 1);
73106
- function useServerTable({ url: url2, params, encrypt, key }) {
73107
+ function useServerTable({ url: url2, params, encrypt, key, decryptPayloadLog }) {
73107
73108
  const [data, setData] = React46.useState([]);
73108
73109
  const [columns, setColumns] = React46.useState([]);
73109
73110
  const [currentPage, setCurrentPage] = React46.useState(1);
@@ -73120,6 +73121,7 @@ ${n2.shaderPreludeCode.vertexSource}`, define: n2.shaderDefine }, defaultProject
73120
73121
  }).then(({ data: res }) => {
73121
73122
  if (cancelled) return;
73122
73123
  const payload = encrypt ? decryptLaravelPayload(res, key) : res;
73124
+ if (encrypt && decryptPayloadLog) console.log("[useServerTable] decrypted payload:", payload);
73123
73125
  setData(payload.data);
73124
73126
  const rawTotal = payload.total;
73125
73127
  const rawPerPage = payload.per_page;
@@ -73153,7 +73155,7 @@ ${n2.shaderPreludeCode.vertexSource}`, define: n2.shaderDefine }, defaultProject
73153
73155
  return () => {
73154
73156
  cancelled = true;
73155
73157
  };
73156
- }, [url2, currentPage, tick, JSON.stringify(params)]);
73158
+ }, [url2, currentPage, tick, JSON.stringify(params), encrypt, decryptPayloadLog]);
73157
73159
  return {
73158
73160
  data,
73159
73161
  columns,
package/dist/index.js CHANGED
@@ -4790,7 +4790,7 @@ Input.displayName = "Input";
4790
4790
 
4791
4791
  // src/components/ui/data-grid.tsx
4792
4792
  import { Fragment as Fragment9, jsx as jsx28, jsxs as jsxs27 } from "react/jsx-runtime";
4793
- function useServerDataGrid({ url, params, encrypt, key }) {
4793
+ function useServerDataGrid({ url, params, encrypt, key, decryptPayloadLog }) {
4794
4794
  const [data, setData] = React24.useState([]);
4795
4795
  const [columns, setColumns] = React24.useState([]);
4796
4796
  const [currentPage, setCurrentPage] = React24.useState(1);
@@ -4805,6 +4805,7 @@ function useServerDataGrid({ url, params, encrypt, key }) {
4805
4805
  axios.get(url, { params: { ...params, page: currentPage } }).then(({ data: res }) => {
4806
4806
  if (cancelled) return;
4807
4807
  const payload = encrypt ? decryptLaravelPayload(res, key) : res;
4808
+ if (encrypt && decryptPayloadLog) console.log("[useServerDataGrid] decrypted payload:", payload);
4808
4809
  setData(payload.data);
4809
4810
  const rawTotal = payload.total;
4810
4811
  const rawPerPage = payload.per_page;
@@ -4838,7 +4839,7 @@ function useServerDataGrid({ url, params, encrypt, key }) {
4838
4839
  return () => {
4839
4840
  cancelled = true;
4840
4841
  };
4841
- }, [url, currentPage, tick, JSON.stringify(params)]);
4842
+ }, [url, currentPage, tick, JSON.stringify(params), encrypt, decryptPayloadLog]);
4842
4843
  return {
4843
4844
  data,
4844
4845
  columns,
@@ -9454,7 +9455,7 @@ import { createPortal as createPortal4 } from "react-dom";
9454
9455
  import axios2 from "axios";
9455
9456
  import { ChevronLeft as ChevronLeft6, ChevronRight as ChevronRight9, Search as Search5, Trash2 as Trash23, ChevronsUpDown as ChevronsUpDown2, ChevronUp as ChevronUp2, ChevronDown as ChevronDown7, X as X13, Eye as Eye2, Pencil as Pencil2, Trash as Trash3, Loader2 as Loader22 } from "lucide-react";
9456
9457
  import { Fragment as Fragment15, jsx as jsx55, jsxs as jsxs48 } from "react/jsx-runtime";
9457
- function useServerTable({ url, params, encrypt, key }) {
9458
+ function useServerTable({ url, params, encrypt, key, decryptPayloadLog }) {
9458
9459
  const [data, setData] = React44.useState([]);
9459
9460
  const [columns, setColumns] = React44.useState([]);
9460
9461
  const [currentPage, setCurrentPage] = React44.useState(1);
@@ -9471,6 +9472,7 @@ function useServerTable({ url, params, encrypt, key }) {
9471
9472
  }).then(({ data: res }) => {
9472
9473
  if (cancelled) return;
9473
9474
  const payload = encrypt ? decryptLaravelPayload(res, key) : res;
9475
+ if (encrypt && decryptPayloadLog) console.log("[useServerTable] decrypted payload:", payload);
9474
9476
  setData(payload.data);
9475
9477
  const rawTotal = payload.total;
9476
9478
  const rawPerPage = payload.per_page;
@@ -9504,7 +9506,7 @@ function useServerTable({ url, params, encrypt, key }) {
9504
9506
  return () => {
9505
9507
  cancelled = true;
9506
9508
  };
9507
- }, [url, currentPage, tick, JSON.stringify(params)]);
9509
+ }, [url, currentPage, tick, JSON.stringify(params), encrypt, decryptPayloadLog]);
9508
9510
  return {
9509
9511
  data,
9510
9512
  columns,
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "registry": "https://registry.npmjs.org/",
5
5
  "access": "public"
6
6
  },
7
- "version": "3.1.4",
7
+ "version": "3.1.5",
8
8
  "description": "Reusable React UI components",
9
9
  "license": "MIT",
10
10
  "main": "dist/index.js",