2023-10-02 10:46:09 +00:00
|
|
|
import BaseStyle from 'primevue/base/style';
|
|
|
|
|
2024-05-01 08:26:48 +00:00
|
|
|
const theme = ({ dt }) => `
|
|
|
|
.p-scrollpanel-content-container {
|
|
|
|
overflow: hidden;
|
|
|
|
width: 100%;
|
|
|
|
height: 100%;
|
|
|
|
position: relative;
|
|
|
|
z-index: 1;
|
|
|
|
float: left;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-scrollpanel-content {
|
2024-05-11 13:25:48 +00:00
|
|
|
height: calc(100% + calc(2 * ${dt('scrollpanel.bar.size')}));
|
|
|
|
width: calc(100% + calc(2 * ${dt('scrollpanel.bar.size')}));
|
|
|
|
padding: 0 calc(2 * ${dt('scrollpanel.bar.size')}) calc(2 * ${dt('scrollpanel.bar.size')}) 0;
|
2024-05-01 08:26:48 +00:00
|
|
|
position: relative;
|
|
|
|
overflow: auto;
|
|
|
|
box-sizing: border-box;
|
|
|
|
scrollbar-width: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-scrollpanel-content::-webkit-scrollbar {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-scrollpanel-bar {
|
|
|
|
position: relative;
|
2024-05-11 13:25:48 +00:00
|
|
|
border-radius: ${dt('scrollpanel.bar.border.radius')};
|
2024-05-01 08:26:48 +00:00
|
|
|
z-index: 2;
|
|
|
|
cursor: pointer;
|
|
|
|
opacity: 0;
|
|
|
|
outline-color: transparent;
|
2024-05-25 08:18:55 +00:00
|
|
|
transition: outline-color ${dt('scrollpanel.transition.duration')};
|
2024-05-01 08:26:48 +00:00
|
|
|
background: ${dt('scrollpanel.bar.background')};
|
|
|
|
border: 0 none;
|
2024-05-25 08:18:55 +00:00
|
|
|
transition: outline-color ${dt('scrollpanel.transition.duration')}, opacity ${dt('scrollpanel.transition.duration')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-scrollpanel-bar:focus-visible {
|
2024-05-11 13:25:48 +00:00
|
|
|
box-shadow: ${dt('scrollpanel.bar.focus.ring.shadow')};
|
|
|
|
outline: ${dt('scrollpanel.barfocus.ring.width')} ${dt('scrollpanel.bar.focus.ring.style')} ${dt('scrollpanel.bar.focus.ring.color')};
|
|
|
|
outline-offset: ${dt('scrollpanel.barfocus.ring.offset')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-scrollpanel-bar-y {
|
2024-05-13 08:03:41 +00:00
|
|
|
width: ${dt('scrollpanel.bar.size')};
|
2024-05-01 08:26:48 +00:00
|
|
|
top: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-scrollpanel-bar-x {
|
2024-05-13 08:03:41 +00:00
|
|
|
height: ${dt('scrollpanel.bar.size')};
|
2024-05-01 08:26:48 +00:00
|
|
|
bottom: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-scrollpanel-hidden {
|
|
|
|
visibility: hidden;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-scrollpanel:hover .p-scrollpanel-bar,
|
|
|
|
.p-scrollpanel:active .p-scrollpanel-bar {
|
|
|
|
opacity: 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-scrollpanel-grabbed {
|
|
|
|
user-select: none;
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
2023-10-02 10:46:09 +00:00
|
|
|
const classes = {
|
|
|
|
root: 'p-scrollpanel p-component',
|
2024-04-30 14:09:49 +00:00
|
|
|
contentContainer: 'p-scrollpanel-content-container',
|
2023-10-02 10:46:09 +00:00
|
|
|
content: 'p-scrollpanel-content',
|
2024-04-08 15:42:47 +00:00
|
|
|
barX: 'p-scrollpanel-bar p-scrollpanel-bar-x',
|
|
|
|
barY: 'p-scrollpanel-bar p-scrollpanel-bar-y'
|
2023-10-02 10:46:09 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
export default BaseStyle.extend({
|
|
|
|
name: 'scrollpanel',
|
2024-05-01 08:26:48 +00:00
|
|
|
theme,
|
2023-10-02 10:46:09 +00:00
|
|
|
classes
|
|
|
|
});
|