synapse-react-client
Version:
[](https://badge.fury.io/js/synapse-react-client) [](https://github.com/prettier/prettie
50 lines (49 loc) • 1.13 kB
JavaScript
import { atom as t, useAtomValue as u } from "jotai";
import { isEqual as l } from "lodash-es";
function A(e, o, n) {
let r = l;
return n && o ? r = (s, a) => {
const f = n.map(
(i) => s.values[o.findIndex((m) => m.name === i)]
), w = n.map(
(i) => a.values[o.findIndex((m) => m.name === i)]
);
return l(f, w);
} : e.rowId && (r = (s, a) => s.rowId === a.rowId), r;
}
const V = t(!1), I = t(!0), d = t(void 0);
function y() {
return u(d);
}
const c = t([]);
function v() {
return u(c);
}
const x = t(
(e) => (o, n) => {
const r = A(
o,
n,
e(d)
);
return e(c).some(
(s) => r(s, o)
);
}
), R = t((e) => e(c).length > 0);
function g() {
return u(R);
}
export {
A as getRowSelectionEqualityComparator,
R as hasSelectedRowsAtom,
x as isRowSelectedAtom,
I as isRowSelectionUIFloatingAtom,
V as isRowSelectionVisibleAtom,
d as rowSelectionPrimaryKeyAtom,
c as selectedRowsAtom,
g as useHasSelectedRowsAtomValue,
y as useRowSelectionPrimaryKeyAtomValue,
v as useSelectedRowsAtomValue
};
//# sourceMappingURL=TableRowSelectionState.js.map