-
+
{{ `[${diagnostic.checkerId}]` }}
-import Checker from './Checker.ce.vue'
-
-withDefaults(
- defineProps<{
- ulStyle?: string
- base: string
- checkerResults: any[]
- }>(),
- {
- ulStyle: '',
- }
+import {computed, ref} from "vue";
+import Diagnostic from "./Diagnostic.ce.vue";
+import {useVirtualizer} from "@tanstack/vue-virtual";
+
+const parentRef = ref(null)
+
+const props = withDefaults(
+ defineProps<{
+ ulStyle?: string
+ base: string
+ checkerResults: any[]
+ }>(),
+ {
+ ulStyle: '',
+ }
)
+
+const diagnostics = computed(() => props.checkerResults.flatMap(item => item.diagnostics))
+
+const rowVirtualizer = useVirtualizer({
+ count: diagnostics.value.length,
+ getScrollElement: () => parentRef.value,
+ estimateSize: () => 220,
+ overscan: 5,
+})
+
+const virtualRows = computed(() => rowVirtualizer.value.getVirtualItems())
+
+const totalSize = computed(() => rowVirtualizer.value.getTotalSize())
+
-
+
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 45479965..95ab88d5 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -79,6 +79,10 @@ importers:
version: 1.6.3(@algolia/client-search@5.24.0)(@types/node@20.19.4)(postcss@8.5.6)(sass@1.89.2)(typescript@5.8.3)
packages/runtime:
+ dependencies:
+ '@tanstack/vue-virtual':
+ specifier: ^3.13.12
+ version: 3.13.12(vue@3.5.17(typescript@5.8.3))
devDependencies:
'@vitejs/plugin-vue':
specifier: ^6.0.0
@@ -1886,6 +1890,14 @@ packages:
resolution: {integrity: sha512-tlqY9xq5ukxTUZBmoOp+m61cqwQD5pHJtFY3Mn8CA8ps6yghLH/Hw8UPdqg4OLmFW3IFlcXnQNmo/dh8HzXYIQ==}
engines: {node: '>=18'}
+ '@tanstack/virtual-core@3.13.12':
+ resolution: {integrity: sha512-1YBOJfRHV4sXUmWsFSf5rQor4Ss82G8dQWLRbnk3GA4jeP8hQt1hxXh0tmflpC0dz3VgEv/1+qwPyLeWkQuPFA==}
+
+ '@tanstack/vue-virtual@3.13.12':
+ resolution: {integrity: sha512-vhF7kEU9EXWXh+HdAwKJ2m3xaOnTTmgcdXcF2pim8g4GvI7eRrk2YRuV5nUlZnd/NbCIX4/Ja2OZu5EjJL06Ww==}
+ peerDependencies:
+ vue: ^2.7.0 || ^3.0.0
+
'@tsconfig/node20@20.1.6':
resolution: {integrity: sha512-sz+Hqx9zwZDpZIV871WSbUzSqNIsXzghZydypnfgzPKLltVJfkINfUeTct31n/tTSa9ZE1ZOfKdRre1uHHquYQ==}
@@ -6248,6 +6260,13 @@ snapshots:
'@sindresorhus/merge-streams@4.0.0': {}
+ '@tanstack/virtual-core@3.13.12': {}
+
+ '@tanstack/vue-virtual@3.13.12(vue@3.5.17(typescript@5.8.3))':
+ dependencies:
+ '@tanstack/virtual-core': 3.13.12
+ vue: 3.5.17(typescript@5.8.3)
+
'@tsconfig/node20@20.1.6': {}
'@tsconfig/strictest@2.0.5': {}