From 6f6083169f55249ec9a7b544953915ec1068a9bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tu=C4=9F=C3=A7e=20K=C3=BC=C3=A7=C3=BCko=C4=9Flu?= Date: Thu, 6 Jul 2023 16:44:37 +0300 Subject: [PATCH] Refactor #3965 - Refactor on VirtualScroller --- .../virtualscroller/BaseVirtualScroller.vue | 32 +-------------- .../lib/virtualscroller/VirtualScroller.vue | 40 +++++++++++++++---- 2 files changed, 33 insertions(+), 39 deletions(-) diff --git a/components/lib/virtualscroller/BaseVirtualScroller.vue b/components/lib/virtualscroller/BaseVirtualScroller.vue index 809715efe..0cff38a22 100644 --- a/components/lib/virtualscroller/BaseVirtualScroller.vue +++ b/components/lib/virtualscroller/BaseVirtualScroller.vue @@ -5,6 +5,7 @@ import { useStyle } from 'primevue/usestyle'; const styles = ` .p-virtualscroller { position: relative; + overflow: auto; contain: strict; transform: translateZ(0); will-change: scroll-position; @@ -64,35 +65,6 @@ const styles = ` } `; -const inlineStyles = { - root: { overflow: 'auto' } -}; - -const classes = { - root: ({ instance, props }) => [ - 'p-virtualscroller', - { - 'p-virtualscroller-inline': props.inline, - 'p-virtualscroller-both p-both-scroll': instance.isBoth(), - 'p-virtualscroller-horizontal p-horizontal-scroll': instance.isHorizontal() - } - ], - content: ({ instance }) => [ - 'p-virtualscroller-content', - { - 'p-virtualscroller-loading': instance.d_loading - } - ], - spacer: 'p-virtualscroller-spacer', - loader: ({ instance }) => [ - 'p-virtualscroller-loader', - { - 'p-component-overlay': !instance.$slots.loader - } - ], - loadingIcon: 'p-virtualscroller-loading-icon' -}; - const { load: loadStyle } = useStyle(styles, { name: 'virtualscroller' }); export default { @@ -181,8 +153,6 @@ export default { } }, css: { - classes, - inlineStyles, loadStyle }, provide() { diff --git a/components/lib/virtualscroller/VirtualScroller.vue b/components/lib/virtualscroller/VirtualScroller.vue index 7461a8976..6fbc547d0 100644 --- a/components/lib/virtualscroller/VirtualScroller.vue +++ b/components/lib/virtualscroller/VirtualScroller.vue @@ -1,9 +1,9 @@