@facter/ds-core 1.18.0 → 1.19.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 CHANGED
@@ -1656,21 +1656,21 @@ var DataTableSearch = React10__namespace.memo(function DataTableSearch2({
1656
1656
  columnInstance?.getFilterValue() ?? ""
1657
1657
  );
1658
1658
  const debouncedValue = useDebounce(value, debounce);
1659
+ const isServerSide = !!onSearch;
1659
1660
  React10__namespace.useEffect(() => {
1660
- if (columnInstance) {
1661
- columnInstance.setFilterValue(debouncedValue || void 0);
1662
- }
1663
- if (onSearch) {
1661
+ if (isServerSide) {
1664
1662
  onSearch(debouncedValue);
1663
+ } else if (columnInstance) {
1664
+ columnInstance.setFilterValue(debouncedValue || void 0);
1665
1665
  }
1666
- }, [debouncedValue, columnInstance, onSearch]);
1666
+ }, [debouncedValue, columnInstance, onSearch, isServerSide]);
1667
1667
  React10__namespace.useEffect(() => {
1668
- if (!columnInstance) return;
1668
+ if (isServerSide || !columnInstance) return;
1669
1669
  const filterValue = columnInstance.getFilterValue() ?? "";
1670
1670
  if (filterValue !== value) {
1671
1671
  setValue(filterValue);
1672
1672
  }
1673
- }, [columnInstance?.getFilterValue()]);
1673
+ }, [columnInstance?.getFilterValue(), isServerSide]);
1674
1674
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("relative w-[150px] lg:w-[250px]", className), children: [
1675
1675
  /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Search, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground pointer-events-none" }),
1676
1676
  /* @__PURE__ */ jsxRuntime.jsx(