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-panelmenu {
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
2024-05-11 12:42:19 +00:00
|
|
|
gap: ${dt('panelmenu.gap')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-panelmenu-panel {
|
|
|
|
background: ${dt('panelmenu.panel.background')};
|
2024-05-11 12:42:19 +00:00
|
|
|
border-width: ${dt('panelmenu.panel.border.width')};
|
|
|
|
border-style: solid;
|
|
|
|
border-color: ${dt('panelmenu.panel.border.color')};
|
2024-05-01 08:26:48 +00:00
|
|
|
color: ${dt('panelmenu.panel.color')};
|
2024-05-11 12:42:19 +00:00
|
|
|
border-radius: ${dt('panelmenu.panel.border.radius')};
|
|
|
|
padding: ${dt('panelmenu.panel.padding')};
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-panelmenu-panel:first-child {
|
|
|
|
border-width: ${dt('panelmenu.panel.first.border.width')};
|
|
|
|
border-top-left-radius: ${dt('panelmenu.panel.first.top.border.radius')};
|
|
|
|
border-top-right-radius: ${dt('panelmenu.panel.first.top.border.radius')};
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-panelmenu-panel:last-child {
|
|
|
|
border-width: ${dt('panelmenu.panel.last.border.width')};
|
|
|
|
border-bottom-left-radius: ${dt('panelmenu.panel.last.bottom.border.radius')};
|
|
|
|
border-bottom-right-radius: ${dt('panelmenu.panel.last.bottom.border.radius')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-panelmenu-header {
|
|
|
|
outline: 0 none;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-panelmenu-header-content {
|
2024-05-11 12:42:19 +00:00
|
|
|
border-radius: ${dt('panelmenu.item.border.radius')};
|
|
|
|
transition: background ${dt('transition.duration')}, color ${dt('transition.duration')}, outline-color ${dt('transition.duration')}, box-shadow ${dt('transition.duration')};
|
2024-05-01 08:26:48 +00:00
|
|
|
outline-color: transparent;
|
2024-05-11 12:42:19 +00:00
|
|
|
color: ${dt('panelmenu.item.color')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-panelmenu-header-link {
|
|
|
|
display: flex;
|
2024-05-11 12:42:19 +00:00
|
|
|
gap: ${dt('panelmenu.item.gap')};
|
|
|
|
padding: ${dt('panelmenu.item.padding')};
|
2024-05-01 08:26:48 +00:00
|
|
|
align-items: center;
|
|
|
|
user-select: none;
|
|
|
|
cursor: pointer;
|
|
|
|
position: relative;
|
|
|
|
text-decoration: none;
|
|
|
|
color: inherit;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-panelmenu-header-icon,
|
2024-05-11 12:42:19 +00:00
|
|
|
.p-panelmenu-item-icon {
|
2024-05-01 08:26:48 +00:00
|
|
|
color: ${dt('panelmenu.item.icon.color')};
|
|
|
|
}
|
|
|
|
|
2024-05-11 12:42:19 +00:00
|
|
|
.p-panelmenu-submenu-icon {
|
|
|
|
color: ${dt('panelmenu.submenu.icon.color')};
|
|
|
|
}
|
|
|
|
|
2024-05-01 08:26:48 +00:00
|
|
|
.p-panelmenu-header:not(.p-disabled):focus-visible .p-panelmenu-header-content {
|
2024-05-05 15:51:29 +00:00
|
|
|
background: ${dt('panelmenu.item.focus.background')};
|
|
|
|
color: ${dt('panelmenu.item.focus.color')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-panelmenu-header:not(.p-disabled):focus-visible .p-panelmenu-header-content .p-panelmenu-header-icon {
|
2024-05-11 12:42:19 +00:00
|
|
|
color: ${dt('panelmenu.item.icon.focus.color')};
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-panelmenu-header:not(.p-disabled):focus-visible .p-panelmenu-header-content .p-panelmenu-submenu-icon {
|
|
|
|
color: ${dt('panelmenu.submenu.icon.focus.color')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-panelmenu-header:not(.p-disabled) .p-panelmenu-header-content:hover {
|
2024-05-05 15:51:29 +00:00
|
|
|
background: ${dt('panelmenu.item.focus.background')};
|
|
|
|
color: ${dt('panelmenu.item.focus.color')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-panelmenu-header:not(.p-disabled) .p-panelmenu-header-content:hover .p-panelmenu-header-icon {
|
2024-05-11 12:42:19 +00:00
|
|
|
color: ${dt('panelmenu.item.icon.focus.color')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
2024-05-11 12:42:19 +00:00
|
|
|
.p-panelmenu-header:not(.p-disabled) .p-panelmenu-header-content:hover .p-panelmenu-submenu-icon {
|
|
|
|
color: ${dt('panelmenu.submenu.icon.focus.color')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-panelmenu-submenu {
|
2024-05-11 12:42:19 +00:00
|
|
|
margin: 0;
|
|
|
|
padding: 0 0 0 ${dt('panelmenu.submenu.indent')};
|
2024-05-02 10:56:41 +00:00
|
|
|
outline: 0;
|
2024-05-01 08:26:48 +00:00
|
|
|
list-style: none;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-panelmenu-item-link {
|
|
|
|
display: flex;
|
2024-05-11 12:42:19 +00:00
|
|
|
gap: ${dt('panelmenu.item.gap')};
|
|
|
|
padding: ${dt('panelmenu.item.padding')};
|
2024-05-01 08:26:48 +00:00
|
|
|
align-items: center;
|
|
|
|
user-select: none;
|
|
|
|
cursor: pointer;
|
|
|
|
text-decoration: none;
|
|
|
|
color: inherit;
|
|
|
|
position: relative;
|
|
|
|
overflow: hidden;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-panelmenu-item-label {
|
|
|
|
line-height: 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
.p-panelmenu-item-content {
|
2024-05-11 12:42:19 +00:00
|
|
|
border-radius: ${dt('panelmenu.item.border.radius')};
|
|
|
|
transition: background ${dt('transition.duration')}, color ${dt('transition.duration')}, outline-color ${dt('transition.duration')}, box-shadow ${dt('transition.duration')};
|
2024-05-01 08:26:48 +00:00
|
|
|
color: ${dt('panelmenu.item.color')};
|
2024-05-11 12:42:19 +00:00
|
|
|
outline-color: transparent;
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-panelmenu-item.p-focus > .p-panelmenu-item-content {
|
2024-05-05 15:51:29 +00:00
|
|
|
background: ${dt('panelmenu.item.focus.background')};
|
|
|
|
color: ${dt('panelmenu.item.focus.color')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.p-panelmenu-item.p-focus > .p-panelmenu-item-icon {
|
2024-05-05 15:51:29 +00:00
|
|
|
color: ${dt('panelmenu.item.focus.color')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
2024-05-11 12:42:19 +00:00
|
|
|
.p-panelmenu-item.p-focus > .p-panelmenu-submenu-icon {
|
|
|
|
color: ${dt('panelmenu.submenu.icon.focus.color')};
|
|
|
|
}
|
|
|
|
|
2024-05-01 08:26:48 +00:00
|
|
|
.p-panelmenu-item:not(.p-disabled) > .p-panelmenu-item-content:hover {
|
2024-05-05 15:51:29 +00:00
|
|
|
background: ${dt('panelmenu.item.focus.background')};
|
|
|
|
color: ${dt('panelmenu.item.focus.color')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
|
2024-05-11 12:42:19 +00:00
|
|
|
.p-panelmenu-item:not(.p-disabled) > .p-panelmenu-item-content:hover .p-panelmenu-item-icon {
|
|
|
|
color: ${dt('panelmenu.item.icon.focus.color')};
|
|
|
|
}
|
|
|
|
|
2024-05-01 08:26:48 +00:00
|
|
|
.p-panelmenu-item:not(.p-disabled) > .p-panelmenu-item-content:hover .p-panelmenu-submenu-icon {
|
2024-05-11 12:42:19 +00:00
|
|
|
color: ${dt('panelmenu.submenu.icon.focus.color')};
|
2024-05-01 08:26:48 +00:00
|
|
|
}
|
|
|
|
`;
|
|
|
|
|
2023-10-02 10:46:09 +00:00
|
|
|
const classes = {
|
|
|
|
root: 'p-panelmenu p-component',
|
|
|
|
panel: 'p-panelmenu-panel',
|
|
|
|
header: ({ instance, item }) => [
|
|
|
|
'p-panelmenu-header',
|
|
|
|
{
|
2024-04-09 14:27:13 +00:00
|
|
|
'p-panelmenu-header-active': instance.isItemActive(item) && !!item.items,
|
2023-10-02 10:46:09 +00:00
|
|
|
'p-disabled': instance.isItemDisabled(item)
|
|
|
|
}
|
|
|
|
],
|
|
|
|
headerContent: 'p-panelmenu-header-content',
|
2024-04-30 13:03:20 +00:00
|
|
|
headerLink: 'p-panelmenu-header-link',
|
2024-04-09 14:27:13 +00:00
|
|
|
headerIcon: 'p-panelmenu-header-icon',
|
|
|
|
headerLabel: 'p-panelmenu-header-label',
|
2024-04-30 13:03:20 +00:00
|
|
|
contentContainer: 'p-panelmenu-content-container',
|
|
|
|
content: 'p-panelmenu-content',
|
|
|
|
rootList: 'p-panelmenu-root-list',
|
|
|
|
item: ({ instance, processedItem }) => [
|
2024-04-09 14:27:13 +00:00
|
|
|
'p-panelmenu-item',
|
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-panelmenu-item-content',
|
|
|
|
itemLink: 'p-panelmenu-item-link',
|
|
|
|
itemIcon: 'p-panelmenu-item-icon',
|
2024-05-06 13:10:13 +00:00
|
|
|
itemLabel: 'p-panelmenu-item-label',
|
2024-04-09 14:27:13 +00:00
|
|
|
submenuIcon: 'p-panelmenu-submenu-icon',
|
|
|
|
submenu: 'p-panelmenu-submenu',
|
2023-10-02 10:46:09 +00:00
|
|
|
separator: 'p-menuitem-separator'
|
|
|
|
};
|
|
|
|
|
|
|
|
export default BaseStyle.extend({
|
|
|
|
name: 'panelmenu',
|
2024-05-01 08:26:48 +00:00
|
|
|
theme,
|
2023-10-02 10:46:09 +00:00
|
|
|
classes
|
|
|
|
});
|