@facter/ds-core 1.19.0 → 1.20.0
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 +8 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1712,14 +1712,14 @@ var DataTableFilter = React10__namespace.memo(function DataTableFilter2({
|
|
|
1712
1712
|
const filterValue = column?.getFilterValue() ?? [];
|
|
1713
1713
|
const [localValue, setLocalValue] = React10__namespace.useState("all");
|
|
1714
1714
|
const currentValue = column ? filterValue.length > 0 ? filterValue[0] : "all" : localValue;
|
|
1715
|
+
const isServerSide = !!onServerValueChange;
|
|
1715
1716
|
const handleValueChange = React10__namespace.useCallback(
|
|
1716
1717
|
(value) => {
|
|
1717
1718
|
const resolvedValue = value === "all" ? void 0 : value;
|
|
1718
|
-
if (
|
|
1719
|
-
column.setFilterValue(resolvedValue ? [resolvedValue] : void 0);
|
|
1720
|
-
}
|
|
1721
|
-
if (onServerValueChange) {
|
|
1719
|
+
if (isServerSide) {
|
|
1722
1720
|
onServerValueChange(resolvedValue);
|
|
1721
|
+
} else if (column) {
|
|
1722
|
+
column.setFilterValue(resolvedValue ? [resolvedValue] : void 0);
|
|
1723
1723
|
}
|
|
1724
1724
|
setLocalValue(value);
|
|
1725
1725
|
},
|
|
@@ -1735,7 +1735,10 @@ var DataTableFilter = React10__namespace.memo(function DataTableFilter2({
|
|
|
1735
1735
|
className,
|
|
1736
1736
|
children: [
|
|
1737
1737
|
/* @__PURE__ */ jsxRuntime.jsx(SelectItem, { value: "all", children: "Todos" }),
|
|
1738
|
-
options.map((option) => /* @__PURE__ */ jsxRuntime.jsx(SelectItem, { value: option.value, children:
|
|
1738
|
+
options.map((option) => /* @__PURE__ */ jsxRuntime.jsx(SelectItem, { value: option.value, children: /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex items-center gap-2", children: [
|
|
1739
|
+
option.icon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0 text-muted-foreground", children: option.icon }),
|
|
1740
|
+
option.label
|
|
1741
|
+
] }) }, option.value))
|
|
1739
1742
|
]
|
|
1740
1743
|
}
|
|
1741
1744
|
);
|