@charlesgomes/leafcode-shared-lib-react 1.0.24 → 1.0.25

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
@@ -749,7 +749,18 @@ function DataTableAdvancedFilterWrapper({
749
749
  paginatorLeft: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "paginatorLeft", children: TableHeaderAndTableActions }),
750
750
  currentPageReportTemplate: "Mostrando {first} a {last} de {totalRecords}",
751
751
  emptyMessage: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "mensagem-nenhum-dado", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { children: isLanguagePtBr ? "Nenhum dado encontrado" : "No data found" }) }),
752
- onFilter: (e) => setFilters(e.filters),
752
+ onFilter: (e) => {
753
+ const newFilters = { ...e.filters };
754
+ Object.keys(filters).forEach((key) => {
755
+ if (filters[key]?.collection && newFilters[key]) {
756
+ newFilters[key] = {
757
+ ...newFilters[key],
758
+ collection: filters[key].collection
759
+ };
760
+ }
761
+ });
762
+ setFilters(newFilters);
763
+ },
753
764
  rowsPerPageOptions: [10, 25, 50, 100],
754
765
  className: "p-datatable-sm",
755
766
  paginatorClassName: "paginatorClassName",
package/dist/index.mjs CHANGED
@@ -702,7 +702,18 @@ function DataTableAdvancedFilterWrapper({
702
702
  paginatorLeft: /* @__PURE__ */ jsx9("div", { className: "paginatorLeft", children: TableHeaderAndTableActions }),
703
703
  currentPageReportTemplate: "Mostrando {first} a {last} de {totalRecords}",
704
704
  emptyMessage: /* @__PURE__ */ jsx9("div", { className: "mensagem-nenhum-dado", children: /* @__PURE__ */ jsx9("p", { children: isLanguagePtBr ? "Nenhum dado encontrado" : "No data found" }) }),
705
- onFilter: (e) => setFilters(e.filters),
705
+ onFilter: (e) => {
706
+ const newFilters = { ...e.filters };
707
+ Object.keys(filters).forEach((key) => {
708
+ if (filters[key]?.collection && newFilters[key]) {
709
+ newFilters[key] = {
710
+ ...newFilters[key],
711
+ collection: filters[key].collection
712
+ };
713
+ }
714
+ });
715
+ setFilters(newFilters);
716
+ },
706
717
  rowsPerPageOptions: [10, 25, 50, 100],
707
718
  className: "p-datatable-sm",
708
719
  paginatorClassName: "paginatorClassName",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@charlesgomes/leafcode-shared-lib-react",
3
- "version": "1.0.24",
3
+ "version": "1.0.25",
4
4
  "description": "Lib de componentes react",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",