@charlesgomes/leafcode-shared-lib-react 1.0.23 → 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 +13 -2
- package/dist/index.mjs +13 -2
- package/package.json +1 -1
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) =>
|
|
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",
|
|
@@ -1060,7 +1071,7 @@ var SelectFilterTemplate = (options, isLanguagePtBr = true, items = []) => {
|
|
|
1060
1071
|
{ label: isLanguagePtBr ? "Sim" : "Yes", value: true },
|
|
1061
1072
|
{ label: isLanguagePtBr ? "N\xE3o" : "No", value: false }
|
|
1062
1073
|
];
|
|
1063
|
-
const currentValue = selectOptions.find((opt) => opt.value === options.value) ||
|
|
1074
|
+
const currentValue = selectOptions.find((opt) => opt.value === options.value) || null;
|
|
1064
1075
|
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
1065
1076
|
import_react_select.default,
|
|
1066
1077
|
{
|
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) =>
|
|
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",
|
|
@@ -1013,7 +1024,7 @@ var SelectFilterTemplate = (options, isLanguagePtBr = true, items = []) => {
|
|
|
1013
1024
|
{ label: isLanguagePtBr ? "Sim" : "Yes", value: true },
|
|
1014
1025
|
{ label: isLanguagePtBr ? "N\xE3o" : "No", value: false }
|
|
1015
1026
|
];
|
|
1016
|
-
const currentValue = selectOptions.find((opt) => opt.value === options.value) ||
|
|
1027
|
+
const currentValue = selectOptions.find((opt) => opt.value === options.value) || null;
|
|
1017
1028
|
return /* @__PURE__ */ jsx11(
|
|
1018
1029
|
Select,
|
|
1019
1030
|
{
|