@extclp/vexip-ui
Version:
A Vue 3 UI library, Highly customizability, full TypeScript, performance pretty good
1 lines • 1.47 kB
Source Map (JSON)
{"version":3,"file":"helpers.mjs","sources":["../../../components/affix/helpers.ts"],"sourcesContent":["import { unref } from 'vue'\r\n\r\nimport type { MaybeRef } from 'vue'\r\n\r\nlet lastScroller: Window | HTMLElement | null | undefined = null\r\n\r\nexport function handleLastScroller(target: MaybeRef<HTMLElement | null | undefined>) {\r\n target = unref(target)\r\n\r\n if (lastScroller !== unref(target)) {\r\n if (lastScroller && lastScroller !== window && lastScroller !== document.documentElement) {\r\n const targetAffix = (lastScroller as HTMLElement).querySelector(\r\n '.vxp-affix--fixed',\r\n ) as HTMLElement\r\n\r\n if (targetAffix) {\r\n targetAffix.classList.remove('vxp-affix--fixed')\r\n }\r\n }\r\n\r\n lastScroller = target\r\n }\r\n}\r\n\r\nexport function clearLastScroller(target: MaybeRef<HTMLElement | null | undefined>) {\r\n if (lastScroller && lastScroller === unref(target)) {\r\n lastScroller = null\r\n }\r\n}\r\n"],"names":["lastScroller","handleLastScroller","target","unref","targetAffix","clearLastScroller"],"mappings":";AAIA,IAAIA,IAAwD;AAErD,SAASC,EAAmBC,GAAkD;AAG/E,MAFJA,IAASC,EAAMD,CAAM,GAEjBF,MAAiBG,EAAMD,CAAM,GAAG;AAClC,QAAIF,KAAgBA,MAAiB,UAAUA,MAAiB,SAAS,iBAAiB;AACxF,YAAMI,IAAeJ,EAA6B;AAAA,QAChD;AAAA,MACF;AAEA,MAAII,KACUA,EAAA,UAAU,OAAO,kBAAkB;AAAA,IACjD;AAGa,IAAAJ,IAAAE;AAAA,EAAA;AAEnB;AAEO,SAASG,EAAkBH,GAAkD;AAClF,EAAIF,KAAgBA,MAAiBG,EAAMD,CAAM,MAChCF,IAAA;AAEnB;"}