@charlesgomes/leafcode-shared-lib-react 1.0.7 → 1.0.8

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.d.mts CHANGED
@@ -43,7 +43,7 @@ interface PaginatedResponse<T> {
43
43
  }
44
44
 
45
45
  interface ColumnCustom<T> {
46
- field: keyof T | "acoes" | string; // "acoes" não existe no User, então adicionamos manualmente
46
+ field: keyof T | "acoes" | "actions" | string;
47
47
  header: string;
48
48
  enableSorting?: boolean;
49
49
  size?: number;
package/dist/index.d.ts CHANGED
@@ -43,7 +43,7 @@ interface PaginatedResponse<T> {
43
43
  }
44
44
 
45
45
  interface ColumnCustom<T> {
46
- field: keyof T | "acoes" | string; // "acoes" não existe no User, então adicionamos manualmente
46
+ field: keyof T | "acoes" | "actions" | string;
47
47
  header: string;
48
48
  enableSorting?: boolean;
49
49
  size?: number;
package/dist/index.js CHANGED
@@ -336,7 +336,7 @@ function DynamicColumns({
336
336
  );
337
337
  }
338
338
  columns.forEach((col, idx) => {
339
- const isActionsCol = col.field === "acoes";
339
+ const isActionsCol = col.field === "acoes" || col.field === "actions";
340
340
  const width = isActionsCol && col?.size ? col.size + "rem" : "6rem";
341
341
  const placeholder = isLanguagePtBr ? "Procurar" : "Search";
342
342
  array.push(
@@ -352,7 +352,7 @@ function DynamicColumns({
352
352
  filterElement: col.filterElement ? (options) => col.filterElement?.(options, col.mask) ?? void 0 : void 0,
353
353
  filterMatchModeOptions: col.filterMatchModeOptions,
354
354
  filterPlaceholder: !isActionsCol ? placeholder : void 0,
355
- ...col.field !== "acoes" && {
355
+ ...(col.field !== "acoes" || col.field !== "actions") && {
356
356
  resizeable: col.enableResizeable ?? true
357
357
  },
358
358
  style: isActionsCol ? { width, minWidth: width, position: "relative" } : {},
@@ -454,7 +454,7 @@ function DataTableAdvancedFilterWrapper({
454
454
  const filtersKey = JSON.stringify(debouncedFilters);
455
455
  const globalFilterFields = (0, import_react4.useMemo)(() => {
456
456
  return columns?.filter(
457
- (col) => col.filterGlobal === true && col.field !== "acoes"
457
+ (col) => col.filterGlobal === true && (col.field !== "acoes" || col.field !== "actions")
458
458
  ).map((col) => col.field) ?? [];
459
459
  }, [columns]);
460
460
  const { data: customers, isLoading } = (0, import_react_query.useQuery)({
package/dist/index.mjs CHANGED
@@ -291,7 +291,7 @@ function DynamicColumns({
291
291
  );
292
292
  }
293
293
  columns.forEach((col, idx) => {
294
- const isActionsCol = col.field === "acoes";
294
+ const isActionsCol = col.field === "acoes" || col.field === "actions";
295
295
  const width = isActionsCol && col?.size ? col.size + "rem" : "6rem";
296
296
  const placeholder = isLanguagePtBr ? "Procurar" : "Search";
297
297
  array.push(
@@ -307,7 +307,7 @@ function DynamicColumns({
307
307
  filterElement: col.filterElement ? (options) => col.filterElement?.(options, col.mask) ?? void 0 : void 0,
308
308
  filterMatchModeOptions: col.filterMatchModeOptions,
309
309
  filterPlaceholder: !isActionsCol ? placeholder : void 0,
310
- ...col.field !== "acoes" && {
310
+ ...(col.field !== "acoes" || col.field !== "actions") && {
311
311
  resizeable: col.enableResizeable ?? true
312
312
  },
313
313
  style: isActionsCol ? { width, minWidth: width, position: "relative" } : {},
@@ -409,7 +409,7 @@ function DataTableAdvancedFilterWrapper({
409
409
  const filtersKey = JSON.stringify(debouncedFilters);
410
410
  const globalFilterFields = useMemo(() => {
411
411
  return columns?.filter(
412
- (col) => col.filterGlobal === true && col.field !== "acoes"
412
+ (col) => col.filterGlobal === true && (col.field !== "acoes" || col.field !== "actions")
413
413
  ).map((col) => col.field) ?? [];
414
414
  }, [columns]);
415
415
  const { data: customers, isLoading } = useQuery({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@charlesgomes/leafcode-shared-lib-react",
3
- "version": "1.0.7",
3
+ "version": "1.0.8",
4
4
  "description": "Lib de componentes react",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",