@progress/kendo-react-inputs
Version:
React Inputs offer a customizable interface for users to enter and pick different information. KendoReact Input package
34 lines (33 loc) • 1.36 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
*-------------------------------------------------------------------------------------------
*/
import { toRound as s } from "./utils/index.mjs";
var u = /* @__PURE__ */ ((r) => (r.select = "select", r.deselect = "deselect", r.increase = "increase", r.decrease = "decrease", r.min = "min", r.max = "max", r.reset = "reset", r))(u || {});
const p = (r, e) => {
switch (e.type) {
case "select":
return e.payload === void 0 || e.step === void 0 ? r : e.payload === r ? null : e.payload >= e.min ? e.payload < e.max ? s(e.payload, e.step) : e.max : e.min;
case "deselect":
return null;
case "increase":
return e.step === void 0 ? r : r < e.min ? e.min : r + e.step < e.max ? s(r + e.step, e.step) : e.max;
case "decrease":
return e.step === void 0 ? r : s(r - e.step, e.step) >= e.min ? s(r - e.step, e.step) : e.min;
case "min":
return e.step === void 0 ? r : e.min;
case "max":
return e.max;
case "reset":
return null;
default:
return r;
}
};
export {
u as RATING_ACTION,
p as ratingReducer
};