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-tabmenu {
|
|
|
|
overflow-x: auto;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-tabmenu-tablist {
|
|
|
|
display: flex;
|
|
|
|
margin: 0;
|
|
|
|
padding: 0;
|
|
|
|
list-style-type: none;
|
|
|
|
flex: 1 1 auto;
|
2024-05-04 17:06:51 +00:00
|
|
|
background: ${dt('tabmenu.tablist.background')};
|
|
|
|
border: 1px solid ${dt('tabmenu.tablist.border.color')};
|
2024-05-01 08:26:48 +00:00
|
|
|
border-width: 0 0 1px 0;
|
|
|
|
position: relative;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-tabmenu-item-link {
|
|
|
|
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 17:06:51 +00:00
|
|
|
border-color: transparent transparent ${dt('tabmenu.item.link.border.color')} transparent;
|
|
|
|
color: ${dt('tabmenu.item.link.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-01 08:26:48 +00:00
|
|
|
transition: color ${dt('transition.duration')}, outline-color ${dt('transition.duration')};
|
|
|
|
margin: 0 0 -1px 0;
|
|
|
|
outline-color: transparent;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-tabmenu-item-link:focus-visible {
|
|
|
|
outline: ${dt('focus.ring.width')} ${dt('focus.ring.style')} ${dt('focus.ring.color')};
|
|
|
|
outline-offset: -1px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-tabmenu-item-icon {
|
|
|
|
margin-right: 0.5rem;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-tabmenu-item-label {
|
|
|
|
line-height: 1;
|
|
|
|
}
|
|
|
|
.p-tabmenu-item:not(.p-tabmenu-item-active):not(.p-disabled):hover .p-tabmenu-item-link {
|
2024-05-04 17:06:51 +00:00
|
|
|
color: ${dt('tabmenu.item.link.hover.color')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-tabmenu-item-active .p-tabmenu-item-link {
|
2024-05-04 17:06:51 +00:00
|
|
|
color: ${dt('tabmenu.item.link.active.border.color')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-tabmenu-ink-bar {
|
|
|
|
z-index: 1;
|
|
|
|
display: block;
|
|
|
|
position: absolute;
|
|
|
|
bottom: -1px;
|
|
|
|
height: 1px;
|
2024-05-04 17:06:51 +00:00
|
|
|
background-color: ${dt('tabmenu.item.link.active.border.color')};
|
2024-05-01 08:26:48 +00:00
|
|
|
transition: 250ms cubic-bezier(0.35, 0, 0.25, 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-tabmenu::-webkit-scrollbar {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
2023-10-02 10:46:09 +00:00
|
|
|
const classes = {
|
|
|
|
root: 'p-tabmenu p-component',
|
2024-04-30 13:03:20 +00:00
|
|
|
tablist: 'p-tabmenu-tablist',
|
|
|
|
item: ({ instance, index, item }) => [
|
2024-04-09 14:03:17 +00:00
|
|
|
'p-tabmenu-item',
|
2023-10-02 10:46:09 +00:00
|
|
|
{
|
2024-04-09 14:03:17 +00:00
|
|
|
'p-tabmenu-item-active': instance.d_activeIndex === index,
|
2023-10-02 10:46:09 +00:00
|
|
|
'p-disabled': instance.disabled(item)
|
|
|
|
}
|
|
|
|
],
|
2024-04-30 13:03:20 +00:00
|
|
|
itemLink: 'p-tabmenu-item-link',
|
|
|
|
itemIcon: 'p-tabmenu-item-icon',
|
|
|
|
itemLabel: 'p-tabmenu-item-label',
|
2023-10-02 10:46:09 +00:00
|
|
|
inkbar: 'p-tabmenu-ink-bar'
|
|
|
|
};
|
|
|
|
|
|
|
|
export default BaseStyle.extend({
|
|
|
|
name: 'tabmenu',
|
2024-05-01 08:26:48 +00:00
|
|
|
theme,
|
2023-10-02 10:46:09 +00:00
|
|
|
classes
|
|
|
|
});
|