UNPKG

@progress/kendo-react-inputs

Version:

React Inputs offer a customizable interface for users to enter and pick different information. KendoReact Input package

9 lines (8 loc) 1.21 kB
/** * @license *------------------------------------------------------------------------------------------- * Copyright © 2025 Progress Software Corporation. All rights reserved. * Licensed under commercial license. See LICENSE.md in the package root for more information *------------------------------------------------------------------------------------------- */ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./utils/index.js");var u=(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 d=(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.toRound(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.toRound(r+e.step,e.step):e.max;case"decrease":return e.step===void 0?r:s.toRound(r-e.step,e.step)>=e.min?s.toRound(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}};exports.RATING_ACTION=u;exports.ratingReducer=d;