UNPKG

@mantine/core

Version:

React components library focused on usability, accessibility and developer experience

1 lines 716 B
{"version":3,"file":"get-client-position.cjs","names":[],"sources":["../../../../../src/components/Slider/utils/get-client-position/get-client-position.ts"],"sourcesContent":["export function getClientPosition(event: any, orientation?: 'horizontal' | 'vertical') {\n if ('TouchEvent' in window && event instanceof window.TouchEvent) {\n const touch = event.touches[0];\n return orientation === 'vertical' ? touch.clientY : touch.clientX;\n }\n\n return orientation === 'vertical' ? event.clientY : event.clientX;\n}\n"],"mappings":";;AAAA,SAAgB,kBAAkB,OAAY,aAAyC;AACrF,KAAI,gBAAgB,UAAU,iBAAiB,OAAO,YAAY;EAChE,MAAM,QAAQ,MAAM,QAAQ;AAC5B,SAAO,gBAAgB,aAAa,MAAM,UAAU,MAAM;;AAG5D,QAAO,gBAAgB,aAAa,MAAM,UAAU,MAAM"}