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;
|
2024-05-04 17:06:51 +00:00
|
|
|
background: ${dt('tabmenu.tablist.background')};
|
2024-05-11 09:30:44 +00:00
|
|
|
border-style: solid;
|
|
|
|
border-color: ${dt('tabmenu.tablist.border.color')};
|
|
|
|
border-width: ${dt('tabmenu.tablist.border.width')};
|
2024-05-01 08:26:48 +00:00
|
|
|
position: relative;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-tabmenu-item-link {
|
|
|
|
cursor: pointer;
|
|
|
|
user-select: none;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
text-decoration: none;
|
|
|
|
position: relative;
|
|
|
|
overflow: hidden;
|
2024-05-11 09:30:44 +00:00
|
|
|
background: ${dt('tabmenu.item.background')};
|
2024-05-01 08:26:48 +00:00
|
|
|
border-style: solid;
|
2024-05-11 09:30:44 +00:00
|
|
|
border-width: ${dt('tabmenu.item.border.width')};
|
|
|
|
border-color: ${dt('tabmenu.item.border.color')};
|
|
|
|
color: ${dt('tabmenu.item.color')};
|
|
|
|
padding: ${dt('tabmenu.item.padding')};
|
|
|
|
font-weight: ${dt('tabmenu.item.font.weight')};
|
2024-05-25 08:18:55 +00:00
|
|
|
transition: background ${dt('tabmenu.transition.duration')}, border-color ${dt('tabmenu.transition.duration')}, color ${dt('tabmenu.transition.duration')}, outline-color ${dt('tabmenu.transition.duration')}, box-shadow ${dt('tabmenu.transition.duration')};
|
2024-05-11 09:30:44 +00:00
|
|
|
margin: ${dt('tabmenu.item.margin')};
|
2024-05-01 08:26:48 +00:00
|
|
|
outline-color: transparent;
|
2024-05-11 09:30:44 +00:00
|
|
|
gap: ${dt('tabmenu.item.gap')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-tabmenu-item-link:focus-visible {
|
2024-05-11 16:45:10 +00:00
|
|
|
z-index: 1;
|
2024-05-11 09:30:44 +00:00
|
|
|
box-shadow: ${dt('tabmenu.item.focus.ring.shadow')};
|
|
|
|
outline: ${dt('tabmenu.item.focus.ring.width')} ${dt('tabmenu.item.focus.ring.style')} ${dt('tabmenu.item.focus.ring.color')};
|
|
|
|
outline-offset: ${dt('tabmenu.item.focus.ring.offset')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-tabmenu-item-icon {
|
2024-05-11 09:30:44 +00:00
|
|
|
color: ${dt('tabmenu.item.icon.color')};
|
2024-05-25 08:18:55 +00:00
|
|
|
transition: background ${dt('tabmenu.transition.duration')}, border-color ${dt('tabmenu.transition.duration')}, color ${dt('tabmenu.transition.duration')}, outline-color ${dt('tabmenu.transition.duration')}, box-shadow ${dt('tabmenu.transition.duration')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-tabmenu-item-label {
|
|
|
|
line-height: 1;
|
|
|
|
}
|
2024-05-11 09:30:44 +00:00
|
|
|
|
2024-05-01 08:26:48 +00:00
|
|
|
.p-tabmenu-item:not(.p-tabmenu-item-active):not(.p-disabled):hover .p-tabmenu-item-link {
|
2024-05-11 09:30:44 +00:00
|
|
|
background: ${dt('tabmenu.item.hover.background')};
|
|
|
|
border-color: ${dt('tabmenu.item.hover.border.color')};
|
|
|
|
color: ${dt('tabmenu.item.hover.color')};
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-tabmenu-item:not(.p-tabmenu-item-active):not(.p-disabled):hover .p-tabmenu-item-icon {
|
|
|
|
color: ${dt('tabmenu.item.icon.hover.color')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-tabmenu-item-active .p-tabmenu-item-link {
|
2024-05-11 09:30:44 +00:00
|
|
|
background: ${dt('tabmenu.item.active.background')};
|
|
|
|
border-color: ${dt('tabmenu.item.active.border.color')};
|
|
|
|
color: ${dt('tabmenu.item.active.color')};
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-tabmenu-item-active .p-tabmenu-item-icon {
|
|
|
|
color: ${dt('tabmenu.item.icon.active.color')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
2024-05-11 09:30:44 +00:00
|
|
|
.p-tabmenu-active-bar {
|
2024-05-01 08:26:48 +00:00
|
|
|
z-index: 1;
|
|
|
|
display: block;
|
|
|
|
position: absolute;
|
2024-05-11 09:30:44 +00:00
|
|
|
bottom: ${dt('tabmenu.active.bar.bottom')};
|
|
|
|
height: ${dt('tabmenu.active.bar.height')};
|
|
|
|
background: ${dt('tabmenu.active.bar.background')};
|
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',
|
2024-05-11 09:30:44 +00:00
|
|
|
activeBar: 'p-tabmenu-active-bar'
|
2023-10-02 10:46:09 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
export default BaseStyle.extend({
|
|
|
|
name: 'tabmenu',
|
2024-05-01 08:26:48 +00:00
|
|
|
theme,
|
2023-10-02 10:46:09 +00:00
|
|
|
classes
|
|
|
|
});
|