UNPKG

koval-ui

Version:

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

26 lines (25 loc) 672 B
"use client"; import { useMemo as h, useState as x, useEffect as C } from "react"; import { ROW_SELECTION_ID as E } from "../columns/rowSelection.js"; const d = {}, z = (s, t) => { const e = t != null && t.right ? t == null ? void 0 : t.right : [], f = t != null && t.left ? t == null ? void 0 : t.left : []; return { right: e, left: s ? [E, ...f] : f }; }, O = ({ columnPinningProp: s = d, hasSelectableColumn: t }) => { const e = h( () => z(t, s), [s, t] ), [f, a] = x(e); return C(() => { a(e); }, [e]), { columnPinning: f, setColumnPinning: a }; }; export { O as useColumnPinning }; //# sourceMappingURL=useColumnPinning.js.map