claude-web/node_modules/primevue/scrolltop/index.mjs.map

1 line
14 KiB
Plaintext
Raw Normal View History

2026-02-23 02:23:38 +00:00
{"version":3,"file":"index.mjs","sources":["../../src/scrolltop/BaseScrollTop.vue","../../src/scrolltop/ScrollTop.vue","../../src/scrolltop/ScrollTop.vue?vue&type=template&id=13ee561a&lang.js"],"sourcesContent":["<script>\nimport BaseComponent from '@primevue/core/basecomponent';\nimport ScrollTopStyle from 'primevue/scrolltop/style';\n\nexport default {\n name: 'BaseScrollTop',\n extends: BaseComponent,\n props: {\n target: {\n type: String,\n default: 'window'\n },\n threshold: {\n type: Number,\n default: 400\n },\n icon: {\n type: String,\n default: undefined\n },\n behavior: {\n type: String,\n default: 'smooth'\n },\n buttonProps: {\n type: Object,\n default: () => {\n return { rounded: true };\n }\n }\n },\n style: ScrollTopStyle,\n provide() {\n return {\n $pcScrollTop: this,\n $parentInstance: this\n };\n }\n};\n</script>\n","<template>\n <transition name=\"p-scrolltop\" appear @enter=\"onEnter\" @after-leave=\"onAfterLeave\" v-bind=\"ptm('transition')\">\n <Button v-if=\"visible\" :ref=\"containerRef\" :class=\"cx('root')\" @click=\"onClick\" :aria-label=\"scrollTopAriaLabel\" :unstyled=\"unstyled\" v-bind=\"buttonProps\" :pt=\"ptm('root')\">\n <template #icon=\"slotProps\">\n <slot name=\"icon\" :class=\"cx('icon')\">\n <component :is=\"icon ? 'span' : 'ChevronUpIcon'\" :class=\"[cx('icon'), icon, slotProps.class]\" v-bind=\"ptm('root')['icon']\" data-pc-section=\"icon\" />\n </slot>\n </template>\n </Button>\n </transition>\n</template>\n\n<script>\nimport { getWindowScrollTop } from '@primeuix/utils/dom';\nimport { ZIndex } from '@primeuix/utils/zindex';\nimport ChevronUpIcon from '@primevue/icons/chevronup';\nimport Button from 'primevue/button';\nimport BaseScrollTop from './BaseScrollTop.vue';\n\nexport default {\n name: 'ScrollTop',\n extends: BaseScrollTop,\n inheritAttrs: false,\n scrollListener: null,\n container: null,\n data() {\n return {\n visible: false\n };\n },\n mounted() {\n if (this.target === 'window') this.bindDocumentScrollListener();\n else if (this.target === 'parent') this.bindParentScrollListener();\n },\n beforeUnmount() {\n if (this.target === 'window') this.unbindDocumentScrollListener();\n else if (this.target === 'parent') this.unbindParentScrollListener();\n\n if (this.container) {\n ZIndex.clear(this.container);\n this.overlay = null;\n }\n },\n methods: {\n onClick() {\n let scrollElement = this.target === 'window' ? window : this.$el.parentElement;\n\n scrollElement.scroll({\n top: 0,\n behavior: this.behavior\n });\n },\n checkVisibility(scrollY) {\n if (scrollY > this.threshold) this.visible = true;\n else this.visible = false;\n },\n bindParentScrollListener() {\n this.scrollListener = () => {\n this.checkVisibility(this.$el.parentElement.scrollTop);\n };\n\n this.$el.parentElement.addEventListener('scroll', this.scrollListener);\n },\n bindDocumentScrollListener() {\n this.scrollListener = () => {\n this.checkVisibility(getWindowScrollTop());\n };\n\n window.addEventListener('scroll', this.scrollListener);\n },\n unbindParentScrollListener() {\n if (this.scrollListener) {\n this.$el.parentElement.removeEventListener('scroll', this.scrollListener);\n this.scrollListener = null;\n }\n },\n unbindDocumentScrollListener() {\n if (this.scrollListener) {\n window.removeEventLis