@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.mjs CHANGED
@@ -1681,14 +1681,14 @@ var DataTableFilter = React10.memo(function DataTableFilter2({
1681
1681
  const filterValue = column?.getFilterValue() ?? [];
1682
1682
  const [localValue, setLocalValue] = React10.useState("all");
1683
1683
  const currentValue = column ? filterValue.length > 0 ? filterValue[0] : "all" : localValue;
1684
+ const isServerSide = !!onServerValueChange;
1684
1685
  const handleValueChange = React10.useCallback(
1685
1686
  (value) => {
1686
1687
  const resolvedValue = value === "all" ? void 0 : value;
1687
- if (column) {
1688
- column.setFilterValue(resolvedValue ? [resolvedValue] : void 0);
1689
- }
1690
- if (onServerValueChange) {
1688
+ if (isServerSide) {
1691
1689
  onServerValueChange(resolvedValue);
1690
+ } else if (column) {
1691
+ column.setFilterValue(resolvedValue ? [resolvedValue] : void 0);
1692
1692
  }
1693
1693
  setLocalValue(value);
1694
1694
  },
@@ -1704,7 +1704,10 @@ var DataTableFilter = React10.memo(function DataTableFilter2({
1704
1704
  className,
1705
1705
  children: [
1706
1706
  /* @__PURE__ */ jsx(SelectItem, { value: "all", children: "Todos" }),
1707
- options.map((option) => /* @__PURE__ */ jsx(SelectItem, { value: option.value, children: option.label }, option.value))
1707
+ options.map((option) => /* @__PURE__ */ jsx(SelectItem, { value: option.value, children: /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2", children: [
1708
+ option.icon && /* @__PURE__ */ jsx("span", { className: "shrink-0 text-muted-foreground", children: option.icon }),
1709
+ option.label
1710
+ ] }) }, option.value))
1708
1711
  ]
1709
1712
  }
1710
1713
  );