vexip-ui
Version:
A Vue 3 UI library, Highly customizability, full TypeScript, performance pretty good
1 lines • 1.41 kB
Source Map (JSON)
{"version":3,"file":"helpers.mjs","sources":["../../../components/affix/helpers.ts"],"sourcesContent":["import { unref } from 'vue'\n\nimport type { MaybeRef } from 'vue'\n\nlet lastScroller: Window | HTMLElement | null | undefined = null\n\nexport function handleLastScroller(target: MaybeRef<HTMLElement | null | undefined>) {\n target = unref(target)\n\n if (lastScroller !== unref(target)) {\n if (lastScroller && lastScroller !== window && lastScroller !== document.documentElement) {\n const targetAffix = (lastScroller as HTMLElement).querySelector(\n '.vxp-affix--fixed',\n ) as HTMLElement\n\n if (targetAffix) {\n targetAffix.classList.remove('vxp-affix--fixed')\n }\n }\n\n lastScroller = target\n }\n}\n\nexport function clearLastScroller(target: MaybeRef<HTMLElement | null | undefined>) {\n if (lastScroller && lastScroller === unref(target)) {\n lastScroller = null\n }\n}\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;"}