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 {
|
2024-05-10 07:23:39 +00:00
|
|
|
padding: ${dt('menu.padding')};
|
2024-05-01 08:26:48 +00:00
|
|
|
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;
|
|
|
|
padding: 0;
|
2024-05-02 10:56:41 +00:00
|
|
|
outline: 0;
|
2024-05-01 08:26:48 +00:00
|
|
|
list-style: none;
|
2024-05-10 07:23:39 +00:00
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
gap: ${dt('menu.gap')};
|
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')};
|
2024-05-01 08:26:48 +00:00
|
|
|
user-select: none;
|
2024-05-10 07:23:39 +00:00
|
|
|
gap: ${dt('menu.item.gap')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-menu-item-content {
|
2024-05-10 07:23:39 +00:00
|
|
|
transition: background ${dt('transition.duration')}, color ${dt('transition.duration')};
|
|
|
|
border-radius: ${dt('menu.item.border.radius')};
|
2024-05-01 08:26:48 +00:00
|
|
|
color: ${dt('menu.item.color')};
|
|
|
|
}
|
|
|
|
|
|
|
|
.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
|
|
|
|
});
|