@progress/kendo-react-inputs
Version:
React Inputs offer a customizable interface for users to enter and pick different information. KendoReact Input package
28 lines (27 loc) • 1.14 kB
JavaScript
/**
* @license
*-------------------------------------------------------------------------------------------
* Copyright © 2025 Progress Software Corporation. All rights reserved.
* Licensed under commercial license. See LICENSE.md in the package root for more information
*-------------------------------------------------------------------------------------------
*/
const i = (t, r) => {
if (t % 1) {
const n = Math.pow(10, (r.toString().split(".")[1] || r.toString().split(".")[0]).length);
return Math.round(t * n) / n;
}
return t;
}, c = (t, r) => t - r * Math.floor(t / r), s = (t, r, n) => i(t - n, n) < r && r < t, l = (t, r, n, o) => r === null ? !1 : o === "continues" ? s(t, r, n) ? i(t - n / 2, n / 2) <= r : t <= r : o === "single" ? s(t, r, n) ? i(t - n / 2, n / 2) === r : t === r : !1, u = (t, r, n) => t === "ltr" ? n < r.x + r.width / 2 : n > r.x + r.width / 2, h = (t, r, n, o) => {
for (let f = t; f <= r; f += n)
if (o === f)
return !0;
return !1;
};
export {
u as calcIsFirstHalf,
c as getRemainder,
h as isCorrectValue,
s as isHalf,
l as isSelected,
i as toRound
};