@progress/kendo-react-buttons
Version:
All you need in React Button in one package: disabled/enabled states, built-in styles and more. KendoReact Buttons package
35 lines (34 loc) • 890 B
JavaScript
/**
* @license
*-------------------------------------------------------------------------------------------
* Copyright © 2025 Progress Software Corporation. All rights reserved.
* Licensed under commercial license. See LICENSE.md in the package root for more information
*-------------------------------------------------------------------------------------------
*/
import { Keys as e } from "@progress/kendo-react-common";
const i = (n, s, t, r) => {
if (t)
return n;
const a = Math.min(r - 1, Math.max(0, n));
switch (s) {
case e.enter:
case e.space:
case e.esc:
return -1;
case e.up:
case e.left:
return a - 1 < 0 ? r - 1 : a - 1;
case e.down:
case e.right:
return a + 1 >= r ? 0 : a + 1;
case e.home:
return 0;
case e.end:
return r - 1;
default:
return n;
}
};
export {
i as navigate
};