UNPKG

@mantine/core

Version:

React components library focused on usability, accessibility and developer experience

1 lines 550 B
{"version":3,"file":"get-position.cjs","names":[],"sources":["../../../../../src/components/Slider/utils/get-position/get-position.ts"],"sourcesContent":["interface GetPosition {\n value: number;\n min: number;\n max: number;\n}\n\nexport function getPosition({ value, min, max }: GetPosition) {\n const position = ((value - min) / (max - min)) * 100;\n return Math.min(Math.max(position, 0), 100);\n}\n"],"mappings":";;AAMA,SAAgB,YAAY,EAAE,OAAO,KAAK,OAAoB;CAC5D,MAAM,YAAa,QAAQ,QAAQ,MAAM,OAAQ;AACjD,QAAO,KAAK,IAAI,KAAK,IAAI,UAAU,EAAE,EAAE,IAAI"}