vexip-ui
Version:
A Vue 3 UI library, Highly customizability, full TypeScript, performance pretty good
1 lines • 1.38 kB
Source Map (JSON)
{"version":3,"file":"helpers.cjs","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":"uGAIA,IAAIA,EAAwD,KAErD,SAASC,EAAmBC,EAAkD,CAG/E,GAFJA,EAASC,QAAMD,CAAM,EAEjBF,IAAiBG,QAAMD,CAAM,EAAG,CAClC,GAAIF,GAAgBA,IAAiB,QAAUA,IAAiB,SAAS,gBAAiB,CACxF,MAAMI,EAAeJ,EAA6B,cAChD,mBACF,EAEII,GACUA,EAAA,UAAU,OAAO,kBAAkB,CACjD,CAGaJ,EAAAE,CAAA,CAEnB,CAEO,SAASG,EAAkBH,EAAkD,CAC9EF,GAAgBA,IAAiBG,EAAM,MAAAD,CAAM,IAChCF,EAAA,KAEnB"}