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-menu {
|
|
|
|
background: ${dt('menu.background')};
|
|
|
|
color: ${dt('menu.color')};
|
|
|
|
border: 1px solid ${dt('menu.border.color')};
|
2024-05-10 07:23:39 +00:00
|
|
|
border-radius: ${dt('menu.border.radius')};
|
2024-05-01 08:26:48 +00:00
|
|
|
min-width: 12.5rem;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-menu-list {
|
|
|
|
margin: 0;
|
2024-05-10 08:05:59 +00:00
|
|
|
padding: ${dt('menu.list.padding')};
|
|
|
|
outline: 0 none;
|
2024-05-01 08:26:48 +00:00
|
|
|
list-style: none;
|
2024-05-10 07:23:39 +00:00
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
2024-05-10 08:05:59 +00:00
|
|
|
gap: ${dt('menu.list.gap')};
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-menu-item-content {
|
2024-05-25 08:18:55 +00:00
|
|
|
transition: background ${dt('menu.transition.duration')}, color ${dt('menu.transition.duration')};
|
2024-05-10 08:05:59 +00:00
|
|
|
border-radius: ${dt('menu.item.border.radius')};
|
|
|
|
color: ${dt('menu.item.color')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-menu-item-link {
|
|
|
|
cursor: pointer;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
text-decoration: none;
|
|
|
|
overflow: hidden;
|
|
|
|
position: relative;
|
|
|
|
color: inherit;
|
2024-05-10 07:23:39 +00:00
|
|
|
padding: ${dt('menu.item.padding')};
|
|
|
|
gap: ${dt('menu.item.gap')};
|
2024-05-10 08:05:59 +00:00
|
|
|
user-select: none;
|
2024-05-10 07:42:27 +00:00
|
|
|
outline: 0 none;
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-menu-item-label {
|
|
|
|
line-height: 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-menu-item-icon {
|
|
|
|
color: ${dt('menu.item.icon.color')};
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-menu-item.p-focus .p-menu-item-content {
|
2024-05-05 15:51:29 +00:00
|
|
|
color: ${dt('menu.item.focus.color')};
|
|
|
|
background: ${dt('menu.item.focus.background')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-menu-item.p-focus .p-menu-item-icon {
|
2024-05-10 07:23:39 +00:00
|
|
|
color: ${dt('menu.item.icon.focus.color')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-menu-item:not(.p-disabled) .p-menu-item-content:hover {
|
2024-05-05 15:51:29 +00:00
|
|
|
color: ${dt('menu.item.focus.color')};
|
|
|
|
background: ${dt('menu.item.focus.background')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-menu-item:not(.p-disabled) .p-menu-item-content:hover .p-menu-item-icon {
|
2024-05-10 07:23:39 +00:00
|
|
|
color: ${dt('menu.item.icon.focus.color')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-menu-overlay {
|
2024-05-10 07:23:39 +00:00
|
|
|
box-shadow: ${dt('menu.shadow')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-menu-submenu-item {
|
2024-05-10 07:23:39 +00:00
|
|
|
background: ${dt('menu.submenu.label.background')};
|
|
|
|
padding: ${dt('menu.submenu.label.padding')};
|
|
|
|
color: ${dt('menu.submenu.label.color')};
|
|
|
|
font-weight: ${dt('menu.submenu.label.font.weight')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-menu-separator {
|
2024-05-10 07:23:39 +00:00
|
|
|
border-top: 1px solid ${dt('menu.separator.border.color')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
2023-10-02 10:46:09 +00:00
|
|
|
const classes = {
|
2024-05-08 15:58:22 +00:00
|
|
|
root: ({ props }) => [
|
2023-10-02 10:46:09 +00:00
|
|
|
'p-menu p-component',
|
|
|
|
{
|
2024-05-08 15:58:22 +00:00
|
|
|
'p-menu-overlay': props.popup
|
2023-10-02 10:46:09 +00:00
|
|
|
}
|
|
|
|
],
|
|
|
|
start: 'p-menu-start',
|
2024-04-30 13:02:03 +00:00
|
|
|
list: 'p-menu-list',
|
|
|
|
submenuItem: 'p-menu-submenu-item',
|
2024-04-09 11:59:41 +00:00
|
|
|
separator: 'p-menu-separator',
|
2023-10-02 10:46:09 +00:00
|
|
|
end: 'p-menu-end',
|
2024-04-30 13:02:03 +00:00
|
|
|
item: ({ instance }) => [
|
2024-04-09 11:59:41 +00:00
|
|
|
'p-menu-item',
|
2023-10-02 10:46:09 +00:00
|
|
|
{
|
|
|
|
'p-focus': instance.id === instance.focusedOptionId,
|
|
|
|
'p-disabled': instance.disabled()
|
|
|
|
}
|
|
|
|
],
|
2024-04-30 13:02:03 +00:00
|
|
|
itemContent: 'p-menu-item-content',
|
|
|
|
itemLink: 'p-menu-item-link',
|
|
|
|
itemIcon: 'p-menu-item-icon',
|
2024-05-06 13:10:13 +00:00
|
|
|
itemLabel: 'p-menu-item-label'
|
2023-10-02 10:46:09 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
export default BaseStyle.extend({
|
|
|
|
name: 'menu',
|
2024-05-01 08:26:48 +00:00
|
|
|
theme,
|
2023-10-02 10:46:09 +00:00
|
|
|
classes
|
|
|
|
});
|