synapse-react-client
Version:
[](https://badge.fury.io/js/synapse-react-client) [](https://github.com/prettier/prettie
27 lines (26 loc) • 724 B
JavaScript
import { jsx as l } from "react/jsx-runtime";
import { useMemo as s } from "react";
import { DebouncedInput as u } from "./DebouncedInput.js";
function f({
column: e,
table: t
}) {
const r = t.getPreFilteredRowModel().flatRows[0]?.getValue(e.id), i = e.getFilterValue() ?? "", a = s(
() => typeof r == "number" ? [] : Array.from(e.getFacetedUniqueValues().keys()).sort(),
[e.getFacetedUniqueValues()]
);
return /* @__PURE__ */ l(
u,
{
type: "text",
options: a,
initialValue: i,
onChange: (o) => e.setFilterValue(o),
label: `Filter by ${e.columnDef.header} (${e.getFacetedUniqueValues().size})`
}
);
}
export {
f as Filter
};
//# sourceMappingURL=Filter.js.map