From edb1d23d716c7e5e0feebdd5841c7ba720d5222b Mon Sep 17 00:00:00 2001 From: burakovec Date: Thu, 18 Dec 2025 12:36:51 +0300 Subject: [PATCH] Implement custom scrollbar for DataTable component. Refactor structure to include a scrollable wrapper and synchronize scroll positions between the table and the custom scrollbar. Update styles for improved visibility and functionality of the scrollbar. --- src/assets/style/default.css | 46 +++++++++++++ src/components/global/DataTable.vue | 102 ++++++++++++++++++++++++++-- 2 files changed, 144 insertions(+), 4 deletions(-) diff --git a/src/assets/style/default.css b/src/assets/style/default.css index 26e8e6c..5059008 100644 --- a/src/assets/style/default.css +++ b/src/assets/style/default.css @@ -1246,6 +1246,44 @@ section { padding: 10px; } +.list-wrapper-container { + width: 100%; + position: relative; +} + +.list-wrapper-scrollbar-top { + width: 100%; + overflow-x: auto; + overflow-y: hidden; + height: 17px; + margin-bottom: 0; + display: none; + position: relative; + z-index: 10; +} + +.list-wrapper-scrollbar-top .scrollbar-content { + height: 1px; + width: 0; +} + +.list-wrapper-scrollbar-top::-webkit-scrollbar { + height: 17px; +} + +.list-wrapper-scrollbar-top::-webkit-scrollbar-track { + background: transparent; +} + +.list-wrapper-scrollbar-top::-webkit-scrollbar-thumb { + background: rgba(0, 0, 0, 0.2); + border-radius: 10px; +} + +.list-wrapper-scrollbar-top::-webkit-scrollbar-thumb:hover { + background: rgba(0, 0, 0, 0.3); +} + .list-wrapper { width: 100%; position: relative; @@ -2374,6 +2412,14 @@ section { width: 100% !important; } + .list-wrapper-container { + overflow: visible; + } + + .list-wrapper-scrollbar-top { + display: none !important; + } + .list-wrapper { overflow: visible; overflow-x: visible; diff --git a/src/components/global/DataTable.vue b/src/components/global/DataTable.vue index 3180282..fadd1ef 100644 --- a/src/components/global/DataTable.vue +++ b/src/components/global/DataTable.vue @@ -1,6 +1,10 @@ +