@payfit/unity-components
Version:
38 lines (37 loc) • 866 B
JavaScript
import { useTableKeyboardNavigation as e } from "./hooks/useTableKeyboardNavigation.js";
import { createContext as t, useContext as n } from "react";
import { jsx as r } from "react/jsx-runtime";
var i = t({
rowCount: 0,
columnCount: 0,
keyboardNavigation: {
focusedCell: {
rowIndex: 0,
colIndex: 0
},
isCellFocused: () => !1,
handleCellKeyDown: () => void 0,
handleTableKeyDown: () => void 0,
handleTableFocus: () => void 0,
handleCellFocus: () => void 0,
tableRef: { current: null },
focusCell: () => void 0,
focusRow: () => void 0
},
enableVirtualization: !1
});
function a() {
return n(i);
}
function o({ children: t, ...n }) {
let a = e(), o = {
...n,
keyboardNavigation: a
};
return /* @__PURE__ */ r(i.Provider, {
value: o,
children: t
});
}
//#endregion
export { o as TableContextProvider, a as useTableContext };