@extclp/vexip-ui
Version:
A Vue 3 UI library, Highly customizability, full TypeScript, performance pretty good
1 lines • 1.71 kB
Source Map (JSON)
{"version":3,"file":"symbol.mjs","sources":["../../../components/scroll/symbol.ts"],"sourcesContent":["import { USE_TOUCH } from '@vexip-ui/utils'\r\n\r\nexport type ScrollMode = 'horizontal' | 'horizontal-exact' | 'vertical' | 'both'\r\n\r\nexport interface ScrollPayload {\r\n type: Exclude<ScrollMode, 'horizontal-exact'>,\r\n clientX: number,\r\n clientY: number,\r\n percentX: number,\r\n percentY: number,\r\n}\r\n\r\nexport interface BarScrollPayload {\r\n type: 'vertical' | 'horizontal',\r\n clientX: number,\r\n clientY: number,\r\n percentX: number,\r\n percentY: number,\r\n}\r\n\r\nexport interface ScrollState {\r\n scrollX: number,\r\n scrollY: number,\r\n percentX: number,\r\n percentY: number,\r\n enableXScroll: number,\r\n enableYScroll: number,\r\n}\r\n\r\nexport interface ScrollSlotParams {\r\n getState: () => ScrollState,\r\n refresh: () => void,\r\n scrollTo: (clientX: number, clientY: number, duration?: number) => void,\r\n scrollBy: (deltaX: number, deltaY: number, duration?: number) => void,\r\n scrollToElement: (el: string | Element, duration?: number, offset?: number) => void,\r\n ensureInView: (el: string | Element, duration?: number, offset?: number) => void,\r\n}\r\n\r\nexport const scrollModes = Object.freeze<ScrollMode[]>([\r\n 'horizontal',\r\n 'horizontal-exact',\r\n 'vertical',\r\n 'both',\r\n])\r\n\r\nexport const MOVE_EVENT = USE_TOUCH ? 'touchmove' : 'mousemove'\r\nexport const UP_EVENT = USE_TOUCH ? 'touchend' : 'mouseup'\r\n"],"names":["scrollModes","MOVE_EVENT","USE_TOUCH","UP_EVENT"],"mappings":";AAsCa,MAAAA,IAAc,OAAO,OAAqB;AAAA,EACrD;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC,GAEYC,IAAaC,IAAY,cAAc,aACvCC,IAAWD,IAAY,aAAa;"}