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-tieredmenu {
|
|
|
|
background: ${dt('tieredmenu.background')};
|
|
|
|
color: ${dt('tieredmenu.color')};
|
|
|
|
border: 1px solid ${dt('tieredmenu.border.color')};
|
2024-05-10 08:05:59 +00:00
|
|
|
border-radius: ${dt('tieredmenu.border.radius')};
|
2024-05-01 08:26:48 +00:00
|
|
|
min-width: 12.5rem;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-tieredmenu-root-list,
|
|
|
|
.p-tieredmenu-submenu {
|
|
|
|
margin: 0;
|
2024-05-10 08:05:59 +00:00
|
|
|
padding: ${dt('tieredmenu.list.padding')};
|
2024-05-01 08:26:48 +00:00
|
|
|
list-style: none;
|
|
|
|
outline: 0 none;
|
2024-05-10 08:05:59 +00:00
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
gap: ${dt('tieredmenu.list.gap')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-tieredmenu-submenu {
|
|
|
|
position: absolute;
|
|
|
|
min-width: 100%;
|
|
|
|
z-index: 1;
|
|
|
|
background: ${dt('tieredmenu.background')};
|
|
|
|
color: ${dt('tieredmenu.color')};
|
|
|
|
border: 1px solid ${dt('tieredmenu.border.color')};
|
2024-05-10 08:05:59 +00:00
|
|
|
border-radius: ${dt('tieredmenu.border.radius')};
|
|
|
|
box-shadow: ${dt('tieredmenu.shadow')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
2024-05-10 08:35:14 +00:00
|
|
|
.p-tieredmenu-item {
|
|
|
|
position: relative;
|
|
|
|
}
|
|
|
|
|
2024-05-01 08:26:48 +00:00
|
|
|
.p-tieredmenu-item-content {
|
2024-05-10 08:05:59 +00:00
|
|
|
transition: background ${dt('transition.duration')}, color ${dt('transition.duration')};
|
|
|
|
border-radius: ${dt('tieredmenu.item.border.radius')};
|
2024-05-01 08:26:48 +00:00
|
|
|
color: ${dt('tieredmenu.item.color')};
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-tieredmenu-item-link {
|
|
|
|
cursor: pointer;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
text-decoration: none;
|
|
|
|
overflow: hidden;
|
|
|
|
position: relative;
|
|
|
|
color: inherit;
|
2024-05-10 08:05:59 +00:00
|
|
|
padding: ${dt('tieredmenu.item.padding')};
|
|
|
|
gap: ${dt('tieredmenu.item.gap')};
|
2024-05-01 08:26:48 +00:00
|
|
|
user-select: none;
|
2024-05-10 08:05:59 +00:00
|
|
|
outline: 0 none;
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-tieredmenu-item-label {
|
|
|
|
line-height: 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-tieredmenu-item-icon {
|
|
|
|
color: ${dt('tieredmenu.item.icon.color')};
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-tieredmenu-submenu-icon {
|
2024-05-10 08:05:59 +00:00
|
|
|
color: ${dt('tieredmenu.submenu.icon.color')};
|
2024-05-01 08:26:48 +00:00
|
|
|
margin-left: auto;
|
2024-05-10 08:05:59 +00:00
|
|
|
font-size: ${dt('tieredmenu.submenu.icon.size')};
|
|
|
|
width: ${dt('tieredmenu.submenu.icon.size')};
|
|
|
|
height: ${dt('tieredmenu.submenu.icon.size')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-tieredmenu-item.p-focus > .p-tieredmenu-item-content {
|
2024-05-05 15:51:29 +00:00
|
|
|
color: ${dt('tieredmenu.item.focus.color')};
|
|
|
|
background: ${dt('tieredmenu.item.focus.background')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
2024-05-10 08:05:59 +00:00
|
|
|
.p-tieredmenu-item.p-focus > .p-tieredmenu-item-content .p-tieredmenu-item-icon {
|
|
|
|
color: ${dt('tieredmenu.item.icon.focus.color')};
|
|
|
|
}
|
|
|
|
|
2024-05-01 08:26:48 +00:00
|
|
|
.p-tieredmenu-item.p-focus > .p-tieredmenu-item-content .p-tieredmenu-submenu-icon {
|
2024-05-10 08:05:59 +00:00
|
|
|
color: ${dt('tieredmenu.submenu.icon.focus.color')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-tieredmenu-item:not(.p-disabled) > .p-tieredmenu-item-content:hover {
|
2024-05-05 15:51:29 +00:00
|
|
|
color: ${dt('tieredmenu.item.focus.color')};
|
|
|
|
background: ${dt('tieredmenu.item.focus.background')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
2024-05-10 08:05:59 +00:00
|
|
|
.p-tieredmenu-item:not(.p-disabled) > .p-tieredmenu-item-content:hover .p-tieredmenu-item-icon {
|
|
|
|
color: ${dt('tieredmenu.item.icon.focus.color')};
|
|
|
|
}
|
|
|
|
|
2024-05-01 08:26:48 +00:00
|
|
|
.p-tieredmenu-item:not(.p-disabled) > .p-tieredmenu-item-content:hover .p-tieredmenu-submenu-icon {
|
2024-05-10 08:05:59 +00:00
|
|
|
color: ${dt('tieredmenu.submenu.icon.focus.color')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-tieredmenu-item-active > .p-tieredmenu-item-content {
|
2024-05-10 08:05:59 +00:00
|
|
|
color: ${dt('tieredmenu.item.active.color')};
|
|
|
|
background: ${dt('tieredmenu.item.active.background')};
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-tieredmenu-item-active > .p-tieredmenu-item-content .p-tieredmenu-item-icon {
|
|
|
|
color: ${dt('tieredmenu.item.icon.active.color')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-tieredmenu-item-active > .p-tieredmenu-item-content .p-tieredmenu-submenu-icon {
|
2024-05-10 08:05:59 +00:00
|
|
|
color: ${dt('tieredmenu.item.icon.active.color')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-tieredmenu-separator {
|
|
|
|
border-top: 1px solid ${dt('tieredmenu.separator.border.color')};
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-tieredmenu-overlay {
|
2024-05-10 08:05:59 +00:00
|
|
|
box-shadow: ${dt('tieredmenu.shadow')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-tieredmenu-enter-from,
|
|
|
|
.p-tieredmenu-leave-active {
|
|
|
|
opacity: 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-tieredmenu-enter-active {
|
|
|
|
transition: opacity 250ms;
|
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
2023-10-02 10:46:09 +00:00
|
|
|
const inlineStyles = {
|
2024-05-10 08:57:09 +00:00
|
|
|
submenu: ({ instance, processedItem }) => ({ display: instance.isItemActive(processedItem) ? 'flex' : 'none' })
|
2023-10-02 10:46:09 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
const classes = {
|
|
|
|
root: ({ instance, props }) => [
|
|
|
|
'p-tieredmenu p-component',
|
|
|
|
{
|
2024-05-08 15:58:22 +00:00
|
|
|
'p-tieredmenu-overlay': props.popup
|
2023-10-02 10:46:09 +00:00
|
|
|
}
|
|
|
|
],
|
2023-11-06 11:54:05 +00:00
|
|
|
start: 'p-tieredmenu-start',
|
2024-04-30 13:03:20 +00:00
|
|
|
rootList: 'p-tieredmenu-root-list',
|
|
|
|
item: ({ instance, processedItem }) => [
|
2024-04-09 13:11:24 +00:00
|
|
|
'p-tieredmenu-item',
|
2023-10-02 10:46:09 +00:00
|
|
|
{
|
2024-04-09 13:11:24 +00:00
|
|
|
'p-tieredmenu-item-active': instance.isItemActive(processedItem),
|
2023-10-02 10:46:09 +00:00
|
|
|
'p-focus': instance.isItemFocused(processedItem),
|
|
|
|
'p-disabled': instance.isItemDisabled(processedItem)
|
|
|
|
}
|
|
|
|
],
|
2024-04-30 13:03:20 +00:00
|
|
|
itemContent: 'p-tieredmenu-item-content',
|
|
|
|
itemLink: 'p-tieredmenu-item-link',
|
|
|
|
itemIcon: 'p-tieredmenu-item-icon',
|
|
|
|
itemLabel: 'p-tieredmenu-item-label',
|
2024-04-09 13:11:24 +00:00
|
|
|
submenuIcon: 'p-tieredmenu-submenu-icon',
|
2024-04-09 13:43:12 +00:00
|
|
|
submenu: 'p-tieredmenu-submenu',
|
2024-04-09 13:11:24 +00:00
|
|
|
separator: 'p-tieredmenu-separator',
|
2023-11-06 11:54:05 +00:00
|
|
|
end: 'p-tieredmenu-end'
|
2023-10-02 10:46:09 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
export default BaseStyle.extend({
|
|
|
|
name: 'tieredmenu',
|
2024-05-01 08:26:48 +00:00
|
|
|
theme,
|
2023-10-02 10:46:09 +00:00
|
|
|
classes,
|
|
|
|
inlineStyles
|
|
|
|
});
|