Vulture/VApp/node_modules/vuetify/lib/components/VInfiniteScroll/VInfiniteScroll.mjs.map

1 line
17 KiB
Plaintext
Raw Normal View History

{"version":3,"file":"VInfiniteScroll.mjs","names":["VBtn","VProgressCircular","makeDimensionProps","useDimension","useIntersectionObserver","useLocale","makeTagProps","computed","nextTick","onMounted","ref","shallowRef","watch","convertToUnit","defineComponent","genericComponent","propsFactory","useRender","makeVInfiniteScrollProps","color","String","direction","type","default","validator","v","includes","side","mode","margin","Number","loadMoreText","emptyText","VInfiniteScrollIntersect","name","props","required","rootRef","rootMargin","emits","intersect","isIntersecting","setup","_ref","emit","intersectionRef","entries","undefined","val","_createVNode","_createTextVNode","VInfiniteScroll","load","options","_ref2","slots","rootEl","startStatus","endStatus","setScrollAmount","amount","value","property","getScrollAmount","getScrollSize","getContainerSize","setStatus","status","getStatus","previousScrollSize","handleIntersect","_isIntersecting","intersecting","done","window","requestAnimationFrame","t","renderSide","onClick","slotProps","error","empty","loading","dimensionStyles","Tag","tag","hasStartIntersect","hasEndIntersect","intersectMode"],"sources":["../../../src/components/VInfiniteScroll/VInfiniteScroll.tsx"],"sourcesContent":["// Styles\nimport './VInfiniteScroll.sass'\n\n// Components\nimport { VBtn } from '@/components/VBtn'\nimport { VProgressCircular } from '@/components/VProgressCircular'\n\n// Composables\nimport { makeDimensionProps, useDimension } from '@/composables/dimensions'\nimport { useIntersectionObserver } from '@/composables/intersectionObserver'\nimport { useLocale } from '@/composables/locale'\nimport { makeTagProps } from '@/composables/tag'\n\n// Utilities\nimport { computed, nextTick, onMounted, ref, shallowRef, watch } from 'vue'\nimport { convertToUnit, defineComponent, genericComponent, propsFactory, useRender } from '@/util'\n\n// Types\nimport type { PropType } from 'vue'\n\nexport type InfiniteScrollSide = 'start' | 'end' | 'both'\nexport type InfiniteScrollStatus = 'ok' | 'empty' | 'loading' | 'error'\n\ntype InfiniteScrollSlot = {\n side: InfiniteScrollSide\n props: Record<string, any>\n}\n\ntype VInfiniteScrollSlots = {\n default: never\n loading: InfiniteScrollSlot\n error: InfiniteScrollSlot\n empty: InfiniteScrollSlot\n 'load-more': InfiniteScrollSlot\n}\n\nexport const makeVInfiniteScrollProps = propsFactory({\n color: String,\n direction: {\n type: String as PropType<'vertical' | 'horizontal'>,\n default: 'vertical',\n validator: (v: any) => ['vertical', 'horizontal'].includes(v),\n },\n side: {\n type: String as PropType<InfiniteScrollSide>,\n default: 'end',\n validator: (v: any) => ['start', 'end', 'both'].includes(v),\n },\n mode: {\n type: String as PropType<'intersect' | 'manual'>,\n default: 'intersect',\n validator: (v: any) => ['intersect', 'manual'].includes(v),\n },\n margin: [Number, String],\n loadMoreText: {\n type: String,\n default: '$vuetify.infiniteScroll.loadMore',\n },\n emptyText: {\n type: String,\n default: '$vuetify.infiniteScroll.empty',\n },\n\n ...makeDimensionProps(),\n ...makeTagProps(),\n}, 'VInfiniteScroll')\n\nexport const VInfiniteScrollIntersect = defineComponent({\n name: 'VInfiniteScrollIntersect',\n\n props: {\n side: {\n type: String as PropType<InfiniteScrollSide>,\n required: true,\n },\n rootRef: null,\n rootMargin: String,\n },\n\n emits: {\n intersect: (side: InfiniteScrollSide, isIntersecting: boolean) => true,\n },\n\n setup (props, { emit }) {\n const { intersectionRef, isIntersecting } = useIntersectionObserver(entries => {\n }, props.rootMargin ? {\n rootMargin: props.rootMargin,\n } : undefined)\n\n watch(isIntersecting, async val => {\n emit('intersect', props.side, val)\n })\n\n useRender(() => (\n <div class=\"v-infinite-scroll-intersect\" ref={ intersectionRef }>&nbsp;</div>\n ))\n\n return {}\n },\n})\n\nexport const VInfiniteScroll = genericComponent<VInfiniteScrollSlots>()({\n name: 'VInfinit