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-tabview-tablist-container {
|
|
|
|
position: relative;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-tabview-scrollable > .p-tabview-tablist-container {
|
|
|
|
overflow: hidden;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-tabview-tablist-scroll-container {
|
|
|
|
overflow-x: auto;
|
|
|
|
overflow-y: hidden;
|
|
|
|
scroll-behavior: smooth;
|
|
|
|
scrollbar-width: none;
|
|
|
|
overscroll-behavior: contain auto;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-tabview-tablist-scroll-container::-webkit-scrollbar {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-tabview-tablist {
|
|
|
|
display: flex;
|
|
|
|
margin: 0;
|
|
|
|
padding: 0;
|
|
|
|
list-style-type: none;
|
|
|
|
flex: 1 1 auto;
|
2024-05-04 11:47:06 +00:00
|
|
|
background: ${dt('tabview.tab.list.background')};
|
|
|
|
border: 1px solid ${dt('tabview.tab.list.border.color')};
|
2024-05-01 08:26:48 +00:00
|
|
|
border-width: 0 0 1px 0;
|
|
|
|
position: relative;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-tabview-tab-header {
|
|
|
|
cursor: pointer;
|
|
|
|
user-select: none;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
text-decoration: none;
|
|
|
|
position: relative;
|
|
|
|
overflow: hidden;
|
|
|
|
border-style: solid;
|
|
|
|
border-width: 0 0 1px 0;
|
2024-05-04 11:47:06 +00:00
|
|
|
border-color: transparent transparent ${dt('tabview.tab.border.color')} transparent;
|
|
|
|
color: ${dt('tabview.tab.color')};
|
2024-05-01 08:26:48 +00:00
|
|
|
padding: 1rem 1.125rem;
|
|
|
|
font-weight: 600;
|
2024-05-06 21:18:22 +00:00
|
|
|
border-top-right-radius: ${dt('border.radius.md')};
|
|
|
|
border-top-left-radius: ${dt('border.radius.md')};
|
2024-05-25 08:18:55 +00:00
|
|
|
transition: color ${dt('tabview.transition.duration')}, outline-color ${dt('tabview.transition.duration')};
|
2024-05-01 08:26:48 +00:00
|
|
|
margin: 0 0 -1px 0;
|
|
|
|
outline-color: transparent;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-tabview-tablist-item:not(.p-disabled) .p-tabview-tab-header:focus-visible {
|
|
|
|
outline: ${dt('focus.ring.width')} ${dt('focus.ring.style')} ${dt('focus.ring.color')};
|
|
|
|
outline-offset: -1px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-tabview-tablist-item:not(.p-highlight):not(.p-disabled):hover > .p-tabview-tab-header {
|
2024-05-04 11:47:06 +00:00
|
|
|
color: ${dt('tabview.tab.hover.color')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-tabview-tablist-item.p-highlight > .p-tabview-tab-header {
|
2024-05-04 11:47:06 +00:00
|
|
|
color: ${dt('tabview.tab.active.color')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-tabview-tab-title {
|
|
|
|
line-height: 1;
|
|
|
|
white-space: nowrap;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-tabview-next-button,
|
|
|
|
.p-tabview-prev-button {
|
|
|
|
position: absolute;
|
|
|
|
top: 0;
|
|
|
|
margin: 0;
|
|
|
|
padding: 0;
|
|
|
|
z-index: 2;
|
|
|
|
height: 100%;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
2024-05-04 11:47:06 +00:00
|
|
|
background: ${dt('tabview.nav.button.background')};
|
|
|
|
color: ${dt('tabview.nav.button.color')};
|
2024-05-01 08:26:48 +00:00
|
|
|
width: 2.5rem;
|
|
|
|
border-radius: 0;
|
|
|
|
outline-color: transparent;
|
2024-05-25 08:18:55 +00:00
|
|
|
transition: color ${dt('tabview.transition.duration')}, outline-color ${dt('tabview.transition.duration')};
|
2024-05-06 21:23:42 +00:00
|
|
|
box-shadow: ${dt('tabview.nav.button.shadow')};
|
2024-05-01 08:26:48 +00:00
|
|
|
border: none;
|
|
|
|
cursor: pointer;
|
|
|
|
user-select: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-tabview-next-button:focus-visible,
|
|
|
|
.p-tabview-prev-button:focus-visible {
|
|
|
|
outline: ${dt('focus.ring.width')} ${dt('focus.ring.style')} ${dt('focus.ring.color')};
|
|
|
|
outline-offset: ${dt('focus.ring.offset')};
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-tabview-next-button:hover,
|
|
|
|
.p-tabview-prev-button:hover {
|
2024-05-04 11:47:06 +00:00
|
|
|
color: ${dt('tabview.nav.button.hover.color')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-tabview-prev-button {
|
|
|
|
left: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-tabview-next-button {
|
|
|
|
right: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-tabview-panels {
|
2024-05-04 11:47:06 +00:00
|
|
|
background: ${dt('tabview.tab.panel.background')};
|
|
|
|
color: ${dt('tabview.tab.panel.color')};
|
2024-05-01 08:26:48 +00:00
|
|
|
padding: 0.875rem 1.125rem 1.125rem 1.125rem;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-tabview-ink-bar {
|
|
|
|
z-index: 1;
|
|
|
|
display: block;
|
|
|
|
position: absolute;
|
|
|
|
bottom: -1px;
|
|
|
|
height: 1px;
|
2024-05-24 05:50:38 +00:00
|
|
|
background: ${dt('tabview.tab.active.border.color')};
|
2024-05-01 08:26:48 +00:00
|
|
|
transition: 250ms cubic-bezier(0.35, 0, 0.25, 1);
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
2023-10-02 10:46:09 +00:00
|
|
|
const classes = {
|
|
|
|
root: ({ props }) => [
|
|
|
|
'p-tabview p-component',
|
|
|
|
{
|
|
|
|
'p-tabview-scrollable': props.scrollable
|
|
|
|
}
|
|
|
|
],
|
2024-04-09 08:27:15 +00:00
|
|
|
navContainer: 'p-tabview-tablist-container',
|
2024-05-27 08:48:42 +00:00
|
|
|
prevButton: 'p-tabview-prev-button',
|
2024-04-09 08:27:15 +00:00
|
|
|
navContent: 'p-tabview-tablist-scroll-container',
|
|
|
|
nav: 'p-tabview-tablist',
|
2023-10-02 10:46:09 +00:00
|
|
|
tab: {
|
|
|
|
header: ({ instance, tab, index }) => [
|
2024-04-09 08:27:15 +00:00
|
|
|
'p-tabview-tablist-item',
|
2023-10-02 10:46:09 +00:00
|
|
|
instance.getTabProp(tab, 'headerClass'),
|
|
|
|
{
|
2024-04-09 08:27:15 +00:00
|
|
|
'p-tabview-tablist-item-active': instance.d_activeIndex === index,
|
2023-10-02 10:46:09 +00:00
|
|
|
'p-disabled': instance.getTabProp(tab, 'disabled')
|
|
|
|
}
|
|
|
|
],
|
2024-04-09 08:27:15 +00:00
|
|
|
headerAction: 'p-tabview-tab-header',
|
|
|
|
headerTitle: 'p-tabview-tab-title',
|
2023-10-02 10:46:09 +00:00
|
|
|
content: ({ instance, tab }) => ['p-tabview-panel', instance.getTabProp(tab, 'contentClass')]
|
|
|
|
},
|
|
|
|
inkbar: 'p-tabview-ink-bar',
|
2024-04-09 08:27:15 +00:00
|
|
|
nextButton: 'p-tabview-next-button',
|
2023-10-02 10:46:09 +00:00
|
|
|
panelContainer: 'p-tabview-panels'
|
|
|
|
};
|
|
|
|
|
|
|
|
export default BaseStyle.extend({
|
|
|
|
name: 'tabview',
|
2024-05-01 08:26:48 +00:00
|
|
|
theme,
|
2023-10-02 10:46:09 +00:00
|
|
|
classes
|
|
|
|
});
|