UNPKG

koval-ui

Version:

React components collection with minimalistic design. Supports theming, layout, and input validation.

42 lines (41 loc) 1.44 kB
"use client"; import { jsxs as a, jsx as e } from "react/jsx-runtime"; import { useCallback as t } from "react"; import { IconUnPin as f } from "../../../internal/Icons/IconUnPin.js"; import { IconFilterOff as u } from "../../../internal/Icons/IconFilterOff.js"; import { IconSortOff as d } from "../../../internal/Icons/IconSortOff.js"; import n from "./Cells.module.css.js"; const B = ({ cellContext: o }) => { const s = o.column.getIsFiltered(), r = !!o.column.getIsSorted(), i = !!o.column.getIsPinned(), l = t(() => { o.column.setFilterValue(""); }, [o]), c = t(() => { o.column.clearSorting(); }, [o]), m = t(() => { o.column.pin(!1); }, [o]); return /* @__PURE__ */ a("div", { className: n.footerCell, children: [ s && /* @__PURE__ */ e( "button", { className: n.footerButton, title: "Reset filter", onClick: l, children: /* @__PURE__ */ e(u, { className: n.footerIcon }) } ), r && /* @__PURE__ */ e( "button", { className: n.footerButton, title: "Reset sorting", onClick: c, children: /* @__PURE__ */ e(d, { className: n.footerIcon }) } ), i && /* @__PURE__ */ e("button", { className: n.footerButton, title: "Unpin column", onClick: m, children: /* @__PURE__ */ e(f, { className: n.footerIcon }) }) ] }); }; export { B as ColumnFooterCell }; //# sourceMappingURL=ColumnFooterCell.js.map