{"version":3,"file":"VVirtualScrollItem.mjs","names":["makeComponentProps","useResizeObserver","watch","genericComponent","propsFactory","useRender","makeVVirtualScrollItemProps","renderless","Boolean","VVirtualScrollItem","name","inheritAttrs","props","emits","height","setup","_ref","attrs","emit","slots","resizeRef","contentRect","undefined","value","_createVNode","_Fragment","default","itemRef","_mergeProps","class","style"],"sources":["../../../src/components/VVirtualScroll/VVirtualScrollItem.tsx"],"sourcesContent":["// Composables\nimport { makeComponentProps } from '@/composables/component'\nimport { useResizeObserver } from '@/composables/resizeObserver'\n\n// Utilities\nimport { watch } from 'vue'\nimport { genericComponent, propsFactory, useRender } from '@/util'\n\n// Types\nimport type { GenericProps, TemplateRef } from '@/util'\n\nexport const makeVVirtualScrollItemProps = propsFactory({\n renderless: Boolean,\n\n ...makeComponentProps(),\n}, 'VVirtualScrollItem')\n\nexport const VVirtualScrollItem = genericComponent(\n props: {\n renderless?: Renderless\n },\n slots: {\n default: Renderless extends true ? {\n itemRef: TemplateRef\n } : never\n }\n) => GenericProps>()({\n name: 'VVirtualScrollItem',\n\n inheritAttrs: false,\n\n props: makeVVirtualScrollItemProps(),\n\n emits: {\n 'update:height': (height: number) => true,\n },\n\n setup (props, { attrs, emit, slots }) {\n const { resizeRef, contentRect } = useResizeObserver(undefined, 'border')\n\n watch(() => contentRect.value?.height, height => {\n if (height != null) emit('update:height', height)\n })\n\n useRender(() => props.renderless ? (\n <>\n { slots.default?.({ itemRef: resizeRef }) }\n \n ) : (\n \n { (slots.default as any)?.() }\n \n ))\n },\n})\n"],"mappings":";AAAA;AAAA,SACSA,kBAAkB;AAAA,SAClBC,iBAAiB,gDAE1B;AACA,SAASC,KAAK,QAAQ,KAAK;AAAA,SAClBC,gBAAgB,EAAEC,YAAY,EAAEC,SAAS,gCAElD;AAGA,OAAO,MAAMC,2BAA2B,GAAGF,YAAY,CAAC;EACtDG,UAAU,EAAEC,OAAO;EAEnB,GAAGR,kBAAkB,CAAC;AACxB,CAAC,EAAE,oBAAoB,CA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