@mantine/core
Version:
React components library focused on usability, accessibility and developer experience
13 lines (9 loc) • 410 B
JavaScript
;
Object.defineProperty(exports, '__esModule', { value: true });
function getChangeValue({ value, containerWidth, min, max, step }) {
const left = Math.min(Math.max(value, 0), containerWidth);
const dx = left / containerWidth * (max - min);
return (dx !== 0 ? Math.round(dx / step) * step : 0) + min;
}
exports.getChangeValue = getChangeValue;
//# sourceMappingURL=get-change-value.js.map